@univerjs/core 0.6.0-alpha.0 → 0.6.0-experimental.20250212-dbe9830

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 (95) hide show
  1. package/lib/cjs/index.js +10 -10
  2. package/lib/es/index.js +6103 -5508
  3. package/lib/types/common/array.d.ts +1 -1
  4. package/lib/types/common/boolean.d.ts +1 -1
  5. package/lib/types/common/const.d.ts +1 -1
  6. package/lib/types/common/di.d.ts +0 -1
  7. package/lib/types/common/equal.d.ts +2 -2
  8. package/lib/types/common/error.d.ts +1 -1
  9. package/lib/types/common/function.d.ts +1 -1
  10. package/lib/types/common/json.d.ts +1 -1
  11. package/lib/types/common/memory-cursor.d.ts +1 -1
  12. package/lib/types/common/mixin.d.ts +1 -1
  13. package/lib/types/common/number.d.ts +1 -1
  14. package/lib/types/common/registry.d.ts +1 -1
  15. package/lib/types/common/request-immediate-macro-task.d.ts +1 -1
  16. package/lib/types/common/sequence.d.ts +1 -1
  17. package/lib/types/common/set.d.ts +1 -1
  18. package/lib/types/common/shims.d.ts +1 -1
  19. package/lib/types/common/url.d.ts +1 -1
  20. package/lib/types/docs/data-model/index.d.ts +1 -1
  21. package/lib/types/docs/data-model/subdocument.d.ts +1 -1
  22. package/lib/types/docs/data-model/text-x/build-utils/__test__/custom-range.spec.d.ts +1 -1
  23. package/lib/types/docs/data-model/text-x/build-utils/__test__/selection.spec.d.ts +1 -1
  24. package/lib/types/docs/data-model/text-x/build-utils/__test__/{textX.d.ts → text-x.d.ts} +1 -1
  25. package/lib/types/docs/data-model/types.d.ts +1 -1
  26. package/lib/types/docs/index.d.ts +1 -1
  27. package/lib/types/facade/f-event-registry.d.ts +36 -0
  28. package/lib/types/facade/f-univer.d.ts +22 -13
  29. package/lib/types/index.d.ts +7 -3
  30. package/lib/types/services/context/context.d.ts +1 -1
  31. package/lib/types/services/lifecycle/lifecycle.d.ts +1 -1
  32. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  33. package/lib/types/services/log/context.d.ts +1 -1
  34. package/lib/types/services/resource-manager/resource-manager.service.d.ts +1 -1
  35. package/lib/types/services/user-manager/user-manager.service.d.ts +1 -1
  36. package/lib/types/shared/array-search.d.ts +1 -1
  37. package/lib/types/shared/blob.d.ts +1 -1
  38. package/lib/types/shared/coder.d.ts +1 -1
  39. package/lib/types/shared/color/color-kit.d.ts +1 -1
  40. package/lib/types/shared/command-enum.d.ts +1 -1
  41. package/lib/types/shared/generate.d.ts +1 -1
  42. package/lib/types/shared/hash-algorithm.d.ts +1 -1
  43. package/lib/types/shared/index.d.ts +1 -1
  44. package/lib/types/shared/locale.d.ts +1 -1
  45. package/lib/types/shared/name.d.ts +1 -1
  46. package/lib/types/shared/object-matrix.d.ts +0 -1
  47. package/lib/types/shared/ref-alias.d.ts +1 -1
  48. package/lib/types/shared/row-col-iter.d.ts +1 -1
  49. package/lib/types/shared/sequence.d.ts +1 -1
  50. package/lib/types/shared/shape.d.ts +1 -1
  51. package/lib/types/shared/sort-rules.d.ts +3 -3
  52. package/lib/types/shared/text-diff.d.ts +1 -1
  53. package/lib/types/shared/timer.d.ts +1 -1
  54. package/lib/types/shared/types/numfmt.type.d.ts +1 -1
  55. package/lib/types/shared/types.d.ts +1 -1
  56. package/lib/types/sheets/sheet-skeleton.d.ts +297 -0
  57. package/lib/types/sheets/typedef.d.ts +3 -3
  58. package/lib/types/sheets/util.d.ts +4 -0
  59. package/lib/types/skeleton.d.ts +14 -0
  60. package/lib/types/types/const/clipboard.d.ts +1 -1
  61. package/lib/types/types/const/extension-names.d.ts +1 -1
  62. package/lib/types/types/const/index.d.ts +1 -1
  63. package/lib/types/types/const/theme-color-map.d.ts +1 -1
  64. package/lib/types/types/enum/auto-fill-series.d.ts +1 -1
  65. package/lib/types/types/enum/border-style-types.d.ts +1 -1
  66. package/lib/types/types/enum/color-type.d.ts +1 -1
  67. package/lib/types/types/enum/common-hide-types.d.ts +1 -1
  68. package/lib/types/types/enum/copy-paste-type.d.ts +1 -1
  69. package/lib/types/types/enum/data-validation-error-style.d.ts +1 -1
  70. package/lib/types/types/enum/data-validation-ime-mode.d.ts +1 -1
  71. package/lib/types/types/enum/data-validation-operator.d.ts +1 -1
  72. package/lib/types/types/enum/data-validation-render-mode.d.ts +1 -1
  73. package/lib/types/types/enum/data-validation-status.d.ts +1 -1
  74. package/lib/types/types/enum/data-validation-type.d.ts +1 -1
  75. package/lib/types/types/enum/delete-direction.d.ts +1 -1
  76. package/lib/types/types/enum/developer-metadata-visibility.d.ts +1 -1
  77. package/lib/types/types/enum/dimension.d.ts +1 -1
  78. package/lib/types/types/enum/direction.d.ts +1 -1
  79. package/lib/types/types/enum/group-control-toggle-position.d.ts +1 -1
  80. package/lib/types/types/enum/index.d.ts +1 -1
  81. package/lib/types/types/enum/interpolation-point-type.d.ts +1 -1
  82. package/lib/types/types/enum/locale-type.d.ts +1 -1
  83. package/lib/types/types/enum/mention-type.d.ts +1 -1
  84. package/lib/types/types/enum/place-holder-type.d.ts +1 -1
  85. package/lib/types/types/enum/protection-type.d.ts +1 -1
  86. package/lib/types/types/enum/prst-geom-type.d.ts +1 -1
  87. package/lib/types/types/enum/relative-date.d.ts +1 -1
  88. package/lib/types/types/enum/sheet-types.d.ts +1 -1
  89. package/lib/types/types/enum/text-style.d.ts +1 -1
  90. package/lib/types/types/enum/theme-color-type.d.ts +1 -1
  91. package/lib/types/types/interfaces/i-image-properties.d.ts +1 -1
  92. package/lib/types/types/interfaces/index.d.ts +1 -1
  93. package/lib/umd/index.js +10 -10
  94. package/package.json +3 -4
  95. package/LICENSE +0 -176
package/lib/cjs/index.js CHANGED
@@ -1,12 +1,12 @@
1
- "use strict";var lh=Object.defineProperty;var uh=(e,t,n)=>t in e?lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>uh(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("rxjs"),Br=require("rxjs/operators"),lt=require("react");function ch(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}function hh(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const wt=ch(lt);function dh(){fh()}const br=typeof global<"u"?global:typeof self<"u"?self:window;function fh(){typeof br.requestIdleCallback!="function"&&(br.requestIdleCallback=function(n){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));n({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof br.cancelIdleCallback!="function"&&(br.cancelIdleCallback=function(n){clearTimeout(n)})}var Qa=typeof global=="object"&&global&&global.Object===Object&&global,gh=typeof self=="object"&&self&&self.Object===Object&&self,Cn=Qa||gh||Function("return this")(),Ln=Cn.Symbol,Ja=Object.prototype,ph=Ja.hasOwnProperty,mh=Ja.toString,Kn=Ln?Ln.toStringTag:void 0;function _h(e){var t=ph.call(e,Kn),n=e[Kn];try{e[Kn]=void 0;var r=!0}catch{}var s=mh.call(e);return r&&(t?e[Kn]=n:delete e[Kn]),s}var Eh=Object.prototype,Ch=Eh.toString;function Rh(e){return Ch.call(e)}var Ih="[object Null]",vh="[object Undefined]",wo=Ln?Ln.toStringTag:void 0;function pr(e){return e==null?e===void 0?vh:Ih:wo&&wo in Object(e)?_h(e):Rh(e)}function Bn(e){return e!=null&&typeof e=="object"}var yh="[object Symbol]";function ms(e){return typeof e=="symbol"||Bn(e)&&pr(e)==yh}function Sh(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Un=Array.isArray,Ao=Ln?Ln.prototype:void 0,To=Ao?Ao.toString:void 0;function qa(e){if(typeof e=="string")return e;if(Un(e))return Sh(e,qa)+"";if(ms(e))return To?To.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Oh=/\s/;function bh(e){for(var t=e.length;t--&&Oh.test(e.charAt(t)););return t}var wh=/^\s+/;function Ah(e){return e&&e.slice(0,bh(e)+1).replace(wh,"")}function yt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var No=NaN,Th=/^[-+]0x[0-9a-f]+$/i,Nh=/^0b[01]+$/i,Mh=/^0o[0-7]+$/i,Dh=parseInt;function Mo(e){if(typeof e=="number")return e;if(ms(e))return No;if(yt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ah(e);var n=Nh.test(e);return n||Mh.test(e)?Dh(e.slice(2),n?2:8):Th.test(e)?No:+e}function Za(e){return e}var xh="[object AsyncFunction]",Lh="[object Function]",Uh="[object GeneratorFunction]",Ph="[object Proxy]";function bi(e){if(!yt(e))return!1;var t=pr(e);return t==Lh||t==Uh||t==xh||t==Ph}var As=Cn["__core-js_shared__"],Do=function(){var e=/[^.]+$/.exec(As&&As.keys&&As.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Fh(e){return!!Do&&Do in e}var kh=Function.prototype,$h=kh.toString;function Bh(e){if(e!=null){try{return $h.call(e)}catch{}try{return e+""}catch{}}return""}var jh=/[\\^$.*+?()[\]{}|]/g,Hh=/^\[object .+?Constructor\]$/,Wh=Function.prototype,zh=Object.prototype,Yh=Wh.toString,Vh=zh.hasOwnProperty,Gh=RegExp("^"+Yh.call(Vh).replace(jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kh(e){if(!yt(e)||Fh(e))return!1;var t=bi(e)?Gh:Hh;return t.test(Bh(e))}function Xh(e,t){return e==null?void 0:e[t]}function wi(e,t){var n=Xh(e,t);return Kh(n)?n:void 0}var xo=Object.create,Qh=function(){function e(){}return function(t){if(!yt(t))return{};if(xo)return xo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Jh(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function qh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Zh=800,ed=16,td=Date.now;function nd(e){var t=0,n=0;return function(){var r=td(),s=ed-(r-n);if(n=r,s>0){if(++t>=Zh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function rd(e){return function(){return e}}var ts=function(){try{var e=wi(Object,"defineProperty");return e({},"",{}),e}catch{}}(),sd=ts?function(e,t){return ts(e,"toString",{configurable:!0,enumerable:!1,value:rd(t),writable:!0})}:Za,id=nd(sd),od=9007199254740991,ad=/^(?:0|[1-9]\d*)$/;function Ai(e,t){var n=typeof e;return t=t==null?od:t,!!t&&(n=="number"||n!="symbol"&&ad.test(e))&&e>-1&&e%1==0&&e<t}function Ti(e,t,n){t=="__proto__"&&ts?ts(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _s(e,t){return e===t||e!==e&&t!==t}var ld=Object.prototype,ud=ld.hasOwnProperty;function el(e,t,n){var r=e[t];(!(ud.call(e,t)&&_s(r,n))||n===void 0&&!(t in e))&&Ti(e,t,n)}function cd(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?Ti(n,a,l):el(n,a,l)}return n}var Lo=Math.max;function hd(e,t,n){return t=Lo(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Lo(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),Jh(e,this,a)}}function dd(e,t){return id(hd(e,t,Za),e+"")}var fd=9007199254740991;function tl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fd}function Ni(e){return e!=null&&tl(e.length)&&!bi(e)}function gd(e,t,n){if(!yt(n))return!1;var r=typeof t;return(r=="number"?Ni(n)&&Ai(t,n.length):r=="string"&&t in n)?_s(n[t],e):!1}function nl(e){return dd(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&gd(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var pd=Object.prototype;function rl(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||pd;return e===n}function md(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _d="[object Arguments]";function Uo(e){return Bn(e)&&pr(e)==_d}var sl=Object.prototype,Ed=sl.hasOwnProperty,Cd=sl.propertyIsEnumerable,Ys=Uo(function(){return arguments}())?Uo:function(e){return Bn(e)&&Ed.call(e,"callee")&&!Cd.call(e,"callee")};function Rd(){return!1}var il=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Po=il&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Po&&Po.exports===il,Fo=Id?Cn.Buffer:void 0,vd=Fo?Fo.isBuffer:void 0,ol=vd||Rd,yd="[object Arguments]",Sd="[object Array]",Od="[object Boolean]",bd="[object Date]",wd="[object Error]",Ad="[object Function]",Td="[object Map]",Nd="[object Number]",Md="[object Object]",Dd="[object RegExp]",xd="[object Set]",Ld="[object String]",Ud="[object WeakMap]",Pd="[object ArrayBuffer]",Fd="[object DataView]",kd="[object Float32Array]",$d="[object Float64Array]",Bd="[object Int8Array]",jd="[object Int16Array]",Hd="[object Int32Array]",Wd="[object Uint8Array]",zd="[object Uint8ClampedArray]",Yd="[object Uint16Array]",Vd="[object Uint32Array]",qe={};qe[kd]=qe[$d]=qe[Bd]=qe[jd]=qe[Hd]=qe[Wd]=qe[zd]=qe[Yd]=qe[Vd]=!0;qe[yd]=qe[Sd]=qe[Pd]=qe[Od]=qe[Fd]=qe[bd]=qe[wd]=qe[Ad]=qe[Td]=qe[Nd]=qe[Md]=qe[Dd]=qe[xd]=qe[Ld]=qe[Ud]=!1;function Gd(e){return Bn(e)&&tl(e.length)&&!!qe[pr(e)]}function Kd(e){return function(t){return e(t)}}var al=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ar=al&&typeof module=="object"&&module&&!module.nodeType&&module,Xd=ar&&ar.exports===al,Ts=Xd&&Qa.process,ko=function(){try{var e=ar&&ar.require&&ar.require("util").types;return e||Ts&&Ts.binding&&Ts.binding("util")}catch{}}(),$o=ko&&ko.isTypedArray,ll=$o?Kd($o):Gd;function Qd(e,t){var n=Un(e),r=!n&&Ys(e),s=!n&&!r&&ol(e),i=!n&&!r&&!s&&ll(e),o=n||r||s||i,a=o?md(e.length,String):[],l=a.length;for(var u in e)o&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ai(u,l))||a.push(u);return a}function Jd(e,t){return function(n){return e(t(n))}}function qd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Zd=Object.prototype,ef=Zd.hasOwnProperty;function tf(e){if(!yt(e))return qd(e);var t=rl(e),n=[];for(var r in e)r=="constructor"&&(t||!ef.call(e,r))||n.push(r);return n}function ul(e){return Ni(e)?Qd(e):tf(e)}var nf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rf=/^\w*$/;function sf(e,t){if(Un(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ms(e)?!0:rf.test(e)||!nf.test(e)||t!=null&&e in Object(t)}var hr=wi(Object,"create");function of(){this.__data__=hr?hr(null):{},this.size=0}function af(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var lf="__lodash_hash_undefined__",uf=Object.prototype,cf=uf.hasOwnProperty;function hf(e){var t=this.__data__;if(hr){var n=t[e];return n===lf?void 0:n}return cf.call(t,e)?t[e]:void 0}var df=Object.prototype,ff=df.hasOwnProperty;function gf(e){var t=this.__data__;return hr?t[e]!==void 0:ff.call(t,e)}var pf="__lodash_hash_undefined__";function mf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hr&&t===void 0?pf:t,this}function mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=of;mn.prototype.delete=af;mn.prototype.get=hf;mn.prototype.has=gf;mn.prototype.set=mf;function _f(){this.__data__=[],this.size=0}function Es(e,t){for(var n=e.length;n--;)if(_s(e[n][0],t))return n;return-1}var Ef=Array.prototype,Cf=Ef.splice;function Rf(e){var t=this.__data__,n=Es(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Cf.call(t,n,1),--this.size,!0}function If(e){var t=this.__data__,n=Es(t,e);return n<0?void 0:t[n][1]}function vf(e){return Es(this.__data__,e)>-1}function yf(e,t){var n=this.__data__,r=Es(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gt.prototype.clear=_f;Gt.prototype.delete=Rf;Gt.prototype.get=If;Gt.prototype.has=vf;Gt.prototype.set=yf;var cl=wi(Cn,"Map");function Sf(){this.size=0,this.__data__={hash:new mn,map:new(cl||Gt),string:new mn}}function Of(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Cs(e,t){var n=e.__data__;return Of(t)?n[typeof t=="string"?"string":"hash"]:n.map}function bf(e){var t=Cs(this,e).delete(e);return this.size-=t?1:0,t}function wf(e){return Cs(this,e).get(e)}function Af(e){return Cs(this,e).has(e)}function Tf(e,t){var n=Cs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=Sf;ln.prototype.delete=bf;ln.prototype.get=wf;ln.prototype.has=Af;ln.prototype.set=Tf;var Nf="Expected a function";function Mi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Nf);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Mi.Cache||ln),n}Mi.Cache=ln;var Mf=500;function Df(e){var t=Mi(e,function(r){return n.size===Mf&&n.clear(),r}),n=t.cache;return t}var xf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lf=/\\(\\)?/g,Uf=Df(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(xf,function(n,r,s,i){t.push(s?i.replace(Lf,"$1"):r||n)}),t});function Pf(e){return e==null?"":qa(e)}function hl(e,t){return Un(e)?e:sf(e,t)?[e]:Uf(Pf(e))}function dl(e){if(typeof e=="string"||ms(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ff(e,t){t=hl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[dl(t[n++])];return n&&n==r?e:void 0}function kf(e,t,n){var r=e==null?void 0:Ff(e,t);return r===void 0?n:r}var fl=Jd(Object.getPrototypeOf,Object),$f="[object Object]",Bf=Function.prototype,jf=Object.prototype,gl=Bf.toString,Hf=jf.hasOwnProperty,Wf=gl.call(Object);function zf(e){if(!Bn(e)||pr(e)!=$f)return!1;var t=fl(e);if(t===null)return!0;var n=Hf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&gl.call(n)==Wf}function Yf(){this.__data__=new Gt,this.size=0}function Vf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Gf(e){return this.__data__.get(e)}function Kf(e){return this.__data__.has(e)}var Xf=200;function Qf(e,t){var n=this.__data__;if(n instanceof Gt){var r=n.__data__;if(!cl||r.length<Xf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ln(r)}return n.set(e,t),this.size=n.size,this}function jn(e){var t=this.__data__=new Gt(e);this.size=t.size}jn.prototype.clear=Yf;jn.prototype.delete=Vf;jn.prototype.get=Gf;jn.prototype.has=Kf;jn.prototype.set=Qf;var pl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bo=pl&&typeof module=="object"&&module&&!module.nodeType&&module,Jf=Bo&&Bo.exports===pl,jo=Jf?Cn.Buffer:void 0;jo&&jo.allocUnsafe;function qf(e,t){return e.slice()}var Ho=Cn.Uint8Array;function Zf(e){var t=new e.constructor(e.byteLength);return new Ho(t).set(new Ho(e)),t}function eg(e,t){var n=Zf(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function tg(e){return typeof e.constructor=="function"&&!rl(e)?Qh(fl(e)):{}}function ng(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var rg=ng(),Ns=function(){return Cn.Date.now()},sg="Expected a function",ig=Math.max,og=Math.min;function ag(e,t,n){var r,s,i,o,a,l,u=0,h=!1,c=!1,d=!0;if(typeof e!="function")throw new TypeError(sg);t=Mo(t)||0,yt(n)&&(h=!!n.leading,c="maxWait"in n,i=c?ig(Mo(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(A){var H=r,J=s;return r=s=void 0,u=A,o=e.apply(J,H),o}function E(A){return u=A,a=setTimeout(U,t),h?f(A):o}function R(A){var H=A-l,J=A-u,fe=t-H;return c?og(fe,i-J):fe}function O(A){var H=A-l,J=A-u;return l===void 0||H>=t||H<0||c&&J>=i}function U(){var A=Ns();if(O(A))return ne(A);a=setTimeout(U,R(A))}function ne(A){return a=void 0,d&&r?f(A):(r=s=void 0,o)}function X(){a!==void 0&&clearTimeout(a),u=0,r=l=s=a=void 0}function de(){return a===void 0?o:ne(Ns())}function N(){var A=Ns(),H=O(A);if(r=arguments,s=this,l=A,H){if(a===void 0)return E(l);if(c)return clearTimeout(a),a=setTimeout(U,t),f(l)}return a===void 0&&(a=setTimeout(U,t)),o}return N.cancel=X,N.flush=de,N}function Vs(e,t,n){(n!==void 0&&!_s(e[t],n)||n===void 0&&!(t in e))&&Ti(e,t,n)}function lg(e){return Bn(e)&&Ni(e)}function Gs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function ug(e){return cd(e,ul(e))}function cg(e,t,n,r,s,i,o){var a=Gs(e,n),l=Gs(t,n),u=o.get(l);if(u){Vs(e,n,u);return}var h=i?i(a,l,n+"",e,t,o):void 0,c=h===void 0;if(c){var d=Un(l),f=!d&&ol(l),E=!d&&!f&&ll(l);h=l,d||f||E?Un(a)?h=a:lg(a)?h=qh(a):f?(c=!1,h=qf(l)):E?(c=!1,h=eg(l)):h=[]:zf(l)||Ys(l)?(h=a,Ys(a)?h=ug(a):(!yt(a)||bi(a))&&(h=tg(l))):c=!1}c&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Vs(e,n,h)}function Di(e,t,n,r,s){e!==t&&rg(t,function(i,o){if(s||(s=new jn),yt(i))cg(e,t,o,n,Di,r,s);else{var a=r?r(Gs(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Vs(e,o,a)}},ul)}var hg=nl(function(e,t,n,r){Di(e,t,n,r)}),xi=nl(function(e,t,n){Di(e,t,n)});function dg(e,t,n,r){if(!yt(e))return e;t=hl(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=dl(t[s]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];u=void 0,u===void 0&&(u=yt(h)?h:Ai(t[s+1])?[]:{})}el(a,l,u),a=a[l]}return e}function fg(e,t,n){return e==null?e:dg(e,t,n)}function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ms,Wo;function gg(){if(Wo)return Ms;Wo=1;var e=-1,t=1,n=0;function r(m,j,y,M,b){if(m===j)return m?[[n,m]]:[];if(y!=null){var S=fe(m,j,y);if(S)return S}var F=a(m,j),$=m.substring(0,F);m=m.substring(F),j=j.substring(F),F=u(m,j);var Y=m.substring(m.length-F);m=m.substring(0,m.length-F),j=j.substring(0,j.length-F);var se=s(m,j);return $&&se.unshift([n,$]),Y&&se.push([n,Y]),ne(se,b),M&&c(se),se}function s(m,j){var y;if(!m)return[[t,j]];if(!j)return[[e,m]];var M=m.length>j.length?m:j,b=m.length>j.length?j:m,S=M.indexOf(b);if(S!==-1)return y=[[t,M.substring(0,S)],[n,b],[t,M.substring(S+b.length)]],m.length>j.length&&(y[0][0]=y[2][0]=e),y;if(b.length===1)return[[e,m],[t,j]];var F=h(m,j);if(F){var $=F[0],Y=F[1],se=F[2],he=F[3],ge=F[4],Te=r($,se),we=r(Y,he);return Te.concat([[n,ge]],we)}return i(m,j)}function i(m,j){for(var y=m.length,M=j.length,b=Math.ceil((y+M)/2),S=b,F=2*b,$=new Array(F),Y=new Array(F),se=0;se<F;se++)$[se]=-1,Y[se]=-1;$[S+1]=0,Y[S+1]=0;for(var he=y-M,ge=he%2!==0,Te=0,we=0,v=0,k=0,V=0;V<b;V++){for(var K=-V+Te;K<=V-we;K+=2){var z=S+K,W;K===-V||K!==V&&$[z-1]<$[z+1]?W=$[z+1]:W=$[z-1]+1;for(var le=W-K;W<y&&le<M&&m.charAt(W)===j.charAt(le);)W++,le++;if($[z]=W,W>y)we+=2;else if(le>M)Te+=2;else if(ge){var oe=S+he-K;if(oe>=0&&oe<F&&Y[oe]!==-1){var B=y-Y[oe];if(W>=B)return o(m,j,W,le)}}}for(var ee=-V+v;ee<=V-k;ee+=2){var oe=S+ee,B;ee===-V||ee!==V&&Y[oe-1]<Y[oe+1]?B=Y[oe+1]:B=Y[oe-1]+1;for(var ie=B-ee;B<y&&ie<M&&m.charAt(y-B-1)===j.charAt(M-ie-1);)B++,ie++;if(Y[oe]=B,B>y)k+=2;else if(ie>M)v+=2;else if(!ge){var z=S+he-ee;if(z>=0&&z<F&&$[z]!==-1){var W=$[z],le=S+W-z;if(B=y-B,W>=B)return o(m,j,W,le)}}}}return[[e,m],[t,j]]}function o(m,j,y,M){var b=m.substring(0,y),S=j.substring(0,M),F=m.substring(y),$=j.substring(M),Y=r(b,S),se=r(F,$);return Y.concat(se)}function a(m,j){if(!m||!j||m.charAt(0)!==j.charAt(0))return 0;for(var y=0,M=Math.min(m.length,j.length),b=M,S=0;y<b;)m.substring(S,b)==j.substring(S,b)?(y=b,S=y):M=b,b=Math.floor((M-y)/2+y);return X(m.charCodeAt(b-1))&&b--,b}function l(m,j){var y=m.length,M=j.length;if(y==0||M==0)return 0;y>M?m=m.substring(y-M):y<M&&(j=j.substring(0,y));var b=Math.min(y,M);if(m==j)return b;for(var S=0,F=1;;){var $=m.substring(b-F),Y=j.indexOf($);if(Y==-1)return S;F+=Y,(Y==0||m.substring(b-F)==j.substring(0,F))&&(S=F,F++)}}function u(m,j){if(!m||!j||m.slice(-1)!==j.slice(-1))return 0;for(var y=0,M=Math.min(m.length,j.length),b=M,S=0;y<b;)m.substring(m.length-b,m.length-S)==j.substring(j.length-b,j.length-S)?(y=b,S=y):M=b,b=Math.floor((M-y)/2+y);return de(m.charCodeAt(m.length-b))&&b--,b}function h(m,j){var y=m.length>j.length?m:j,M=m.length>j.length?j:m;if(y.length<4||M.length*2<y.length)return null;function b(we,v,k){for(var V=we.substring(k,k+Math.floor(we.length/4)),K=-1,z="",W,le,oe,B;(K=v.indexOf(V,K+1))!==-1;){var ee=a(we.substring(k),v.substring(K)),ie=u(we.substring(0,k),v.substring(0,K));z.length<ie+ee&&(z=v.substring(K-ie,K)+v.substring(K,K+ee),W=we.substring(0,k-ie),le=we.substring(k+ee),oe=v.substring(0,K-ie),B=v.substring(K+ee))}return z.length*2>=we.length?[W,le,oe,B,z]:null}var S=b(y,M,Math.ceil(y.length/4)),F=b(y,M,Math.ceil(y.length/2)),$;if(!S&&!F)return null;F?S?$=S[4].length>F[4].length?S:F:$=F:$=S;var Y,se,he,ge;m.length>j.length?(Y=$[0],se=$[1],he=$[2],ge=$[3]):(he=$[0],ge=$[1],Y=$[2],se=$[3]);var Te=$[4];return[Y,se,he,ge,Te]}function c(m){for(var j=!1,y=[],M=0,b=null,S=0,F=0,$=0,Y=0,se=0;S<m.length;)m[S][0]==n?(y[M++]=S,F=Y,$=se,Y=0,se=0,b=m[S][1]):(m[S][0]==t?Y+=m[S][1].length:se+=m[S][1].length,b&&b.length<=Math.max(F,$)&&b.length<=Math.max(Y,se)&&(m.splice(y[M-1],0,[e,b]),m[y[M-1]+1][0]=t,M--,M--,S=M>0?y[M-1]:-1,F=0,$=0,Y=0,se=0,b=null,j=!0)),S++;for(j&&ne(m),U(m),S=1;S<m.length;){if(m[S-1][0]==e&&m[S][0]==t){var he=m[S-1][1],ge=m[S][1],Te=l(he,ge),we=l(ge,he);Te>=we?(Te>=he.length/2||Te>=ge.length/2)&&(m.splice(S,0,[n,ge.substring(0,Te)]),m[S-1][1]=he.substring(0,he.length-Te),m[S+1][1]=ge.substring(Te),S++):(we>=he.length/2||we>=ge.length/2)&&(m.splice(S,0,[n,he.substring(0,we)]),m[S-1][0]=t,m[S-1][1]=ge.substring(0,ge.length-we),m[S+1][0]=e,m[S+1][1]=he.substring(we),S++),S++}S++}}var d=/[^a-zA-Z0-9]/,f=/\s/,E=/[\r\n]/,R=/\n\r?\n$/,O=/^\r?\n\r?\n/;function U(m){function j(we,v){if(!we||!v)return 6;var k=we.charAt(we.length-1),V=v.charAt(0),K=k.match(d),z=V.match(d),W=K&&k.match(f),le=z&&V.match(f),oe=W&&k.match(E),B=le&&V.match(E),ee=oe&&we.match(R),ie=B&&v.match(O);return ee||ie?5:oe||B?4:K&&!W&&le?3:W||le?2:K||z?1:0}for(var y=1;y<m.length-1;){if(m[y-1][0]==n&&m[y+1][0]==n){var M=m[y-1][1],b=m[y][1],S=m[y+1][1],F=u(M,b);if(F){var $=b.substring(b.length-F);M=M.substring(0,M.length-F),b=$+b.substring(0,b.length-F),S=$+S}for(var Y=M,se=b,he=S,ge=j(M,b)+j(b,S);b.charAt(0)===S.charAt(0);){M+=b.charAt(0),b=b.substring(1)+S.charAt(0),S=S.substring(1);var Te=j(M,b)+j(b,S);Te>=ge&&(ge=Te,Y=M,se=b,he=S)}m[y-1][1]!=Y&&(Y?m[y-1][1]=Y:(m.splice(y-1,1),y--),m[y][1]=se,he?m[y+1][1]=he:(m.splice(y+1,1),y--))}y++}}function ne(m,j){m.push([n,""]);for(var y=0,M=0,b=0,S="",F="",$;y<m.length;){if(y<m.length-1&&!m[y][1]){m.splice(y,1);continue}switch(m[y][0]){case t:b++,F+=m[y][1],y++;break;case e:M++,S+=m[y][1],y++;break;case n:var Y=y-b-M-1;if(j){if(Y>=0&&A(m[Y][1])){var se=m[Y][1].slice(-1);if(m[Y][1]=m[Y][1].slice(0,-1),S=se+S,F=se+F,!m[Y][1]){m.splice(Y,1),y--;var he=Y-1;m[he]&&m[he][0]===t&&(b++,F=m[he][1]+F,he--),m[he]&&m[he][0]===e&&(M++,S=m[he][1]+S,he--),Y=he}}if(N(m[y][1])){var se=m[y][1].charAt(0);m[y][1]=m[y][1].slice(1),S+=se,F+=se}}if(y<m.length-1&&!m[y][1]){m.splice(y,1);break}if(S.length>0||F.length>0){S.length>0&&F.length>0&&($=a(F,S),$!==0&&(Y>=0?m[Y][1]+=F.substring(0,$):(m.splice(0,0,[n,F.substring(0,$)]),y++),F=F.substring($),S=S.substring($)),$=u(F,S),$!==0&&(m[y][1]=F.substring(F.length-$)+m[y][1],F=F.substring(0,F.length-$),S=S.substring(0,S.length-$)));var ge=b+M;S.length===0&&F.length===0?(m.splice(y-ge,ge),y=y-ge):S.length===0?(m.splice(y-ge,ge,[t,F]),y=y-ge+1):F.length===0?(m.splice(y-ge,ge,[e,S]),y=y-ge+1):(m.splice(y-ge,ge,[e,S],[t,F]),y=y-ge+2)}y!==0&&m[y-1][0]===n?(m[y-1][1]+=m[y][1],m.splice(y,1)):y++,b=0,M=0,S="",F="";break}}m[m.length-1][1]===""&&m.pop();var Te=!1;for(y=1;y<m.length-1;)m[y-1][0]===n&&m[y+1][0]===n&&(m[y][1].substring(m[y][1].length-m[y-1][1].length)===m[y-1][1]?(m[y][1]=m[y-1][1]+m[y][1].substring(0,m[y][1].length-m[y-1][1].length),m[y+1][1]=m[y-1][1]+m[y+1][1],m.splice(y-1,1),Te=!0):m[y][1].substring(0,m[y+1][1].length)==m[y+1][1]&&(m[y-1][1]+=m[y+1][1],m[y][1]=m[y][1].substring(m[y+1][1].length)+m[y+1][1],m.splice(y+1,1),Te=!0)),y++;Te&&ne(m,j)}function X(m){return m>=55296&&m<=56319}function de(m){return m>=56320&&m<=57343}function N(m){return de(m.charCodeAt(0))}function A(m){return X(m.charCodeAt(m.length-1))}function H(m){for(var j=[],y=0;y<m.length;y++)m[y][1].length>0&&j.push(m[y]);return j}function J(m,j,y,M){return A(m)||N(M)?null:H([[n,m],[e,j],[t,y],[n,M]])}function fe(m,j,y){var M=typeof y=="number"?{index:y,length:0}:y.oldRange,b=typeof y=="number"?null:y.newRange,S=m.length,F=j.length;if(M.length===0&&(b===null||b.length===0)){var $=M.index,Y=m.slice(0,$),se=m.slice($),he=b?b.index:null;e:{var ge=$+F-S;if(he!==null&&he!==ge||ge<0||ge>F)break e;var Te=j.slice(0,ge),we=j.slice(ge);if(we!==se)break e;var v=Math.min($,ge),k=Y.slice(0,v),V=Te.slice(0,v);if(k!==V)break e;var K=Y.slice(v),z=Te.slice(v);return J(k,K,z,se)}e:{if(he!==null&&he!==$)break e;var W=$,Te=j.slice(0,W),we=j.slice(W);if(Te!==Y)break e;var le=Math.min(S-W,F-W),oe=se.slice(se.length-le),B=we.slice(we.length-le);if(oe!==B)break e;var K=se.slice(0,se.length-le),z=we.slice(0,we.length-le);return J(Y,K,z,oe)}}if(M.length>0&&b&&b.length===0)e:{var k=m.slice(0,M.index),oe=m.slice(M.index+M.length),v=k.length,le=oe.length;if(F<v+le)break e;var V=j.slice(0,v),B=j.slice(F-le);if(k!==V||oe!==B)break e;var K=m.slice(v,S-le),z=j.slice(v,F-le);return J(k,K,z,oe)}return null}function ae(m,j,y,M){return r(m,j,y,M,!0)}return ae.INSERT=t,ae.DELETE=e,ae.EQUAL=n,Ms=ae,Ms}var pg=gg();const Li=St(pg);function mr(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function mg(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function _g(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Eg(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Cg(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function Rg(e){return Array.isArray(e)?e:[e]}function Ig(e){return["true","false"].includes(e.toLowerCase())}const _r="__INTERNAL_EDITOR__",Ui=`${_r}DOCS_NORMAL`,Pi=`${_r}DOCS_FORMULA_BAR`,ml=`${_r}ZEN_EDITOR`,_l=`\r
2
- `,vg="isRowStylePrecedeColumnStyle",yg=Symbol("AUTO_HEIGHT_FOR_MERGED_CELLS");function Sg(e){return`${_r}${e}`}function El(e){return e.startsWith(_r)}var Fi=Symbol("$$IDENTIFIER_DECORATOR");function Og(e){return e&&e[Fi]===!0}function ki(e){return typeof e=="function"}function Ks(e){return!!(e&&typeof e.useClass<"u")}function Xs(e){return!!(e&&typeof e.useFactory<"u")}function Qs(e){return!!(e&&typeof e.useValue<"u")}function bg(e){return!!(e&&typeof e.useExisting<"u")}function Js(e){return!!(e&&typeof e.useAsync<"u")}var Cl=Symbol("AsyncHook");function jr(e){return!!(e&&e.__symbol===Cl)}function Ct(e){return typeof e>"u"?"undefined":ki(e)&&!e[Fi]?e.name:e.toString()}var wg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ot=function(e){wg(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error);exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var Rl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zo=Symbol("$$TARGET"),qs=Symbol("$$DEPENDENCIES"),Ag=function(e){Rl(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(Ct(r),'".');return e.call(this,s)||this}return t}(ot),Il=function(e){Rl(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Ct(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(ot);function vl(e){var t=e;return t[qs]||[]}function $i(e,t){var n=vl(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new Ag(t,e);return r}function Bi(e,t,n,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new Il(e,n);var o=e;o[zo]===o?o[qs].push(i):(o[qs]=[i],o[zo]=o)}var Yo=new Set;function _t(e){if(Yo.has(e))throw new ot('Identifier "'.concat(e,'" already exists.'));Yo.add(e);var t=function(n,r,s){Bi(n,t,s)};return t.toString=function(){return e},t[Fi]=!0,t}function Tg(e,t,n){var r=$i(e,t);r.lookUp=n}function yl(e){return function t(){return this instanceof t?this:function(n,r,s){Tg(n,s,e)}}}var Sl=yl(exports.LookUp.SKIP_SELF),Ol=yl(exports.LookUp.SELF),Ng=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function Mg(e){switch(e){case exports.Quantity.OPTIONAL:return"0 or 1";case exports.Quantity.REQUIRED:return"1";case exports.Quantity.MANY:return"0 or more"}}var Zs=function(e){Ng(t,e);function t(n,r,s){var i=this,o="Expect ".concat(Mg(r),' dependency item(s) for id "').concat(Ct(n),'" but get ').concat(s,".");return s===0&&(o+=" Did you forget to register it?"),s>1&&(o+=" You register it more than once."),i=e.call(this,o)||this,i.quantity=r,i.actual=s,i}return t}(ot);function ji(e,t,n){if(t===exports.Quantity.OPTIONAL&&n>1||t===exports.Quantity.REQUIRED&&n!==1)throw new Zs(e,t,n)}function Dg(e,t){return e===exports.Quantity.MANY?t:t[0]}function xg(e,t,n){var r=$i(e,t);r.quantity=n}function Hi(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)Bi(r,n,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Il(r,i);xg(r,i,e)}}}}var bl=Hi(exports.Quantity.MANY),wl=Hi(exports.Quantity.OPTIONAL),it=Hi(exports.Quantity.REQUIRED);function Lg(e,t,n){var r=$i(e,t);r.withNew=n}function Ug(e){return function t(){return this instanceof t?this:function(n,r,s){Lg(n,s,e)}}}var Al=Ug(!0);function Tl(e,t){return t===void 0&&(t=0),e?e.map(function(n,r){if(r+=t,!Array.isArray(n))return{paramIndex:r,identifier:n,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(u){if(u instanceof Ol)o=exports.LookUp.SELF;else if(u instanceof Sl)o=exports.LookUp.SKIP_SELF;else if(u instanceof wl)a=exports.Quantity.OPTIONAL;else if(u instanceof bl)a=exports.Quantity.MANY;else if(u instanceof Al)l=!0;else throw new ot("unknown dep modifier ".concat(u,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}function Pg(e,t,n){n===void 0&&(n=0);var r=Tl(t,n);r.forEach(function(s){Bi(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}function Fg(e){return{unwrap:e}}function kg(e){return!!e&&typeof e.unwrap=="function"}function $g(e){return kg(e)?e.unwrap():e}function ei(e){return!!e&&typeof e.dispose=="function"}var Nl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function Bg(e){return e.length===1}var Rs=[];function Vo(e){Rs.push(e)}function Go(){Rs.pop()}function jg(){Rs.length=0}var Ko=function(e){Nl(t,e);function t(n,r,s){var i='Cannot find "'.concat(Ct(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(Og(n)?Ct(n):n.name,'".');return e.call(this,i)||this}return t}(ot),Hr=function(e){Nl(t,e);function t(n){var r=this,s='Cannot find "'.concat(Ct(n),'" registered by any injector. The stack of dependencies is: "').concat(Rs.map(function(i){return Ct(i)}).join(" -> "),'".');return r=e.call(this,s)||this,jg(),r}return t}(ot),Hg=function(){function e(t){var n=this;this.dependencyMap=new Map,this.normalizeDependencies(t).map(function(r){return n.add(r[0],r[1])})}return e.prototype.add=function(t,n){typeof n>"u"&&(n={useClass:t,lazy:!1});var r=this.dependencyMap.get(t);typeof r>"u"&&(r=[],this.dependencyMap.set(t,r)),r.push(n)},e.prototype.delete=function(t){this.dependencyMap.delete(t)},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return ji(t,n,r.length),Dg(n,r)},e.prototype.has=function(t){return this.dependencyMap.has(t)},e.prototype.append=function(t){var n=this;this.normalizeDependencies(t).forEach(function(r){return n.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(t){return t.map(function(n){var r=n[0],s;return Bg(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),Wg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(t,n){var r=this.resolvedDependencies.get(t);typeof r>"u"&&(r=[],this.resolvedDependencies.set(t,r)),r.push(n)},e.prototype.has=function(t){return this.resolvedDependencies.has(t)},e.prototype.delete=function(t){if(this.resolvedDependencies.has(t)){var n=this.resolvedDependencies.get(t);n.forEach(function(r){return ei(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new Hr(t);return ji(t,n,r.length),n===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return ei(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}(),ti;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")ti=function(t,n){var r=requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});ti=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var zg=function(){function e(t){var n=this;this.didRun=!1,this.selfExecutor=function(){try{n.value=t()}catch(r){n.error=r}finally{n.didRun=!0}},this.disposeCallback=ti(function(){return n.selfExecutor()})}return e.prototype.hasRun=function(){return this.didRun},e.prototype.dispose=function(){this.disposeCallback()},e.prototype.getValue=function(){if(this.didRun||(this.dispose(),this.selfExecutor()),this.error)throw this.error;return this.value},e}(),Hn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ns=function(){return ns=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ns.apply(this,arguments)},cn=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},Yg=300,wr=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Vg=function(e){Hn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Ct(n),'".'))||this}return t}(ot),Gg=function(e){Hn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(ot),Kg=function(e){Hn(t,e);function t(n){return e.call(this,'Async item "'.concat(Ct(n),'" returns another async item.'))||this}return t}(ot),Xg=function(e){Hn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(Ct(n),'" from sync api.'))||this}return t}(ot),Xo=function(e){Hn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(Ct(n),'" after it is already resolved.'))||this}return t}(ot),Qg=function(e){Hn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(Ct(n),'" after it is already resolved.'))||this}return t}(ot),Rt=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposingCallbacks=new Set,this.disposed=!1,this.dependencyCollection=new Hg(t||[]),this.resolvedDependencyCollection=new Wg,n&&n.children.push(this)}return e.prototype.onDispose=function(t){var n=this;return this.disposingCallbacks.add(t),{dispose:function(){return n.disposingCallbacks.delete(t)}}},e.prototype.createChild=function(t){return this._ensureInjectorNotDisposed(),new e(t,this)},e.prototype.dispose=function(){this.children.forEach(function(t){return t.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0,this.disposingCallbacks.forEach(function(t){return t()}),this.disposingCallbacks.clear()},e.prototype.deleteSelfFromParent=function(){if(this.parent){var t=this.parent.children.indexOf(this);t>-1&&this.parent.children.splice(t,1)}},e.prototype.add=function(t){this._ensureInjectorNotDisposed();var n=t[0],r=t[1];if(this.resolvedDependencyCollection.has(n))throw new Xo(n);typeof r>"u"?this.dependencyCollection.add(n):Js(r)||Ks(r)||Qs(r)||Xs(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new Xo(n);this.dependencyCollection.delete(n),t.length===1?this.dependencyCollection.add(n):this.dependencyCollection.add(n,t[1])},e.prototype.delete=function(t){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(t))throw new Qg(t);this.dependencyCollection.delete(t)},e.prototype.invoke=function(t){for(var n=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return n._get(o,a,l)},has:function(o){return n.has(o)}};return t.apply(void 0,cn([i],r,!1))},e.prototype.has=function(t){var n;return this.dependencyCollection.has(t)||((n=this.parent)===null||n===void 0?void 0:n.has(t))||!1},e.prototype.get=function(t,n,r){this._ensureInjectorNotDisposed();var s=this._get(t,n,r);if(Array.isArray(s)&&s.some(function(i){return jr(i)})||jr(s))throw new Xg(t);return s},e.prototype._get=function(t,n,r,s){var i=exports.Quantity.REQUIRED;if(n===exports.Quantity.REQUIRED||n===exports.Quantity.OPTIONAL||n===exports.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==wr)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,exports.Quantity.REQUIRED);if(n!==wr)return Promise.resolve(n);var r=this.createDependency(t,exports.Quantity.REQUIRED);return jr(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,cn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;Vo(t);try{Qs(n)?s=this._resolveValueDependency(t,n):Xs(n)?s=this._resolveFactory(t,n,r):Ks(n)?s=this._resolveClass(t,n,r):bg(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),Go()}catch(i){throw Go(),i}return s},e.prototype._resolveExisting=function(t,n){var r=this.get(n.useExisting);return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveValueDependency=function(t,n){var r=n.useValue;return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveClass=function(t,n,r){var s=this;r===void 0&&(r=!0);var i;if(n.lazy){var o=new zg(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(n)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var u=o.getValue(),h=u[l];return typeof h!="function"||(h=h.bind(u),a[l]=h),h}},set:function(a,l,u){return o.getValue()[l]=u,!0}})}else i=this._resolveClassImpl(n);return t&&r&&this.resolvedDependencyCollection.add(t,i),i},e.prototype._resolveClassImpl=function(t){for(var n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=t.useClass;this.markNewResolution(i);for(var o=vl(i).sort(function(O,U){return O.paramIndex-U.paramIndex}).map(function(O){return ns(ns({},O),{identifier:$g(O.identifier)})}),a=[],l=0,u=o;l<u.length;l++){var h=u[l];try{var c=this._get(h.identifier,h.quantity,h.lookUp,h.withNew);a.push(c)}catch(O){throw O instanceof Hr||O instanceof Zs&&O.actual===0?new Ko(i,h.identifier,h.paramIndex):O}}var d=cn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(Ct(i)," but get ").concat(d.length,"."));var E=f-d.length;E>0?d=cn(cn([],d,!0),Array.from({length:E}).fill(void 0),!0):d=d.slice(0,f)}var R=new(i.bind.apply(i,cn(cn([void 0],d,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,R),this.markResolutionCompleted(),R},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=Tl(n.deps),o=[],a=0,l=i;a<l.length;a++){var u=l[a];try{var h=this._get(u.identifier,u.quantity,u.lookUp,u.withNew);o.push(h)}catch(d){throw d instanceof Hr||d instanceof Zs&&d.actual===0?new Ko(t,u.identifier,u.paramIndex):d}}var c=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,c),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,c),c},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:Cl,whenReady:function(){return r._resolveAsyncImpl(t,n)}};return s},e.prototype._resolveAsyncImpl=function(t,n){var r=this;return n.useAsync().then(function(s){var i=r.getValue(t);if(i!==wr)return i;var o;if(Array.isArray(s)){var a=s[1];if(Js(a))throw new Kg(t);o=r._resolveDependency(t,a)}else ki(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:n.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(t,o),o})},e.prototype.getValue=function(t,n,r){var s=this;n===void 0&&(n=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?wr:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):(ji(t,n,0),n===exports.Quantity.MANY?[]:null)};return r===exports.LookUp.SKIP_SELF?o():t===e?this:r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():o()},e.prototype.createDependency=function(t,n,r,s){var i=this;n===void 0&&(n=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(t,n),u=null;return Array.isArray(l)?u=l.map(function(h){return i._resolveDependency(t,h,s)}):l&&(u=i._resolveDependency(t,l,s)),u},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===exports.Quantity.OPTIONAL)return null;throw Vo(t),new Hr(t)};return r===exports.LookUp.SKIP_SELF?a():this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Yg)throw new Vg(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Gg},e}(),Qo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,Jo="REDI_GLOBAL_LOCK",Jg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Qo[Jo]?Jg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
1
+ "use strict";var lh=Object.defineProperty;var uh=(e,t,n)=>t in e?lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>uh(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("rxjs"),Hr=require("rxjs/operators");function ch(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const wr=typeof global<"u"?global:typeof self<"u"?self:window;function hh(){const t=new Map;let n=0;typeof wr.requestIdleCallback!="function"&&(wr.requestIdleCallback=function(s){const i=Date.now(),o=++n,a=setTimeout(function(){t.delete(o);const u=Math.max(0,50-(Date.now()-i));s({didTimeout:u===0,timeRemaining(){return u}})},1);return t.set(o,a),o}),typeof wr.cancelIdleCallback!="function"&&(wr.cancelIdleCallback=function(s){const i=t.get(s);i!==void 0&&(clearTimeout(i),t.delete(s))})}function dh(){hh()}var Ka=typeof global=="object"&&global&&global.Object===Object&&global,fh=typeof self=="object"&&self&&self.Object===Object&&self,En=Ka||fh||Function("return this")(),Ln=En.Symbol,Xa=Object.prototype,gh=Xa.hasOwnProperty,ph=Xa.toString,Xn=Ln?Ln.toStringTag:void 0;function mh(e){var t=gh.call(e,Xn),n=e[Xn];try{e[Xn]=void 0;var r=!0}catch{}var s=ph.call(e);return r&&(t?e[Xn]=n:delete e[Xn]),s}var _h=Object.prototype,Eh=_h.toString;function Ch(e){return Eh.call(e)}var Rh="[object Null]",Ih="[object Undefined]",Ao=Ln?Ln.toStringTag:void 0;function mr(e){return e==null?e===void 0?Ih:Rh:Ao&&Ao in Object(e)?mh(e):Ch(e)}function Hn(e){return e!=null&&typeof e=="object"}var yh="[object Symbol]";function ms(e){return typeof e=="symbol"||Hn(e)&&mr(e)==yh}function vh(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Un=Array.isArray,To=Ln?Ln.prototype:void 0,No=To?To.toString:void 0;function Qa(e){if(typeof e=="string")return e;if(Un(e))return vh(e,Qa)+"";if(ms(e))return No?No.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Sh=/\s/;function wh(e){for(var t=e.length;t--&&Sh.test(e.charAt(t)););return t}var Oh=/^\s+/;function bh(e){return e&&e.slice(0,wh(e)+1).replace(Oh,"")}function St(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Mo=NaN,Ah=/^[-+]0x[0-9a-f]+$/i,Th=/^0b[01]+$/i,Nh=/^0o[0-7]+$/i,Mh=parseInt;function Do(e){if(typeof e=="number")return e;if(ms(e))return Mo;if(St(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=St(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=bh(e);var n=Th.test(e);return n||Nh.test(e)?Mh(e.slice(2),n?2:8):Ah.test(e)?Mo:+e}function Ja(e){return e}var Dh="[object AsyncFunction]",xh="[object Function]",Lh="[object GeneratorFunction]",Uh="[object Proxy]";function bi(e){if(!St(e))return!1;var t=mr(e);return t==xh||t==Lh||t==Dh||t==Uh}var As=En["__core-js_shared__"],xo=function(){var e=/[^.]+$/.exec(As&&As.keys&&As.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ph(e){return!!xo&&xo in e}var kh=Function.prototype,Fh=kh.toString;function $h(e){if(e!=null){try{return Fh.call(e)}catch{}try{return e+""}catch{}}return""}var Hh=/[\\^$.*+?()[\]{}|]/g,Bh=/^\[object .+?Constructor\]$/,jh=Function.prototype,Wh=Object.prototype,Yh=jh.toString,zh=Wh.hasOwnProperty,Vh=RegExp("^"+Yh.call(zh).replace(Hh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gh(e){if(!St(e)||Ph(e))return!1;var t=bi(e)?Vh:Bh;return t.test($h(e))}function Kh(e,t){return e==null?void 0:e[t]}function Ai(e,t){var n=Kh(e,t);return Gh(n)?n:void 0}var Lo=Object.create,Xh=function(){function e(){}return function(t){if(!St(t))return{};if(Lo)return Lo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Qh(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Jh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var qh=800,Zh=16,ed=Date.now;function td(e){var t=0,n=0;return function(){var r=ed(),s=Zh-(r-n);if(n=r,s>0){if(++t>=qh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function nd(e){return function(){return e}}var ns=function(){try{var e=Ai(Object,"defineProperty");return e({},"",{}),e}catch{}}(),rd=ns?function(e,t){return ns(e,"toString",{configurable:!0,enumerable:!1,value:nd(t),writable:!0})}:Ja,sd=td(rd),id=9007199254740991,od=/^(?:0|[1-9]\d*)$/;function Ti(e,t){var n=typeof e;return t=t==null?id:t,!!t&&(n=="number"||n!="symbol"&&od.test(e))&&e>-1&&e%1==0&&e<t}function Ni(e,t,n){t=="__proto__"&&ns?ns(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _s(e,t){return e===t||e!==e&&t!==t}var ad=Object.prototype,ld=ad.hasOwnProperty;function qa(e,t,n){var r=e[t];(!(ld.call(e,t)&&_s(r,n))||n===void 0&&!(t in e))&&Ni(e,t,n)}function ud(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?Ni(n,a,l):qa(n,a,l)}return n}var Uo=Math.max;function cd(e,t,n){return t=Uo(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Uo(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),Qh(e,this,a)}}function hd(e,t){return sd(cd(e,t,Ja),e+"")}var dd=9007199254740991;function Za(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dd}function Mi(e){return e!=null&&Za(e.length)&&!bi(e)}function fd(e,t,n){if(!St(n))return!1;var r=typeof t;return(r=="number"?Mi(n)&&Ti(t,n.length):r=="string"&&t in n)?_s(n[t],e):!1}function el(e){return hd(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&fd(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var gd=Object.prototype;function tl(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||gd;return e===n}function pd(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var md="[object Arguments]";function Po(e){return Hn(e)&&mr(e)==md}var nl=Object.prototype,_d=nl.hasOwnProperty,Ed=nl.propertyIsEnumerable,Vs=Po(function(){return arguments}())?Po:function(e){return Hn(e)&&_d.call(e,"callee")&&!Ed.call(e,"callee")};function Cd(){return!1}var rl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ko=rl&&typeof module=="object"&&module&&!module.nodeType&&module,Rd=ko&&ko.exports===rl,Fo=Rd?En.Buffer:void 0,Id=Fo?Fo.isBuffer:void 0,sl=Id||Cd,yd="[object Arguments]",vd="[object Array]",Sd="[object Boolean]",wd="[object Date]",Od="[object Error]",bd="[object Function]",Ad="[object Map]",Td="[object Number]",Nd="[object Object]",Md="[object RegExp]",Dd="[object Set]",xd="[object String]",Ld="[object WeakMap]",Ud="[object ArrayBuffer]",Pd="[object DataView]",kd="[object Float32Array]",Fd="[object Float64Array]",$d="[object Int8Array]",Hd="[object Int16Array]",Bd="[object Int32Array]",jd="[object Uint8Array]",Wd="[object Uint8ClampedArray]",Yd="[object Uint16Array]",zd="[object Uint32Array]",qe={};qe[kd]=qe[Fd]=qe[$d]=qe[Hd]=qe[Bd]=qe[jd]=qe[Wd]=qe[Yd]=qe[zd]=!0;qe[yd]=qe[vd]=qe[Ud]=qe[Sd]=qe[Pd]=qe[wd]=qe[Od]=qe[bd]=qe[Ad]=qe[Td]=qe[Nd]=qe[Md]=qe[Dd]=qe[xd]=qe[Ld]=!1;function Vd(e){return Hn(e)&&Za(e.length)&&!!qe[mr(e)]}function Gd(e){return function(t){return e(t)}}var il=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ur=il&&typeof module=="object"&&module&&!module.nodeType&&module,Kd=ur&&ur.exports===il,Ts=Kd&&Ka.process,$o=function(){try{var e=ur&&ur.require&&ur.require("util").types;return e||Ts&&Ts.binding&&Ts.binding("util")}catch{}}(),Ho=$o&&$o.isTypedArray,ol=Ho?Gd(Ho):Vd;function Xd(e,t){var n=Un(e),r=!n&&Vs(e),s=!n&&!r&&sl(e),i=!n&&!r&&!s&&ol(e),o=n||r||s||i,a=o?pd(e.length,String):[],l=a.length;for(var u in e)o&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ti(u,l))||a.push(u);return a}function Qd(e,t){return function(n){return e(t(n))}}function Jd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var qd=Object.prototype,Zd=qd.hasOwnProperty;function ef(e){if(!St(e))return Jd(e);var t=tl(e),n=[];for(var r in e)r=="constructor"&&(t||!Zd.call(e,r))||n.push(r);return n}function al(e){return Mi(e)?Xd(e):ef(e)}var tf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nf=/^\w*$/;function rf(e,t){if(Un(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ms(e)?!0:nf.test(e)||!tf.test(e)||t!=null&&e in Object(t)}var dr=Ai(Object,"create");function sf(){this.__data__=dr?dr(null):{},this.size=0}function of(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var af="__lodash_hash_undefined__",lf=Object.prototype,uf=lf.hasOwnProperty;function cf(e){var t=this.__data__;if(dr){var n=t[e];return n===af?void 0:n}return uf.call(t,e)?t[e]:void 0}var hf=Object.prototype,df=hf.hasOwnProperty;function ff(e){var t=this.__data__;return dr?t[e]!==void 0:df.call(t,e)}var gf="__lodash_hash_undefined__";function pf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=dr&&t===void 0?gf:t,this}function pn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pn.prototype.clear=sf;pn.prototype.delete=of;pn.prototype.get=cf;pn.prototype.has=ff;pn.prototype.set=pf;function mf(){this.__data__=[],this.size=0}function Es(e,t){for(var n=e.length;n--;)if(_s(e[n][0],t))return n;return-1}var _f=Array.prototype,Ef=_f.splice;function Cf(e){var t=this.__data__,n=Es(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ef.call(t,n,1),--this.size,!0}function Rf(e){var t=this.__data__,n=Es(t,e);return n<0?void 0:t[n][1]}function If(e){return Es(this.__data__,e)>-1}function yf(e,t){var n=this.__data__,r=Es(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gt.prototype.clear=mf;Gt.prototype.delete=Cf;Gt.prototype.get=Rf;Gt.prototype.has=If;Gt.prototype.set=yf;var ll=Ai(En,"Map");function vf(){this.size=0,this.__data__={hash:new pn,map:new(ll||Gt),string:new pn}}function Sf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Cs(e,t){var n=e.__data__;return Sf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function wf(e){var t=Cs(this,e).delete(e);return this.size-=t?1:0,t}function Of(e){return Cs(this,e).get(e)}function bf(e){return Cs(this,e).has(e)}function Af(e,t){var n=Cs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=vf;ln.prototype.delete=wf;ln.prototype.get=Of;ln.prototype.has=bf;ln.prototype.set=Af;var Tf="Expected a function";function Di(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Tf);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Di.Cache||ln),n}Di.Cache=ln;var Nf=500;function Mf(e){var t=Di(e,function(r){return n.size===Nf&&n.clear(),r}),n=t.cache;return t}var Df=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xf=/\\(\\)?/g,Lf=Mf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Df,function(n,r,s,i){t.push(s?i.replace(xf,"$1"):r||n)}),t});function Uf(e){return e==null?"":Qa(e)}function ul(e,t){return Un(e)?e:rf(e,t)?[e]:Lf(Uf(e))}function cl(e){if(typeof e=="string"||ms(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Pf(e,t){t=ul(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[cl(t[n++])];return n&&n==r?e:void 0}function kf(e,t,n){var r=e==null?void 0:Pf(e,t);return r===void 0?n:r}var hl=Qd(Object.getPrototypeOf,Object),Ff="[object Object]",$f=Function.prototype,Hf=Object.prototype,dl=$f.toString,Bf=Hf.hasOwnProperty,jf=dl.call(Object);function Wf(e){if(!Hn(e)||mr(e)!=Ff)return!1;var t=hl(e);if(t===null)return!0;var n=Bf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&dl.call(n)==jf}function Yf(){this.__data__=new Gt,this.size=0}function zf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Vf(e){return this.__data__.get(e)}function Gf(e){return this.__data__.has(e)}var Kf=200;function Xf(e,t){var n=this.__data__;if(n instanceof Gt){var r=n.__data__;if(!ll||r.length<Kf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ln(r)}return n.set(e,t),this.size=n.size,this}function Bn(e){var t=this.__data__=new Gt(e);this.size=t.size}Bn.prototype.clear=Yf;Bn.prototype.delete=zf;Bn.prototype.get=Vf;Bn.prototype.has=Gf;Bn.prototype.set=Xf;var fl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bo=fl&&typeof module=="object"&&module&&!module.nodeType&&module,Qf=Bo&&Bo.exports===fl,jo=Qf?En.Buffer:void 0;jo&&jo.allocUnsafe;function Jf(e,t){return e.slice()}var Wo=En.Uint8Array;function qf(e){var t=new e.constructor(e.byteLength);return new Wo(t).set(new Wo(e)),t}function Zf(e,t){var n=qf(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function eg(e){return typeof e.constructor=="function"&&!tl(e)?Xh(hl(e)):{}}function tg(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var ng=tg(),Ns=function(){return En.Date.now()},rg="Expected a function",sg=Math.max,ig=Math.min;function og(e,t,n){var r,s,i,o,a,l,u=0,c=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(rg);t=Do(t)||0,St(n)&&(c=!!n.leading,h="maxWait"in n,i=h?sg(Do(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(A){var j=r,q=s;return r=s=void 0,u=A,o=e.apply(q,j),o}function C(A){return u=A,a=setTimeout(M,t),c?f(A):o}function R(A){var j=A-l,q=A-u,fe=t-j;return h?ig(fe,i-q):fe}function v(A){var j=A-l,q=A-u;return l===void 0||j>=t||j<0||h&&q>=i}function M(){var A=Ns();if(v(A))return Q(A);a=setTimeout(M,R(A))}function Q(A){return a=void 0,d&&r?f(A):(r=s=void 0,o)}function z(){a!==void 0&&clearTimeout(a),u=0,r=l=s=a=void 0}function de(){return a===void 0?o:Q(Ns())}function N(){var A=Ns(),j=v(A);if(r=arguments,s=this,l=A,j){if(a===void 0)return C(l);if(h)return clearTimeout(a),a=setTimeout(M,t),f(l)}return a===void 0&&(a=setTimeout(M,t)),o}return N.cancel=z,N.flush=de,N}function Gs(e,t,n){(n!==void 0&&!_s(e[t],n)||n===void 0&&!(t in e))&&Ni(e,t,n)}function ag(e){return Hn(e)&&Mi(e)}function Ks(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function lg(e){return ud(e,al(e))}function ug(e,t,n,r,s,i,o){var a=Ks(e,n),l=Ks(t,n),u=o.get(l);if(u){Gs(e,n,u);return}var c=i?i(a,l,n+"",e,t,o):void 0,h=c===void 0;if(h){var d=Un(l),f=!d&&sl(l),C=!d&&!f&&ol(l);c=l,d||f||C?Un(a)?c=a:ag(a)?c=Jh(a):f?(h=!1,c=Jf(l)):C?(h=!1,c=Zf(l)):c=[]:Wf(l)||Vs(l)?(c=a,Vs(a)?c=lg(a):(!St(a)||bi(a))&&(c=eg(l))):h=!1}h&&(o.set(l,c),s(c,l,r,i,o),o.delete(l)),Gs(e,n,c)}function xi(e,t,n,r,s){e!==t&&ng(t,function(i,o){if(s||(s=new Bn),St(i))ug(e,t,o,n,xi,r,s);else{var a=r?r(Ks(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Gs(e,o,a)}},al)}var cg=el(function(e,t,n,r){xi(e,t,n,r)}),Li=el(function(e,t,n){xi(e,t,n)});function hg(e,t,n,r){if(!St(e))return e;t=ul(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=cl(t[s]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var c=a[l];u=void 0,u===void 0&&(u=St(c)?c:Ti(t[s+1])?[]:{})}qa(a,l,u),a=a[l]}return e}function dg(e,t,n){return e==null?e:hg(e,t,n)}function wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ms,Yo;function fg(){if(Yo)return Ms;Yo=1;var e=-1,t=1,n=0;function r(m,B,S,D,O){if(m===B)return m?[[n,m]]:[];if(S!=null){var w=fe(m,B,S);if(w)return w}var k=a(m,B),$=m.substring(0,k);m=m.substring(k),B=B.substring(k),k=u(m,B);var V=m.substring(m.length-k);m=m.substring(0,m.length-k),B=B.substring(0,B.length-k);var se=s(m,B);return $&&se.unshift([n,$]),V&&se.push([n,V]),Q(se,O),D&&h(se),se}function s(m,B){var S;if(!m)return[[t,B]];if(!B)return[[e,m]];var D=m.length>B.length?m:B,O=m.length>B.length?B:m,w=D.indexOf(O);if(w!==-1)return S=[[t,D.substring(0,w)],[n,O],[t,D.substring(w+O.length)]],m.length>B.length&&(S[0][0]=S[2][0]=e),S;if(O.length===1)return[[e,m],[t,B]];var k=c(m,B);if(k){var $=k[0],V=k[1],se=k[2],he=k[3],ge=k[4],Te=r($,se),be=r(V,he);return Te.concat([[n,ge]],be)}return i(m,B)}function i(m,B){for(var S=m.length,D=B.length,O=Math.ceil((S+D)/2),w=O,k=2*O,$=new Array(k),V=new Array(k),se=0;se<k;se++)$[se]=-1,V[se]=-1;$[w+1]=0,V[w+1]=0;for(var he=S-D,ge=he%2!==0,Te=0,be=0,y=0,F=0,G=0;G<O;G++){for(var X=-G+Te;X<=G-be;X+=2){var Y=w+X,W;X===-G||X!==G&&$[Y-1]<$[Y+1]?W=$[Y+1]:W=$[Y-1]+1;for(var le=W-X;W<S&&le<D&&m.charAt(W)===B.charAt(le);)W++,le++;if($[Y]=W,W>S)be+=2;else if(le>D)Te+=2;else if(ge){var oe=w+he-X;if(oe>=0&&oe<k&&V[oe]!==-1){var H=S-V[oe];if(W>=H)return o(m,B,W,le)}}}for(var te=-G+y;te<=G-F;te+=2){var oe=w+te,H;te===-G||te!==G&&V[oe-1]<V[oe+1]?H=V[oe+1]:H=V[oe-1]+1;for(var ie=H-te;H<S&&ie<D&&m.charAt(S-H-1)===B.charAt(D-ie-1);)H++,ie++;if(V[oe]=H,H>S)F+=2;else if(ie>D)y+=2;else if(!ge){var Y=w+he-te;if(Y>=0&&Y<k&&$[Y]!==-1){var W=$[Y],le=w+W-Y;if(H=S-H,W>=H)return o(m,B,W,le)}}}}return[[e,m],[t,B]]}function o(m,B,S,D){var O=m.substring(0,S),w=B.substring(0,D),k=m.substring(S),$=B.substring(D),V=r(O,w),se=r(k,$);return V.concat(se)}function a(m,B){if(!m||!B||m.charAt(0)!==B.charAt(0))return 0;for(var S=0,D=Math.min(m.length,B.length),O=D,w=0;S<O;)m.substring(w,O)==B.substring(w,O)?(S=O,w=S):D=O,O=Math.floor((D-S)/2+S);return z(m.charCodeAt(O-1))&&O--,O}function l(m,B){var S=m.length,D=B.length;if(S==0||D==0)return 0;S>D?m=m.substring(S-D):S<D&&(B=B.substring(0,S));var O=Math.min(S,D);if(m==B)return O;for(var w=0,k=1;;){var $=m.substring(O-k),V=B.indexOf($);if(V==-1)return w;k+=V,(V==0||m.substring(O-k)==B.substring(0,k))&&(w=k,k++)}}function u(m,B){if(!m||!B||m.slice(-1)!==B.slice(-1))return 0;for(var S=0,D=Math.min(m.length,B.length),O=D,w=0;S<O;)m.substring(m.length-O,m.length-w)==B.substring(B.length-O,B.length-w)?(S=O,w=S):D=O,O=Math.floor((D-S)/2+S);return de(m.charCodeAt(m.length-O))&&O--,O}function c(m,B){var S=m.length>B.length?m:B,D=m.length>B.length?B:m;if(S.length<4||D.length*2<S.length)return null;function O(be,y,F){for(var G=be.substring(F,F+Math.floor(be.length/4)),X=-1,Y="",W,le,oe,H;(X=y.indexOf(G,X+1))!==-1;){var te=a(be.substring(F),y.substring(X)),ie=u(be.substring(0,F),y.substring(0,X));Y.length<ie+te&&(Y=y.substring(X-ie,X)+y.substring(X,X+te),W=be.substring(0,F-ie),le=be.substring(F+te),oe=y.substring(0,X-ie),H=y.substring(X+te))}return Y.length*2>=be.length?[W,le,oe,H,Y]:null}var w=O(S,D,Math.ceil(S.length/4)),k=O(S,D,Math.ceil(S.length/2)),$;if(!w&&!k)return null;k?w?$=w[4].length>k[4].length?w:k:$=k:$=w;var V,se,he,ge;m.length>B.length?(V=$[0],se=$[1],he=$[2],ge=$[3]):(he=$[0],ge=$[1],V=$[2],se=$[3]);var Te=$[4];return[V,se,he,ge,Te]}function h(m){for(var B=!1,S=[],D=0,O=null,w=0,k=0,$=0,V=0,se=0;w<m.length;)m[w][0]==n?(S[D++]=w,k=V,$=se,V=0,se=0,O=m[w][1]):(m[w][0]==t?V+=m[w][1].length:se+=m[w][1].length,O&&O.length<=Math.max(k,$)&&O.length<=Math.max(V,se)&&(m.splice(S[D-1],0,[e,O]),m[S[D-1]+1][0]=t,D--,D--,w=D>0?S[D-1]:-1,k=0,$=0,V=0,se=0,O=null,B=!0)),w++;for(B&&Q(m),M(m),w=1;w<m.length;){if(m[w-1][0]==e&&m[w][0]==t){var he=m[w-1][1],ge=m[w][1],Te=l(he,ge),be=l(ge,he);Te>=be?(Te>=he.length/2||Te>=ge.length/2)&&(m.splice(w,0,[n,ge.substring(0,Te)]),m[w-1][1]=he.substring(0,he.length-Te),m[w+1][1]=ge.substring(Te),w++):(be>=he.length/2||be>=ge.length/2)&&(m.splice(w,0,[n,he.substring(0,be)]),m[w-1][0]=t,m[w-1][1]=ge.substring(0,ge.length-be),m[w+1][0]=e,m[w+1][1]=he.substring(be),w++),w++}w++}}var d=/[^a-zA-Z0-9]/,f=/\s/,C=/[\r\n]/,R=/\n\r?\n$/,v=/^\r?\n\r?\n/;function M(m){function B(be,y){if(!be||!y)return 6;var F=be.charAt(be.length-1),G=y.charAt(0),X=F.match(d),Y=G.match(d),W=X&&F.match(f),le=Y&&G.match(f),oe=W&&F.match(C),H=le&&G.match(C),te=oe&&be.match(R),ie=H&&y.match(v);return te||ie?5:oe||H?4:X&&!W&&le?3:W||le?2:X||Y?1:0}for(var S=1;S<m.length-1;){if(m[S-1][0]==n&&m[S+1][0]==n){var D=m[S-1][1],O=m[S][1],w=m[S+1][1],k=u(D,O);if(k){var $=O.substring(O.length-k);D=D.substring(0,D.length-k),O=$+O.substring(0,O.length-k),w=$+w}for(var V=D,se=O,he=w,ge=B(D,O)+B(O,w);O.charAt(0)===w.charAt(0);){D+=O.charAt(0),O=O.substring(1)+w.charAt(0),w=w.substring(1);var Te=B(D,O)+B(O,w);Te>=ge&&(ge=Te,V=D,se=O,he=w)}m[S-1][1]!=V&&(V?m[S-1][1]=V:(m.splice(S-1,1),S--),m[S][1]=se,he?m[S+1][1]=he:(m.splice(S+1,1),S--))}S++}}function Q(m,B){m.push([n,""]);for(var S=0,D=0,O=0,w="",k="",$;S<m.length;){if(S<m.length-1&&!m[S][1]){m.splice(S,1);continue}switch(m[S][0]){case t:O++,k+=m[S][1],S++;break;case e:D++,w+=m[S][1],S++;break;case n:var V=S-O-D-1;if(B){if(V>=0&&A(m[V][1])){var se=m[V][1].slice(-1);if(m[V][1]=m[V][1].slice(0,-1),w=se+w,k=se+k,!m[V][1]){m.splice(V,1),S--;var he=V-1;m[he]&&m[he][0]===t&&(O++,k=m[he][1]+k,he--),m[he]&&m[he][0]===e&&(D++,w=m[he][1]+w,he--),V=he}}if(N(m[S][1])){var se=m[S][1].charAt(0);m[S][1]=m[S][1].slice(1),w+=se,k+=se}}if(S<m.length-1&&!m[S][1]){m.splice(S,1);break}if(w.length>0||k.length>0){w.length>0&&k.length>0&&($=a(k,w),$!==0&&(V>=0?m[V][1]+=k.substring(0,$):(m.splice(0,0,[n,k.substring(0,$)]),S++),k=k.substring($),w=w.substring($)),$=u(k,w),$!==0&&(m[S][1]=k.substring(k.length-$)+m[S][1],k=k.substring(0,k.length-$),w=w.substring(0,w.length-$)));var ge=O+D;w.length===0&&k.length===0?(m.splice(S-ge,ge),S=S-ge):w.length===0?(m.splice(S-ge,ge,[t,k]),S=S-ge+1):k.length===0?(m.splice(S-ge,ge,[e,w]),S=S-ge+1):(m.splice(S-ge,ge,[e,w],[t,k]),S=S-ge+2)}S!==0&&m[S-1][0]===n?(m[S-1][1]+=m[S][1],m.splice(S,1)):S++,O=0,D=0,w="",k="";break}}m[m.length-1][1]===""&&m.pop();var Te=!1;for(S=1;S<m.length-1;)m[S-1][0]===n&&m[S+1][0]===n&&(m[S][1].substring(m[S][1].length-m[S-1][1].length)===m[S-1][1]?(m[S][1]=m[S-1][1]+m[S][1].substring(0,m[S][1].length-m[S-1][1].length),m[S+1][1]=m[S-1][1]+m[S+1][1],m.splice(S-1,1),Te=!0):m[S][1].substring(0,m[S+1][1].length)==m[S+1][1]&&(m[S-1][1]+=m[S+1][1],m[S][1]=m[S][1].substring(m[S+1][1].length)+m[S+1][1],m.splice(S+1,1),Te=!0)),S++;Te&&Q(m,B)}function z(m){return m>=55296&&m<=56319}function de(m){return m>=56320&&m<=57343}function N(m){return de(m.charCodeAt(0))}function A(m){return z(m.charCodeAt(m.length-1))}function j(m){for(var B=[],S=0;S<m.length;S++)m[S][1].length>0&&B.push(m[S]);return B}function q(m,B,S,D){return A(m)||N(D)?null:j([[n,m],[e,B],[t,S],[n,D]])}function fe(m,B,S){var D=typeof S=="number"?{index:S,length:0}:S.oldRange,O=typeof S=="number"?null:S.newRange,w=m.length,k=B.length;if(D.length===0&&(O===null||O.length===0)){var $=D.index,V=m.slice(0,$),se=m.slice($),he=O?O.index:null;e:{var ge=$+k-w;if(he!==null&&he!==ge||ge<0||ge>k)break e;var Te=B.slice(0,ge),be=B.slice(ge);if(be!==se)break e;var y=Math.min($,ge),F=V.slice(0,y),G=Te.slice(0,y);if(F!==G)break e;var X=V.slice(y),Y=Te.slice(y);return q(F,X,Y,se)}e:{if(he!==null&&he!==$)break e;var W=$,Te=B.slice(0,W),be=B.slice(W);if(Te!==V)break e;var le=Math.min(w-W,k-W),oe=se.slice(se.length-le),H=be.slice(be.length-le);if(oe!==H)break e;var X=se.slice(0,se.length-le),Y=be.slice(0,be.length-le);return q(V,X,Y,oe)}}if(D.length>0&&O&&O.length===0)e:{var F=m.slice(0,D.index),oe=m.slice(D.index+D.length),y=F.length,le=oe.length;if(k<y+le)break e;var G=B.slice(0,y),H=B.slice(k-le);if(F!==G||oe!==H)break e;var X=m.slice(y,w-le),Y=B.slice(y,k-le);return q(F,X,Y,oe)}return null}function ae(m,B,S,D){return r(m,B,S,D,!0)}return ae.INSERT=t,ae.DELETE=e,ae.EQUAL=n,Ms=ae,Ms}var gg=fg();const Ui=wt(gg);function _r(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function pg(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function mg(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function _g(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Eg(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function Cg(e){return Array.isArray(e)?e:[e]}function Rg(e){return["true","false"].includes(e.toLowerCase())}const Er="__INTERNAL_EDITOR__",Pi=`${Er}DOCS_NORMAL`,ki=`${Er}DOCS_FORMULA_BAR`,gl=`${Er}ZEN_EDITOR`,pl=`\r
2
+ `,ml="isRowStylePrecedeColumnStyle",_l=Symbol("AUTO_HEIGHT_FOR_MERGED_CELLS");function Ig(e){return`${Er}${e}`}function El(e){return e.startsWith(Er)}var Fi=Symbol("$$IDENTIFIER_DECORATOR");function yg(e){return e&&e[Fi]===!0}function $i(e){return typeof e=="function"}function Xs(e){return!!(e&&typeof e.useClass<"u")}function Qs(e){return!!(e&&typeof e.useFactory<"u")}function Js(e){return!!(e&&typeof e.useValue<"u")}function vg(e){return!!(e&&typeof e.useExisting<"u")}function qs(e){return!!(e&&typeof e.useAsync<"u")}var Cl=Symbol("AsyncHook");function Br(e){return!!(e&&e.__symbol===Cl)}function Et(e){return typeof e>"u"?"undefined":$i(e)&&!e[Fi]?e.name:e.toString()}var Sg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pt=function(e){Sg(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error);exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var Rl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zo=Symbol("$$TARGET"),Zs=Symbol("$$DEPENDENCIES"),wg=function(e){Rl(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(Et(r),'".');return e.call(this,s)||this}return t}(pt),Il=function(e){Rl(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Et(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(pt);function yl(e){var t=e;return t[Zs]||[]}function Hi(e,t){var n=yl(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new wg(t,e);return r}function Bi(e,t,n,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new Il(e,n);var o=e;o[zo]===o?o[Zs].push(i):(o[Zs]=[i],o[zo]=o)}var Vo=new Set;function mt(e){if(Vo.has(e))throw new pt('Identifier "'.concat(e,'" already exists.'));Vo.add(e);var t=function(n,r,s){Bi(n,t,s)};return t.toString=function(){return e},t[Fi]=!0,t}function Og(e,t,n){var r=Hi(e,t);r.lookUp=n}function vl(e){return function t(){return this instanceof t?this:function(n,r,s){Og(n,s,e)}}}var Sl=vl(exports.LookUp.SKIP_SELF),wl=vl(exports.LookUp.SELF),bg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function Ag(e){switch(e){case exports.Quantity.OPTIONAL:return"0 or 1";case exports.Quantity.REQUIRED:return"1";case exports.Quantity.MANY:return"0 or more"}}var ei=function(e){bg(t,e);function t(n,r,s){var i=this,o="Expect ".concat(Ag(r),' dependency item(s) for id "').concat(Et(n),'" but get ').concat(s,".");return s===0&&(o+=" Did you forget to register it?"),s>1&&(o+=" You register it more than once."),i=e.call(this,o)||this,i.quantity=r,i.actual=s,i}return t}(pt);function ji(e,t,n){if(t===exports.Quantity.OPTIONAL&&n>1||t===exports.Quantity.REQUIRED&&n!==1)throw new ei(e,t,n)}function Tg(e,t){return e===exports.Quantity.MANY?t:t[0]}function Ng(e,t,n){var r=Hi(e,t);r.quantity=n}function Wi(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)Bi(r,n,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Il(r,i);Ng(r,i,e)}}}}var Ol=Wi(exports.Quantity.MANY),bl=Wi(exports.Quantity.OPTIONAL),rt=Wi(exports.Quantity.REQUIRED);function Mg(e,t,n){var r=Hi(e,t);r.withNew=n}function Dg(e){return function t(){return this instanceof t?this:function(n,r,s){Mg(n,s,e)}}}var Al=Dg(!0);function Tl(e,t){return t===void 0&&(t=0),e?e.map(function(n,r){if(r+=t,!Array.isArray(n))return{paramIndex:r,identifier:n,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(u){if(u instanceof wl)o=exports.LookUp.SELF;else if(u instanceof Sl)o=exports.LookUp.SKIP_SELF;else if(u instanceof bl)a=exports.Quantity.OPTIONAL;else if(u instanceof Ol)a=exports.Quantity.MANY;else if(u instanceof Al)l=!0;else throw new pt("unknown dep modifier ".concat(u,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}function xg(e,t,n){n===void 0&&(n=0);var r=Tl(t,n);r.forEach(function(s){Bi(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}function Lg(e){return{unwrap:e}}function Ug(e){return!!e&&typeof e.unwrap=="function"}function Pg(e){return Ug(e)?e.unwrap():e}function ti(e){return!!e&&typeof e.dispose=="function"}var Nl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function kg(e){return e.length===1}var Rs=[];function Go(e){Rs.push(e)}function Ko(){Rs.pop()}function Fg(){Rs.length=0}var Xo=function(e){Nl(t,e);function t(n,r,s){var i='Cannot find "'.concat(Et(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(yg(n)?Et(n):n.name,'".');return e.call(this,i)||this}return t}(pt),jr=function(e){Nl(t,e);function t(n){var r=this,s='Cannot find "'.concat(Et(n),'" registered by any injector. The stack of dependencies is: "').concat(Rs.map(function(i){return Et(i)}).join(" -> "),'".');return r=e.call(this,s)||this,Fg(),r}return t}(pt),$g=function(){function e(t){var n=this;this.dependencyMap=new Map,this.normalizeDependencies(t).map(function(r){return n.add(r[0],r[1])})}return e.prototype.add=function(t,n){typeof n>"u"&&(n={useClass:t,lazy:!1});var r=this.dependencyMap.get(t);typeof r>"u"&&(r=[],this.dependencyMap.set(t,r)),r.push(n)},e.prototype.delete=function(t){this.dependencyMap.delete(t)},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return ji(t,n,r.length),Tg(n,r)},e.prototype.has=function(t){return this.dependencyMap.has(t)},e.prototype.append=function(t){var n=this;this.normalizeDependencies(t).forEach(function(r){return n.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(t){return t.map(function(n){var r=n[0],s;return kg(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),Hg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(t,n){var r=this.resolvedDependencies.get(t);typeof r>"u"&&(r=[],this.resolvedDependencies.set(t,r)),r.push(n)},e.prototype.has=function(t){return this.resolvedDependencies.has(t)},e.prototype.delete=function(t){if(this.resolvedDependencies.has(t)){var n=this.resolvedDependencies.get(t);n.forEach(function(r){return ti(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new jr(t);return ji(t,n,r.length),n===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return ti(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}(),ni;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")ni=function(t,n){var r=requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});ni=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var Bg=function(){function e(t){var n=this;this.didRun=!1,this.selfExecutor=function(){try{n.value=t()}catch(r){n.error=r}finally{n.didRun=!0}},this.disposeCallback=ni(function(){return n.selfExecutor()})}return e.prototype.hasRun=function(){return this.didRun},e.prototype.dispose=function(){this.disposeCallback()},e.prototype.getValue=function(){if(this.didRun||(this.dispose(),this.selfExecutor()),this.error)throw this.error;return this.value},e}(),jn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rs=function(){return rs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},rs.apply(this,arguments)},cn=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},jg=300,Or=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Wg=function(e){jn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Et(n),'".'))||this}return t}(pt),Yg=function(e){jn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(pt),zg=function(e){jn(t,e);function t(n){return e.call(this,'Async item "'.concat(Et(n),'" returns another async item.'))||this}return t}(pt),Vg=function(e){jn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(Et(n),'" from sync api.'))||this}return t}(pt),Qo=function(e){jn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(pt),Gg=function(e){jn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(pt),Ct=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposingCallbacks=new Set,this.disposed=!1,this.dependencyCollection=new $g(t||[]),this.resolvedDependencyCollection=new Hg,n&&n.children.push(this)}return e.prototype.onDispose=function(t){var n=this;return this.disposingCallbacks.add(t),{dispose:function(){return n.disposingCallbacks.delete(t)}}},e.prototype.createChild=function(t){return this._ensureInjectorNotDisposed(),new e(t,this)},e.prototype.dispose=function(){this.children.forEach(function(t){return t.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0,this.disposingCallbacks.forEach(function(t){return t()}),this.disposingCallbacks.clear()},e.prototype.deleteSelfFromParent=function(){if(this.parent){var t=this.parent.children.indexOf(this);t>-1&&this.parent.children.splice(t,1)}},e.prototype.add=function(t){this._ensureInjectorNotDisposed();var n=t[0],r=t[1];if(this.resolvedDependencyCollection.has(n))throw new Qo(n);typeof r>"u"?this.dependencyCollection.add(n):qs(r)||Xs(r)||Js(r)||Qs(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new Qo(n);this.dependencyCollection.delete(n),t.length===1?this.dependencyCollection.add(n):this.dependencyCollection.add(n,t[1])},e.prototype.delete=function(t){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(t))throw new Gg(t);this.dependencyCollection.delete(t)},e.prototype.invoke=function(t){for(var n=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return n._get(o,a,l)},has:function(o){return n.has(o)}};return t.apply(void 0,cn([i],r,!1))},e.prototype.has=function(t){var n;return this.dependencyCollection.has(t)||((n=this.parent)===null||n===void 0?void 0:n.has(t))||!1},e.prototype.get=function(t,n,r){this._ensureInjectorNotDisposed();var s=this._get(t,n,r);if(Array.isArray(s)&&s.some(function(i){return Br(i)})||Br(s))throw new Vg(t);return s},e.prototype._get=function(t,n,r,s){var i=exports.Quantity.REQUIRED;if(n===exports.Quantity.REQUIRED||n===exports.Quantity.OPTIONAL||n===exports.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==Or)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,exports.Quantity.REQUIRED);if(n!==Or)return Promise.resolve(n);var r=this.createDependency(t,exports.Quantity.REQUIRED);return Br(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,cn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;Go(t);try{Js(n)?s=this._resolveValueDependency(t,n):Qs(n)?s=this._resolveFactory(t,n,r):Xs(n)?s=this._resolveClass(t,n,r):vg(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),Ko()}catch(i){throw Ko(),i}return s},e.prototype._resolveExisting=function(t,n){var r=this.get(n.useExisting);return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveValueDependency=function(t,n){var r=n.useValue;return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveClass=function(t,n,r){var s=this;r===void 0&&(r=!0);var i;if(n.lazy){var o=new Bg(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(n)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var u=o.getValue(),c=u[l];return typeof c!="function"||(c=c.bind(u),a[l]=c),c}},set:function(a,l,u){return o.getValue()[l]=u,!0}})}else i=this._resolveClassImpl(n);return t&&r&&this.resolvedDependencyCollection.add(t,i),i},e.prototype._resolveClassImpl=function(t){for(var n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=t.useClass;this.markNewResolution(i);for(var o=yl(i).sort(function(v,M){return v.paramIndex-M.paramIndex}).map(function(v){return rs(rs({},v),{identifier:Pg(v.identifier)})}),a=[],l=0,u=o;l<u.length;l++){var c=u[l];try{var h=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);a.push(h)}catch(v){throw v instanceof jr||v instanceof ei&&v.actual===0?new Xo(i,c.identifier,c.paramIndex):v}}var d=cn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(Et(i)," but get ").concat(d.length,"."));var C=f-d.length;C>0?d=cn(cn([],d,!0),Array.from({length:C}).fill(void 0),!0):d=d.slice(0,f)}var R=new(i.bind.apply(i,cn(cn([void 0],d,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,R),this.markResolutionCompleted(),R},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=Tl(n.deps),o=[],a=0,l=i;a<l.length;a++){var u=l[a];try{var c=this._get(u.identifier,u.quantity,u.lookUp,u.withNew);o.push(c)}catch(d){throw d instanceof jr||d instanceof ei&&d.actual===0?new Xo(t,u.identifier,u.paramIndex):d}}var h=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,h),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,h),h},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:Cl,whenReady:function(){return r._resolveAsyncImpl(t,n)}};return s},e.prototype._resolveAsyncImpl=function(t,n){var r=this;return n.useAsync().then(function(s){var i=r.getValue(t);if(i!==Or)return i;var o;if(Array.isArray(s)){var a=s[1];if(qs(a))throw new zg(t);o=r._resolveDependency(t,a)}else $i(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:n.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(t,o),o})},e.prototype.getValue=function(t,n,r){var s=this;n===void 0&&(n=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?Or:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):(ji(t,n,0),n===exports.Quantity.MANY?[]:null)};return r===exports.LookUp.SKIP_SELF?o():t===e?this:r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():o()},e.prototype.createDependency=function(t,n,r,s){var i=this;n===void 0&&(n=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(t,n),u=null;return Array.isArray(l)?u=l.map(function(c){return i._resolveDependency(t,c,s)}):l&&(u=i._resolveDependency(t,l,s)),u},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===exports.Quantity.OPTIONAL)return null;throw Go(t),new jr(t)};return r===exports.LookUp.SKIP_SELF?a():this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=jg)throw new Wg(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Yg},e}(),Jo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,qo="REDI_GLOBAL_LOCK",Kg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Jo[qo]?Kg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
3
3
  Maybe your dependencies added redi as its dependency and bundled redi to its dist files. Or you import different versions of redi.
4
- For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):Qo[Jo]=!0;var qo="REDI_CONTEXT_LOCK",qg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Zo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;Zo[qo]?qg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):Zo[qo]=!0;var Er=wt.createContext({injector:null});Er.displayName="RediContext";var Wi=Er.Provider,Ml=Er.Consumer,rs=function(){return rs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},rs.apply(this,arguments)};function Zg(e){var t=e.children,n=e.dependencies,r=wt.useRef(null);return wt.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),wt.createElement(Ml,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(n):new Rt(n),r.current=i),wt.createElement(Wi,{value:{injector:i}},t)})}function ep(e,t){return function(r){return wt.createElement(Wi,{value:{injector:t}},wt.createElement(e,rs({},r)))}}function tp(e,t){return function(r){return wt.createElement(Zg,{dependencies:t},wt.createElement(e,rs({},r)))}}var np=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rp=function(e){np(t,e);function t(n){return e.call(this,'You should make "RediContext" as '.concat(n.constructor.name,"'s default context type. ")+"If you want to use multiple context, please check this on React doc site. https://reactjs.org/docs/context.html#classcontexttype")||this}return t}(ot);function sp(e,t,n){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new rp(r);var i=s.injector,o=i.get(e,t||exports.Quantity.REQUIRED,n);return o}}}}var ip=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),op=function(e){ip(t,e);function t(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return t}(ot);function Dl(){var e=wt.useContext(Er);if(!e.injector)throw new op;return e.injector}function ap(e,t,n){var r=Dl();return wt.useMemo(function(){return r.get(e,t,n)},[e,t,n])}var lp=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};function xl(e,t){var n=e instanceof Oe.BehaviorSubject&&typeof t>"u"?e.getValue():t,r=lt.useState(n),s=r[0],i=r[1];return lt.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function ea(e){return typeof e=="function"?e():e}function up(e,t,n,r){if(typeof e=="function"&&!r)throw new ot("Expected deps to be provided when observable is a function!");var s=lt.useRef(null),i=lt.useRef(!1),o=lt.useMemo(function(){return e},lp([],typeof r<"u"?r:[e],!0)),a=lt.useState(0);a[0];var l=a[1],u=lt.useRef(function(){var h;if(o){var c=ea(o).subscribe(function(d){i.current=!0,h=d});c.unsubscribe()}return h!=null?h:t}());if(lt.useEffect(function(){var h=null;return o&&(s.current=ea(o),h=s.current.subscribe(function(c){u.current=c,l(function(d){return d+1})})),function(){return h==null?void 0:h.unsubscribe()}},[o]),n&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return u.current}function cp(e){var t=lt.useState(0),n=t[1];lt.useEffect(function(){var r=e.subscribe(function(){return n(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var ni=new WeakMap;function hp(e,t){var n=lt.useRef(void 0),r=xl(e,t),s=lt.useMemo(function(){return lt.createContext(r)},[e]),i=lt.useCallback(function(o){return lt.createElement(s.Provider,{value:r},o.children)},[e,r]);return n.current!==e&&(n.current&&ni.delete(n.current),n.current=e,ni.set(e,s)),{Provider:i,value:r}}function dp(e){var t=ni.get(e);if(!t)throw new ot("try to read context value but no ancestor component subscribed it.");return lt.useContext(t)}function fp(e,t){t.forEach(n=>e.add(n))}function Ll(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Ul(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let i=0;i<n.length;i++){const o=n[i];if(!s(o))return!1;const a=e[o],l=t[o];if(a!==l)return!1}return!0}class ri extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class Pl extends Error{constructor(){super("Canceled by facade"),this.name="CanceledError"}}async function Fl(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function kl(e){for(const[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function ta(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function na(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function ra(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function lr(e){return typeof e=="function"}function gp(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ds=gp(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
4
+ For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):Jo[qo]=!0;function Xg(e,t){t.forEach(n=>e.add(n))}function Ml(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Dl(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let i=0;i<n.length;i++){const o=n[i];if(!s(o))return!1;const a=e[o],l=t[o];if(a!==l)return!1}return!0}class ri extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class Wr extends Error{constructor(){super("Canceled by facade"),this.name="CanceledError"}}async function xl(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Ll(e){for(const[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Zo(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ea(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function ta(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function cr(e){return typeof e=="function"}function Qg(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ds=Qg(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
5
5
  `+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
6
- `):"",this.name="UnsubscriptionError",this.errors=n}});function sa(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var $l=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ta(o),l=a.next();!l.done;l=a.next()){var u=l.value;u.remove(this)}}catch(R){t={error:R}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else o.remove(this);var h=this.initialTeardown;if(lr(h))try{h()}catch(R){i=R instanceof Ds?R.errors:[R]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var d=ta(c),f=d.next();!f.done;f=d.next()){var E=f.value;try{ia(E)}catch(R){i=i!=null?i:[],R instanceof Ds?i=ra(ra([],na(i)),na(R.errors)):i.push(R)}}}catch(R){r={error:R}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new Ds(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ia(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&sa(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&sa(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();$l.EMPTY;function pp(e){return e instanceof $l||e&&"closed"in e&&lr(e.remove)&&lr(e.add)&&lr(e.unsubscribe)}function ia(e){lr(e)?e():e.unsubscribe()}function Qe(e){let t=!1;return e?pp(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Qe(()=>{})}function mp(e){return Qe(()=>{e.unsubscribe()})}class Is{constructor(){C(this,"_disposables",new Set)}add(t){const n=Qe(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class nt{constructor(){C(this,"_disposed",!1);C(this,"_collection",new Is)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class _p extends nt{constructor(){super(...arguments);C(this,"dispose$",new Oe.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class Ep extends nt{constructor(n){super();C(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const Cr=_t("univer.context-service");class Bl extends nt{constructor(){super(...arguments);C(this,"_contextChanged$",new Oe.Subject);C(this,"contextChanged$",this._contextChanged$.asObservable());C(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new Oe.Observable(r=>{const s=this._contextChanged$.pipe(Oe.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var jl=(e=>(e[e.SILENT=0]="SILENT",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE",e))(jl||{});const At=_t("univer.log");class Hl extends nt{constructor(){super(...arguments);C(this,"_logLevel",3);C(this,"_deduction",new Set)}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}deprecate(...n){this._logLevel>=2&&this._logWithDeduplication(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}_logWithDeduplication(n,...r){const s=Cp(...r);this._deduction.has(s)||(this._deduction.add(s),this._log(n,...r))}}function Cp(...e){return e.map(t=>JSON.stringify(t)).join("")}var Rp=Object.defineProperty,Ip=Object.getOwnPropertyDescriptor,vp=(e,t,n,r)=>{for(var s=r>1?void 0:r?Ip(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&Rp(t,n,s),s},oa=(e,t)=>(n,r)=>t(n,r,e),Wn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(Wn||{});const xt=_t("anywhere.command-service");class yp{constructor(){C(this,"_commands",new Map);C(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),Qe(()=>{this._commands.delete(t.id),this._commandTypes.delete(t.id)})}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const Wl={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends nt{constructor(n,r){super();C(this,"_commandRegistry");C(this,"_beforeCommandExecutionListeners",[]);C(this,"_commandExecutedListeners",[]);C(this,"_multiCommandDisposables",new Map);C(this,"_commandExecutingLevel",0);C(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new yp,this._registerCommand(Wl)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._registerCommand(n)}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),Qe(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),Qe(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(h=>h(a,s));const u=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(h=>h(a,s)),l.dispose(),u}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof ri)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const c=_g(this._commandExecutionStack,d=>d.type===0);c&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=c.id)}const u=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(c=>c(l,s));const h=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(c=>c(l,s)),u.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof ri)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Qe(()=>mr(this._commandExecutionStack,n))}_registerCommand(n){return this._commandRegistry.registerCommand(n)}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{const o=new Is;s=new Sp(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Qe(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Qe(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=vp([oa(0,it(Rt)),oa(1,At)],exports.CommandService);class Sp{constructor(t){C(this,"name");C(this,"multi",!0);C(this,"type",0);C(this,"priority",0);C(this,"_implementations",[]);C(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(At),s=t.get(Cr),i=t.get(Rt);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Qe(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function zi(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return kl(r)}function Op(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return Fl(r)}function zl(e){return new Oe.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Yl(e){return function(n){return new Oe.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function bp(e=0){return t=>{let n=[];return t.pipe(Oe.tap(r=>n.push(r)),Oe.debounceTime(e),Oe.map(()=>n),Oe.tap(()=>n=[]))}}function wp(e){const t=new Oe.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(Oe.take(1))}const Ap=e=>new Promise(t=>{Oe.merge(zl(e.onCommandExecuted.bind(e)).pipe(Br.filter(([n])=>n.type===Wn.MUTATION)),Oe.timer(300)).pipe(Br.debounceTime(16),Br.first()).subscribe(()=>{t()})});function Vl(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function Tp(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function Gl(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function Np(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=Vl(e,t):r=Gl(e,t),n){const s=e[r];return e.indexOf(s)}return r}function Mp(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const Zn=2,Kl=1;function Dp(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:u=0,width:h=0,angle:c=0}=e,d=h,f=u,E=i,R=s;return Math.abs(a-n)>Zn||Math.abs(l-r)>Zn||Math.abs(d-E)>Zn||Math.abs(f-R)>Zn||Math.abs(c-o)>Kl}var Yi=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Yi||{}),Xe=(e=>(e[e.NONE=0]="NONE",e[e.THIN=1]="THIN",e[e.HAIR=2]="HAIR",e[e.DOTTED=3]="DOTTED",e[e.DASHED=4]="DASHED",e[e.DASH_DOT=5]="DASH_DOT",e[e.DASH_DOT_DOT=6]="DASH_DOT_DOT",e[e.DOUBLE=7]="DOUBLE",e[e.MEDIUM=8]="MEDIUM",e[e.MEDIUM_DASHED=9]="MEDIUM_DASHED",e[e.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",e[e.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",e[e.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",e[e.THICK=13]="THICK",e))(Xe||{}),Vi=(e=>(e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e.ALL="all",e.OUTSIDE="outside",e.INSIDE="inside",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.TLBR="tlbr",e.TLBC_TLMR="tlbc_tlmr",e.TLBR_TLBC_TLMR="tlbr_tlbc_tlmr",e.BLTR="bl_tr",e.MLTR_BCTR="mltr_bctr",e))(Vi||{}),Et=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Et||{}),Gi=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Gi||{}),Ki=(e=>(e[e.PASTE_NORMAL=0]="PASTE_NORMAL",e[e.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",e[e.PASTE_FORMAT=2]="PASTE_FORMAT",e[e.PASTE_FORMULA=3]="PASTE_FORMULA",e[e.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",e[e.PASTE_VALUES=5]="PASTE_VALUES",e[e.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",e[e.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",e))(Ki||{}),Xi=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Xi||{}),Qi=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Qi||{}),Ji=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Ji||{}),qi=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(qi||{});function xp(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Zi=(e=>(e[e.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",e[e.MIN=1]="MIN",e[e.MAX=2]="MAX",e[e.NUMBER=3]="NUMBER",e[e.PERCENT=4]="PERCENT",e[e.PERCENTILE=5]="PERCENTILE",e))(Zi||{}),zn=(e=>(e.EN_US="enUS",e.FR_FR="frFR",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(zn||{}),dr=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(dr||{}),eo=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(eo||{}),Xl=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(Xl||{}),Ql=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(Ql||{}),Jl=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(Jl||{}),ql=(e=>(e.SmileyFace="smileyFace",e.Heart="heart",e.LightningBolt="lightningBolt",e.Sun="sun",e.Moon="moon",e.Cloud="cloud",e.Arc="arc",e.Backpack="backpack",e.Frame="frame",e.HalfFrame="halfFrame",e.Corner="corner",e.Chord="chord",e.Pie="pie",e.Teardrop="teardrop",e.WedgeRectCallout="wedgeRectCallout",e.WedgeRRectCallout="wedgeRRectCallout",e.WedgeEllipseCallout="wedgeEllipseCallout",e.CloudCallout="cloudCallout",e.BorderCallout1="borderCallout1",e.BorderCallout2="borderCallout2",e.BorderCallout3="borderCallout3",e.AccentCallout1="accentCallout1",e.AccentCallout2="accentCallout2",e.AccentCallout3="accentCallout3",e.Callout1="callout1",e.Callout2="callout2",e.Callout3="callout3",e.ActionButtonBackPrevious="actionButtonBackPrevious",e.ActionButtonEnd="actionButtonEnd",e.ActionButtonForwardNext="actionButtonForwardNext",e.ActionButtonHelp="actionButtonHelp",e.ActionButtonHome="actionButtonHome",e.ActionButtonInformation="actionButtonInformation",e.ActionButtonMovie="actionButtonMovie",e.ActionButtonReturn="actionButtonReturn",e.ActionButtonSound="actionButtonSound",e))(ql||{}),to=(e=>(e[e.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",e[e.PAST_YEAR=1]="PAST_YEAR",e[e.PAST_MONTH=2]="PAST_MONTH",e[e.PAST_WEEK=3]="PAST_WEEK",e[e.YESTERDAY=4]="YESTERDAY",e[e.TODAY=5]="TODAY",e[e.TOMORROW=6]="TOMORROW",e))(to||{}),no=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(no||{}),Pn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",e))(Pn||{}),ro=(e=>(e[e.DASH=0]="DASH",e[e.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",e[e.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",e[e.DASHED_HEAVY=3]="DASHED_HEAVY",e[e.DASH_LONG=4]="DASH_LONG",e[e.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",e[e.DOT_DASH=6]="DOT_DASH",e[e.DOT_DOT_DASH=7]="DOT_DOT_DASH",e[e.DOTTED=8]="DOTTED",e[e.DOTTED_HEAVY=9]="DOTTED_HEAVY",e[e.DOUBLE=10]="DOUBLE",e[e.NONE=11]="NONE",e[e.SINGLE=12]="SINGLE",e[e.THICK=13]="THICK",e[e.WAVE=14]="WAVE",e[e.WAVY_DOUBLE=15]="WAVY_DOUBLE",e[e.WAVY_HEAVY=16]="WAVY_HEAVY",e[e.WORDS=17]="WORDS",e))(ro||{}),Bt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT",e[e.JUSTIFIED=4]="JUSTIFIED",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTED=6]="DISTRIBUTED",e))(Bt||{}),tn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(tn||{}),_n=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(_n||{}),ss=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(ss||{}),is=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(is||{}),Pt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Pt||{}),Se=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Se||{}),nn=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(nn||{}),ct=(e=>(e[e.DARK1=0]="DARK1",e[e.LIGHT1=1]="LIGHT1",e[e.DARK2=2]="DARK2",e[e.LIGHT2=3]="LIGHT2",e[e.ACCENT1=4]="ACCENT1",e[e.ACCENT2=5]="ACCENT2",e[e.ACCENT3=6]="ACCENT3",e[e.ACCENT4=7]="ACCENT4",e[e.ACCENT5=8]="ACCENT5",e[e.ACCENT6=9]="ACCENT6",e[e.HYPERLINK=10]="HYPERLINK",e[e.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",e))(ct||{}),vs=(e=>(e.OFFICE="Office",e.OFFICE_2007_2010="Office 2007-2010",e.GRAYSCALE="Grayscale",e.BLUE_WARM="Blue Warm",e.BLUE="Blue",e.BLUE_II="Blue II",e.BLUE_GREEN="Blue Green",e.GREEN="Green",e.GREEN_YELLOW="Green Yellow",e.YELLOW="Yellow",e.YELLOW_ORANGE="Yellow Orange",e.ORANGE="Orange",e.ORANGE_RED="Orange Red",e.RED_ORANGE="Red Orange",e.RED="Red",e.RED_VIOLET="Red Violet",e.VIOLET="Violet",e.VIOLET_II="Violet II",e.MEDIAN="Median",e.PAPER="Paper",e.MARQUEE="Marquee",e.SLIPSTREAM="Slipstream",e.Aspect="Aspect",e))(vs||{});const Lp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Up=e=>crypto.getRandomValues(new Uint8Array(e)),Pp=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s|0;for(;l--;)if(o+=e[a[l]&r]||"",o.length>=i)return o}}},Fp=(e,t=21)=>Pp(e,t|0,Up),kp=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Lp[n[e]&63];return t};const Zl=new Set(["ac","ad","ae","aero","af","ag","ai","al","am","ao","aq","ar","arpa","as","asia","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","biz","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cat","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","com","coop","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","edu","ee","eg","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gov","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","info","int","io","iq","ir","is","it","je","jm","jo","jobs","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mil","mk","ml","mm","mn","mo","mobi","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","name","nc","ne","net","nf","ng","ni","nl","no","np","nr","nu","nz","om","onion","org","pa","pe","pf","pg","ph","pk","pl","pm","pn","post","pr","pro","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tel","tf","tg","th","tj","tk","tl","tm","tn","to","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","yt","za","zm","zw"]),$p=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");function Bp(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if($p.test(e)){if(eu(e))return!0;try{const r=new URL(tu(e)).hostname.split(".").pop();if(r&&Zl.has(r))return!0}catch{return!1}}return!1}function eu(e){return/^[a-zA-Z]+:\/\//.test(e)}function jp(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function tu(e){return eu(e)?e:jp(e)?`mailto://${e}`:`https://${e}`}const Hp=/^-ms-/,Wp=/-([a-z])/g,Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function so(e,t){const n=re.getValueType(e),r=re.getValueType(t);return n!==r?!1:re.isArray(e)?zp(e,t):re.isObject(e)?Yp(e,t):re.isDate(e)?e.getTime()===t.getTime():re.isRegExp(e)?e.toString()===t.toString():e===t}function zp(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!so(s,i))return!1}return!0}function Yp(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!so(i,o))return!1}return!0}class re{static stringAt(t){let n="",r=t;for(;r>=Jt.length;)r/=Jt.length,r-=1,n+=Jt[r%Jt.length];const s=t%Jt.length;return n+=Jt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=Jt.length**i+Jt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return re.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const h=Number.parseFloat(RegExp.$1);return h===7?"IE7":h===8?"IE8":h===9?"IE9":h===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(t=21,n){return zt(t,n)}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,u)=>{var h,c;if(re.isArray(l)){const d=(h=a[u])!=null?h:[];a[u]=d,r(l,d);return}if(re.isObject(l)){const d=(c=a[u])!=null?c:{};a[u]=d,s(l,d);return}a[u]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,c;const u=o[l];if(re.isObject(u)){const d=(h=a[l])!=null?h:{};a[l]=d,s(u,d);return}if(re.isArray(u)){const d=(c=a[l])!=null?c:[];a[l]=d,r(u,d);return}a[l]=u})}function i(o){Object.keys(o).forEach(a=>{var u,h;const l=o[a];if(re.isArray(l)){const c=(u=t[a])!=null?u:[];t[a]=c,r(l,c);return}if(re.isObject(l)){const c=(h=t[a])!=null?h:{};t[a]=c,s(l,c);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return so(t,n)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){const n=[];return t.forEach((r,s)=>{n[s]=re.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=re.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isBoolean(t){return this.getValueType(t)==="[object Boolean]"}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isFunction(t){return this.getValueType(t)==="[object Function]"}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isMobile(){let t=0,n=0;return document.body.clientWidth&&(t=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||t<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const t=navigator.userAgent.toLowerCase();return String(t.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const t=navigator.userAgent;return t.indexOf("Android")>-1||t.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return Bp(t)}static normalizeUrl(t){return tu(t)}static topLevelDomainCombiningString(){return[...Zl].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return re.isDefine(t)?re.isDefine(n)?t.length===n:t.length>0:!1}static capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}static fCamelCase(t,n){return n.toUpperCase()}static camelCase(t){return t.replace(Hp,"ms-").replace(Wp,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:re.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static randSort(t){for(let n=0,r=t.length;n<r;n++){const s=Number.parseInt((Math.random()*r).toString()),i=t[s];t[s]=t[n],t[n]=i}return t}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static commonExtend1(t,n){for(const r in t)n[r]==null&&(n[r]=t[r]);return n}static arrayToObject(t){const n={};return t.forEach((r,s)=>{n[s]={},r.forEach((i,o)=>{n[s][o]=i})}),n}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-z_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function zt(e=21,t){return t?Fp(t,e)():kp(e)}function si(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const Vp=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Wr(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:u}=a;re.hasIntersectionBetweenTwoRanges(t,n,l,u)&&(l>i?(o.push(r.slice(i,l)),o.push(ii(r,{...a,ed:Math.min(u,n)}))):o.push(ii(r,{...a,st:i,ed:Math.min(u,n)}))),i=Math.max(t,Math.min(u,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function Gp(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:u={}}=a,{spaceAbove:h,spaceBelow:c,lineSpacing:d}=u,f=[];h!=null&&(typeof h=="number"?f.push(`margin-top: ${h}px`):f.push(`margin-top: ${h.v}px`)),c!=null&&(typeof c=="number"?f.push(`margin-bottom: ${c}px`):f.push(`margin-bottom: ${c.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Wr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Wr(e,o,r.length)),i}else return Wr(e,0,e.dataStream.length)}function ii(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:u,st:h,ol:c,bg:d,cl:f,va:E}=s;let R=e.slice(n,r);const O=[];return a===Se.TRUE&&(R=`<i>${R}</i>`),E===Pt.SUPERSCRIPT?R=`<sup>${R}</sup>`:E===Pt.SUBSCRIPT&&(R=`<sub>${R}</sub>`),(u==null?void 0:u.s)===Se.TRUE&&(R=`<u>${R}</u>`),(h==null?void 0:h.s)===Se.TRUE&&(R=`<s>${R}</s>`),l===Se.TRUE&&(R=`<strong>${R}</strong>`),i&&O.push(`font-family: ${i}`),f&&O.push(`color: ${f.rgb}`),o&&O.push(`font-size: ${o}pt`),c&&O.push("text-decoration: overline"),d&&O.push(`background: ${d.rgb}`),O.length?`<span style="${O.join("; ")};">${R}</span>`:R}const nu={[vs.OFFICE]:{[ct.ACCENT1]:"#4472C4",[ct.ACCENT2]:"#ED7D31",[ct.ACCENT3]:"#A5A5A5",[ct.ACCENT4]:"#70AD47",[ct.ACCENT5]:"#5B9BD5",[ct.ACCENT6]:"#70AD47",[ct.DARK1]:"#000000",[ct.DARK2]:"#44546A",[ct.LIGHT1]:"#FFFFFF",[ct.LIGHT2]:"#E7E6E6",[ct.HYPERLINK]:"#0563C1",[ct.FOLLOWED_HYPERLINK]:"#954F72"}};class Rr{constructor(){C(this,"_themeValue",ct.LIGHT1);C(this,"_themeColors");C(this,"_themeTint");C(this,"_rgbValue","");C(this,"_colorType");this._colorType=Et.UNSUPPORTED,this._themeColors=vs.OFFICE,this._themeTint=0}asRgbColor(){return new os(this._rgbValue,this)}asThemeColor(){return new as(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case Et.THEME:return this.asThemeColor();case Et.RGB:return this.asRgbColor();case Et.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=Et.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=Et.THEME,this._themeColors=t}setThemeTint(t){this._colorType=Et.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=Et.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class En{constructor(t){C(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new Rr().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new En(this._builder)}equals(t){return!1}}class ru{constructor(t){C(this,"_saturation",0);C(this,"_hue",0);C(this,"_lightness",0);C(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new Rr;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,u=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(u*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const vt=class vt extends En{constructor(n,r){super(r);C(this,"_cssString");C(this,"_red");C(this,"_green");C(this,"_blue");C(this,"_alpha");let s=n.match(vt.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(vt.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return En.rgbColorToHexValue(this)}getRed(){let n=this._red+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return Et.RGB}clone(){return new vt(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof vt?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};C(vt,"RGB_COLOR_AMT",0),C(vt,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),C(vt,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let os=vt;const Zt=class Zt extends En{constructor(n,r,s,i){super(i);C(this,"_themeColorType");C(this,"_themeTint");C(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=nu[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Zt._cacheThemeColor.has(this._themeColors)){if(s=Zt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Zt._cacheThemeColor.set(this._themeColors,s);const i=new ru(En.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new Zt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof Zt?n._themeColorType===this._themeColorType:!1}getColorType(){return Et.THEME}getThemeColorType(){return this._themeColorType}};C(Zt,"_cacheThemeColor",new Map);let as=Zt;const Kp="rgb(",Xp="rgba(",oi={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class bt{constructor(t){C(this,"_color");C(this,"_rgbColor");C(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof bt){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=su(t);if(n==null){this._setNullColor();return}this._color=n;const r=em(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var u,h;r=Math.min(1,Math.max(0,r));const s=new bt(t).toRgb(),i=new bt(n).toRgb(),o=(u=s.a)!=null?u:1,a=(h=i.a)!=null?h:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new bt(l)}static getContrastRatio(t,n){const r=new bt(t).getLuminance(),s=new bt(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Ar(Math.round(n).toString(16)),Ar(Math.round(r).toString(16)),Ar(Math.round(s).toString(16)),Ar(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return sm(this.toRgb())}toHsl(){return rm(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}setAlpha(t){return new bt({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=xs(t),n=xs(n),r=xs(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Ar=e=>e.length===1?`0${e}`:e,xs=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),su=e=>{if(om(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim();if(oi[t]){const n=oi[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return Qp(t);if(t.startsWith("rgb"))return Jp(t);if(t.startsWith("hsl"))return qp(t);if(t.startsWith("hsv"))return Zp(t)},Qp=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},Jp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},qp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Zp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},em=e=>{const t=su(e);if(t!=null)return"r"in t?t:"l"in t?tm(t):nm(t)},Ls=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),tm=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;s=Ls(u,l,t+1/3),i=Ls(u,l,t),o=Ls(u,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},nm=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),u=s%6,h=[r,a,o,o,l,r][u],c=[l,r,r,a,o,o][u],d=[o,o,l,r,r,a][u],f={r:h*255,g:c*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},rm=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const h=s-i;switch(l=o>.5?h/(2-s-i):h/(s+i),s){case t:a=(n-r)/h+(n<r?6:0);break;case n:a=(r-t)/h+2;break;default:a=(t-n)/h+4;break}a/=6}const u={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(u.a=e.a),u},sm=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,u=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const h={h:Math.round(o*360),s:Math.round(u*100),v:Math.round(a*100)};return e.a!==void 0&&(h.a=e.a),h},im=e=>e==null,om=e=>!im(e)&&typeof e=="object";function am(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function lm(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}var Pe=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Pe||{});function um(e){return e&&(e.s!==void 0||e.p!==void 0||e.v!==void 0||e.t!==void 0||e.f!==void 0||e.si!==void 0||e.custom!==void 0)}function cm(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return nn.STRING;if(typeof e.v=="number")return nn.NUMBER;if(typeof e.v=="boolean")return nn.BOOLEAN}function hm(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,custom:i}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||i!=null)}function dm(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var xe=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(xe||{}),tt=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(tt||{});function fm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var iu=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(iu||{}),ou=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(ou||{});function gm(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let u=0;u<n.length;u++){const{startRow:h,endRow:c,startColumn:d,endColumn:f}=n[u];if(e===h&&t===d){i=c,o=f,a=h,l=d,s=!0;break}if(e>=h&&e<=c&&t>=d&&t<=f){i=c,o=f,a=h,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var bn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(bn||{});function au(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:u}=e,h=t,c=n,d=t,f=n;if(r&&i){const{startRow:E,startColumn:R,endRow:O,endColumn:U,startY:ne,endY:X,startX:de,endX:N}=i;h=E,c=R,d=O,f=U,o=ne,a=X,l=de,u=N}return s&&(o=i.startY,a=i.endY,l=i.startX,u=i.endX,d=i.endRow,f=i.endColumn),{startRow:h,startColumn:c,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:u}}const pm=au;function mm(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let u=t,h=n,c=t,d=n;return(r||s)&&(u=i,h=o,c=a,d=l),{startRow:u,startColumn:h,endRow:c,endColumn:d}}function lu(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function _m(e){return lu(e)&&(e==null?void 0:e.coverable)!==!1}function Mt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Rr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function Em(e){return re.isString(e)&&e.substring(0,1)==="="&&e.length>1}function Cm(e){return re.isString(e)&&e.length>0}function Rm(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Mt(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Mt(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Mt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Mt(e.bg)}; `)}],["bd",()=>{var o,a,l,u,h,c,d,f,E,R,O,U;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Tr((a=e.bd)==null?void 0:a.b.s)} ${(l=Mt(e.bd.b.cl))!=null?l:""}; `),(u=e.bd)!=null&&u.t&&(n+=`border-top: ${Tr((h=e.bd)==null?void 0:h.t.s)} ${(c=Mt(e.bd.t.cl))!=null?c:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Tr((f=e.bd)==null?void 0:f.r.s)} ${(E=Mt(e.bd.r.cl))!=null?E:""}; `),(R=e.bd)!=null&&R.l&&(n+=`border-left: ${Tr((O=e.bd)==null?void 0:O.l.s)} ${(U=Mt(e.bd.l.cl))!=null?U:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Mt(e.cl)}; `)}],["va",()=>{e.va===Pt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===Pt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Pn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Pn.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===Bt.LEFT?n+="text-align: left; ":e.ht===Bt.RIGHT?n+="text-align: right; ":e.ht===Bt.CENTER?n+="text-align: center; ":e.ht===Bt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===tn.BOTTOM?n+="vertical-align: bottom; ":e.vt===tn.TOP?n+="vertical-align: top; ":e.vt===tn.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===_n.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===_n.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,c,d,f,E,R,O,U;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(c=e.pd)==null?void 0:c.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,u=`${(f=e.pd)==null?void 0:f.r}pt`;(E=e.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(R=e.pd)!=null&&R.t&&(n+=`padding-top: ${a}; `),(O=e.pd)!=null&&O.l&&(n+=`padding-left: ${l}; `),(U=e.pd)!=null&&U.r&&(n+=`padding-right: ${u}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Tr(e){let t="";return e===Xe.NONE?t="none":e===Xe.THIN?t="0.5pt solid":e===Xe.HAIR?t="0.5pt double":e===Xe.DOTTED?t="0.5pt dotted":e===Xe.DASHED||e===Xe.DASH_DOT?t="0.5pt dashed":e===Xe.DASH_DOT_DOT?t="0.5pt dotted":e===Xe.DOUBLE?t="0.5pt double":e===Xe.MEDIUM?t="1pt solid":e===Xe.MEDIUM_DASHED||e===Xe.MEDIUM_DASH_DOT?t="1pt dashed":e===Xe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Xe.SLANT_DASH_DOT?t="0.5pt dashed":e===Xe.THICK&&(t="1.5pt solid"),t}function Im(e){let t=0;if(e=e.trim(),e==="none")t=Xe.NONE;else if(e==="0.5pt solid")t=Xe.THIN;else if(e==="0.5pt double")t=Xe.HAIR;else if(e==="0.5pt dotted")t=Xe.DOTTED;else if(e==="0.5pt dashed")t=Xe.DASHED;else if(e==="1pt solid")t=Xe.MEDIUM;else if(e==="1pt dashed")t=Xe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Xe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Xe.THICK;else if(!e.includes("none"))t=Xe.THIN;else return Xe.NONE;return t}function vm(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function ym(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===xe.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===xe.ROW||o!==xe.ROW&&o!==xe.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function Sm(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function io(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>io(e[n],t[n])):e===t:!1}function uu(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:io(n,r)}function Om(e,t){return t.some(n=>e.indexOf(n)>-1)}var zr={exports:{}},bm=zr.exports,aa;function wm(){return aa||(aa=1,function(e,t){(function(n,r){e.exports=r()})(bm,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",u="day",h="week",c="month",d="quarter",f="year",E="date",R="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ne={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var b=["th","st","nd","rd"],S=M%100;return"["+M+(b[(S-20)%10]||b[S]||b[0])+"]"}},X=function(M,b,S){var F=String(M);return!F||F.length>=b?M:""+Array(b+1-F.length).join(S)+M},de={s:X,z:function(M){var b=-M.utcOffset(),S=Math.abs(b),F=Math.floor(S/60),$=S%60;return(b<=0?"+":"-")+X(F,2,"0")+":"+X($,2,"0")},m:function M(b,S){if(b.date()<S.date())return-M(S,b);var F=12*(S.year()-b.year())+(S.month()-b.month()),$=b.clone().add(F,c),Y=S-$<0,se=b.clone().add(F+(Y?-1:1),c);return+(-(F+(S-$)/(Y?$-se:se-$))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:c,y:f,w:h,d:u,D:E,h:l,m:a,s:o,ms:i,Q:d}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},N="en",A={};A[N]=ne;var H="$isDayjsObject",J=function(M){return M instanceof j||!(!M||!M[H])},fe=function M(b,S,F){var $;if(!b)return N;if(typeof b=="string"){var Y=b.toLowerCase();A[Y]&&($=Y),S&&(A[Y]=S,$=Y);var se=b.split("-");if(!$&&se.length>1)return M(se[0])}else{var he=b.name;A[he]=b,$=he}return!F&&$&&(N=$),$||!F&&N},ae=function(M,b){if(J(M))return M.clone();var S=typeof b=="object"?b:{};return S.date=M,S.args=arguments,new j(S)},m=de;m.l=fe,m.i=J,m.w=function(M,b){return ae(M,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var j=function(){function M(S){this.$L=fe(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[H]=!0}var b=M.prototype;return b.parse=function(S){this.$d=function(F){var $=F.date,Y=F.utc;if($===null)return new Date(NaN);if(m.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var se=$.match(O);if(se){var he=se[2]-1||0,ge=(se[7]||"0").substring(0,3);return Y?new Date(Date.UTC(se[1],he,se[3]||1,se[4]||0,se[5]||0,se[6]||0,ge)):new Date(se[1],he,se[3]||1,se[4]||0,se[5]||0,se[6]||0,ge)}}return new Date($)}(S),this.init()},b.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},b.$utils=function(){return m},b.isValid=function(){return this.$d.toString()!==R},b.isSame=function(S,F){var $=ae(S);return this.startOf(F)<=$&&$<=this.endOf(F)},b.isAfter=function(S,F){return ae(S)<this.startOf(F)},b.isBefore=function(S,F){return this.endOf(F)<ae(S)},b.$g=function(S,F,$){return m.u(S)?this[F]:this.set($,S)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(S,F){var $=this,Y=!!m.u(F)||F,se=m.p(S),he=function(z,W){var le=m.w($.$u?Date.UTC($.$y,W,z):new Date($.$y,W,z),$);return Y?le:le.endOf(u)},ge=function(z,W){return m.w($.toDate()[z].apply($.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(W)),$)},Te=this.$W,we=this.$M,v=this.$D,k="set"+(this.$u?"UTC":"");switch(se){case f:return Y?he(1,0):he(31,11);case c:return Y?he(1,we):he(0,we+1);case h:var V=this.$locale().weekStart||0,K=(Te<V?Te+7:Te)-V;return he(Y?v-K:v+(6-K),we);case u:case E:return ge(k+"Hours",0);case l:return ge(k+"Minutes",1);case a:return ge(k+"Seconds",2);case o:return ge(k+"Milliseconds",3);default:return this.clone()}},b.endOf=function(S){return this.startOf(S,!1)},b.$set=function(S,F){var $,Y=m.p(S),se="set"+(this.$u?"UTC":""),he=($={},$[u]=se+"Date",$[E]=se+"Date",$[c]=se+"Month",$[f]=se+"FullYear",$[l]=se+"Hours",$[a]=se+"Minutes",$[o]=se+"Seconds",$[i]=se+"Milliseconds",$)[Y],ge=Y===u?this.$D+(F-this.$W):F;if(Y===c||Y===f){var Te=this.clone().set(E,1);Te.$d[he](ge),Te.init(),this.$d=Te.set(E,Math.min(this.$D,Te.daysInMonth())).$d}else he&&this.$d[he](ge);return this.init(),this},b.set=function(S,F){return this.clone().$set(S,F)},b.get=function(S){return this[m.p(S)]()},b.add=function(S,F){var $,Y=this;S=Number(S);var se=m.p(F),he=function(we){var v=ae(Y);return m.w(v.date(v.date()+Math.round(we*S)),Y)};if(se===c)return this.set(c,this.$M+S);if(se===f)return this.set(f,this.$y+S);if(se===u)return he(1);if(se===h)return he(7);var ge=($={},$[a]=r,$[l]=s,$[o]=n,$)[se]||1,Te=this.$d.getTime()+S*ge;return m.w(Te,this)},b.subtract=function(S,F){return this.add(-1*S,F)},b.format=function(S){var F=this,$=this.$locale();if(!this.isValid())return $.invalidDate||R;var Y=S||"YYYY-MM-DDTHH:mm:ssZ",se=m.z(this),he=this.$H,ge=this.$m,Te=this.$M,we=$.weekdays,v=$.months,k=$.meridiem,V=function(W,le,oe,B){return W&&(W[le]||W(F,Y))||oe[le].slice(0,B)},K=function(W){return m.s(he%12||12,W,"0")},z=k||function(W,le,oe){var B=W<12?"AM":"PM";return oe?B.toLowerCase():B};return Y.replace(U,function(W,le){return le||function(oe){switch(oe){case"YY":return String(F.$y).slice(-2);case"YYYY":return m.s(F.$y,4,"0");case"M":return Te+1;case"MM":return m.s(Te+1,2,"0");case"MMM":return V($.monthsShort,Te,v,3);case"MMMM":return V(v,Te);case"D":return F.$D;case"DD":return m.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return V($.weekdaysMin,F.$W,we,2);case"ddd":return V($.weekdaysShort,F.$W,we,3);case"dddd":return we[F.$W];case"H":return String(he);case"HH":return m.s(he,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return z(he,ge,!0);case"A":return z(he,ge,!1);case"m":return String(ge);case"mm":return m.s(ge,2,"0");case"s":return String(F.$s);case"ss":return m.s(F.$s,2,"0");case"SSS":return m.s(F.$ms,3,"0");case"Z":return se}return null}(W)||se.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(S,F,$){var Y,se=this,he=m.p(F),ge=ae(S),Te=(ge.utcOffset()-this.utcOffset())*r,we=this-ge,v=function(){return m.m(se,ge)};switch(he){case f:Y=v()/12;break;case c:Y=v();break;case d:Y=v()/3;break;case h:Y=(we-Te)/6048e5;break;case u:Y=(we-Te)/864e5;break;case l:Y=we/s;break;case a:Y=we/r;break;case o:Y=we/n;break;default:Y=we}return $?Y:m.a(Y)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return A[this.$L]},b.locale=function(S,F){if(!S)return this.$L;var $=this.clone(),Y=fe(S,F,!0);return Y&&($.$L=Y),$},b.clone=function(){return m.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},M}(),y=j.prototype;return ae.prototype=y,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",u],["$M",c],["$y",f],["$D",E]].forEach(function(M){y[M[1]]=function(b){return this.$g(b,M[0],M[1])}}),ae.extend=function(M,b){return M.$i||(M(b,j,ae),M.$i=!0),ae},ae.locale=fe,ae.isDayjs=J,ae.unix=function(M){return ae(1e3*M)},ae.en=A[N],ae.Ls=A,ae.p={},ae})}(zr)),zr.exports}var Am=wm();const Kt=St(Am);var Yr={exports:{}},Tm=Yr.exports,la;function Nm(){return la||(la=1,function(e,t){(function(n,r){e.exports=r()})(Tm,function(){return function(n,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var u=this.$utils(),h=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(c){switch(c){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),c==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),c==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),c==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return c}});return i.bind(this)(h)}}})}(Yr)),Yr.exports}var Mm=Nm();const Dm=St(Mm);var Vr={exports:{}},xm=Vr.exports,ua;function Lm(){return ua||(ua=1,function(e,t){(function(n,r){e.exports=r()})(xm,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(O){return(O=+O)+(O>68?1900:2e3)},h=function(O){return function(U){this[O]=+U}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(O){(this.zone||(this.zone={})).offset=function(U){if(!U||U==="Z")return 0;var ne=U.match(/([+-]|\d\d)/g),X=60*ne[1]+(+ne[2]||0);return X===0?0:ne[0]==="+"?-X:X}(O)}],d=function(O){var U=l[O];return U&&(U.indexOf?U:U.s.concat(U.f))},f=function(O,U){var ne,X=l.meridiem;if(X){for(var de=1;de<=24;de+=1)if(O.indexOf(X(de,0,U))>-1){ne=de>12;break}}else ne=O===(U?"pm":"PM");return ne},E={A:[a,function(O){this.afternoon=f(O,!1)}],a:[a,function(O){this.afternoon=f(O,!0)}],Q:[s,function(O){this.month=3*(O-1)+1}],S:[s,function(O){this.milliseconds=100*+O}],SS:[i,function(O){this.milliseconds=10*+O}],SSS:[/\d{3}/,function(O){this.milliseconds=+O}],s:[o,h("seconds")],ss:[o,h("seconds")],m:[o,h("minutes")],mm:[o,h("minutes")],H:[o,h("hours")],h:[o,h("hours")],HH:[o,h("hours")],hh:[o,h("hours")],D:[o,h("day")],DD:[i,h("day")],Do:[a,function(O){var U=l.ordinal,ne=O.match(/\d+/);if(this.day=ne[0],U)for(var X=1;X<=31;X+=1)U(X).replace(/\[|\]/g,"")===O&&(this.day=X)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(O){var U=d("months"),ne=(d("monthsShort")||U.map(function(X){return X.slice(0,3)})).indexOf(O)+1;if(ne<1)throw new Error;this.month=ne%12||ne}],MMMM:[a,function(O){var U=d("months").indexOf(O)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(O){this.year=u(O)}],YYYY:[/\d{4}/,h("year")],Z:c,ZZ:c};function R(O){var U,ne;U=O,ne=l&&l.formats;for(var X=(O=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(ae,m,j){var y=j&&j.toUpperCase();return m||ne[j]||n[j]||ne[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,b,S){return b||S.slice(1)})})).match(r),de=X.length,N=0;N<de;N+=1){var A=X[N],H=E[A],J=H&&H[0],fe=H&&H[1];X[N]=fe?{regex:J,parser:fe}:A.replace(/^\[|\]$/g,"")}return function(ae){for(var m={},j=0,y=0;j<de;j+=1){var M=X[j];if(typeof M=="string")y+=M.length;else{var b=M.regex,S=M.parser,F=ae.slice(y),$=b.exec(F)[0];S.call(m,$),ae=ae.replace($,"")}}return function(Y){var se=Y.afternoon;if(se!==void 0){var he=Y.hours;se?he<12&&(Y.hours+=12):he===12&&(Y.hours=0),delete Y.afternoon}}(m),m}}return function(O,U,ne){ne.p.customParseFormat=!0,O&&O.parseTwoDigitYear&&(u=O.parseTwoDigitYear);var X=U.prototype,de=X.parse;X.parse=function(N){var A=N.date,H=N.utc,J=N.args;this.$u=H;var fe=J[1];if(typeof fe=="string"){var ae=J[2]===!0,m=J[3]===!0,j=ae||m,y=J[2];m&&(y=J[2]),l=this.$locale(),!ae&&y&&(l=ne.Ls[y]),this.$d=function(F,$,Y,se){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*F);var he=R($)(F),ge=he.year,Te=he.month,we=he.day,v=he.hours,k=he.minutes,V=he.seconds,K=he.milliseconds,z=he.zone,W=he.week,le=new Date,oe=we||(ge||Te?1:le.getDate()),B=ge||le.getFullYear(),ee=0;ge&&!Te||(ee=Te>0?Te-1:le.getMonth());var ie,pe=v||0,be=k||0,De=V||0,G=K||0;return z?new Date(Date.UTC(B,ee,oe,pe,be,De,G+60*z.offset*1e3)):Y?new Date(Date.UTC(B,ee,oe,pe,be,De,G)):(ie=new Date(B,ee,oe,pe,be,De,G),W&&(ie=se(ie).week(W).toDate()),ie)}catch{return new Date("")}}(A,fe,H,ne),this.init(),y&&y!==!0&&(this.$L=this.locale(y).$L),j&&A!=this.format(fe)&&(this.$d=new Date("")),l={}}else if(fe instanceof Array)for(var M=fe.length,b=1;b<=M;b+=1){J[1]=fe[b-1];var S=ne.apply(this,J);if(S.isValid()){this.$d=S.$d,this.$L=S.$L,this.init();break}b===M&&(this.$d=new Date(""))}else de.call(this,N)}}})}(Vr)),Vr.exports}var Um=Lm();const Pm=St(Um);var Gr={exports:{}},Fm=Gr.exports,ca;function km(){return ca||(ca=1,function(e,t){(function(n,r){e.exports=r()})(Fm,function(){return function(n,r,s){var i=r.prototype,o=function(c){return c&&(c.indexOf?c:c.s)},a=function(c,d,f,E,R){var O=c.name?c:c.$locale(),U=o(O[d]),ne=o(O[f]),X=U||ne.map(function(N){return N.slice(0,E)});if(!R)return X;var de=O.weekStart;return X.map(function(N,A){return X[(A+(de||0))%7]})},l=function(){return s.Ls[s.locale()]},u=function(c,d){return c.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(E,R,O){return R||O.slice(1)})}(c.formats[d.toUpperCase()])},h=function(){var c=this;return{months:function(d){return d?d.format("MMMM"):a(c,"months")},monthsShort:function(d){return d?d.format("MMM"):a(c,"monthsShort","months",3)},firstDayOfWeek:function(){return c.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(c,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(c,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(c,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return u(c.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return h.bind(this)()},s.localeData=function(){var c=l();return{firstDayOfWeek:function(){return c.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return u(c,d)},meridiem:c.meridiem,ordinal:c.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(c){return a(l(),"weekdays",null,null,c)},s.weekdaysShort=function(c){return a(l(),"weekdaysShort","weekdays",3,c)},s.weekdaysMin=function(c){return a(l(),"weekdaysMin","weekdays",2,c)}}})}(Gr)),Gr.exports}var $m=km();const Bm=St($m);var Kr={exports:{}},jm=Kr.exports,ha;function Hm(){return ha||(ha=1,function(e,t){(function(n,r){e.exports=r()})(jm,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,h=function(c,d){return c.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,E,R){var O=R&&R.toUpperCase();return E||d[R]||n[R]||d[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,ne,X){return ne||X.slice(1)})})}(l,u===void 0?{}:u);return a.call(this,h)}}})}(Kr)),Kr.exports}var Wm=Hm();const zm=St(Wm);var Xr={exports:{}},Ym=Xr.exports,da;function Vm(){return da||(da=1,function(e,t){(function(n,r){e.exports=r()})(Ym,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(R){var O={date:R,utc:!0,args:arguments};return new o(O)},l.utc=function(R){var O=a(this.toDate(),{locale:this.$L,utc:!0});return R?O.add(this.utcOffset(),n):O},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(R){R.utc&&(this.$u=!0),this.$utils().u(R.$offset)||(this.$offset=R.$offset),u.call(this,R)};var h=l.init;l.init=function(){if(this.$u){var R=this.$d;this.$y=R.getUTCFullYear(),this.$M=R.getUTCMonth(),this.$D=R.getUTCDate(),this.$W=R.getUTCDay(),this.$H=R.getUTCHours(),this.$m=R.getUTCMinutes(),this.$s=R.getUTCSeconds(),this.$ms=R.getUTCMilliseconds()}else h.call(this)};var c=l.utcOffset;l.utcOffset=function(R,O){var U=this.$utils().u;if(U(R))return this.$u?0:U(this.$offset)?c.call(this):this.$offset;if(typeof R=="string"&&(R=function(N){N===void 0&&(N="");var A=N.match(r);if(!A)return null;var H=(""+A[0]).match(s)||["-",0,0],J=H[0],fe=60*+H[1]+ +H[2];return fe===0?0:J==="+"?fe:-fe}(R),R===null))return this;var ne=Math.abs(R)<=16?60*R:R,X=this;if(O)return X.$offset=ne,X.$u=R===0,X;if(R!==0){var de=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(X=this.local().add(ne+de,n)).$offset=ne,X.$x.$localOffset=de}else X=this.utc();return X};var d=l.format;l.format=function(R){var O=R||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,O)},l.valueOf=function(){var R=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*R},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(R){return R==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var E=l.diff;l.diff=function(R,O,U){if(R&&this.$u===R.$u)return E.call(this,R,O,U);var ne=this.local(),X=a(R).local();return E.call(ne,X,O,U)}}})}(Xr)),Xr.exports}var Gm=Vm();const Km=St(Gm);var Qr={exports:{}},Xm=Qr.exports,fa;function Qm(){return fa||(fa=1,function(e,t){(function(n,r){e.exports=r()})(Xm,function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}})}(Qr)),Qr.exports}var Jm=Qm();const qm=St(Jm);var Jr={exports:{}},Zm=Jr.exports,ga;function e_(){return ga||(ga=1,function(e,t){(function(n,r){e.exports=r()})(Zm,function(){var n="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(r).add(1,r).date(u),c=o(this).endOf(n);if(h.isBefore(c))return 1}var d=o(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),f=this.diff(d,n,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(Jr)),Jr.exports}var t_=e_();const n_=St(t_);var qr={exports:{}},r_=qr.exports,pa;function s_(){return pa||(pa=1,function(e,t){(function(n,r){e.exports=r()})(r_,function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}})}(qr)),qr.exports}var i_=s_();const o_=St(i_);Kt.extend(Pm);Kt.extend(Dm);Kt.extend(qm);Kt.extend(Bm);Kt.extend(n_);Kt.extend(o_);Kt.extend(Km);Kt.extend(zm);function ys(e,t,n,r){if(e>t)throw new Error("a1 should be less than a2");if(n>r)throw new Error("b1 should be less than b2");if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];const s=r-n+1;return e<n&&t>r?[e,t-s]:n<=e&&r<t?[r+1-s,t-s]:n>e&&r>=t?[e,n-1]:[e,t]}function a_(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function l_(e){if(e==null)return!1;const t=e.paragraphStyle;return cu(t)}function cu(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function hu(e,t,n){return e.slice(0,t)+n+e.slice(t)}function du(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const u_=/\s/g;function c_(e){return e===null||e.toString().replace(u_,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function h_(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}const Ke=Symbol("newer"),rt=Symbol("older");class d_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ke],{done:!1,value:t.key}):{done:!0,value:void 0}}}class f_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ke],{done:!1,value:t.value}):{done:!0,value:void 0}}}class g_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ke],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}var Ka,Xa;Xa=Ke,Ka=rt;class ma{constructor(t,n){C(this,"key");C(this,"value");C(this,Xa);C(this,Ka);this.key=t,this.value=n,this[Ke]=void 0,this[rt]=void 0}toJSON(){return{key:this.key,value:this.value}}}class fr{constructor(...t){C(this,"_keymap");C(this,"size",0);C(this,"limit");C(this,"oldest");C(this,"newest");C(this,"_onShiftListeners",[]);if(er.hasLength(t,1)){if(er.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(er.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(er.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),Qe(()=>mr(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Ke]&&(t===this.oldest&&(this.oldest=t[Ke]),t[Ke][rt]=t[rt]),t[rt]&&(t[rt][Ke]=t[Ke]),t[Ke]=void 0,t[rt]=this.newest,this.newest&&(this.newest[Ke]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new ma(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ke]=o,o[rt]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new ma(t,n)),this.newest?(this.newest[Ke]=r,r[rt]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Ke]?(this.oldest=this.oldest[Ke],this.oldest[rt]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ke]=t[rt]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Ke]&&n[rt]?(n[rt][Ke]=n[Ke],n[Ke][rt]=n[rt]):n[Ke]?(n[Ke][rt]=void 0,this.oldest=n[Ke]):n[rt]?(n[rt][Ke]=void 0,this.newest=n[rt]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new d_(this.oldest)}values(){return new f_(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new g_(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Ke]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Ke];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ke],n&&(t+=" < ");return t}}class er{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}var Zr={exports:{}},p_=Zr.exports,_a;function m_(){return _a||(_a=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:p_,function(){return function(){var n={d:function(_,g){for(var p in g)n.o(g,p)&&!n.o(_,p)&&Object.defineProperty(_,p,{enumerable:!0,get:g[p]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};n.d(r,{default:function(){return ft}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function u(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function h(_){const g=u(_);let p=null;if(g){const w=l(g);p=o[w.lang]||o[w.language]||null}return p}function c(_){return Object.assign({},a,_)}function d(_,g){const p=typeof g=="object"?g:l(g);return o[p.lang]=c(_),p.language===p.lang||o[p.language]||(o[p.language]=c(_)),o[p.lang]}const f=c({group:","});function E(_,g){if(typeof _!="number")return _;if(_<0)return-E(-_,g);if(g){const p=10**(g||0)||1;return E(_*p,0)/p}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function R(_,g,p){const w=_<0?-1:1,T=10**(g||2),L=10**(p||2);let x,P,I=Math.abs(_),q=0,_e=0,Q=0,me=1;if((_=I)%1==0)P=[_*w,1];else if(_<1e-19)P=[w,1e19];else if(_>1e19)P=[1e19*w,1];else{do if(I=1/(I-Math.floor(I)),x=me,me=me*Math.floor(I)+q,q=x,_e=Q,Q=Math.floor(_*me+.5),Q>=T||me>=L)return[w*_e,q];while(Math.abs(_-Q/me)>=1e-10&&I!==Math.floor(I));P=[w*Q,me]}return P}const O={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},U=Object.assign({},O);function ne(_){if(_===null&&(_=O),_){for(const g in _)if(g in O){const p=_[g];U[g]=p==null?O[g]:p}}return{...U}}const X={"#":"",0:"0","?":" "},de={"@":"text","-":"minus","+":"plus"},N=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],A=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],H=new RegExp("["+A.join("")+"]");function J(_,g,p){return g[p+"_max"]=_.length,g[p+"_min"]=_.replace(/#/g,"").length,g}const fe={};function ae(_){if(!(_ in fe)){const g=[],p=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,w=>"?".repeat(w.length));for(let w=0;w<p.length;w++){const T=p.charAt(w);g[w]=T in X?X[T]:T}fe[_]=g.join("")}return fe[_]}function m(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,X["?"])}),g.push(_)}function j(_){const g=[],p={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:g};let w=_+"",T="int",L=!1,x=null;const P=[];let I,q,_e=!1;for(;w&&!L;){if(I=/^General/i.exec(w))p.general=!0,m({type:"general"},g);else if(T==="int"&&(I=/^[#?0]+(?:,[#?0]+)*/.exec(w))||T==="den"&&(I=/^[#?\d]+/.exec(w))||(I=/^[#?0]+/.exec(w)))p[T+"_pattern"].push(I[0]),x={type:T,num:I[0]},m(x,g);else if((I=/^\//.exec(w))&&p[T+"_pattern"].length){if(!x)throw new SyntaxError("Missing a numerator in pattern ".concat(_));p.fractions=!0,p.num_pattern.push(p[T+"_pattern"].pop()),x.type="num",T="den",m({type:"div"},g)}else if(I=/^,+/.exec(w)){const D=w.charAt(1)in X;q.slice(-1)in X&&(I[0].length>1||!D)?p.scale=.001**I[0].length:p.dec_fractions||m(I[0],g)}else{if(I=/^;/.exec(w)){L=!0;break}if(I=/^[@+-]/.exec(w))I[0]==="@"&&(p.text=!0),m({type:de[I[0]]},g);else if(I=/^(?:\[(h+|m+|s+)\])/i.exec(w)){const D=I[1].toLowerCase(),Z=D[0],Ce={type:"",size:0,date:1,raw:I[0],pad:D.length};Z==="h"?(Ce.size=16,Ce.type="hour-elap"):Z==="m"?(Ce.size=32,Ce.type="min-elap"):(Ce.size=64,Ce.type="sec-elap"),p.date=p.date|Ce.size,P.push(Ce),m(Ce,g)}else if(I=/^(?:B2)/i.exec(w))_e||(p.date_system=6);else if(I=/^(?:B1)/i.exec(w))_e||(p.date_system=1);else if(I=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(w)){const D={type:"",size:0,date:1,raw:I[0]},Z=I[0].toLowerCase(),Ce=Z[0];if(Z==="y"||Z==="yy")D.size=2,D.type="year-short";else if(Ce==="y"||Ce==="e")D.size=2,D.type="year";else if(Z==="b"||Z==="bb")D.size=2,D.type="b-year-short";else if(Ce==="b")D.size=2,D.type="b-year";else if(Z==="d"||Z==="dd")D.size=8,D.type="day",D.pad=/dd/.test(Z);else if(Z==="ddd")D.size=8,D.type="weekday-short";else if(Ce==="d")D.size=8,D.type="weekday";else if(Ce==="h")D.size=16,D.type="hour",D.pad=/hh/i.test(Z);else if(Ce==="m"){Z.length===3?(D.size=4,D.type="monthname-short"):Z.length===5?(D.size=4,D.type="monthname-single"):Z.length>=4&&(D.size=4,D.type="monthname");const Ae=P[P.length-1];!D.type&&Ae&&!Ae.used&&80&Ae.size&&(Ae.used=!0,D.size=32,D.type="min",D.pad=/mm/.test(Z)),D.type||(D.size=4,D.type="month",D.pad=/mm/.test(Z),D.indeterminate=!0)}else if(Ce==="s"){D.size=64,D.type="sec",D.pad=/ss/.test(Z);const Ae=P[P.length-1];Ae&&32&Ae.size?D.used=!0:Ae&&Ae.indeterminate&&(delete Ae.indeterminate,Ae.size=32,Ae.type="min",D.used=!0)}p.date=p.date|D.size,p.date_eval=!0,P.push(D),m(D,g)}else if(I=/^(?:AM\/PM|am\/pm|A\/P)/.exec(w))p.clock=12,p.date=16|p.date,p.date_eval=!0,m({type:"am",short:I[0]==="A/P"},g);else if(p.date&&(I=/^\.0{1,3}/i.exec(w))){const D=I[0].length-1,Z=[64,128,256,512][D];p.date=p.date|Z,p.date_eval=!0,p.sec_decimals=Math.max(p.sec_decimals,D),m({type:"subsec",size:Z,decimals:D,date:1,raw:I[0]},g)}else if((I=/^\\(.)/.exec(w))||(I=/^"([^"]*?)"/.exec(w)))m(I[1],g);else if(I=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(w))p.condition=[I[1],parseFloat(I[2],10)];else if(I=/^\[\$([^\]]+)\]/.exec(w)){const D=I[1].split("-"),Z=D.length<2?"":D[D.length-1],Ce=D[0];Ce&&m(Ce,g);const Ae=u(Z);Ae&&(p.locale=Ae);const Ue=parseInt(Z,16);isFinite(Ue)&&16711680&Ue&&(Ue>>16&255)===6&&(p.date_system=6),_e=!0}else if(I=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(w))p.color=I[2]?N[parseInt(I[2],10)]||"#000":I[1].toLowerCase();else if(!(I=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(w))){if(I=/^%/.exec(w))p.scale=100,p.percent=!0,m("%",g);else if(I=/^_(\\.|.)/.exec(w))m(" ",g);else if(I=/^\./.exec(w))m({type:"point",value:I[0]},g),p.dec_fractions=!0,T="frac";else if(I=/^[Ee]([+-]?|(?=[0#?]))/.exec(w))p.exponential=!0,p.exp_plus=I[1]==="+",T="man",m({type:"exp",plus:I[1]==="+"},g);else if(!(I=/^\*(\\.|.)/.exec(w))){if(I=/^[BENn[]/.exec(w))throw new SyntaxError("Unexpected char ".concat(w.charAt(0)," in pattern ").concat(_));w[0]==="("&&(p.parens=!0),I=[w[0]],m(I[0],g)}}}q=I[0],w=w.slice(I?I[0].length:1)}if(p.pattern=_.slice(0,_.length-w.length),/^((?:\[[^\]]+\])+)(;|$)/.test(p.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(p.pattern)&&m({type:"text"},g),p.fractions&&p.dec_fractions||p.fractions&&p.exponential)throw new SyntaxError("Invalid pattern: ".concat(p.pattern));const Q=p.int_pattern.join("");if(p.grouping=Q.indexOf(",")>=0,p.grouping){const D=Q.split(","),Z=D.length;Z===2?(p.group_pri=D[1].length,p.group_sec=p.group_pri):Z>2&&(p.group_pri=D[Z-1].length,p.group_sec=D[Z-2].length)}else p.group_pri=0,p.group_sec=0;J(Q.replace(/[,]/g,""),p,"int"),J(p.frac_pattern.join(""),p,"frac"),J(p.man_pattern.join(""),p,"man");let me=p.num_pattern.join(""),ye=p.den_pattern.join("");const ue=/\?/.test(ye)||/\?/.test(me);return ye=ye.replace(/\d/g,ue?"?":"#"),ue&&(ye=ye.replace(/#$/g,"?")),J(me,p,"num"),J(ye,p,"den"),ue&&(me=me.replace(/#$/g,"?")),p.int_padding=ae(p.int_pattern.join("")),p.man_padding=ae(p.man_pattern.join("")),p.num_padding=ae(me),p.den_padding=ae(ye),p.den_pattern.length&&(p.denominator=parseInt(p.den_pattern.join("").replace(/\D/g,""),10)),p.integer=!!p.int_pattern.join("").length,p.fractions&&g.forEach((D,Z)=>{const Ce=g[Z+1];D.type==="string"&&Ce&&(Ce.type==="num"?D.rule="num+int":Ce.type==="div"?D.rule="num":Ce.type==="den"&&(D.rule="den"))}),p}const y=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function M(_){const g=[];let p,w=!1,T=null,L=_,x=0,P=!1,I=0,q=0;do{if(P=j(L),(P.date||P.general)&&(P.int_pattern.length||P.frac_pattern.length||P.scale!==1||P.text))throw new Error("Illegal format");if(P.condition&&(q++,w=!0),P.text){if(T)throw new Error("Unexpected partition");T=P}P.locale&&(p=u(P.locale)),g.push(P),x=L.charAt(P.pattern.length)===";"?1:0,L=L.slice(P.pattern.length+x),I++}while(x&&I<4&&q<3);if(x)throw new Error("Unexpected partition");if(q>2)throw new Error("Unexpected condition");const _e=g[3];if(_e&&(_e.int_pattern.length||_e.frac_pattern.length||_e.date))throw new Error("Unexpected partition");if(w){const Q=g.length;if(Q===1&&(g[1]=j("General"),g[1].generated=!0),Q<3){const me=g[0],ye=g[1];if(y(me),ye.condition)y(ye);else{const ue=me.condition;(ue[0]==="="||ue[1]>=0&&(ue[0]===">"||ue[0]===">="))&&ye.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(y)}else{if(g.length<4&&T)for(let Q=0,me=g.length;Q<me;Q++)g[Q]===T&&g.splice(Q,1);if(g.length<1&&T&&(g[0]=j("General"),g[0].generated=!0),g.length<2){const Q=j(g[0].pattern);Q.tokens.unshift({type:"minus",volatile:!0}),Q.generated=!0,g.push(Q)}if(g.length<3){const Q=j(g[0].pattern);Q.generated=!0,g.push(Q)}if(g.length<4)if(T)g.push(T);else{const Q=j("@");Q.generated=!0,g.push(Q)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:p}}const b=Math.floor;function S(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let p=_+68569+2415019;const w=b(4*p/146097);p-=b((146097*w+3)/4);const T=b(4e3*(p+1)/1461001);p=p-b(1461*T/4)+31;const L=b(80*p/2447),x=p-b(2447*L/80);p=b(L/11);const P=L+2-12*p;return[0|100*(w-49)+T+p,0|P,0|x]}function F(_){return S(_+1462)}function $(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,p=.1335;let w=_+466935;const T=b(w/10631);w-=10631*T;const L=b((w-p)/g);w-=b(L*g+p);const x=b((w+28.5001)/29.5);return x===13?[30*T+L,12,30]:[30*T+L,x,w-b(29.5001*x-29)]}function Y(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const w=b(_);return g===6?$(w):g===-1?F(w):S(w,p)}const se=Math.floor,he=86400;function ge(_,g){let p=null;if(Array.isArray(_)){const[w,T,L,x,P,I]=_;p=Date.UTC(w,T==null?0:T-1,L!=null?L:1,x||0,P||0,I||0)}else if(_ instanceof Date&&(p=1*_,!g||!g.ignoreTimezone)){const w=new Date;w.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),w.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),p=1*w}if(p!=null&&isFinite(p)){const w=p/864e5;return w-(w<=-25509?-25568:-25569)}return _}function Te(_,g){let p=0|_;const w=he*(_-p);let T=se(w);w-T>.9999&&(T+=1,T===he&&(T=0,p+=1));const L=T<0?he+T:T,[x,P,I]=Y(_,0,g&&g.leap1900),q=se(L/60/60)%60,_e=se(L/60)%60,Q=se(L)%60;if(g&&g.nativeDate){const me=new Date(0);return me.setUTCFullYear(x,P-1,I),me.setUTCHours(q,_e,Q),me}return[x,P,I,q,_e,Q]}function we(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function v(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function k(_){const[g,p,w,T]=_;return!(g&&!g.generated||p&&!p.generated||w&&!w.generated||!T||!T.text||T.generated)}const V={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},K=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],z={total:1,sign:0,period:0,int:1,frac:0},W=(_,g)=>_.replace(/\./,g.decimal);function le(_,g,p,w){const T=0|p;if(typeof p=="string")_.push(p);else if(p===T)_.push(Math.abs(T));else{const L=Math.abs(p);let x=L?Math.floor(Math.log10(L)):0,P=x<0?L*10**-x:L/10**x;P===10&&(P=1,x++);const I=function(_e){let Q=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const me=Math.abs(_e);if(!me)return z;const ye=Q&&_e<0?1:0,ue=Math.floor(me),D=Math.floor(Math.log10(me)+1);let Z=0,Ce=0;if(ue!==me){Z=1;const Ae=String(E(D<0?me*10**-D:me/10**D,15));let Ue=Ae.length,Fe=!0,He=0;for(;He<=Ae.length;){if(Ae[He]==="."){Ue--;break}Ae[He]==="0"&&Fe?Ue--:Fe=!1,He++}Ce=Ue-D,Ce<0&&(Ce=0,Z=0)}return{total:ye+Math.max(D,1)+Z+Ce,digits:Math.max(D,0)+Ce,sign:ye,period:Z,int:Math.max(D,1),frac:Ce}}(L),q=()=>{const _e=Math.abs(x);let Q;Q=P===1?P:E(P,5),_.push(W(Q+"",w),w.exponent,x<0?w.negative:w.positive,_e<10?"0":"",_e)};if(x>=-4&&x<=-1){const _e=L.toPrecision(10+x).replace(/\.?0+$/,"");_.push(W(_e,w))}else if(x===10){const _e=L.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(W(_e,w))}else if(Math.abs(x)<=9)if(I.total<=11){const _e=E(L,9).toFixed(I.frac);_.push(W(_e,w))}else x===9?_.push(Math.floor(L)):x>=0&&x<9?_.push(E(L,9-x)):q();else I.total>=12?q():Math.floor(L)===L?_.push(Math.floor(L)):_.push(W(E(L,9).toFixed(I.frac),w))}return _}const oe=86400,B={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},ee=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const p=Math.floor(Math.log10(_));return g>1?Math.floor(p/g)*g:p};function ie(_,g,p,w){let T="",L="",x="",P="",I="",q=0,_e=0|_,Q=0,me=0,ye=1,ue=0,D=0,Z=0,Ce=0,Ae=0,Ue=0;const Fe=w||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(Ie){if(Ie===0)return Ie;const Me=Math.ceil(Math.log10(Ie<0?-Ie:Ie)),te=10**(16-Math.floor(Me));return Math.round(Ie*te)/te}(_*g.scale)),g.exponential){let Ie=Math.abs(_);if(Ie){const Me=10**-ee(Ie,g.int_max),te=E(Ie*Me,g.frac_max)/Me;q=ee(te,g.int_max)}Ie/=10**q,_=_<0?-Ie:Ie,T+=Math.abs(q)}if(g.integer){const Ie=Math.abs(E(_,g.fractions?1:g.frac_max));I+=Ie<1?"":Math.floor(Ie)}if(g.grouping){let Ie="",Me=I.length;for(Me>g.group_pri&&(Me-=g.group_pri,Ie=Fe.group+I.slice(Me,Me+g.group_pri)+Ie);Me>g.group_sec;)Me-=g.group_sec,Ie=Fe.group+I.slice(Me,Me+g.group_sec)+Ie;I=Me?I.slice(0,Me)+Ie:Ie}g.dec_fractions&&(P=String(E(_,g.frac_max)).split(".")[1]||"");let He=!1;if(g.fractions){const Ie=Math.abs(g.integer?_%1:_);if(Ie)if(He=!0,isFinite(g.denominator))x+=g.denominator,L+=E(Ie*g.denominator),L==="0"&&(L="",x="",He=!1,I||(I="0"));else{const Me=R(Ie,g.integer?g.num_max:1/0,g.den_max);L+=Me[0],x+=Me[1],g.integer&&L==="0"&&(I||(I="0"),L="",x="",He=!1)}}if(g.date){_e=Math.trunc(_);const Ie=oe*(_-_e);if(Q=Math.floor(Ie),Ue=Ie-Q,Math.abs(Ue)<1e-6?Ue=0:Ue>.9999&&(Ue=0,Q+=1,Q===oe&&(Q=0,_e+=1)),Ue){const Me=512&g.date||256&g.date||128&g.date;(Me===512&&Ue>.9995||Me===256&&Ue>.995||Me===128&&Ue>.95||!Me&&Ue>=.5)&&(Q++,Ue=0)}if(_e||g.date_system){const Me=Y(_,g.date_system,p.leap1900);me=Me[0],ye=Me[1],ue=Me[2]}if(Q){const Me=Q<0?oe+Q:Q;Ae=Math.floor(Me)%60,Ce=Math.floor(Me/60)%60,Z=Math.floor(Me/60/60)%60}if(D=(6+_e)%7,g.date_eval&&(gt=_,pt=_e+Q/oe,p.dateSpanLarge?gt<-694324||pt>=35830291:gt<0||pt>=2958466)){if(p.dateErrorThrows)throw new Error("Date out of bounds");return p.dateErrorNumber?le(_<0?[Fe.negative]:[],0,_,Fe).join(""):p.overflow}}var gt,pt;if(g.int_padding&&(I=g.int_padding.length===1?I||g.int_padding:g.int_padding.substring(0,g.int_padding.length-I.length)+I),g.num_padding&&(L=g.num_padding.length===1?L||g.num_padding:g.num_padding.substring(0,g.num_padding.length-L.length)+L),g.den_padding&&(x=g.den_padding.length===1?x||g.den_padding:x+g.den_padding.slice(x.length)),g.man_padding){const Ie=g.exp_plus?"+":"";T=g.man_padding.length===1?(q<0?"-":Ie)+(T||g.man_padding):(q<0?"-":Ie)+g.man_padding.slice(0,g.man_padding.length-T.length)+T}const Ee=[];let Ze=0;const ve={int:0,frac:0,man:0,num:0,den:0};for(let Ie=0,Me=g.tokens.length;Ie<Me;Ie++){const te=g.tokens[Ie],ut=te.num?te.num.length:0;if(te.type==="string")te.rule?te.rule==="num"?He?Ee.push(te.value):(g.num_min>0||g.den_min>0)&&Ee.push(te.value.replace(/./g,X["?"])):te.rule==="num+int"?He&&I?Ee.push(te.value):g.den_min>0&&(I||g.num_min)&&Ee.push(te.value.replace(/./g,X["?"])):te.rule==="den"&&(He?Ee.push(te.value):(g.den_min>0||g.den_min>0)&&Ee.push(te.value.replace(/./g,X["?"]))):Ee.push(te.value);else if(te.type==="error")Ee.push(p.invalid);else if(te.type==="point")Ee.push(g.date?te.value:Fe.decimal);else if(te.type==="general")le(Ee,0,_,Fe);else if(te.type==="exp")Ee.push(Fe.exponent);else if(te.type==="minus")te.volatile&&g.date||te.volatile&&(_>=0||typeof _!="number")||(te.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&I&&I!=="0"||P)&&Ee.push(Fe.negative):Ee.push(Fe.negative));else if(te.type==="plus")Ee.push(Fe.positive);else if(te.type==="text")Ee.push(_);else if(te.type==="div")He?Ee.push("/"):g.num_min>0||g.den_min>0?Ee.push(X["?"]):Ee.push(X["#"]);else if(te.type==="int")if(g.int_pattern.length===1)Ee.push(I);else{const Be=Ze?g.int_pattern.join("").length-ve.int:1/0,Nt=Ze===g.int_pattern.length-1?0:g.int_pattern.join("").length-(ve.int+te.num.length);Ee.push(I.substring(I.length-Be,I.length-Nt)),Ze++,ve.int+=te.num.length}else if(te.type==="frac"){const Be=ve.frac;for(let Nt=0;Nt<ut;Nt++)Ee.push(P[Nt+Be]||X[te.num[Nt]]);ve.frac+=ut}else if(te.type in B)g[te.type+"_pattern"].length===1?(te.type==="int"&&Ee.push(I),te.type==="frac"&&Ee.push(P),te.type==="man"&&Ee.push(T),te.type==="num"&&Ee.push(L),te.type==="den"&&Ee.push(x)):(Ee.push(B[te.type].slice(ve[te.type],ve[te.type]+ut)),ve[te.type]+=ut);else if(te.type==="year")me<0&&Ee.push(Fe.negative),Ee.push(String(Math.abs(me)).padStart(4,"0"));else if(te.type==="year-short"){const Be=me%100;Ee.push(Be<10?"0":"",Be)}else if(te.type==="month")Ee.push(te.pad&&ye<10?"0":"",ye);else if(te.type==="monthname-single")g.date_system===6?Ee.push(Fe.mmmm6[ye-1].charAt(0)):Ee.push(Fe.mmmm[ye-1].charAt(0));else if(te.type==="monthname-short")g.date_system===6?Ee.push(Fe.mmm6[ye-1]):Ee.push(Fe.mmm[ye-1]);else if(te.type==="monthname")g.date_system===6?Ee.push(Fe.mmmm6[ye-1]):Ee.push(Fe.mmmm[ye-1]);else if(te.type==="weekday-short")Ee.push(Fe.ddd[D]);else if(te.type==="weekday")Ee.push(Fe.dddd[D]);else if(te.type==="day")Ee.push(te.pad&&ue<10?"0":"",ue);else if(te.type==="hour"){const Be=Z%g.clock||(g.clock<24?g.clock:0);Ee.push(te.pad&&Be<10?"0":"",Be)}else if(te.type==="min")Ee.push(te.pad&&Ce<10?"0":"",Ce);else if(te.type==="sec")Ee.push(te.pad&&Ae<10?"0":"",Ae);else if(te.type==="subsec"){Ee.push(Fe.decimal);const Be=Ue.toFixed(g.sec_decimals);Ee.push(Be.slice(2,2+te.decimals))}else if(te.type==="am"){const Be=Z<12?0:1;te.short&&!w?Ee.push("AP"[Be]):Ee.push(Fe.ampm[Be])}else if(te.type==="hour-elap"){_<0&&Ee.push(Fe.negative);const Be=24*_e+Math.floor(Math.abs(Q)/3600);Ee.push(String(Math.abs(Be)).padStart(te.pad,"0"))}else if(te.type==="min-elap"){_<0&&Ee.push(Fe.negative);const Be=1440*_e+Math.floor(Math.abs(Q)/60);Ee.push(String(Math.abs(Be)).padStart(te.pad,"0"))}else if(te.type==="sec-elap"){_<0&&Ee.push(Fe.negative);const Be=_e*oe+Math.abs(Q);Ee.push(String(Math.abs(Be)).padStart(te.pad,"0"))}else if(te.type==="b-year")Ee.push(me+543);else if(te.type==="b-year-short"){const Be=(me+543)%100;Ee.push(Be<10?"0":"",Be)}}return p.nbsp?Ee.join(""):Ee.join("").replace(/\u00a0/g," ")}function pe(_,g){for(let p=0;p<3;p++){const w=g[p];if(w){let T;if(w.condition){const L=w.condition[0],x=w.condition[1];L==="="?T=_===x:L===">"?T=_>x:L==="<"?T=_<x:L===">="?T=_>=x:L==="<="?T=_<=x:L==="<>"&&(T=_!==x)}else T=!0;if(T)return w}}}const be=j("@"),De="black",G={};function Re(_,g){if(_){const p=_[0];g[p]=g[p]||{},Re(_.slice(1),g[p])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","m-d-y","m-d-Y","m-j-y","m-j-Y","n-d-y","n-d-Y","n-j-y","n-j-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"].forEach(_=>{Re(_,G),Re(_+" x",G),Re(_+" l",G),Re(_+" l x",G),Re("l "+_,G),Re("l "+_+" x",G),Re(_+" D",G),Re(_+" D x",G),Re("D "+_,G),Re("D "+_+" x",G)});const Ye={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},je={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Le={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},Je=new Date().getUTCFullYear();function It(_){const g=new RegExp("^([\\s+%"+A.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+A.join("")+")]*)$").exec(_);if(g){const[,p,w,T,L,x]=g;let P=1,I="",q=!1,_e=!1,Q=!1,me=!1,ye=!1,ue=null,D=!1,Z=parseFloat(w.replace(/,/g,""));if(!isFinite(Z))return null;for(let Ae=0;Ae<p.length;Ae++){const Ue=p[Ae];if(Ue==="-"){if(q||_e)return null;q=!0,P=-1}else if(H.test(Ue)){if(ye)return null;ye=!0,ue=Ue}else if(Ue==="("){if(_e||q)return null;_e=!0,P=-1}else if(Ue==="%"){if(me)return null;me=!0}}for(let Ae=0;Ae<x.length;Ae++){const Ue=x[Ae];if(H.test(Ue)){if(ye)return null;ye=!0,ue=Ue,D=!0}else if(Ue===")"){if(Q||!_e)return null;Q=!0}else if(Ue==="%"){if(me)return null;me=!0}}if(L){if(me||ye)return null;I="0.00E+00"}else if(me){if(ye)return null;I=T.includes(".")?"0.00%":"0%",Z*=.01}else if(ye){const Ae=T.includes(".")?"#,##0.00":"#,##0";I=D?Ae+ue:ue+Ae}else T.includes(",")&&(I=T.includes(".")?"#,##0.00":"#,##0");const Ce={v:Z*P};return I&&(Ce.z=I),Ce}}const Ve=(_,g,p)=>{const w=p.path||"",T=Object.keys(g);for(let L=0;L<T.length;L++){let x;const P=T[L];if(g[P]){if(P==="$"||P==="€")_||(x=p);else if(P==="-"){const I=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(I){const q=I[1]==="-"||I[1]==="/"||I[1]==="."?I[1]:" ";if(!p.sep||p.sep===q){const _e=I[0].replace(/\s+/g," ");x=Ve(_.slice(I[0].length),g[P],{...p,sep:q,path:w+_e})}}}else if(P===" "){const I=/^[,.]?\s+/.exec(_);if(I){const q=I[0].replace(/\s+/g," ");x=Ve(_.slice(I[0].length),g[P],{...p,path:w+q})}}else if(P==="j"||P==="d"){const I=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);I&&(x=Ve(_.slice(I[0].length),g[P],{...p,day:I[0],path:w+P}))}else if(P==="n"||P==="m"){const I=/^(0?[1-9]|1[012])\b/.exec(_);I&&(x=Ve(_.slice(I[0].length),g[P],{...p,month:+I[0],_mon:I[0],path:w+P}))}else if(P==="F"||P==="M"){const I=/^([a-z]{3,9})\b/i.exec(_),q=I&&(P==="F"?je:Ye)[I[0].toLowerCase()];q&&(x=Ve(_.slice(I[0].length),g[P],{...p,month:q,_mon:I[0],path:w+P}))}else if(P==="l"||P==="D"){const I=/^([a-z]{3,9})\b/i.exec(_);(I&&Le[I[0].toLowerCase()])===P&&(x=Ve(_.slice(I[0].length),g[P],{...p,path:w+P}))}else if(P==="y"){const I=/^\d\d\b/.exec(_);if(I){const q=+I[0]>=30?+I[0]+1900:+I[0]+2e3;x=Ve(_.slice(I[0].length),g[P],{...p,year:q,path:w+P})}}else if(P==="Y"){const I=/^\d\d\d\d\b/.exec(_);I&&(x=Ve(_.slice(I[0].length),g[P],{...p,year:+I[0],path:w+P}))}else{if(P!=="x")throw new Error('Unknown date token "'.concat(P,'"'));{const I=Ge(_);I&&(x=Ve("",g[P],{...p,time:I.v,tf:I.z,path:w+P}))}}if(x)return x}}};function et(_,g){const p=Ve(_.trim(),G,{path:""});if(p){var w;if(p.sep==="."&&p.path.length===3)return null;const T=+((w=p.year)!==null&&w!==void 0?w:Je);if(p.day||(p.day=1),!function(P,I,q){if(q<1||I<1||I>12)return!1;if(I===2){if(q>(P%4==0&&P%100!=0||P%400==0||P===1900?29:28))return!1}else if((I===4||I===6||I===9||I===11)&&q>30||(I===1||I===3||I===5||I===7||I===8||I===10||I===12)&&q>31)return!1;return!0}(T,p.month,p.day))return null;let L=-1/0;if(T<1900)return null;T<=1900&&p.month<=2?L=25568:T<1e4&&(L=25569);const x=Date.UTC(T,p.month-1,p.day)/864e5+L+(p.time||0);if(x>=0&&x<=2958465){const P=p._mon[0]==="0"||p.day[0]==="0"||p._mon.length===2&&p.day.length===2,I=p.path.replace(/[jdlDnmMFyYx-]/g,q=>q==="j"||q==="d"?P?"dd":"d":q==="D"?"ddd":q==="l"?"dddd":q==="n"||q==="m"?P?"mm":"m":q==="M"?"mmm":q==="F"?"mmmm":q==="y"?"yy":q==="x"?p.tf||"":q==="Y"?"yyyy":q);return g&&g.nativeDate?{v:Te(x,g),z:I}:{v:x,z:I}}}return null}function Ge(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,p,w,T,L,x]=g;if(L&&!T||!x&&!w&&!T)return null;let P=1*(p||0);if(x){if(P>=13)return null;x[0]!=="p"&&x[0]!=="P"||(P+=12)}return{v:(60*P*60+60*(1*(w||0))+1*(T||0)+1*(L||0))/86400,z:(p.length===2?"hh":"h")+":mm"+(T?":ss":"")+(x?" AM/PM":"")}}return null}function dt(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const at={};function kt(_,g){const{pattern:p,partitions:w,locale:T}=_,L=I=>{const q=Object.assign({},ne(),g,I);return T&&(q.locale=T),q},x=(I,q)=>{const _e=L(q);return function(Q,me,ye){const ue=h(ye.locale),D=me[3]?me[3]:be;if(typeof Q=="boolean"&&(Q=Q?"TRUE":"FALSE"),Q==null)return"";if(typeof Q!="number")return ie(Q,D,ye,ue);if(!isFinite(Q)){const Ce=ue||f;return isNaN(Q)?Ce.nan:(Q<0?Ce.negative:"")+Ce.infinity}const Z=pe(Q,me);return Z?ie(Q,Z,ye,ue):ye.overflow}(ge(I,_e),w,_e)};x.color=(I,q)=>function(_e,Q){if(typeof _e!="number"||!isFinite(_e))return(Q[3]?Q[3].color:be.color)||De;const me=pe(_e,Q);return me&&me.color||De}(ge(I,L(q)),w);const P=function(I){var q;let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[Q,me]=I,ye=Q.frac_max,ue={type:"general",isDate:v(I),isText:k(I),isPercent:we(I),maxDecimals:Q.general?9:ye,scale:(q=Q.scale)!==null&&q!==void 0?q:1,color:0,parentheses:0,grouped:Q.grouping?1:0,_partitions:I},D=!ue.isDate&&!ue.isText&&!Q.error&&Q.tokens.some(Fe=>Fe.type==="string"&&(_e?Fe.value===_e:H.test(Fe.value)));let Z="G",Ce=ye>=0?Math.min(15,ye):"",Ae="",Ue="";if(me&&me.color&&(Ue="-",ue.color=1),Q.parens&&(Ae="()",ue.parentheses=1),D)Z="C",ue.type="currency";else if(Q.error)ue.type="error",ue.maxDecimals=0;else if(ue.isDate){let Fe=0,He=0,gt="";Q.tokens.forEach(Ee=>{const Ze=Ee.type;/^(b-)?year/.test(Ze)?(gt+="Y",He++):Ze.startsWith("month")?(gt+="M",He++):/^(week)?day/.test(Ze)?(gt+="D",He++):Ze!=="hour"&&Ze!=="min"&&Ze!=="sec"&&Ze!=="am"||(gt+=Ze[0],Fe++)}),ue.type="date",He&&Fe?ue.type="datetime":!He&&Fe&&(ue.type="time");const pt=K.find(Ee=>gt.startsWith(Ee[0]));Z=pt?"D":"G",Ce=pt?pt[1]:""}else ue.isText?(Z="G",ue.type="text",Ce="",ue.maxDecimals=0):Q.general?(Z="G",ue.type="general",Ce=""):Q.fractions?(Z="G",ue.type="fraction",Ce=""):Q.exponential?(Z="S",ue.type="scientific"):ue.isPercent?(Z="P",ue.type="percent"):Q.grouping?(Z=",",ue.type="grouped"):(Q.int_max||ye)&&(Z="F",ue.type="number");return ue.code=Z+Ce+Ue+Ae,ue.level=V[ue.type],Object.freeze(ue)}(w,(g||{}).currency)||new SyntaxError;return x.info=P,x.dateInfo=function(I){const[q]=I;return{year:!!(2&q.date),month:!!(4&q.date),day:!!(8&q.date),hours:!!(16&q.date),minutes:!!(32&q.date),seconds:!!(64&q.date),clockType:q.clock===12?12:24}}(w),x.isPercent=()=>!!P.isPercent,x.isDate=()=>!!P.isDate,x.isText=()=>!!P.isText,x.pattern=p,_.error&&(x.error=_.error),x.options=L,x.locale=T||g&&g.locale||"",Object.freeze(x)}function ke(_,g){_||(_="General");let p=null;return at[_]?p=at[_]:(p=Object.assign({},ne(),g).throws?M(_):function(w){try{return M(w)}catch(T){const L={tokens:[{type:"error"}],error:T.message};return{pattern:w,partitions:[L,L,L,L],error:T.message,locale:null}}}(_),p.error||(at[_]=p)),kt(p,g)}ke.isDate=_=>ke(_,{throws:!1}).isDate(),ke.isPercent=_=>ke(_,{throws:!1}).isPercent(),ke.isText=_=>ke(_,{throws:!1}).isText(),ke.getInfo=(_,g)=>ke(_,{...g,throws:!1}).info,ke.getDateInfo=(_,g)=>ke(_,{...g,throws:!1}).dateInfo,ke.dateToSerial=ge,ke.dateFromSerial=Te,ke.options=ne,ke.dec2frac=R,ke.round=E,ke.codeToLocale=s,ke.parseLocale=l,ke.getLocale=h,ke.addLocale=(_,g)=>{const p=l(g);return delete at[p.lang],delete at[p.language],d(_,p)},ke.format=function(_,g,p){let w=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const T=p&&typeof p=="object"?p:{locale:p,throws:!w};return ke(_,T)(ge(g,T),T)},ke.is_date=ke.isDate,ke.parseNumber=It,ke.parseDate=et,ke.parseTime=Ge,ke.parseBool=dt,ke.parseValue=function(_,g){var p,w,T;return(p=(w=(T=It(_))!==null&&T!==void 0?T:et(_,g))!==null&&w!==void 0?w:Ge(_))!==null&&p!==void 0?p:dt(_)};var ft=ke;return r=r.default}()})}(Zr)),Zr.exports}var Us,Ea;function __(){return Ea||(Ea=1,Us=m_()),Us}var E_=__();const C_=St(E_),fu=C_;function rn(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function ai(e,t,n){const r=rn(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function li(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function R_(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let u=0;for(let h=0;h<s;h++,u++){const c=r[h];l[u]=n[c]}for(let h=0;h<a;h++,u++){const c=o[h];l[u]=i[c]}return l}function I_(e,t,n){const r=n;if(rn(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function ui(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?v_(e,t,n,r):y_(e,t,n,r)}function v_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function y_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class Lt{constructor(t={}){C(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new Lt({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){ui(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{ui(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)ai(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&ai(r,void 0,i)})}removeRows(t,n){li(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&li(t,n,s)})}getFragment(t,n,r,s){const i=new Lt;let o=0;for(let a=t;a<=n;a++){const l={};let u=0;for(let h=r;h<=s;h++){const c=this.getValue(a,h);l[u]=c,u++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new Lt;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,re.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return rn(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=rn(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new Lt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const u=Number(l);s?u<n&&(n=u):(s=!0,n=u);const h=this.getValue(o,u);i.setValue(o-t,u-n,h)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const u=rn(l)-1;u>r&&(r=u),Object.keys(l).forEach(h=>{const c=Number(h);o?c<n&&(n=c):(o=!0,n=c)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}merge(t){this.forValue((n,r)=>{const s=t.getValue(n,r);s!=null&&this.setValue(n,r,s)})}_setOriginValue(t={}){this._matrix=t}}const S_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},O_={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},b_={startRow:0,startColumn:0,endRow:0,endColumn:0},w_={row:0,column:0},ht={ff:"Arial",fs:11,it:Se.FALSE,bl:Se.FALSE,ul:{s:Se.FALSE},st:{s:Se.FALSE},ol:{s:Se.FALSE},tr:{a:0,v:Se.FALSE},td:Pn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Bt.UNSPECIFIED,vt:tn.UNSPECIFIED,tb:_n.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},gu={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},A_=[Ui,ml,Pi];var pu=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(pu||{});function Nr(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Se.FALSE;switch(e){case"bl":case"it":{if(o[e]===Se.FALSE)return Se.FALSE;break}case"ul":case"st":{if(o[e].s===Se.FALSE)return Se.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
7
- `)===r?Se.TRUE:Se.FALSE}const cr=class cr{constructor(t,n,r){C(this,"_range");C(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Lt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Lt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=re.numToWord(r+1)+(t+1),o=re.numToWord(s+1)+(n+1)):(i=re.numToWord(s+1)+(n+1),o=re.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ht.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new cr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let u=0;u<=r-n;u++)for(let h=0;h<=i-s;h++){if(o==null||((a=o==null?void 0:o[u])==null?void 0:a[h])==null)continue;const c=o[u][h].s;c&&(o[u][h].s=l.get(c))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ht.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Nr("ul",t.body)===Se.TRUE?{s:Se.TRUE}:{s:Se.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Nr("st",t.body)===Se.TRUE?{s:Se.TRUE}:{s:Se.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Nr("it",t.body)===Se.TRUE?ss.ITALIC:ss.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Nr("bl",t.body)===Se.TRUE?is.BOLD:is.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===_n.WRAP?Se.TRUE:Se.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){cr.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||ht[t]}))}};C(cr,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===xe.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===xe.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===xe.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let Fn=cr;function T_(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||tt.NONE,o=s.endAbsoluteRefType||tt.NONE,a=s.rangeType||xe.NORMAL;if(!r&&i===tt.ALL&&o===tt.ALL)return s;const l=Ca(s.startRow,n,s.startColumn,t,a),u=Ca(s.endRow,n,s.endColumn,t,a);return r||i===tt.NONE&&o===tt.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:u.row,endColumn:u.column}:(i===tt.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===tt.COLUMN?s={...s,startRow:l.row}:i===tt.ROW&&(s={...s,startColumn:l.column}),o===tt.NONE?s={...s,endRow:u.row,endColumn:u.column}:o===tt.COLUMN?s={...s,endRow:u.row}:o===tt.ROW&&(s={...s,endColumn:u.column}),s)}function Ca(e,t,n,r,s){return s===xe.NORMAL?{row:e+t,column:n+r}:s===xe.ROW?{row:e+t,column:n}:s===xe.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function oo(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],u=r[a+1]-1,h=s[o],c=s[o+1]-1;for(const d of e){if(d.startRow>c)break;if(d.startRow<=h&&d.endRow>=c&&d.startColumn<=l&&d.endColumn>=u){i.push({startColumn:l,endColumn:u,startRow:h,endRow:c});break}}}return i}function N_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function M_(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function D_(e){const t=oo(e),n=N_(t);return M_(n)}function x_(e,t){const n=[];return e.forEach(r=>{n.push(...Yt.subtract(r,t))}),Yt.mergeRanges(n)}function L_(e,t){const n=Ra(e.startRow,e.endRow,t.startRow,t.endRow),r=Ra(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=U_(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Ra(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),u=Math.min(i,a);if(l<=u){const h=l===-1/0?Number.NaN:l,c=u===1/0?Number.NaN:u;return[h,c]}else return null}function U_(e,t,n,r,s,i){const o=e!==void 0?e:Ia(n,r,s,i),a=t!==void 0?t:Ia(n,r,s,i);return o===xe.ALL||a===xe.ALL?o===a?o:o===xe.ALL?a:o:o===a?o:(o===xe.NORMAL||a===xe.NORMAL,xe.NORMAL)}function Ia(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?xe.NORMAL:s?xe.ROW:i?xe.COLUMN:xe.ALL}const $t=class $t{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===xe.NORMAL||n.rangeType===void 0&&t.rangeType===xe.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:u,endColumn:h}=n,c=r<=l&&s>=a,d=i<=h&&o>=u;return c&&d}static intersects(t,n){if(t.rangeType===xe.ROW&&n.rangeType===xe.COLUMN||t.rangeType===xe.COLUMN&&n.rangeType===xe.ROW)return!0;if(t.rangeType===xe.ROW&&n.rangeType===xe.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===xe.COLUMN&&n.rangeType===xe.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,u=Number.isNaN(n.endRow)?r:n.endRow,h=Number.isNaN(n.startColumn)?0:n.startColumn,c=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-h-c),f=Math.abs(o-a)+Math.abs(h-c),E=Math.abs(s+i-l-u),R=Math.abs(s-i)+Math.abs(l-u);return d<=f&&E<=R}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,u=n.startColumn,h=n.endColumn;let c,d,f,E;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?E=s:E=l;else return null;if(u<=o)u>i?c=u:c=i;else return null;if(h>=i)h>=o?f=o:f=h;else return null;return{startRow:d,endRow:E,startColumn:c,endColumn:f,rangeType:xe.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return $t.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:xe.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===xe.COLUMN),r=t.some(i=>i.rangeType===xe.ROW),s=$t.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?xe.ROW:n?xe.COLUMN:xe.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return D_(t)}static splitIntoGrid(t){return oo(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=x_(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};C($t,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),C($t,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[tt.ROW,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[tt.ROW,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[tt.COLUMN,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[tt.COLUMN,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),C($t,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),C($t,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),C($t,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let Yt=$t;function P_(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=F_(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function F_(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function k_(e,t){Fn.foreach(t,(n,r)=>{e[n][r]=void 0})}function $_(e,t){const n=e.toFullArray(),r=[];for(;;){const s=P_(n,t);if(!s)break;r.push(s),k_(n,s)}return r}class B_{constructor(t,n){C(this,"_values",[]);C(this,"_keys",[]);C(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function ci(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function j_(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const ls=65,mu=90,H_=97;function W_(e){const t=mu-ls+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+ls)+n,e=Math.floor(e/t)-1;return n}function _u(e,t){let n="";for(;t>0;)n+=e,t--;return n}function z_(e,t=!1){const n=mu-ls+1;let r=H_;t&&(r=ls);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return _u(s,i)}function Y_(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function V_(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Ir(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var Eu=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Eu||{}),Cu=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Cu||{}),Ne=(e=>(e[e.BULLET=0]="BULLET",e[e.NONE=1]="NONE",e[e.DECIMAL=2]="DECIMAL",e[e.DECIMAL_ZERO=3]="DECIMAL_ZERO",e[e.UPPER_LETTER=4]="UPPER_LETTER",e[e.LOWER_LETTER=5]="LOWER_LETTER",e[e.UPPER_ROMAN=6]="UPPER_ROMAN",e[e.LOWER_ROMAN=7]="LOWER_ROMAN",e[e.ORDINAL=8]="ORDINAL",e[e.CARDINAL_TEXT=9]="CARDINAL_TEXT",e[e.ORDINAL_TEXT=10]="ORDINAL_TEXT",e[e.HEX=11]="HEX",e[e.CHICAGO=12]="CHICAGO",e[e.IDEOGRAPH_DIGITAL=13]="IDEOGRAPH_DIGITAL",e[e.JAPANESE_COUNTING=14]="JAPANESE_COUNTING",e[e.AIUEO=15]="AIUEO",e[e.IROHA=16]="IROHA",e[e.DECIMAL_FULL_WIDTH=17]="DECIMAL_FULL_WIDTH",e[e.DECIMAL_HALF_WIDTH=18]="DECIMAL_HALF_WIDTH",e[e.JAPANESE_LEGAL=19]="JAPANESE_LEGAL",e[e.JAPANESE_DIGITAL_TEN_THOUSAND=20]="JAPANESE_DIGITAL_TEN_THOUSAND",e[e.DECIMAL_ENCLOSED_CIRCLE=21]="DECIMAL_ENCLOSED_CIRCLE",e[e.DECIMAL_FULL_WIDTH2=22]="DECIMAL_FULL_WIDTH2",e[e.AIUEO_FULL_WIDTH=23]="AIUEO_FULL_WIDTH",e[e.IROHA_FULL_WIDTH=24]="IROHA_FULL_WIDTH",e[e.GANADA=25]="GANADA",e[e.CHOSUNG=26]="CHOSUNG",e[e.DECIMAL_ENCLOSED_FULLSTOP=27]="DECIMAL_ENCLOSED_FULLSTOP",e[e.DECIMAL_ENCLOSED_PAREN=28]="DECIMAL_ENCLOSED_PAREN",e[e.DECIMAL_ENCLOSED_CIRCLE_CHINESE=29]="DECIMAL_ENCLOSED_CIRCLE_CHINESE",e[e.IDEOGRAPH_ENCLOSED_CIRCLE=30]="IDEOGRAPH_ENCLOSED_CIRCLE",e[e.IDEOGRAPH_TRADITIONAL=31]="IDEOGRAPH_TRADITIONAL",e[e.IDEOGRAPH_ZODIAC=32]="IDEOGRAPH_ZODIAC",e[e.IDEOGRAPH_ZODIAC_TRADITIONAL=33]="IDEOGRAPH_ZODIAC_TRADITIONAL",e[e.TAIWANESE_COUNTING=34]="TAIWANESE_COUNTING",e[e.IDEOGRAPH_LEGAL_TRADITIONAL=35]="IDEOGRAPH_LEGAL_TRADITIONAL",e[e.TAIWANESE_COUNTING_THOUSAND=36]="TAIWANESE_COUNTING_THOUSAND",e[e.TAIWANESE_DIGITAL=37]="TAIWANESE_DIGITAL",e[e.CHINESE_COUNTING=38]="CHINESE_COUNTING",e[e.CHINESE_LEGAL_SIMPLIFIED=39]="CHINESE_LEGAL_SIMPLIFIED",e[e.CHINESE_COUNTING_THOUSAND=40]="CHINESE_COUNTING_THOUSAND",e[e.KOREAN_DIGITAL=41]="KOREAN_DIGITAL",e[e.KOREAN_COUNTING=42]="KOREAN_COUNTING",e[e.KOREAN_LEGAL=43]="KOREAN_LEGAL",e[e.KOREAN_DIGITAL2=44]="KOREAN_DIGITAL2",e[e.VIETNAMESE_COUNTING=45]="VIETNAMESE_COUNTING",e[e.RUSSIAN_LOWER=46]="RUSSIAN_LOWER",e[e.RUSSIAN_UPPER=47]="RUSSIAN_UPPER",e[e.NUMBER_IN_DASH=48]="NUMBER_IN_DASH",e[e.HEBREW1=49]="HEBREW1",e[e.HEBREW2=50]="HEBREW2",e[e.ARABIC_ALPHA=51]="ARABIC_ALPHA",e[e.ARABIC_ABJAD=52]="ARABIC_ABJAD",e[e.HINDI_VOWELS=53]="HINDI_VOWELS",e[e.HINDI_CONSONANTS=54]="HINDI_CONSONANTS",e[e.HINDI_NUMBERS=55]="HINDI_NUMBERS",e[e.HINDI_COUNTING=56]="HINDI_COUNTING",e[e.THAI_LETTERS=57]="THAI_LETTERS",e[e.THAI_NUMBERS=58]="THAI_NUMBERS",e[e.THAI_COUNTING=59]="THAI_COUNTING",e[e.CUSTOM=60]="CUSTOM",e))(Ne||{}),vr=(e=>(e[e.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e[e.BOTH=4]="BOTH",e))(vr||{}),on=(e=>(e[e.HYPERLINK=0]="HYPERLINK",e[e.FIELD=1]="FIELD",e[e.SDT=2]="SDT",e[e.BOOKMARK=3]="BOOKMARK",e[e.COMMENT=4]="COMMENT",e[e.CUSTOM=5]="CUSTOM",e[e.MENTION=6]="MENTION",e[e.UNI_FORMULA=7]="UNI_FORMULA",e[e.DELTED=9999]="DELTED",e))(on||{}),fn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(fn||{}),Ru=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Ru||{}),ao=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(ao||{}),Iu=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.LINES=1]="LINES",e[e.LINES_AND_CHARS=2]="LINES_AND_CHARS",e[e.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",e))(Iu||{}),vu=(e=>(e[e.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",e[e.CONTINUOUS=1]="CONTINUOUS",e[e.NEXT_PAGE=2]="NEXT_PAGE",e[e.EVEN_PAGE=3]="EVEN_PAGE",e[e.ODD_PAGE=4]="ODD_PAGE",e))(vu||{}),yu=(e=>(e[e.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",e[e.NONE=1]="NONE",e[e.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",e))(yu||{}),Su=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Su||{}),Ou=(e=>(e[e.TEXT_RUN=0]="TEXT_RUN",e[e.AUTO_TEXT=1]="AUTO_TEXT",e[e.PAGE_BREAK=2]="PAGE_BREAK",e[e.COLUMN_BREAK=3]="COLUMN_BREAK",e[e.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",e[e.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",e[e.EQUATION=6]="EQUATION",e[e.DRAWING=7]="DRAWING",e[e.PERSON=8]="PERSON",e[e.RICH_LINK=9]="RICH_LINK",e))(Ou||{}),bu=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(bu||{}),wu=(e=>(e[e.INLINE=0]="INLINE",e[e.WRAP_NONE=1]="WRAP_NONE",e[e.WRAP_POLYGON=2]="WRAP_POLYGON",e[e.WRAP_SQUARE=3]="WRAP_SQUARE",e[e.WRAP_THROUGH=4]="WRAP_THROUGH",e[e.WRAP_TIGHT=5]="WRAP_TIGHT",e[e.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",e))(wu||{}),Au=(e=>(e[e.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",e[e.NORMAL_TEXT=1]="NORMAL_TEXT",e[e.TITLE=2]="TITLE",e[e.SUBTITLE=3]="SUBTITLE",e[e.HEADING_1=4]="HEADING_1",e[e.HEADING_2=5]="HEADING_2",e[e.HEADING_3=6]="HEADING_3",e[e.HEADING_4=7]="HEADING_4",e[e.HEADING_5=8]="HEADING_5",e[e.HEADING_6=9]="HEADING_6",e))(Au||{}),Tu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Tu||{}),Nu=(e=>(e[e.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",e[e.SOLID=1]="SOLID",e[e.DOT=2]="DOT",e[e.DASH=3]="DASH",e))(Nu||{}),Mu=(e=>(e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e))(Mu||{}),Du=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Du||{}),xu=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(xu||{}),Lu=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Lu||{}),Uu=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Uu||{}),Pu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Pu||{}),Fu=(e=>(e[e.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",e[e.BOTH=1]="BOTH",e[e.TOP=2]="TOP",e[e.CENTER=3]="CENTER",e[e.BOTTOM=4]="BOTTOM",e))(Fu||{}),wn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(wn||{}),ku=(e=>(e[e.PAGE=0]="PAGE",e[e.COLUMN=1]="COLUMN",e[e.CHARACTER=2]="CHARACTER",e[e.MARGIN=3]="MARGIN",e[e.INSIDE_MARGIN=4]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",e[e.LEFT_MARGIN=6]="LEFT_MARGIN",e[e.RIGHT_MARGIN=7]="RIGHT_MARGIN",e))(ku||{}),$u=(e=>(e[e.PAGE=0]="PAGE",e[e.PARAGRAPH=1]="PARAGRAPH",e[e.LINE=2]="LINE",e[e.MARGIN=3]="MARGIN",e[e.TOP_MARGIN=4]="TOP_MARGIN",e[e.BOTTOM_MARGIN=5]="BOTTOM_MARGIN",e[e.INSIDE_MARGIN=6]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=7]="OUTSIDE_MARGIN",e))($u||{}),Bu=(e=>(e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.CHARACTER=2]="CHARACTER",e[e.PIXEL=3]="PIXEL",e[e.PERCENT=4]="PERCENT",e))(Bu||{}),ju=(e=>(e[e.CENTER=0]="CENTER",e[e.INSIDE=1]="INSIDE",e[e.LEFT=2]="LEFT",e[e.OUTSIDE=3]="OUTSIDE",e[e.RIGHT=4]="RIGHT",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTE=6]="DISTRIBUTE",e))(ju||{}),Hu=(e=>(e[e.BOTTOM=0]="BOTTOM",e[e.CENTER=1]="CENTER",e[e.INSIDE=2]="INSIDE",e[e.OUTSIDE=3]="OUTSIDE",e[e.TOP=4]="TOP",e))(Hu||{}),Wu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(Wu||{}),zu=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(zu||{}),Yu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(Yu||{}),Vu=(e=>(e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e[e.DRAWING_IMAGE=0]="DRAWING_IMAGE",e[e.DRAWING_SHAPE=1]="DRAWING_SHAPE",e[e.DRAWING_CHART=2]="DRAWING_CHART",e[e.DRAWING_TABLE=3]="DRAWING_TABLE",e[e.DRAWING_SMART_ART=4]="DRAWING_SMART_ART",e[e.DRAWING_VIDEO=5]="DRAWING_VIDEO",e[e.DRAWING_GROUP=6]="DRAWING_GROUP",e[e.DRAWING_UNIT=7]="DRAWING_UNIT",e[e.DRAWING_DOM=8]="DRAWING_DOM",e))(Vu||{}),lo=(e=>(e[e.SLIDE=0]="SLIDE",e[e.MASTER=1]="MASTER",e[e.LAYOUT=2]="LAYOUT",e[e.HANDOUT_MASTER=3]="HANDOUT_MASTER",e[e.NOTES_MASTER=4]="NOTES_MASTER",e))(lo||{}),Gu=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(Gu||{}),Ku=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(Ku||{}),$e=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{}),Dt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Dt||{}),hi=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(hi||{});class Ss extends nt{}function G_(e=re.generateRandomId(6),t=zn.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
8
- `,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:ao.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:Se.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:Se.TRUE,doNotHyphenateCaps:Se.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:Se.FALSE,useFirstPageHeaderFooter:Se.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var Xn={},Mr={},Dr={},va;function K_(){if(va)return Dr;va=1,Object.defineProperty(Dr,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return Dr.default=n,Dr}var xr={},ya;function X_(){if(ya)return xr;ya=1,Object.defineProperty(xr,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return xr.default=e,xr}var Ps={},Sa;function Xu(){return Sa||(Sa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(h,c){if(!h)throw new Error(c)}const n=h=>h!=null&&typeof h=="object"&&!Array.isArray(h),r=(h,c)=>typeof h==typeof c?h>c:typeof h=="string"&&typeof c=="number";function s(h,c){for(let d in h){const f=d;c.write(f,h[f])}}e.isValidPathItem=h=>typeof h=="number"||typeof h=="string"&&h!=="__proto__";class i{constructor(c=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=c}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const c=[];let d=this.container,f=this.parents.length-1,E=this.idx;for(;E>=0;)c.unshift(d[E]),E===0?(E=this.indexes[f*2],d=this.parents[f--]):E-=n(d[E-1])?2:1;return c}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let c;return this.container&&this.container.length>this.idx+1&&n(c=this.container[this.idx+1])?c:null}descendFirst(){let c=this.idx+1;if(!this.container||c>=this.container.length||n(this.container[c])&&c+1>=this.container.length)return!1;n(this.container[c])&&c++;const d=this.container[c];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(c),this.idx=0,this.container=d):this.idx=c,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const c=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return c>=d.length?!1:(t(!isNaN(c)),this.indexes[this.indexes.length-1]=c,this.container=d[c],!0)}_init(c,d,f,E){this.container=c,this.idx=d,this.parents=f.slice(),this.indexes=E.slice()}clone(){const c=new o;return c._init(this.container,this.idx,this.parents,this.indexes),c}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(c,d){const f=this.getComponent();f&&d(f,c);for(const E of this)c&&c.descend(E),this.traverse(c,d),c&&c.ascend()}eachPick(c,d){this.traverse(c,(f,E)=>{f.p!=null&&d(f.p,E)})}eachDrop(c,d){this.traverse(c,(f,E)=>{f.d!=null&&d(f.d,E)})}}e.ReadCursor=o;class a extends i{constructor(c=null){super(c),this.pendingDescent=[],this._op=c}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let c=0;c<this.pendingDescent.length;c++){const d=this.pendingDescent[c];let f=this.idx+1;if(f<this.container.length&&n(this.container[f])&&f++,t(f===this.container.length||!n(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const E=this.container.splice(f,this.container.length-f);this.container.push(E),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const E=[d];this.container.splice(f,0,E),this.container=E}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const c=this.idx+1;if(c<this.container.length&&n(this.container[c]))return this.container[c];{const d={};return this.container.splice(c,0,d),d}}write(c,d){const f=this.getComponent();t(f[c]==null||f[c]===d,"Internal consistency error: Overwritten component. File a bug"),f[c]=d}get(){return this._op}descend(c){if(!e.isValidPathItem(c))throw Error("Invalid JSON key");this.pendingDescent.push(c)}descendPath(c){return this.pendingDescent.push(...c),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(c,d=s){if(c===null)return;if(t(Array.isArray(c)),c===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,E=this.parents.length;let R=0;for(let O=0;O<c.length;O++){const U=c[O];typeof U=="string"||typeof U=="number"?(R++,this.descend(U)):Array.isArray(U)?this.mergeTree(U,d):typeof U=="object"&&d(U,this)}for(;R--;)this.ascend();this.lcIdx=this.parents.length===E?f:-1}at(c,d){this.descendPath(c),d(this);for(let f=0;f<c.length;f++)this.ascend();return this}writeAtPath(c,d,f){return this.at(c,()=>this.write(d,f)),this.reset(),this}writeMove(c,d,f=0){return this.writeAtPath(c,"p",f).writeAtPath(d,"d",f)}getPath(){const c=super.getPath();return c.push(...this.pendingDescent),c}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=h=>new o(h);function l(h,c,d){let f,E;E=f=h?h.descendFirst():!1;function R(O){let U;for(;E;){const ne=U=h.getKey();if(O!=null){let X=!1;if(c&&typeof ne=="number"&&(U=c(ne,h.getComponent()),U<0&&(U=~U,X=!0)),r(U,O))return null;if(U===O&&!X)return h}d&&typeof U=="number"&&d(U,h.getComponent()),E=h.nextSibling()}return null}return R.end=()=>{f&&h.ascend()},R}e.advancer=l;function u(h,c,d){let f,E,R,O;for(f=E=h&&h.descendFirst(),R=O=c&&c.descendFirst();f||R;){let U=f?h.getKey():null,ne=R?c.getKey():null;U!==null&&ne!==null&&(r(ne,U)?ne=null:U!==ne&&(U=null)),d(U==null?ne:U,U!=null?h:null,ne!=null?c:null),U!=null&&f&&(f=h.nextSibling()),ne!=null&&R&&(R=c.nextSibling())}E&&h.ascend(),O&&c.ascend()}e.eachChildOf=u}(Ps)),Ps}var Fs={},Oa;function Qu(){return Oa||(Oa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))}(Fs)),Fs}var hn={},dn={},ba;function uo(){return ba||(ba=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.uniToStrPos=dn.strPosToUni=void 0,dn.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},dn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),dn}var ks={},wa;function di(){return wa||(wa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=uo(),n=N=>{if(!Array.isArray(N))throw Error("Op must be an array of components");let A=null;for(let H=0;H<N.length;H++){const J=N[H];switch(typeof J){case"object":if(typeof J.d!="number"&&typeof J.d!="string")throw Error("Delete must be number or string");if(e.dlen(J.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(J.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(J>0))throw Error("Skip components must be >0");if(typeof A=="number")throw Error("Adjacent skip components should be combined");break}A=J}if(typeof A=="number")throw Error("Op has a trailing skip")};function r(N,A){let H=0,J=0;for(let fe=0;fe<N.length;fe++){const ae=N[fe];switch(A(ae,H,J),typeof ae){case"object":H+=e.dlen(ae.d);break;case"string":J+=t.strPosToUni(ae);break;case"number":H+=ae,J+=ae;break}}}e.eachOp=r;function s(N,A){const H=[],J=a(H);return r(N,(fe,ae,m)=>{J(A(fe,ae,m))}),c(H)}const i=N=>N,o=N=>s(N,i);e.dlen=N=>typeof N=="number"?N:t.strPosToUni(N);const a=N=>A=>{if(!(!A||A.d===0||A.d===""))if(N.length===0)N.push(A);else if(typeof A==typeof N[N.length-1])if(typeof A=="object"){const H=N[N.length-1];H.d=typeof H.d=="string"&&typeof A.d=="string"?H.d+A.d:e.dlen(H.d)+e.dlen(A.d)}else N[N.length-1]+=A;else N.push(A)},l=N=>typeof N=="number"?N:typeof N=="string"?t.strPosToUni(N):typeof N.d=="number"?N.d:t.strPosToUni(N.d);e.uniSlice=(N,A,H)=>{const J=t.uniToStrPos(N,A),fe=H==null?1/0:t.uniToStrPos(N,H);return N.slice(J,fe)};const u=(N,A,H)=>typeof N=="number"?H==null?N-A:Math.min(N,H)-A:e.uniSlice(N,A,H),h=N=>{let A=0,H=0;return{take:(ae,m)=>{if(A===N.length)return ae===-1?null:ae;const j=N[A];let y;if(typeof j=="number")return ae===-1||j-H<=ae?(y=j-H,++A,H=0,y):(H+=ae,ae);if(typeof j=="string"){if(ae===-1||m==="i"||t.strPosToUni(j.slice(H))<=ae)return y=j.slice(H),++A,H=0,y;{const M=H+t.uniToStrPos(j.slice(H),ae);return y=j.slice(H,M),H=M,y}}else{if(ae===-1||m==="d"||e.dlen(j.d)-H<=ae)return y={d:u(j.d,H)},++A,H=0,y;{let M=u(j.d,H,H+ae);return H+=ae,{d:M}}}},peek:()=>N[A]}},c=N=>(N.length>0&&typeof N[N.length-1]=="number"&&N.pop(),N);function d(N,A,H){if(H!=="left"&&H!=="right")throw Error("side ("+H+") must be 'left' or 'right'");n(N),n(A);const J=[],fe=a(J),{take:ae,peek:m}=h(N);for(let y=0;y<A.length;y++){const M=A[y];let b,S;switch(typeof M){case"number":for(b=M;b>0;)S=ae(b,"i"),fe(S),typeof S!="string"&&(b-=l(S));break;case"string":H==="left"&&typeof m()=="string"&&fe(ae(-1)),fe(t.strPosToUni(M));break;case"object":for(b=e.dlen(M.d);b>0;)switch(S=ae(b,"i"),typeof S){case"number":b-=S;break;case"string":fe(S);break;case"object":b-=e.dlen(S.d)}break}}let j;for(;j=ae(-1);)fe(j);return c(J)}function f(N,A){n(N),n(A);const H=[],J=a(H),{take:fe}=h(N);for(let m=0;m<A.length;m++){const j=A[m];let y,M;switch(typeof j){case"number":for(y=j;y>0;)M=fe(y,"d"),J(M),typeof M!="object"&&(y-=l(M));break;case"string":J(j);break;case"object":y=e.dlen(j.d);let b=0;for(;b<y;)switch(M=fe(y-b,"d"),typeof M){case"number":J({d:u(j.d,b,b+M)}),b+=M;break;case"string":b+=t.strPosToUni(M);break;case"object":J(M)}break}}let ae;for(;ae=fe(-1);)J(ae);return c(H)}const E=(N,A)=>{let H=0;for(let J=0;J<A.length&&N>H;J++){const fe=A[J];switch(typeof fe){case"number":{H+=fe;break}case"string":const ae=t.strPosToUni(fe);H+=ae,N+=ae;break;case"object":N-=Math.min(e.dlen(fe.d),N-H);break}}return N},R=(N,A)=>typeof N=="number"?E(N,A):N.map(H=>E(H,A));function O(N,A,H){return s(N,(J,fe)=>typeof J=="object"&&typeof J.d=="number"?{d:H.slice(A,fe,fe+J.d)}:J)}function U(N){return s(N,A=>{switch(typeof A){case"object":if(typeof A.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return A.d;case"string":return{d:A};case"number":return A}})}function ne(N){return s(N,A=>typeof A=="object"&&typeof A.d=="string"?{d:t.strPosToUni(A.d)}:A)}function X(N){let A=!0;return r(N,H=>{typeof H=="object"&&typeof H.d=="number"&&(A=!1)}),A}function de(N){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:c,normalize:o,checkOp:n,create(A=""){if(typeof A!="string")throw Error("Initial data must be a string");return N.create(A)},apply(A,H){n(H);const J=N.builder(A);for(let fe=0;fe<H.length;fe++){const ae=H[fe];switch(typeof ae){case"number":J.skip(ae);break;case"string":J.append(ae);break;case"object":J.del(e.dlen(ae.d));break}}return J.build()},transform:d,compose:f,transformPosition:E,transformSelection:R,isInvertible:X,makeInvertible(A,H){return O(A,H,N)},stripInvertible:ne,invert:U,invertWithDoc(A,H){return U(O(A,H,N))},isNoop:A=>A.length===0}}e.default=de}(ks)),ks}var Lr={},Aa;function Q_(){if(Aa)return Lr;Aa=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=di(),t=uo();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const u=e.dlen(o.d);this.onRemove&&this.onRemove(l,u)}})},onInsert:null,onRemove:null}}return Lr.default=n,n.provides={text:!0},Lr}var Ta;function J_(){return Ta||(Ta=1,function(e){var t=hn.__createBinding||(Object.create?function(d,f,E,R){R===void 0&&(R=E),Object.defineProperty(d,R,{enumerable:!0,get:function(){return f[E]}})}:function(d,f,E,R){R===void 0&&(R=E),d[R]=f[E]}),n=hn.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=hn.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var E in d)Object.hasOwnProperty.call(d,E)&&t(f,d,E);return n(f,d),f},s=hn.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=uo(),o=r(di()),a=s(Q_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(E){let R=i.uniToStrPos(d,E);if(R>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,R)),d=d.slice(R)},append(E){f.push(E)},del(E){d=d.slice(i.uniToStrPos(d,E))},build(){return f.join("")+d}}},slice:o.uniSlice},u=o.default(l),h=Object.assign(Object.assign({},u),{api:a.default});e.type=h,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var c=di();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return c.default}})}(hn)),hn}var Na;function q_(){return Na||(Na=1,function(e){var t=Mr.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(K_()),r=t(X_()),s=Xu(),i=Qu();function o(v,k){if(!v)throw new Error(k)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:v=>v,isNoop:v=>v==null,setDebug(v){},registerSubtype:U,checkValidOp:fe,normalize:ae,apply:m,transformPosition:j,compose:y,tryTransform:Y,transform:he,makeInvertible:S,invert:M,invertWithDoc:F,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(v,k,V)=>we(()=>!0,v,k,V),typeAllowingConflictsPred:v=>Object.assign(Object.assign({},e.type),{transform:(k,V,K)=>we(v,k,V,K)})};const a=v=>v?v.getComponent():null;function l(v){return v&&typeof v=="object"&&!Array.isArray(v)}const u=v=>Array.isArray(v)?v.slice():v!==null&&typeof v=="object"?Object.assign({},v):v,h=v=>v&&(v.p!=null||v.r!==void 0),c=v=>v&&(v.d!=null||v.i!==void 0);function d(v,k){return o(v!=null),typeof k=="number"?(o(Array.isArray(v),"Invalid key - child is not an array"),(v=v.slice()).splice(k,1)):(o(l(v),"Invalid key - child is not an object"),delete(v=Object.assign({},v))[k]),v}function f(v,k,V){return typeof k=="number"?(o(v!=null,"Container is missing for key"),o(Array.isArray(v),"Cannot use numerical key for object container"),o(v.length>=k,"Cannot insert into out of bounds index"),v.splice(k,0,V)):(o(l(v),"Cannot insert into missing item"),o(v[k]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),v[k]=V),V}e.removeOp=(v,k=!0)=>s.writeCursor().writeAtPath(v,"r",k).get(),e.moveOp=(v,k)=>s.writeCursor().writeMove(v,k).get(),e.insertOp=(v,k)=>s.writeCursor().writeAtPath(v,"i",k).get(),e.replaceOp=(v,k,V)=>s.writeCursor().at(v,K=>{K.write("r",k),K.write("i",V)}).get(),e.editOp=(v,k,V,K=!1)=>s.writeCursor().at(v,z=>A(z,k,V,K)).get();const E=(v,k)=>v!=null&&(typeof k=="number"?Array.isArray(v):typeof v=="object"),R=(v,k)=>E(v,k)?v[k]:void 0,O={};function U(v){let k=v.type?v.type:v;k.name&&(O[k.name]=k),k.uri&&(O[k.uri]=k)}const ne=v=>{const k=O[v];if(k)return k;throw Error("Missing type: "+v)};U(J_());const X=(v,k)=>v+k;U({name:"number",apply:X,compose:X,invert:v=>-v,transform:v=>v});const de=v=>v==null?null:v.et?ne(v.et):v.es?O["text-unicode"]:v.ena!=null?O.number:null,N=v=>v.es?v.es:v.ena!=null?v.ena:v.e,A=(v,k,V,K=!1)=>{const[z,W]=typeof k=="string"?[ne(k),k]:[k,k.name];!K&&z.isNoop&&z.isNoop(V)||(W==="number"?v.write("ena",V):W==="text-unicode"?v.write("es",V):(v.write("et",W),v.write("e",V)))};function H(v){o(typeof v=="number"),o(v>=0),o(v===(0|v))}function J(v){typeof v=="number"?H(v):o(typeof v=="string")}function fe(v){if(v===null)return;const k=new Set,V=new Set,K=W=>{let le=!0,oe=!1;for(let B in W){const ee=W[B];if(le=!1,o(B==="p"||B==="r"||B==="d"||B==="i"||B==="e"||B==="es"||B==="ena"||B==="et","Invalid component item '"+B+"'"),B==="p")H(ee),o(!k.has(ee)),k.add(ee),o(W.r===void 0);else if(B==="d")H(ee),o(!V.has(ee)),V.add(ee),o(W.i===void 0);else if(B==="e"||B==="es"||B==="ena"){o(!oe),oe=!0;const ie=de(W);o(ie,"Missing type in edit"),ie.checkValidOp&&ie.checkValidOp(N(W))}}o(!le)},z=(W,le,oe)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");le||J(W[0]);let B=1,ee=0,ie=0;for(let pe=0;pe<W.length;pe++){const be=W[pe];if(o(be!=null),Array.isArray(be)){const De=z(be,!1);if(ee){const G=typeof ie,Re=typeof De;G===Re?o(ie<De,"descent keys are not in order"):o(G==="number"&&Re==="string")}ie=De,ee++,B=3}else typeof be=="object"?(o(B===1,`Prev not scalar - instead ${B}`),K(be),B=2):(o(B!==3),J(be),o(s.isValidPathItem(be),"Invalid path key"),B=1)}return o(ee!==1,"Operation makes multiple descents. Remove some []"),o(B===2||B===3),W[0]};z(v,!0),o(k.size===V.size,"Mismatched picks and drops in op");for(let W=0;W<k.size;W++)o(k.has(W)),o(V.has(W))}function ae(v){let k=0,V=[];const K=s.writeCursor();return K.mergeTree(v,(z,W)=>{const le=de(z);if(le){const B=N(z);A(W,le,le.normalize?le.normalize(B):B)}for(const B of["r","p","i","d"])if(z[B]!==void 0){const ee=B==="p"||B==="d"?(oe=z[B],V[oe]==null&&(V[oe]=k++),V[oe]):z[B];W.write(B,ee)}var oe}),K.get()}function m(v,k){if(fe(k),k===null)return v;const V=[];return function K(z,W){let le=z,oe=0,B={root:z},ee=0,ie=B,pe="root";function be(){for(;ee<oe;ee++){let De=W[ee];typeof De!="object"&&(o(E(ie,pe)),ie=ie[pe]=u(ie[pe]),pe=De)}}for(;oe<W.length;oe++){const De=W[oe];if(Array.isArray(De)){const G=K(le,De);G!==le&&G!==void 0&&(be(),le=ie[pe]=G)}else if(typeof De=="object"){De.d!=null?(be(),le=f(ie,pe,V[De.d])):De.i!==void 0&&(be(),le=f(ie,pe,De.i));const G=de(De);if(G)be(),le=ie[pe]=G.apply(le,N(De));else if(De.e!==void 0)throw Error("Subtype "+De.et+" undefined")}else le=R(le,De)}return B.root}(v=function K(z,W){const le=[];let oe=0;for(;oe<W.length;oe++){const pe=W[oe];if(Array.isArray(pe))break;typeof pe!="object"&&(le.push(z),z=R(z,pe))}for(let pe=W.length-1;pe>=oe;pe--)z=K(z,W[pe]);for(--oe;oe>=0;oe--){const pe=W[oe];if(typeof pe!="object"){const be=le.pop();z=z===R(be,pe)?be:z===void 0?d(be,pe):(ee=pe,ie=z,(B=u(B=be))[ee]=ie,B)}else h(pe)&&(o(z!==void 0,"Cannot pick up or remove undefined"),pe.p!=null&&(V[pe.p]=z),z=void 0)}var B,ee,ie;return z}(v,k),k)}function j(v,k){v=v.slice(),fe(k);const V=s.readCursor(k);let K,z,W=!1;const le=[];for(let B=0;;B++){const ee=v[B],ie=V.getComponent();if(ie&&(ie.r!==void 0?W=!0:ie.p!=null&&(W=!1,K=ie.p,z=B)),B>=v.length)break;let pe=0;const be=s.advancer(V,void 0,(G,Re)=>{h(Re)&&pe++});le.unshift(be);const De=be(ee);if(typeof ee=="number"&&(v[B]-=pe),!De)break}if(le.forEach(B=>B.end()),W)return null;const oe=()=>{let B=0;if(K!=null){const ee=V.getPath();B=ee.length,v=ee.concat(v.slice(z))}for(;B<v.length;B++){const ee=v[B],ie=a(V),pe=de(ie);if(pe){const G=N(ie);pe.transformPosition&&(v[B]=pe.transformPosition(v[B],G));break}let be=0;const De=s.advancer(V,(G,Re)=>c(Re)?~(G-be):G-be,(G,Re)=>{c(Re)&&be++})(ee);if(typeof ee=="number"&&(v[B]+=be),!De)break}};return K!=null?V.eachDrop(null,B=>{B===K&&oe()}):oe(),v}function y(v,k){if(fe(v),fe(k),v==null)return k;if(k==null)return v;let V=0;const K=s.readCursor(v),z=s.readCursor(k),W=s.writeCursor(),le=[],oe=[],B=[],ee=[],ie=[],pe=[],be=new Set;K.traverse(null,G=>{G.p!=null&&(B[G.p]=K.clone())}),z.traverse(null,G=>{G.d!=null&&(ee[G.d]=z.clone())});const De=s.writeCursor();return function G(Re,Ye,je,Le,Je,It,Ve,et){o(Ye||je);const Ge=a(Ye),dt=a(je),at=!!dt&&dt.r!==void 0,kt=!!Ge&&Ge.i!==void 0,ke=Ge?Ge.d:null,ft=dt?dt.p:null,_=(It||at)&&ft==null;if(ft!=null)Le=ee[ft],Ve=oe[ft]=new s.WriteCursor;else if(dt&&dt.r!==void 0)Le=null;else{const D=a(Le);D&&D.d!=null&&(Le=null)}const g=a(Le);if(ke!=null)if(Re=B[ke],et=le[ke]=new s.WriteCursor,_)It&&!at&&et.write("r",!0);else{const D=ie[ke]=V++;Ve.write("d",D)}else if(Ge&&Ge.i!==void 0)Re=null;else{const D=a(Re);D&&D.p!=null&&(Re=null)}let p;kt?(o(Je===void 0),p=Ge.i):p=Je;const w=(ft==null?!kt||It||at:p===void 0)?null:Ve.getComponent();if(ft!=null){if(!(Je!==void 0||kt)){const D=ke!=null?ie[ke]:V++;pe[ft]=D,et.write("p",D)}}else at&&(kt||Je!==void 0||(dt.r,et.write("r",dt.r)));const T=_?null:de(Ge),L=de(g);if((T||L)&&(T&&T.name,L&&L.name),T&&L){o(T===L);const D=N(Ge),Z=N(g),Ce=T.compose(D,Z);A(Ve,T,Ce),be.add(g)}else T?A(Ve,T,N(Ge)):L&&(A(Ve,L,N(g)),be.add(g));const x=typeof p=="object"&&p!=null;let P=!1,I=0,q=0,_e=0,Q=0,me=0;const ye=s.advancer(Le,(D,Z)=>c(Z)?Q-D-1:D-Q,(D,Z)=>{c(Z)&&Q++}),ue=s.advancer(Re,(D,Z)=>h(Z)?I-D-1:D-I,(D,Z)=>{h(Z)&&I++});if(s.eachChildOf(Ye,je,(D,Z,Ce)=>{let Ae,Ue,Fe=D,He=D,gt=D;if(typeof D=="number"){let Me=D+_e;Ue=ye(Me),He=Me+Q;let te=D+q;Ae=ue(te),c(a(Ue))&&(Ae=null),Fe=te+I,gt=D+me,o(Fe>=0,"p1PickKey is negative"),o(He>=0,"p2DropKey is negative");const ut=c(a(Z)),Be=h(a(Ce));(ut||Be&&!_)&&me--,ut&&q--,Be&&_e--}else Ae=ue(D),Ue=ye(D);et.descend(Fe),Ve.descend(He);const pt=x&&!c(a(Z))?p[gt]:void 0,Ee=G(Ae,Z,Ce,Ue,pt,_,Ve,et);var Ze,ve,Ie;x&&!_?pt!==Ee&&(P||(p=Array.isArray(p)?p.slice():Object.assign({},p),P=!0),Ze=p,Ie=Ee,typeof(ve=gt)=="number"?(o(Array.isArray(Ze)),o(ve<Ze.length)):(o(!Array.isArray(Ze)),o(Ze[ve]!==void 0)),Ie===void 0?typeof ve=="number"?Ze.splice(ve,1):delete Ze[ve]:Ze[ve]=Ie):o(Ee===void 0),Ve.ascend(),et.ascend()}),ue.end(),ye.end(),w!=null)w.i=p;else if(!It&&!at&&ft==null)return p}(K,K.clone(),z,z.clone(),void 0,!1,W,De),W.reset(),W.mergeTree(De.get()),W.reset(),W.get(),le.map(G=>G.get()),oe.map(G=>G.get()),K.traverse(W,(G,Re)=>{const Ye=G.p;if(Ye!=null){const je=ie[Ye];je!=null&&Re.write("p",je);const Le=le[Ye];Le&&Le.get(),Le&&Re.mergeTree(Le.get())}else G.r!==void 0&&Re.write("r",G.r)}),W.reset(),W.get(),z.traverse(W,(G,Re)=>{const Ye=G.d;if(Ye!=null){const Le=pe[Ye];Le!=null&&Re.write("d",Le);const Je=oe[Ye];Je&&Re.mergeTree(Je.get())}else G.i!==void 0&&Re.write("i",G.i);const je=de(G);je&&!be.has(G)&&A(Re,je,N(G))}),W.get()}function M(v){if(v==null)return null;const k=new s.ReadCursor(v),V=new s.WriteCursor;let K;const z=[],W=[];return function le(oe,B,ee){const ie=oe.getComponent();let pe,be=!1;if(ie){ie.p!=null&&(B.write("d",ie.p),z[ie.p]=oe.clone()),ie.r!==void 0&&B.write("i",ie.r),ie.d!=null&&(B.write("p",ie.d),ee=void 0),ie.i!==void 0&&(ee=pe=ie.i);const G=de(ie);G&&(ee===void 0?(K||(K=new Set),K.add(ie)):(N(ie),ee=G.apply(ee,N(ie)),be=!0))}let De=0;for(const G of oe){B.descend(G);const Re=typeof G=="number"?G-De:G,Ye=R(ee,Re);c(oe.getComponent())&&De++;const je=le(oe,B,Ye);if(ee!==void 0&&je!==void 0){if(be||(be=!0,ee=u(ee)),!E(ee,Re))throw Error("Cannot modify child - invalid operation");ee[Re]=je}B.ascend()}if(pe===void 0)return be?ee:void 0;B.write("r",ee)}(k,V,void 0),K&&(V.reset(),function le(oe,B,ee){const ie=B.getComponent();if(ie){const G=ie.d;if(G!=null&&(oe=z[G],ee=W[G]=s.writeCursor()),K.has(ie)){const Re=de(ie);if(!Re.invert)throw Error(`Cannot invert subtype ${Re.name}`);A(ee,Re,Re.invert(N(ie)))}}let pe=0,be=0;const De=s.advancer(oe,(G,Re)=>h(Re)?pe-G-1:G-pe,(G,Re)=>{h(Re)&&pe++});for(const G of B)if(typeof G=="number"){const Re=G-be,Ye=De(Re),je=Re+pe;ee.descend(je),le(Ye,B,ee),c(B.getComponent())&&be++,ee.ascend()}else ee.descend(G),le(De(G),B,ee),ee.ascend();De.end()}(k.clone(),k,V),W.length&&(V.reset(),k.traverse(V,(le,oe)=>{const B=le.p;if(B!=null){const ee=W[B];ee&&ee.get(),ee&&oe.mergeTree(ee.get())}}))),V.get()}const b=(v,k)=>v.some(V=>typeof V=="object"&&(Array.isArray(V)?b(V,k):k(V)));function S(v,k){if(v==null||!b(v,B=>{var ee;return B.r!==void 0||((ee=de(B))===null||ee===void 0?void 0:ee.makeInvertible)!=null}))return v;const V=new s.ReadCursor(v),K=new s.WriteCursor;let z=!1;const W=[],le=[],oe=(B,ee,ie)=>{const pe=B.getComponent();let be=!1;if(pe){pe.d!=null&&ee.write("d",pe.d),pe.i!==void 0&&ee.write("i",pe.i);const G=pe.p;if(G!=null&&(W[G]=B.clone(),o(ie!==void 0,"Operation picks up at an invalid key"),le[G]=ie,ee.write("p",pe.p)),pe.r!==void 0&&ie===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Re=de(pe);Re&&(Re.makeInvertible?z=!0:A(ee,Re,N(pe),!0))}let De=0;for(const G of B){ee.descend(G);const Re=typeof G=="number"?G-De:G,Ye=R(ie,Re),je=oe(B,ee,Ye);Ye!==je&&(be||(be=!0,ie=u(ie)),je===void 0?(ie=d(ie,Re),typeof G=="number"&&De++):ie[Re]=je),ee.ascend()}return pe&&(pe.r!==void 0?(ee.write("r",r.default(ie)),ie=void 0):pe.p!=null&&(ie=void 0)),ie};return oe(V,K,k),K.get(),z&&(K.reset(),function B(ee,ie,pe,be,De){const G=ie.getComponent();if(G){G.i!==void 0?(be=G.i,De=!0):G.d!=null&&(be=le[G.d],ee=W[G.d],De=!1,G.d);let Le=de(G);if(Le&&Le.makeInvertible){const Je=N(G);A(pe,Le,Le.makeInvertible(Je,be),!0)}}let Re=0,Ye=0;const je=s.advancer(ee,(Le,Je)=>h(Je)?Re-Le-1:Le-Re,(Le,Je)=>{h(Je)&&Re++});for(const Le of ie)if(typeof Le=="number"){const Je=Le-Ye,It=je(Je),Ve=Je+Re,et=R(be,De?Je:Ve);pe.descend(Le),B(It,ie,pe,et,De),c(ie.getComponent())&&Ye++,pe.ascend()}else{const Je=R(be,Le);pe.descend(Le),B(je(Le),ie,pe,Je,De),pe.ascend()}je.end()}(V.clone(),V,K,k,!1)),K.get()}function F(v,k){return M(S(v,k))}const $=v=>{if(v==null)return null;const k=v.slice();for(let V=0;V<v.length;V++){const K=k[V];Array.isArray(K)&&(k[V]=$(K))}return k};function Y(v,k,V){o(V==="left"||V==="right","Direction must be left or right");const K=V==="left"?0:1;if(k==null)return{ok:!0,result:v};fe(v),fe(k);let z=null;const W=[],le=[],oe=[],B=[],ee=[],ie=[],pe=[],be=[],De=[],G=[],Re=[],Ye=[],je=[],Le=[],Je=[];let It=0;const Ve=s.readCursor(v),et=s.readCursor(k),Ge=s.writeCursor();if(function g(p,w=null,T){const L=a(w);L&&(L.r!==void 0?T=w.clone():L.p!=null&&(T=null,ie[L.p]=p.clone()));const x=p.getComponent();let P;x&&(P=x.p)!=null&&(ee[P]=w?w.clone():null,oe[P]=p.clone(),T&&(G[P]=!0,De[P]=T),L&&L.p!=null&&(Le[P]=L.p));const I=s.advancer(w);for(const q of p)g(p,I(q),T);I.end()}(et,Ve,null),function g(p,w,T,L,x){const P=T.getComponent();let I,q=!1;P&&((I=P.d)!=null?(B[I]=T.clone(),L!=null&&(Je[L]==null&&(Je[L]=[]),Je[L].push(I)),G[I],p=ee[I]||null,w=oe[I]||null,G[I]?(x&&(Re[I]=!0),x=De[I]||null):!x||K!==1&&Le[I]!=null||z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(x.getPath()),op2:e.moveOp(w.getPath(),T.getPath())}),q=!0):P.i!==void 0&&(p=w=null,q=!0,x&&z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(x.getPath()),op2:e.insertOp(T.getPath(),P.i)})));const _e=a(p);_e&&(_e.r!==void 0?x=p.clone():_e.p!=null&&(_e.p,L=_e.p,x=null));const Q=de(P);Q&&x&&z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(x.getPath()),op2:e.editOp(T.getPath(),Q,N(P),!0)});let me=0,ye=0;const ue=s.advancer(w,(Z,Ce)=>h(Ce)?me-Z-1:Z-me,(Z,Ce)=>{h(Ce)&&me++}),D=s.advancer(p);for(const Z of T)if(typeof Z=="number"){const Ce=Z-ye,Ae=ue(Ce);ye+=+g(D(Ce+me),Ae,T,L,x)}else{const Ce=ue(Z);g(D(Z),Ce,T,L,x)}return ue.end(),D.end(),q}(Ve,et,et.clone(),null,null),B.map(g=>g&&g.get()),z)return{ok:!1,conflict:z};Re.map(g=>!!g);const dt=[];let at=null;(function g(p,w,T,L,x){let P=!1;const I=a(w);if(h(I)){const ue=I.p;ue!=null?(T=B[ue],L=Ye[ue]=s.writeCursor(),P=!0,x=null):(T=null,x=w.clone())}else c(a(T))&&(T=null);const q=p.getComponent();if(q){const ue=q.p;ue!=null?(x&&(be[ue]=x),dt[ue]=x||K===1&&P?null:L.getComponent(),W[ue]=p.clone(),T&&(pe[ue]=T.clone())):q.r!==void 0&&(x||L.write("r",!0),(x||P)&&(at==null&&(at=new Set),at.add(q)))}let _e=0,Q=0;const me=s.advancer(w,void 0,(ue,D)=>{h(D)&&_e++}),ye=s.advancer(T,(ue,D)=>c(D)?~(ue-Q):ue-Q,(ue,D)=>{c(D)&&Q++});if(p)for(const ue of p)if(typeof ue=="string"){const D=me(ue),Z=ye(ue);L.descend(ue),g(p,D,Z,L,x),L.ascend()}else{const D=me(ue),Z=ue-_e,Ce=h(a(D))?null:ye(Z),Ae=Z+Q;o(Ae>=0),L.descend(Ae),g(p,D,Ce,L,x),L.ascend()}me.end(),ye.end()})(Ve,et,et.clone(),Ge,null),Ge.reset();let kt=[];if(function g(p,w,T,L,x,P){o(w);const I=w.getComponent();let q=a(L),_e=!1;const Q=(ve,Ie,Me)=>ve?e.moveOp(ve.getPath(),Ie.getPath()):e.insertOp(Ie.getPath(),Me.i);if(c(I)){const ve=I.d;ve!=null&&(le[ve]=w.clone());const Ie=ve!=null?dt[ve]:null;let Me=!1;if(I.i!==void 0||ve!=null&&Ie){let te;q&&(q.i!==void 0||(te=q.d)!=null&&!G[te])&&(Me=te!=null?ve!=null&&ve===Le[te]:n.default(q.i,I.i),Me||te!=null&&K!==1&&Le[te]!=null||z==null&&(z={type:i.ConflictType.DROP_COLLISION,op1:Q(ve!=null?W[ve]:null,w,I),op2:Q(te!=null?oe[te]:null,L,q)})),Me||(P?z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:Q(ve!=null?W[ve]:null,w,I),op2:e.removeOp(P.getPath())}):(ve!=null?(kt[It]=ve,x.write("d",Ie.p=It++)):x.write("i",r.default(I.i)),_e=!0))}else if(ve!=null&&!Ie){const te=be[ve];te&&(P=te.clone())}ve!=null?(p=W[ve],T=ie[ve],L=pe[ve]):I.i!==void 0&&(p=T=null,Me||(L=null))}else h(a(p))&&(p=T=L=null);const me=a(p),ye=a(T);if(h(ye)){const ve=ye.p;ye.r!==void 0&&(!me||me.r===void 0)||G[ve]?(L=null,P=T.clone()):ve!=null&&(L=B[ve],K!==1&&Le[ve]!=null||((x=je[ve])||(x=je[ve]=s.writeCursor()),x.reset(),P=null))}else!c(I)&&c(q)&&(L=null);q=L!=null?L.getComponent():null;const ue=de(I);if(ue){const ve=N(I);if(P)z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(w.getPath(),ue,ve,!0),op2:e.removeOp(P.getPath())});else{const Ie=de(q);let Me;if(Ie){if(ue!==Ie)throw Error("Transforming incompatible types");const te=N(q);Me=ue.transform(ve,te,V)}else Me=r.default(ve);A(x,ue,Me)}}let D=0,Z=0,Ce=0,Ae=0,Ue=0,Fe=0,He=p!=null&&p.descendFirst(),gt=He;const pt=s.advancer(T,void 0,(ve,Ie)=>{h(Ie)&&Ce++});let Ee=L!=null&&L.descendFirst(),Ze=Ee;for(const ve of w)if(typeof ve=="number"){let Ie;const Me=c(w.getComponent()),te=ve-Z;{let Xt;for(;He&&typeof(Xt=p.getKey())=="number";){Xt+=D;const Ot=p.getComponent(),Rn=h(Ot);if(Xt>te||Xt===te&&(!Rn||K===0&&Me))break;if(Rn){D--;const un=Ot.p;Le.includes(un),Ot.d,a(je[Ot.d]),h(a(je[Ot.d])),(Ot.r===void 0||at&&at.has(Ot))&&(un==null||!dt[un]||K!==1&&Le.includes(un))||Ue--}He=p.nextSibling()}Ie=He&&Xt===te?p:null}const ut=te-D;let Be=pt(ut);const Nt=ut-Ce;let Or=null;{let Xt,Ot;for(;Ee&&typeof(Xt=L.getKey())=="number";){Ot=Xt-Ae;const Rn=L.getComponent(),un=c(Rn);if(Ot>Nt)break;if(Ot===Nt){if(!un){Or=L;break}{if(K===0&&Me){Or=L;break}const Qt=Be&&h(Be.getComponent());if(K===0&&Qt)break}}if(un){const Qt=Rn.d;G[Qt],Le[Qt],Rn.i===void 0&&(G[Qt]||Le[Qt]!=null&&K!==1)?(G[Qt]||Le[Qt]!=null&&K===0)&&(Ae++,Fe--):Ae++}Ee=L.nextSibling()}}const bo=Nt+Ae+Ue+Fe;o(bo>=0,"trying to descend to a negative index"),x.descend(bo),Me&&(Ie=Be=Or=null,Z++),g(Ie,w,Be,Or,x,P)&&Fe++,x.ascend()}else{let Ie;for(;He&&(Ie=p.getKey(),typeof Ie!="string"||!(Ie>ve||Ie===ve));)He=p.nextSibling();const Me=He&&Ie===ve?p:null,te=pt(ve);let ut;for(;Ee&&(ut=L.getKey(),typeof ut!="string"||!(ut>ve||ut===ve));)Ee=L.nextSibling();const Be=Ee&&ut===ve?L:null;x.descend(ve),g(Me,w,te,Be,x,P),x.ascend()}return pt.end(),gt&&p.ascend(),Ze&&L.ascend(),_e}(Ve,Ve.clone(),et,et.clone(),Ge,null),z)return{ok:!1,conflict:z};Ge.reset();const ke=(g,p,w)=>g.traverse(p,(T,L)=>{T.d!=null&&w(T.d,g,L)});(G.length||Ye.length)&&(ke(et,Ge,(g,p,w)=>{G[g]&&!Re[g]&&w.write("r",!0),Ye[g]&&w.mergeTree(Ye[g].get())}),Ge.reset());const ft=[],_=[];if((je.length||G.length)&&!z){const g=s.readCursor($(Ge.get()));if(ke(g,null,(p,w)=>{ft[p]=w.clone()}),je.forEach(p=>{p&&ke(s.readCursor(p.get()),null,(w,T)=>{ft[w]=T.clone()})}),function p(w,T,L,x,P,I){const q=a(T);if(q&&h(q))if(q.p!=null){const D=q.p;ft[D].getPath(),L=ft[D],x=_[D]=s.writeCursor()}else q.r!==void 0&&(L=null);else c(a(L))&&(L=null);const _e=w.getComponent();if(_e){let D;if((D=_e.d)!=null){const Z=je[D];Z&&(Z.get(),x.mergeTree(Z.get()),L=s.readCursor(Z.get()))}}let Q=0,me=0;const ye=s.advancer(T,void 0,(D,Z)=>{h(Z)&&Q--}),ue=s.advancer(L,(D,Z)=>c(Z)?-(D-me)-1:D-me,(D,Z)=>{c(Z)&&me++});for(const D of w)if(typeof D=="number"){const Z=ye(D),Ce=D+Q,Ae=ue(Ce),Ue=Ce+me;x.descend(Ue),p(w,Z,Ae,x),x.ascend()}else x.descend(D),p(w,ye(D),ue(D),x),x.ascend();ye.end(),ue.end()}(et,g,g.clone(),Ge),Ge.reset(),z)return{ok:!1,conflict:z};if(Ge.get(),_.length){const p=_.map(T=>T?T.get():null),w=s.readCursor($(Ge.get()));if(ke(w,Ge,(T,L,x)=>{const P=p[T];P&&(x.mergeTree(P),p[T]=null)}),p.find(T=>T)){const T=s.writeCursor(),L=s.writeCursor();let x=0,P=0;p.forEach(I=>{I!=null&&ke(s.readCursor(I),null,q=>{const _e=kt[q];T.writeMove(W[_e].getPath(),le[_e].getPath(),x++);const Q=Je[_e];Q&&Q.forEach(me=>{G[me]||K!==1&&Le[me]!=null||L.writeMove(oe[me].getPath(),B[me].getPath(),P++)})})}),z={type:i.ConflictType.BLACKHOLE,op1:T.get(),op2:L.get()}}}}return z?{ok:!1,conflict:z}:{ok:!0,result:Ge.get()}}const se=v=>{const k=new Error("Transform detected write conflict");throw k.conflict=v,k.type=k.name="writeConflict",k};function he(v,k,V){const K=Y(v,k,V);if(K.ok)return K.result;se(K.conflict)}const ge=v=>{const k=s.writeCursor();return s.readCursor(v).traverse(k,(V,K)=>{(c(V)||de(V))&&K.write("r",!0)}),k.get()},Te=(v,k)=>{const{type:V,op1:K,op2:z}=v;switch(V){case i.ConflictType.DROP_COLLISION:return k==="left"?[null,ge(z)]:[ge(K),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(K).traverse(null,le=>{le.r!==void 0&&(W=!0)}),W?[null,ge(z)]:[ge(K),null];case i.ConflictType.BLACKHOLE:return[ge(K),ge(z)];default:throw Error("Unrecognised conflict: "+V)}};function we(v,k,V,K){let z=null;for(;;){const W=Y(k,V,K);if(W.ok)return y(z,W.result);{const{conflict:le}=W;v(le)||se(le);const[oe,B]=Te(le,K);k=y(ae(k),oe),V=y(ae(V),B),z=y(z,B)}}}}(Mr)),Mr}var Ma;function Z_(){return Ma||(Ma=1,function(e){var t=Xn.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=Xn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(q_(),e);var r=Xu();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Qu();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(Xn)),Xn}var mt=Z_();const eE=St(mt),tE=hh({__proto__:null,default:eE},[mt]);var ce=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(ce||{});function yr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&re.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();uu(r,a)&&re.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Ju(e,t,n,r){var u;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(u=t.textRuns)!=null?u:[];if(l.length)for(const h of l)h.st+=r,h.ed+=r;for(let h=0;h<o;h++){const c=s[h],{st:d,ed:f}=c;if(f<=r)i.push(c);else if(r>d&&r<f){a=!0;const E={...c,ed:r};i.push(E),l.length&&i.push(...l);const R={...c,st:r+n,ed:f+n};i.push(R)}else c.st+=n,c.ed+=n,a||(a=!0,i.push(...l)),i.push(c)}a||(a=!0,i.push(...l)),e.textRuns=yr(i)}function qu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,u=s.length;l<u;l++){const h=s[l],{startIndex:c}=h;c>=r&&(h.startIndex+=n),o.push(h.startIndex)}let a=-1;if(i){for(let l=0,u=i.length;l<u;l++){const h=i[l];h.startIndex+=r;const c=h.startIndex;a=o.indexOf(c)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(Ir("startIndex"))}}function Zu(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Ir("startIndex"))}}function ec(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Ir("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function tc(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u,endIndex:h}=l;u>r?(l.startIndex+=n,l.endIndex+=n):h>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(Ir("startIndex"))}}const nc="$",Da=e=>e.split(nc)[0];function co(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=Da(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Da(i.rangeId),i.rangeId===n.rangeId&&Ul(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${nc}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function fi(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function rc(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function gi(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function nE(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;fi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=co(s)}function rE(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;gi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=rc(s)}function sc(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const h=r[l],{st:c,ed:d}=h;if(s<=c&&i>=d){o.push({...h,st:c-s,ed:d-s});continue}else c<=s&&d>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=c&&s<d?(o.push({...h,st:s-s,ed:d-s}),h.ed=s):i>c&&i<=d?(o.push({...h,st:c-s,ed:i-s}),h.st=i-t,h.ed-=t):c>=i&&(h.st-=t,h.ed-=t);a.push(h)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function ic(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const h=r[l],{startIndex:c}=h;if(c>=s&&c<i){o.push({...h,startIndex:c-n});continue}else c>=i&&(h.startIndex-=t);a.push(h)}e.paragraphs=a}return o}function oc(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const h=r[l],{startIndex:c}=h;if(c>=s&&c<=i){o.push({...h,startIndex:c-n});continue}else c>i&&(h.startIndex-=t);a.push(h)}e.sectionBreaks=a}return o}function ac(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const h=r[l],{startIndex:c}=h;if(c>=s&&c<=i){o.push({...h,startIndex:c-n});continue}else c>i&&(h.startIndex-=t);a.push(h)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function lc(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const h=r[l],{startIndex:c,endIndex:d}=h;if(s<=c&&i>=d){o.push({...h,startIndex:c-n,endIndex:d-n});continue}else if(c<=s&&d>=i){const f=ys(c,d,s,i);if(f.length===0||(h.startIndex=f[0],h.endIndex=f[1],h.startIndex===h.endIndex))continue}else i<c&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.tables=a}return o}function sE(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const h=r[l],{startIndex:c,endIndex:d}=h;if(c>=s&&d<=i){o.push(h);continue}else if(Math.max(s,c)<=Math.min(i,d)){const f=ys(c,d,s,i);if(f.length===0)continue;h.startIndex=f[0],h.endIndex=f[1]}else i<c&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=co(a)}return o}function iE(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let u=0,h=s.length;u<h;u++){const c=s[u],{startIndex:d,endIndex:f}=c;if(d>=i&&f<=o){a.push(c);continue}else if(Math.max(i,d)<=Math.min(o,f)){const E=ys(d,f,i,o);if(E.length===0)continue;c.startIndex=E[0],c.endIndex=E[1]}else o<d&&r&&(c.startIndex-=t,c.endIndex-=t);l.push(c)}e.customDecorations=l}return a}var uc=(e=>(e.ORDER_LIST_QUICK_1="1.",e.ORDER_LIST_QUICK_2="a)",e.ORDER_LIST_QUICK_3="a.",e.ORDER_LIST_QUICK_4="i.",e.ORDER_LIST_QUICK_5="A.",e.ORDER_LIST_QUICK_6="I.",e.ORDER_LIST_QUICK_7="01.",e))(uc||{}),Ut=(e=>(e.BULLET_LIST="BULLET_LIST",e.BULLET_LIST_1="BULLET_LIST_1",e.BULLET_LIST_2="BULLET_LIST_2",e.BULLET_LIST_3="BULLET_LIST_3",e.BULLET_LIST_4="BULLET_LIST_4",e.BULLET_LIST_5="BULLET_LIST_5",e.ORDER_LIST="ORDER_LIST",e.ORDER_LIST_1="ORDER_LIST_1",e.ORDER_LIST_2="ORDER_LIST_2",e.ORDER_LIST_3="ORDER_LIST_3",e.ORDER_LIST_4="ORDER_LIST_4",e.ORDER_LIST_5="ORDER_LIST_5",e.ORDER_LIST_QUICK_2="ORDER_LIST_QUICK_2",e.ORDER_LIST_QUICK_3="ORDER_LIST_QUICK_3",e.ORDER_LIST_QUICK_4="ORDER_LIST_QUICK_4",e.ORDER_LIST_QUICK_5="ORDER_LIST_QUICK_5",e.ORDER_LIST_QUICK_6="ORDER_LIST_QUICK_6",e.CHECK_LIST="CHECK_LIST",e.CHECK_LIST_CHECKED="CHECK_LIST_CHECKED",e))(Ut||{});const Ur={"a)":{glyphFormat:"%1)",glyphType:Ne.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Ne.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Ne.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Ne.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER}},In=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:vr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),vn=e=>e.map((t,n)=>({...t,bulletAlignment:vr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),xa=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:vr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),Sr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:In(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:In(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:In(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:In(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:In(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:In(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.DECIMAL},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.DECIMAL},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.DECIMAL},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1)",glyphType:Ne.DECIMAL},{glyphFormat:"%2)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Ne.DECIMAL},{glyphFormat:"%5)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Ne.DECIMAL},{glyphFormat:"%8)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:vn(["%1.","%1.%2.","%1.%2.%3.","%1.%2.%3.%4.","%1.%2.%3.%4.%5.","%1.%2.%3.%4.%5.%6.","%1.%2.%3.%4.%5.%6.%7."].map(e=>({glyphFormat:e,glyphType:Ne.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Ne.DECIMAL},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Ne.DECIMAL},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Ne.DECIMAL},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:xa("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:xa("☑",{st:{s:Se.TRUE}})}},Pr=e=>{const{glyphFormat:t,glyphType:n}=e,r=re.deepClone(Sr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},oE={ORDER_LIST_QUICK_2:Pr(Ur["a)"]),ORDER_LIST_QUICK_3:Pr(Ur["a."]),ORDER_LIST_QUICK_4:Pr(Ur["i."]),ORDER_LIST_QUICK_6:Pr(Ur["I."])};Object.assign(Sr,oE);const aE={"1.":"ORDER_LIST","a)":"ORDER_LIST_QUICK_2","a.":"ORDER_LIST_QUICK_3","i.":"ORDER_LIST_QUICK_4","A.":"ORDER_LIST_3","I.":"ORDER_LIST_QUICK_6","01.":"ORDER_LIST_5"};function lE(e,t,n,r,s){const i=uE(e,t,n,r,s),o=cE(e,t,n,r,s),a=hE(e,t,n,r,s),l=dE(e,t,n,r,s),u=fE(e,t,n,r,s),h=gE(e,t,n,r),c=pE(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:u,customRanges:h,customDecorations:c}}function uE(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=sc(e,n,r);if(s!==Pe.REPLACE){const l=cc(o,a,s);t.textRuns=l}return Ju(e,t,n,r),a}function cc(e,t,n){if(t.length===0)return e;e=re.deepClone(e),t=re.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function u(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:f,ed:E,ts:R}=e[o],{st:O,ed:U,ts:ne,sId:X}=t[a];let de;if(n===Pe.COVER?de={...ne,...R}:de={...R},E<O)u()||r.push(e[o]),o++;else if(U<f)u()||r.push(t[a]),a++;else{const N={st:Math.min(f,O),ed:Math.max(f,O),ts:f<O?{...R}:{...ne},sId:f<O?void 0:X};N.ed>N.st&&r.push(N),r.push({st:Math.max(f,O),ed:Math.min(E,U),ts:de,sId:X}),E<U?(o++,t[a].st=E,t[a].st===t[a].ed&&a++):(a++,e[o].st=U,e[o].st===e[o].ed&&o++);const A={st:Math.min(E,U),ed:Math.max(E,U),ts:E<U?{...ne}:{...R},sId:E<U?X:void 0};l=A.ed>A.st?A:null}}u();const h=r[r.length-1],c=e[s-1],d=t[i-1];return h&&h.ed!==Math.max(c.ed,d.ed)&&(c.ed>d.ed?r.push(c):r.push(d)),yr(r)}function cE(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=ic(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h,paragraphStyle:c,bullet:d}=u;let f=[];for(const E of a){const{startIndex:R,paragraphStyle:O,bullet:U}=E;let ne,X;if(s===Pe.COVER?(ne={...O,...c},X={listId:"",listType:Ut.BULLET_LIST,nestingLevel:0,textStyle:{},...U,...d}):(ne={...c,...O},X={listId:"",listType:Ut.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...U}),h===R){f.push({startIndex:h,paragraphStyle:ne,bullet:X});break}}l.push(...f),f=[]}t.paragraphs=l}return qu(e,t,n,r),a}function hE(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=oc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h}=u;let c=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?c.push({...d,...u}):c.push({...u,...d});break}}l.push(...c),c=[]}t.sectionBreaks=l}return Zu(e,t,n,r),a}function dE(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=ac(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h}=u;let c=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?c.push({...d,...u}):c.push({...u,...d});break}}l.push(...c),c=[]}t.customBlocks=l}return ec(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function fE(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=lc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h,endIndex:c}=u;let d=[];for(const f of a){const{startIndex:E,endIndex:R}=f;if(E>=h&&R<=c){s===Pe.COVER?d.push({...f,...u}):d.push({...u,...f});break}}l.push(...d),d=[]}t.tables=l}return tc(e,t,n,r),a}function gE(e,t,n,r,s){e.customRanges||(e.customRanges=[]),fi(e.customRanges,r),fi(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],u=new Map;e.customRanges.forEach(c=>{const{startIndex:d,endIndex:f}=c;d>=i&&f<=o?u.set(c.rangeId,c):l.push(c)});const h=[];return a?(a.forEach(c=>{const{startIndex:d,endIndex:f}=c;l.push({...c,startIndex:d+r,endIndex:f+r})}),e.customRanges=co(l),h):[]}function pE(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),gi(e.customDecorations,r),gi(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Pe.REPLACE){for(let l=0;l<o.length;l++){const u=o[l],{startIndex:h,endIndex:c}=u;h>=r&&c<=r+n-1&&i.push(u)}a.forEach(l=>{const{startIndex:u,endIndex:h}=l;o.push({...l,startIndex:u+r,endIndex:h+r})})}else for(const l of a){const{id:u}=l;if(l.type===fn.DELETED){const h=o.filter(c=>c.id===u);h.length&&i.push(...h)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:u}=l,h=o.findIndex(c=>c.id===u);h!==-1&&o.splice(h,1)}return e.customDecorations=rc(o),i}var ho=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(ho||{});function us(e,t,n,r=!0){const{textRuns:s}=e;if(s){const i=[];for(const o of s){const a=re.deepClone(o),{st:l,ed:u}=a;re.hasIntersectionBetweenTwoRanges(l,u,t,n)&&(t>=l&&t<=u?i.push({...a,st:t,ed:Math.min(n,u)}):n>=l&&n<=u?i.push({...a,st:Math.max(t,l),ed:n}):i.push(a))}return yr(i.map(o=>{const{st:a,ed:l}=o;return{...o,st:a-t,ed:l-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function hc(e,t,n){const{tables:r=[]}=e,s=[];for(const i of r){const o=re.deepClone(i),{startIndex:a,endIndex:l}=o;a>=t&&l<=n&&s.push({...o,startIndex:a-t,endIndex:l-t})}return s}function dc(e,t,n){const{paragraphs:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<n&&s.push(re.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function mE(e,t,n){const{sectionBreaks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(re.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function fc(e,t,n){const{customBlocks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(re.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function Tt(e,t,n,r=!0,s=1){const{dataStream:i}=e,o={dataStream:i.slice(t,n)};o.textRuns=us(e,t,n,r);const a=hc(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=dc(e,t,n),s===1){const u=pc(e,t,n);u?o.customDecorations=u:r&&(o.customDecorations=[])}const{customRanges:l}=gc(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=fc(e,t,n),o}function _E(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(h=>{h.startIndex<0&&(a=Math.max(a,-h.startIndex)),h.endIndex>t.length-1&&(l=Math.max(l,h.endIndex-t.length+1))});const u=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(h=>{h.st+=a,h.ed+=a}),r==null||r.forEach(h=>{h.startIndex+=a}),s==null||s.forEach(h=>{h.startIndex+=a,h.endIndex+=a}),i==null||i.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),o==null||o.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),{...e,dataStream:u,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function gc(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function pc(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=re.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function EE(e,t,n){return e==null||t==null?e!=null?e:t:cc(e,t,n)}function CE(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Pe.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function RE(e,t,n){return t.length===0||e.length===0||n===Pe.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function pi(e,t,n=Pe.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:u=[],customRanges:h,customDecorations:c=[]}=t;r.textRuns=EE(l,s,n),r.customRanges=CE(h,o,n);const d=RE(c,a,n);d.length&&(r.customDecorations=d);const f=[];let E=0,R=0;for(;E<i.length&&R<u.length;){const O=i[E],U=u[R],{startIndex:ne}=O,{startIndex:X}=U;ne===X?(f.push(re.deepMerge(O,U)),E++,R++):ne<X?(f.push(re.deepClone(O)),E++):(f.push(re.deepClone(U)),R++)}return E<i.length&&f.push(...i.slice(E)),R<u.length&&f.push(...u.slice(R)),f.length&&(r.paragraphs=f),r}function IE(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class Sn{constructor(t){C(this,"_index",0);C(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===ce.DELETE||n.t===ce.RETAIN&&n.body==null?re.deepClone({...n,len:t}):re.deepClone({...n,len:t,body:Tt(n.body,r,r+t,!1)})}else return{t:ce.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:ce.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}class Yn{constructor(){C(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function mc(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=sc(e,t,n),a=ic(e,t,n),l=oc(e,t,n),u=ac(e,t,n),h=lc(e,t,n),c=sE(e,t,n),d=iE(e,t,n);let f="";return r&&(e.dataStream=du(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:u,tables:h,customRanges:c,customDecorations:d}}function _c(e,t,n,r){e.dataStream=hu(e.dataStream,r,t.dataStream),Ju(e,t,n,r),qu(e,t,n,r),Zu(e,t,n,r),ec(e,t,n,r),tc(e,t,n,r),nE(e,t,n,r),rE(e,t,n,r)}function vE(e,t,n,r,s=Pe.COVER){return lE(e,t,n,r,s)}function yE(e,t,n){return t<=0?{dataStream:""}:mc(e,t,n)}function SE(e,t,n,r){n!==0&&_c(e,t,n,r)}function OE(e,t){const n=new Yn;return n.reset(),t.forEach(r=>{const s=re.deepClone(r);switch(s.t){case ce.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&vE(e,o,a,n.cursor,i),n.moveCursor(a);break}case ce.INSERT:{const{body:i,len:o}=s;SE(e,i,o,n.cursor),n.moveCursor(o);break}case ce.DELETE:{const{len:i}=s;yE(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function bE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=re.deepClone(t),e=re.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,u=0,h=null;function c(){return h?(i.push(h),h=null,!0):!1}for(;l<o&&u<a;){const{st:R,ed:O,ts:U}=t[l],{st:ne,ed:X,ts:de,sId:N}=e[u];let A={};if(s===0)A={...U},n===Pe.COVER&&r===Pe.REPLACE&&de&&(A=Object.assign({},de,A));else if(A={...U},n===Pe.REPLACE){if(r===Pe.REPLACE)A={...de};else if(U&&de){const H=Object.keys(U);for(const J of H)de[J]&&delete A[J]}}else if(r===Pe.REPLACE){if(de){const H=Object.keys(de);for(const J of H)de[J]!==void 0&&(A[J]=de[J])}}else if(de){const H=Object.keys(de);for(const J of H)A[J]!==void 0&&delete A[J]}if(O<ne)c()||i.push(t[l]),l++;else if(X<R)c()||i.push(e[u]),u++;else{const H={st:Math.min(R,ne),ed:Math.max(R,ne),ts:R<ne?{...U}:{...de},sId:R<ne?void 0:N};H.ed>H.st&&i.push(),i.push({st:Math.max(R,ne),ed:Math.min(O,X),ts:A,sId:N}),O<X?(l++,e[u].st=O,e[u].st===e[u].ed&&u++):(u++,t[l].st=X,t[l].st===t[l].ed&&l++);const J={st:Math.min(O,X),ed:Math.max(O,X),ts:O<X?{...de}:{...U},sId:O<X?N:void 0};h=J.ed>J.st?J:null}}c();const d=i[i.length-1],f=t[o-1],E=e[a-1];return d.ed!==Math.max(f.ed,E.ed)&&(f.ed>E.ed?i.push(f):i.push(E)),yr(i,!0)}function wE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Pe.REPLACE)return s===1?[re.deepClone(i)]:[re.deepClone(o)];if(r===Pe.REPLACE){const a=re.deepClone(o);return s===1&&Object.assign(a,re.deepClone(i)),[a]}else{const a=re.deepClone(o);return s===1&&Object.assign(a,re.deepClone(i)),[a]}}function La(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=re.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Pe.REPLACE)if(r===Pe.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===Pe.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Pe.REPLACE&&r===Pe.REPLACE?i.bullet=s===1?re.deepClone(e.bullet):re.deepClone(t.bullet):e.bullet===void 0?i.bullet=re.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?re.deepClone(t.bullet):re.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=re.deepClone(t.bullet)),i}function AE(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return re.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===fn.DELETED||i===fn.DELETED)&&(o=!0,n.push({...r,type:fn.DELETED}));break}o||n.push(r)}return n}function TE(e,t,n=!1){const{body:r,coverType:s=Pe.COVER}=e,{body:i,coverType:o=Pe.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:u,paragraphs:h=[],customRanges:c,customDecorations:d}=r,{textRuns:f,paragraphs:E=[],customRanges:R,customDecorations:O}=i,U=bE(u,f,s,o,n?1:0);U&&(a.textRuns=U);const ne=wE(c,R,s,o,n?1:0);ne&&(a.customRanges=ne);const X=AE(d,O);X&&(a.customDecorations=X);const de=[];let N=0,A=0;for(;N<h.length&&A<E.length;){const H=h[N],J=E[A],{startIndex:fe}=H,{startIndex:ae}=J;if(fe===ae){let m={startIndex:fe};n?m=La(H,J,s,o,1):m=La(H,J,s,o,0),de.push(m),N++,A++}else fe<ae?N++:(de.push(re.deepClone(J)),A++)}return A<E.length&&de.push(...E.slice(A)),de.length&&(a.paragraphs=de),{coverType:l,body:a}}function Ua(e){return Object.keys(e).length===1}const Nn=class Nn{constructor(){C(this,"_actions",[])}static apply(t,n){return OE(t,n)}static compose(t,n){const r=new Sn(t),s=new Sn(n),i=new Nn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===ce.INSERT)i.push(s.next());else if(r.peekType()===ce.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===ce.INSERT&&l.t===ce.RETAIN)l.body==null?i.push(a):i.push({...a,body:pi(a.body,l.body,l.coverType)});else if(a.t===ce.RETAIN&&l.t===ce.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const u=a.coverType===Pe.REPLACE||l.coverType===Pe.REPLACE?Pe.REPLACE:Pe.COVER;i.push({...a,t:ce.RETAIN,coverType:u,body:pi(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===ce.RETAIN&&l.t===ce.DELETE?i.push(l):a.t===ce.INSERT&&(l.t,ce.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new Sn(t),i=new Sn(n),o=new Nn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===ce.INSERT&&(r==="left"||i.peekType()!==ce.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===ce.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),u=i.next(a);if(l.t===ce.DELETE)continue;if(u.t===ce.DELETE){o.push(u);continue}if(l.body==null||u.body==null)o.push(u);else{const{coverType:h,body:c}=TE(l,u,r==="left");o.push({...u,t:ce.RETAIN,coverType:h,body:c})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new Sn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===ce.DELETE){n-=Math.min(o,n-i);continue}else a===ce.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===ce.INSERT)n.push({t:ce.DELETE,len:r.len,body:r.body});else if(r.t===ce.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:ce.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:ce.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Pe.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===ce.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=Tt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===ce.RETAIN&&i.body!=null){const o=Tt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==ce.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:ce.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:ce.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:ce.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=re.deepClone(t[0]);if(s.t===ce.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===ce.DELETE&&s.t===ce.DELETE)return r.len+=s.len,this;if(r.t===ce.DELETE&&s.t===ce.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===ce.RETAIN&&s.t===ce.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===ce.INSERT&&Ua(r.body)&&s.t===ce.INSERT&&Ua(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===ce.RETAIN&&IE(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};C(Nn,"id","text-x"),C(Nn,"uri","https://github.com/dream-num/univer#text-x");let ze=Nn;Object.defineProperty(ze,"name",{value:"text-x"});const Mn=class Mn{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==ze.id||(this._subTypes.set(t.name,t),mt.type.registerSubtype(t))}static apply(t,n){if(!mt.type.isNoop(n))return mt.type.apply(t,n)}static compose(t,n){return mt.type.compose(t,n)}static transform(t,n,r){return mt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===ze.name?ze.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return mt.type.invertWithDoc(t,n)}static isNoop(t){return mt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Mn),this._instance}removeOp(t,n){return mt.removeOp(t,n)}moveOp(t,n){return mt.moveOp(t,n)}insertOp(t,n){return mt.insertOp(t,n)}replaceOp(t,n,r){return mt.replaceOp(t,n,r)}editOp(t,n=["body"]){return mt.editOp(n,ze.name,t)}};C(Mn,"uri","https://github.com/dream-num/univer#json-x"),C(Mn,"_subTypes",new Map),C(Mn,"_instance",null);let Vt=Mn;Vt.registerSubtype(ze);const fo={id:"default_doc",documentStyle:{}};class NE extends Ss{constructor(n){var r;super();C(this,"type",$e.UNIVER_DOC);C(this,"_name$",new Oe.BehaviorSubject(""));C(this,"name$",this._name$.asObservable());C(this,"snapshot");this.snapshot={...fo,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...Sr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,u=s==null?void 0:s[n];if(!u)return;const h=u.docTransform;h.size.width=i,h.size.height=o,h.positionH.posOffset=a,h.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:n}:this.snapshot.settings.zoomRatio=1}}class Ft extends NE{constructor(n){var s,i;super(re.isEmptyObject(n)?G_():n);C(this,"_unitId");C(this,"headerModelMap",new Map);C(this,"footerModelMap",new Map);C(this,"change$",new Oe.BehaviorSubject(0));const r=6;this._unitId=(s=this.snapshot.id)!=null?s:re.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...fo,...n},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Vt.isNoop(n))return this.snapshot=Vt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(n,r,s=ho.copy){const i=this.getBody();if(i!=null)return Tt(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new Ft(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Ft(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}function ME(e){const{ranges:t,id:n,type:r}=e,s=new ze;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:u}=a;l>0&&s.push({t:ce.RETAIN,len:l-i}),s.push({t:ce.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:u-l-1}]},len:u-l}),i=u}return s}function DE(e){var h,c,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(c=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:c.customDecorations)==null?void 0:d.find(f=>f.id===t);if(!i)return!1;const o=new ze,{startIndex:a,endIndex:l}=i,u=l-a+1;return o.push({t:ce.RETAIN,len:a}),o.push({t:ce.RETAIN,len:u,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:u-1,id:t,type:fn.DELETED}]}}),o}function Ec(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function xE(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Ec(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function LE(e){return{...re.deepClone(e),rangeId:zt()}}function UE(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function Cc(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function PE(e,t){var i,o,a,l,u;const n=Cc(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((u=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?u:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}function FE(e){var c,d,f;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(c=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:c.customRanges)==null?void 0:d.find(E=>E.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new ze,u=a-o+1;l.push({t:ce.RETAIN,len:o}),l.push({t:ce.RETAIN,len:u,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:ce.INSERT,body:s,len:s.dataStream.length});const h=a+1+((f=s==null?void 0:s.dataStream.length)!=null?f:0);return l.selections=[{startOffset:h,endOffset:h,collapsed:!0}],l}function kE(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new ze;let u=!1;return t.forEach(h=>{var X,de,N;const c=PE(h,o);if(!c||!o)return!1;const{startOffset:d,endOffset:f}=c,E=(X=o.customRanges)!=null?X:[],R=(A,H,J)=>{var y,M,b,S;const fe=Cc(A,H,E,r),ae=Math.min((M=(y=fe[0])==null?void 0:y.startIndex)!=null?M:1/0,A),m=Math.max((S=(b=fe[fe.length-1])==null?void 0:b.endIndex)!=null?S:-1/0,H),j={rangeId:J?`${n}$${J}`:n,rangeType:r,startIndex:0,endIndex:m-ae,wholeEntity:s,properties:{...i}};l.push({t:ce.RETAIN,len:ae-a}),l.push({t:ce.RETAIN,len:m-ae+1,body:{dataStream:"",customRanges:[j]},coverType:Pe.COVER}),a=m+1},O=((de=o.paragraphs)!=null?de:[]).filter(A=>A.startIndex<f&&A.startIndex>d),U=((N=o.customBlocks)!=null?N:[]).filter(A=>A.startIndex<f&&A.startIndex>d);UE([d,f-1],[...O.map(A=>A.startIndex),...U.map(A=>A.startIndex)]).forEach(([A,H],J)=>R(A,H,J)),u=!0,l.selections=[{startOffset:c.endOffset,endOffset:c.endOffset,collapsed:!0}]}),u?l:!1}function Rc(e,t,n=0,r=null,s=!0){e.sort((u,h)=>u.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(u=>u.startIndex>=e[0].startOffset&&u.startIndex<e[0].endOffset);let l=n;if(e.forEach(u=>{const{startOffset:h,endOffset:c}=u;h>l&&(i.push({t:ce.RETAIN,len:h-l}),l=h),l<c&&(i.push({t:ce.DELETE,len:c-l}),l=c)}),r&&i.push({t:ce.INSERT,body:r,len:r.dataStream.length}),a&&s){const u=o.find(h=>h.startIndex-n>=e[e.length-1].endOffset-1);u&&(u.startIndex>l&&(i.push({t:ce.RETAIN,len:u.startIndex-l}),l=u.startIndex),i.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...u,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}function $E(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:ce.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:ce.RETAIN,len:a-s,body:{...re.deepClone(t),dataStream:""}}),s=a)}),r}const BE=e=>{var c;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(c=r.getSelfOrHeaderFooterModel(s))==null?void 0:c.getBody();if(!i)return!1;const o=t.collapsed?null:Tt(i,t.startOffset,t.endOffset),a=Li(o?o.dataStream:"",n.dataStream);let l=0;const u=a.map(([d,f])=>{switch(d){case 0:{const E={t:ce.RETAIN,body:{...Tt(n,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,E}case 1:{const E={t:ce.INSERT,body:Tt(n,l,l+f.length),len:f.length};return l+=f.length,E}default:return{t:ce.DELETE,len:f.length}}}),h=new ze;return h.push({t:ce.RETAIN,len:t.startOffset}),h.push(...u),h};function jE(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&(e!=null&&e.every((n,r)=>JSON.stringify(n)===JSON.stringify(t==null?void 0:t[r]))))}const HE=e=>{var c;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(c=r.getSelfOrHeaderFooterModel(s))==null?void 0:c.getBody();if(!i)return!1;const o=t.collapsed?null:Tt(i,t.startOffset,t.endOffset),a=Li(o?o.dataStream:"",n.dataStream);let l=0;const u=a.map(([d,f])=>{switch(d){case 0:{const E=us(n,l,l+f.length,!1),R=us(o,l,l+f.length,!1),O={t:ce.RETAIN,body:jE(E,R)?void 0:{textRuns:E,dataStream:""},len:f.length};return l+=f.length,O}case 1:{const E={t:ce.INSERT,body:Tt(n,l,l+f.length),len:f.length};return l+=f.length,E}default:return{t:ce.DELETE,len:f.length}}});if(u.every(d=>d.t===ce.RETAIN&&!d.body))return!1;const h=new ze;return h.push({t:ce.RETAIN,len:t.startOffset}),h.push(...u),h};function WE(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function zE(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const YE=e=>{var R,O,U,ne;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new ze,l=Vt.getInstance(),u=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const c=(O=(R=n.getSnapshot().drawingsOrder)==null?void 0:R.length)!=null?O:0;let d=0;if(s)i>0&&a.push({t:ce.RETAIN,len:i});else{const X=Rc([t],h,0,null,!1);a.push(...X);const de=WE(h,[t]),N=(U=n.getDrawings())!=null?U:{},A=(ne=n.getDrawingsOrder())!=null?ne:[],H=de.sort((J,fe)=>A.indexOf(J)>A.indexOf(fe)?-1:A.indexOf(J)<A.indexOf(fe)?1:0);if(H.length>0)for(const J of H){const fe=N[J],ae=A.indexOf(J);if(fe==null||ae<0)continue;const m=l.removeOp(["drawings",J],fe),j=l.removeOp(["drawingsOrder",ae],J);u.push(m),u.push(j),d++}}a.push({t:ce.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((X,de)=>({startIndex:de,blockId:X.drawingId}))},len:r.length});const f=zE(n,o),E=l.editOp(a.serialize(),f);u.push(E);for(const X of r){const{drawingId:de}=X,N=l.insertOp(["drawings",de],X),A=l.insertOp(["drawingsOrder",c-d],de);u.push(N),u.push(A)}return u.reduce((X,de)=>Vt.compose(X,de),null)},VE=e=>{var c,d,f;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(c=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:c.paragraphs)!=null?d:[],o=t.every(E=>{var R;return((R=E.bullet)==null?void 0:R.listType.indexOf(s))===0});let l=re.generateRandomId(6);if(t.length===1){const E=i.indexOf(t[0]),R=i[E-1],O=i[E+1];R&&R.bullet&&R.bullet.listType.indexOf(s)===0?(l=R.bullet.listId,s!==Ut.CHECK_LIST&&(s=R.bullet.listType)):O&&O.bullet&&O.bullet.listType.indexOf(s)===0&&(l=O.bullet.listId,s!==Ut.CHECK_LIST&&(s=O.bullet.listType))}const u=new Yn;u.reset();const h=new ze;for(const E of t){const{startIndex:R,paragraphStyle:O={},bullet:U}=E;h.push({t:ce.RETAIN,len:R-u.cursor}),h.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:O,startIndex:0}:{startIndex:0,paragraphStyle:{...O},bullet:{nestingLevel:(f=U==null?void 0:U.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),u.moveCursorTo(R+1)}return h},GE=e=>{var c;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(c=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:c.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ut.CHECK_LIST)===-1)return!1;const o=new Yn;o.reset();const a=new ze,{startIndex:l,paragraphStyle:u={}}=i,h=i.bullet.listType===Ut.CHECK_LIST?Ut.CHECK_LIST_CHECKED:Ut.CHECK_LIST;return a.push({t:ce.RETAIN,len:l-o.cursor}),a.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:u,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},KE=e=>{var h,c;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((h=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:h.paragraphs)==null)return!1;const a=re.generateRandomId(6),l=new Yn;l.reset();const u=new ze;for(const d of t){const{startIndex:f,paragraphStyle:E={},bullet:R}=d;u.push({t:ce.RETAIN,len:f-l.cursor}),u.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:E,bullet:{nestingLevel:(c=R==null?void 0:R.nestingLevel)!=null?c:0,textStyle:(R==null?void 0:R.listType)===n?R.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(f+1)}return u};function XE(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const QE=e=>{var h,c,d;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Yn;i.reset();const o=new ze,a=(h=r.getSnapshot().lists)!=null?h:{},l=(d=(c=r.getBody())==null?void 0:c.tables)!=null?d:[],u={...Sr,...a};for(const f of t){const{startIndex:E,paragraphStyle:R={},bullet:O}=f,U=XE(f,l);if(o.push({t:ce.RETAIN,len:E-i.cursor}),O){const ne=O.listType;let X=u[ne].nestingLevel.length-1;U&&(X=Math.min(X,2)),o.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R},bullet:{...O,nestingLevel:Math.max(Math.min(O.nestingLevel+s,X),0)}}]},coverType:Pe.REPLACE})}else o.push({t:ce.RETAIN,len:1});i.moveCursorTo(E+1)}return o};var Ic=(e=>(e.PARAGRAPH="PARAGRAPH",e.SECTION_BREAK="SECTION_BREAK",e.TABLE="TABLE",e.TABLE_ROW="TABLE_ROW",e.TABLE_CELL="TABLE_CELL",e.CUSTOM_BLOCK="CUSTOM_BLOCK",e))(Ic||{}),qt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
9
- `,e.TABLE_START="",e.TABLE_ROW_START="\x1B",e.TABLE_CELL_START="",e.TABLE_CELL_END="",e.TABLE_ROW_END="",e.TABLE_END="",e.CUSTOM_RANGE_START="",e.CUSTOM_RANGE_END="",e.COLUMN_BREAK="\v",e.PAGE_BREAK="\f",e.DOCS_END="\0",e.TAB=" ",e.CUSTOM_BLOCK="\b",e.LETTER="",e.SPACE=" ",e))(qt||{});function JE(e){return`${e}`}const qE=[qt.TABLE_START,qt.TABLE_ROW_START,qt.TABLE_CELL_START,qt.TABLE_CELL_END,qt.TABLE_ROW_END,qt.TABLE_END],vc=e=>{const t=e.endsWith(`\r
10
- `)?e.slice(0,-2):e;return qE.reduce((n,r)=>n.replaceAll(r,""),t)},ZE=e=>e?vc(e).replaceAll("\r","")==="":!0,eC=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,u=!0)=>{const h=t.slice(s,l);if(re.isLegalUrl(h)){const c=zt(),d=`${h}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:c,rangeType:on.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,u&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,u&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}};function tC(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function nC(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function rC(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class st{}C(st,"customRange",{add:kE,delete:FE,copyCustomRange:LE,getCustomRangesInterestsWithSelection:xE,isIntersecting:Ec}),C(st,"customDecoration",{add:ME,delete:DE}),C(st,"selection",{replace:BE,makeSelection:tC,normalizeSelection:nC,delete:Rc,replaceTextRuns:HE,retain:$E}),C(st,"range",{isIntersects:rC}),C(st,"transform",{getPlainText:vc,fromPlainText:eC,isEmptyDocument:ZE}),C(st,"paragraph",{bullet:{set:KE,switch:VE,toggleChecklist:GE,changeNestLevel:QE}}),C(st,"drawing",{add:YE});function sC(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]==="\r"&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function yc(e){var t;return e.body=sC((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class Vn{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Vn(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===Se.TRUE}get bold(){return this._style.bl===Se.TRUE}get underline(){return this._style.ul&&jt.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&jt.create(this._style.bbl)}get strikethrough(){return this._style.st&&jt.create(this._style.st)}get overline(){return this._style.ol&&jt.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return Wt.create(re.deepClone(this._style))}getValue(){return{...this._style}}}class Wt extends Vn{static create(t={}){return new Wt(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return Wt.create(re.deepClone(this._style))}build(){return this.getValue()}}class jt{constructor(t={s:1}){C(this,"_decoration");this._decoration=t}static create(t={s:1}){return new jt(t)}get show(){return this._decoration.s===Se.TRUE}get followFontColor(){return this._decoration.c===Se.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return jt.create(re.deepClone(this._decoration))}build(){return{...this._decoration}}}class Gn{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Gn(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===Se.TRUE}get keepNext(){return this._style.keepNext===Se.TRUE}get wordWrap(){return this._style.wordWrap===Se.TRUE}get widowControl(){return this._style.widowControl===Se.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===Se.TRUE}copy(){return kn.create(re.deepClone(this._style))}getValue(){return this._style}}class kn extends Gn{static create(t={}){return new kn(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return kn.create(re.deepClone(this._style))}build(){return this.getValue()}}class Ht{constructor(t){C(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=yc(t)}static create(t){return new Ht(t)}static createByBody(t){return new Ht({body:t,id:"d",documentStyle:{}})}copy(){return sn.create(re.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return sn.create({...re.deepClone(s),body:Tt(r,t,n)})}toPlainText(){var t,n;return st.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
11
- `)}getParagraphStyle(){var t,n;return Gn.create((n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].paragraphStyle)}getParagraphBullet(){var t,n;return(n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].bullet}getParagraphs(){var r,s;const t=(s=(r=this._data.body)==null?void 0:r.paragraphs)!=null?s:[];let n=0;return t.map(i=>{const o=this.slice(n,i.startIndex);return n=i.startIndex,o})}getTextRuns(){var t,n;return((n=(t=this._data.body)==null?void 0:t.textRuns)!=null?n:[]).map(r=>({...r,ts:r.ts?Vn.create(r.ts):null}))}getLinks(){var t,n,r;return(r=(n=(t=this._data.body)==null?void 0:t.customRanges)==null?void 0:n.filter(s=>s.rangeType===on.HYPERLINK))!=null?r:[]}getData(){return this._data}}class sn extends Ht{constructor(n){super(n);C(this,"_doc");this._doc=new Ft(n)}static newEmptyData(){return yc({id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
12
- `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new sn(n!=null?n:sn.newEmptyData())}insertText(n,r,s){var h,c;let i=((c=(h=this._data.body)==null?void 0:h.dataStream.length)!=null?c:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof Wt?r.build():r:a=s instanceof Wt?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},u=st.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!u)throw new Error("Insert text failed, please check.");return ze.apply(this._doc.getBody(),u.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof Ht?n.getData():n:(s=Math.min(n,s),i=r instanceof Ht?r.getData():r);const o=st.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return ze.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=st.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);ze.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof Wt?s.build():s,st:0,ed:r-n}]},o=st.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return ze.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=st.customRange.add({rangeType:on.HYPERLINK,rangeId:zt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return ze.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=st.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");ze.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=st.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");ze.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,Ht.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=sn.createByBody({dataStream:i,customRanges:[{rangeType:on.HYPERLINK,rangeId:zt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}function iC(e,t=16){let n=0,r=null;return function(...i){const o=Date.now();o-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=o,e.apply(this,i)},t)):(n=o,e.apply(this,i))}}var An=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(An||{});function oC(e){return`sheet_interceptor_${e}`}const Sc=e=>function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,n,l=>(a=!0,l)),!a)break}return s};class aC{constructor(t){C(this,"_interceptorsByName",new Map);C(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),Sc(s||[])}intercept(t,n){const r=t;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(n),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>mr(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function lC(e){return`sheet_async_interceptor_${e}`}const uC=e=>async function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,n,async l=>(a=!0,l)),!a)break}return s};class cC{constructor(t){C(this,"_asyncInterceptorsByName",new Map);C(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),uC(s||[])}async interceptAsync(t,n){const r=t;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(n),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>mr(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function hC(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}class Os extends nt{static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}const $s=Symbol("initializers");class go extends nt{constructor(t){super(),this._injector=t;const n=this,r=Object.getPrototypeOf(this)[$s];r&&r.forEach(function(s){s.apply(n,[t])})}_initialize(t){}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{if(n==="_initialize"){let r=this.prototype[$s];r||(r=[],this.prototype[$s]=r),r.push(t.prototype._initialize)}else n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}class bs{constructor(){C(this,"_data",[])}static create(){return new bs}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class po{constructor(){C(this,"_data",new Map)}static create(){return new po}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}const dC="0.6.0-alpha.0";function fC(e="",t=zn.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:dC,locale:t,styles:{},sheets:{},resources:[]}}class Oc{constructor(t={}){C(this,"_styles");C(this,"_cacheMap",new fr(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=re.generateRandomId(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&re.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(re.diffValue(n[r],t))return r;return null}}const gC=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Yt.equals(r,n))),pC=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Yt.equals(n.range,s.range)}),mi={t:0,b:2,l:2,r:2},mC=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Pa=90;function tr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Bt.UNSPECIFIED,verticalAlign:a=tn.UNSPECIFIED,wrapStrategy:l=_n.UNSPECIFIED,cellValueType:u}=n,{t:h,r:c,b:d,l:f}=i||mi,{vertexAngle:E,centerAngle:R}=Ac(s),O={id:"d",body:{dataStream:`${e}${_l}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:h,marginBottom:d,marginRight:c,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:R,vertexAngle:E,wrapStrategy:l,cellValueType:u,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new Ft(O)}function _C(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Fa(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,u={};return t&&(u.ff=t),n&&(u.fs=n),r&&(u.it=r),s&&(u.bl=s),i&&(u.ul=i),o&&(u.st=o),a&&(u.ol=a),l&&(u.cl=l),u}function bc(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===on.HYPERLINK))return;const s=st.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:on.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&ze.apply(r,s.serialize())}function wc(e){return e!=null}const EC='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function ka(e){const t=ht.ff,n=ht.fs;if(!e){const c=`${n}pt ${t}`;return{fontCache:c,fontString:c,fontSize:n,originFontSize:n,fontFamily:t}}let r=wn.ITALIC;(e.it===0||e.it===void 0)&&(r=wn.NORMAL);let s=wn.BOLD;(e.bl===0||e.bl===void 0)&&(s=wn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let c=e.ff;c=c.replace(/"/g,"").replace(/'/g,""),c.indexOf(" ")>-1&&(c=`"${c}"`),c==null&&(c=t),o=c}const{va:a}=e;let l=i;if(a===Pt.SUBSCRIPT||a===Pt.SUPERSCRIPT){const c=CC(o,l),{sbr:d,spr:f}=c;l*=a===Pt.SUBSCRIPT?d:f}const u=`${r} ${s} ${l}pt ${o}`,h=`${u}, ${EC} `;return{fontCache:u,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function CC(e,t){return mC(t)}function Ac(e){const{a:t=0,v:n=Se.FALSE}=e||{a:0,v:Se.FALSE};let r=0,s=t;return n===Se.TRUE&&(r=Pa,s=Pa),{centerAngle:r,vertexAngle:s}}class RC{constructor(t,n){C(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==Se.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:xe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:xe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:xe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:xe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return rn(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Se.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(t){const n=this._columnData[t];if(n)return n}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}class IC{constructor(t,n,r){C(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:Se.FALSE,h:s.defaultRowHeight},{ia:l,ah:u,h=s.defaultRowHeight}=a;i+=(l==null||l===Se.TRUE)&&typeof u=="number"?u:h}return i}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:xe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:xe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:xe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:xe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Se.TRUE:!0}getSize(){return rn(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const vC="DEFAULT_WORKSHEET_ROW_COUNT",Tc=1e3,yC="DEFAULT_WORKSHEET_COLUMN_COUNT",Nc=20,SC="DEFAULT_WORKSHEET_ROW_HEIGHT",Mc=24,OC="DEFAULT_WORKSHEET_COLUMN_WIDTH",Dc=88,bC="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",xc=46,wC="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Lc=20;function Uc(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Se.FALSE,rowCount:Tc,columnCount:Nc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Dc,defaultRowHeight:Mc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Se.TRUE,rowHeader:{width:xc,hidden:Se.FALSE},columnHeader:{height:Lc,hidden:Se.FALSE},rightToLeft:Se.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class AC extends nt{constructor(n){super();C(this,"_cellCache",new Map);C(this,"_rowCache",new Map);C(this,"_columnCache",new Map);C(this,"_hasRow",!1);C(this,"_hasColumn",!1);C(this,"_hasAll",!1);C(this,"_allIndex",-1);C(this,"_mergeData");C(this,"_rangeMap",new fr(5e4));C(this,"_skeletonCache",new fr(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===xe.ROW?this._createRowCache(s,r):i===xe.COLUMN?this._createColumnCache(s,r):i===xe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!re.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!re.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const u=[];for(const h of this._mergeData||[])Yt.intersects(h,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),u.push(l)),l++;return this._rangeMap.set(a,u),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const u=[];for(let h=0;h<a.length;h++){const{startRow:c,endRow:d,startColumn:f,endColumn:E}=a[h];for(let R=n;R<=s;R++){let O=!1;for(let U=r;U<=i;U++)if(R>=c&&R<=d&&U>=f&&U<=E){o.push({startRow:c,endRow:d,startColumn:f,endColumn:E}),u.push(h),O=!0;break}if(O)break}}return this._skeletonCache.set(l,u),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Pc extends nt{constructor(n){super();C(this,"_cellContentInterceptor",null);C(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value|An.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,Qe(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Qe(()=>this._rowFilteredInterceptor=null)}}const $a={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class gr{constructor(t,n,r){C(this,"_sheetId");C(this,"_snapshot");C(this,"_cellData");C(this,"_rowManager");C(this,"_columnManager");C(this,"_viewModel");C(this,"_spanModel");var a;this.unitId=t,this._styles=r,this._snapshot=Uc(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:re.generateRandomId(6),this._cellData=new Lt(o),this._viewModel=new Pc((l,u)=>this.getCellRaw(l,u)),this._rowManager=new IC(this._snapshot,this._viewModel,i),this._columnManager=new RC(this._snapshot,s),this._spanModel=new AC(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}mixinDefaultStyleToCellRaw(t,n,r,s){const i=this.getColumnStyle(n),o=this.getRowStyle(t),a=this.getDefaultCellStyleInternal();if(a||i||o){let l=r==null?void 0:r.s;typeof l=="string"&&(l=this._styles.get(l));const u=s?si(a,i,o,l):si(a,o,i,l);r||(r={}),r.s=u}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((u,h)=>{Object.keys(h).forEach(c=>{const d=+c,f=t.getValue(u,d),E=f!=null&&f.s?this._styles.get(f.s):null,R=(E==null?void 0:E.bd)&&(E.bd.b||E.bd.l||E.bd.r||E.bd.t||E.bd.bc_tr||E.bd.bl_tr||E.bd.ml_tr||E.bd.tl_bc||E.bd.tl_br||E.bd.tl_mr);(f&&(f.v||f.p)||E!=null&&E.bg||R)&&(a?r=Math.min(r,u):(r=u,a=!0),s=Math.max(s,u),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(u=>{a?r=Math.min(r,u.startRow):(r=u.startRow,a=!0),s=Math.max(s,u.endRow),l?i=Math.min(i,u.startColumn):(i=u.startColumn,a=!0),o=Math.max(o,u.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=re.deepClone(t);return new gr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,u=n;if(r){const{startRow:h,endRow:c,startColumn:d,endColumn:f}=r;t===h&&n===d?(o=c,a=f,l=h,u=d,i=!0):t>=h&&t<=c&&n>=d&&n<=f&&(o=c,a=f,l=h,u=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:u}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getMatrixWithMergedCells(t,n,r,s,i=bn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new Lt;return ci(t,r,n,s).forEach((u,h)=>{var d;let c;if(i===bn.Raw)c=this.getCellRaw(u,h);else if(i===bn.Intercepted)c=this.getCell(u,h);else if(i===bn.Both){const f=this.getCellRaw(u,h);if(f){c={...f};const E=(d=this.getCell(u,h))==null?void 0:d.v;wc(E)&&c&&(c.displayV=String(E))}}c&&l.setValue(u,h,c)}),a.forEach(u=>{const{startColumn:h,startRow:c,endColumn:d,endRow:f}=u;ci(c,f,h,d).forEach((E,R)=>{E===c&&R===h&&l.setValue(E,R,{...o.getValue(E,R),rowSpan:f-c+1,colSpan:d-h+1}),(E!==c||R!==h)&&l.realDeleteValue(E,R)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Fn(this,t,{getStyles:()=>this._styles}):new Fn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,u=s;return{next(){for(;;){if(u>o&&(l+=1,u=s),l>i)return{done:!0,value:void 0};const h=a.getCell(l,u),c=!h,d=a.getMergedCell(l,u);if(d){if(l!==d.startRow||u!==d.startColumn){u=d.endColumn+1;continue}if(c&&n){u=d.endColumn+1;continue}const E={row:l,col:u,value:h};return E.colSpan=d.endColumn-d.startColumn+1,E.rowSpan=d.endRow-d.startRow+1,u=d.endColumn+1,{done:!1,value:E}}if(c&&n)u+=1;else{const f={row:l,col:u,value:h};return u+=1,{done:!1,value:f}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let u=s,h=i;return{next(){for(;;){if(u>o&&(h+=1,u=s),h>a)return{done:!0,value:void 0};const c=l.getMergedCell(u,h);if(c){const E=u!==c.startRow,R=E||h!==c.startColumn;if(r&&R||!r&&E){u=c.endRow+1;continue}const O=l.getCell(c.startRow,c.startColumn);if(!O&&n){u=c.endRow+1;continue}const ne={row:u,col:c.startColumn,value:O};return ne.colSpan=c.endColumn-c.startColumn+1,ne.rowSpan=c.endRow-c.startRow+1,u=c.endRow+1,{done:!1,value:ne}}const d=l.getCell(u,h);if(!d&&n)u+=1;else{const E={row:u,col:h,value:d};return u+=1,{done:!1,value:E}}}}}}}}_getCellDocumentModel(t,n=$a){var R;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...$a,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const u=_C(o),h=i?ht.tr:u.textRotation||ht.tr;let c=u.horizontalAlign||ht.ht;const d=u.verticalAlign||ht.vt,f=u.wrapStrategy||ht.tb,E=u.paddingData||mi;if(t.f&&s)a=tr(t.f.toString(),{},{verticalAlign:d}),c=ht.ht;else if(t.p){const{centerAngle:O,vertexAngle:U}=Ac(h);a=this._updateConfigAndGetDocumentModel(r?re.deepClone(t.p):t.p,c,E,{horizontalAlign:c,verticalAlign:d,centerAngle:O,vertexAngle:U,wrapStrategy:f,zeroWidthParagraphBreak:1})}else if(t.v!=null){const O=Fa(o);l=ka(O).fontCache;let U=Fc(t);t.t===nn.FORCE_STRING&&s&&(U=`'${U}`),a=tr(U,O,{...u,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&bc(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:f,verticalAlign:d,horizontalAlign:c,paddingData:E,fill:(R=o==null?void 0:o.bg)==null?void 0:R.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,u,h;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(u=r.l)!=null?u:2,t.documentStyle.marginRight=(h=r.r)!=null?h:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const c of i)c.paragraphStyle||(c.paragraphStyle={}),c.paragraphStyle.horizontalAlign=n;return new Ft(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=Fa(r);if(n!=null)return n.documentModel==null&&(n.documentModel=tr("",s)),n;const i="";let o="document";const a=ht.tr,l=ht.ht,u=ht.vt,h=ht.tb,c=mi;return o=ka({}).fontCache,{documentModel:tr(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:u,horizontalAlign:l,paddingData:c}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function Fc(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return st.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===nn.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===nn.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function TC(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return st.transform.getPlainText(n)}return e==null?void 0:e.v}var NC=Object.defineProperty,MC=Object.getOwnPropertyDescriptor,DC=(e,t,n,r)=>{for(var s=r>1?void 0:r?MC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&NC(t,n,s),s},xC=(e,t)=>(n,r)=>t(n,r,e);function LC(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}exports.Workbook=class extends Ss{constructor(n={},r){super();C(this,"type",$e.UNIVER_SHEET);C(this,"_sheetCreated$",new Oe.Subject);C(this,"sheetCreated$",this._sheetCreated$.asObservable());C(this,"_sheetDisposed$",new Oe.Subject);C(this,"sheetDisposed$",this._sheetDisposed$.asObservable());C(this,"_activeSheet$",new Oe.BehaviorSubject(null));C(this,"activeSheet$",this._activeSheet$.asObservable());C(this,"_worksheets");C(this,"_styles");C(this,"_snapshot");C(this,"_unitId");C(this,"_count");C(this,"_name$");C(this,"name$");this._logService=r;const s=fC();re.isEmptyObject(n)?this._snapshot=s:this._snapshot=re.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=re.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Oc(i),this._count=1,this._worksheets=new Map,this._name$=new Oe.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return re.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new gr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==Se.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===Se.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Se.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(re.isEmptyObject(s)){const o=re.generateRandomId();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const u=new gr(this._unitId,a,this._styles);r.set(o,u),i.includes(o)||i.push(o)}this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}};exports.Workbook=DC([xC(1,At)],exports.Workbook);class mo extends Ss{constructor(n){var r;super();C(this,"type",$e.UNIVER_SLIDE);C(this,"_activePage$",new Oe.BehaviorSubject(null));C(this,"activePage$",this._activePage$.asObservable());C(this,"_name$");C(this,"name$");C(this,"_snapshot");C(this,"_unitId");this._snapshot={...gu,...n},this._unitId=(r=this._snapshot.id)!=null?r:re.generateRandomId(6),this._name$=new Oe.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:zt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=zt(6);return{id:n,pageType:lo.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}const nr="FOCUSING_UNIT",Tn="FOCUSING_SHEET",rr="FOCUSING_DOC",sr="FOCUSING_SLIDE",UC="FOCUSING_EDITOR_BUT_HIDDEN",kc="EDITOR_ACTIVATED",PC="FOCUSING_EDITOR_INPUT_FORMULA",$c="FOCUSING_FX_BAR_EDITOR",FC="FOCUSING_UNIVER_EDITOR",kC="FOCUSING_EDITOR_INPUT_FORMULA",$C="FOCUSING_PANEL_EDITOR",BC="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",jC="FOCUSING_COMMON_DRAWINGS",HC="FORMULA_EDITOR_ACTIVATED";var WC=Object.defineProperty,zC=Object.getOwnPropertyDescriptor,YC=(e,t,n,r)=>{for(var s=r>1?void 0:r?zC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&WC(t,n,s),s},Ba=(e,t)=>(n,r)=>t(n,r,e);const an=_t("univer.current");exports.UniverInstanceService=class extends nt{constructor(n,r){super();C(this,"_unitsByType",new Map);C(this,"_createHandler");C(this,"_ctorByType",new Map);C(this,"_currentUnits",new Map);C(this,"_currentUnits$",new Oe.BehaviorSubject(this._currentUnits));C(this,"currentUnits$",this._currentUnits$.asObservable());C(this,"_unitAdded$",new Oe.Subject);C(this,"unitAdded$",this._unitAdded$.asObservable());C(this,"_unitDisposed$",new Oe.Subject);C(this,"unitDisposed$",this._unitDisposed$.asObservable());C(this,"_focused$",new Oe.BehaviorSubject(null));C(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(Oe.map(r=>{var s;return(s=r.get(n))!=null?s:null}),Oe.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(Oe.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(Oe.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType($e.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,$e.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,$e.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType($e.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(nr,!0),this._contextService.setContextValue(rr,!1),this._contextService.setContextValue(Tn,!0),this._contextService.setContextValue(sr,!1),this.setCurrentUnitForType(n)):this.focused instanceof Ft?(this._contextService.setContextValue(nr,!0),this._contextService.setContextValue(rr,!0),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(sr,!1),this.setCurrentUnitForType(n)):this.focused instanceof mo?(this._contextService.setContextValue(nr,!0),this._contextService.setContextValue(rr,!1),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(sr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(nr,!1),this._contextService.setContextValue(rr,!1),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(sr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:$e.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(n,i),this._tryBlurUnitOnRemoval(n),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}};exports.UniverInstanceService=YC([Ba(0,it(Rt)),Ba(1,Cr)],exports.UniverInstanceService);var We=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(We||{});const VC={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var GC=Object.defineProperty,KC=Object.getOwnPropertyDescriptor,XC=(e,t,n,r)=>{for(var s=r>1?void 0:r?KC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&GC(t,n,s),s},QC=(e,t)=>(n,r)=>t(n,r,e);exports.LifecycleService=class extends nt{constructor(n){super();C(this,"_lifecycle$",new Oe.BehaviorSubject(We.Starting));C(this,"lifecycle$",this._lifecycle$.asObservable());C(this,"_lock",!1);this._logService=n,this._reportProgress(We.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return Oe.merge(Bc(this.stage),this._lifecycle$.pipe(Oe.skip(1))).pipe(Yl(n=>n===We.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${VC[n]}".`)}};exports.LifecycleService=XC([QC(0,At)],exports.LifecycleService);function Bc(e){switch(e){case We.Starting:return Oe.of(We.Starting);case We.Ready:return Oe.of(We.Starting,We.Ready);case We.Rendered:return Oe.of(We.Starting,We.Ready,We.Rendered);default:return Oe.of(We.Starting,We.Ready,We.Rendered,We.Steady)}}var JC=Object.defineProperty,qC=Object.getOwnPropertyDescriptor,ZC=(e,t,n,r)=>{for(var s=r>1?void 0:r?qC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&JC(t,n,s),s},Bs=(e,t)=>(n,r)=>t(n,r,e);const en=_t("univer.undo-redo.service"),eR=20;class jc{dispose(){}async dispatchToHandlers(){return!1}}const Hc="univer.command.redo",Wc="univer.command.undo",gn=new class extends jc{constructor(){super(...arguments);C(this,"type",Wn.COMMAND);C(this,"id",Wc)}handler(t){const n=t.get(en),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(xt);return zi(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},pn=new class extends jc{constructor(){super(...arguments);C(this,"type",Wn.COMMAND);C(this,"id",Hc)}handler(t){const n=t.get(en),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(xt);return zi(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends nt{constructor(n,r,s){super();C(this,"undoRedoStatus$");C(this,"_undoRedoStatus$",new Oe.BehaviorSubject({undos:0,redos:0}));C(this,"_undoStacks",new Map);C(this,"_redoStacks",new Map);C(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(gn)),this.disposeWithMe(this._commandService.registerCommand(pn)),this.disposeWithMe(Qe(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Qe(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>eR&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),Qe(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,u;let n="";const r=this._contextService.getContextValue(Tn),s=this._contextService.getContextValue($c),i=this._contextService.getContextValue(kc);return r?s?n=Pi:i?n=Ui:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(u=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?u:"",n}};exports.LocalUndoRedoService=ZC([Bs(0,an),Bs(1,xt),Bs(2,Cr)],exports.LocalUndoRedoService);const ws=_t("core.resource-manager.service"),_i={[Dt.Editor]:"Editor",[Dt.Owner]:"Owner",[Dt.Reader]:"Reader",[Dt.UNRECOGNIZED]:"UNRECOGNIZED"},cs=e=>e?{userID:`${_i[e]}_${re.generateRandomId(8)}`,name:_i[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},tR=(e,t)=>e.startsWith(_i[t]);class $n{constructor(){C(this,"_model",new Map);C(this,"_userChange$",new Oe.Subject);C(this,"userChange$",this._userChange$.asObservable());C(this,"_currentUser$",new Oe.BehaviorSubject(cs()));C(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(t){this.addUser(t),this._currentUser$.next(t)}addUser(t){this._model.set(t.userID,t),this._userChange$.next({type:"add",user:t})}getUser(t,n){const r=this._model.get(t);if(r)return r;n&&n()}delete(t){const n=this.getUser(t);this._model.delete(t),n&&this._userChange$.next({type:"delete",user:n})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var nR=Object.defineProperty,rR=Object.getOwnPropertyDescriptor,sR=(e,t,n,r)=>{for(var s=r>1?void 0:r?rR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&nR(t,n,s),s},ja=(e,t)=>(n,r)=>t(n,r,e);exports.AuthzIoLocalService=class{constructor(t,n){C(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(cs(Dt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?tR(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[$e.UNIVER_SHEET,$e.UNIVER_DOC,$e.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return zt(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:Dt.Owner,shareScope:-1,scope:{read:hi.AllCollaborator,edit:hi.AllCollaborator},creator:cs(Dt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(Dt.Owner)||this._getRole(Dt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}};exports.AuthzIoLocalService=sR([ja(0,ws),ja(1,it($n))],exports.AuthzIoLocalService);const zc=_t("IAuthzIoIoService"),Yc=_t("univer.config-service");class Vc{constructor(){C(this,"_configChanged$",new Oe.Subject);C(this,"configChanged$",this._configChanged$.asObservable());C(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=xi(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new Oe.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(Oe.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class Gc extends nt{constructor(){super(...arguments);C(this,"_error$",new Oe.Subject);C(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class ur extends nt{constructor(){super();C(this,"_currentLocale$",new Oe.BehaviorSubject(zn.ZH_CN));C(this,"currentLocale$",this._currentLocale$.asObservable());C(this,"_locales",null);C(this,"localeChanged$",new Oe.Subject);C(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(Qe(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=xi((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var iR=Object.defineProperty,oR=Object.getOwnPropertyDescriptor,aR=(e,t,n,r)=>{for(var s=r>1?void 0:r?oR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&iR(t,n,s),s},lR=(e,t)=>(n,r)=>t(n,r,e);exports.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:dr.PERSON,mentions:[{objectType:dr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}};exports.MentionIOLocalService=aR([lR(0,it($n))],exports.MentionIOLocalService);const Kc=_t("univer.service.mention-io");var _o=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(_o||{});const Xc=_t("univer.permission-service");class Qc extends nt{constructor(){super(...arguments);C(this,"_permissionPointMap",new Map);C(this,"_permissionPointUpdate$",new Oe.Subject);C(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());C(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof Oe.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new Oe.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=_o.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return Oe.combineLatest(r).pipe(Br.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function Jc(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}const qc=Symbol("DependentOn");class Ei extends nt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}C(Ei,"pluginName"),C(Ei,"type",$e.UNIVER_UNKNOWN);class uR{constructor(){C(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}class cR{constructor(){C(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var hR=Object.defineProperty,dR=Object.getOwnPropertyDescriptor,Zc=(e,t,n,r)=>{for(var s=r>1?void 0:r?dR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&hR(t,n,s),s},es=(e,t)=>(n,r)=>t(n,r,e);const fR=4;function gR(...e){return function(t){t[qc]=e}}exports.PluginService=class{constructor(t){C(this,"_pluginHolderForUniver");C(this,"_pluginHoldersForTypes",new Map);C(this,"_seenPlugins",new Set);C(this,"_flushTimer");this._injector=t,this._pluginHolderForUniver=this._injector.createInstance(hs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set($e.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const t of this._pluginHoldersForTypes.values())t.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(t,n){this._assertPluginValid(t),this._scheduleInitPlugin();const{type:r}=t;r===$e.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(t,n),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(t,n)}startPluginForType(t){this._ensurePluginHolderForType(t).start()}_ensurePluginHolderForType(t){if(!this._pluginHoldersForTypes.has(t)){const n=this._injector.createInstance(hs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(t,n),n}return this._pluginHoldersForTypes.get(t)}_immediateInitPlugin(t){this._seenPlugins.add(t.pluginName),this._ensurePluginHolderForType(t.type).immediateInitPlugin(t)}_checkPluginSeen(t){return this._seenPlugins.has(t.pluginName)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===$e.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},fR))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[t,n]of this._pluginHoldersForTypes)n.started&&n.flush()}};exports.PluginService=Zc([es(0,it(Rt))],exports.PluginService);let hs=class extends nt{constructor(t,n,r,s,i){super();C(this,"_started",!1);C(this,"_warnedAboutOnStartingDeprecation",!1);C(this,"_pluginRegistry",new cR);C(this,"_pluginStore",new uR);C(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Oe.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(t=>t.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(t,n){this._pluginRegistry.registerPlugin(t,n)}immediateInitPlugin(t){const n=this._initPlugin(t,void 0);this._pluginsRunLifecycle([n])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const t=this._pluginRegistry.getRegisterPlugins().map(({plugin:n,options:r})=>this._initPlugin(n,r));t.length&&(this._pluginsRunLifecycle(t),this._pluginRegistry.removePlugins())}_initPlugin(t,n){const r=t[qc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" depends on "${o.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._registerPlugin(o,void 0),!0):!1};for(;i(););}const s=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(t){Bc(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case We.Starting:r.onStarting();break;case We.Ready:r.onReady();break;case We.Rendered:r.onRendered();break;case We.Steady:r.onSteady();break}})}};hs=Zc([es(2,At),es(3,it(Rt)),es(4,it(exports.LifecycleService))],hs);var pR=Object.defineProperty,mR=Object.getOwnPropertyDescriptor,_R=(e,t,n,r)=>{for(var s=r>1?void 0:r?mR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&pR(t,n,s),s},Ha=(e,t)=>(n,r)=>t(n,r,e);let Ci=class extends nt{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case $e.UNRECOGNIZED:case $e.UNIVER_UNKNOWN:case $e.UNIVER_SLIDE:case $e.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType($e.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case $e.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType($e.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();El(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=re.deepClone(t.getSnapshot());return r.resources=n,r}};Ci=_R([Ha(0,it(ws)),Ha(1,it(an))],Ci);const Ri=_t("resource-loader-service");class eh extends nt{constructor(){super(...arguments);C(this,"_resourceMap",new Map);C(this,"_register$",new Oe.Subject);C(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),Qe(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch{console.error("LoadResources Error!")}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Eo extends nt{constructor(){super();C(this,"_currentTheme");C(this,"_currentTheme$",new Oe.BehaviorSubject({}));C(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Qe(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}class th{constructor(t={},n){C(this,"_startedTypes",new Set);C(this,"_injector");C(this,"_disposingCallbacks",new Is);const r=this._injector=ER(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(Eo).setTheme(s),o&&this._injector.get(ur).load(o),i&&this._injector.get(ur).setLocale(i),a&&this._injector.get(At).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(an)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Qe(t));return Qe(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(ur).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType($e.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType($e.UNIVER_DOC,Ft),this._univerInstanceService.registerCtorForType($e.UNIVER_SLIDE,mo);const n=t.get(an);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<We.Ready&&(this._injector.get(exports.LifecycleService).stage=We.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function ER(e,t){const n=Jc([[Gc],[ur],[Eo],[exports.LifecycleService],[exports.PluginService],[$n],[an,{useClass:exports.UniverInstanceService}],[Xc,{useClass:Qc}],[At,{useClass:Hl,lazy:!0}],[xt,{useClass:exports.CommandService}],[en,{useClass:exports.LocalUndoRedoService,lazy:!0}],[Yc,{useClass:Vc}],[Cr,{useClass:Bl}],[ws,{useClass:eh,lazy:!0}],[Ri,{useClass:Ci,lazy:!0}],[zc,{useClass:exports.AuthzIoLocalService}],[Kc,{useClass:exports.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Rt(n);return Ll(r,[[$n],[Ri]]),r}var CR=Object.defineProperty,RR=Object.getOwnPropertyDescriptor,IR=(e,t,n,r)=>{for(var s=r>1?void 0:r?RR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&CR(t,n,s),s},vR=(e,t)=>(n,r)=>t(n,r,e);exports.FBlob=class extends Os{constructor(t,n){super(),this._blob=t,this._injector=n}copyBlob(){return this._injector.createInstance(exports.FBlob,this._blob)}getAs(t){const n=this.copyBlob();return n.setContentType(t),n}getDataAsString(t){return this._blob===null?Promise.resolve(""):t===void 0?this._blob.text():new Promise((n,r)=>{this._blob.arrayBuffer().then(s=>{const i=new TextDecoder(t).decode(s);n(i)}).catch(s=>{r(new Error(`Failed to read Blob as ArrayBuffer: ${s.message}`))})})}getBytes(){return this._blob?this._blob.arrayBuffer().then(t=>new Uint8Array(t)):Promise.reject(new Error("Blob is undefined or null."))}setBytes(t){return this._blob=new Blob([t]),this}setDataFromString(t,n){const r=n!=null?n:"text/plain",s=new Blob([t],{type:r});return this._blob=s,this}getContentType(){var t;return(t=this._blob)==null?void 0:t.type}setContentType(t){var n;return this._blob=(n=this._blob)==null?void 0:n.slice(0,this._blob.size,t),this}};exports.FBlob=IR([vR(1,it(Rt))],exports.FBlob);var yR=Object.defineProperty,SR=Object.getOwnPropertyDescriptor,OR=(e,t,n,r)=>{for(var s=r>1?void 0:r?SR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&yR(t,n,s),s},bR=(e,t)=>(n,r)=>t(n,r,e);let Ii=class extends go{constructor(e,t){super(t),this.doc=e}};Ii=OR([bR(1,it(Rt))],Ii);var Co=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Co||{}),Ro=(e=>(e.BETWEEN="between",e.EQUAL="equal",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.NOT_BETWEEN="notBetween",e.NOT_EQUAL="notEqual",e))(Ro||{}),Io=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Io||{}),vo=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(vo||{}),yo=(e=>(e.CUSTOM="custom",e.LIST="list",e.LIST_MULTIPLE="listMultiple",e.NONE="none",e.TEXT_LENGTH="textLength",e.DATE="date",e.TIME="time",e.WHOLE="whole",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e.ANY="any",e))(yo||{});const Dn=class Dn{static get(){if(this._instance)return this._instance;const t=new Dn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in Dn.prototype)this[t]=Dn.prototype[t]}get UniverInstanceType(){return $e}get LifecycleStages(){return We}get DataValidationType(){return yo}get DataValidationErrorStyle(){return Co}get DataValidationRenderMode(){return Io}get DataValidationOperator(){return Ro}get DataValidationStatus(){return vo}get CommandType(){return Wn}get BaselineOffset(){return Pt}get BooleanNumber(){return Se}get HorizontalAlign(){return Bt}get TextDecoration(){return ro}get TextDirection(){return Pn}get VerticalAlign(){return tn}get BorderType(){return Vi}get BorderStyleTypes(){return Xe}get AutoFillSeries(){return Yi}get ColorType(){return Et}get CommonHideTypes(){return Gi}get CopyPasteType(){return Ki}get DeleteDirection(){return Xi}get DeveloperMetadataVisibility(){return Qi}get Dimension(){return Ji}get Direction(){return qi}get InterpolationPointType(){return Zi}get LocaleType(){return zn}get MentionType(){return dr}get ProtectionType(){return eo}get RelativeDate(){return to}get SheetTypes(){return no}get ThemeColorType(){return ct}};C(Dn,"_instance");let ds=Dn;const xn=class xn{static get(){if(this._instance)return this._instance;const t=new xn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in xn.prototype)this[t]=xn.prototype[t]}get DocCreated(){return"DocCreated"}get DocDisposed(){return"DocDisposed"}get LifeCycleChanged(){return"LifeCycleChanged"}get Redo(){return"Redo"}get Undo(){return"Undo"}get BeforeRedo(){return"BeforeRedo"}get BeforeUndo(){return"BeforeUndo"}get CommandExecuted(){return"CommandExecuted"}get BeforeCommandExecute(){return"BeforeCommandExecute"}};C(xn,"_instance");let fs=xn;var wR=Object.defineProperty,AR=Object.getOwnPropertyDescriptor,TR=(e,t,n,r)=>{for(var s=r>1?void 0:r?AR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&wR(t,n,s),s},Wa=(e,t)=>(n,r)=>t(n,r,e);exports.FHooks=class extends Os{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Starting)).subscribe(t))}onReady(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Ready)).subscribe(t))}onRendered(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Rendered)).subscribe(t))}onSteady(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(xt).beforeCommandExecuted(r=>{if(r.id===gn.id){const i=this._injector.get(en).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(xt).onCommandExecuted(r=>{if(r.id===gn.id){const i=this._injector.get(en).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(xt).beforeCommandExecuted(r=>{if(r.id===pn.id){const i=this._injector.get(en).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(xt).onCommandExecuted(r=>{if(r.id===pn.id){const i=this._injector.get(en).pitchTopRedoElement();i&&t(i)}})}};exports.FHooks=TR([Wa(0,it(Rt)),Wa(1,it(exports.LifecycleService))],exports.FHooks);var NR=Object.defineProperty,MR=Object.getOwnPropertyDescriptor,DR=(e,t,n,r)=>{for(var s=r>1?void 0:r?MR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&NR(t,n,s),s},za=(e,t)=>(n,r)=>t(n,r,e);let vi=class extends Os{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};vi=DR([za(0,it(Rt)),za(1,it($n))],vi);const ps=class ps{static get(){if(this._instance)return this._instance;const t=new ps;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}get rectangle(){return Yt}get numfmt(){return fu}get tools(){return re}};C(ps,"_instance");let gs=ps;var xR=Object.defineProperty,LR=Object.getOwnPropertyDescriptor,UR=(e,t,n,r)=>{for(var s=r>1?void 0:r?LR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&xR(t,n,s),s},Fr=(e,t)=>(n,r)=>t(n,r,e);exports.FUniver=class extends go{constructor(n,r,s,i){super(n);C(this,"_eventRegistry",new Map);this._injector=n,this._commandService=r,this._univerInstanceService=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(o=>{this.fireEvent(this.Event.LifeCycleChanged,{stage:o})})),this.disposeWithMe(this._commandService.beforeCommandExecuted(o=>{if(!this._eventRegistry.get(this.Event.BeforeRedo)&&!this._eventRegistry.get(this.Event.BeforeUndo)&&!this._eventRegistry.get(this.Event.BeforeCommandExecute))return;const{id:a,type:l,params:u}=o,c={id:a,type:l,params:u};switch(o.id){case pn.id:this.fireEvent(this.Event.BeforeRedo,c);break;case gn.id:this.fireEvent(this.Event.BeforeUndo,c);break;default:this.fireEvent(this.Event.BeforeCommandExecute,c);break}if(c.cancel)throw new Pl})),this.disposeWithMe(this._commandService.onCommandExecuted(o=>{if(!this._eventRegistry.get(this.Event.Redo)&&!this._eventRegistry.get(this.Event.Undo)&&!this._eventRegistry.get(this.Event.CommandExecuted))return;const{id:a,type:l,params:u}=o,c={id:a,type:l,params:u};switch(o.id){case pn.id:this.fireEvent(this.Event.Redo,c);break;case gn.id:this.fireEvent(this.Event.Undo,c);break;default:this.fireEvent(this.Event.CommandExecuted,c);break}})),this._initUnitEvent(this._injector),this._injector.onDispose(()=>{this.dispose()})}static newAPI(n){return(n instanceof th?n.__getInjector():n).createInstance(exports.FUniver)}_ensureEventRegistry(n){return this._eventRegistry.has(n)||this._eventRegistry.set(n,new bs),this._eventRegistry.get(n)}_initUnitEvent(n){const r=n.get(an);this.disposeWithMe(r.unitDisposed$.subscribe(s=>{this._eventRegistry.get(this.Event.DocDisposed)&&s.type===$e.UNIVER_DOC&&this.fireEvent(this.Event.DocDisposed,{unitId:s.getUnitId(),unitType:s.type,snapshot:s.getSnapshot()})})),this.disposeWithMe(r.unitAdded$.subscribe(s=>{if(this._eventRegistry.get(this.Event.DocCreated)&&s.type===$e.UNIVER_DOC){const i=s,o=n.createInstance(Ii,i);this.fireEvent(this.Event.DocCreated,{unitId:s.getUnitId(),type:s.type,doc:o,unit:o})}}))}_eventListend(n){return this._eventRegistry.get(n)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(gn.id)}redo(){return this._commandService.executeCommand(pn.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((r,s)=>{n(r,s)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((r,s)=>{n(r,s)})}executeCommand(n,r,s){return this._commandService.executeCommand(n,r,s)}syncExecuteCommand(n,r,s){return this._commandService.syncExecuteCommand(n,r,s)}getHooks(){return this._injector.createInstance(exports.FHooks)}get Enum(){return ds.get()}get Event(){return fs.get()}get Util(){return gs.get()}addEvent(n,r){return this._ensureEventRegistry(n).add(r),Qe(()=>this._ensureEventRegistry(n).delete(r))}fireEvent(n,r){var s;return(s=this._eventRegistry.get(n))==null||s.getData().forEach(i=>{i(r)}),r.cancel}hasEventCallback(n){var s,i;return((i=(s=this._eventRegistry.get(n))==null?void 0:s.getData().length)!=null?i:0)>0}getUserManager(){return this._injector.createInstance(vi)}newBlob(){return this._injector.createInstance(exports.FBlob)}newColor(){return new Rr}newRichText(n){return sn.create(n)}newRichTextValue(n){return Ht.create(n)}newParagraphStyle(n){return kn.create(n)}newParagraphStyleValue(n){return Gn.create(n)}newTextStyle(n){return Wt.create(n)}newTextStyleValue(n){return Vn.create(n)}newTextDecoration(n){return new jt(n)}};exports.FUniver=UR([Fr(0,it(Rt)),Fr(1,xt),Fr(2,an),Fr(3,it(exports.LifecycleService))],exports.FUniver);function nh(e){return/^-?\d+(\.\d+)?$/.test(e)}function PR(e){return nh(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function FR(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.close(),t.port2.close()}}function kR(e,t){return t.forEach(n=>e.add(n)),e}function $R(e,t,n,r){var u;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Ft(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const h=new ze,c=Vt.getInstance();if(a>0&&h.retain(a),n.length>0){const d=i.sliceBody(a,a+o),f={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(u=d==null?void 0:d.customRanges)!=null&&u.length){const E=d.customRanges[0];f.customRanges=[{...E,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,f)}h.delete(o),i.apply(c.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const BR="__default_document_sub_component_id20231101__";class rh{constructor(){C(this,"skipNextObservers",!1);C(this,"lastReturnValue");C(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class jR extends Oe.Subject{constructor(){super(...arguments);C(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new rh;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function HR(e){return new Oe.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const WR=_t("ILocalStorageService");function zR(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function YR(e){return new Promise(t=>setTimeout(t,e))}function VR(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var So=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(So||{}),sh=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(sh||{});const yi=_t("core.image-io.service");class GR{constructor(t,n=100){C(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new fr(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n);let o=this._imageCacheMap.get(i);return o||((async()=>{o=new Image;const a=this._injector.has(yi)?this._injector.get(yi):null;if(t===So.UUID)try{o.src=await(a==null?void 0:a.getImage(n))||""}catch(l){console.error(l)}else o.src=n;o.onload=()=>{r==null||r()},o.onerror=()=>{s==null||s()},this._imageCacheMap.set(i,o)})(),null)}}const KR=["script","style","meta","comment","link"];var ih=(e=>(e[e.DISABLED=0]="DISABLED",e[e.FULL_ALPHA=1]="FULL_ALPHA",e[e.FULL_HANGUL=2]="FULL_HANGUL",e[e.FULL_KATAKANA=3]="FULL_KATAKANA",e[e.HALF_ALPHA=4]="HALF_ALPHA",e[e.HALF_HANGUL=5]="HALF_HANGUL",e[e.HALF_KATAKANA=6]="HALF_KATAKANA",e[e.HIRAGANA=7]="HIRAGANA",e[e.NO_CONTROL=8]="NO_CONTROL",e[e.OFF=9]="OFF",e[e.ON=10]="ON",e))(ih||{});const Ya=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],js=1,Qn=8;class Oo{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==js)throw new Error(`Got v${s} data when expected v${js}.`);const i=Ya[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new Oo(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Ya.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Qn,t),this.coords=new this.ArrayType(this.data,Qn+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Qn+o+a+l),this.ids=new this.IndexArrayType(this.data,Qn,t),this.coords=new this.ArrayType(this.data,Qn+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(js<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Si(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],u=[];for(;l.length;){const h=l.pop()||0,c=l.pop()||0,d=l.pop()||0;if(c-d<=a){for(let O=d;O<=c;O++){const U=o[2*O],ne=o[2*O+1];U>=t&&U<=r&&ne>=n&&ne<=s&&u.push(i[O])}continue}const f=d+c>>1,E=o[2*f],R=o[2*f+1];E>=t&&E<=r&&R>=n&&R<=s&&u.push(i[f]),(h===0?t<=E:n<=R)&&(l.push(d),l.push(f-1),l.push(1-h)),(h===0?r>=E:s>=R)&&(l.push(f+1),l.push(c),l.push(1-h))}return u}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],u=r*r;for(;a.length;){const h=a.pop()||0,c=a.pop()||0,d=a.pop()||0;if(c-d<=o){for(let O=d;O<=c;O++)Va(i[2*O],i[2*O+1],t,n)<=u&&l.push(s[O]);continue}const f=d+c>>1,E=i[2*f],R=i[2*f+1];Va(E,R,t,n)<=u&&l.push(s[f]),(h===0?t-r<=E:n-r<=R)&&(a.push(d),a.push(f-1),a.push(1-h)),(h===0?t+r>=E:n+r>=R)&&(a.push(f+1),a.push(c),a.push(1-h))}return l}}function Si(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;oh(e,t,o,r,s,i),Si(e,t,n,r,o-1,1-i),Si(e,t,n,o+1,s,1-i)}function oh(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const u=s-r+1,h=n-r+1,c=Math.log(u),d=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*d*(u-d)/u)*(h-u/2<0?-1:1),E=Math.max(r,Math.floor(n-h*d/u+f)),R=Math.min(s,Math.floor(n+(u-h)*d/u+f));oh(e,t,n,E,R,i)}const o=t[2*n+i];let a=r,l=s;for(Jn(e,t,r,n),t[2*s+i]>o&&Jn(e,t,r,s);a<l;){for(Jn(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Jn(e,t,r,l):(l++,Jn(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Jn(e,t,n,r){Hs(e,n,r),Hs(t,2*n,2*r),Hs(t,2*n+1,2*r+1)}function Hs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Va(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function ah(e,t,n=0,r=e.length-1,s=XR){for(;r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,h=Math.log(l),c=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1),f=Math.max(n,Math.floor(t-u*c/l+d)),E=Math.min(r,Math.floor(t+(l-u)*c/l+d));ah(e,t,f,E,s)}const i=e[t];let o=n,a=r;for(qn(e,n,t),s(e[r],i)>0&&qn(e,n,r);o<a;){for(qn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?qn(e,n,a):(a++,qn(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function qn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function XR(e,t){return e<t?-1:e>t?1:0}class Oi{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!$r(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;$r(t,l)&&(n.leaf?r.push(a):zs(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!$r(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if($r(t,o)){if(n.leaf||zs(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=On([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,u;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),u=!0),r.leaf){const h=QR(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!u&&!r.leaf&&zs(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],u=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=On(t.slice(n,r+1)),yn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=On([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),u=l*Math.ceil(Math.sqrt(o));Ga(t,n,r,u,this.compareMinX);for(let h=n;h<=r;h+=u){const c=Math.min(h+u-1,r);Ga(t,h,c,l,this.compareMinY);for(let d=h;d<=c;d+=l){const f=Math.min(d+l-1,c);a.children.push(this._build(t,d,f,s-1))}}return yn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const u=n.children[l],h=Ws(u),c=ZR(t,u)-h;c<o?(o=c,i=h<i?h:i,a=u):c===o&&h<i&&(i=h,a=u)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),or(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=On(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,yn(r,this.toBBox),yn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=On([t,n]),this.data.height=t.height+1,this.data.leaf=!1,yn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=ir(t,0,a,this.toBBox),u=ir(t,a,r,this.toBBox),h=e0(l,u),c=Ws(l)+Ws(u);h<i?(i=h,s=a,o=c<o?c:o):h===i&&c<o&&(o=c,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:JR,i=t.leaf?this.compareMinY:qR,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=ir(t,0,n,i),a=ir(t,r-n,r,i);let l=kr(o)+kr(a);for(let u=n;u<r-n;u++){const h=t.children[u];or(o,t.leaf?i(h):h),l+=kr(o)}for(let u=r-n-1;u>=n;u--){const h=t.children[u];or(a,t.leaf?i(h):h),l+=kr(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)or(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():yn(t[n],this.toBBox)}}function QR(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function yn(e,t){ir(e,0,e.children.length,t,e)}function ir(e,t,n,r,s){s||(s=On(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];or(s,e.leaf?r(o):o)}return s}function or(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function JR(e,t){return e.minX-t.minX}function qR(e,t){return e.minY-t.minY}function Ws(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function kr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function ZR(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function e0(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function zs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function $r(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function On(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ga(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;ah(e,o,t,n,s),i.push(t,o,o,n)}}class t0{constructor(t=!1){C(this,"_tree",new Map);C(this,"_oneCellCache",new Map);C(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Oi),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const u=l.get(s);u&&u.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:u,endRow:h,endColumn:c}=s;for(let d=l;d<=h;d++){const f=a.get(d);if(f)for(let E=u;E<=c;E++){const R=f.get(E);R&&R.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var E;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,u=(E=this._kdTree.get(n))==null?void 0:E.get(r);if(!u)return[];const{tree:h,items:c}=u,d=h.range(o,i,l,a),f=[];for(const R of d){const O=c[R];f.push(...Array.from(O.ids))}return f}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new Oo(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:u}=s;if(this._enableOneCellCache&&o===a&&l===u){this._insertOneCellCache(n,r,o,l,i);return}const h=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(u)&&(u=Number.POSITIVE_INFINITY),h.insert({minX:l,minY:o,maxX:u,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const u of l)yield u}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:u}=s;this._enableOneCellCache?o===l&&a===u?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Oi;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}dh();exports.ABCToNumber=j_;exports.AUTO_HEIGHT_FOR_MERGED_CELLS=yg;exports.AbsoluteRefType=tt;exports.ActionIterator=Sn;exports.AlignTypeH=ju;exports.AlignTypeV=Hu;exports.ArrangeTypeEnum=Yu;exports.ArrowsAndMarkersShapes=Ql;exports.AsyncInterceptorManager=cC;exports.AutoFillSeries=Yi;exports.BaselineOffset=Pt;exports.BasicShapes=Xl;exports.BlockType=Ru;exports.BooleanNumber=Se;exports.BorderStyleTypes=Xe;exports.BorderType=Vi;exports.BuildTextUtils=st;exports.BulletAlignment=vr;exports.COLORS=oi;exports.CanceledError=Pl;exports.CellModeEnum=bn;exports.CellValueType=nn;exports.Color=En;exports.ColorBuilder=Rr;exports.ColorKit=bt;exports.ColorType=Et;exports.ColumnSeparatorType=yu;exports.CommandType=Wn;exports.CommonHideTypes=Gi;exports.ConfigService=Vc;exports.ContextService=Bl;exports.CopyPasteType=Ki;exports.CustomCommandExecutionError=ri;exports.CustomDecorationType=fn;exports.CustomRangeType=on;exports.DEFAULT_CELL=w_;exports.DEFAULT_DOC=fo;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=BR;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=_l;exports.DEFAULT_RANGE=O_;exports.DEFAULT_RANGE_ARRAY=S_;exports.DEFAULT_SELECTION=b_;exports.DEFAULT_SLIDE=gu;exports.DEFAULT_STYLES=ht;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=Nc;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=yC;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Lc;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=wC;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Dc;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=OC;exports.DEFAULT_WORKSHEET_ROW_COUNT=Tc;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=vC;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Mc;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=SC;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=xc;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=bC;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Pi;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Ui;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=ml;exports.DOC_RANGE_TYPE=ou;exports.DashStyleType=Nu;exports.DataStreamTreeNodeType=Ic;exports.DataStreamTreeTokenType=qt;exports.DataValidationErrorStyle=Co;exports.DataValidationImeMode=ih;exports.DataValidationOperator=Ro;exports.DataValidationRenderMode=Io;exports.DataValidationStatus=vo;exports.DataValidationType=yo;exports.DeleteDirection=Xi;exports.DependentOn=gR;exports.DesktopLogService=Hl;exports.DeveloperMetadataVisibility=Qi;exports.Dimension=Ji;exports.Direction=qi;exports.Disposable=nt;exports.DisposableCollection=Is;exports.DocStyleType=Eu;exports.DocumentDataModel=Ft;exports.DocumentFlavor=ao;exports.DrawingTypeEnum=Vu;exports.EDITOR_ACTIVATED=kc;exports.EXTENSION_NAMES=pu;exports.ErrorService=Gc;exports.EventState=rh;exports.EventSubject=jR;exports.FBase=Os;exports.FBaseInitialable=go;exports.FEnum=ds;exports.FEventName=fs;exports.FOCUSING_COMMON_DRAWINGS=jC;exports.FOCUSING_DOC=rr;exports.FOCUSING_EDITOR_BUT_HIDDEN=UC;exports.FOCUSING_EDITOR_INPUT_FORMULA=PC;exports.FOCUSING_EDITOR_STANDALONE=kC;exports.FOCUSING_FX_BAR_EDITOR=$c;exports.FOCUSING_PANEL_EDITOR=$C;exports.FOCUSING_SHEET=Tn;exports.FOCUSING_SLIDE=sr;exports.FOCUSING_UNIT=nr;exports.FOCUSING_UNIVER_EDITOR=FC;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=BC;exports.FORMULA_EDITOR_ACTIVATED=HC;exports.FUtil=gs;exports.FollowNumberWithType=Cu;exports.FontItalic=ss;exports.FontStyleType=wn;exports.FontWeight=is;exports.GridType=Iu;exports.HLSColor=ru;exports.HorizontalAlign=Bt;exports.IAuthzIoService=zc;exports.ICommandService=xt;exports.IConfigService=Yc;exports.IContextService=Cr;exports.IImageIoService=yi;exports.ILocalStorageService=WR;exports.ILogService=At;exports.IMentionIOService=Kc;exports.IPermissionService=Xc;exports.IResourceLoaderService=Ri;exports.IResourceManagerService=ws;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=vg;exports.IUndoRedoService=en;exports.IUniverInstanceService=an;exports.ImageCacheMap=GR;exports.ImageSourceType=So;exports.ImageUploadStatusType=sh;exports.Inject=it;exports.Injector=Rt;exports.InterceptorEffectEnum=An;exports.InterceptorManager=aC;exports.InterpolationPointType=Zi;exports.JSON1=tE;exports.JSONX=Vt;exports.LRUHelper=er;exports.LRUMap=fr;exports.LifecycleStages=We;exports.ListGlyphType=Ne;exports.LocaleService=ur;exports.LocaleType=zn;exports.LogLevel=jl;exports.MOVE_BUFFER_VALUE=Zn;exports.Many=bl;exports.MemoryCursor=Yn;exports.MentionType=dr;exports.NamedStyleType=Au;exports.NilCommand=Wl;exports.NumberUnitType=Bu;exports.ObjectMatrix=Lt;exports.ObjectRelativeFromH=ku;exports.ObjectRelativeFromV=$u;exports.Optional=wl;exports.OtherShapes=Jl;exports.PRESET_LIST_TYPE=Sr;exports.PageElementType=Gu;exports.PageOrientType=zu;exports.PageType=lo;exports.ParagraphElementType=Ou;exports.ParagraphStyleBuilder=kn;exports.ParagraphStyleValue=Gn;exports.PermissionService=Qc;exports.PermissionStatus=_o;exports.Plugin=Ei;exports.PositionedObjectLayoutType=wu;exports.PresetListType=Ut;exports.ProtectionType=eo;exports.QuickListType=uc;exports.QuickListTypeMap=aE;exports.RANGE_DIRECTION=iu;exports.RANGE_TYPE=xe;exports.RBush=Oi;exports.RCDisposable=Ep;exports.RGBA_PAREN=Xp;exports.RGB_PAREN=Kp;exports.ROTATE_BUFFER_VALUE=Kl;exports.RTree=t0;exports.Range=Fn;exports.Rectangle=Yt;exports.RediConsumer=Ml;exports.RediContext=Er;exports.RediError=ot;exports.RediProvider=Wi;exports.RedoCommand=pn;exports.RedoCommandId=Hc;exports.RefAlias=B_;exports.Registry=bs;exports.RegistryAsMap=po;exports.RelativeDate=to;exports.RelativeSlideLink=Ku;exports.ResourceManagerService=eh;exports.RgbColor=os;exports.RichTextBuilder=sn;exports.RichTextValue=Ht;exports.RxDisposable=_p;exports.SHEET_EDITOR_UNITS=A_;exports.SectionType=vu;exports.Self=Ol;exports.SheetTypes=no;exports.SheetViewModel=Pc;exports.SkipSelf=Sl;exports.SliceBodyType=ho;exports.SlideDataModel=mo;exports.SpacingRule=Tu;exports.SpecialShapes=ql;exports.Styles=Oc;exports.THEME_COLORS=nu;exports.TabStopAlignment=Mu;exports.TableAlignmentType=xu;exports.TableLayoutType=Lu;exports.TableRowHeightRule=Pu;exports.TableSizeType=Du;exports.TableTextWrapType=Uu;exports.TextDecoration=ro;exports.TextDecorationBuilder=jt;exports.TextDirection=Pn;exports.TextDirectionType=Su;exports.TextStyleBuilder=Wt;exports.TextStyleValue=Vn;exports.TextX=ze;exports.TextXActionType=ce;exports.ThemeColor=as;exports.ThemeColorType=ct;exports.ThemeColors=vs;exports.ThemeService=Eo;exports.Tools=re;exports.UndoCommand=gn;exports.UndoCommandId=Wc;exports.UnitModel=Ss;exports.Univer=th;exports.UniverInstanceType=$e;exports.UpdateDocsAttributeType=Pe;exports.UserManagerService=$n;exports.VerticalAlign=tn;exports.VerticalAlignmentType=Fu;exports.WithDependency=sp;exports.WithNew=Al;exports.Worksheet=gr;exports.WrapStrategy=_n;exports.WrapTextType=bu;exports.addLinkToDocumentModel=bc;exports.afterInitApply=Ap;exports.afterTime=wp;exports.awaitTime=YR;exports.binSearchFirstGreaterThanTarget=Gl;exports.binarySearchArray=Tp;exports.bufferDebounceTime=bp;exports.cellToRange=Sm;exports.characterSpacingControlType=Wu;exports.checkForSubstrings=Om;exports.checkIfMove=Dp;exports.checkParagraphHasBullet=a_;exports.checkParagraphHasIndent=l_;exports.checkParagraphHasIndentByStyle=cu;exports.codeToBlob=Mp;exports.composeBody=pi;exports.composeInterceptors=Sc;exports.composeStyles=si;exports.concatMatrixArray=R_;exports.connectDependencies=tp;exports.connectInjector=ep;exports.convertBodyToHtml=Gp;exports.convertCellToRange=au;exports.covertTextRunToHtml=ii;exports.createAsyncInterceptorKey=lC;exports.createDefaultUser=cs;exports.createDocumentModelWithStyle=tr;exports.createIdentifier=_t;exports.createInterceptorKey=oC;exports.createInternalEditorID=Sg;exports.createRowColIter=ci;exports.dayjs=Kt;exports.debounce=ag;exports.dedupe=mg;exports.deepCompare=io;exports.delayAnimationFrame=VR;exports.deleteContent=du;exports.extractPureTextFromCell=Fc;exports.forwardRef=Fg;exports.fromCallback=zl;exports.fromEventSubject=HR;exports.fromObservable=mp;exports.generateRandomId=zt;exports.get=kf;exports.getArrayLength=rn;exports.getBodySlice=Tt;exports.getBodySliceHtml=Wr;exports.getBorderStyleType=Im;exports.getCellInfoInMergeData=gm;exports.getCellValueType=cm;exports.getColorStyle=Mt;exports.getCustomBlockSlice=fc;exports.getCustomDecorationSlice=pc;exports.getCustomRangeSlice=gc;exports.getDocsUpdateBody=vm;exports.getIntersectRange=L_;exports.getOriginCellValue=TC;exports.getParagraphsSlice=dc;exports.getReverseDirection=xp;exports.getSectionBreakSlice=mE;exports.getTableSlice=hc;exports.getTextRunSlice=us;exports.getWorksheetUID=LC;exports.groupBy=Cg;exports.handleStyleToString=Rm;exports.hashAlgorithm=h_;exports.horizontalLineSegmentsSubtraction=ys;exports.insertMatrixArray=ai;exports.insertTextToContent=hu;exports.isAsyncDependencyItem=Js;exports.isAsyncHook=jr;exports.isBlackColor=am;exports.isBooleanString=Ig;exports.isCellCoverable=_m;exports.isCellV=dm;exports.isClassDependencyItem=Ks;exports.isCtor=ki;exports.isDisposable=ei;exports.isEmptyCell=lu;exports.isFactoryDependencyItem=Xs;exports.isFormulaId=Cm;exports.isFormulaString=Em;exports.isICellData=um;exports.isInternalEditorID=El;exports.isNodeEnv=Vp;exports.isNotNullOrUndefined=wc;exports.isNullCell=hm;exports.isNumeric=nh;exports.isRangesEqual=gC;exports.isRealNum=c_;exports.isSafeNumeric=PR;exports.isSameStyleTextRun=uu;exports.isUnitRangesEqual=pC;exports.isValidRange=ym;exports.isValueDependencyItem=Qs;exports.isWhiteColor=lm;exports.makeArray=Rg;exports.makeCellRangeToRangeData=mm;exports.makeCellToSelection=pm;exports.makeCustomRangeStream=JE;exports.merge=xi;exports.mergeOverrideWithDependencies=Jc;exports.mergeSets=kR;exports.mergeWith=hg;exports.mergeWorksheetSnapshotWithDefault=Uc;exports.mixinClass=hC;exports.moveMatrixArray=ui;exports.moveRangeByOffset=T_;exports.nameCharacterCheck=zR;exports.normalizeBody=_E;exports.normalizeTextRuns=yr;exports.numberToABC=W_;exports.numberToListABC=z_;exports.numfmt=fu;exports.queryObjectMatrix=$_;exports.registerDependencies=fp;exports.remove=mr;exports.repeatStringNumTimes=_u;exports.replaceInDocumentBody=$R;exports.requestImmediateMacroTask=FR;exports.rotate=Eg;exports.searchArray=Np;exports.searchInOrderedArray=Vl;exports.selectionToArray=fm;exports.sequence=kl;exports.sequenceAsync=Fl;exports.sequenceExecute=zi;exports.sequenceExecuteAsync=Op;exports.set=fg;exports.setDependencies=Pg;exports.shallowEqual=Ul;exports.skipParseTagNames=KR;exports.sliceMatrixArray=I_;exports.sortRules=Y_;exports.sortRulesByDesc=V_;exports.sortRulesFactory=Ir;exports.spliceArray=li;exports.splitIntoGrid=oo;exports.takeAfter=Yl;exports.textDiff=Li;exports.throttle=iC;exports.toDisposable=Qe;exports.touchDependencies=Ll;exports.updateAttributeByDelete=mc;exports.updateAttributeByInsert=_c;exports.useDependency=ap;exports.useDependencyContext=hp;exports.useDependencyContextValue=dp;exports.useDependencyValue=xl;exports.useInjector=Dl;exports.useObservable=up;exports.useUpdateBinder=cp;
6
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function na(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ul=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Zo(o),l=a.next();!l.done;l=a.next()){var u=l.value;u.remove(this)}}catch(R){t={error:R}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(cr(c))try{c()}catch(R){i=R instanceof Ds?R.errors:[R]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var d=Zo(h),f=d.next();!f.done;f=d.next()){var C=f.value;try{ra(C)}catch(R){i=i!=null?i:[],R instanceof Ds?i=ta(ta([],ea(i)),ea(R.errors)):i.push(R)}}}catch(R){r={error:R}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new Ds(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ra(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&na(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&na(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();Ul.EMPTY;function Jg(e){return e instanceof Ul||e&&"closed"in e&&cr(e.remove)&&cr(e.add)&&cr(e.unsubscribe)}function ra(e){cr(e)?e():e.unsubscribe()}function We(e){let t=!1;return e?Jg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:We(()=>{})}function qg(e){return We(()=>{e.unsubscribe()})}class Is{constructor(){E(this,"_disposables",new Set)}add(t){const n=We(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class Ze{constructor(){E(this,"_disposed",!1);E(this,"_collection",new Is)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class Zg extends Ze{constructor(){super(...arguments);E(this,"dispose$",new we.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class ep extends Ze{constructor(n){super();E(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const Wn=mt("univer.context-service");class Pl extends Ze{constructor(){super(...arguments);E(this,"_contextChanged$",new we.Subject);E(this,"contextChanged$",this._contextChanged$.asObservable());E(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new we.Observable(r=>{const s=this._contextChanged$.pipe(we.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var kl=(e=>(e[e.SILENT=0]="SILENT",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE",e))(kl||{});const At=mt("univer.log");class Fl extends Ze{constructor(){super(...arguments);E(this,"_logLevel",3);E(this,"_deduction",new Set)}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}deprecate(...n){this._logLevel>=2&&this._logWithDeduplication(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}_logWithDeduplication(n,...r){const s=tp(...r);this._deduction.has(s)||(this._deduction.add(s),this._log(n,...r))}}function tp(...e){return e.map(t=>JSON.stringify(t)).join("")}var np=Object.defineProperty,rp=Object.getOwnPropertyDescriptor,sp=(e,t,n,r)=>{for(var s=r>1?void 0:r?rp(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&np(t,n,s),s},sa=(e,t)=>(n,r)=>t(n,r,e),Yn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(Yn||{});const yt=mt("anywhere.command-service");class ip{constructor(){E(this,"_commands",new Map);E(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),We(()=>{this._commands.delete(t.id),this._commandTypes.delete(t.id)})}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const $l={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends Ze{constructor(n,r){super();E(this,"_commandRegistry");E(this,"_beforeCommandExecutionListeners",[]);E(this,"_commandExecutedListeners",[]);E(this,"_multiCommandDisposables",new Map);E(this,"_commandExecutingLevel",0);E(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new ip,this._registerCommand($l)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._registerCommand(n)}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),We(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),We(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(c=>c(a,s));const u=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(c=>c(a,s)),l.dispose(),u}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof ri)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const h=mg(this._commandExecutionStack,d=>d.type===0);h&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=h.id)}const u=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(h=>h(l,s));const c=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(h=>h(l,s)),u.dispose(),c}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof ri)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),We(()=>_r(this._commandExecutionStack,n))}_registerCommand(n){return this._commandRegistry.registerCommand(n)}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{const o=new Is;s=new op(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(We(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return We(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=sp([sa(0,rt(Ct)),sa(1,At)],exports.CommandService);class op{constructor(t){E(this,"name");E(this,"multi",!0);E(this,"type",0);E(this,"priority",0);E(this,"_implementations",[]);E(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(At),s=t.get(Wn),i=t.get(Ct);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),We(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function Yi(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Ll(r)}function ap(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return xl(r)}function Hl(e){return new we.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Bl(e){return function(n){return new we.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function lp(e=0){return t=>{let n=[];return t.pipe(we.tap(r=>n.push(r)),we.debounceTime(e),we.map(()=>n),we.tap(()=>n=[]))}}function up(e){const t=new we.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(we.take(1))}const cp=e=>new Promise(t=>{we.merge(Hl(e.onCommandExecuted.bind(e)).pipe(Hr.filter(([n])=>n.type===Yn.MUTATION)),we.timer(300)).pipe(Hr.debounceTime(16),Hr.first()).subscribe(()=>{t()})});function jl(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function hp(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function Wl(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function er(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=jl(e,t):r=Wl(e,t),n){const s=e[r];return e.indexOf(s)}return r}function dp(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const tr=2,Yl=1;function fp(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:u=0,width:c=0,angle:h=0}=e,d=c,f=u,C=i,R=s;return Math.abs(a-n)>tr||Math.abs(l-r)>tr||Math.abs(d-C)>tr||Math.abs(f-R)>tr||Math.abs(h-o)>Yl}var zi=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(zi||{}),Qe=(e=>(e[e.NONE=0]="NONE",e[e.THIN=1]="THIN",e[e.HAIR=2]="HAIR",e[e.DOTTED=3]="DOTTED",e[e.DASHED=4]="DASHED",e[e.DASH_DOT=5]="DASH_DOT",e[e.DASH_DOT_DOT=6]="DASH_DOT_DOT",e[e.DOUBLE=7]="DOUBLE",e[e.MEDIUM=8]="MEDIUM",e[e.MEDIUM_DASHED=9]="MEDIUM_DASHED",e[e.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",e[e.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",e[e.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",e[e.THICK=13]="THICK",e))(Qe||{}),Vi=(e=>(e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e.ALL="all",e.OUTSIDE="outside",e.INSIDE="inside",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.TLBR="tlbr",e.TLBC_TLMR="tlbc_tlmr",e.TLBR_TLBC_TLMR="tlbr_tlbc_tlmr",e.BLTR="bl_tr",e.MLTR_BCTR="mltr_bctr",e))(Vi||{}),_t=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(_t||{}),Gi=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Gi||{}),Ki=(e=>(e[e.PASTE_NORMAL=0]="PASTE_NORMAL",e[e.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",e[e.PASTE_FORMAT=2]="PASTE_FORMAT",e[e.PASTE_FORMULA=3]="PASTE_FORMULA",e[e.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",e[e.PASTE_VALUES=5]="PASTE_VALUES",e[e.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",e[e.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",e))(Ki||{}),Xi=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Xi||{}),Qi=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Qi||{}),Ji=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Ji||{}),qi=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(qi||{});function gp(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Zi=(e=>(e[e.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",e[e.MIN=1]="MIN",e[e.MAX=2]="MAX",e[e.NUMBER=3]="NUMBER",e[e.PERCENT=4]="PERCENT",e[e.PERCENTILE=5]="PERCENTILE",e))(Zi||{}),zn=(e=>(e.EN_US="enUS",e.FR_FR="frFR",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(zn||{}),fr=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(fr||{}),eo=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(eo||{}),zl=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(zl||{}),Vl=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(Vl||{}),Gl=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(Gl||{}),Kl=(e=>(e.SmileyFace="smileyFace",e.Heart="heart",e.LightningBolt="lightningBolt",e.Sun="sun",e.Moon="moon",e.Cloud="cloud",e.Arc="arc",e.Backpack="backpack",e.Frame="frame",e.HalfFrame="halfFrame",e.Corner="corner",e.Chord="chord",e.Pie="pie",e.Teardrop="teardrop",e.WedgeRectCallout="wedgeRectCallout",e.WedgeRRectCallout="wedgeRRectCallout",e.WedgeEllipseCallout="wedgeEllipseCallout",e.CloudCallout="cloudCallout",e.BorderCallout1="borderCallout1",e.BorderCallout2="borderCallout2",e.BorderCallout3="borderCallout3",e.AccentCallout1="accentCallout1",e.AccentCallout2="accentCallout2",e.AccentCallout3="accentCallout3",e.Callout1="callout1",e.Callout2="callout2",e.Callout3="callout3",e.ActionButtonBackPrevious="actionButtonBackPrevious",e.ActionButtonEnd="actionButtonEnd",e.ActionButtonForwardNext="actionButtonForwardNext",e.ActionButtonHelp="actionButtonHelp",e.ActionButtonHome="actionButtonHome",e.ActionButtonInformation="actionButtonInformation",e.ActionButtonMovie="actionButtonMovie",e.ActionButtonReturn="actionButtonReturn",e.ActionButtonSound="actionButtonSound",e))(Kl||{}),to=(e=>(e[e.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",e[e.PAST_YEAR=1]="PAST_YEAR",e[e.PAST_MONTH=2]="PAST_MONTH",e[e.PAST_WEEK=3]="PAST_WEEK",e[e.YESTERDAY=4]="YESTERDAY",e[e.TODAY=5]="TODAY",e[e.TOMORROW=6]="TOMORROW",e))(to||{}),no=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(no||{}),Pn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",e))(Pn||{}),ro=(e=>(e[e.DASH=0]="DASH",e[e.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",e[e.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",e[e.DASHED_HEAVY=3]="DASHED_HEAVY",e[e.DASH_LONG=4]="DASH_LONG",e[e.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",e[e.DOT_DASH=6]="DOT_DASH",e[e.DOT_DOT_DASH=7]="DOT_DOT_DASH",e[e.DOTTED=8]="DOTTED",e[e.DOTTED_HEAVY=9]="DOTTED_HEAVY",e[e.DOUBLE=10]="DOUBLE",e[e.NONE=11]="NONE",e[e.SINGLE=12]="SINGLE",e[e.THICK=13]="THICK",e[e.WAVE=14]="WAVE",e[e.WAVY_DOUBLE=15]="WAVY_DOUBLE",e[e.WAVY_HEAVY=16]="WAVY_HEAVY",e[e.WORDS=17]="WORDS",e))(ro||{}),vt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT",e[e.JUSTIFIED=4]="JUSTIFIED",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTED=6]="DISTRIBUTED",e))(vt||{}),tn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(tn||{}),mn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(mn||{}),ss=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(ss||{}),is=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(is||{}),Pt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Pt||{}),Ie=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Ie||{}),nn=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(nn||{}),lt=(e=>(e[e.DARK1=0]="DARK1",e[e.LIGHT1=1]="LIGHT1",e[e.DARK2=2]="DARK2",e[e.LIGHT2=3]="LIGHT2",e[e.ACCENT1=4]="ACCENT1",e[e.ACCENT2=5]="ACCENT2",e[e.ACCENT3=6]="ACCENT3",e[e.ACCENT4=7]="ACCENT4",e[e.ACCENT5=8]="ACCENT5",e[e.ACCENT6=9]="ACCENT6",e[e.HYPERLINK=10]="HYPERLINK",e[e.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",e))(lt||{}),ys=(e=>(e.OFFICE="Office",e.OFFICE_2007_2010="Office 2007-2010",e.GRAYSCALE="Grayscale",e.BLUE_WARM="Blue Warm",e.BLUE="Blue",e.BLUE_II="Blue II",e.BLUE_GREEN="Blue Green",e.GREEN="Green",e.GREEN_YELLOW="Green Yellow",e.YELLOW="Yellow",e.YELLOW_ORANGE="Yellow Orange",e.ORANGE="Orange",e.ORANGE_RED="Orange Red",e.RED_ORANGE="Red Orange",e.RED="Red",e.RED_VIOLET="Red Violet",e.VIOLET="Violet",e.VIOLET_II="Violet II",e.MEDIAN="Median",e.PAPER="Paper",e.MARQUEE="Marquee",e.SLIPSTREAM="Slipstream",e.Aspect="Aspect",e))(ys||{});const pp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let mp=e=>crypto.getRandomValues(new Uint8Array(e)),_p=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s|0;for(;l--;)if(o+=e[a[l]&r]||"",o.length>=i)return o}}},Ep=(e,t=21)=>_p(e,t|0,mp),Cp=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=pp[n[e]&63];return t};const Xl=new Set(["ac","ad","ae","aero","af","ag","ai","al","am","ao","aq","ar","arpa","as","asia","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","biz","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cat","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","com","coop","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","edu","ee","eg","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gov","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","info","int","io","iq","ir","is","it","je","jm","jo","jobs","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mil","mk","ml","mm","mn","mo","mobi","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","name","nc","ne","net","nf","ng","ni","nl","no","np","nr","nu","nz","om","onion","org","pa","pe","pf","pg","ph","pk","pl","pm","pn","post","pr","pro","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tel","tf","tg","th","tj","tk","tl","tm","tn","to","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","yt","za","zm","zw"]),Rp=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");function Ip(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Rp.test(e)){if(Ql(e))return!0;try{const r=new URL(Jl(e)).hostname.split(".").pop();if(r&&Xl.has(r))return!0}catch{return!1}}return!1}function Ql(e){return/^[a-zA-Z]+:\/\//.test(e)}function yp(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Jl(e){return Ql(e)?e:yp(e)?`mailto://${e}`:`https://${e}`}const vp=/^-ms-/,Sp=/-([a-z])/g,Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function so(e,t){const n=ne.getValueType(e),r=ne.getValueType(t);return n!==r?!1:ne.isArray(e)?wp(e,t):ne.isObject(e)?Op(e,t):ne.isDate(e)?e.getTime()===t.getTime():ne.isRegExp(e)?e.toString()===t.toString():e===t}function wp(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!so(s,i))return!1}return!0}function Op(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!so(i,o))return!1}return!0}class ne{static stringAt(t){let n="",r=t;for(;r>=Jt.length;)r/=Jt.length,r-=1,n+=Jt[r%Jt.length];const s=t%Jt.length;return n+=Jt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=Jt.length**i+Jt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return ne.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const c=Number.parseFloat(RegExp.$1);return c===7?"IE7":c===8?"IE8":c===9?"IE9":c===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(t=21,n){return Yt(t,n)}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,u)=>{var c,h;if(ne.isArray(l)){const d=(c=a[u])!=null?c:[];a[u]=d,r(l,d);return}if(ne.isObject(l)){const d=(h=a[u])!=null?h:{};a[u]=d,s(l,d);return}a[u]=l})}function s(o,a){Object.keys(o).forEach(l=>{var c,h;const u=o[l];if(ne.isObject(u)){const d=(c=a[l])!=null?c:{};a[l]=d,s(u,d);return}if(ne.isArray(u)){const d=(h=a[l])!=null?h:[];a[l]=d,r(u,d);return}a[l]=u})}function i(o){Object.keys(o).forEach(a=>{var u,c;const l=o[a];if(ne.isArray(l)){const h=(u=t[a])!=null?u:[];t[a]=h,r(l,h);return}if(ne.isObject(l)){const h=(c=t[a])!=null?c:{};t[a]=h,s(l,h);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return so(t,n)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){const n=[];return t.forEach((r,s)=>{n[s]=ne.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=ne.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isBoolean(t){return this.getValueType(t)==="[object Boolean]"}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isFunction(t){return this.getValueType(t)==="[object Function]"}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isMobile(){let t=0,n=0;return document.body.clientWidth&&(t=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||t<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const t=navigator.userAgent.toLowerCase();return String(t.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const t=navigator.userAgent;return t.indexOf("Android")>-1||t.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return Ip(t)}static normalizeUrl(t){return Jl(t)}static topLevelDomainCombiningString(){return[...Xl].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return ne.isDefine(t)?ne.isDefine(n)?t.length===n:t.length>0:!1}static capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}static fCamelCase(t,n){return n.toUpperCase()}static camelCase(t){return t.replace(vp,"ms-").replace(Sp,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:ne.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static randSort(t){for(let n=0,r=t.length;n<r;n++){const s=Number.parseInt((Math.random()*r).toString()),i=t[s];t[s]=t[n],t[n]=i}return t}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static commonExtend1(t,n){for(const r in t)n[r]==null&&(n[r]=t[r]);return n}static arrayToObject(t){const n={};return t.forEach((r,s)=>{n[s]={},r.forEach((i,o)=>{n[s][o]=i})}),n}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-z_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function Yt(e=21,t){return t?Ep(t,e)():Cp(e)}function si(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const bp=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Yr(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:u}=a;ne.hasIntersectionBetweenTwoRanges(t,n,l,u)&&(l>i?(o.push(r.slice(i,l)),o.push(ii(r,{...a,ed:Math.min(u,n)}))):o.push(ii(r,{...a,st:i,ed:Math.min(u,n)}))),i=Math.max(t,Math.min(u,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function Ap(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:u={}}=a,{spaceAbove:c,spaceBelow:h,lineSpacing:d}=u,f=[];c!=null&&(typeof c=="number"?f.push(`margin-top: ${c}px`):f.push(`margin-top: ${c.v}px`)),h!=null&&(typeof h=="number"?f.push(`margin-bottom: ${h}px`):f.push(`margin-bottom: ${h.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Yr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Yr(e,o,r.length)),i}else return Yr(e,0,e.dataStream.length)}function ii(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:u,st:c,ol:h,bg:d,cl:f,va:C}=s;let R=e.slice(n,r);const v=[];return a===Ie.TRUE&&(R=`<i>${R}</i>`),C===Pt.SUPERSCRIPT?R=`<sup>${R}</sup>`:C===Pt.SUBSCRIPT&&(R=`<sub>${R}</sub>`),(u==null?void 0:u.s)===Ie.TRUE&&(R=`<u>${R}</u>`),(c==null?void 0:c.s)===Ie.TRUE&&(R=`<s>${R}</s>`),l===Ie.TRUE&&(R=`<strong>${R}</strong>`),i&&v.push(`font-family: ${i}`),f&&v.push(`color: ${f.rgb}`),o&&v.push(`font-size: ${o}pt`),h&&v.push("text-decoration: overline"),d&&v.push(`background: ${d.rgb}`),v.length?`<span style="${v.join("; ")};">${R}</span>`:R}const ql={[ys.OFFICE]:{[lt.ACCENT1]:"#4472C4",[lt.ACCENT2]:"#ED7D31",[lt.ACCENT3]:"#A5A5A5",[lt.ACCENT4]:"#70AD47",[lt.ACCENT5]:"#5B9BD5",[lt.ACCENT6]:"#70AD47",[lt.DARK1]:"#000000",[lt.DARK2]:"#44546A",[lt.LIGHT1]:"#FFFFFF",[lt.LIGHT2]:"#E7E6E6",[lt.HYPERLINK]:"#0563C1",[lt.FOLLOWED_HYPERLINK]:"#954F72"}};class Cr{constructor(){E(this,"_themeValue",lt.LIGHT1);E(this,"_themeColors");E(this,"_themeTint");E(this,"_rgbValue","");E(this,"_colorType");this._colorType=_t.UNSUPPORTED,this._themeColors=ys.OFFICE,this._themeTint=0}asRgbColor(){return new os(this._rgbValue,this)}asThemeColor(){return new as(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case _t.THEME:return this.asThemeColor();case _t.RGB:return this.asRgbColor();case _t.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=_t.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=_t.THEME,this._themeColors=t}setThemeTint(t){this._colorType=_t.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=_t.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class _n{constructor(t){E(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new Cr().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new _n(this._builder)}equals(t){return!1}}class Zl{constructor(t){E(this,"_saturation",0);E(this,"_hue",0);E(this,"_lightness",0);E(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new Cr;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,u=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(u*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const It=class It extends _n{constructor(n,r){super(r);E(this,"_cssString");E(this,"_red");E(this,"_green");E(this,"_blue");E(this,"_alpha");let s=n.match(It.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(It.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return _n.rgbColorToHexValue(this)}getRed(){let n=this._red+It.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+It.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+It.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return _t.RGB}clone(){return new It(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof It?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};E(It,"RGB_COLOR_AMT",0),E(It,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),E(It,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let os=It;const Zt=class Zt extends _n{constructor(n,r,s,i){super(i);E(this,"_themeColorType");E(this,"_themeTint");E(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=ql[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Zt._cacheThemeColor.has(this._themeColors)){if(s=Zt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Zt._cacheThemeColor.set(this._themeColors,s);const i=new Zl(_n.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new Zt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof Zt?n._themeColorType===this._themeColorType:!1}getColorType(){return _t.THEME}getThemeColorType(){return this._themeColorType}};E(Zt,"_cacheThemeColor",new Map);let as=Zt;const Tp="rgb(",Np="rgba(",oi={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class bt{constructor(t){E(this,"_color");E(this,"_rgbColor");E(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof bt){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=eu(t);if(n==null){this._setNullColor();return}this._color=n;const r=Up(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var u,c;r=Math.min(1,Math.max(0,r));const s=new bt(t).toRgb(),i=new bt(n).toRgb(),o=(u=s.a)!=null?u:1,a=(c=i.a)!=null?c:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new bt(l)}static getContrastRatio(t,n){const r=new bt(t).getLuminance(),s=new bt(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[br(Math.round(n).toString(16)),br(Math.round(r).toString(16)),br(Math.round(s).toString(16)),br(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return $p(this.toRgb())}toHsl(){return Fp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}setAlpha(t){return new bt({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=xs(t),n=xs(n),r=xs(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const br=e=>e.length===1?`0${e}`:e,xs=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),eu=e=>{if(Bp(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim();if(oi[t]){const n=oi[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return Mp(t);if(t.startsWith("rgb"))return Dp(t);if(t.startsWith("hsl"))return xp(t);if(t.startsWith("hsv"))return Lp(t)},Mp=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},Dp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},xp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Lp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Up=e=>{const t=eu(e);if(t!=null)return"r"in t?t:"l"in t?Pp(t):kp(t)},Ls=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Pp=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;s=Ls(u,l,t+1/3),i=Ls(u,l,t),o=Ls(u,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},kp=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),u=s%6,c=[r,a,o,o,l,r][u],h=[l,r,r,a,o,o][u],d=[o,o,l,r,r,a][u],f={r:c*255,g:h*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},Fp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const c=s-i;switch(l=o>.5?c/(2-s-i):c/(s+i),s){case t:a=(n-r)/c+(n<r?6:0);break;case n:a=(r-t)/c+2;break;default:a=(t-n)/c+4;break}a/=6}const u={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(u.a=e.a),u},$p=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,u=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const c={h:Math.round(o*360),s:Math.round(u*100),v:Math.round(a*100)};return e.a!==void 0&&(c.a=e.a),c},Hp=e=>e==null,Bp=e=>!Hp(e)&&typeof e=="object";function jp(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function Wp(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}var Pe=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Pe||{});function Yp(e){return e&&(e.s!==void 0||e.p!==void 0||e.v!==void 0||e.t!==void 0||e.f!==void 0||e.si!==void 0||e.custom!==void 0)}function zp(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return nn.STRING;if(typeof e.v=="number")return nn.NUMBER;if(typeof e.v=="boolean")return nn.BOOLEAN}function Vp(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,custom:i}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||i!=null)}function Gp(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var xe=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(xe||{}),nt=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(nt||{});function Kp(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var tu=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(tu||{}),nu=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(nu||{});function Xp(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let u=0;u<n.length;u++){const{startRow:c,endRow:h,startColumn:d,endColumn:f}=n[u];if(e===c&&t===d){i=h,o=f,a=c,l=d,s=!0;break}if(e>=c&&e<=h&&t>=d&&t<=f){i=h,o=f,a=c,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var On=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(On||{});function ru(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:u}=e,c=t,h=n,d=t,f=n;if(r&&i){const{startRow:C,startColumn:R,endRow:v,endColumn:M,startY:Q,endY:z,startX:de,endX:N}=i;c=C,h=R,d=v,f=M,o=Q,a=z,l=de,u=N}return s&&(o=i.startY,a=i.endY,l=i.startX,u=i.endX,d=i.endRow,f=i.endColumn),{startRow:c,startColumn:h,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:u}}const Qp=ru;function Jp(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let u=t,c=n,h=t,d=n;return(r||s)&&(u=i,c=o,h=a,d=l),{startRow:u,startColumn:c,endRow:h,endColumn:d}}function su(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function ai(e){return su(e)&&(e==null?void 0:e.coverable)!==!1}function xt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Cr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function qp(e){return ne.isString(e)&&e.substring(0,1)==="="&&e.length>1}function Zp(e){return ne.isString(e)&&e.length>0}function em(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${xt(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${xt(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${xt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${xt(e.bg)}; `)}],["bd",()=>{var o,a,l,u,c,h,d,f,C,R,v,M;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Ar((a=e.bd)==null?void 0:a.b.s)} ${(l=xt(e.bd.b.cl))!=null?l:""}; `),(u=e.bd)!=null&&u.t&&(n+=`border-top: ${Ar((c=e.bd)==null?void 0:c.t.s)} ${(h=xt(e.bd.t.cl))!=null?h:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Ar((f=e.bd)==null?void 0:f.r.s)} ${(C=xt(e.bd.r.cl))!=null?C:""}; `),(R=e.bd)!=null&&R.l&&(n+=`border-left: ${Ar((v=e.bd)==null?void 0:v.l.s)} ${(M=xt(e.bd.l.cl))!=null?M:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${xt(e.cl)}; `)}],["va",()=>{e.va===Pt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===Pt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Pn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Pn.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===vt.LEFT?n+="text-align: left; ":e.ht===vt.RIGHT?n+="text-align: right; ":e.ht===vt.CENTER?n+="text-align: center; ":e.ht===vt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===tn.BOTTOM?n+="vertical-align: bottom; ":e.vt===tn.TOP?n+="vertical-align: top; ":e.vt===tn.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===mn.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===mn.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var c,h,d,f,C,R,v,M;const o=`${(c=e.pd)==null?void 0:c.b}pt`,a=`${(h=e.pd)==null?void 0:h.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,u=`${(f=e.pd)==null?void 0:f.r}pt`;(C=e.pd)!=null&&C.b&&(n+=`padding-bottom: ${o}; `),(R=e.pd)!=null&&R.t&&(n+=`padding-top: ${a}; `),(v=e.pd)!=null&&v.l&&(n+=`padding-left: ${l}; `),(M=e.pd)!=null&&M.r&&(n+=`padding-right: ${u}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Ar(e){let t="";return e===Qe.NONE?t="none":e===Qe.THIN?t="0.5pt solid":e===Qe.HAIR?t="0.5pt double":e===Qe.DOTTED?t="0.5pt dotted":e===Qe.DASHED||e===Qe.DASH_DOT?t="0.5pt dashed":e===Qe.DASH_DOT_DOT?t="0.5pt dotted":e===Qe.DOUBLE?t="0.5pt double":e===Qe.MEDIUM?t="1pt solid":e===Qe.MEDIUM_DASHED||e===Qe.MEDIUM_DASH_DOT?t="1pt dashed":e===Qe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Qe.SLANT_DASH_DOT?t="0.5pt dashed":e===Qe.THICK&&(t="1.5pt solid"),t}function tm(e){let t=0;if(e=e.trim(),e==="none")t=Qe.NONE;else if(e==="0.5pt solid")t=Qe.THIN;else if(e==="0.5pt double")t=Qe.HAIR;else if(e==="0.5pt dotted")t=Qe.DOTTED;else if(e==="0.5pt dashed")t=Qe.DASHED;else if(e==="1pt solid")t=Qe.MEDIUM;else if(e==="1pt dashed")t=Qe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Qe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Qe.THICK;else if(!e.includes("none"))t=Qe.THIN;else return Qe.NONE;return t}function nm(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function rm(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===xe.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===xe.ROW||o!==xe.ROW&&o!==xe.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function sm(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function io(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>io(e[n],t[n])):e===t:!1}function iu(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:io(n,r)}function im(e,t){return t.some(n=>e.indexOf(n)>-1)}var zr={exports:{}},om=zr.exports,ia;function am(){return ia||(ia=1,function(e,t){(function(n,r){e.exports=r()})(om,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",u="day",c="week",h="month",d="quarter",f="year",C="date",R="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Q={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var O=["th","st","nd","rd"],w=D%100;return"["+D+(O[(w-20)%10]||O[w]||O[0])+"]"}},z=function(D,O,w){var k=String(D);return!k||k.length>=O?D:""+Array(O+1-k.length).join(w)+D},de={s:z,z:function(D){var O=-D.utcOffset(),w=Math.abs(O),k=Math.floor(w/60),$=w%60;return(O<=0?"+":"-")+z(k,2,"0")+":"+z($,2,"0")},m:function D(O,w){if(O.date()<w.date())return-D(w,O);var k=12*(w.year()-O.year())+(w.month()-O.month()),$=O.clone().add(k,h),V=w-$<0,se=O.clone().add(k+(V?-1:1),h);return+(-(k+(w-$)/(V?$-se:se-$))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:h,y:f,w:c,d:u,D:C,h:l,m:a,s:o,ms:i,Q:d}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},N="en",A={};A[N]=Q;var j="$isDayjsObject",q=function(D){return D instanceof B||!(!D||!D[j])},fe=function D(O,w,k){var $;if(!O)return N;if(typeof O=="string"){var V=O.toLowerCase();A[V]&&($=V),w&&(A[V]=w,$=V);var se=O.split("-");if(!$&&se.length>1)return D(se[0])}else{var he=O.name;A[he]=O,$=he}return!k&&$&&(N=$),$||!k&&N},ae=function(D,O){if(q(D))return D.clone();var w=typeof O=="object"?O:{};return w.date=D,w.args=arguments,new B(w)},m=de;m.l=fe,m.i=q,m.w=function(D,O){return ae(D,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var B=function(){function D(w){this.$L=fe(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[j]=!0}var O=D.prototype;return O.parse=function(w){this.$d=function(k){var $=k.date,V=k.utc;if($===null)return new Date(NaN);if(m.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var se=$.match(v);if(se){var he=se[2]-1||0,ge=(se[7]||"0").substring(0,3);return V?new Date(Date.UTC(se[1],he,se[3]||1,se[4]||0,se[5]||0,se[6]||0,ge)):new Date(se[1],he,se[3]||1,se[4]||0,se[5]||0,se[6]||0,ge)}}return new Date($)}(w),this.init()},O.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},O.$utils=function(){return m},O.isValid=function(){return this.$d.toString()!==R},O.isSame=function(w,k){var $=ae(w);return this.startOf(k)<=$&&$<=this.endOf(k)},O.isAfter=function(w,k){return ae(w)<this.startOf(k)},O.isBefore=function(w,k){return this.endOf(k)<ae(w)},O.$g=function(w,k,$){return m.u(w)?this[k]:this.set($,w)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(w,k){var $=this,V=!!m.u(k)||k,se=m.p(w),he=function(Y,W){var le=m.w($.$u?Date.UTC($.$y,W,Y):new Date($.$y,W,Y),$);return V?le:le.endOf(u)},ge=function(Y,W){return m.w($.toDate()[Y].apply($.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(W)),$)},Te=this.$W,be=this.$M,y=this.$D,F="set"+(this.$u?"UTC":"");switch(se){case f:return V?he(1,0):he(31,11);case h:return V?he(1,be):he(0,be+1);case c:var G=this.$locale().weekStart||0,X=(Te<G?Te+7:Te)-G;return he(V?y-X:y+(6-X),be);case u:case C:return ge(F+"Hours",0);case l:return ge(F+"Minutes",1);case a:return ge(F+"Seconds",2);case o:return ge(F+"Milliseconds",3);default:return this.clone()}},O.endOf=function(w){return this.startOf(w,!1)},O.$set=function(w,k){var $,V=m.p(w),se="set"+(this.$u?"UTC":""),he=($={},$[u]=se+"Date",$[C]=se+"Date",$[h]=se+"Month",$[f]=se+"FullYear",$[l]=se+"Hours",$[a]=se+"Minutes",$[o]=se+"Seconds",$[i]=se+"Milliseconds",$)[V],ge=V===u?this.$D+(k-this.$W):k;if(V===h||V===f){var Te=this.clone().set(C,1);Te.$d[he](ge),Te.init(),this.$d=Te.set(C,Math.min(this.$D,Te.daysInMonth())).$d}else he&&this.$d[he](ge);return this.init(),this},O.set=function(w,k){return this.clone().$set(w,k)},O.get=function(w){return this[m.p(w)]()},O.add=function(w,k){var $,V=this;w=Number(w);var se=m.p(k),he=function(be){var y=ae(V);return m.w(y.date(y.date()+Math.round(be*w)),V)};if(se===h)return this.set(h,this.$M+w);if(se===f)return this.set(f,this.$y+w);if(se===u)return he(1);if(se===c)return he(7);var ge=($={},$[a]=r,$[l]=s,$[o]=n,$)[se]||1,Te=this.$d.getTime()+w*ge;return m.w(Te,this)},O.subtract=function(w,k){return this.add(-1*w,k)},O.format=function(w){var k=this,$=this.$locale();if(!this.isValid())return $.invalidDate||R;var V=w||"YYYY-MM-DDTHH:mm:ssZ",se=m.z(this),he=this.$H,ge=this.$m,Te=this.$M,be=$.weekdays,y=$.months,F=$.meridiem,G=function(W,le,oe,H){return W&&(W[le]||W(k,V))||oe[le].slice(0,H)},X=function(W){return m.s(he%12||12,W,"0")},Y=F||function(W,le,oe){var H=W<12?"AM":"PM";return oe?H.toLowerCase():H};return V.replace(M,function(W,le){return le||function(oe){switch(oe){case"YY":return String(k.$y).slice(-2);case"YYYY":return m.s(k.$y,4,"0");case"M":return Te+1;case"MM":return m.s(Te+1,2,"0");case"MMM":return G($.monthsShort,Te,y,3);case"MMMM":return G(y,Te);case"D":return k.$D;case"DD":return m.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return G($.weekdaysMin,k.$W,be,2);case"ddd":return G($.weekdaysShort,k.$W,be,3);case"dddd":return be[k.$W];case"H":return String(he);case"HH":return m.s(he,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return Y(he,ge,!0);case"A":return Y(he,ge,!1);case"m":return String(ge);case"mm":return m.s(ge,2,"0");case"s":return String(k.$s);case"ss":return m.s(k.$s,2,"0");case"SSS":return m.s(k.$ms,3,"0");case"Z":return se}return null}(W)||se.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(w,k,$){var V,se=this,he=m.p(k),ge=ae(w),Te=(ge.utcOffset()-this.utcOffset())*r,be=this-ge,y=function(){return m.m(se,ge)};switch(he){case f:V=y()/12;break;case h:V=y();break;case d:V=y()/3;break;case c:V=(be-Te)/6048e5;break;case u:V=(be-Te)/864e5;break;case l:V=be/s;break;case a:V=be/r;break;case o:V=be/n;break;default:V=be}return $?V:m.a(V)},O.daysInMonth=function(){return this.endOf(h).$D},O.$locale=function(){return A[this.$L]},O.locale=function(w,k){if(!w)return this.$L;var $=this.clone(),V=fe(w,k,!0);return V&&($.$L=V),$},O.clone=function(){return m.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},D}(),S=B.prototype;return ae.prototype=S,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",u],["$M",h],["$y",f],["$D",C]].forEach(function(D){S[D[1]]=function(O){return this.$g(O,D[0],D[1])}}),ae.extend=function(D,O){return D.$i||(D(O,B,ae),D.$i=!0),ae},ae.locale=fe,ae.isDayjs=q,ae.unix=function(D){return ae(1e3*D)},ae.en=A[N],ae.Ls=A,ae.p={},ae})}(zr)),zr.exports}var lm=am();const Kt=wt(lm);var Vr={exports:{}},um=Vr.exports,oa;function cm(){return oa||(oa=1,function(e,t){(function(n,r){e.exports=r()})(um,function(){return function(n,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var u=this.$utils(),c=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(h){switch(h){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),h==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),h==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return h}});return i.bind(this)(c)}}})}(Vr)),Vr.exports}var hm=cm();const dm=wt(hm);var Gr={exports:{}},fm=Gr.exports,aa;function gm(){return aa||(aa=1,function(e,t){(function(n,r){e.exports=r()})(fm,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(v){return(v=+v)+(v>68?1900:2e3)},c=function(v){return function(M){this[v]=+M}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(M){if(!M||M==="Z")return 0;var Q=M.match(/([+-]|\d\d)/g),z=60*Q[1]+(+Q[2]||0);return z===0?0:Q[0]==="+"?-z:z}(v)}],d=function(v){var M=l[v];return M&&(M.indexOf?M:M.s.concat(M.f))},f=function(v,M){var Q,z=l.meridiem;if(z){for(var de=1;de<=24;de+=1)if(v.indexOf(z(de,0,M))>-1){Q=de>12;break}}else Q=v===(M?"pm":"PM");return Q},C={A:[a,function(v){this.afternoon=f(v,!1)}],a:[a,function(v){this.afternoon=f(v,!0)}],Q:[s,function(v){this.month=3*(v-1)+1}],S:[s,function(v){this.milliseconds=100*+v}],SS:[i,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[i,c("day")],Do:[a,function(v){var M=l.ordinal,Q=v.match(/\d+/);if(this.day=Q[0],M)for(var z=1;z<=31;z+=1)M(z).replace(/\[|\]/g,"")===v&&(this.day=z)}],w:[o,c("week")],ww:[i,c("week")],M:[o,c("month")],MM:[i,c("month")],MMM:[a,function(v){var M=d("months"),Q=(d("monthsShort")||M.map(function(z){return z.slice(0,3)})).indexOf(v)+1;if(Q<1)throw new Error;this.month=Q%12||Q}],MMMM:[a,function(v){var M=d("months").indexOf(v)+1;if(M<1)throw new Error;this.month=M%12||M}],Y:[/[+-]?\d+/,c("year")],YY:[i,function(v){this.year=u(v)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function R(v){var M,Q;M=v,Q=l&&l.formats;for(var z=(v=M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(ae,m,B){var S=B&&B.toUpperCase();return m||Q[B]||n[B]||Q[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,O,w){return O||w.slice(1)})})).match(r),de=z.length,N=0;N<de;N+=1){var A=z[N],j=C[A],q=j&&j[0],fe=j&&j[1];z[N]=fe?{regex:q,parser:fe}:A.replace(/^\[|\]$/g,"")}return function(ae){for(var m={},B=0,S=0;B<de;B+=1){var D=z[B];if(typeof D=="string")S+=D.length;else{var O=D.regex,w=D.parser,k=ae.slice(S),$=O.exec(k)[0];w.call(m,$),ae=ae.replace($,"")}}return function(V){var se=V.afternoon;if(se!==void 0){var he=V.hours;se?he<12&&(V.hours+=12):he===12&&(V.hours=0),delete V.afternoon}}(m),m}}return function(v,M,Q){Q.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(u=v.parseTwoDigitYear);var z=M.prototype,de=z.parse;z.parse=function(N){var A=N.date,j=N.utc,q=N.args;this.$u=j;var fe=q[1];if(typeof fe=="string"){var ae=q[2]===!0,m=q[3]===!0,B=ae||m,S=q[2];m&&(S=q[2]),l=this.$locale(),!ae&&S&&(l=Q.Ls[S]),this.$d=function(k,$,V,se){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*k);var he=R($)(k),ge=he.year,Te=he.month,be=he.day,y=he.hours,F=he.minutes,G=he.seconds,X=he.milliseconds,Y=he.zone,W=he.week,le=new Date,oe=be||(ge||Te?1:le.getDate()),H=ge||le.getFullYear(),te=0;ge&&!Te||(te=Te>0?Te-1:le.getMonth());var ie,pe=y||0,Oe=F||0,De=G||0,K=X||0;return Y?new Date(Date.UTC(H,te,oe,pe,Oe,De,K+60*Y.offset*1e3)):V?new Date(Date.UTC(H,te,oe,pe,Oe,De,K)):(ie=new Date(H,te,oe,pe,Oe,De,K),W&&(ie=se(ie).week(W).toDate()),ie)}catch{return new Date("")}}(A,fe,j,Q),this.init(),S&&S!==!0&&(this.$L=this.locale(S).$L),B&&A!=this.format(fe)&&(this.$d=new Date("")),l={}}else if(fe instanceof Array)for(var D=fe.length,O=1;O<=D;O+=1){q[1]=fe[O-1];var w=Q.apply(this,q);if(w.isValid()){this.$d=w.$d,this.$L=w.$L,this.init();break}O===D&&(this.$d=new Date(""))}else de.call(this,N)}}})}(Gr)),Gr.exports}var pm=gm();const mm=wt(pm);var Kr={exports:{}},_m=Kr.exports,la;function Em(){return la||(la=1,function(e,t){(function(n,r){e.exports=r()})(_m,function(){return function(n,r,s){var i=r.prototype,o=function(h){return h&&(h.indexOf?h:h.s)},a=function(h,d,f,C,R){var v=h.name?h:h.$locale(),M=o(v[d]),Q=o(v[f]),z=M||Q.map(function(N){return N.slice(0,C)});if(!R)return z;var de=v.weekStart;return z.map(function(N,A){return z[(A+(de||0))%7]})},l=function(){return s.Ls[s.locale()]},u=function(h,d){return h.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(C,R,v){return R||v.slice(1)})}(h.formats[d.toUpperCase()])},c=function(){var h=this;return{months:function(d){return d?d.format("MMMM"):a(h,"months")},monthsShort:function(d){return d?d.format("MMM"):a(h,"monthsShort","months",3)},firstDayOfWeek:function(){return h.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(h,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(h,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(h,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return u(h.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return c.bind(this)()},s.localeData=function(){var h=l();return{firstDayOfWeek:function(){return h.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return u(h,d)},meridiem:h.meridiem,ordinal:h.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(h){return a(l(),"weekdays",null,null,h)},s.weekdaysShort=function(h){return a(l(),"weekdaysShort","weekdays",3,h)},s.weekdaysMin=function(h){return a(l(),"weekdaysMin","weekdays",2,h)}}})}(Kr)),Kr.exports}var Cm=Em();const Rm=wt(Cm);var Xr={exports:{}},Im=Xr.exports,ua;function ym(){return ua||(ua=1,function(e,t){(function(n,r){e.exports=r()})(Im,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,c=function(h,d){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,C,R){var v=R&&R.toUpperCase();return C||d[R]||n[R]||d[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,Q,z){return Q||z.slice(1)})})}(l,u===void 0?{}:u);return a.call(this,c)}}})}(Xr)),Xr.exports}var vm=ym();const Sm=wt(vm);var Qr={exports:{}},wm=Qr.exports,ca;function Om(){return ca||(ca=1,function(e,t){(function(n,r){e.exports=r()})(wm,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(R){var v={date:R,utc:!0,args:arguments};return new o(v)},l.utc=function(R){var v=a(this.toDate(),{locale:this.$L,utc:!0});return R?v.add(this.utcOffset(),n):v},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(R){R.utc&&(this.$u=!0),this.$utils().u(R.$offset)||(this.$offset=R.$offset),u.call(this,R)};var c=l.init;l.init=function(){if(this.$u){var R=this.$d;this.$y=R.getUTCFullYear(),this.$M=R.getUTCMonth(),this.$D=R.getUTCDate(),this.$W=R.getUTCDay(),this.$H=R.getUTCHours(),this.$m=R.getUTCMinutes(),this.$s=R.getUTCSeconds(),this.$ms=R.getUTCMilliseconds()}else c.call(this)};var h=l.utcOffset;l.utcOffset=function(R,v){var M=this.$utils().u;if(M(R))return this.$u?0:M(this.$offset)?h.call(this):this.$offset;if(typeof R=="string"&&(R=function(N){N===void 0&&(N="");var A=N.match(r);if(!A)return null;var j=(""+A[0]).match(s)||["-",0,0],q=j[0],fe=60*+j[1]+ +j[2];return fe===0?0:q==="+"?fe:-fe}(R),R===null))return this;var Q=Math.abs(R)<=16?60*R:R,z=this;if(v)return z.$offset=Q,z.$u=R===0,z;if(R!==0){var de=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(z=this.local().add(Q+de,n)).$offset=Q,z.$x.$localOffset=de}else z=this.utc();return z};var d=l.format;l.format=function(R){var v=R||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,v)},l.valueOf=function(){var R=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*R},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(R){return R==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var C=l.diff;l.diff=function(R,v,M){if(R&&this.$u===R.$u)return C.call(this,R,v,M);var Q=this.local(),z=a(R).local();return C.call(Q,z,v,M)}}})}(Qr)),Qr.exports}var bm=Om();const Am=wt(bm);var Jr={exports:{}},Tm=Jr.exports,ha;function Nm(){return ha||(ha=1,function(e,t){(function(n,r){e.exports=r()})(Tm,function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}})}(Jr)),Jr.exports}var Mm=Nm();const Dm=wt(Mm);var qr={exports:{}},xm=qr.exports,da;function Lm(){return da||(da=1,function(e,t){(function(n,r){e.exports=r()})(xm,function(){var n="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var c=o(this).startOf(r).add(1,r).date(u),h=o(this).endOf(n);if(c.isBefore(h))return 1}var d=o(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),f=this.diff(d,n,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(qr)),qr.exports}var Um=Lm();const Pm=wt(Um);var Zr={exports:{}},km=Zr.exports,fa;function Fm(){return fa||(fa=1,function(e,t){(function(n,r){e.exports=r()})(km,function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}})}(Zr)),Zr.exports}var $m=Fm();const Hm=wt($m);Kt.extend(mm);Kt.extend(dm);Kt.extend(Dm);Kt.extend(Rm);Kt.extend(Pm);Kt.extend(Hm);Kt.extend(Am);Kt.extend(Sm);function vs(e,t,n,r){if(e>t)throw new Error("a1 should be less than a2");if(n>r)throw new Error("b1 should be less than b2");if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];const s=r-n+1;return e<n&&t>r?[e,t-s]:n<=e&&r<t?[r+1-s,t-s]:n>e&&r>=t?[e,n-1]:[e,t]}function Bm(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function jm(e){if(e==null)return!1;const t=e.paragraphStyle;return ou(t)}function ou(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function au(e,t,n){return e.slice(0,t)+n+e.slice(t)}function lu(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const Wm=/\s/g;function Ym(e){return e===null||e.toString().replace(Wm,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function zm(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}const Xe=Symbol("newer"),st=Symbol("older");class Vm{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Xe],{done:!1,value:t.key}):{done:!0,value:void 0}}}class Gm{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Xe],{done:!1,value:t.value}):{done:!0,value:void 0}}}class Km{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Xe],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}var Va,Ga;Ga=Xe,Va=st;class ga{constructor(t,n){E(this,"key");E(this,"value");E(this,Ga);E(this,Va);this.key=t,this.value=n,this[Xe]=void 0,this[st]=void 0}toJSON(){return{key:this.key,value:this.value}}}class gr{constructor(...t){E(this,"_keymap");E(this,"size",0);E(this,"limit");E(this,"oldest");E(this,"newest");E(this,"_onShiftListeners",[]);if(nr.hasLength(t,1)){if(nr.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(nr.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(nr.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),We(()=>_r(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Xe]&&(t===this.oldest&&(this.oldest=t[Xe]),t[Xe][st]=t[st]),t[st]&&(t[st][Xe]=t[Xe]),t[Xe]=void 0,t[st]=this.newest,this.newest&&(this.newest[Xe]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new ga(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Xe]=o,o[st]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new ga(t,n)),this.newest?(this.newest[Xe]=r,r[st]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Xe]?(this.oldest=this.oldest[Xe],this.oldest[st]=void 0):(this.oldest=void 0,this.newest=void 0),t[Xe]=t[st]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Xe]&&n[st]?(n[st][Xe]=n[Xe],n[Xe][st]=n[st]):n[Xe]?(n[Xe][st]=void 0,this.oldest=n[Xe]):n[st]?(n[st][Xe]=void 0,this.newest=n[st]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new Vm(this.oldest)}values(){return new Gm(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Km(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Xe]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Xe];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Xe],n&&(t+=" < ");return t}}class nr{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}var es={exports:{}},Xm=es.exports,pa;function Qm(){return pa||(pa=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:Xm,function(){return function(){var n={d:function(_,g){for(var p in g)n.o(g,p)&&!n.o(_,p)&&Object.defineProperty(_,p,{enumerable:!0,get:g[p]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};n.d(r,{default:function(){return ht}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function u(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function c(_){const g=u(_);let p=null;if(g){const b=l(g);p=o[b.lang]||o[b.language]||null}return p}function h(_){return Object.assign({},a,_)}function d(_,g){const p=typeof g=="object"?g:l(g);return o[p.lang]=h(_),p.language===p.lang||o[p.language]||(o[p.language]=h(_)),o[p.lang]}const f=h({group:","});function C(_,g){if(typeof _!="number")return _;if(_<0)return-C(-_,g);if(g){const p=10**(g||0)||1;return C(_*p,0)/p}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function R(_,g,p){const b=_<0?-1:1,T=10**(g||2),U=10**(p||2);let L,P,I=Math.abs(_),Z=0,_e=0,J=0,me=1;if((_=I)%1==0)P=[_*b,1];else if(_<1e-19)P=[b,1e19];else if(_>1e19)P=[1e19*b,1];else{do if(I=1/(I-Math.floor(I)),L=me,me=me*Math.floor(I)+Z,Z=L,_e=J,J=Math.floor(_*me+.5),J>=T||me>=U)return[b*_e,Z];while(Math.abs(_-J/me)>=1e-10&&I!==Math.floor(I));P=[b*J,me]}return P}const v={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},M=Object.assign({},v);function Q(_){if(_===null&&(_=v),_){for(const g in _)if(g in v){const p=_[g];M[g]=p==null?v[g]:p}}return{...M}}const z={"#":"",0:"0","?":" "},de={"@":"text","-":"minus","+":"plus"},N=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],A=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],j=new RegExp("["+A.join("")+"]");function q(_,g,p){return g[p+"_max"]=_.length,g[p+"_min"]=_.replace(/#/g,"").length,g}const fe={};function ae(_){if(!(_ in fe)){const g=[],p=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,b=>"?".repeat(b.length));for(let b=0;b<p.length;b++){const T=p.charAt(b);g[b]=T in z?z[T]:T}fe[_]=g.join("")}return fe[_]}function m(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,z["?"])}),g.push(_)}function B(_){const g=[],p={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:g};let b=_+"",T="int",U=!1,L=null;const P=[];let I,Z,_e=!1;for(;b&&!U;){if(I=/^General/i.exec(b))p.general=!0,m({type:"general"},g);else if(T==="int"&&(I=/^[#?0]+(?:,[#?0]+)*/.exec(b))||T==="den"&&(I=/^[#?\d]+/.exec(b))||(I=/^[#?0]+/.exec(b)))p[T+"_pattern"].push(I[0]),L={type:T,num:I[0]},m(L,g);else if((I=/^\//.exec(b))&&p[T+"_pattern"].length){if(!L)throw new SyntaxError("Missing a numerator in pattern ".concat(_));p.fractions=!0,p.num_pattern.push(p[T+"_pattern"].pop()),L.type="num",T="den",m({type:"div"},g)}else if(I=/^,+/.exec(b)){const x=b.charAt(1)in z;Z.slice(-1)in z&&(I[0].length>1||!x)?p.scale=.001**I[0].length:p.dec_fractions||m(I[0],g)}else{if(I=/^;/.exec(b)){U=!0;break}if(I=/^[@+-]/.exec(b))I[0]==="@"&&(p.text=!0),m({type:de[I[0]]},g);else if(I=/^(?:\[(h+|m+|s+)\])/i.exec(b)){const x=I[1].toLowerCase(),ee=x[0],Ce={type:"",size:0,date:1,raw:I[0],pad:x.length};ee==="h"?(Ce.size=16,Ce.type="hour-elap"):ee==="m"?(Ce.size=32,Ce.type="min-elap"):(Ce.size=64,Ce.type="sec-elap"),p.date=p.date|Ce.size,P.push(Ce),m(Ce,g)}else if(I=/^(?:B2)/i.exec(b))_e||(p.date_system=6);else if(I=/^(?:B1)/i.exec(b))_e||(p.date_system=1);else if(I=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(b)){const x={type:"",size:0,date:1,raw:I[0]},ee=I[0].toLowerCase(),Ce=ee[0];if(ee==="y"||ee==="yy")x.size=2,x.type="year-short";else if(Ce==="y"||Ce==="e")x.size=2,x.type="year";else if(ee==="b"||ee==="bb")x.size=2,x.type="b-year-short";else if(Ce==="b")x.size=2,x.type="b-year";else if(ee==="d"||ee==="dd")x.size=8,x.type="day",x.pad=/dd/.test(ee);else if(ee==="ddd")x.size=8,x.type="weekday-short";else if(Ce==="d")x.size=8,x.type="weekday";else if(Ce==="h")x.size=16,x.type="hour",x.pad=/hh/i.test(ee);else if(Ce==="m"){ee.length===3?(x.size=4,x.type="monthname-short"):ee.length===5?(x.size=4,x.type="monthname-single"):ee.length>=4&&(x.size=4,x.type="monthname");const Ae=P[P.length-1];!x.type&&Ae&&!Ae.used&&80&Ae.size&&(Ae.used=!0,x.size=32,x.type="min",x.pad=/mm/.test(ee)),x.type||(x.size=4,x.type="month",x.pad=/mm/.test(ee),x.indeterminate=!0)}else if(Ce==="s"){x.size=64,x.type="sec",x.pad=/ss/.test(ee);const Ae=P[P.length-1];Ae&&32&Ae.size?x.used=!0:Ae&&Ae.indeterminate&&(delete Ae.indeterminate,Ae.size=32,Ae.type="min",x.used=!0)}p.date=p.date|x.size,p.date_eval=!0,P.push(x),m(x,g)}else if(I=/^(?:AM\/PM|am\/pm|A\/P)/.exec(b))p.clock=12,p.date=16|p.date,p.date_eval=!0,m({type:"am",short:I[0]==="A/P"},g);else if(p.date&&(I=/^\.0{1,3}/i.exec(b))){const x=I[0].length-1,ee=[64,128,256,512][x];p.date=p.date|ee,p.date_eval=!0,p.sec_decimals=Math.max(p.sec_decimals,x),m({type:"subsec",size:ee,decimals:x,date:1,raw:I[0]},g)}else if((I=/^\\(.)/.exec(b))||(I=/^"([^"]*?)"/.exec(b)))m(I[1],g);else if(I=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(b))p.condition=[I[1],parseFloat(I[2],10)];else if(I=/^\[\$([^\]]+)\]/.exec(b)){const x=I[1].split("-"),ee=x.length<2?"":x[x.length-1],Ce=x[0];Ce&&m(Ce,g);const Ae=u(ee);Ae&&(p.locale=Ae);const Ue=parseInt(ee,16);isFinite(Ue)&&16711680&Ue&&(Ue>>16&255)===6&&(p.date_system=6),_e=!0}else if(I=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(b))p.color=I[2]?N[parseInt(I[2],10)]||"#000":I[1].toLowerCase();else if(!(I=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(b))){if(I=/^%/.exec(b))p.scale=100,p.percent=!0,m("%",g);else if(I=/^_(\\.|.)/.exec(b))m(" ",g);else if(I=/^\./.exec(b))m({type:"point",value:I[0]},g),p.dec_fractions=!0,T="frac";else if(I=/^[Ee]([+-]?|(?=[0#?]))/.exec(b))p.exponential=!0,p.exp_plus=I[1]==="+",T="man",m({type:"exp",plus:I[1]==="+"},g);else if(!(I=/^\*(\\.|.)/.exec(b))){if(I=/^[BENn[]/.exec(b))throw new SyntaxError("Unexpected char ".concat(b.charAt(0)," in pattern ").concat(_));b[0]==="("&&(p.parens=!0),I=[b[0]],m(I[0],g)}}}Z=I[0],b=b.slice(I?I[0].length:1)}if(p.pattern=_.slice(0,_.length-b.length),/^((?:\[[^\]]+\])+)(;|$)/.test(p.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(p.pattern)&&m({type:"text"},g),p.fractions&&p.dec_fractions||p.fractions&&p.exponential)throw new SyntaxError("Invalid pattern: ".concat(p.pattern));const J=p.int_pattern.join("");if(p.grouping=J.indexOf(",")>=0,p.grouping){const x=J.split(","),ee=x.length;ee===2?(p.group_pri=x[1].length,p.group_sec=p.group_pri):ee>2&&(p.group_pri=x[ee-1].length,p.group_sec=x[ee-2].length)}else p.group_pri=0,p.group_sec=0;q(J.replace(/[,]/g,""),p,"int"),q(p.frac_pattern.join(""),p,"frac"),q(p.man_pattern.join(""),p,"man");let me=p.num_pattern.join(""),Se=p.den_pattern.join("");const ue=/\?/.test(Se)||/\?/.test(me);return Se=Se.replace(/\d/g,ue?"?":"#"),ue&&(Se=Se.replace(/#$/g,"?")),q(me,p,"num"),q(Se,p,"den"),ue&&(me=me.replace(/#$/g,"?")),p.int_padding=ae(p.int_pattern.join("")),p.man_padding=ae(p.man_pattern.join("")),p.num_padding=ae(me),p.den_padding=ae(Se),p.den_pattern.length&&(p.denominator=parseInt(p.den_pattern.join("").replace(/\D/g,""),10)),p.integer=!!p.int_pattern.join("").length,p.fractions&&g.forEach((x,ee)=>{const Ce=g[ee+1];x.type==="string"&&Ce&&(Ce.type==="num"?x.rule="num+int":Ce.type==="div"?x.rule="num":Ce.type==="den"&&(x.rule="den"))}),p}const S=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function D(_){const g=[];let p,b=!1,T=null,U=_,L=0,P=!1,I=0,Z=0;do{if(P=B(U),(P.date||P.general)&&(P.int_pattern.length||P.frac_pattern.length||P.scale!==1||P.text))throw new Error("Illegal format");if(P.condition&&(Z++,b=!0),P.text){if(T)throw new Error("Unexpected partition");T=P}P.locale&&(p=u(P.locale)),g.push(P),L=U.charAt(P.pattern.length)===";"?1:0,U=U.slice(P.pattern.length+L),I++}while(L&&I<4&&Z<3);if(L)throw new Error("Unexpected partition");if(Z>2)throw new Error("Unexpected condition");const _e=g[3];if(_e&&(_e.int_pattern.length||_e.frac_pattern.length||_e.date))throw new Error("Unexpected partition");if(b){const J=g.length;if(J===1&&(g[1]=B("General"),g[1].generated=!0),J<3){const me=g[0],Se=g[1];if(S(me),Se.condition)S(Se);else{const ue=me.condition;(ue[0]==="="||ue[1]>=0&&(ue[0]===">"||ue[0]===">="))&&Se.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(S)}else{if(g.length<4&&T)for(let J=0,me=g.length;J<me;J++)g[J]===T&&g.splice(J,1);if(g.length<1&&T&&(g[0]=B("General"),g[0].generated=!0),g.length<2){const J=B(g[0].pattern);J.tokens.unshift({type:"minus",volatile:!0}),J.generated=!0,g.push(J)}if(g.length<3){const J=B(g[0].pattern);J.generated=!0,g.push(J)}if(g.length<4)if(T)g.push(T);else{const J=B("@");J.generated=!0,g.push(J)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:p}}const O=Math.floor;function w(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let p=_+68569+2415019;const b=O(4*p/146097);p-=O((146097*b+3)/4);const T=O(4e3*(p+1)/1461001);p=p-O(1461*T/4)+31;const U=O(80*p/2447),L=p-O(2447*U/80);p=O(U/11);const P=U+2-12*p;return[0|100*(b-49)+T+p,0|P,0|L]}function k(_){return w(_+1462)}function $(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,p=.1335;let b=_+466935;const T=O(b/10631);b-=10631*T;const U=O((b-p)/g);b-=O(U*g+p);const L=O((b+28.5001)/29.5);return L===13?[30*T+U,12,30]:[30*T+U,L,b-O(29.5001*L-29)]}function V(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const b=O(_);return g===6?$(b):g===-1?k(b):w(b,p)}const se=Math.floor,he=86400;function ge(_,g){let p=null;if(Array.isArray(_)){const[b,T,U,L,P,I]=_;p=Date.UTC(b,T==null?0:T-1,U!=null?U:1,L||0,P||0,I||0)}else if(_ instanceof Date&&(p=1*_,!g||!g.ignoreTimezone)){const b=new Date;b.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),b.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),p=1*b}if(p!=null&&isFinite(p)){const b=p/864e5;return b-(b<=-25509?-25568:-25569)}return _}function Te(_,g){let p=0|_;const b=he*(_-p);let T=se(b);b-T>.9999&&(T+=1,T===he&&(T=0,p+=1));const U=T<0?he+T:T,[L,P,I]=V(_,0,g&&g.leap1900),Z=se(U/60/60)%60,_e=se(U/60)%60,J=se(U)%60;if(g&&g.nativeDate){const me=new Date(0);return me.setUTCFullYear(L,P-1,I),me.setUTCHours(Z,_e,J),me}return[L,P,I,Z,_e,J]}function be(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function y(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function F(_){const[g,p,b,T]=_;return!(g&&!g.generated||p&&!p.generated||b&&!b.generated||!T||!T.text||T.generated)}const G={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},X=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],Y={total:1,sign:0,period:0,int:1,frac:0},W=(_,g)=>_.replace(/\./,g.decimal);function le(_,g,p,b){const T=0|p;if(typeof p=="string")_.push(p);else if(p===T)_.push(Math.abs(T));else{const U=Math.abs(p);let L=U?Math.floor(Math.log10(U)):0,P=L<0?U*10**-L:U/10**L;P===10&&(P=1,L++);const I=function(_e){let J=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const me=Math.abs(_e);if(!me)return Y;const Se=J&&_e<0?1:0,ue=Math.floor(me),x=Math.floor(Math.log10(me)+1);let ee=0,Ce=0;if(ue!==me){ee=1;const Ae=String(C(x<0?me*10**-x:me/10**x,15));let Ue=Ae.length,ke=!0,je=0;for(;je<=Ae.length;){if(Ae[je]==="."){Ue--;break}Ae[je]==="0"&&ke?Ue--:ke=!1,je++}Ce=Ue-x,Ce<0&&(Ce=0,ee=0)}return{total:Se+Math.max(x,1)+ee+Ce,digits:Math.max(x,0)+Ce,sign:Se,period:ee,int:Math.max(x,1),frac:Ce}}(U),Z=()=>{const _e=Math.abs(L);let J;J=P===1?P:C(P,5),_.push(W(J+"",b),b.exponent,L<0?b.negative:b.positive,_e<10?"0":"",_e)};if(L>=-4&&L<=-1){const _e=U.toPrecision(10+L).replace(/\.?0+$/,"");_.push(W(_e,b))}else if(L===10){const _e=U.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(W(_e,b))}else if(Math.abs(L)<=9)if(I.total<=11){const _e=C(U,9).toFixed(I.frac);_.push(W(_e,b))}else L===9?_.push(Math.floor(U)):L>=0&&L<9?_.push(C(U,9-L)):Z();else I.total>=12?Z():Math.floor(U)===U?_.push(Math.floor(U)):_.push(W(C(U,9).toFixed(I.frac),b))}return _}const oe=86400,H={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},te=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const p=Math.floor(Math.log10(_));return g>1?Math.floor(p/g)*g:p};function ie(_,g,p,b){let T="",U="",L="",P="",I="",Z=0,_e=0|_,J=0,me=0,Se=1,ue=0,x=0,ee=0,Ce=0,Ae=0,Ue=0;const ke=b||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(ye){if(ye===0)return ye;const Me=Math.ceil(Math.log10(ye<0?-ye:ye)),re=10**(16-Math.floor(Me));return Math.round(ye*re)/re}(_*g.scale)),g.exponential){let ye=Math.abs(_);if(ye){const Me=10**-te(ye,g.int_max),re=C(ye*Me,g.frac_max)/Me;Z=te(re,g.int_max)}ye/=10**Z,_=_<0?-ye:ye,T+=Math.abs(Z)}if(g.integer){const ye=Math.abs(C(_,g.fractions?1:g.frac_max));I+=ye<1?"":Math.floor(ye)}if(g.grouping){let ye="",Me=I.length;for(Me>g.group_pri&&(Me-=g.group_pri,ye=ke.group+I.slice(Me,Me+g.group_pri)+ye);Me>g.group_sec;)Me-=g.group_sec,ye=ke.group+I.slice(Me,Me+g.group_sec)+ye;I=Me?I.slice(0,Me)+ye:ye}g.dec_fractions&&(P=String(C(_,g.frac_max)).split(".")[1]||"");let je=!1;if(g.fractions){const ye=Math.abs(g.integer?_%1:_);if(ye)if(je=!0,isFinite(g.denominator))L+=g.denominator,U+=C(ye*g.denominator),U==="0"&&(U="",L="",je=!1,I||(I="0"));else{const Me=R(ye,g.integer?g.num_max:1/0,g.den_max);U+=Me[0],L+=Me[1],g.integer&&U==="0"&&(I||(I="0"),U="",L="",je=!1)}}if(g.date){_e=Math.trunc(_);const ye=oe*(_-_e);if(J=Math.floor(ye),Ue=ye-J,Math.abs(Ue)<1e-6?Ue=0:Ue>.9999&&(Ue=0,J+=1,J===oe&&(J=0,_e+=1)),Ue){const Me=512&g.date||256&g.date||128&g.date;(Me===512&&Ue>.9995||Me===256&&Ue>.995||Me===128&&Ue>.95||!Me&&Ue>=.5)&&(J++,Ue=0)}if(_e||g.date_system){const Me=V(_,g.date_system,p.leap1900);me=Me[0],Se=Me[1],ue=Me[2]}if(J){const Me=J<0?oe+J:J;Ae=Math.floor(Me)%60,Ce=Math.floor(Me/60)%60,ee=Math.floor(Me/60/60)%60}if(x=(6+_e)%7,g.date_eval&&(dt=_,ft=_e+J/oe,p.dateSpanLarge?dt<-694324||ft>=35830291:dt<0||ft>=2958466)){if(p.dateErrorThrows)throw new Error("Date out of bounds");return p.dateErrorNumber?le(_<0?[ke.negative]:[],0,_,ke).join(""):p.overflow}}var dt,ft;if(g.int_padding&&(I=g.int_padding.length===1?I||g.int_padding:g.int_padding.substring(0,g.int_padding.length-I.length)+I),g.num_padding&&(U=g.num_padding.length===1?U||g.num_padding:g.num_padding.substring(0,g.num_padding.length-U.length)+U),g.den_padding&&(L=g.den_padding.length===1?L||g.den_padding:L+g.den_padding.slice(L.length)),g.man_padding){const ye=g.exp_plus?"+":"";T=g.man_padding.length===1?(Z<0?"-":ye)+(T||g.man_padding):(Z<0?"-":ye)+g.man_padding.slice(0,g.man_padding.length-T.length)+T}const Ee=[];let et=0;const ve={int:0,frac:0,man:0,num:0,den:0};for(let ye=0,Me=g.tokens.length;ye<Me;ye++){const re=g.tokens[ye],at=re.num?re.num.length:0;if(re.type==="string")re.rule?re.rule==="num"?je?Ee.push(re.value):(g.num_min>0||g.den_min>0)&&Ee.push(re.value.replace(/./g,z["?"])):re.rule==="num+int"?je&&I?Ee.push(re.value):g.den_min>0&&(I||g.num_min)&&Ee.push(re.value.replace(/./g,z["?"])):re.rule==="den"&&(je?Ee.push(re.value):(g.den_min>0||g.den_min>0)&&Ee.push(re.value.replace(/./g,z["?"]))):Ee.push(re.value);else if(re.type==="error")Ee.push(p.invalid);else if(re.type==="point")Ee.push(g.date?re.value:ke.decimal);else if(re.type==="general")le(Ee,0,_,ke);else if(re.type==="exp")Ee.push(ke.exponent);else if(re.type==="minus")re.volatile&&g.date||re.volatile&&(_>=0||typeof _!="number")||(re.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&I&&I!=="0"||P)&&Ee.push(ke.negative):Ee.push(ke.negative));else if(re.type==="plus")Ee.push(ke.positive);else if(re.type==="text")Ee.push(_);else if(re.type==="div")je?Ee.push("/"):g.num_min>0||g.den_min>0?Ee.push(z["?"]):Ee.push(z["#"]);else if(re.type==="int")if(g.int_pattern.length===1)Ee.push(I);else{const He=et?g.int_pattern.join("").length-ve.int:1/0,Dt=et===g.int_pattern.length-1?0:g.int_pattern.join("").length-(ve.int+re.num.length);Ee.push(I.substring(I.length-He,I.length-Dt)),et++,ve.int+=re.num.length}else if(re.type==="frac"){const He=ve.frac;for(let Dt=0;Dt<at;Dt++)Ee.push(P[Dt+He]||z[re.num[Dt]]);ve.frac+=at}else if(re.type in H)g[re.type+"_pattern"].length===1?(re.type==="int"&&Ee.push(I),re.type==="frac"&&Ee.push(P),re.type==="man"&&Ee.push(T),re.type==="num"&&Ee.push(U),re.type==="den"&&Ee.push(L)):(Ee.push(H[re.type].slice(ve[re.type],ve[re.type]+at)),ve[re.type]+=at);else if(re.type==="year")me<0&&Ee.push(ke.negative),Ee.push(String(Math.abs(me)).padStart(4,"0"));else if(re.type==="year-short"){const He=me%100;Ee.push(He<10?"0":"",He)}else if(re.type==="month")Ee.push(re.pad&&Se<10?"0":"",Se);else if(re.type==="monthname-single")g.date_system===6?Ee.push(ke.mmmm6[Se-1].charAt(0)):Ee.push(ke.mmmm[Se-1].charAt(0));else if(re.type==="monthname-short")g.date_system===6?Ee.push(ke.mmm6[Se-1]):Ee.push(ke.mmm[Se-1]);else if(re.type==="monthname")g.date_system===6?Ee.push(ke.mmmm6[Se-1]):Ee.push(ke.mmmm[Se-1]);else if(re.type==="weekday-short")Ee.push(ke.ddd[x]);else if(re.type==="weekday")Ee.push(ke.dddd[x]);else if(re.type==="day")Ee.push(re.pad&&ue<10?"0":"",ue);else if(re.type==="hour"){const He=ee%g.clock||(g.clock<24?g.clock:0);Ee.push(re.pad&&He<10?"0":"",He)}else if(re.type==="min")Ee.push(re.pad&&Ce<10?"0":"",Ce);else if(re.type==="sec")Ee.push(re.pad&&Ae<10?"0":"",Ae);else if(re.type==="subsec"){Ee.push(ke.decimal);const He=Ue.toFixed(g.sec_decimals);Ee.push(He.slice(2,2+re.decimals))}else if(re.type==="am"){const He=ee<12?0:1;re.short&&!b?Ee.push("AP"[He]):Ee.push(ke.ampm[He])}else if(re.type==="hour-elap"){_<0&&Ee.push(ke.negative);const He=24*_e+Math.floor(Math.abs(J)/3600);Ee.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="min-elap"){_<0&&Ee.push(ke.negative);const He=1440*_e+Math.floor(Math.abs(J)/60);Ee.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="sec-elap"){_<0&&Ee.push(ke.negative);const He=_e*oe+Math.abs(J);Ee.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="b-year")Ee.push(me+543);else if(re.type==="b-year-short"){const He=(me+543)%100;Ee.push(He<10?"0":"",He)}}return p.nbsp?Ee.join(""):Ee.join("").replace(/\u00a0/g," ")}function pe(_,g){for(let p=0;p<3;p++){const b=g[p];if(b){let T;if(b.condition){const U=b.condition[0],L=b.condition[1];U==="="?T=_===L:U===">"?T=_>L:U==="<"?T=_<L:U===">="?T=_>=L:U==="<="?T=_<=L:U==="<>"&&(T=_!==L)}else T=!0;if(T)return b}}}const Oe=B("@"),De="black",K={};function Re(_,g){if(_){const p=_[0];g[p]=g[p]||{},Re(_.slice(1),g[p])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","m-d-y","m-d-Y","m-j-y","m-j-Y","n-d-y","n-d-Y","n-j-y","n-j-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"].forEach(_=>{Re(_,K),Re(_+" x",K),Re(_+" l",K),Re(_+" l x",K),Re("l "+_,K),Re("l "+_+" x",K),Re(_+" D",K),Re(_+" D x",K),Re("D "+_,K),Re("D "+_+" x",K)});const Ve={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},Be={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Le={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},Je=new Date().getUTCFullYear();function Rt(_){const g=new RegExp("^([\\s+%"+A.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+A.join("")+")]*)$").exec(_);if(g){const[,p,b,T,U,L]=g;let P=1,I="",Z=!1,_e=!1,J=!1,me=!1,Se=!1,ue=null,x=!1,ee=parseFloat(b.replace(/,/g,""));if(!isFinite(ee))return null;for(let Ae=0;Ae<p.length;Ae++){const Ue=p[Ae];if(Ue==="-"){if(Z||_e)return null;Z=!0,P=-1}else if(j.test(Ue)){if(Se)return null;Se=!0,ue=Ue}else if(Ue==="("){if(_e||Z)return null;_e=!0,P=-1}else if(Ue==="%"){if(me)return null;me=!0}}for(let Ae=0;Ae<L.length;Ae++){const Ue=L[Ae];if(j.test(Ue)){if(Se)return null;Se=!0,ue=Ue,x=!0}else if(Ue===")"){if(J||!_e)return null;J=!0}else if(Ue==="%"){if(me)return null;me=!0}}if(U){if(me||Se)return null;I="0.00E+00"}else if(me){if(Se)return null;I=T.includes(".")?"0.00%":"0%",ee*=.01}else if(Se){const Ae=T.includes(".")?"#,##0.00":"#,##0";I=x?Ae+ue:ue+Ae}else T.includes(",")&&(I=T.includes(".")?"#,##0.00":"#,##0");const Ce={v:ee*P};return I&&(Ce.z=I),Ce}}const Ge=(_,g,p)=>{const b=p.path||"",T=Object.keys(g);for(let U=0;U<T.length;U++){let L;const P=T[U];if(g[P]){if(P==="$"||P==="€")_||(L=p);else if(P==="-"){const I=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(I){const Z=I[1]==="-"||I[1]==="/"||I[1]==="."?I[1]:" ";if(!p.sep||p.sep===Z){const _e=I[0].replace(/\s+/g," ");L=Ge(_.slice(I[0].length),g[P],{...p,sep:Z,path:b+_e})}}}else if(P===" "){const I=/^[,.]?\s+/.exec(_);if(I){const Z=I[0].replace(/\s+/g," ");L=Ge(_.slice(I[0].length),g[P],{...p,path:b+Z})}}else if(P==="j"||P==="d"){const I=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);I&&(L=Ge(_.slice(I[0].length),g[P],{...p,day:I[0],path:b+P}))}else if(P==="n"||P==="m"){const I=/^(0?[1-9]|1[012])\b/.exec(_);I&&(L=Ge(_.slice(I[0].length),g[P],{...p,month:+I[0],_mon:I[0],path:b+P}))}else if(P==="F"||P==="M"){const I=/^([a-z]{3,9})\b/i.exec(_),Z=I&&(P==="F"?Be:Ve)[I[0].toLowerCase()];Z&&(L=Ge(_.slice(I[0].length),g[P],{...p,month:Z,_mon:I[0],path:b+P}))}else if(P==="l"||P==="D"){const I=/^([a-z]{3,9})\b/i.exec(_);(I&&Le[I[0].toLowerCase()])===P&&(L=Ge(_.slice(I[0].length),g[P],{...p,path:b+P}))}else if(P==="y"){const I=/^\d\d\b/.exec(_);if(I){const Z=+I[0]>=30?+I[0]+1900:+I[0]+2e3;L=Ge(_.slice(I[0].length),g[P],{...p,year:Z,path:b+P})}}else if(P==="Y"){const I=/^\d\d\d\d\b/.exec(_);I&&(L=Ge(_.slice(I[0].length),g[P],{...p,year:+I[0],path:b+P}))}else{if(P!=="x")throw new Error('Unknown date token "'.concat(P,'"'));{const I=Ke(_);I&&(L=Ge("",g[P],{...p,time:I.v,tf:I.z,path:b+P}))}}if(L)return L}}};function tt(_,g){const p=Ge(_.trim(),K,{path:""});if(p){var b;if(p.sep==="."&&p.path.length===3)return null;const T=+((b=p.year)!==null&&b!==void 0?b:Je);if(p.day||(p.day=1),!function(P,I,Z){if(Z<1||I<1||I>12)return!1;if(I===2){if(Z>(P%4==0&&P%100!=0||P%400==0||P===1900?29:28))return!1}else if((I===4||I===6||I===9||I===11)&&Z>30||(I===1||I===3||I===5||I===7||I===8||I===10||I===12)&&Z>31)return!1;return!0}(T,p.month,p.day))return null;let U=-1/0;if(T<1900)return null;T<=1900&&p.month<=2?U=25568:T<1e4&&(U=25569);const L=Date.UTC(T,p.month-1,p.day)/864e5+U+(p.time||0);if(L>=0&&L<=2958465){const P=p._mon[0]==="0"||p.day[0]==="0"||p._mon.length===2&&p.day.length===2,I=p.path.replace(/[jdlDnmMFyYx-]/g,Z=>Z==="j"||Z==="d"?P?"dd":"d":Z==="D"?"ddd":Z==="l"?"dddd":Z==="n"||Z==="m"?P?"mm":"m":Z==="M"?"mmm":Z==="F"?"mmmm":Z==="y"?"yy":Z==="x"?p.tf||"":Z==="Y"?"yyyy":Z);return g&&g.nativeDate?{v:Te(L,g),z:I}:{v:L,z:I}}}return null}function Ke(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,p,b,T,U,L]=g;if(U&&!T||!L&&!b&&!T)return null;let P=1*(p||0);if(L){if(P>=13)return null;L[0]!=="p"&&L[0]!=="P"||(P+=12)}return{v:(60*P*60+60*(1*(b||0))+1*(T||0)+1*(U||0))/86400,z:(p.length===2?"hh":"h")+":mm"+(T?":ss":"")+(L?" AM/PM":"")}}return null}function ct(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const ot={};function kt(_,g){const{pattern:p,partitions:b,locale:T}=_,U=I=>{const Z=Object.assign({},Q(),g,I);return T&&(Z.locale=T),Z},L=(I,Z)=>{const _e=U(Z);return function(J,me,Se){const ue=c(Se.locale),x=me[3]?me[3]:Oe;if(typeof J=="boolean"&&(J=J?"TRUE":"FALSE"),J==null)return"";if(typeof J!="number")return ie(J,x,Se,ue);if(!isFinite(J)){const Ce=ue||f;return isNaN(J)?Ce.nan:(J<0?Ce.negative:"")+Ce.infinity}const ee=pe(J,me);return ee?ie(J,ee,Se,ue):Se.overflow}(ge(I,_e),b,_e)};L.color=(I,Z)=>function(_e,J){if(typeof _e!="number"||!isFinite(_e))return(J[3]?J[3].color:Oe.color)||De;const me=pe(_e,J);return me&&me.color||De}(ge(I,U(Z)),b);const P=function(I){var Z;let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[J,me]=I,Se=J.frac_max,ue={type:"general",isDate:y(I),isText:F(I),isPercent:be(I),maxDecimals:J.general?9:Se,scale:(Z=J.scale)!==null&&Z!==void 0?Z:1,color:0,parentheses:0,grouped:J.grouping?1:0,_partitions:I},x=!ue.isDate&&!ue.isText&&!J.error&&J.tokens.some(ke=>ke.type==="string"&&(_e?ke.value===_e:j.test(ke.value)));let ee="G",Ce=Se>=0?Math.min(15,Se):"",Ae="",Ue="";if(me&&me.color&&(Ue="-",ue.color=1),J.parens&&(Ae="()",ue.parentheses=1),x)ee="C",ue.type="currency";else if(J.error)ue.type="error",ue.maxDecimals=0;else if(ue.isDate){let ke=0,je=0,dt="";J.tokens.forEach(Ee=>{const et=Ee.type;/^(b-)?year/.test(et)?(dt+="Y",je++):et.startsWith("month")?(dt+="M",je++):/^(week)?day/.test(et)?(dt+="D",je++):et!=="hour"&&et!=="min"&&et!=="sec"&&et!=="am"||(dt+=et[0],ke++)}),ue.type="date",je&&ke?ue.type="datetime":!je&&ke&&(ue.type="time");const ft=X.find(Ee=>dt.startsWith(Ee[0]));ee=ft?"D":"G",Ce=ft?ft[1]:""}else ue.isText?(ee="G",ue.type="text",Ce="",ue.maxDecimals=0):J.general?(ee="G",ue.type="general",Ce=""):J.fractions?(ee="G",ue.type="fraction",Ce=""):J.exponential?(ee="S",ue.type="scientific"):ue.isPercent?(ee="P",ue.type="percent"):J.grouping?(ee=",",ue.type="grouped"):(J.int_max||Se)&&(ee="F",ue.type="number");return ue.code=ee+Ce+Ue+Ae,ue.level=G[ue.type],Object.freeze(ue)}(b,(g||{}).currency)||new SyntaxError;return L.info=P,L.dateInfo=function(I){const[Z]=I;return{year:!!(2&Z.date),month:!!(4&Z.date),day:!!(8&Z.date),hours:!!(16&Z.date),minutes:!!(32&Z.date),seconds:!!(64&Z.date),clockType:Z.clock===12?12:24}}(b),L.isPercent=()=>!!P.isPercent,L.isDate=()=>!!P.isDate,L.isText=()=>!!P.isText,L.pattern=p,_.error&&(L.error=_.error),L.options=U,L.locale=T||g&&g.locale||"",Object.freeze(L)}function Fe(_,g){_||(_="General");let p=null;return ot[_]?p=ot[_]:(p=Object.assign({},Q(),g).throws?D(_):function(b){try{return D(b)}catch(T){const U={tokens:[{type:"error"}],error:T.message};return{pattern:b,partitions:[U,U,U,U],error:T.message,locale:null}}}(_),p.error||(ot[_]=p)),kt(p,g)}Fe.isDate=_=>Fe(_,{throws:!1}).isDate(),Fe.isPercent=_=>Fe(_,{throws:!1}).isPercent(),Fe.isText=_=>Fe(_,{throws:!1}).isText(),Fe.getInfo=(_,g)=>Fe(_,{...g,throws:!1}).info,Fe.getDateInfo=(_,g)=>Fe(_,{...g,throws:!1}).dateInfo,Fe.dateToSerial=ge,Fe.dateFromSerial=Te,Fe.options=Q,Fe.dec2frac=R,Fe.round=C,Fe.codeToLocale=s,Fe.parseLocale=l,Fe.getLocale=c,Fe.addLocale=(_,g)=>{const p=l(g);return delete ot[p.lang],delete ot[p.language],d(_,p)},Fe.format=function(_,g,p){let b=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const T=p&&typeof p=="object"?p:{locale:p,throws:!b};return Fe(_,T)(ge(g,T),T)},Fe.is_date=Fe.isDate,Fe.parseNumber=Rt,Fe.parseDate=tt,Fe.parseTime=Ke,Fe.parseBool=ct,Fe.parseValue=function(_,g){var p,b,T;return(p=(b=(T=Rt(_))!==null&&T!==void 0?T:tt(_,g))!==null&&b!==void 0?b:Ke(_))!==null&&p!==void 0?p:ct(_)};var ht=Fe;return r=r.default}()})}(es)),es.exports}var Us,ma;function Jm(){return ma||(ma=1,Us=Qm()),Us}var qm=Jm();const Zm=wt(qm),uu=Zm;function rn(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function li(e,t,n){const r=rn(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function ui(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function e_(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let u=0;for(let c=0;c<s;c++,u++){const h=r[c];l[u]=n[h]}for(let c=0;c<a;c++,u++){const h=o[c];l[u]=i[h]}return l}function t_(e,t,n){const r=n;if(rn(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function ci(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?n_(e,t,n,r):r_(e,t,n,r)}function n_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function r_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class Tt{constructor(t={}){E(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new Tt({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){ci(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{ci(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)li(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&li(r,void 0,i)})}removeRows(t,n){ui(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&ui(t,n,s)})}getFragment(t,n,r,s){const i=new Tt;let o=0;for(let a=t;a<=n;a++){const l={};let u=0;for(let c=r;c<=s;c++){const h=this.getValue(a,c);l[u]=h,u++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new Tt;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,ne.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return rn(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=rn(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new Tt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const u=Number(l);s?u<n&&(n=u):(s=!0,n=u);const c=this.getValue(o,u);i.setValue(o-t,u-n,c)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const u=rn(l)-1;u>r&&(r=u),Object.keys(l).forEach(c=>{const h=Number(c);o?h<n&&(n=h):(o=!0,n=h)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}_setOriginValue(t={}){this._matrix=t}}const s_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},i_={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},o_={startRow:0,startColumn:0,endRow:0,endColumn:0},a_={row:0,column:0},ut={ff:"Arial",fs:11,it:Ie.FALSE,bl:Ie.FALSE,ul:{s:Ie.FALSE},st:{s:Ie.FALSE},ol:{s:Ie.FALSE},tr:{a:0,v:Ie.FALSE},td:Pn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:vt.UNSPECIFIED,vt:tn.UNSPECIFIED,tb:mn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},cu={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},l_=[Pi,gl,ki];var hu=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(hu||{});function Tr(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Ie.FALSE;switch(e){case"bl":case"it":{if(o[e]===Ie.FALSE)return Ie.FALSE;break}case"ul":case"st":{if(o[e].s===Ie.FALSE)return Ie.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
7
+ `)===r?Ie.TRUE:Ie.FALSE}const hr=class hr{constructor(t,n,r){E(this,"_range");E(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Tt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Tt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=ne.numToWord(r+1)+(t+1),o=ne.numToWord(s+1)+(n+1)):(i=ne.numToWord(s+1)+(n+1),o=ne.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ut.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new hr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let u=0;u<=r-n;u++)for(let c=0;c<=i-s;c++){if(o==null||((a=o==null?void 0:o[u])==null?void 0:a[c])==null)continue;const h=o[u][c].s;h&&(o[u][c].s=l.get(h))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ut.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("ul",t.body)===Ie.TRUE?{s:Ie.TRUE}:{s:Ie.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("st",t.body)===Ie.TRUE?{s:Ie.TRUE}:{s:Ie.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("it",t.body)===Ie.TRUE?ss.ITALIC:ss.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("bl",t.body)===Ie.TRUE?is.BOLD:is.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===mn.WRAP?Ie.TRUE:Ie.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){hr.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||ut[t]}))}};E(hr,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===xe.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===xe.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===xe.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let kn=hr;function u_(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||nt.NONE,o=s.endAbsoluteRefType||nt.NONE,a=s.rangeType||xe.NORMAL;if(!r&&i===nt.ALL&&o===nt.ALL)return s;const l=_a(s.startRow,n,s.startColumn,t,a),u=_a(s.endRow,n,s.endColumn,t,a);return r||i===nt.NONE&&o===nt.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:u.row,endColumn:u.column}:(i===nt.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===nt.COLUMN?s={...s,startRow:l.row}:i===nt.ROW&&(s={...s,startColumn:l.column}),o===nt.NONE?s={...s,endRow:u.row,endColumn:u.column}:o===nt.COLUMN?s={...s,endRow:u.row}:o===nt.ROW&&(s={...s,endColumn:u.column}),s)}function _a(e,t,n,r,s){return s===xe.NORMAL?{row:e+t,column:n+r}:s===xe.ROW?{row:e+t,column:n}:s===xe.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function oo(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],u=r[a+1]-1,c=s[o],h=s[o+1]-1;for(const d of e){if(d.startRow>h)break;if(d.startRow<=c&&d.endRow>=h&&d.startColumn<=l&&d.endColumn>=u){i.push({startColumn:l,endColumn:u,startRow:c,endRow:h});break}}}return i}function c_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function h_(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function d_(e){const t=oo(e),n=c_(t);return h_(n)}function f_(e,t){const n=[];return e.forEach(r=>{n.push(...zt.subtract(r,t))}),zt.mergeRanges(n)}function du(e,t){const n=Ea(e.startRow,e.endRow,t.startRow,t.endRow),r=Ea(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=g_(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Ea(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),u=Math.min(i,a);if(l<=u){const c=l===-1/0?Number.NaN:l,h=u===1/0?Number.NaN:u;return[c,h]}else return null}function g_(e,t,n,r,s,i){const o=e!==void 0?e:Ca(n,r,s,i),a=t!==void 0?t:Ca(n,r,s,i);return o===xe.ALL||a===xe.ALL?o===a?o:o===xe.ALL?a:o:o===a?o:(o===xe.NORMAL||a===xe.NORMAL,xe.NORMAL)}function Ca(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?xe.NORMAL:s?xe.ROW:i?xe.COLUMN:xe.ALL}const Ft=class Ft{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===xe.NORMAL||n.rangeType===void 0&&t.rangeType===xe.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:u,endColumn:c}=n,h=r<=l&&s>=a,d=i<=c&&o>=u;return h&&d}static intersects(t,n){if(t.rangeType===xe.ROW&&n.rangeType===xe.COLUMN||t.rangeType===xe.COLUMN&&n.rangeType===xe.ROW)return!0;if(t.rangeType===xe.ROW&&n.rangeType===xe.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===xe.COLUMN&&n.rangeType===xe.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,u=Number.isNaN(n.endRow)?r:n.endRow,c=Number.isNaN(n.startColumn)?0:n.startColumn,h=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-c-h),f=Math.abs(o-a)+Math.abs(c-h),C=Math.abs(s+i-l-u),R=Math.abs(s-i)+Math.abs(l-u);return d<=f&&C<=R}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,u=n.startColumn,c=n.endColumn;let h,d,f,C;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?C=s:C=l;else return null;if(u<=o)u>i?h=u:h=i;else return null;if(c>=i)c>=o?f=o:f=c;else return null;return{startRow:d,endRow:C,startColumn:h,endColumn:f,rangeType:xe.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return Ft.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:xe.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===xe.COLUMN),r=t.some(i=>i.rangeType===xe.ROW),s=Ft.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?xe.ROW:n?xe.COLUMN:xe.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return d_(t)}static splitIntoGrid(t){return oo(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=f_(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};E(Ft,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),E(Ft,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[nt.ROW,nt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[nt.ROW,nt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[nt.COLUMN,nt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[nt.COLUMN,nt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),E(Ft,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),E(Ft,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),E(Ft,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let zt=Ft;function p_(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=m_(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function m_(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function __(e,t){kn.foreach(t,(n,r)=>{e[n][r]=void 0})}function E_(e,t){const n=e.toFullArray(),r=[];for(;;){const s=p_(n,t);if(!s)break;r.push(s),__(n,s)}return r}class C_{constructor(t,n){E(this,"_values",[]);E(this,"_keys",[]);E(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function hi(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function R_(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const ls=65,fu=90,I_=97;function y_(e){const t=fu-ls+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+ls)+n,e=Math.floor(e/t)-1;return n}function gu(e,t){let n="";for(;t>0;)n+=e,t--;return n}function v_(e,t=!1){const n=fu-ls+1;let r=I_;t&&(r=ls);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return gu(s,i)}function S_(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function w_(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Rr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var pu=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(pu||{}),mu=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(mu||{}),Ne=(e=>(e[e.BULLET=0]="BULLET",e[e.NONE=1]="NONE",e[e.DECIMAL=2]="DECIMAL",e[e.DECIMAL_ZERO=3]="DECIMAL_ZERO",e[e.UPPER_LETTER=4]="UPPER_LETTER",e[e.LOWER_LETTER=5]="LOWER_LETTER",e[e.UPPER_ROMAN=6]="UPPER_ROMAN",e[e.LOWER_ROMAN=7]="LOWER_ROMAN",e[e.ORDINAL=8]="ORDINAL",e[e.CARDINAL_TEXT=9]="CARDINAL_TEXT",e[e.ORDINAL_TEXT=10]="ORDINAL_TEXT",e[e.HEX=11]="HEX",e[e.CHICAGO=12]="CHICAGO",e[e.IDEOGRAPH_DIGITAL=13]="IDEOGRAPH_DIGITAL",e[e.JAPANESE_COUNTING=14]="JAPANESE_COUNTING",e[e.AIUEO=15]="AIUEO",e[e.IROHA=16]="IROHA",e[e.DECIMAL_FULL_WIDTH=17]="DECIMAL_FULL_WIDTH",e[e.DECIMAL_HALF_WIDTH=18]="DECIMAL_HALF_WIDTH",e[e.JAPANESE_LEGAL=19]="JAPANESE_LEGAL",e[e.JAPANESE_DIGITAL_TEN_THOUSAND=20]="JAPANESE_DIGITAL_TEN_THOUSAND",e[e.DECIMAL_ENCLOSED_CIRCLE=21]="DECIMAL_ENCLOSED_CIRCLE",e[e.DECIMAL_FULL_WIDTH2=22]="DECIMAL_FULL_WIDTH2",e[e.AIUEO_FULL_WIDTH=23]="AIUEO_FULL_WIDTH",e[e.IROHA_FULL_WIDTH=24]="IROHA_FULL_WIDTH",e[e.GANADA=25]="GANADA",e[e.CHOSUNG=26]="CHOSUNG",e[e.DECIMAL_ENCLOSED_FULLSTOP=27]="DECIMAL_ENCLOSED_FULLSTOP",e[e.DECIMAL_ENCLOSED_PAREN=28]="DECIMAL_ENCLOSED_PAREN",e[e.DECIMAL_ENCLOSED_CIRCLE_CHINESE=29]="DECIMAL_ENCLOSED_CIRCLE_CHINESE",e[e.IDEOGRAPH_ENCLOSED_CIRCLE=30]="IDEOGRAPH_ENCLOSED_CIRCLE",e[e.IDEOGRAPH_TRADITIONAL=31]="IDEOGRAPH_TRADITIONAL",e[e.IDEOGRAPH_ZODIAC=32]="IDEOGRAPH_ZODIAC",e[e.IDEOGRAPH_ZODIAC_TRADITIONAL=33]="IDEOGRAPH_ZODIAC_TRADITIONAL",e[e.TAIWANESE_COUNTING=34]="TAIWANESE_COUNTING",e[e.IDEOGRAPH_LEGAL_TRADITIONAL=35]="IDEOGRAPH_LEGAL_TRADITIONAL",e[e.TAIWANESE_COUNTING_THOUSAND=36]="TAIWANESE_COUNTING_THOUSAND",e[e.TAIWANESE_DIGITAL=37]="TAIWANESE_DIGITAL",e[e.CHINESE_COUNTING=38]="CHINESE_COUNTING",e[e.CHINESE_LEGAL_SIMPLIFIED=39]="CHINESE_LEGAL_SIMPLIFIED",e[e.CHINESE_COUNTING_THOUSAND=40]="CHINESE_COUNTING_THOUSAND",e[e.KOREAN_DIGITAL=41]="KOREAN_DIGITAL",e[e.KOREAN_COUNTING=42]="KOREAN_COUNTING",e[e.KOREAN_LEGAL=43]="KOREAN_LEGAL",e[e.KOREAN_DIGITAL2=44]="KOREAN_DIGITAL2",e[e.VIETNAMESE_COUNTING=45]="VIETNAMESE_COUNTING",e[e.RUSSIAN_LOWER=46]="RUSSIAN_LOWER",e[e.RUSSIAN_UPPER=47]="RUSSIAN_UPPER",e[e.NUMBER_IN_DASH=48]="NUMBER_IN_DASH",e[e.HEBREW1=49]="HEBREW1",e[e.HEBREW2=50]="HEBREW2",e[e.ARABIC_ALPHA=51]="ARABIC_ALPHA",e[e.ARABIC_ABJAD=52]="ARABIC_ABJAD",e[e.HINDI_VOWELS=53]="HINDI_VOWELS",e[e.HINDI_CONSONANTS=54]="HINDI_CONSONANTS",e[e.HINDI_NUMBERS=55]="HINDI_NUMBERS",e[e.HINDI_COUNTING=56]="HINDI_COUNTING",e[e.THAI_LETTERS=57]="THAI_LETTERS",e[e.THAI_NUMBERS=58]="THAI_NUMBERS",e[e.THAI_COUNTING=59]="THAI_COUNTING",e[e.CUSTOM=60]="CUSTOM",e))(Ne||{}),Ir=(e=>(e[e.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e[e.BOTH=4]="BOTH",e))(Ir||{}),on=(e=>(e[e.HYPERLINK=0]="HYPERLINK",e[e.FIELD=1]="FIELD",e[e.SDT=2]="SDT",e[e.BOOKMARK=3]="BOOKMARK",e[e.COMMENT=4]="COMMENT",e[e.CUSTOM=5]="CUSTOM",e[e.MENTION=6]="MENTION",e[e.UNI_FORMULA=7]="UNI_FORMULA",e[e.DELTED=9999]="DELTED",e))(on||{}),fn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(fn||{}),_u=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(_u||{}),ao=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(ao||{}),Eu=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.LINES=1]="LINES",e[e.LINES_AND_CHARS=2]="LINES_AND_CHARS",e[e.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",e))(Eu||{}),Cu=(e=>(e[e.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",e[e.CONTINUOUS=1]="CONTINUOUS",e[e.NEXT_PAGE=2]="NEXT_PAGE",e[e.EVEN_PAGE=3]="EVEN_PAGE",e[e.ODD_PAGE=4]="ODD_PAGE",e))(Cu||{}),Ru=(e=>(e[e.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",e[e.NONE=1]="NONE",e[e.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",e))(Ru||{}),Iu=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Iu||{}),yu=(e=>(e[e.TEXT_RUN=0]="TEXT_RUN",e[e.AUTO_TEXT=1]="AUTO_TEXT",e[e.PAGE_BREAK=2]="PAGE_BREAK",e[e.COLUMN_BREAK=3]="COLUMN_BREAK",e[e.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",e[e.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",e[e.EQUATION=6]="EQUATION",e[e.DRAWING=7]="DRAWING",e[e.PERSON=8]="PERSON",e[e.RICH_LINK=9]="RICH_LINK",e))(yu||{}),vu=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(vu||{}),Su=(e=>(e[e.INLINE=0]="INLINE",e[e.WRAP_NONE=1]="WRAP_NONE",e[e.WRAP_POLYGON=2]="WRAP_POLYGON",e[e.WRAP_SQUARE=3]="WRAP_SQUARE",e[e.WRAP_THROUGH=4]="WRAP_THROUGH",e[e.WRAP_TIGHT=5]="WRAP_TIGHT",e[e.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",e))(Su||{}),wu=(e=>(e[e.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",e[e.NORMAL_TEXT=1]="NORMAL_TEXT",e[e.TITLE=2]="TITLE",e[e.SUBTITLE=3]="SUBTITLE",e[e.HEADING_1=4]="HEADING_1",e[e.HEADING_2=5]="HEADING_2",e[e.HEADING_3=6]="HEADING_3",e[e.HEADING_4=7]="HEADING_4",e[e.HEADING_5=8]="HEADING_5",e[e.HEADING_6=9]="HEADING_6",e))(wu||{}),Ou=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Ou||{}),bu=(e=>(e[e.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",e[e.SOLID=1]="SOLID",e[e.DOT=2]="DOT",e[e.DASH=3]="DASH",e))(bu||{}),Au=(e=>(e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e))(Au||{}),Tu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Tu||{}),Nu=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Nu||{}),Mu=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Mu||{}),Du=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Du||{}),xu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(xu||{}),Lu=(e=>(e[e.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",e[e.BOTH=1]="BOTH",e[e.TOP=2]="TOP",e[e.CENTER=3]="CENTER",e[e.BOTTOM=4]="BOTTOM",e))(Lu||{}),bn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(bn||{}),Uu=(e=>(e[e.PAGE=0]="PAGE",e[e.COLUMN=1]="COLUMN",e[e.CHARACTER=2]="CHARACTER",e[e.MARGIN=3]="MARGIN",e[e.INSIDE_MARGIN=4]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",e[e.LEFT_MARGIN=6]="LEFT_MARGIN",e[e.RIGHT_MARGIN=7]="RIGHT_MARGIN",e))(Uu||{}),Pu=(e=>(e[e.PAGE=0]="PAGE",e[e.PARAGRAPH=1]="PARAGRAPH",e[e.LINE=2]="LINE",e[e.MARGIN=3]="MARGIN",e[e.TOP_MARGIN=4]="TOP_MARGIN",e[e.BOTTOM_MARGIN=5]="BOTTOM_MARGIN",e[e.INSIDE_MARGIN=6]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=7]="OUTSIDE_MARGIN",e))(Pu||{}),ku=(e=>(e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.CHARACTER=2]="CHARACTER",e[e.PIXEL=3]="PIXEL",e[e.PERCENT=4]="PERCENT",e))(ku||{}),Fu=(e=>(e[e.CENTER=0]="CENTER",e[e.INSIDE=1]="INSIDE",e[e.LEFT=2]="LEFT",e[e.OUTSIDE=3]="OUTSIDE",e[e.RIGHT=4]="RIGHT",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTE=6]="DISTRIBUTE",e))(Fu||{}),$u=(e=>(e[e.BOTTOM=0]="BOTTOM",e[e.CENTER=1]="CENTER",e[e.INSIDE=2]="INSIDE",e[e.OUTSIDE=3]="OUTSIDE",e[e.TOP=4]="TOP",e))($u||{}),Hu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(Hu||{}),Bu=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(Bu||{}),ju=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(ju||{}),Wu=(e=>(e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e[e.DRAWING_IMAGE=0]="DRAWING_IMAGE",e[e.DRAWING_SHAPE=1]="DRAWING_SHAPE",e[e.DRAWING_CHART=2]="DRAWING_CHART",e[e.DRAWING_TABLE=3]="DRAWING_TABLE",e[e.DRAWING_SMART_ART=4]="DRAWING_SMART_ART",e[e.DRAWING_VIDEO=5]="DRAWING_VIDEO",e[e.DRAWING_GROUP=6]="DRAWING_GROUP",e[e.DRAWING_UNIT=7]="DRAWING_UNIT",e[e.DRAWING_DOM=8]="DRAWING_DOM",e))(Wu||{}),lo=(e=>(e[e.SLIDE=0]="SLIDE",e[e.MASTER=1]="MASTER",e[e.LAYOUT=2]="LAYOUT",e[e.HANDOUT_MASTER=3]="HANDOUT_MASTER",e[e.NOTES_MASTER=4]="NOTES_MASTER",e))(lo||{}),Yu=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(Yu||{}),zu=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(zu||{}),$e=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{}),Lt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Lt||{}),di=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(di||{});class Ss extends Ze{}function O_(e=ne.generateRandomId(6),t=zn.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
8
+ `,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:ao.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:Ie.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:Ie.TRUE,doNotHyphenateCaps:Ie.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:Ie.FALSE,useFirstPageHeaderFooter:Ie.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var Qn={},Nr={},Mr={},Ra;function b_(){if(Ra)return Mr;Ra=1,Object.defineProperty(Mr,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return Mr.default=n,Mr}var Dr={},Ia;function A_(){if(Ia)return Dr;Ia=1,Object.defineProperty(Dr,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return Dr.default=e,Dr}var Ps={},ya;function Vu(){return ya||(ya=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(c,h){if(!c)throw new Error(h)}const n=c=>c!=null&&typeof c=="object"&&!Array.isArray(c),r=(c,h)=>typeof c==typeof h?c>h:typeof c=="string"&&typeof h=="number";function s(c,h){for(let d in c){const f=d;h.write(f,c[f])}}e.isValidPathItem=c=>typeof c=="number"||typeof c=="string"&&c!=="__proto__";class i{constructor(h=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=h}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const h=[];let d=this.container,f=this.parents.length-1,C=this.idx;for(;C>=0;)h.unshift(d[C]),C===0?(C=this.indexes[f*2],d=this.parents[f--]):C-=n(d[C-1])?2:1;return h}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let h;return this.container&&this.container.length>this.idx+1&&n(h=this.container[this.idx+1])?h:null}descendFirst(){let h=this.idx+1;if(!this.container||h>=this.container.length||n(this.container[h])&&h+1>=this.container.length)return!1;n(this.container[h])&&h++;const d=this.container[h];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(h),this.idx=0,this.container=d):this.idx=h,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const h=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return h>=d.length?!1:(t(!isNaN(h)),this.indexes[this.indexes.length-1]=h,this.container=d[h],!0)}_init(h,d,f,C){this.container=h,this.idx=d,this.parents=f.slice(),this.indexes=C.slice()}clone(){const h=new o;return h._init(this.container,this.idx,this.parents,this.indexes),h}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(h,d){const f=this.getComponent();f&&d(f,h);for(const C of this)h&&h.descend(C),this.traverse(h,d),h&&h.ascend()}eachPick(h,d){this.traverse(h,(f,C)=>{f.p!=null&&d(f.p,C)})}eachDrop(h,d){this.traverse(h,(f,C)=>{f.d!=null&&d(f.d,C)})}}e.ReadCursor=o;class a extends i{constructor(h=null){super(h),this.pendingDescent=[],this._op=h}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let h=0;h<this.pendingDescent.length;h++){const d=this.pendingDescent[h];let f=this.idx+1;if(f<this.container.length&&n(this.container[f])&&f++,t(f===this.container.length||!n(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const C=this.container.splice(f,this.container.length-f);this.container.push(C),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const C=[d];this.container.splice(f,0,C),this.container=C}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const h=this.idx+1;if(h<this.container.length&&n(this.container[h]))return this.container[h];{const d={};return this.container.splice(h,0,d),d}}write(h,d){const f=this.getComponent();t(f[h]==null||f[h]===d,"Internal consistency error: Overwritten component. File a bug"),f[h]=d}get(){return this._op}descend(h){if(!e.isValidPathItem(h))throw Error("Invalid JSON key");this.pendingDescent.push(h)}descendPath(h){return this.pendingDescent.push(...h),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(h,d=s){if(h===null)return;if(t(Array.isArray(h)),h===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,C=this.parents.length;let R=0;for(let v=0;v<h.length;v++){const M=h[v];typeof M=="string"||typeof M=="number"?(R++,this.descend(M)):Array.isArray(M)?this.mergeTree(M,d):typeof M=="object"&&d(M,this)}for(;R--;)this.ascend();this.lcIdx=this.parents.length===C?f:-1}at(h,d){this.descendPath(h),d(this);for(let f=0;f<h.length;f++)this.ascend();return this}writeAtPath(h,d,f){return this.at(h,()=>this.write(d,f)),this.reset(),this}writeMove(h,d,f=0){return this.writeAtPath(h,"p",f).writeAtPath(d,"d",f)}getPath(){const h=super.getPath();return h.push(...this.pendingDescent),h}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=c=>new o(c);function l(c,h,d){let f,C;C=f=c?c.descendFirst():!1;function R(v){let M;for(;C;){const Q=M=c.getKey();if(v!=null){let z=!1;if(h&&typeof Q=="number"&&(M=h(Q,c.getComponent()),M<0&&(M=~M,z=!0)),r(M,v))return null;if(M===v&&!z)return c}d&&typeof M=="number"&&d(M,c.getComponent()),C=c.nextSibling()}return null}return R.end=()=>{f&&c.ascend()},R}e.advancer=l;function u(c,h,d){let f,C,R,v;for(f=C=c&&c.descendFirst(),R=v=h&&h.descendFirst();f||R;){let M=f?c.getKey():null,Q=R?h.getKey():null;M!==null&&Q!==null&&(r(Q,M)?Q=null:M!==Q&&(M=null)),d(M==null?Q:M,M!=null?c:null,Q!=null?h:null),M!=null&&f&&(f=c.nextSibling()),Q!=null&&R&&(R=h.nextSibling())}C&&c.ascend(),v&&h.ascend()}e.eachChildOf=u}(Ps)),Ps}var ks={},va;function Gu(){return va||(va=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))}(ks)),ks}var hn={},dn={},Sa;function uo(){return Sa||(Sa=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.uniToStrPos=dn.strPosToUni=void 0,dn.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},dn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),dn}var Fs={},wa;function fi(){return wa||(wa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=uo(),n=N=>{if(!Array.isArray(N))throw Error("Op must be an array of components");let A=null;for(let j=0;j<N.length;j++){const q=N[j];switch(typeof q){case"object":if(typeof q.d!="number"&&typeof q.d!="string")throw Error("Delete must be number or string");if(e.dlen(q.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(q.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(q>0))throw Error("Skip components must be >0");if(typeof A=="number")throw Error("Adjacent skip components should be combined");break}A=q}if(typeof A=="number")throw Error("Op has a trailing skip")};function r(N,A){let j=0,q=0;for(let fe=0;fe<N.length;fe++){const ae=N[fe];switch(A(ae,j,q),typeof ae){case"object":j+=e.dlen(ae.d);break;case"string":q+=t.strPosToUni(ae);break;case"number":j+=ae,q+=ae;break}}}e.eachOp=r;function s(N,A){const j=[],q=a(j);return r(N,(fe,ae,m)=>{q(A(fe,ae,m))}),h(j)}const i=N=>N,o=N=>s(N,i);e.dlen=N=>typeof N=="number"?N:t.strPosToUni(N);const a=N=>A=>{if(!(!A||A.d===0||A.d===""))if(N.length===0)N.push(A);else if(typeof A==typeof N[N.length-1])if(typeof A=="object"){const j=N[N.length-1];j.d=typeof j.d=="string"&&typeof A.d=="string"?j.d+A.d:e.dlen(j.d)+e.dlen(A.d)}else N[N.length-1]+=A;else N.push(A)},l=N=>typeof N=="number"?N:typeof N=="string"?t.strPosToUni(N):typeof N.d=="number"?N.d:t.strPosToUni(N.d);e.uniSlice=(N,A,j)=>{const q=t.uniToStrPos(N,A),fe=j==null?1/0:t.uniToStrPos(N,j);return N.slice(q,fe)};const u=(N,A,j)=>typeof N=="number"?j==null?N-A:Math.min(N,j)-A:e.uniSlice(N,A,j),c=N=>{let A=0,j=0;return{take:(ae,m)=>{if(A===N.length)return ae===-1?null:ae;const B=N[A];let S;if(typeof B=="number")return ae===-1||B-j<=ae?(S=B-j,++A,j=0,S):(j+=ae,ae);if(typeof B=="string"){if(ae===-1||m==="i"||t.strPosToUni(B.slice(j))<=ae)return S=B.slice(j),++A,j=0,S;{const D=j+t.uniToStrPos(B.slice(j),ae);return S=B.slice(j,D),j=D,S}}else{if(ae===-1||m==="d"||e.dlen(B.d)-j<=ae)return S={d:u(B.d,j)},++A,j=0,S;{let D=u(B.d,j,j+ae);return j+=ae,{d:D}}}},peek:()=>N[A]}},h=N=>(N.length>0&&typeof N[N.length-1]=="number"&&N.pop(),N);function d(N,A,j){if(j!=="left"&&j!=="right")throw Error("side ("+j+") must be 'left' or 'right'");n(N),n(A);const q=[],fe=a(q),{take:ae,peek:m}=c(N);for(let S=0;S<A.length;S++){const D=A[S];let O,w;switch(typeof D){case"number":for(O=D;O>0;)w=ae(O,"i"),fe(w),typeof w!="string"&&(O-=l(w));break;case"string":j==="left"&&typeof m()=="string"&&fe(ae(-1)),fe(t.strPosToUni(D));break;case"object":for(O=e.dlen(D.d);O>0;)switch(w=ae(O,"i"),typeof w){case"number":O-=w;break;case"string":fe(w);break;case"object":O-=e.dlen(w.d)}break}}let B;for(;B=ae(-1);)fe(B);return h(q)}function f(N,A){n(N),n(A);const j=[],q=a(j),{take:fe}=c(N);for(let m=0;m<A.length;m++){const B=A[m];let S,D;switch(typeof B){case"number":for(S=B;S>0;)D=fe(S,"d"),q(D),typeof D!="object"&&(S-=l(D));break;case"string":q(B);break;case"object":S=e.dlen(B.d);let O=0;for(;O<S;)switch(D=fe(S-O,"d"),typeof D){case"number":q({d:u(B.d,O,O+D)}),O+=D;break;case"string":O+=t.strPosToUni(D);break;case"object":q(D)}break}}let ae;for(;ae=fe(-1);)q(ae);return h(j)}const C=(N,A)=>{let j=0;for(let q=0;q<A.length&&N>j;q++){const fe=A[q];switch(typeof fe){case"number":{j+=fe;break}case"string":const ae=t.strPosToUni(fe);j+=ae,N+=ae;break;case"object":N-=Math.min(e.dlen(fe.d),N-j);break}}return N},R=(N,A)=>typeof N=="number"?C(N,A):N.map(j=>C(j,A));function v(N,A,j){return s(N,(q,fe)=>typeof q=="object"&&typeof q.d=="number"?{d:j.slice(A,fe,fe+q.d)}:q)}function M(N){return s(N,A=>{switch(typeof A){case"object":if(typeof A.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return A.d;case"string":return{d:A};case"number":return A}})}function Q(N){return s(N,A=>typeof A=="object"&&typeof A.d=="string"?{d:t.strPosToUni(A.d)}:A)}function z(N){let A=!0;return r(N,j=>{typeof j=="object"&&typeof j.d=="number"&&(A=!1)}),A}function de(N){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:n,create(A=""){if(typeof A!="string")throw Error("Initial data must be a string");return N.create(A)},apply(A,j){n(j);const q=N.builder(A);for(let fe=0;fe<j.length;fe++){const ae=j[fe];switch(typeof ae){case"number":q.skip(ae);break;case"string":q.append(ae);break;case"object":q.del(e.dlen(ae.d));break}}return q.build()},transform:d,compose:f,transformPosition:C,transformSelection:R,isInvertible:z,makeInvertible(A,j){return v(A,j,N)},stripInvertible:Q,invert:M,invertWithDoc(A,j){return M(v(A,j,N))},isNoop:A=>A.length===0}}e.default=de}(Fs)),Fs}var xr={},Oa;function T_(){if(Oa)return xr;Oa=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=fi(),t=uo();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const u=e.dlen(o.d);this.onRemove&&this.onRemove(l,u)}})},onInsert:null,onRemove:null}}return xr.default=n,n.provides={text:!0},xr}var ba;function N_(){return ba||(ba=1,function(e){var t=hn.__createBinding||(Object.create?function(d,f,C,R){R===void 0&&(R=C),Object.defineProperty(d,R,{enumerable:!0,get:function(){return f[C]}})}:function(d,f,C,R){R===void 0&&(R=C),d[R]=f[C]}),n=hn.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=hn.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var C in d)Object.hasOwnProperty.call(d,C)&&t(f,d,C);return n(f,d),f},s=hn.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=uo(),o=r(fi()),a=s(T_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(C){let R=i.uniToStrPos(d,C);if(R>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,R)),d=d.slice(R)},append(C){f.push(C)},del(C){d=d.slice(i.uniToStrPos(d,C))},build(){return f.join("")+d}}},slice:o.uniSlice},u=o.default(l),c=Object.assign(Object.assign({},u),{api:a.default});e.type=c,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var h=fi();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})}(hn)),hn}var Aa;function M_(){return Aa||(Aa=1,function(e){var t=Nr.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(b_()),r=t(A_()),s=Vu(),i=Gu();function o(y,F){if(!y)throw new Error(F)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:y=>y,isNoop:y=>y==null,setDebug(y){},registerSubtype:M,checkValidOp:fe,normalize:ae,apply:m,transformPosition:B,compose:S,tryTransform:V,transform:he,makeInvertible:w,invert:D,invertWithDoc:k,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(y,F,G)=>be(()=>!0,y,F,G),typeAllowingConflictsPred:y=>Object.assign(Object.assign({},e.type),{transform:(F,G,X)=>be(y,F,G,X)})};const a=y=>y?y.getComponent():null;function l(y){return y&&typeof y=="object"&&!Array.isArray(y)}const u=y=>Array.isArray(y)?y.slice():y!==null&&typeof y=="object"?Object.assign({},y):y,c=y=>y&&(y.p!=null||y.r!==void 0),h=y=>y&&(y.d!=null||y.i!==void 0);function d(y,F){return o(y!=null),typeof F=="number"?(o(Array.isArray(y),"Invalid key - child is not an array"),(y=y.slice()).splice(F,1)):(o(l(y),"Invalid key - child is not an object"),delete(y=Object.assign({},y))[F]),y}function f(y,F,G){return typeof F=="number"?(o(y!=null,"Container is missing for key"),o(Array.isArray(y),"Cannot use numerical key for object container"),o(y.length>=F,"Cannot insert into out of bounds index"),y.splice(F,0,G)):(o(l(y),"Cannot insert into missing item"),o(y[F]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),y[F]=G),G}e.removeOp=(y,F=!0)=>s.writeCursor().writeAtPath(y,"r",F).get(),e.moveOp=(y,F)=>s.writeCursor().writeMove(y,F).get(),e.insertOp=(y,F)=>s.writeCursor().writeAtPath(y,"i",F).get(),e.replaceOp=(y,F,G)=>s.writeCursor().at(y,X=>{X.write("r",F),X.write("i",G)}).get(),e.editOp=(y,F,G,X=!1)=>s.writeCursor().at(y,Y=>A(Y,F,G,X)).get();const C=(y,F)=>y!=null&&(typeof F=="number"?Array.isArray(y):typeof y=="object"),R=(y,F)=>C(y,F)?y[F]:void 0,v={};function M(y){let F=y.type?y.type:y;F.name&&(v[F.name]=F),F.uri&&(v[F.uri]=F)}const Q=y=>{const F=v[y];if(F)return F;throw Error("Missing type: "+y)};M(N_());const z=(y,F)=>y+F;M({name:"number",apply:z,compose:z,invert:y=>-y,transform:y=>y});const de=y=>y==null?null:y.et?Q(y.et):y.es?v["text-unicode"]:y.ena!=null?v.number:null,N=y=>y.es?y.es:y.ena!=null?y.ena:y.e,A=(y,F,G,X=!1)=>{const[Y,W]=typeof F=="string"?[Q(F),F]:[F,F.name];!X&&Y.isNoop&&Y.isNoop(G)||(W==="number"?y.write("ena",G):W==="text-unicode"?y.write("es",G):(y.write("et",W),y.write("e",G)))};function j(y){o(typeof y=="number"),o(y>=0),o(y===(0|y))}function q(y){typeof y=="number"?j(y):o(typeof y=="string")}function fe(y){if(y===null)return;const F=new Set,G=new Set,X=W=>{let le=!0,oe=!1;for(let H in W){const te=W[H];if(le=!1,o(H==="p"||H==="r"||H==="d"||H==="i"||H==="e"||H==="es"||H==="ena"||H==="et","Invalid component item '"+H+"'"),H==="p")j(te),o(!F.has(te)),F.add(te),o(W.r===void 0);else if(H==="d")j(te),o(!G.has(te)),G.add(te),o(W.i===void 0);else if(H==="e"||H==="es"||H==="ena"){o(!oe),oe=!0;const ie=de(W);o(ie,"Missing type in edit"),ie.checkValidOp&&ie.checkValidOp(N(W))}}o(!le)},Y=(W,le,oe)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");le||q(W[0]);let H=1,te=0,ie=0;for(let pe=0;pe<W.length;pe++){const Oe=W[pe];if(o(Oe!=null),Array.isArray(Oe)){const De=Y(Oe,!1);if(te){const K=typeof ie,Re=typeof De;K===Re?o(ie<De,"descent keys are not in order"):o(K==="number"&&Re==="string")}ie=De,te++,H=3}else typeof Oe=="object"?(o(H===1,`Prev not scalar - instead ${H}`),X(Oe),H=2):(o(H!==3),q(Oe),o(s.isValidPathItem(Oe),"Invalid path key"),H=1)}return o(te!==1,"Operation makes multiple descents. Remove some []"),o(H===2||H===3),W[0]};Y(y,!0),o(F.size===G.size,"Mismatched picks and drops in op");for(let W=0;W<F.size;W++)o(F.has(W)),o(G.has(W))}function ae(y){let F=0,G=[];const X=s.writeCursor();return X.mergeTree(y,(Y,W)=>{const le=de(Y);if(le){const H=N(Y);A(W,le,le.normalize?le.normalize(H):H)}for(const H of["r","p","i","d"])if(Y[H]!==void 0){const te=H==="p"||H==="d"?(oe=Y[H],G[oe]==null&&(G[oe]=F++),G[oe]):Y[H];W.write(H,te)}var oe}),X.get()}function m(y,F){if(fe(F),F===null)return y;const G=[];return function X(Y,W){let le=Y,oe=0,H={root:Y},te=0,ie=H,pe="root";function Oe(){for(;te<oe;te++){let De=W[te];typeof De!="object"&&(o(C(ie,pe)),ie=ie[pe]=u(ie[pe]),pe=De)}}for(;oe<W.length;oe++){const De=W[oe];if(Array.isArray(De)){const K=X(le,De);K!==le&&K!==void 0&&(Oe(),le=ie[pe]=K)}else if(typeof De=="object"){De.d!=null?(Oe(),le=f(ie,pe,G[De.d])):De.i!==void 0&&(Oe(),le=f(ie,pe,De.i));const K=de(De);if(K)Oe(),le=ie[pe]=K.apply(le,N(De));else if(De.e!==void 0)throw Error("Subtype "+De.et+" undefined")}else le=R(le,De)}return H.root}(y=function X(Y,W){const le=[];let oe=0;for(;oe<W.length;oe++){const pe=W[oe];if(Array.isArray(pe))break;typeof pe!="object"&&(le.push(Y),Y=R(Y,pe))}for(let pe=W.length-1;pe>=oe;pe--)Y=X(Y,W[pe]);for(--oe;oe>=0;oe--){const pe=W[oe];if(typeof pe!="object"){const Oe=le.pop();Y=Y===R(Oe,pe)?Oe:Y===void 0?d(Oe,pe):(te=pe,ie=Y,(H=u(H=Oe))[te]=ie,H)}else c(pe)&&(o(Y!==void 0,"Cannot pick up or remove undefined"),pe.p!=null&&(G[pe.p]=Y),Y=void 0)}var H,te,ie;return Y}(y,F),F)}function B(y,F){y=y.slice(),fe(F);const G=s.readCursor(F);let X,Y,W=!1;const le=[];for(let H=0;;H++){const te=y[H],ie=G.getComponent();if(ie&&(ie.r!==void 0?W=!0:ie.p!=null&&(W=!1,X=ie.p,Y=H)),H>=y.length)break;let pe=0;const Oe=s.advancer(G,void 0,(K,Re)=>{c(Re)&&pe++});le.unshift(Oe);const De=Oe(te);if(typeof te=="number"&&(y[H]-=pe),!De)break}if(le.forEach(H=>H.end()),W)return null;const oe=()=>{let H=0;if(X!=null){const te=G.getPath();H=te.length,y=te.concat(y.slice(Y))}for(;H<y.length;H++){const te=y[H],ie=a(G),pe=de(ie);if(pe){const K=N(ie);pe.transformPosition&&(y[H]=pe.transformPosition(y[H],K));break}let Oe=0;const De=s.advancer(G,(K,Re)=>h(Re)?~(K-Oe):K-Oe,(K,Re)=>{h(Re)&&Oe++})(te);if(typeof te=="number"&&(y[H]+=Oe),!De)break}};return X!=null?G.eachDrop(null,H=>{H===X&&oe()}):oe(),y}function S(y,F){if(fe(y),fe(F),y==null)return F;if(F==null)return y;let G=0;const X=s.readCursor(y),Y=s.readCursor(F),W=s.writeCursor(),le=[],oe=[],H=[],te=[],ie=[],pe=[],Oe=new Set;X.traverse(null,K=>{K.p!=null&&(H[K.p]=X.clone())}),Y.traverse(null,K=>{K.d!=null&&(te[K.d]=Y.clone())});const De=s.writeCursor();return function K(Re,Ve,Be,Le,Je,Rt,Ge,tt){o(Ve||Be);const Ke=a(Ve),ct=a(Be),ot=!!ct&&ct.r!==void 0,kt=!!Ke&&Ke.i!==void 0,Fe=Ke?Ke.d:null,ht=ct?ct.p:null,_=(Rt||ot)&&ht==null;if(ht!=null)Le=te[ht],Ge=oe[ht]=new s.WriteCursor;else if(ct&&ct.r!==void 0)Le=null;else{const x=a(Le);x&&x.d!=null&&(Le=null)}const g=a(Le);if(Fe!=null)if(Re=H[Fe],tt=le[Fe]=new s.WriteCursor,_)Rt&&!ot&&tt.write("r",!0);else{const x=ie[Fe]=G++;Ge.write("d",x)}else if(Ke&&Ke.i!==void 0)Re=null;else{const x=a(Re);x&&x.p!=null&&(Re=null)}let p;kt?(o(Je===void 0),p=Ke.i):p=Je;const b=(ht==null?!kt||Rt||ot:p===void 0)?null:Ge.getComponent();if(ht!=null){if(!(Je!==void 0||kt)){const x=Fe!=null?ie[Fe]:G++;pe[ht]=x,tt.write("p",x)}}else ot&&(kt||Je!==void 0||(ct.r,tt.write("r",ct.r)));const T=_?null:de(Ke),U=de(g);if((T||U)&&(T&&T.name,U&&U.name),T&&U){o(T===U);const x=N(Ke),ee=N(g),Ce=T.compose(x,ee);A(Ge,T,Ce),Oe.add(g)}else T?A(Ge,T,N(Ke)):U&&(A(Ge,U,N(g)),Oe.add(g));const L=typeof p=="object"&&p!=null;let P=!1,I=0,Z=0,_e=0,J=0,me=0;const Se=s.advancer(Le,(x,ee)=>h(ee)?J-x-1:x-J,(x,ee)=>{h(ee)&&J++}),ue=s.advancer(Re,(x,ee)=>c(ee)?I-x-1:x-I,(x,ee)=>{c(ee)&&I++});if(s.eachChildOf(Ve,Be,(x,ee,Ce)=>{let Ae,Ue,ke=x,je=x,dt=x;if(typeof x=="number"){let Me=x+_e;Ue=Se(Me),je=Me+J;let re=x+Z;Ae=ue(re),h(a(Ue))&&(Ae=null),ke=re+I,dt=x+me,o(ke>=0,"p1PickKey is negative"),o(je>=0,"p2DropKey is negative");const at=h(a(ee)),He=c(a(Ce));(at||He&&!_)&&me--,at&&Z--,He&&_e--}else Ae=ue(x),Ue=Se(x);tt.descend(ke),Ge.descend(je);const ft=L&&!h(a(ee))?p[dt]:void 0,Ee=K(Ae,ee,Ce,Ue,ft,_,Ge,tt);var et,ve,ye;L&&!_?ft!==Ee&&(P||(p=Array.isArray(p)?p.slice():Object.assign({},p),P=!0),et=p,ye=Ee,typeof(ve=dt)=="number"?(o(Array.isArray(et)),o(ve<et.length)):(o(!Array.isArray(et)),o(et[ve]!==void 0)),ye===void 0?typeof ve=="number"?et.splice(ve,1):delete et[ve]:et[ve]=ye):o(Ee===void 0),Ge.ascend(),tt.ascend()}),ue.end(),Se.end(),b!=null)b.i=p;else if(!Rt&&!ot&&ht==null)return p}(X,X.clone(),Y,Y.clone(),void 0,!1,W,De),W.reset(),W.mergeTree(De.get()),W.reset(),W.get(),le.map(K=>K.get()),oe.map(K=>K.get()),X.traverse(W,(K,Re)=>{const Ve=K.p;if(Ve!=null){const Be=ie[Ve];Be!=null&&Re.write("p",Be);const Le=le[Ve];Le&&Le.get(),Le&&Re.mergeTree(Le.get())}else K.r!==void 0&&Re.write("r",K.r)}),W.reset(),W.get(),Y.traverse(W,(K,Re)=>{const Ve=K.d;if(Ve!=null){const Le=pe[Ve];Le!=null&&Re.write("d",Le);const Je=oe[Ve];Je&&Re.mergeTree(Je.get())}else K.i!==void 0&&Re.write("i",K.i);const Be=de(K);Be&&!Oe.has(K)&&A(Re,Be,N(K))}),W.get()}function D(y){if(y==null)return null;const F=new s.ReadCursor(y),G=new s.WriteCursor;let X;const Y=[],W=[];return function le(oe,H,te){const ie=oe.getComponent();let pe,Oe=!1;if(ie){ie.p!=null&&(H.write("d",ie.p),Y[ie.p]=oe.clone()),ie.r!==void 0&&H.write("i",ie.r),ie.d!=null&&(H.write("p",ie.d),te=void 0),ie.i!==void 0&&(te=pe=ie.i);const K=de(ie);K&&(te===void 0?(X||(X=new Set),X.add(ie)):(N(ie),te=K.apply(te,N(ie)),Oe=!0))}let De=0;for(const K of oe){H.descend(K);const Re=typeof K=="number"?K-De:K,Ve=R(te,Re);h(oe.getComponent())&&De++;const Be=le(oe,H,Ve);if(te!==void 0&&Be!==void 0){if(Oe||(Oe=!0,te=u(te)),!C(te,Re))throw Error("Cannot modify child - invalid operation");te[Re]=Be}H.ascend()}if(pe===void 0)return Oe?te:void 0;H.write("r",te)}(F,G,void 0),X&&(G.reset(),function le(oe,H,te){const ie=H.getComponent();if(ie){const K=ie.d;if(K!=null&&(oe=Y[K],te=W[K]=s.writeCursor()),X.has(ie)){const Re=de(ie);if(!Re.invert)throw Error(`Cannot invert subtype ${Re.name}`);A(te,Re,Re.invert(N(ie)))}}let pe=0,Oe=0;const De=s.advancer(oe,(K,Re)=>c(Re)?pe-K-1:K-pe,(K,Re)=>{c(Re)&&pe++});for(const K of H)if(typeof K=="number"){const Re=K-Oe,Ve=De(Re),Be=Re+pe;te.descend(Be),le(Ve,H,te),h(H.getComponent())&&Oe++,te.ascend()}else te.descend(K),le(De(K),H,te),te.ascend();De.end()}(F.clone(),F,G),W.length&&(G.reset(),F.traverse(G,(le,oe)=>{const H=le.p;if(H!=null){const te=W[H];te&&te.get(),te&&oe.mergeTree(te.get())}}))),G.get()}const O=(y,F)=>y.some(G=>typeof G=="object"&&(Array.isArray(G)?O(G,F):F(G)));function w(y,F){if(y==null||!O(y,H=>{var te;return H.r!==void 0||((te=de(H))===null||te===void 0?void 0:te.makeInvertible)!=null}))return y;const G=new s.ReadCursor(y),X=new s.WriteCursor;let Y=!1;const W=[],le=[],oe=(H,te,ie)=>{const pe=H.getComponent();let Oe=!1;if(pe){pe.d!=null&&te.write("d",pe.d),pe.i!==void 0&&te.write("i",pe.i);const K=pe.p;if(K!=null&&(W[K]=H.clone(),o(ie!==void 0,"Operation picks up at an invalid key"),le[K]=ie,te.write("p",pe.p)),pe.r!==void 0&&ie===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Re=de(pe);Re&&(Re.makeInvertible?Y=!0:A(te,Re,N(pe),!0))}let De=0;for(const K of H){te.descend(K);const Re=typeof K=="number"?K-De:K,Ve=R(ie,Re),Be=oe(H,te,Ve);Ve!==Be&&(Oe||(Oe=!0,ie=u(ie)),Be===void 0?(ie=d(ie,Re),typeof K=="number"&&De++):ie[Re]=Be),te.ascend()}return pe&&(pe.r!==void 0?(te.write("r",r.default(ie)),ie=void 0):pe.p!=null&&(ie=void 0)),ie};return oe(G,X,F),X.get(),Y&&(X.reset(),function H(te,ie,pe,Oe,De){const K=ie.getComponent();if(K){K.i!==void 0?(Oe=K.i,De=!0):K.d!=null&&(Oe=le[K.d],te=W[K.d],De=!1,K.d);let Le=de(K);if(Le&&Le.makeInvertible){const Je=N(K);A(pe,Le,Le.makeInvertible(Je,Oe),!0)}}let Re=0,Ve=0;const Be=s.advancer(te,(Le,Je)=>c(Je)?Re-Le-1:Le-Re,(Le,Je)=>{c(Je)&&Re++});for(const Le of ie)if(typeof Le=="number"){const Je=Le-Ve,Rt=Be(Je),Ge=Je+Re,tt=R(Oe,De?Je:Ge);pe.descend(Le),H(Rt,ie,pe,tt,De),h(ie.getComponent())&&Ve++,pe.ascend()}else{const Je=R(Oe,Le);pe.descend(Le),H(Be(Le),ie,pe,Je,De),pe.ascend()}Be.end()}(G.clone(),G,X,F,!1)),X.get()}function k(y,F){return D(w(y,F))}const $=y=>{if(y==null)return null;const F=y.slice();for(let G=0;G<y.length;G++){const X=F[G];Array.isArray(X)&&(F[G]=$(X))}return F};function V(y,F,G){o(G==="left"||G==="right","Direction must be left or right");const X=G==="left"?0:1;if(F==null)return{ok:!0,result:y};fe(y),fe(F);let Y=null;const W=[],le=[],oe=[],H=[],te=[],ie=[],pe=[],Oe=[],De=[],K=[],Re=[],Ve=[],Be=[],Le=[],Je=[];let Rt=0;const Ge=s.readCursor(y),tt=s.readCursor(F),Ke=s.writeCursor();if(function g(p,b=null,T){const U=a(b);U&&(U.r!==void 0?T=b.clone():U.p!=null&&(T=null,ie[U.p]=p.clone()));const L=p.getComponent();let P;L&&(P=L.p)!=null&&(te[P]=b?b.clone():null,oe[P]=p.clone(),T&&(K[P]=!0,De[P]=T),U&&U.p!=null&&(Le[P]=U.p));const I=s.advancer(b);for(const Z of p)g(p,I(Z),T);I.end()}(tt,Ge,null),function g(p,b,T,U,L){const P=T.getComponent();let I,Z=!1;P&&((I=P.d)!=null?(H[I]=T.clone(),U!=null&&(Je[U]==null&&(Je[U]=[]),Je[U].push(I)),K[I],p=te[I]||null,b=oe[I]||null,K[I]?(L&&(Re[I]=!0),L=De[I]||null):!L||X!==1&&Le[I]!=null||Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.moveOp(b.getPath(),T.getPath())}),Z=!0):P.i!==void 0&&(p=b=null,Z=!0,L&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.insertOp(T.getPath(),P.i)})));const _e=a(p);_e&&(_e.r!==void 0?L=p.clone():_e.p!=null&&(_e.p,U=_e.p,L=null));const J=de(P);J&&L&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.editOp(T.getPath(),J,N(P),!0)});let me=0,Se=0;const ue=s.advancer(b,(ee,Ce)=>c(Ce)?me-ee-1:ee-me,(ee,Ce)=>{c(Ce)&&me++}),x=s.advancer(p);for(const ee of T)if(typeof ee=="number"){const Ce=ee-Se,Ae=ue(Ce);Se+=+g(x(Ce+me),Ae,T,U,L)}else{const Ce=ue(ee);g(x(ee),Ce,T,U,L)}return ue.end(),x.end(),Z}(Ge,tt,tt.clone(),null,null),H.map(g=>g&&g.get()),Y)return{ok:!1,conflict:Y};Re.map(g=>!!g);const ct=[];let ot=null;(function g(p,b,T,U,L){let P=!1;const I=a(b);if(c(I)){const ue=I.p;ue!=null?(T=H[ue],U=Ve[ue]=s.writeCursor(),P=!0,L=null):(T=null,L=b.clone())}else h(a(T))&&(T=null);const Z=p.getComponent();if(Z){const ue=Z.p;ue!=null?(L&&(Oe[ue]=L),ct[ue]=L||X===1&&P?null:U.getComponent(),W[ue]=p.clone(),T&&(pe[ue]=T.clone())):Z.r!==void 0&&(L||U.write("r",!0),(L||P)&&(ot==null&&(ot=new Set),ot.add(Z)))}let _e=0,J=0;const me=s.advancer(b,void 0,(ue,x)=>{c(x)&&_e++}),Se=s.advancer(T,(ue,x)=>h(x)?~(ue-J):ue-J,(ue,x)=>{h(x)&&J++});if(p)for(const ue of p)if(typeof ue=="string"){const x=me(ue),ee=Se(ue);U.descend(ue),g(p,x,ee,U,L),U.ascend()}else{const x=me(ue),ee=ue-_e,Ce=c(a(x))?null:Se(ee),Ae=ee+J;o(Ae>=0),U.descend(Ae),g(p,x,Ce,U,L),U.ascend()}me.end(),Se.end()})(Ge,tt,tt.clone(),Ke,null),Ke.reset();let kt=[];if(function g(p,b,T,U,L,P){o(b);const I=b.getComponent();let Z=a(U),_e=!1;const J=(ve,ye,Me)=>ve?e.moveOp(ve.getPath(),ye.getPath()):e.insertOp(ye.getPath(),Me.i);if(h(I)){const ve=I.d;ve!=null&&(le[ve]=b.clone());const ye=ve!=null?ct[ve]:null;let Me=!1;if(I.i!==void 0||ve!=null&&ye){let re;Z&&(Z.i!==void 0||(re=Z.d)!=null&&!K[re])&&(Me=re!=null?ve!=null&&ve===Le[re]:n.default(Z.i,I.i),Me||re!=null&&X!==1&&Le[re]!=null||Y==null&&(Y={type:i.ConflictType.DROP_COLLISION,op1:J(ve!=null?W[ve]:null,b,I),op2:J(re!=null?oe[re]:null,U,Z)})),Me||(P?Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:J(ve!=null?W[ve]:null,b,I),op2:e.removeOp(P.getPath())}):(ve!=null?(kt[Rt]=ve,L.write("d",ye.p=Rt++)):L.write("i",r.default(I.i)),_e=!0))}else if(ve!=null&&!ye){const re=Oe[ve];re&&(P=re.clone())}ve!=null?(p=W[ve],T=ie[ve],U=pe[ve]):I.i!==void 0&&(p=T=null,Me||(U=null))}else c(a(p))&&(p=T=U=null);const me=a(p),Se=a(T);if(c(Se)){const ve=Se.p;Se.r!==void 0&&(!me||me.r===void 0)||K[ve]?(U=null,P=T.clone()):ve!=null&&(U=H[ve],X!==1&&Le[ve]!=null||((L=Be[ve])||(L=Be[ve]=s.writeCursor()),L.reset(),P=null))}else!h(I)&&h(Z)&&(U=null);Z=U!=null?U.getComponent():null;const ue=de(I);if(ue){const ve=N(I);if(P)Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(b.getPath(),ue,ve,!0),op2:e.removeOp(P.getPath())});else{const ye=de(Z);let Me;if(ye){if(ue!==ye)throw Error("Transforming incompatible types");const re=N(Z);Me=ue.transform(ve,re,G)}else Me=r.default(ve);A(L,ue,Me)}}let x=0,ee=0,Ce=0,Ae=0,Ue=0,ke=0,je=p!=null&&p.descendFirst(),dt=je;const ft=s.advancer(T,void 0,(ve,ye)=>{c(ye)&&Ce++});let Ee=U!=null&&U.descendFirst(),et=Ee;for(const ve of b)if(typeof ve=="number"){let ye;const Me=h(b.getComponent()),re=ve-ee;{let Xt;for(;je&&typeof(Xt=p.getKey())=="number";){Xt+=x;const Ot=p.getComponent(),Cn=c(Ot);if(Xt>re||Xt===re&&(!Cn||X===0&&Me))break;if(Cn){x--;const un=Ot.p;Le.includes(un),Ot.d,a(Be[Ot.d]),c(a(Be[Ot.d])),(Ot.r===void 0||ot&&ot.has(Ot))&&(un==null||!ct[un]||X!==1&&Le.includes(un))||Ue--}je=p.nextSibling()}ye=je&&Xt===re?p:null}const at=re-x;let He=ft(at);const Dt=at-Ce;let Sr=null;{let Xt,Ot;for(;Ee&&typeof(Xt=U.getKey())=="number";){Ot=Xt-Ae;const Cn=U.getComponent(),un=h(Cn);if(Ot>Dt)break;if(Ot===Dt){if(!un){Sr=U;break}{if(X===0&&Me){Sr=U;break}const Qt=He&&c(He.getComponent());if(X===0&&Qt)break}}if(un){const Qt=Cn.d;K[Qt],Le[Qt],Cn.i===void 0&&(K[Qt]||Le[Qt]!=null&&X!==1)?(K[Qt]||Le[Qt]!=null&&X===0)&&(Ae++,ke--):Ae++}Ee=U.nextSibling()}}const bo=Dt+Ae+Ue+ke;o(bo>=0,"trying to descend to a negative index"),L.descend(bo),Me&&(ye=He=Sr=null,ee++),g(ye,b,He,Sr,L,P)&&ke++,L.ascend()}else{let ye;for(;je&&(ye=p.getKey(),typeof ye!="string"||!(ye>ve||ye===ve));)je=p.nextSibling();const Me=je&&ye===ve?p:null,re=ft(ve);let at;for(;Ee&&(at=U.getKey(),typeof at!="string"||!(at>ve||at===ve));)Ee=U.nextSibling();const He=Ee&&at===ve?U:null;L.descend(ve),g(Me,b,re,He,L,P),L.ascend()}return ft.end(),dt&&p.ascend(),et&&U.ascend(),_e}(Ge,Ge.clone(),tt,tt.clone(),Ke,null),Y)return{ok:!1,conflict:Y};Ke.reset();const Fe=(g,p,b)=>g.traverse(p,(T,U)=>{T.d!=null&&b(T.d,g,U)});(K.length||Ve.length)&&(Fe(tt,Ke,(g,p,b)=>{K[g]&&!Re[g]&&b.write("r",!0),Ve[g]&&b.mergeTree(Ve[g].get())}),Ke.reset());const ht=[],_=[];if((Be.length||K.length)&&!Y){const g=s.readCursor($(Ke.get()));if(Fe(g,null,(p,b)=>{ht[p]=b.clone()}),Be.forEach(p=>{p&&Fe(s.readCursor(p.get()),null,(b,T)=>{ht[b]=T.clone()})}),function p(b,T,U,L,P,I){const Z=a(T);if(Z&&c(Z))if(Z.p!=null){const x=Z.p;ht[x].getPath(),U=ht[x],L=_[x]=s.writeCursor()}else Z.r!==void 0&&(U=null);else h(a(U))&&(U=null);const _e=b.getComponent();if(_e){let x;if((x=_e.d)!=null){const ee=Be[x];ee&&(ee.get(),L.mergeTree(ee.get()),U=s.readCursor(ee.get()))}}let J=0,me=0;const Se=s.advancer(T,void 0,(x,ee)=>{c(ee)&&J--}),ue=s.advancer(U,(x,ee)=>h(ee)?-(x-me)-1:x-me,(x,ee)=>{h(ee)&&me++});for(const x of b)if(typeof x=="number"){const ee=Se(x),Ce=x+J,Ae=ue(Ce),Ue=Ce+me;L.descend(Ue),p(b,ee,Ae,L),L.ascend()}else L.descend(x),p(b,Se(x),ue(x),L),L.ascend();Se.end(),ue.end()}(tt,g,g.clone(),Ke),Ke.reset(),Y)return{ok:!1,conflict:Y};if(Ke.get(),_.length){const p=_.map(T=>T?T.get():null),b=s.readCursor($(Ke.get()));if(Fe(b,Ke,(T,U,L)=>{const P=p[T];P&&(L.mergeTree(P),p[T]=null)}),p.find(T=>T)){const T=s.writeCursor(),U=s.writeCursor();let L=0,P=0;p.forEach(I=>{I!=null&&Fe(s.readCursor(I),null,Z=>{const _e=kt[Z];T.writeMove(W[_e].getPath(),le[_e].getPath(),L++);const J=Je[_e];J&&J.forEach(me=>{K[me]||X!==1&&Le[me]!=null||U.writeMove(oe[me].getPath(),H[me].getPath(),P++)})})}),Y={type:i.ConflictType.BLACKHOLE,op1:T.get(),op2:U.get()}}}}return Y?{ok:!1,conflict:Y}:{ok:!0,result:Ke.get()}}const se=y=>{const F=new Error("Transform detected write conflict");throw F.conflict=y,F.type=F.name="writeConflict",F};function he(y,F,G){const X=V(y,F,G);if(X.ok)return X.result;se(X.conflict)}const ge=y=>{const F=s.writeCursor();return s.readCursor(y).traverse(F,(G,X)=>{(h(G)||de(G))&&X.write("r",!0)}),F.get()},Te=(y,F)=>{const{type:G,op1:X,op2:Y}=y;switch(G){case i.ConflictType.DROP_COLLISION:return F==="left"?[null,ge(Y)]:[ge(X),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(X).traverse(null,le=>{le.r!==void 0&&(W=!0)}),W?[null,ge(Y)]:[ge(X),null];case i.ConflictType.BLACKHOLE:return[ge(X),ge(Y)];default:throw Error("Unrecognised conflict: "+G)}};function be(y,F,G,X){let Y=null;for(;;){const W=V(F,G,X);if(W.ok)return S(Y,W.result);{const{conflict:le}=W;y(le)||se(le);const[oe,H]=Te(le,X);F=S(ae(F),oe),G=S(ae(G),H),Y=S(Y,H)}}}}(Nr)),Nr}var Ta;function D_(){return Ta||(Ta=1,function(e){var t=Qn.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=Qn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(M_(),e);var r=Vu();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Gu();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(Qn)),Qn}var gt=D_();const x_=wt(gt),L_=ch({__proto__:null,default:x_},[gt]);var ce=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(ce||{});function yr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&ne.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();iu(r,a)&&ne.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Ku(e,t,n,r){var u;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(u=t.textRuns)!=null?u:[];if(l.length)for(const c of l)c.st+=r,c.ed+=r;for(let c=0;c<o;c++){const h=s[c],{st:d,ed:f}=h;if(f<=r)i.push(h);else if(r>d&&r<f){a=!0;const C={...h,ed:r};i.push(C),l.length&&i.push(...l);const R={...h,st:r+n,ed:f+n};i.push(R)}else h.st+=n,h.ed+=n,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=yr(i)}function Xu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,u=s.length;l<u;l++){const c=s[l],{startIndex:h}=c;h>=r&&(c.startIndex+=n),o.push(c.startIndex)}let a=-1;if(i){for(let l=0,u=i.length;l<u;l++){const c=i[l];c.startIndex+=r;const h=c.startIndex;a=o.indexOf(h)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(Rr("startIndex"))}}function Qu(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Rr("startIndex"))}}function Ju(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Rr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function qu(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u,endIndex:c}=l;u>r?(l.startIndex+=n,l.endIndex+=n):c>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(Rr("startIndex"))}}const Zu="$",Na=e=>e.split(Zu)[0];function co(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=Na(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Na(i.rangeId),i.rangeId===n.rangeId&&Dl(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${Zu}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function gi(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function ec(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function pi(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function U_(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;gi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=co(s)}function P_(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;pi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:u}=l;u>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=ec(s)}function tc(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const c=r[l],{st:h,ed:d}=c;if(s<=h&&i>=d){o.push({...c,st:h-s,ed:d-s});continue}else h<=s&&d>=i?(o.push({...c,st:s-s,ed:i-s}),c.ed-=t):s>=h&&s<d?(o.push({...c,st:s-s,ed:d-s}),c.ed=s):i>h&&i<=d?(o.push({...c,st:h-s,ed:i-s}),c.st=i-t,c.ed-=t):h>=i&&(c.st-=t,c.ed-=t);a.push(c)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function nc(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const c=r[l],{startIndex:h}=c;if(h>=s&&h<i){o.push({...c,startIndex:h-n});continue}else h>=i&&(c.startIndex-=t);a.push(c)}e.paragraphs=a}return o}function rc(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const c=r[l],{startIndex:h}=c;if(h>=s&&h<=i){o.push({...c,startIndex:h-n});continue}else h>i&&(c.startIndex-=t);a.push(c)}e.sectionBreaks=a}return o}function sc(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const c=r[l],{startIndex:h}=c;if(h>=s&&h<=i){o.push({...c,startIndex:h-n});continue}else h>i&&(c.startIndex-=t);a.push(c)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function ic(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const c=r[l],{startIndex:h,endIndex:d}=c;if(s<=h&&i>=d){o.push({...c,startIndex:h-n,endIndex:d-n});continue}else if(h<=s&&d>=i){const f=vs(h,d,s,i);if(f.length===0||(c.startIndex=f[0],c.endIndex=f[1],c.startIndex===c.endIndex))continue}else i<h&&(c.startIndex-=t,c.endIndex-=t);a.push(c)}e.tables=a}return o}function k_(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,u=r.length;l<u;l++){const c=r[l],{startIndex:h,endIndex:d}=c;if(h>=s&&d<=i){o.push(c);continue}else if(Math.max(s,h)<=Math.min(i,d)){const f=vs(h,d,s,i);if(f.length===0)continue;c.startIndex=f[0],c.endIndex=f[1]}else i<h&&(c.startIndex-=t,c.endIndex-=t);a.push(c)}e.customRanges=co(a)}return o}function F_(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let u=0,c=s.length;u<c;u++){const h=s[u],{startIndex:d,endIndex:f}=h;if(d>=i&&f<=o){a.push(h);continue}else if(Math.max(i,d)<=Math.min(o,f)){const C=vs(d,f,i,o);if(C.length===0)continue;h.startIndex=C[0],h.endIndex=C[1]}else o<d&&r&&(h.startIndex-=t,h.endIndex-=t);l.push(h)}e.customDecorations=l}return a}var oc=(e=>(e.ORDER_LIST_QUICK_1="1.",e.ORDER_LIST_QUICK_2="a)",e.ORDER_LIST_QUICK_3="a.",e.ORDER_LIST_QUICK_4="i.",e.ORDER_LIST_QUICK_5="A.",e.ORDER_LIST_QUICK_6="I.",e.ORDER_LIST_QUICK_7="01.",e))(oc||{}),Ut=(e=>(e.BULLET_LIST="BULLET_LIST",e.BULLET_LIST_1="BULLET_LIST_1",e.BULLET_LIST_2="BULLET_LIST_2",e.BULLET_LIST_3="BULLET_LIST_3",e.BULLET_LIST_4="BULLET_LIST_4",e.BULLET_LIST_5="BULLET_LIST_5",e.ORDER_LIST="ORDER_LIST",e.ORDER_LIST_1="ORDER_LIST_1",e.ORDER_LIST_2="ORDER_LIST_2",e.ORDER_LIST_3="ORDER_LIST_3",e.ORDER_LIST_4="ORDER_LIST_4",e.ORDER_LIST_5="ORDER_LIST_5",e.ORDER_LIST_QUICK_2="ORDER_LIST_QUICK_2",e.ORDER_LIST_QUICK_3="ORDER_LIST_QUICK_3",e.ORDER_LIST_QUICK_4="ORDER_LIST_QUICK_4",e.ORDER_LIST_QUICK_5="ORDER_LIST_QUICK_5",e.ORDER_LIST_QUICK_6="ORDER_LIST_QUICK_6",e.CHECK_LIST="CHECK_LIST",e.CHECK_LIST_CHECKED="CHECK_LIST_CHECKED",e))(Ut||{});const Lr={"a)":{glyphFormat:"%1)",glyphType:Ne.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Ne.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Ne.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Ne.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER}},Rn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:Ir.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),In=e=>e.map((t,n)=>({...t,bulletAlignment:Ir.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Ma=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:Ir.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),vr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Rn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Rn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Rn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Rn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Rn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Rn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:In([{glyphFormat:"%1.",glyphType:Ne.DECIMAL},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.DECIMAL},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.DECIMAL},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:In([{glyphFormat:"%1)",glyphType:Ne.DECIMAL},{glyphFormat:"%2)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Ne.DECIMAL},{glyphFormat:"%5)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Ne.DECIMAL},{glyphFormat:"%8)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:In(["%1.","%1.%2.","%1.%2.%3.","%1.%2.%3.%4.","%1.%2.%3.%4.%5.","%1.%2.%3.%4.%5.%6.","%1.%2.%3.%4.%5.%6.%7."].map(e=>({glyphFormat:e,glyphType:Ne.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:In([{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:In([{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Ne.DECIMAL},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Ne.DECIMAL},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Ne.DECIMAL},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:In([{glyphFormat:"%1.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:Ma("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Ma("☑",{st:{s:Ie.TRUE}})}},Ur=e=>{const{glyphFormat:t,glyphType:n}=e,r=ne.deepClone(vr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},$_={ORDER_LIST_QUICK_2:Ur(Lr["a)"]),ORDER_LIST_QUICK_3:Ur(Lr["a."]),ORDER_LIST_QUICK_4:Ur(Lr["i."]),ORDER_LIST_QUICK_6:Ur(Lr["I."])};Object.assign(vr,$_);const H_={"1.":"ORDER_LIST","a)":"ORDER_LIST_QUICK_2","a.":"ORDER_LIST_QUICK_3","i.":"ORDER_LIST_QUICK_4","A.":"ORDER_LIST_3","I.":"ORDER_LIST_QUICK_6","01.":"ORDER_LIST_5"};function B_(e,t,n,r,s){const i=j_(e,t,n,r,s),o=W_(e,t,n,r,s),a=Y_(e,t,n,r,s),l=z_(e,t,n,r,s),u=V_(e,t,n,r,s),c=G_(e,t,n,r),h=K_(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:u,customRanges:c,customDecorations:h}}function j_(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=tc(e,n,r);if(s!==Pe.REPLACE){const l=ac(o,a,s);t.textRuns=l}return Ku(e,t,n,r),a}function ac(e,t,n){if(t.length===0)return e;e=ne.deepClone(e),t=ne.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function u(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:f,ed:C,ts:R}=e[o],{st:v,ed:M,ts:Q,sId:z}=t[a];let de;if(n===Pe.COVER?de={...Q,...R}:de={...R},C<v)u()||r.push(e[o]),o++;else if(M<f)u()||r.push(t[a]),a++;else{const N={st:Math.min(f,v),ed:Math.max(f,v),ts:f<v?{...R}:{...Q},sId:f<v?void 0:z};N.ed>N.st&&r.push(N),r.push({st:Math.max(f,v),ed:Math.min(C,M),ts:de,sId:z}),C<M?(o++,t[a].st=C,t[a].st===t[a].ed&&a++):(a++,e[o].st=M,e[o].st===e[o].ed&&o++);const A={st:Math.min(C,M),ed:Math.max(C,M),ts:C<M?{...Q}:{...R},sId:C<M?z:void 0};l=A.ed>A.st?A:null}}u();const c=r[r.length-1],h=e[s-1],d=t[i-1];return c&&c.ed!==Math.max(h.ed,d.ed)&&(h.ed>d.ed?r.push(h):r.push(d)),yr(r)}function W_(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=nc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:c,paragraphStyle:h,bullet:d}=u;let f=[];for(const C of a){const{startIndex:R,paragraphStyle:v,bullet:M}=C;let Q,z;if(s===Pe.COVER?(Q={...v,...h},z={listId:"",listType:Ut.BULLET_LIST,nestingLevel:0,textStyle:{},...M,...d}):(Q={...h,...v},z={listId:"",listType:Ut.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...M}),c===R){f.push({startIndex:c,paragraphStyle:Q,bullet:z});break}}l.push(...f),f=[]}t.paragraphs=l}return Xu(e,t,n,r),a}function Y_(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=rc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:c}=u;let h=[];for(const d of a){const{startIndex:f}=d;if(c===f){s===Pe.COVER?h.push({...d,...u}):h.push({...u,...d});break}}l.push(...h),h=[]}t.sectionBreaks=l}return Qu(e,t,n,r),a}function z_(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=sc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:c}=u;let h=[];for(const d of a){const{startIndex:f}=d;if(c===f){s===Pe.COVER?h.push({...d,...u}):h.push({...u,...d});break}}l.push(...h),h=[]}t.customBlocks=l}return Ju(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function V_(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=ic(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:c,endIndex:h}=u;let d=[];for(const f of a){const{startIndex:C,endIndex:R}=f;if(C>=c&&R<=h){s===Pe.COVER?d.push({...f,...u}):d.push({...u,...f});break}}l.push(...d),d=[]}t.tables=l}return qu(e,t,n,r),a}function G_(e,t,n,r,s){e.customRanges||(e.customRanges=[]),gi(e.customRanges,r),gi(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],u=new Map;e.customRanges.forEach(h=>{const{startIndex:d,endIndex:f}=h;d>=i&&f<=o?u.set(h.rangeId,h):l.push(h)});const c=[];return a?(a.forEach(h=>{const{startIndex:d,endIndex:f}=h;l.push({...h,startIndex:d+r,endIndex:f+r})}),e.customRanges=co(l),c):[]}function K_(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),pi(e.customDecorations,r),pi(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Pe.REPLACE){for(let l=0;l<o.length;l++){const u=o[l],{startIndex:c,endIndex:h}=u;c>=r&&h<=r+n-1&&i.push(u)}a.forEach(l=>{const{startIndex:u,endIndex:c}=l;o.push({...l,startIndex:u+r,endIndex:c+r})})}else for(const l of a){const{id:u}=l;if(l.type===fn.DELETED){const c=o.filter(h=>h.id===u);c.length&&i.push(...c)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:u}=l,c=o.findIndex(h=>h.id===u);c!==-1&&o.splice(c,1)}return e.customDecorations=ec(o),i}var ho=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(ho||{});function us(e,t,n,r=!0){const{textRuns:s}=e;if(s){const i=[];for(const o of s){const a=ne.deepClone(o),{st:l,ed:u}=a;ne.hasIntersectionBetweenTwoRanges(l,u,t,n)&&(t>=l&&t<=u?i.push({...a,st:t,ed:Math.min(n,u)}):n>=l&&n<=u?i.push({...a,st:Math.max(t,l),ed:n}):i.push(a))}return yr(i.map(o=>{const{st:a,ed:l}=o;return{...o,st:a-t,ed:l-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function lc(e,t,n){const{tables:r=[]}=e,s=[];for(const i of r){const o=ne.deepClone(i),{startIndex:a,endIndex:l}=o;a>=t&&l<=n&&s.push({...o,startIndex:a-t,endIndex:l-t})}return s}function uc(e,t,n){const{paragraphs:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<n&&s.push(ne.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function X_(e,t,n){const{sectionBreaks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(ne.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function cc(e,t,n){const{customBlocks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(ne.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function Nt(e,t,n,r=!0,s=1){const{dataStream:i}=e,o={dataStream:i.slice(t,n)};o.textRuns=us(e,t,n,r);const a=lc(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=uc(e,t,n),s===1){const u=dc(e,t,n);u?o.customDecorations=u:r&&(o.customDecorations=[])}const{customRanges:l}=hc(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=cc(e,t,n),o}function Q_(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(c=>{c.startIndex<0&&(a=Math.max(a,-c.startIndex)),c.endIndex>t.length-1&&(l=Math.max(l,c.endIndex-t.length+1))});const u=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(c=>{c.st+=a,c.ed+=a}),r==null||r.forEach(c=>{c.startIndex+=a}),s==null||s.forEach(c=>{c.startIndex+=a,c.endIndex+=a}),i==null||i.forEach(c=>{c.startIndex+=a,c.endIndex+=l}),o==null||o.forEach(c=>{c.startIndex+=a,c.endIndex+=l}),{...e,dataStream:u,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function hc(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function dc(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=ne.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function J_(e,t,n){return e==null||t==null?e!=null?e:t:ac(e,t,n)}function q_(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Pe.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function Z_(e,t,n){return t.length===0||e.length===0||n===Pe.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function mi(e,t,n=Pe.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:u=[],customRanges:c,customDecorations:h=[]}=t;r.textRuns=J_(l,s,n),r.customRanges=q_(c,o,n);const d=Z_(h,a,n);d.length&&(r.customDecorations=d);const f=[];let C=0,R=0;for(;C<i.length&&R<u.length;){const v=i[C],M=u[R],{startIndex:Q}=v,{startIndex:z}=M;Q===z?(f.push(ne.deepMerge(v,M)),C++,R++):Q<z?(f.push(ne.deepClone(v)),C++):(f.push(ne.deepClone(M)),R++)}return C<i.length&&f.push(...i.slice(C)),R<u.length&&f.push(...u.slice(R)),f.length&&(r.paragraphs=f),r}function eE(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class vn{constructor(t){E(this,"_index",0);E(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===ce.DELETE||n.t===ce.RETAIN&&n.body==null?ne.deepClone({...n,len:t}):ne.deepClone({...n,len:t,body:Nt(n.body,r,r+t,!1)})}else return{t:ce.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:ce.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}class Vn{constructor(){E(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function fc(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=tc(e,t,n),a=nc(e,t,n),l=rc(e,t,n),u=sc(e,t,n),c=ic(e,t,n),h=k_(e,t,n),d=F_(e,t,n);let f="";return r&&(e.dataStream=lu(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:u,tables:c,customRanges:h,customDecorations:d}}function gc(e,t,n,r){e.dataStream=au(e.dataStream,r,t.dataStream),Ku(e,t,n,r),Xu(e,t,n,r),Qu(e,t,n,r),Ju(e,t,n,r),qu(e,t,n,r),U_(e,t,n,r),P_(e,t,n,r)}function tE(e,t,n,r,s=Pe.COVER){return B_(e,t,n,r,s)}function nE(e,t,n){return t<=0?{dataStream:""}:fc(e,t,n)}function rE(e,t,n,r){n!==0&&gc(e,t,n,r)}function sE(e,t){const n=new Vn;return n.reset(),t.forEach(r=>{const s=ne.deepClone(r);switch(s.t){case ce.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&tE(e,o,a,n.cursor,i),n.moveCursor(a);break}case ce.INSERT:{const{body:i,len:o}=s;rE(e,i,o,n.cursor),n.moveCursor(o);break}case ce.DELETE:{const{len:i}=s;nE(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function iE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=ne.deepClone(t),e=ne.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,u=0,c=null;function h(){return c?(i.push(c),c=null,!0):!1}for(;l<o&&u<a;){const{st:R,ed:v,ts:M}=t[l],{st:Q,ed:z,ts:de,sId:N}=e[u];let A={};if(s===0)A={...M},n===Pe.COVER&&r===Pe.REPLACE&&de&&(A=Object.assign({},de,A));else if(A={...M},n===Pe.REPLACE){if(r===Pe.REPLACE)A={...de};else if(M&&de){const j=Object.keys(M);for(const q of j)de[q]&&delete A[q]}}else if(r===Pe.REPLACE){if(de){const j=Object.keys(de);for(const q of j)de[q]!==void 0&&(A[q]=de[q])}}else if(de){const j=Object.keys(de);for(const q of j)A[q]!==void 0&&delete A[q]}if(v<Q)h()||i.push(t[l]),l++;else if(z<R)h()||i.push(e[u]),u++;else{const j={st:Math.min(R,Q),ed:Math.max(R,Q),ts:R<Q?{...M}:{...de},sId:R<Q?void 0:N};j.ed>j.st&&i.push(),i.push({st:Math.max(R,Q),ed:Math.min(v,z),ts:A,sId:N}),v<z?(l++,e[u].st=v,e[u].st===e[u].ed&&u++):(u++,t[l].st=z,t[l].st===t[l].ed&&l++);const q={st:Math.min(v,z),ed:Math.max(v,z),ts:v<z?{...de}:{...M},sId:v<z?N:void 0};c=q.ed>q.st?q:null}}h();const d=i[i.length-1],f=t[o-1],C=e[a-1];return d.ed!==Math.max(f.ed,C.ed)&&(f.ed>C.ed?i.push(f):i.push(C)),yr(i,!0)}function oE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Pe.REPLACE)return s===1?[ne.deepClone(i)]:[ne.deepClone(o)];if(r===Pe.REPLACE){const a=ne.deepClone(o);return s===1&&Object.assign(a,ne.deepClone(i)),[a]}else{const a=ne.deepClone(o);return s===1&&Object.assign(a,ne.deepClone(i)),[a]}}function Da(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=ne.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Pe.REPLACE)if(r===Pe.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===Pe.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Pe.REPLACE&&r===Pe.REPLACE?i.bullet=s===1?ne.deepClone(e.bullet):ne.deepClone(t.bullet):e.bullet===void 0?i.bullet=ne.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?ne.deepClone(t.bullet):ne.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=ne.deepClone(t.bullet)),i}function aE(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return ne.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===fn.DELETED||i===fn.DELETED)&&(o=!0,n.push({...r,type:fn.DELETED}));break}o||n.push(r)}return n}function lE(e,t,n=!1){const{body:r,coverType:s=Pe.COVER}=e,{body:i,coverType:o=Pe.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:u,paragraphs:c=[],customRanges:h,customDecorations:d}=r,{textRuns:f,paragraphs:C=[],customRanges:R,customDecorations:v}=i,M=iE(u,f,s,o,n?1:0);M&&(a.textRuns=M);const Q=oE(h,R,s,o,n?1:0);Q&&(a.customRanges=Q);const z=aE(d,v);z&&(a.customDecorations=z);const de=[];let N=0,A=0;for(;N<c.length&&A<C.length;){const j=c[N],q=C[A],{startIndex:fe}=j,{startIndex:ae}=q;if(fe===ae){let m={startIndex:fe};n?m=Da(j,q,s,o,1):m=Da(j,q,s,o,0),de.push(m),N++,A++}else fe<ae?N++:(de.push(ne.deepClone(q)),A++)}return A<C.length&&de.push(...C.slice(A)),de.length&&(a.paragraphs=de),{coverType:l,body:a}}function xa(e){return Object.keys(e).length===1}const Nn=class Nn{constructor(){E(this,"_actions",[])}static apply(t,n){return sE(t,n)}static compose(t,n){const r=new vn(t),s=new vn(n),i=new Nn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===ce.INSERT)i.push(s.next());else if(r.peekType()===ce.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===ce.INSERT&&l.t===ce.RETAIN)l.body==null?i.push(a):i.push({...a,body:mi(a.body,l.body,l.coverType)});else if(a.t===ce.RETAIN&&l.t===ce.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const u=a.coverType===Pe.REPLACE||l.coverType===Pe.REPLACE?Pe.REPLACE:Pe.COVER;i.push({...a,t:ce.RETAIN,coverType:u,body:mi(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===ce.RETAIN&&l.t===ce.DELETE?i.push(l):a.t===ce.INSERT&&(l.t,ce.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new vn(t),i=new vn(n),o=new Nn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===ce.INSERT&&(r==="left"||i.peekType()!==ce.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===ce.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),u=i.next(a);if(l.t===ce.DELETE)continue;if(u.t===ce.DELETE){o.push(u);continue}if(l.body==null||u.body==null)o.push(u);else{const{coverType:c,body:h}=lE(l,u,r==="left");o.push({...u,t:ce.RETAIN,coverType:c,body:h})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new vn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===ce.DELETE){n-=Math.min(o,n-i);continue}else a===ce.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===ce.INSERT)n.push({t:ce.DELETE,len:r.len,body:r.body});else if(r.t===ce.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:ce.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:ce.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Pe.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===ce.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=Nt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===ce.RETAIN&&i.body!=null){const o=Nt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==ce.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:ce.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:ce.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:ce.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=ne.deepClone(t[0]);if(s.t===ce.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===ce.DELETE&&s.t===ce.DELETE)return r.len+=s.len,this;if(r.t===ce.DELETE&&s.t===ce.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===ce.RETAIN&&s.t===ce.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===ce.INSERT&&xa(r.body)&&s.t===ce.INSERT&&xa(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===ce.RETAIN&&eE(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};E(Nn,"id","text-x"),E(Nn,"uri","https://github.com/dream-num/univer#text-x");let ze=Nn;Object.defineProperty(ze,"name",{value:"text-x"});const Mn=class Mn{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==ze.id||(this._subTypes.set(t.name,t),gt.type.registerSubtype(t))}static apply(t,n){if(!gt.type.isNoop(n))return gt.type.apply(t,n)}static compose(t,n){return gt.type.compose(t,n)}static transform(t,n,r){return gt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===ze.name?ze.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return gt.type.invertWithDoc(t,n)}static isNoop(t){return gt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Mn),this._instance}removeOp(t,n){return gt.removeOp(t,n)}moveOp(t,n){return gt.moveOp(t,n)}insertOp(t,n){return gt.insertOp(t,n)}replaceOp(t,n,r){return gt.replaceOp(t,n,r)}editOp(t,n=["body"]){return gt.editOp(n,ze.name,t)}};E(Mn,"uri","https://github.com/dream-num/univer#json-x"),E(Mn,"_subTypes",new Map),E(Mn,"_instance",null);let Vt=Mn;Vt.registerSubtype(ze);const fo={id:"default_doc",documentStyle:{}};class uE extends Ss{constructor(n){var r;super();E(this,"type",$e.UNIVER_DOC);E(this,"_name$",new we.BehaviorSubject(""));E(this,"name$",this._name$.asObservable());E(this,"snapshot");this.snapshot={...fo,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...vr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,u=s==null?void 0:s[n];if(!u)return;const c=u.docTransform;c.size.width=i,c.size.height=o,c.positionH.posOffset=a,c.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:n}:this.snapshot.settings.zoomRatio=1}}class Mt extends uE{constructor(n){var s,i;super(ne.isEmptyObject(n)?O_():n);E(this,"_unitId");E(this,"headerModelMap",new Map);E(this,"footerModelMap",new Map);E(this,"change$",new we.BehaviorSubject(0));const r=6;this._unitId=(s=this.snapshot.id)!=null?s:ne.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...fo,...n},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Vt.isNoop(n))return this.snapshot=Vt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(n,r,s=ho.copy){const i=this.getBody();if(i!=null)return Nt(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new Mt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Mt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}function cE(e){const{ranges:t,id:n,type:r}=e,s=new ze;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:u}=a;l>0&&s.push({t:ce.RETAIN,len:l-i}),s.push({t:ce.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:u-l-1}]},len:u-l}),i=u}return s}function hE(e){var c,h,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(h=(c=r.getSelfOrHeaderFooterModel(n))==null?void 0:c.getBody())==null?void 0:h.customDecorations)==null?void 0:d.find(f=>f.id===t);if(!i)return!1;const o=new ze,{startIndex:a,endIndex:l}=i,u=l-a+1;return o.push({t:ce.RETAIN,len:a}),o.push({t:ce.RETAIN,len:u,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:u-1,id:t,type:fn.DELETED}]}}),o}function pc(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function dE(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):pc(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function fE(e){return{...ne.deepClone(e),rangeId:Yt()}}function gE(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function mc(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function pE(e,t){var i,o,a,l,u;const n=mc(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((u=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?u:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}function mE(e){var h,d,f;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.customRanges)==null?void 0:d.find(C=>C.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new ze,u=a-o+1;l.push({t:ce.RETAIN,len:o}),l.push({t:ce.RETAIN,len:u,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:ce.INSERT,body:s,len:s.dataStream.length});const c=a+1+((f=s==null?void 0:s.dataStream.length)!=null?f:0);return l.selections=[{startOffset:c,endOffset:c,collapsed:!0}],l}function _E(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new ze;let u=!1;return t.forEach(c=>{var z,de,N;const h=pE(c,o);if(!h||!o)return!1;const{startOffset:d,endOffset:f}=h,C=(z=o.customRanges)!=null?z:[],R=(A,j,q)=>{var S,D,O,w;const fe=mc(A,j,C,r),ae=Math.min((D=(S=fe[0])==null?void 0:S.startIndex)!=null?D:1/0,A),m=Math.max((w=(O=fe[fe.length-1])==null?void 0:O.endIndex)!=null?w:-1/0,j),B={rangeId:q?`${n}$${q}`:n,rangeType:r,startIndex:0,endIndex:m-ae,wholeEntity:s,properties:{...i}};l.push({t:ce.RETAIN,len:ae-a}),l.push({t:ce.RETAIN,len:m-ae+1,body:{dataStream:"",customRanges:[B]},coverType:Pe.COVER}),a=m+1},v=((de=o.paragraphs)!=null?de:[]).filter(A=>A.startIndex<f&&A.startIndex>d),M=((N=o.customBlocks)!=null?N:[]).filter(A=>A.startIndex<f&&A.startIndex>d);gE([d,f-1],[...v.map(A=>A.startIndex),...M.map(A=>A.startIndex)]).forEach(([A,j],q)=>R(A,j,q)),u=!0,l.selections=[{startOffset:h.endOffset,endOffset:h.endOffset,collapsed:!0}]}),u?l:!1}function _c(e,t,n=0,r=null,s=!0){e.sort((u,c)=>u.startOffset-c.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(u=>u.startIndex>=e[0].startOffset&&u.startIndex<e[0].endOffset);let l=n;if(e.forEach(u=>{const{startOffset:c,endOffset:h}=u;c>l&&(i.push({t:ce.RETAIN,len:c-l}),l=c),l<h&&(i.push({t:ce.DELETE,len:h-l}),l=h)}),r&&i.push({t:ce.INSERT,body:r,len:r.dataStream.length}),a&&s){const u=o.find(c=>c.startIndex-n>=e[e.length-1].endOffset-1);u&&(u.startIndex>l&&(i.push({t:ce.RETAIN,len:u.startIndex-l}),l=u.startIndex),i.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...u,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}function EE(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:ce.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:ce.RETAIN,len:a-s,body:{...ne.deepClone(t),dataStream:""}}),s=a)}),r}const CE=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:Nt(i,t.startOffset,t.endOffset),a=Ui(o?o.dataStream:"",n.dataStream);let l=0;const u=a.map(([d,f])=>{switch(d){case 0:{const C={t:ce.RETAIN,body:{...Nt(n,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,C}case 1:{const C={t:ce.INSERT,body:Nt(n,l,l+f.length),len:f.length};return l+=f.length,C}default:return{t:ce.DELETE,len:f.length}}}),c=new ze;return c.push({t:ce.RETAIN,len:t.startOffset}),c.push(...u),c};function RE(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&(e!=null&&e.every((n,r)=>JSON.stringify(n)===JSON.stringify(t==null?void 0:t[r]))))}const IE=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:Nt(i,t.startOffset,t.endOffset),a=Ui(o?o.dataStream:"",n.dataStream);let l=0;const u=a.map(([d,f])=>{switch(d){case 0:{const C=us(n,l,l+f.length,!1),R=us(o,l,l+f.length,!1),v={t:ce.RETAIN,body:RE(C,R)?void 0:{textRuns:C,dataStream:""},len:f.length};return l+=f.length,v}case 1:{const C={t:ce.INSERT,body:Nt(n,l,l+f.length),len:f.length};return l+=f.length,C}default:return{t:ce.DELETE,len:f.length}}});if(u.every(d=>d.t===ce.RETAIN&&!d.body))return!1;const c=new ze;return c.push({t:ce.RETAIN,len:t.startOffset}),c.push(...u),c};function yE(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function vE(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const SE=e=>{var R,v,M,Q;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new ze,l=Vt.getInstance(),u=[],c=n.getSelfOrHeaderFooterModel(o).getBody();if(!c)return!1;const h=(v=(R=n.getSnapshot().drawingsOrder)==null?void 0:R.length)!=null?v:0;let d=0;if(s)i>0&&a.push({t:ce.RETAIN,len:i});else{const z=_c([t],c,0,null,!1);a.push(...z);const de=yE(c,[t]),N=(M=n.getDrawings())!=null?M:{},A=(Q=n.getDrawingsOrder())!=null?Q:[],j=de.sort((q,fe)=>A.indexOf(q)>A.indexOf(fe)?-1:A.indexOf(q)<A.indexOf(fe)?1:0);if(j.length>0)for(const q of j){const fe=N[q],ae=A.indexOf(q);if(fe==null||ae<0)continue;const m=l.removeOp(["drawings",q],fe),B=l.removeOp(["drawingsOrder",ae],q);u.push(m),u.push(B),d++}}a.push({t:ce.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((z,de)=>({startIndex:de,blockId:z.drawingId}))},len:r.length});const f=vE(n,o),C=l.editOp(a.serialize(),f);u.push(C);for(const z of r){const{drawingId:de}=z,N=l.insertOp(["drawings",de],z),A=l.insertOp(["drawingsOrder",h-d],de);u.push(N),u.push(A)}return u.reduce((z,de)=>Vt.compose(z,de),null)},wE=e=>{var h,d,f;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs)!=null?d:[],o=t.every(C=>{var R;return((R=C.bullet)==null?void 0:R.listType.indexOf(s))===0});let l=ne.generateRandomId(6);if(t.length===1){const C=i.indexOf(t[0]),R=i[C-1],v=i[C+1];R&&R.bullet&&R.bullet.listType.indexOf(s)===0?(l=R.bullet.listId,s!==Ut.CHECK_LIST&&(s=R.bullet.listType)):v&&v.bullet&&v.bullet.listType.indexOf(s)===0&&(l=v.bullet.listId,s!==Ut.CHECK_LIST&&(s=v.bullet.listType))}const u=new Vn;u.reset();const c=new ze;for(const C of t){const{startIndex:R,paragraphStyle:v={},bullet:M}=C;c.push({t:ce.RETAIN,len:R-u.cursor}),c.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:v,startIndex:0}:{startIndex:0,paragraphStyle:{...v},bullet:{nestingLevel:(f=M==null?void 0:M.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),u.moveCursorTo(R+1)}return c},OE=e=>{var h;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ut.CHECK_LIST)===-1)return!1;const o=new Vn;o.reset();const a=new ze,{startIndex:l,paragraphStyle:u={}}=i,c=i.bullet.listType===Ut.CHECK_LIST?Ut.CHECK_LIST_CHECKED:Ut.CHECK_LIST;return a.push({t:ce.RETAIN,len:l-o.cursor}),a.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:u,startIndex:0,bullet:{...i.bullet,listType:c}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},bE=e=>{var c,h;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((c=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:c.paragraphs)==null)return!1;const a=ne.generateRandomId(6),l=new Vn;l.reset();const u=new ze;for(const d of t){const{startIndex:f,paragraphStyle:C={},bullet:R}=d;u.push({t:ce.RETAIN,len:f-l.cursor}),u.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:C,bullet:{nestingLevel:(h=R==null?void 0:R.nestingLevel)!=null?h:0,textStyle:(R==null?void 0:R.listType)===n?R.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(f+1)}return u};function AE(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const TE=e=>{var c,h,d;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Vn;i.reset();const o=new ze,a=(c=r.getSnapshot().lists)!=null?c:{},l=(d=(h=r.getBody())==null?void 0:h.tables)!=null?d:[],u={...vr,...a};for(const f of t){const{startIndex:C,paragraphStyle:R={},bullet:v}=f,M=AE(f,l);if(o.push({t:ce.RETAIN,len:C-i.cursor}),v){const Q=v.listType;let z=u[Q].nestingLevel.length-1;M&&(z=Math.min(z,2)),o.push({t:ce.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R},bullet:{...v,nestingLevel:Math.max(Math.min(v.nestingLevel+s,z),0)}}]},coverType:Pe.REPLACE})}else o.push({t:ce.RETAIN,len:1});i.moveCursorTo(C+1)}return o};var Ec=(e=>(e.PARAGRAPH="PARAGRAPH",e.SECTION_BREAK="SECTION_BREAK",e.TABLE="TABLE",e.TABLE_ROW="TABLE_ROW",e.TABLE_CELL="TABLE_CELL",e.CUSTOM_BLOCK="CUSTOM_BLOCK",e))(Ec||{}),qt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
9
+ `,e.TABLE_START="",e.TABLE_ROW_START="\x1B",e.TABLE_CELL_START="",e.TABLE_CELL_END="",e.TABLE_ROW_END="",e.TABLE_END="",e.CUSTOM_RANGE_START="",e.CUSTOM_RANGE_END="",e.COLUMN_BREAK="\v",e.PAGE_BREAK="\f",e.DOCS_END="\0",e.TAB=" ",e.CUSTOM_BLOCK="\b",e.LETTER="",e.SPACE=" ",e))(qt||{});function NE(e){return`${e}`}const ME=[qt.TABLE_START,qt.TABLE_ROW_START,qt.TABLE_CELL_START,qt.TABLE_CELL_END,qt.TABLE_ROW_END,qt.TABLE_END],Cc=e=>{const t=e.endsWith(`\r
10
+ `)?e.slice(0,-2):e;return ME.reduce((n,r)=>n.replaceAll(r,""),t)},DE=e=>e?Cc(e).replaceAll("\r","")==="":!0,xE=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,u=!0)=>{const c=t.slice(s,l);if(ne.isLegalUrl(c)){const h=Yt(),d=`${c}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:on.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,u&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,u&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}};function LE(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function UE(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function PE(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class it{}E(it,"customRange",{add:_E,delete:mE,copyCustomRange:fE,getCustomRangesInterestsWithSelection:dE,isIntersecting:pc}),E(it,"customDecoration",{add:cE,delete:hE}),E(it,"selection",{replace:CE,makeSelection:LE,normalizeSelection:UE,delete:_c,replaceTextRuns:IE,retain:EE}),E(it,"range",{isIntersects:PE}),E(it,"transform",{getPlainText:Cc,fromPlainText:xE,isEmptyDocument:DE}),E(it,"paragraph",{bullet:{set:bE,switch:wE,toggleChecklist:OE,changeNestLevel:TE}}),E(it,"drawing",{add:SE});function kE(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]==="\r"&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function Rc(e){var t;return e.body=kE((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class Gn{constructor(t={}){E(this,"_style");this._style=t}static create(t={}){return new Gn(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===Ie.TRUE}get bold(){return this._style.bl===Ie.TRUE}get underline(){return this._style.ul&&Bt.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&Bt.create(this._style.bbl)}get strikethrough(){return this._style.st&&Bt.create(this._style.st)}get overline(){return this._style.ol&&Bt.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return Wt.create(ne.deepClone(this._style))}getValue(){return{...this._style}}}class Wt extends Gn{static create(t={}){return new Wt(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return Wt.create(ne.deepClone(this._style))}build(){return this.getValue()}}class Bt{constructor(t={s:1}){E(this,"_decoration");this._decoration=t}static create(t={s:1}){return new Bt(t)}get show(){return this._decoration.s===Ie.TRUE}get followFontColor(){return this._decoration.c===Ie.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return Bt.create(ne.deepClone(this._decoration))}build(){return{...this._decoration}}}class Kn{constructor(t={}){E(this,"_style");this._style=t}static create(t={}){return new Kn(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===Ie.TRUE}get keepNext(){return this._style.keepNext===Ie.TRUE}get wordWrap(){return this._style.wordWrap===Ie.TRUE}get widowControl(){return this._style.widowControl===Ie.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===Ie.TRUE}copy(){return Fn.create(ne.deepClone(this._style))}getValue(){return this._style}}class Fn extends Kn{static create(t={}){return new Fn(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return Fn.create(ne.deepClone(this._style))}build(){return this.getValue()}}class jt{constructor(t){E(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=Rc(t)}static create(t){return new jt(t)}static createByBody(t){return new jt({body:t,id:"d",documentStyle:{}})}copy(){return sn.create(ne.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return sn.create({...ne.deepClone(s),body:Nt(r,t,n)})}toPlainText(){var t,n;return it.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
11
+ `)}getParagraphStyle(){var t,n;return Kn.create((n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].paragraphStyle)}getParagraphBullet(){var t,n;return(n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].bullet}getParagraphs(){var r,s;const t=(s=(r=this._data.body)==null?void 0:r.paragraphs)!=null?s:[];let n=0;return t.map(i=>{const o=this.slice(n,i.startIndex);return n=i.startIndex,o})}getTextRuns(){var t,n;return((n=(t=this._data.body)==null?void 0:t.textRuns)!=null?n:[]).map(r=>({...r,ts:r.ts?Gn.create(r.ts):null}))}getLinks(){var t,n,r;return(r=(n=(t=this._data.body)==null?void 0:t.customRanges)==null?void 0:n.filter(s=>s.rangeType===on.HYPERLINK))!=null?r:[]}getData(){return this._data}}class sn extends jt{constructor(n){super(n);E(this,"_doc");this._doc=new Mt(n)}static newEmptyData(){return Rc({id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
12
+ `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new sn(n!=null?n:sn.newEmptyData())}insertText(n,r,s){var c,h;let i=((h=(c=this._data.body)==null?void 0:c.dataStream.length)!=null?h:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof Wt?r.build():r:a=s instanceof Wt?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},u=it.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!u)throw new Error("Insert text failed, please check.");return ze.apply(this._doc.getBody(),u.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof jt?n.getData():n:(s=Math.min(n,s),i=r instanceof jt?r.getData():r);const o=it.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return ze.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=it.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);ze.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof Wt?s.build():s,st:0,ed:r-n}]},o=it.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return ze.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=it.customRange.add({rangeType:on.HYPERLINK,rangeId:Yt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return ze.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=it.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");ze.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=it.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");ze.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,jt.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=sn.createByBody({dataStream:i,customRanges:[{rangeType:on.HYPERLINK,rangeId:Yt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}function FE(e,t=16){let n=0,r=null;return function(...i){const o=Date.now();o-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=o,e.apply(this,i)},t)):(n=o,e.apply(this,i))}}var An=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(An||{});function $E(e){return`sheet_interceptor_${e}`}const Ic=e=>function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,n,l=>(a=!0,l)),!a)break}return s};class HE{constructor(t){E(this,"_interceptorsByName",new Map);E(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),Ic(s||[])}intercept(t,n){const r=t;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(n),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>_r(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function BE(e){return`sheet_async_interceptor_${e}`}const jE=e=>async function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,n,async l=>(a=!0,l)),!a)break}return s};class WE{constructor(t){E(this,"_asyncInterceptorsByName",new Map);E(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),jE(s||[])}async interceptAsync(t,n){const r=t;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(n),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>_r(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function YE(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}class ws extends Ze{static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}const $s=Symbol("initializers");class yc extends Ze{constructor(t){super(),this._injector=t;const n=this,r=Object.getPrototypeOf(this)[$s];r&&r.forEach(function(s){s.apply(n,[t])})}_initialize(t){}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{if(n==="_initialize"){let r=this.prototype[$s];r||(r=[],this.prototype[$s]=r),r.push(t.prototype._initialize)}else n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}const zE="0.6.0-experimental.20250212-dbe9830";function VE(e="",t=zn.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:zE,locale:t,styles:{},sheets:{},resources:[]}}class vc{constructor(t={}){E(this,"_styles");E(this,"_cacheMap",new gr(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=ne.generateRandomId(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&ne.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(ne.diffValue(n[r],t))return r;return null}}const GE=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!zt.equals(r,n))),KE=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&zt.equals(n.range,s.range)}),_i={t:0,b:2,l:2,r:2},XE=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),La=90;function rr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=vt.UNSPECIFIED,verticalAlign:a=tn.UNSPECIFIED,wrapStrategy:l=mn.UNSPECIFIED,cellValueType:u}=n,{t:c,r:h,b:d,l:f}=i||_i,{vertexAngle:C,centerAngle:R}=Oc(s),v={id:"d",body:{dataStream:`${e}${pl}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:c,marginBottom:d,marginRight:h,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:R,vertexAngle:C,wrapStrategy:l,cellValueType:u,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new Mt(v)}function QE(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Ua(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,u={};return t&&(u.ff=t),n&&(u.fs=n),r&&(u.it=r),s&&(u.bl=s),i&&(u.ul=i),o&&(u.st=o),a&&(u.ol=a),l&&(u.cl=l),u}function Sc(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===on.HYPERLINK))return;const s=it.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:on.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&ze.apply(r,s.serialize())}function wc(e){return e!=null}const JE='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Pa(e){const t=ut.ff,n=ut.fs;if(!e){const h=`${n}pt ${t}`;return{fontCache:h,fontString:h,fontSize:n,originFontSize:n,fontFamily:t}}let r=bn.ITALIC;(e.it===0||e.it===void 0)&&(r=bn.NORMAL);let s=bn.BOLD;(e.bl===0||e.bl===void 0)&&(s=bn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=t),o=h}const{va:a}=e;let l=i;if(a===Pt.SUBSCRIPT||a===Pt.SUPERSCRIPT){const h=qE(o,l),{sbr:d,spr:f}=h;l*=a===Pt.SUBSCRIPT?d:f}const u=`${r} ${s} ${l}pt ${o}`,c=`${u}, ${JE} `;return{fontCache:u,fontString:c,fontSize:l,originFontSize:i,fontFamily:o}}function qE(e,t){return XE(t)}function Oc(e){const{a:t=0,v:n=Ie.FALSE}=e||{a:0,v:Ie.FALSE};let r=0,s=t;return n===Ie.TRUE&&(r=La,s=La),{centerAngle:r,vertexAngle:s}}class ZE{constructor(t,n){E(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==Ie.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:xe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:xe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:xe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:xe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return rn(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Ie.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(t){const n=this._columnData[t];if(n)return n}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}class eC{constructor(t,n,r){E(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:Ie.FALSE,h:s.defaultRowHeight},{ia:l,ah:u,h:c=s.defaultRowHeight}=a;i+=(l==null||l===Ie.TRUE)&&typeof u=="number"?u:c}return i}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:xe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:xe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:xe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:xe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Ie.TRUE:!0}getSize(){return rn(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const tC="DEFAULT_WORKSHEET_ROW_COUNT",bc=1e3,nC="DEFAULT_WORKSHEET_COLUMN_COUNT",Ac=20,rC="DEFAULT_WORKSHEET_ROW_HEIGHT",Tc=24,sC="DEFAULT_WORKSHEET_COLUMN_WIDTH",Nc=88,iC="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Mc=46,oC="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Dc=20;function xc(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Ie.FALSE,rowCount:bc,columnCount:Ac,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Nc,defaultRowHeight:Tc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Ie.TRUE,rowHeader:{width:Mc,hidden:Ie.FALSE},columnHeader:{height:Dc,hidden:Ie.FALSE},rightToLeft:Ie.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class aC extends Ze{constructor(n){super();E(this,"_cellCache",new Map);E(this,"_rowCache",new Map);E(this,"_columnCache",new Map);E(this,"_hasRow",!1);E(this,"_hasColumn",!1);E(this,"_hasAll",!1);E(this,"_allIndex",-1);E(this,"_mergeData");E(this,"_rangeMap",new gr(5e4));E(this,"_skeletonCache",new gr(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===xe.ROW?this._createRowCache(s,r):i===xe.COLUMN?this._createColumnCache(s,r):i===xe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!ne.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!ne.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const u=[];for(const c of this._mergeData||[])zt.intersects(c,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...c}),u.push(l)),l++;return this._rangeMap.set(a,u),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const u=[];for(let c=0;c<a.length;c++){const{startRow:h,endRow:d,startColumn:f,endColumn:C}=a[c];for(let R=n;R<=s;R++){let v=!1;for(let M=r;M<=i;M++)if(R>=h&&R<=d&&M>=f&&M<=C){o.push({startRow:h,endRow:d,startColumn:f,endColumn:C}),u.push(c),v=!0;break}if(v)break}}return this._skeletonCache.set(l,u),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Lc extends Ze{constructor(n){super();E(this,"_cellContentInterceptor",null);E(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value|An.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,We(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,We(()=>this._rowFilteredInterceptor=null)}}const ka={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class pr{constructor(t,n,r){E(this,"_sheetId");E(this,"_snapshot");E(this,"_cellData");E(this,"_rowManager");E(this,"_columnManager");E(this,"_viewModel");E(this,"_spanModel");var a;this.unitId=t,this._styles=r,this._snapshot=xc(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:ne.generateRandomId(6),this._cellData=new Tt(o),this._viewModel=new Lc((l,u)=>this.getCellRaw(l,u)),this._rowManager=new eC(this._snapshot,this._viewModel,i),this._columnManager=new ZE(this._snapshot,s),this._spanModel=new aC(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}mixinDefaultStyleToCellRaw(t,n,r,s){const i=this.getColumnStyle(n),o=this.getRowStyle(t),a=this.getDefaultCellStyleInternal();if(a||i||o){let l=r==null?void 0:r.s;typeof l=="string"&&(l=this._styles.get(l));const u=s?si(a,i,o,l):si(a,o,i,l);r||(r={}),r.s=u}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((u,c)=>{Object.keys(c).forEach(h=>{const d=+h,f=t.getValue(u,d),C=f!=null&&f.s?this._styles.get(f.s):null,R=(C==null?void 0:C.bd)&&(C.bd.b||C.bd.l||C.bd.r||C.bd.t||C.bd.bc_tr||C.bd.bl_tr||C.bd.ml_tr||C.bd.tl_bc||C.bd.tl_br||C.bd.tl_mr);(f&&(f.v||f.p)||C!=null&&C.bg||R)&&(a?r=Math.min(r,u):(r=u,a=!0),s=Math.max(s,u),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(u=>{a?r=Math.min(r,u.startRow):(r=u.startRow,a=!0),s=Math.max(s,u.endRow),l?i=Math.min(i,u.startColumn):(i=u.startColumn,a=!0),o=Math.max(o,u.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=ne.deepClone(t);return new pr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,u=n;if(r){const{startRow:c,endRow:h,startColumn:d,endColumn:f}=r;t===c&&n===d?(o=h,a=f,l=c,u=d,i=!0):t>=c&&t<=h&&n>=d&&n<=f&&(o=h,a=f,l=c,u=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:u}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getMatrixWithMergedCells(t,n,r,s,i=On.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new Tt;return hi(t,r,n,s).forEach((u,c)=>{var d;let h;if(i===On.Raw)h=this.getCellRaw(u,c);else if(i===On.Intercepted)h=this.getCell(u,c);else if(i===On.Both){const f=this.getCellRaw(u,c);if(f){h={...f};const C=(d=this.getCell(u,c))==null?void 0:d.v;wc(C)&&h&&(h.displayV=String(C))}}h&&l.setValue(u,c,h)}),a.forEach(u=>{const{startColumn:c,startRow:h,endColumn:d,endRow:f}=u;hi(h,f,c,d).forEach((C,R)=>{C===h&&R===c&&l.setValue(C,R,{...o.getValue(C,R),rowSpan:f-h+1,colSpan:d-c+1}),(C!==h||R!==c)&&l.realDeleteValue(C,R)})}),l}getRange(t,n,r,s){return typeof t=="object"?new kn(this,t,{getStyles:()=>this._styles}):new kn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,u=s;return{next(){for(;;){if(u>o&&(l+=1,u=s),l>i)return{done:!0,value:void 0};const c=a.getCell(l,u),h=!c,d=a.getMergedCell(l,u);if(d){if(l!==d.startRow||u!==d.startColumn){u=d.endColumn+1;continue}if(h&&n){u=d.endColumn+1;continue}const C={row:l,col:u,value:c};return C.colSpan=d.endColumn-d.startColumn+1,C.rowSpan=d.endRow-d.startRow+1,u=d.endColumn+1,{done:!1,value:C}}if(h&&n)u+=1;else{const f={row:l,col:u,value:c};return u+=1,{done:!1,value:f}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let u=s,c=i;return{next(){for(;;){if(u>o&&(c+=1,u=s),c>a)return{done:!0,value:void 0};const h=l.getMergedCell(u,c);if(h){const C=u!==h.startRow,R=C||c!==h.startColumn;if(r&&R||!r&&C){u=h.endRow+1;continue}const v=l.getCell(h.startRow,h.startColumn);if(!v&&n){u=h.endRow+1;continue}const Q={row:u,col:h.startColumn,value:v};return Q.colSpan=h.endColumn-h.startColumn+1,Q.rowSpan=h.endRow-h.startRow+1,u=h.endRow+1,{done:!1,value:Q}}const d=l.getCell(u,c);if(!d&&n)u+=1;else{const C={row:u,col:c,value:d};return u+=1,{done:!1,value:C}}}}}}}}_getCellDocumentModel(t,n=ka){var R;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...ka,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const u=QE(o),c=i?ut.tr:u.textRotation||ut.tr;let h=u.horizontalAlign||ut.ht;const d=u.verticalAlign||ut.vt,f=u.wrapStrategy||ut.tb,C=u.paddingData||_i;if(t.f&&s)a=rr(t.f.toString(),{},{verticalAlign:d}),h=ut.ht;else if(t.p){const{centerAngle:v,vertexAngle:M}=Oc(c);a=this._updateConfigAndGetDocumentModel(r?ne.deepClone(t.p):t.p,h,C,{horizontalAlign:h,verticalAlign:d,centerAngle:v,vertexAngle:M,wrapStrategy:f,zeroWidthParagraphBreak:1})}else if(t.v!=null){const v=Ua(o);l=Pa(v).fontCache;let M=Uc(t);t.t===nn.FORCE_STRING&&s&&(M=`'${M}`),a=rr(M,v,{...u,textRotation:c,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Sc(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:c,wrapStrategy:f,verticalAlign:d,horizontalAlign:h,paddingData:C,fill:(R=o==null?void 0:o.bg)==null?void 0:R.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,u,c;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(u=r.l)!=null?u:2,t.documentStyle.marginRight=(c=r.r)!=null?c:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=n;return new Mt(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=Ua(r);if(n!=null)return n.documentModel==null&&(n.documentModel=rr("",s)),n;const i="";let o="document";const a=ut.tr,l=ut.ht,u=ut.vt,c=ut.tb,h=_i;return o=Pa({}).fontCache,{documentModel:rr(i,s),fontString:o,textRotation:a,wrapStrategy:c,verticalAlign:u,horizontalAlign:l,paddingData:h}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function Uc(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return it.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===nn.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===nn.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function lC(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return it.transform.getPlainText(n)}return e==null?void 0:e.v}var uC=Object.defineProperty,cC=Object.getOwnPropertyDescriptor,hC=(e,t,n,r)=>{for(var s=r>1?void 0:r?cC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&uC(t,n,s),s},dC=(e,t)=>(n,r)=>t(n,r,e);function fC(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}exports.Workbook=class extends Ss{constructor(n={},r){super();E(this,"type",$e.UNIVER_SHEET);E(this,"_sheetCreated$",new we.Subject);E(this,"sheetCreated$",this._sheetCreated$.asObservable());E(this,"_sheetDisposed$",new we.Subject);E(this,"sheetDisposed$",this._sheetDisposed$.asObservable());E(this,"_activeSheet$",new we.BehaviorSubject(null));E(this,"activeSheet$",this._activeSheet$.asObservable());E(this,"_worksheets");E(this,"_styles");E(this,"_snapshot");E(this,"_unitId");E(this,"_count");E(this,"_name$");E(this,"name$");this._logService=r;const s=VE();ne.isEmptyObject(n)?this._snapshot=s:this._snapshot=ne.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=ne.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new vc(i),this._count=1,this._worksheets=new Map,this._name$=new we.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return ne.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new pr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==Ie.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===Ie.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Ie.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(ne.isEmptyObject(s)){const o=ne.generateRandomId();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const u=new pr(this._unitId,a,this._styles);r.set(o,u),i.includes(o)||i.push(o)}this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}};exports.Workbook=hC([dC(1,At)],exports.Workbook);class go extends Ss{constructor(n){var r;super();E(this,"type",$e.UNIVER_SLIDE);E(this,"_activePage$",new we.BehaviorSubject(null));E(this,"activePage$",this._activePage$.asObservable());E(this,"_name$");E(this,"name$");E(this,"_snapshot");E(this,"_unitId");this._snapshot={...cu,...n},this._unitId=(r=this._snapshot.id)!=null?r:ne.generateRandomId(6),this._name$=new we.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:Yt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=Yt(6);return{id:n,pageType:lo.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}const sr="FOCUSING_UNIT",Tn="FOCUSING_SHEET",ir="FOCUSING_DOC",or="FOCUSING_SLIDE",gC="FOCUSING_EDITOR_BUT_HIDDEN",Pc="EDITOR_ACTIVATED",pC="FOCUSING_EDITOR_INPUT_FORMULA",kc="FOCUSING_FX_BAR_EDITOR",mC="FOCUSING_UNIVER_EDITOR",_C="FOCUSING_EDITOR_INPUT_FORMULA",EC="FOCUSING_PANEL_EDITOR",CC="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",RC="FOCUSING_COMMON_DRAWINGS",IC="FORMULA_EDITOR_ACTIVATED";var yC=Object.defineProperty,vC=Object.getOwnPropertyDescriptor,SC=(e,t,n,r)=>{for(var s=r>1?void 0:r?vC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&yC(t,n,s),s},Fa=(e,t)=>(n,r)=>t(n,r,e);const an=mt("univer.current");exports.UniverInstanceService=class extends Ze{constructor(n,r){super();E(this,"_unitsByType",new Map);E(this,"_createHandler");E(this,"_ctorByType",new Map);E(this,"_currentUnits",new Map);E(this,"_currentUnits$",new we.BehaviorSubject(this._currentUnits));E(this,"currentUnits$",this._currentUnits$.asObservable());E(this,"_unitAdded$",new we.Subject);E(this,"unitAdded$",this._unitAdded$.asObservable());E(this,"_unitDisposed$",new we.Subject);E(this,"unitDisposed$",this._unitDisposed$.asObservable());E(this,"_focused$",new we.BehaviorSubject(null));E(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(we.map(r=>{var s;return(s=r.get(n))!=null?s:null}),we.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(we.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(we.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType($e.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,$e.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,$e.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType($e.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(sr,!0),this._contextService.setContextValue(ir,!1),this._contextService.setContextValue(Tn,!0),this._contextService.setContextValue(or,!1),this.setCurrentUnitForType(n)):this.focused instanceof Mt?(this._contextService.setContextValue(sr,!0),this._contextService.setContextValue(ir,!0),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(or,!1),this.setCurrentUnitForType(n)):this.focused instanceof go?(this._contextService.setContextValue(sr,!0),this._contextService.setContextValue(ir,!1),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(or,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(sr,!1),this._contextService.setContextValue(ir,!1),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(or,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:$e.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(n,i),this._tryBlurUnitOnRemoval(n),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}};exports.UniverInstanceService=SC([Fa(0,rt(Ct)),Fa(1,Wn)],exports.UniverInstanceService);var Ye=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Ye||{});const wC={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var OC=Object.defineProperty,bC=Object.getOwnPropertyDescriptor,AC=(e,t,n,r)=>{for(var s=r>1?void 0:r?bC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&OC(t,n,s),s},TC=(e,t)=>(n,r)=>t(n,r,e);exports.LifecycleService=class extends Ze{constructor(n){super();E(this,"_lifecycle$",new we.BehaviorSubject(Ye.Starting));E(this,"lifecycle$",this._lifecycle$.asObservable());E(this,"_lock",!1);this._logService=n,this._reportProgress(Ye.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return we.merge(Fc(this.stage),this._lifecycle$.pipe(we.skip(1))).pipe(Bl(n=>n===Ye.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${wC[n]}".`)}};exports.LifecycleService=AC([TC(0,At)],exports.LifecycleService);function Fc(e){switch(e){case Ye.Starting:return we.of(Ye.Starting);case Ye.Ready:return we.of(Ye.Starting,Ye.Ready);case Ye.Rendered:return we.of(Ye.Starting,Ye.Ready,Ye.Rendered);default:return we.of(Ye.Starting,Ye.Ready,Ye.Rendered,Ye.Steady)}}var NC=Object.defineProperty,MC=Object.getOwnPropertyDescriptor,DC=(e,t,n,r)=>{for(var s=r>1?void 0:r?MC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&NC(t,n,s),s},Hs=(e,t)=>(n,r)=>t(n,r,e);const en=mt("univer.undo-redo.service"),xC=20;class $c{dispose(){}async dispatchToHandlers(){return!1}}const Hc="univer.command.redo",Bc="univer.command.undo",$t=new class extends $c{constructor(){super(...arguments);E(this,"type",Yn.COMMAND);E(this,"id",Bc)}handler(t){const n=t.get(en),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(yt);return Yi(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},Ht=new class extends $c{constructor(){super(...arguments);E(this,"type",Yn.COMMAND);E(this,"id",Hc)}handler(t){const n=t.get(en),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(yt);return Yi(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends Ze{constructor(n,r,s){super();E(this,"undoRedoStatus$");E(this,"_undoRedoStatus$",new we.BehaviorSubject({undos:0,redos:0}));E(this,"_undoStacks",new Map);E(this,"_redoStacks",new Map);E(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand($t)),this.disposeWithMe(this._commandService.registerCommand(Ht)),this.disposeWithMe(We(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(We(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>xC&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),We(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,u;let n="";const r=this._contextService.getContextValue(Tn),s=this._contextService.getContextValue(kc),i=this._contextService.getContextValue(Pc);return r?s?n=ki:i?n=Pi:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(u=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?u:"",n}};exports.LocalUndoRedoService=DC([Hs(0,an),Hs(1,yt),Hs(2,Wn)],exports.LocalUndoRedoService);const Os=mt("core.resource-manager.service"),Ei={[Lt.Editor]:"Editor",[Lt.Owner]:"Owner",[Lt.Reader]:"Reader",[Lt.UNRECOGNIZED]:"UNRECOGNIZED"},cs=e=>e?{userID:`${Ei[e]}_${ne.generateRandomId(8)}`,name:Ei[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},LC=(e,t)=>e.startsWith(Ei[t]);class $n{constructor(){E(this,"_model",new Map);E(this,"_userChange$",new we.Subject);E(this,"userChange$",this._userChange$.asObservable());E(this,"_currentUser$",new we.BehaviorSubject(cs()));E(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(t){this.addUser(t),this._currentUser$.next(t)}addUser(t){this._model.set(t.userID,t),this._userChange$.next({type:"add",user:t})}getUser(t,n){const r=this._model.get(t);if(r)return r;n&&n()}delete(t){const n=this.getUser(t);this._model.delete(t),n&&this._userChange$.next({type:"delete",user:n})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var UC=Object.defineProperty,PC=Object.getOwnPropertyDescriptor,kC=(e,t,n,r)=>{for(var s=r>1?void 0:r?PC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&UC(t,n,s),s},$a=(e,t)=>(n,r)=>t(n,r,e);exports.AuthzIoLocalService=class{constructor(t,n){E(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(cs(Lt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?LC(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[$e.UNIVER_SHEET,$e.UNIVER_DOC,$e.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return Yt(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:Lt.Owner,shareScope:-1,scope:{read:di.AllCollaborator,edit:di.AllCollaborator},creator:cs(Lt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(Lt.Owner)||this._getRole(Lt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}};exports.AuthzIoLocalService=kC([$a(0,Os),$a(1,rt($n))],exports.AuthzIoLocalService);const jc=mt("IAuthzIoIoService"),po=mt("univer.config-service");class Wc{constructor(){E(this,"_configChanged$",new we.Subject);E(this,"configChanged$",this._configChanged$.asObservable());E(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=Li(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new we.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(we.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class Yc extends Ze{constructor(){super(...arguments);E(this,"_error$",new we.Subject);E(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class gn extends Ze{constructor(){super();E(this,"_currentLocale$",new we.BehaviorSubject(zn.ZH_CN));E(this,"currentLocale$",this._currentLocale$.asObservable());E(this,"_locales",null);E(this,"localeChanged$",new we.Subject);E(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(We(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=Li((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var FC=Object.defineProperty,$C=Object.getOwnPropertyDescriptor,HC=(e,t,n,r)=>{for(var s=r>1?void 0:r?$C(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&FC(t,n,s),s},BC=(e,t)=>(n,r)=>t(n,r,e);exports.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:fr.PERSON,mentions:[{objectType:fr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}};exports.MentionIOLocalService=HC([BC(0,rt($n))],exports.MentionIOLocalService);const zc=mt("univer.service.mention-io");var mo=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(mo||{});const Vc=mt("univer.permission-service");class Gc extends Ze{constructor(){super(...arguments);E(this,"_permissionPointMap",new Map);E(this,"_permissionPointUpdate$",new we.Subject);E(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());E(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof we.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new we.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=mo.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return we.combineLatest(r).pipe(Hr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function Kc(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}const Xc=Symbol("DependentOn");class Ci extends Ze{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}E(Ci,"pluginName"),E(Ci,"type",$e.UNIVER_UNKNOWN);class jC{constructor(){E(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}class WC{constructor(){E(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var YC=Object.defineProperty,zC=Object.getOwnPropertyDescriptor,Qc=(e,t,n,r)=>{for(var s=r>1?void 0:r?zC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&YC(t,n,s),s},ts=(e,t)=>(n,r)=>t(n,r,e);const VC=4;function GC(...e){return function(t){t[Xc]=e}}exports.PluginService=class{constructor(t){E(this,"_pluginHolderForUniver");E(this,"_pluginHoldersForTypes",new Map);E(this,"_seenPlugins",new Set);E(this,"_flushTimer");this._injector=t,this._pluginHolderForUniver=this._injector.createInstance(hs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set($e.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const t of this._pluginHoldersForTypes.values())t.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(t,n){this._assertPluginValid(t),this._scheduleInitPlugin();const{type:r}=t;r===$e.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(t,n),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(t,n)}startPluginForType(t){this._ensurePluginHolderForType(t).start()}_ensurePluginHolderForType(t){if(!this._pluginHoldersForTypes.has(t)){const n=this._injector.createInstance(hs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(t,n),n}return this._pluginHoldersForTypes.get(t)}_immediateInitPlugin(t){this._seenPlugins.add(t.pluginName),this._ensurePluginHolderForType(t.type).immediateInitPlugin(t)}_checkPluginSeen(t){return this._seenPlugins.has(t.pluginName)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===$e.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},VC))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[t,n]of this._pluginHoldersForTypes)n.started&&n.flush()}};exports.PluginService=Qc([ts(0,rt(Ct))],exports.PluginService);let hs=class extends Ze{constructor(t,n,r,s,i){super();E(this,"_started",!1);E(this,"_warnedAboutOnStartingDeprecation",!1);E(this,"_pluginRegistry",new WC);E(this,"_pluginStore",new jC);E(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(we.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(t=>t.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(t,n){this._pluginRegistry.registerPlugin(t,n)}immediateInitPlugin(t){const n=this._initPlugin(t,void 0);this._pluginsRunLifecycle([n])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const t=this._pluginRegistry.getRegisterPlugins().map(({plugin:n,options:r})=>this._initPlugin(n,r));t.length&&(this._pluginsRunLifecycle(t),this._pluginRegistry.removePlugins())}_initPlugin(t,n){const r=t[Xc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" depends on "${o.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._registerPlugin(o,void 0),!0):!1};for(;i(););}const s=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(t){Fc(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case Ye.Starting:r.onStarting();break;case Ye.Ready:r.onReady();break;case Ye.Rendered:r.onRendered();break;case Ye.Steady:r.onSteady();break}})}};hs=Qc([ts(2,At),ts(3,rt(Ct)),ts(4,rt(exports.LifecycleService))],hs);var KC=Object.defineProperty,XC=Object.getOwnPropertyDescriptor,QC=(e,t,n,r)=>{for(var s=r>1?void 0:r?XC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&KC(t,n,s),s},Ha=(e,t)=>(n,r)=>t(n,r,e);let Ri=class extends Ze{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case $e.UNRECOGNIZED:case $e.UNIVER_UNKNOWN:case $e.UNIVER_SLIDE:case $e.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType($e.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case $e.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType($e.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();El(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=ne.deepClone(t.getSnapshot());return r.resources=n,r}};Ri=QC([Ha(0,rt(Os)),Ha(1,rt(an))],Ri);const Ii=mt("resource-loader-service");class Jc extends Ze{constructor(){super(...arguments);E(this,"_resourceMap",new Map);E(this,"_register$",new we.Subject);E(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),We(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch{console.error("LoadResources Error!")}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class _o extends Ze{constructor(){super();E(this,"_currentTheme");E(this,"_currentTheme$",new we.BehaviorSubject({}));E(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(We(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}class qc{constructor(t={},n){E(this,"_startedTypes",new Set);E(this,"_injector");E(this,"_disposingCallbacks",new Is);const r=this._injector=JC(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(_o).setTheme(s),o&&this._injector.get(gn).load(o),i&&this._injector.get(gn).setLocale(i),a&&this._injector.get(At).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(an)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(We(t));return We(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(gn).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType($e.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType($e.UNIVER_DOC,Mt),this._univerInstanceService.registerCtorForType($e.UNIVER_SLIDE,go);const n=t.get(an);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<Ye.Ready&&(this._injector.get(exports.LifecycleService).stage=Ye.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function JC(e,t){const n=Kc([[Yc],[gn],[_o],[exports.LifecycleService],[exports.PluginService],[$n],[an,{useClass:exports.UniverInstanceService}],[Vc,{useClass:Gc}],[At,{useClass:Fl,lazy:!0}],[yt,{useClass:exports.CommandService}],[en,{useClass:exports.LocalUndoRedoService,lazy:!0}],[po,{useClass:Wc}],[Wn,{useClass:Pl}],[Os,{useClass:Jc,lazy:!0}],[Ii,{useClass:Ri,lazy:!0}],[jc,{useClass:exports.AuthzIoLocalService}],[zc,{useClass:exports.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Ct(n);return Ml(r,[[$n],[Ii]]),r}var qC=Object.defineProperty,ZC=Object.getOwnPropertyDescriptor,eR=(e,t,n,r)=>{for(var s=r>1?void 0:r?ZC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&qC(t,n,s),s},tR=(e,t)=>(n,r)=>t(n,r,e);exports.FBlob=class extends ws{constructor(t,n){super(),this._blob=t,this._injector=n}copyBlob(){return this._injector.createInstance(exports.FBlob,this._blob)}getAs(t){const n=this.copyBlob();return n.setContentType(t),n}getDataAsString(t){return this._blob===null?Promise.resolve(""):t===void 0?this._blob.text():new Promise((n,r)=>{this._blob.arrayBuffer().then(s=>{const i=new TextDecoder(t).decode(s);n(i)}).catch(s=>{r(new Error(`Failed to read Blob as ArrayBuffer: ${s.message}`))})})}getBytes(){return this._blob?this._blob.arrayBuffer().then(t=>new Uint8Array(t)):Promise.reject(new Error("Blob is undefined or null."))}setBytes(t){return this._blob=new Blob([t]),this}setDataFromString(t,n){const r=n!=null?n:"text/plain",s=new Blob([t],{type:r});return this._blob=s,this}getContentType(){var t;return(t=this._blob)==null?void 0:t.type}setContentType(t){var n;return this._blob=(n=this._blob)==null?void 0:n.slice(0,this._blob.size,t),this}};exports.FBlob=eR([tR(1,rt(Ct))],exports.FBlob);var nR=Object.defineProperty,rR=Object.getOwnPropertyDescriptor,sR=(e,t,n,r)=>{for(var s=r>1?void 0:r?rR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&nR(t,n,s),s},iR=(e,t)=>(n,r)=>t(n,r,e);let yi=class extends yc{constructor(e,t){super(t),this.doc=e}};yi=sR([iR(1,rt(Ct))],yi);var Eo=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Eo||{}),Co=(e=>(e.BETWEEN="between",e.EQUAL="equal",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.NOT_BETWEEN="notBetween",e.NOT_EQUAL="notEqual",e))(Co||{}),Ro=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Ro||{}),Io=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(Io||{}),yo=(e=>(e.CUSTOM="custom",e.LIST="list",e.LIST_MULTIPLE="listMultiple",e.NONE="none",e.TEXT_LENGTH="textLength",e.DATE="date",e.TIME="time",e.WHOLE="whole",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e.ANY="any",e))(yo||{});const Dn=class Dn{static get(){if(this._instance)return this._instance;const t=new Dn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in Dn.prototype)this[t]=Dn.prototype[t]}get UniverInstanceType(){return $e}get LifecycleStages(){return Ye}get DataValidationType(){return yo}get DataValidationErrorStyle(){return Eo}get DataValidationRenderMode(){return Ro}get DataValidationOperator(){return Co}get DataValidationStatus(){return Io}get CommandType(){return Yn}get BaselineOffset(){return Pt}get BooleanNumber(){return Ie}get HorizontalAlign(){return vt}get TextDecoration(){return ro}get TextDirection(){return Pn}get VerticalAlign(){return tn}get BorderType(){return Vi}get BorderStyleTypes(){return Qe}get AutoFillSeries(){return zi}get ColorType(){return _t}get CommonHideTypes(){return Gi}get CopyPasteType(){return Ki}get DeleteDirection(){return Xi}get DeveloperMetadataVisibility(){return Qi}get Dimension(){return Ji}get Direction(){return qi}get InterpolationPointType(){return Zi}get LocaleType(){return zn}get MentionType(){return fr}get ProtectionType(){return eo}get RelativeDate(){return to}get SheetTypes(){return no}get ThemeColorType(){return lt}};E(Dn,"_instance");let ds=Dn;const xn=class xn{static get(){if(this._instance)return this._instance;const t=new xn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in xn.prototype)this[t]=xn.prototype[t]}get DocCreated(){return"DocCreated"}get DocDisposed(){return"DocDisposed"}get LifeCycleChanged(){return"LifeCycleChanged"}get Redo(){return"Redo"}get Undo(){return"Undo"}get BeforeRedo(){return"BeforeRedo"}get BeforeUndo(){return"BeforeUndo"}get CommandExecuted(){return"CommandExecuted"}get BeforeCommandExecute(){return"BeforeCommandExecute"}};E(xn,"_instance");let fs=xn;class bs{constructor(){E(this,"_data",[])}static create(){return new bs}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class vo{constructor(){E(this,"_data",new Map)}static create(){return new vo}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}class oR{constructor(){E(this,"_eventRegistry",new Map);E(this,"_eventHandlerMap",new Map);E(this,"_eventHandlerRegisted",new Map)}_ensureEventRegistry(t){return this._eventRegistry.has(t)||this._eventRegistry.set(t,new bs),this._eventRegistry.get(t)}registerEventHandler(t,n){const r=this._eventHandlerMap.get(t);return r?r.add(n):this._eventHandlerMap.set(t,new Set([n])),We(()=>{var s,i,o,a;(s=this._eventHandlerMap.get(t))==null||s.delete(n),(o=(i=this._eventHandlerRegisted.get(t))==null?void 0:i.get(n))==null||o.dispose(),(a=this._eventHandlerRegisted.get(t))==null||a.delete(n)})}removeEvent(t,n){const r=this._ensureEventRegistry(t);if(r.delete(n),r.getData().length===0){const s=this._eventHandlerRegisted.get(t);s==null||s.forEach(i=>i.dispose()),this._eventHandlerRegisted.delete(t)}}addEvent(t,n){this._ensureEventRegistry(t).add(n);let r=this._eventHandlerRegisted.get(t);const s=this._eventHandlerMap.get(t);return r||(r=new Map,this._eventHandlerRegisted.set(t,r),s==null||s.forEach(i=>{r==null||r.set(i,We(i()))})),We(()=>this.removeEvent(t,n))}fireEvent(t,n){var r;return(r=this._eventRegistry.get(t))==null||r.getData().forEach(s=>{s(n)}),n.cancel}}var aR=Object.defineProperty,lR=Object.getOwnPropertyDescriptor,uR=(e,t,n,r)=>{for(var s=r>1?void 0:r?lR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&aR(t,n,s),s},Ba=(e,t)=>(n,r)=>t(n,r,e);exports.FHooks=class extends ws{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return We(this._lifecycleService.lifecycle$.pipe(we.filter(n=>n===Ye.Starting)).subscribe(t))}onReady(t){return We(this._lifecycleService.lifecycle$.pipe(we.filter(n=>n===Ye.Ready)).subscribe(t))}onRendered(t){return We(this._lifecycleService.lifecycle$.pipe(we.filter(n=>n===Ye.Rendered)).subscribe(t))}onSteady(t){return We(this._lifecycleService.lifecycle$.pipe(we.filter(n=>n===Ye.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(yt).beforeCommandExecuted(r=>{if(r.id===$t.id){const i=this._injector.get(en).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(yt).onCommandExecuted(r=>{if(r.id===$t.id){const i=this._injector.get(en).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(yt).beforeCommandExecuted(r=>{if(r.id===Ht.id){const i=this._injector.get(en).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(yt).onCommandExecuted(r=>{if(r.id===Ht.id){const i=this._injector.get(en).pitchTopRedoElement();i&&t(i)}})}};exports.FHooks=uR([Ba(0,rt(Ct)),Ba(1,rt(exports.LifecycleService))],exports.FHooks);var cR=Object.defineProperty,hR=Object.getOwnPropertyDescriptor,dR=(e,t,n,r)=>{for(var s=r>1?void 0:r?hR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&cR(t,n,s),s},ja=(e,t)=>(n,r)=>t(n,r,e);let vi=class extends ws{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};vi=dR([ja(0,rt(Ct)),ja(1,rt($n))],vi);const ps=class ps{static get(){if(this._instance)return this._instance;const t=new ps;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}get rectangle(){return zt}get numfmt(){return uu}get tools(){return ne}};E(ps,"_instance");let gs=ps;var fR=Object.defineProperty,gR=Object.getOwnPropertyDescriptor,pR=(e,t,n,r)=>{for(var s=r>1?void 0:r?gR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&fR(t,n,s),s},Pr=(e,t)=>(n,r)=>t(n,r,e);const Bs=Symbol("initializers");exports.FUniver=class extends Ze{constructor(n,r,s,i){super();E(this,"_eventRegistry",new oR);E(this,"registerEventHandler",(n,r)=>this._eventRegistry.registerEventHandler(n,r));this._injector=n,this._commandService=r,this._univerInstanceService=s,this._lifecycleService=i,this.registerEventHandler(this.Event.LifeCycleChanged,()=>We(this._lifecycleService.lifecycle$.subscribe(a=>{this.fireEvent(this.Event.LifeCycleChanged,{stage:a})}))),this._initUnitEvent(this._injector),this._initBeforeCommandEvent(this._injector),this._initCommandEvent(this._injector),this._injector.onDispose(()=>{this.dispose()});const o=Object.getPrototypeOf(this)[Bs];if(o){const a=this;o.forEach(function(l){l.apply(a,[n])})}}static newAPI(n){return(n instanceof qc?n.__getInjector():n).createInstance(exports.FUniver)}_initialize(n){}static extend(n){Object.getOwnPropertyNames(n.prototype).forEach(r=>{if(r==="_initialize"){let s=this.prototype[Bs];s||(s=[],this.prototype[Bs]=s),s.push(n.prototype._initialize)}else r!=="constructor"&&(this.prototype[r]=n.prototype[r])}),Object.getOwnPropertyNames(n).forEach(r=>{r!=="prototype"&&r!=="name"&&r!=="length"&&(this[r]=n[r])})}_initCommandEvent(n){const r=n.get(yt);this.registerEventHandler(this.Event.Redo,()=>r.onCommandExecuted(s=>{const{id:i,type:o,params:a}=s;if(s.id===Ht.id){const u={id:i,type:o,params:a};this.fireEvent(this.Event.Redo,u)}})),this.registerEventHandler(this.Event.Undo,()=>r.onCommandExecuted(s=>{const{id:i,type:o,params:a}=s;if(s.id===$t.id){const u={id:i,type:o,params:a};this.fireEvent(this.Event.Undo,u)}})),this.registerEventHandler(this.Event.CommandExecuted,()=>r.onCommandExecuted(s=>{const{id:i,type:o,params:a}=s;if(s.id!==Ht.id&&s.id!==$t.id){const u={id:i,type:o,params:a};this.fireEvent(this.Event.CommandExecuted,u)}}))}_initBeforeCommandEvent(n){const r=n.get(yt);this.registerEventHandler(this.Event.BeforeRedo,()=>r.beforeCommandExecuted(s=>{const{id:i,type:o,params:a}=s;if(s.id===Ht.id){const u={id:i,type:o,params:a};if(this.fireEvent(this.Event.BeforeRedo,u),u.cancel)throw new Wr}})),this.registerEventHandler(this.Event.BeforeUndo,()=>r.beforeCommandExecuted(s=>{const{id:i,type:o,params:a}=s;if(s.id===$t.id){const u={id:i,type:o,params:a};if(this.fireEvent(this.Event.BeforeUndo,u),u.cancel)throw new Wr}})),this.registerEventHandler(this.Event.BeforeCommandExecute,()=>r.beforeCommandExecuted(s=>{const{id:i,type:o,params:a}=s;if(s.id!==Ht.id&&s.id!==$t.id){const u={id:i,type:o,params:a};if(this.fireEvent(this.Event.BeforeCommandExecute,u),u.cancel)throw new Wr}}))}_initUnitEvent(n){const r=n.get(an);this.registerEventHandler(this.Event.DocDisposed,()=>r.unitDisposed$.subscribe(s=>{s.type===$e.UNIVER_DOC&&this.fireEvent(this.Event.DocDisposed,{unitId:s.getUnitId(),unitType:s.type,snapshot:s.getSnapshot()})})),this.registerEventHandler(this.Event.DocCreated,()=>r.unitAdded$.subscribe(s=>{if(s.type===$e.UNIVER_DOC){const i=s,o=n.createInstance(yi,i);this.fireEvent(this.Event.DocCreated,{unitId:s.getUnitId(),type:s.type,doc:o,unit:o})}}))}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand($t.id)}redo(){return this._commandService.executeCommand(Ht.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((r,s)=>{n(r,s)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((r,s)=>{n(r,s)})}executeCommand(n,r,s){return this._commandService.executeCommand(n,r,s)}syncExecuteCommand(n,r,s){return this._commandService.syncExecuteCommand(n,r,s)}getHooks(){return this._injector.createInstance(exports.FHooks)}get Enum(){return ds.get()}get Event(){return fs.get()}get Util(){return gs.get()}addEvent(n,r){return this._eventRegistry.addEvent(n,r)}fireEvent(n,r){return this._eventRegistry.fireEvent(n,r)}getUserManager(){return this._injector.createInstance(vi)}newBlob(){return this._injector.createInstance(exports.FBlob)}newColor(){return new Cr}newRichText(n){return sn.create(n)}newRichTextValue(n){return jt.create(n)}newParagraphStyle(n){return Fn.create(n)}newParagraphStyleValue(n){return Kn.create(n)}newTextStyle(n){return Wt.create(n)}newTextStyleValue(n){return Gn.create(n)}newTextDecoration(n){return new Bt(n)}};exports.FUniver=pR([Pr(0,rt(Ct)),Pr(1,yt),Pr(2,an),Pr(3,rt(exports.LifecycleService))],exports.FUniver);function Zc(e){return/^-?\d+(\.\d+)?$/.test(e)}function mR(e){return Zc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function _R(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.close(),t.port2.close()}}function ER(e,t){return t.forEach(n=>e.add(n)),e}function CR(e,t,n,r){var u;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Mt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const c=new ze,h=Vt.getInstance();if(a>0&&c.retain(a),n.length>0){const d=i.sliceBody(a,a+o),f={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(u=d==null?void 0:d.customRanges)!=null&&u.length){const C=d.customRanges[0];f.customRanges=[{...C,startIndex:0,endIndex:n.length-1}]}c.insert(n.length,f)}c.delete(o),i.apply(h.editOp(c.serialize()))}const l=i.getBody();return i.dispose(),l}const RR="__default_document_sub_component_id20231101__";class eh{constructor(){E(this,"skipNextObservers",!1);E(this,"lastReturnValue");E(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class IR extends we.Subject{constructor(){super(...arguments);E(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new eh;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function yR(e){return new we.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const vR=mt("ILocalStorageService");function SR(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function wR(e){return new Promise(t=>setTimeout(t,e))}function OR(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var So=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(So||{}),th=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(th||{});const Si=mt("core.image-io.service");class nh{constructor(t,n=100){E(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new gr(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n);let o=this._imageCacheMap.get(i);return o||((async()=>{o=new Image;const a=this._injector.has(Si)?this._injector.get(Si):null;if(t===So.UUID)try{o.src=await(a==null?void 0:a.getImage(n))||""}catch(l){console.error(l)}else o.src=n;o.onload=()=>{r==null||r()},o.onerror=()=>{s==null||s()},this._imageCacheMap.set(i,o)})(),null)}}const bR=["script","style","meta","comment","link"];var rh=(e=>(e[e.DISABLED=0]="DISABLED",e[e.FULL_ALPHA=1]="FULL_ALPHA",e[e.FULL_HANGUL=2]="FULL_HANGUL",e[e.FULL_KATAKANA=3]="FULL_KATAKANA",e[e.HALF_ALPHA=4]="HALF_ALPHA",e[e.HALF_HANGUL=5]="HALF_HANGUL",e[e.HALF_KATAKANA=6]="HALF_KATAKANA",e[e.HIRAGANA=7]="HIRAGANA",e[e.NO_CONTROL=8]="NO_CONTROL",e[e.OFF=9]="OFF",e[e.ON=10]="ON",e))(rh||{}),AR=Object.defineProperty,TR=Object.getOwnPropertyDescriptor,NR=(e,t,n,r)=>{for(var s=r>1?void 0:r?TR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&AR(t,n,s),s},MR=(e,t)=>(n,r)=>t(n,r,e);exports.Skeleton=class extends Ze{constructor(n){super();E(this,"_fontLocale");E(this,"_dirty",!0);this._localeService=n,this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(n){this._dirty=n}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}};exports.Skeleton=NR([MR(0,rt(gn))],exports.Skeleton);var DR=Object.defineProperty,xR=Object.getOwnPropertyDescriptor,LR=(e,t,n,r)=>{for(var s=r>1?void 0:r?xR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&DR(t,n,s),s},kr=(e,t)=>(n,r)=>t(n,r,e);exports.SheetSkeleton=class extends exports.Skeleton{constructor(n,r,s,i,o,a){super(s);E(this,"_worksheetData");E(this,"_renderRawFormula",!1);E(this,"_cellData");E(this,"_imageCacheMap");E(this,"_isRowStylePrecedeColumnStyle",!1);E(this,"_skipAutoHeightForMergedCells",!0);E(this,"_rowTotalHeight",0);E(this,"_columnTotalWidth",0);E(this,"_rowHeaderWidth",0);E(this,"_columnHeaderHeight",0);E(this,"_rowHeightAccumulation",[]);E(this,"_columnWidthAccumulation",[]);E(this,"_marginTop",0);E(this,"_marginLeft",0);E(this,"_scaleX");E(this,"_scaleY");E(this,"_scrollX");E(this,"_scrollY");this.worksheet=n,this._styles=r,this._contextService=i,this._configService=o,this._injector=a,this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new nh(this._injector),this.initConfig()}initConfig(){var n,r;this._skipAutoHeightForMergedCells=!((n=this._configService.getConfig(_l))!=null&&n),this._isRowStylePrecedeColumnStyle=(r=this._configService.getConfig(ml))!=null?r:!1}_resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(n){this._columnHeaderHeight=n,this._worksheetData.columnHeader.height=n}set rowHeaderWidth(n){this._rowHeaderWidth=n,this._worksheetData.rowHeader.width=n}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(n){this._marginLeft=n}setMarginTop(n){this._marginTop=n}setScale(n,r){this._updateLayout(),this._scaleX=n,this._scaleY=r||n,this._updateLayout()}setScroll(n,r){ne.isDefine(n)&&(this._scrollX=n),ne.isDefine(r)&&(this._scrollY=r)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}_generateRowMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let u=s;if(this.worksheet.getRowFiltered(l))u=0;else if(a[l]!=null){const c=a[l];if(!c)continue;const{h=s,ah:d,ia:f}=c;(f==null||f===Ie.TRUE)&&typeof d=="number"?u=d:u=h,c.hd===Ie.TRUE&&(u=0)}i+=u,o.push(i)}return{rowTotalHeight:i,rowHeightAccumulation:o}}_generateColumnMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let u=s;if(a[l]!=null){const c=a[l];if(!c)continue;c.w!=null&&(u=c.w),c.hd===Ie.TRUE&&(u=0)}i+=u,o.push(i)}return{columnTotalWidth:i,columnWidthAccumulation:o}}intersectMergeRange(n,r){return!!this.worksheet.getMergedCell(n,r)}_getOverflowBound(n,r,s,i,o=vt.LEFT){let a=0;if(r>s){const l=this._columnWidthAccumulation.length-1;for(let u=r;u>=s;u--){const c=u,h=this.worksheet.getCell(n,c);if(!ai(h)&&c!==r||this.intersectMergeRange(n,c))return c===r?c:c+1>l?l:c+1;const{startX:d,endX:f}=Sn(n,c,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===vt.CENTER&&c===r?a+=(f-d)/2:a+=f-d,i<a)return c}return r}for(let l=r;l<=s;l++){const u=l,c=this.worksheet.getCell(n,u);if(!ai(c)&&u!==r||this.intersectMergeRange(n,u))return u===r?u:u-1<0?0:u-1;const{startX:h,endX:d}=Sn(n,u,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===vt.CENTER&&u===r?a+=(d-h)/2:a+=d-h,i<a)return u}return s}_updateLayout(){if(!this.dirty)return;const{rowData:n,columnData:r,defaultRowHeight:s,defaultColumnWidth:i,rowCount:o,columnCount:a,rowHeader:l,columnHeader:u}=this._worksheetData,{rowTotalHeight:c,rowHeightAccumulation:h}=this._generateRowMatrixCache(o,n,s),{columnTotalWidth:d,columnWidthAccumulation:f}=this._generateColumnMatrixCache(a,r,i);this._rowHeaderWidth=l.hidden!==Ie.TRUE?this._dynamicallyUpdateRowHeaderWidth(l):0,this._columnHeaderHeight=u.hidden!==Ie.TRUE?u.height:0,this._rowTotalHeight=c,this._rowHeightAccumulation=h,this._columnTotalWidth=d,this._columnWidthAccumulation=f,this.makeDirty(!1)}calculate(){return this._resetCache(),this._updateLayout(),this}_dynamicallyUpdateRowHeaderWidth(n){const s=`${this.worksheet.getRowCount()}`.length*8;return Math.max(n.width,s)}_hasUnMergedCellInRow(n,r,s){if(!this.worksheet.getMergeData())return!1;for(let o=r;o<=s;o++){const{isMerged:a,isMergedMainCell:l}=this.worksheet.getCellInfoInMergeData(n,o);if(!a&&!l)return!0}return!1}expandRangeByMerge(n){let{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;const a=this._worksheetData.mergeData;if(!a)return{startRow:r,startColumn:s,endRow:i,endColumn:o};let l=!0;const u=new Tt;for(;l;){l=!1;for(let c=0;c<a.length;c++){const{startRow:h,startColumn:d,endRow:f,endColumn:C}=a[c];if(u.getValue(h,d))continue;du({startColumn:s,startRow:r,endColumn:o,endRow:i},{startColumn:d,startRow:h,endColumn:C,endRow:f})&&(r=Math.min(r,h),s=Math.min(s,d),i=Math.max(i,f),o=Math.max(o,C),u.setValue(h,d,!0),l=!0)}}return{startRow:r,startColumn:s,endRow:i,endColumn:o}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(n,r){return this.worksheet.getCellInfoInMergeData(n,r)}getNoMergeCellPositionByIndex(n,r,s=!0){return this.getNoMergeCellWithCoordByIndex(n,r,s)}getNoMergeCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this;let{startY:u,endY:c,startX:h,endX:d}=Sn(n,r,i,o);return s&&(u+=l,c+=l,h+=a,d+=a),{startY:u,endY:c,startX:h,endX:d}}getNoMergeCellPositionByIndexWithNoHeader(n,r){const{rowHeightAccumulation:s,columnWidthAccumulation:i}=this,{startY:o,endY:a,startX:l,endX:u}=Sn(n,r,s,i);return{startY:o,endY:a,startX:l,endX:u}}getRowIndexByOffsetY(n,r,s,i){var l;const{rowHeightAccumulation:o}=this;n=ih(n,r,s,this.columnHeaderHeightAndMarginTop);let a=er(o,n,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(o[a]-n)<Math.abs(n-((l=o[a-1])!=null?l:0))&&(a=a+1),a}getColumnIndexByOffsetX(n,r,s,i){var u;const o=sh(n,r,s,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this;let l=er(a,o,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(a[l]-o)<Math.abs(o-((u=a[l-1])!=null?u:0))&&(l=l+1),l}getCellIndexByOffset(n,r,s,i,o,a){const l=this.getRowIndexByOffsetY(r,i,o,a),u=this.getColumnIndexByOffsetX(n,s,o,a);return{row:l,column:u}}getCellByOffset(n,r,s,i,o){const a=this==null?void 0:this.getCellIndexByOffset(n,r,s,i,o,{firstMatch:!0});return a?this.worksheet.getCellInfoInMergeData(a.row,a.column):null}getCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this,u=Sn(n,r,i,o,this.worksheet.getCellInfoInMergeData(n,r)),{isMerged:c,isMergedMainCell:h}=u;let{startY:d,endY:f,startX:C,endX:R,mergeInfo:v}=u,M=a,Q=l;return s===!1&&(M=0,Q=0),d+=Q,f+=Q,C+=M,R+=M,v.startY+=Q,v.endY+=Q,v.startX+=M,v.endX+=M,{actualRow:n,actualColumn:r,startX:C,startY:d,endX:R,endY:f,isMerged:c,isMergedMainCell:h,mergeInfo:v}}getCellWithCoordByOffset(n,r,s,i,o,a){const{row:l,column:u}=this.getCellIndexByOffset(n,r,s,i,o,a);return this.getCellWithCoordByIndex(l,u)}getOffsetByColumn(n){const{columnWidthAccumulation:r,rowHeaderWidthAndMarginLeft:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetByRow(n){const{rowHeightAccumulation:r,columnHeaderHeightAndMarginTop:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetRelativeToRowCol(n,r){const s=er(this.columnWidthAccumulation,n);let i=0;s===0?i=n:i=n-this._columnWidthAccumulation[s-1];const o=er(this.rowHeightAccumulation,r);let a=0;return o===0?a=r:a=r-this._rowHeightAccumulation[o-1],{row:o,column:s,columnOffset:i,rowOffset:a}}_updateConfigAndGetDocumentModel(n,r,s,i){var a,l,u,c,h;if(!i||!((a=n.body)!=null&&a.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(l=s.t)!=null?l:0,n.documentStyle.marginBottom=(u=s.b)!=null?u:2,n.documentStyle.marginLeft=(c=s.l)!=null?c:2,n.documentStyle.marginRight=(h=s.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig={...n.documentStyle.renderConfig,...i};const o=n.body.paragraphs||[];for(const d of o)d.paragraphStyle||(d.paragraphStyle={}),d.paragraphStyle.horizontalAlign=r;return new Mt(n)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null}};exports.SheetSkeleton=LR([kr(2,rt(gn)),kr(3,Wn),kr(4,po),kr(5,rt(Ct))],exports.SheetSkeleton);function wo(e,t,n,r){const s=e-1,i=t-1,o=n[s]||0;let a=n[e];a==null&&(a=n[n.length-1]);const l=r[i]||0;let u=r[t];return u==null&&(u=r[r.length-1]),{startY:o,endY:a,startX:l,endX:u}}function UR(e,t,n,r){return wo(e,t,n,r)}function Sn(e,t,n,r,s){e=ne.clamp(e,0,n.length-1),t=ne.clamp(t,0,r.length-1);let{startY:i,endY:o,startX:a,endX:l}=wo(e,t,n,r);if(!s)return{startY:i,endY:o,startX:a,endX:l,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:i,endY:o,startX:a,endX:l,startRow:e,startColumn:t,endRow:e,endColumn:t}};const{isMerged:u,isMergedMainCell:c,startRow:h,startColumn:d,endRow:f,endColumn:C}=s;let R={startRow:h,startColumn:d,endRow:f,endColumn:C,startY:i,endY:o,startX:a,endX:l};const v=n.length-1,M=r.length-1;if(u&&h!==-1&&d!==-1){const Q=n[h-1]||0,z=n[f]||n[v],de=r[d-1]||0,N=r[C]||r[M];R={...R,startY:Q,endY:z,startX:de,endX:N}}else if(!u&&f!==-1&&C!==-1){const Q=n[f]||n[v],z=r[C]||r[M];R={...R,startY:i,endY:Q,startX:a,endX:z}}return{isMerged:u,isMergedMainCell:c,actualRow:e,actualColumn:t,startY:i,endY:o,startX:a,endX:l,mergeInfo:R}}function sh(e,t,n,r){const{x:s}=n;return e/t+s-r}function ih(e,t,n,r){const{y:s}=n;return e=e/t+s-r,e}const Wa=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],js=1,Jn=8;class Oo{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==js)throw new Error(`Got v${s} data when expected v${js}.`);const i=Wa[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new Oo(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Wa.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Jn,t),this.coords=new this.ArrayType(this.data,Jn+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Jn+o+a+l),this.ids=new this.IndexArrayType(this.data,Jn,t),this.coords=new this.ArrayType(this.data,Jn+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(js<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return wi(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],u=[];for(;l.length;){const c=l.pop()||0,h=l.pop()||0,d=l.pop()||0;if(h-d<=a){for(let v=d;v<=h;v++){const M=o[2*v],Q=o[2*v+1];M>=t&&M<=r&&Q>=n&&Q<=s&&u.push(i[v])}continue}const f=d+h>>1,C=o[2*f],R=o[2*f+1];C>=t&&C<=r&&R>=n&&R<=s&&u.push(i[f]),(c===0?t<=C:n<=R)&&(l.push(d),l.push(f-1),l.push(1-c)),(c===0?r>=C:s>=R)&&(l.push(f+1),l.push(h),l.push(1-c))}return u}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],u=r*r;for(;a.length;){const c=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let v=d;v<=h;v++)Ya(i[2*v],i[2*v+1],t,n)<=u&&l.push(s[v]);continue}const f=d+h>>1,C=i[2*f],R=i[2*f+1];Ya(C,R,t,n)<=u&&l.push(s[f]),(c===0?t-r<=C:n-r<=R)&&(a.push(d),a.push(f-1),a.push(1-c)),(c===0?t+r>=C:n+r>=R)&&(a.push(f+1),a.push(h),a.push(1-c))}return l}}function wi(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;oh(e,t,o,r,s,i),wi(e,t,n,r,o-1,1-i),wi(e,t,n,o+1,s,1-i)}function oh(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const u=s-r+1,c=n-r+1,h=Math.log(u),d=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*d*(u-d)/u)*(c-u/2<0?-1:1),C=Math.max(r,Math.floor(n-c*d/u+f)),R=Math.min(s,Math.floor(n+(u-c)*d/u+f));oh(e,t,n,C,R,i)}const o=t[2*n+i];let a=r,l=s;for(qn(e,t,r,n),t[2*s+i]>o&&qn(e,t,r,s);a<l;){for(qn(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?qn(e,t,r,l):(l++,qn(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function qn(e,t,n,r){Ws(e,n,r),Ws(t,2*n,2*r),Ws(t,2*n+1,2*r+1)}function Ws(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ya(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function ah(e,t,n=0,r=e.length-1,s=PR){for(;r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),f=Math.max(n,Math.floor(t-u*h/l+d)),C=Math.min(r,Math.floor(t+(l-u)*h/l+d));ah(e,t,f,C,s)}const i=e[t];let o=n,a=r;for(Zn(e,n,t),s(e[r],i)>0&&Zn(e,n,r);o<a;){for(Zn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?Zn(e,n,a):(a++,Zn(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function Zn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function PR(e,t){return e<t?-1:e>t?1:0}class Oi{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!$r(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;$r(t,l)&&(n.leaf?r.push(a):zs(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!$r(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if($r(t,o)){if(n.leaf||zs(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=wn([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,u;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),u=!0),r.leaf){const c=kR(t,r.children,n);if(c!==-1)return r.children.splice(c,1),i.push(r),this._condense(i),this}!u&&!r.leaf&&zs(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],u=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=wn(t.slice(n,r+1)),yn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=wn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),u=l*Math.ceil(Math.sqrt(o));za(t,n,r,u,this.compareMinX);for(let c=n;c<=r;c+=u){const h=Math.min(c+u-1,r);za(t,c,h,l,this.compareMinY);for(let d=c;d<=h;d+=l){const f=Math.min(d+l-1,h);a.children.push(this._build(t,d,f,s-1))}}return yn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const u=n.children[l],c=Ys(u),h=HR(t,u)-c;h<o?(o=h,i=c<i?c:i,a=u):h===o&&c<i&&(i=c,a=u)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),lr(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=wn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,yn(r,this.toBBox),yn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=wn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,yn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=ar(t,0,a,this.toBBox),u=ar(t,a,r,this.toBBox),c=BR(l,u),h=Ys(l)+Ys(u);c<i?(i=c,s=a,o=h<o?h:o):c===i&&h<o&&(o=h,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:FR,i=t.leaf?this.compareMinY:$R,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=ar(t,0,n,i),a=ar(t,r-n,r,i);let l=Fr(o)+Fr(a);for(let u=n;u<r-n;u++){const c=t.children[u];lr(o,t.leaf?i(c):c),l+=Fr(o)}for(let u=r-n-1;u>=n;u--){const c=t.children[u];lr(a,t.leaf?i(c):c),l+=Fr(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)lr(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():yn(t[n],this.toBBox)}}function kR(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function yn(e,t){ar(e,0,e.children.length,t,e)}function ar(e,t,n,r,s){s||(s=wn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];lr(s,e.leaf?r(o):o)}return s}function lr(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function FR(e,t){return e.minX-t.minX}function $R(e,t){return e.minY-t.minY}function Ys(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Fr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function HR(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function BR(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function zs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function $r(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function wn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function za(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;ah(e,o,t,n,s),i.push(t,o,o,n)}}class jR{constructor(t=!1){E(this,"_tree",new Map);E(this,"_oneCellCache",new Map);E(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Oi),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const u=l.get(s);u&&u.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:u,endRow:c,endColumn:h}=s;for(let d=l;d<=c;d++){const f=a.get(d);if(f)for(let C=u;C<=h;C++){const R=f.get(C);R&&R.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var C;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,u=(C=this._kdTree.get(n))==null?void 0:C.get(r);if(!u)return[];const{tree:c,items:h}=u,d=c.range(o,i,l,a),f=[];for(const R of d){const v=h[R];f.push(...Array.from(v.ids))}return f}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new Oo(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:u}=s;if(this._enableOneCellCache&&o===a&&l===u){this._insertOneCellCache(n,r,o,l,i);return}const c=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(u)&&(u=Number.POSITIVE_INFINITY),c.insert({minX:l,minY:o,maxX:u,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const u of l)yield u}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:u}=s;this._enableOneCellCache?o===l&&a===u?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Oi;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}dh();exports.ABCToNumber=R_;exports.AUTO_HEIGHT_FOR_MERGED_CELLS=_l;exports.AbsoluteRefType=nt;exports.ActionIterator=vn;exports.AlignTypeH=Fu;exports.AlignTypeV=$u;exports.ArrangeTypeEnum=ju;exports.ArrowsAndMarkersShapes=Vl;exports.AsyncInterceptorManager=WE;exports.AutoFillSeries=zi;exports.BaselineOffset=Pt;exports.BasicShapes=zl;exports.BlockType=_u;exports.BooleanNumber=Ie;exports.BorderStyleTypes=Qe;exports.BorderType=Vi;exports.BuildTextUtils=it;exports.BulletAlignment=Ir;exports.COLORS=oi;exports.CanceledError=Wr;exports.CellModeEnum=On;exports.CellValueType=nn;exports.Color=_n;exports.ColorBuilder=Cr;exports.ColorKit=bt;exports.ColorType=_t;exports.ColumnSeparatorType=Ru;exports.CommandType=Yn;exports.CommonHideTypes=Gi;exports.ConfigService=Wc;exports.ContextService=Pl;exports.CopyPasteType=Ki;exports.CustomCommandExecutionError=ri;exports.CustomDecorationType=fn;exports.CustomRangeType=on;exports.DEFAULT_CELL=a_;exports.DEFAULT_DOC=fo;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=RR;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=pl;exports.DEFAULT_RANGE=i_;exports.DEFAULT_RANGE_ARRAY=s_;exports.DEFAULT_SELECTION=o_;exports.DEFAULT_SLIDE=cu;exports.DEFAULT_STYLES=ut;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=Ac;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=nC;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Dc;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=oC;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Nc;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=sC;exports.DEFAULT_WORKSHEET_ROW_COUNT=bc;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=tC;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Tc;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=rC;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Mc;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=iC;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ki;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Pi;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=gl;exports.DOC_RANGE_TYPE=nu;exports.DashStyleType=bu;exports.DataStreamTreeNodeType=Ec;exports.DataStreamTreeTokenType=qt;exports.DataValidationErrorStyle=Eo;exports.DataValidationImeMode=rh;exports.DataValidationOperator=Co;exports.DataValidationRenderMode=Ro;exports.DataValidationStatus=Io;exports.DataValidationType=yo;exports.DeleteDirection=Xi;exports.DependentOn=GC;exports.DesktopLogService=Fl;exports.DeveloperMetadataVisibility=Qi;exports.Dimension=Ji;exports.Direction=qi;exports.Disposable=Ze;exports.DisposableCollection=Is;exports.DocStyleType=pu;exports.DocumentDataModel=Mt;exports.DocumentFlavor=ao;exports.DrawingTypeEnum=Wu;exports.EDITOR_ACTIVATED=Pc;exports.EXTENSION_NAMES=hu;exports.ErrorService=Yc;exports.EventState=eh;exports.EventSubject=IR;exports.FBase=ws;exports.FBaseInitialable=yc;exports.FEnum=ds;exports.FEventName=fs;exports.FOCUSING_COMMON_DRAWINGS=RC;exports.FOCUSING_DOC=ir;exports.FOCUSING_EDITOR_BUT_HIDDEN=gC;exports.FOCUSING_EDITOR_INPUT_FORMULA=pC;exports.FOCUSING_EDITOR_STANDALONE=_C;exports.FOCUSING_FX_BAR_EDITOR=kc;exports.FOCUSING_PANEL_EDITOR=EC;exports.FOCUSING_SHEET=Tn;exports.FOCUSING_SLIDE=or;exports.FOCUSING_UNIT=sr;exports.FOCUSING_UNIVER_EDITOR=mC;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=CC;exports.FORMULA_EDITOR_ACTIVATED=IC;exports.FUtil=gs;exports.FollowNumberWithType=mu;exports.FontItalic=ss;exports.FontStyleType=bn;exports.FontWeight=is;exports.GridType=Eu;exports.HLSColor=Zl;exports.HorizontalAlign=vt;exports.IAuthzIoService=jc;exports.ICommandService=yt;exports.IConfigService=po;exports.IContextService=Wn;exports.IImageIoService=Si;exports.ILocalStorageService=vR;exports.ILogService=At;exports.IMentionIOService=zc;exports.IPermissionService=Vc;exports.IResourceLoaderService=Ii;exports.IResourceManagerService=Os;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=ml;exports.IUndoRedoService=en;exports.IUniverInstanceService=an;exports.ImageCacheMap=nh;exports.ImageSourceType=So;exports.ImageUploadStatusType=th;exports.Inject=rt;exports.Injector=Ct;exports.InterceptorEffectEnum=An;exports.InterceptorManager=HE;exports.InterpolationPointType=Zi;exports.JSON1=L_;exports.JSONX=Vt;exports.LRUHelper=nr;exports.LRUMap=gr;exports.LifecycleStages=Ye;exports.ListGlyphType=Ne;exports.LocaleService=gn;exports.LocaleType=zn;exports.LogLevel=kl;exports.MOVE_BUFFER_VALUE=tr;exports.Many=Ol;exports.MemoryCursor=Vn;exports.MentionType=fr;exports.NamedStyleType=wu;exports.NilCommand=$l;exports.NumberUnitType=ku;exports.ObjectMatrix=Tt;exports.ObjectRelativeFromH=Uu;exports.ObjectRelativeFromV=Pu;exports.Optional=bl;exports.OtherShapes=Gl;exports.PRESET_LIST_TYPE=vr;exports.PageElementType=Yu;exports.PageOrientType=Bu;exports.PageType=lo;exports.ParagraphElementType=yu;exports.ParagraphStyleBuilder=Fn;exports.ParagraphStyleValue=Kn;exports.PermissionService=Gc;exports.PermissionStatus=mo;exports.Plugin=Ci;exports.PositionedObjectLayoutType=Su;exports.PresetListType=Ut;exports.ProtectionType=eo;exports.QuickListType=oc;exports.QuickListTypeMap=H_;exports.RANGE_DIRECTION=tu;exports.RANGE_TYPE=xe;exports.RBush=Oi;exports.RCDisposable=ep;exports.RGBA_PAREN=Np;exports.RGB_PAREN=Tp;exports.ROTATE_BUFFER_VALUE=Yl;exports.RTree=jR;exports.Range=kn;exports.Rectangle=zt;exports.RediError=pt;exports.RedoCommand=Ht;exports.RedoCommandId=Hc;exports.RefAlias=C_;exports.Registry=bs;exports.RegistryAsMap=vo;exports.RelativeDate=to;exports.RelativeSlideLink=zu;exports.ResourceManagerService=Jc;exports.RgbColor=os;exports.RichTextBuilder=sn;exports.RichTextValue=jt;exports.RxDisposable=Zg;exports.SHEET_EDITOR_UNITS=l_;exports.SectionType=Cu;exports.Self=wl;exports.SheetTypes=no;exports.SheetViewModel=Lc;exports.SkipSelf=Sl;exports.SliceBodyType=ho;exports.SlideDataModel=go;exports.SpacingRule=Ou;exports.SpecialShapes=Kl;exports.Styles=vc;exports.THEME_COLORS=ql;exports.TabStopAlignment=Au;exports.TableAlignmentType=Nu;exports.TableLayoutType=Mu;exports.TableRowHeightRule=xu;exports.TableSizeType=Tu;exports.TableTextWrapType=Du;exports.TextDecoration=ro;exports.TextDecorationBuilder=Bt;exports.TextDirection=Pn;exports.TextDirectionType=Iu;exports.TextStyleBuilder=Wt;exports.TextStyleValue=Gn;exports.TextX=ze;exports.TextXActionType=ce;exports.ThemeColor=as;exports.ThemeColorType=lt;exports.ThemeColors=ys;exports.ThemeService=_o;exports.Tools=ne;exports.UndoCommand=$t;exports.UndoCommandId=Bc;exports.UnitModel=Ss;exports.Univer=qc;exports.UniverInstanceType=$e;exports.UpdateDocsAttributeType=Pe;exports.UserManagerService=$n;exports.VerticalAlign=tn;exports.VerticalAlignmentType=Lu;exports.WithNew=Al;exports.Worksheet=pr;exports.WrapStrategy=mn;exports.WrapTextType=vu;exports.addLinkToDocumentModel=Sc;exports.afterInitApply=cp;exports.afterTime=up;exports.awaitTime=wR;exports.binSearchFirstGreaterThanTarget=Wl;exports.binarySearchArray=hp;exports.bufferDebounceTime=lp;exports.cellToRange=sm;exports.characterSpacingControlType=Hu;exports.checkForSubstrings=im;exports.checkIfMove=fp;exports.checkParagraphHasBullet=Bm;exports.checkParagraphHasIndent=jm;exports.checkParagraphHasIndentByStyle=ou;exports.codeToBlob=dp;exports.composeBody=mi;exports.composeInterceptors=Ic;exports.composeStyles=si;exports.concatMatrixArray=e_;exports.convertBodyToHtml=Ap;exports.convertCellToRange=ru;exports.covertTextRunToHtml=ii;exports.createAsyncInterceptorKey=BE;exports.createDefaultUser=cs;exports.createDocumentModelWithStyle=rr;exports.createIdentifier=mt;exports.createInterceptorKey=$E;exports.createInternalEditorID=Ig;exports.createRowColIter=hi;exports.dayjs=Kt;exports.debounce=og;exports.dedupe=pg;exports.deepCompare=io;exports.delayAnimationFrame=OR;exports.deleteContent=lu;exports.extractPureTextFromCell=Uc;exports.forwardRef=Lg;exports.fromCallback=Hl;exports.fromEventSubject=yR;exports.fromObservable=qg;exports.generateRandomId=Yt;exports.get=kf;exports.getArrayLength=rn;exports.getBodySlice=Nt;exports.getBodySliceHtml=Yr;exports.getBorderStyleType=tm;exports.getCellCoordByIndexSimple=wo;exports.getCellInfoInMergeData=Xp;exports.getCellPositionByIndexSimple=UR;exports.getCellValueType=zp;exports.getCellWithCoordByIndexCore=Sn;exports.getColorStyle=xt;exports.getCustomBlockSlice=cc;exports.getCustomDecorationSlice=dc;exports.getCustomRangeSlice=hc;exports.getDocsUpdateBody=nm;exports.getIntersectRange=du;exports.getOriginCellValue=lC;exports.getParagraphsSlice=uc;exports.getReverseDirection=gp;exports.getSectionBreakSlice=X_;exports.getTableSlice=lc;exports.getTextRunSlice=us;exports.getTransformOffsetX=sh;exports.getTransformOffsetY=ih;exports.getWorksheetUID=fC;exports.groupBy=Eg;exports.handleStyleToString=em;exports.hashAlgorithm=zm;exports.horizontalLineSegmentsSubtraction=vs;exports.insertMatrixArray=li;exports.insertTextToContent=au;exports.isAsyncDependencyItem=qs;exports.isAsyncHook=Br;exports.isBlackColor=jp;exports.isBooleanString=Rg;exports.isCellCoverable=ai;exports.isCellV=Gp;exports.isClassDependencyItem=Xs;exports.isCtor=$i;exports.isDisposable=ti;exports.isEmptyCell=su;exports.isFactoryDependencyItem=Qs;exports.isFormulaId=Zp;exports.isFormulaString=qp;exports.isICellData=Yp;exports.isInternalEditorID=El;exports.isNodeEnv=bp;exports.isNotNullOrUndefined=wc;exports.isNullCell=Vp;exports.isNumeric=Zc;exports.isRangesEqual=GE;exports.isRealNum=Ym;exports.isSafeNumeric=mR;exports.isSameStyleTextRun=iu;exports.isUnitRangesEqual=KE;exports.isValidRange=rm;exports.isValueDependencyItem=Js;exports.isWhiteColor=Wp;exports.makeArray=Cg;exports.makeCellRangeToRangeData=Jp;exports.makeCellToSelection=Qp;exports.makeCustomRangeStream=NE;exports.merge=Li;exports.mergeOverrideWithDependencies=Kc;exports.mergeSets=ER;exports.mergeWith=cg;exports.mergeWorksheetSnapshotWithDefault=xc;exports.mixinClass=YE;exports.moveMatrixArray=ci;exports.moveRangeByOffset=u_;exports.nameCharacterCheck=SR;exports.normalizeBody=Q_;exports.normalizeTextRuns=yr;exports.numberToABC=y_;exports.numberToListABC=v_;exports.numfmt=uu;exports.queryObjectMatrix=E_;exports.registerDependencies=Xg;exports.remove=_r;exports.repeatStringNumTimes=gu;exports.replaceInDocumentBody=CR;exports.requestImmediateMacroTask=_R;exports.rotate=_g;exports.searchArray=er;exports.searchInOrderedArray=jl;exports.selectionToArray=Kp;exports.sequence=Ll;exports.sequenceAsync=xl;exports.sequenceExecute=Yi;exports.sequenceExecuteAsync=ap;exports.set=dg;exports.setDependencies=xg;exports.shallowEqual=Dl;exports.skipParseTagNames=bR;exports.sliceMatrixArray=t_;exports.sortRules=S_;exports.sortRulesByDesc=w_;exports.sortRulesFactory=Rr;exports.spliceArray=ui;exports.splitIntoGrid=oo;exports.takeAfter=Bl;exports.textDiff=Ui;exports.throttle=FE;exports.toDisposable=We;exports.touchDependencies=Ml;exports.updateAttributeByDelete=fc;exports.updateAttributeByInsert=gc;