index.js 389 KB

123456789101112
  1. (function(d,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("rxjs"),require("rxjs/operators"),require("react")):typeof define=="function"&&define.amd?define(["exports","rxjs","rxjs/operators","react"],Ce):(d=typeof globalThis<"u"?globalThis:d||self,Ce(d.UniverCore={},d.rxjs,d.rxjs.operators,d.React))})(this,function(d,Ce,xt,lt){"use strict";var JR=Object.defineProperty;var qR=(d,Ce,xt)=>Ce in d?JR(d,Ce,{enumerable:!0,configurable:!0,writable:!0,value:xt}):d[Ce]=xt;var R=(d,Ce,xt)=>qR(d,typeof Ce!="symbol"?Ce+"":Ce,xt);var oh,ah;function uh(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 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 bt=uh(lt);function hh(){dh()}const wr=typeof global<"u"?global:typeof self<"u"?self:window;function dh(){typeof wr.requestIdleCallback!="function"&&(wr.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 wr.cancelIdleCallback!="function"&&(wr.cancelIdleCallback=function(n){clearTimeout(n)})}var wo=typeof global=="object"&&global&&global.Object===Object&&global,fh=typeof self=="object"&&self&&self.Object===Object&&self,hn=wo||fh||Function("return this")(),vn=hn.Symbol,Ao=Object.prototype,gh=Ao.hasOwnProperty,mh=Ao.toString,Qn=vn?vn.toStringTag:void 0;function _h(e){var t=gh.call(e,Qn),n=e[Qn];try{e[Qn]=void 0;var r=!0}catch{}var s=mh.call(e);return r&&(t?e[Qn]=n:delete e[Qn]),s}var ph=Object.prototype,Eh=ph.toString;function Ch(e){return Eh.call(e)}var Rh="[object Null]",Ih="[object Undefined]",To=vn?vn.toStringTag:void 0;function Jn(e){return e==null?e===void 0?Ih:Rh:To&&To in Object(e)?_h(e):Ch(e)}function yn(e){return e!=null&&typeof e=="object"}var vh="[object Symbol]";function Ar(e){return typeof e=="symbol"||yn(e)&&Jn(e)==vh}function yh(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 Sn=Array.isArray,No=vn?vn.prototype:void 0,Mo=No?No.toString:void 0;function Do(e){if(typeof e=="string")return e;if(Sn(e))return yh(e,Do)+"";if(Ar(e))return Mo?Mo.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Sh=/\s/;function Oh(e){for(var t=e.length;t--&&Sh.test(e.charAt(t)););return t}var bh=/^\s+/;function wh(e){return e&&e.slice(0,Oh(e)+1).replace(bh,"")}function vt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Lo=NaN,Ah=/^[-+]0x[0-9a-f]+$/i,Th=/^0b[01]+$/i,Nh=/^0o[0-7]+$/i,Mh=parseInt;function Uo(e){if(typeof e=="number")return e;if(Ar(e))return Lo;if(vt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=vt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wh(e);var n=Th.test(e);return n||Nh.test(e)?Mh(e.slice(2),n?2:8):Ah.test(e)?Lo:+e}function Po(e){return e}var Dh="[object AsyncFunction]",Lh="[object Function]",Uh="[object GeneratorFunction]",Ph="[object Proxy]";function Ts(e){if(!vt(e))return!1;var t=Jn(e);return t==Lh||t==Uh||t==Dh||t==Ph}var Ns=hn["__core-js_shared__"],Fo=function(){var e=/[^.]+$/.exec(Ns&&Ns.keys&&Ns.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Fh(e){return!!Fo&&Fo in e}var kh=Function.prototype,$h=kh.toString;function xh(e){if(e!=null){try{return $h.call(e)}catch{}try{return e+""}catch{}}return""}var Bh=/[\\^$.*+?()[\]{}|]/g,Hh=/^\[object .+?Constructor\]$/,jh=Function.prototype,Wh=Object.prototype,zh=jh.toString,Yh=Wh.hasOwnProperty,Vh=RegExp("^"+zh.call(Yh).replace(Bh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gh(e){if(!vt(e)||Fh(e))return!1;var t=Ts(e)?Vh:Hh;return t.test(xh(e))}function Kh(e,t){return e==null?void 0:e[t]}function Ms(e,t){var n=Kh(e,t);return Gh(n)?n:void 0}var ko=Object.create,Xh=function(){function e(){}return function(t){if(!vt(t))return{};if(ko)return ko(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 Tr=function(){try{var e=Ms(Object,"defineProperty");return e({},"",{}),e}catch{}}(),rd=Tr?function(e,t){return Tr(e,"toString",{configurable:!0,enumerable:!1,value:nd(t),writable:!0})}:Po,sd=td(rd),id=9007199254740991,od=/^(?:0|[1-9]\d*)$/;function Ds(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 Ls(e,t,n){t=="__proto__"&&Tr?Tr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Nr(e,t){return e===t||e!==e&&t!==t}var ad=Object.prototype,ld=ad.hasOwnProperty;function $o(e,t,n){var r=e[t];(!(ld.call(e,t)&&Nr(r,n))||n===void 0&&!(t in e))&&Ls(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?Ls(n,a,l):$o(n,a,l)}return n}var xo=Math.max;function cd(e,t,n){return t=xo(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=xo(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,Po),e+"")}var dd=9007199254740991;function Bo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dd}function Us(e){return e!=null&&Bo(e.length)&&!Ts(e)}function fd(e,t,n){if(!vt(n))return!1;var r=typeof t;return(r=="number"?Us(n)&&Ds(t,n.length):r=="string"&&t in n)?Nr(n[t],e):!1}function Ho(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 jo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||gd;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 Wo(e){return yn(e)&&Jn(e)==_d}var zo=Object.prototype,pd=zo.hasOwnProperty,Ed=zo.propertyIsEnumerable,Ps=Wo(function(){return arguments}())?Wo:function(e){return yn(e)&&pd.call(e,"callee")&&!Ed.call(e,"callee")};function Cd(){return!1}var Yo=typeof d=="object"&&d&&!d.nodeType&&d,Vo=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,Rd=Vo&&Vo.exports===Yo,Go=Rd?hn.Buffer:void 0,Id=Go?Go.isBuffer:void 0,Ko=Id||Cd,vd="[object Arguments]",yd="[object Array]",Sd="[object Boolean]",Od="[object Date]",bd="[object Error]",wd="[object Function]",Ad="[object Map]",Td="[object Number]",Nd="[object Object]",Md="[object RegExp]",Dd="[object Set]",Ld="[object String]",Ud="[object WeakMap]",Pd="[object ArrayBuffer]",Fd="[object DataView]",kd="[object Float32Array]",$d="[object Float64Array]",xd="[object Int8Array]",Bd="[object Int16Array]",Hd="[object Int32Array]",jd="[object Uint8Array]",Wd="[object Uint8ClampedArray]",zd="[object Uint16Array]",Yd="[object Uint32Array]",Ze={};Ze[kd]=Ze[$d]=Ze[xd]=Ze[Bd]=Ze[Hd]=Ze[jd]=Ze[Wd]=Ze[zd]=Ze[Yd]=!0,Ze[vd]=Ze[yd]=Ze[Pd]=Ze[Sd]=Ze[Fd]=Ze[Od]=Ze[bd]=Ze[wd]=Ze[Ad]=Ze[Td]=Ze[Nd]=Ze[Md]=Ze[Dd]=Ze[Ld]=Ze[Ud]=!1;function Vd(e){return yn(e)&&Bo(e.length)&&!!Ze[Jn(e)]}function Gd(e){return function(t){return e(t)}}var Xo=typeof d=="object"&&d&&!d.nodeType&&d,qn=Xo&&typeof module=="object"&&module&&!module.nodeType&&module,Kd=qn&&qn.exports===Xo,Fs=Kd&&wo.process,Qo=function(){try{var e=qn&&qn.require&&qn.require("util").types;return e||Fs&&Fs.binding&&Fs.binding("util")}catch{}}(),Jo=Qo&&Qo.isTypedArray,qo=Jo?Gd(Jo):Vd;function Xd(e,t){var n=Sn(e),r=!n&&Ps(e),s=!n&&!r&&Ko(e),i=!n&&!r&&!s&&qo(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")||Ds(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(!vt(e))return Jd(e);var t=jo(e),n=[];for(var r in e)r=="constructor"&&(t||!Zd.call(e,r))||n.push(r);return n}function Zo(e){return Us(e)?Xd(e):ef(e)}var tf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nf=/^\w*$/;function rf(e,t){if(Sn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ar(e)?!0:nf.test(e)||!tf.test(e)||t!=null&&e in Object(t)}var Zn=Ms(Object,"create");function sf(){this.__data__=Zn?Zn(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(Zn){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 Zn?t[e]!==void 0:df.call(t,e)}var gf="__lodash_hash_undefined__";function mf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zn&&t===void 0?gf:t,this}function dn(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])}}dn.prototype.clear=sf,dn.prototype.delete=of,dn.prototype.get=cf,dn.prototype.has=ff,dn.prototype.set=mf;function _f(){this.__data__=[],this.size=0}function Mr(e,t){for(var n=e.length;n--;)if(Nr(e[n][0],t))return n;return-1}var pf=Array.prototype,Ef=pf.splice;function Cf(e){var t=this.__data__,n=Mr(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=Mr(t,e);return n<0?void 0:t[n][1]}function If(e){return Mr(this.__data__,e)>-1}function vf(e,t){var n=this.__data__,r=Mr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Bt(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])}}Bt.prototype.clear=_f,Bt.prototype.delete=Cf,Bt.prototype.get=Rf,Bt.prototype.has=If,Bt.prototype.set=vf;var ea=Ms(hn,"Map");function yf(){this.size=0,this.__data__={hash:new dn,map:new(ea||Bt),string:new dn}}function Sf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Dr(e,t){var n=e.__data__;return Sf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Of(e){var t=Dr(this,e).delete(e);return this.size-=t?1:0,t}function bf(e){return Dr(this,e).get(e)}function wf(e){return Dr(this,e).has(e)}function Af(e,t){var n=Dr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Jt(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])}}Jt.prototype.clear=yf,Jt.prototype.delete=Of,Jt.prototype.get=bf,Jt.prototype.has=wf,Jt.prototype.set=Af;var Tf="Expected a function";function ks(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(ks.Cache||Jt),n}ks.Cache=Jt;var Nf=500;function Mf(e){var t=ks(e,function(r){return n.size===Nf&&n.clear(),r}),n=t.cache;return t}var Df=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lf=/\\(\\)?/g,Uf=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(Lf,"$1"):r||n)}),t});function Pf(e){return e==null?"":Do(e)}function ta(e,t){return Sn(e)?e:rf(e,t)?[e]:Uf(Pf(e))}function na(e){if(typeof e=="string"||Ar(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ff(e,t){t=ta(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[na(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 ra=Qd(Object.getPrototypeOf,Object),$f="[object Object]",xf=Function.prototype,Bf=Object.prototype,sa=xf.toString,Hf=Bf.hasOwnProperty,jf=sa.call(Object);function Wf(e){if(!yn(e)||Jn(e)!=$f)return!1;var t=ra(e);if(t===null)return!0;var n=Hf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&sa.call(n)==jf}function zf(){this.__data__=new Bt,this.size=0}function Yf(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 Bt){var r=n.__data__;if(!ea||r.length<Kf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jt(r)}return n.set(e,t),this.size=n.size,this}function On(e){var t=this.__data__=new Bt(e);this.size=t.size}On.prototype.clear=zf,On.prototype.delete=Yf,On.prototype.get=Vf,On.prototype.has=Gf,On.prototype.set=Xf;var ia=typeof d=="object"&&d&&!d.nodeType&&d,oa=ia&&typeof module=="object"&&module&&!module.nodeType&&module,Qf=oa&&oa.exports===ia,aa=Qf?hn.Buffer:void 0;aa&&aa.allocUnsafe;function Jf(e,t){return e.slice()}var la=hn.Uint8Array;function qf(e){var t=new e.constructor(e.byteLength);return new la(t).set(new la(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"&&!jo(e)?Xh(ra(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(),$s=function(){return hn.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,h=!1,c=!1,f=!0;if(typeof e!="function")throw new TypeError(rg);t=Uo(t)||0,vt(n)&&(h=!!n.leading,c="maxWait"in n,i=c?sg(Uo(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function g(T){var W=r,q=s;return r=s=void 0,u=T,o=e.apply(q,W),o}function C(T){return u=T,a=setTimeout(F,t),h?g(T):o}function I(T){var W=T-l,q=T-u,ge=t-W;return c?ig(ge,i-q):ge}function b(T){var W=T-l,q=T-u;return l===void 0||W>=t||W<0||c&&q>=i}function F(){var T=$s();if(b(T))return se(T);a=setTimeout(F,I(T))}function se(T){return a=void 0,f&&r?g(T):(r=s=void 0,o)}function Q(){a!==void 0&&clearTimeout(a),u=0,r=l=s=a=void 0}function fe(){return a===void 0?o:se($s())}function M(){var T=$s(),W=b(T);if(r=arguments,s=this,l=T,W){if(a===void 0)return C(l);if(c)return clearTimeout(a),a=setTimeout(F,t),g(l)}return a===void 0&&(a=setTimeout(F,t)),o}return M.cancel=Q,M.flush=fe,M}function xs(e,t,n){(n!==void 0&&!Nr(e[t],n)||n===void 0&&!(t in e))&&Ls(e,t,n)}function ag(e){return yn(e)&&Us(e)}function Bs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function lg(e){return ud(e,Zo(e))}function ug(e,t,n,r,s,i,o){var a=Bs(e,n),l=Bs(t,n),u=o.get(l);if(u){xs(e,n,u);return}var h=i?i(a,l,n+"",e,t,o):void 0,c=h===void 0;if(c){var f=Sn(l),g=!f&&Ko(l),C=!f&&!g&&qo(l);h=l,f||g||C?Sn(a)?h=a:ag(a)?h=Jh(a):g?(c=!1,h=Jf(l)):C?(c=!1,h=Zf(l)):h=[]:Wf(l)||Ps(l)?(h=a,Ps(a)?h=lg(a):(!vt(a)||Ts(a))&&(h=eg(l))):c=!1}c&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),xs(e,n,h)}function Hs(e,t,n,r,s){e!==t&&ng(t,function(i,o){if(s||(s=new On),vt(i))ug(e,t,o,n,Hs,r,s);else{var a=r?r(Bs(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),xs(e,o,a)}},Zo)}var cg=Ho(function(e,t,n,r){Hs(e,t,n,r)}),js=Ho(function(e,t,n){Hs(e,t,n)});function hg(e,t,n,r){if(!vt(e))return e;t=ta(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=na(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=vt(h)?h:Ds(t[s+1])?[]:{})}$o(a,l,u),a=a[l]}return e}function dg(e,t,n){return e==null?e:hg(e,t,n)}function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ws,ua;function fg(){if(ua)return Ws;ua=1;var e=-1,t=1,n=0;function r(p,j,S,D,w){if(p===j)return p?[[n,p]]:[];if(S!=null){var O=ge(p,j,S);if(O)return O}var $=a(p,j),B=p.substring(0,$);p=p.substring($),j=j.substring($),$=u(p,j);var V=p.substring(p.length-$);p=p.substring(0,p.length-$),j=j.substring(0,j.length-$);var ie=s(p,j);return B&&ie.unshift([n,B]),V&&ie.push([n,V]),se(ie,w),D&&c(ie),ie}function s(p,j){var S;if(!p)return[[t,j]];if(!j)return[[e,p]];var D=p.length>j.length?p:j,w=p.length>j.length?j:p,O=D.indexOf(w);if(O!==-1)return S=[[t,D.substring(0,O)],[n,w],[t,D.substring(O+w.length)]],p.length>j.length&&(S[0][0]=S[2][0]=e),S;if(w.length===1)return[[e,p],[t,j]];var $=h(p,j);if($){var B=$[0],V=$[1],ie=$[2],de=$[3],me=$[4],Me=r(B,ie),Ae=r(V,de);return Me.concat([[n,me]],Ae)}return i(p,j)}function i(p,j){for(var S=p.length,D=j.length,w=Math.ceil((S+D)/2),O=w,$=2*w,B=new Array($),V=new Array($),ie=0;ie<$;ie++)B[ie]=-1,V[ie]=-1;B[O+1]=0,V[O+1]=0;for(var de=S-D,me=de%2!==0,Me=0,Ae=0,y=0,x=0,G=0;G<w;G++){for(var X=-G+Me;X<=G-Ae;X+=2){var Y=O+X,z;X===-G||X!==G&&B[Y-1]<B[Y+1]?z=B[Y+1]:z=B[Y-1]+1;for(var ue=z-X;z<S&&ue<D&&p.charAt(z)===j.charAt(ue);)z++,ue++;if(B[Y]=z,z>S)Ae+=2;else if(ue>D)Me+=2;else if(me){var ae=O+de-X;if(ae>=0&&ae<$&&V[ae]!==-1){var H=S-V[ae];if(z>=H)return o(p,j,z,ue)}}}for(var te=-G+y;te<=G-x;te+=2){var ae=O+te,H;te===-G||te!==G&&V[ae-1]<V[ae+1]?H=V[ae+1]:H=V[ae-1]+1;for(var oe=H-te;H<S&&oe<D&&p.charAt(S-H-1)===j.charAt(D-oe-1);)H++,oe++;if(V[ae]=H,H>S)x+=2;else if(oe>D)y+=2;else if(!me){var Y=O+de-te;if(Y>=0&&Y<$&&B[Y]!==-1){var z=B[Y],ue=O+z-Y;if(H=S-H,z>=H)return o(p,j,z,ue)}}}}return[[e,p],[t,j]]}function o(p,j,S,D){var w=p.substring(0,S),O=j.substring(0,D),$=p.substring(S),B=j.substring(D),V=r(w,O),ie=r($,B);return V.concat(ie)}function a(p,j){if(!p||!j||p.charAt(0)!==j.charAt(0))return 0;for(var S=0,D=Math.min(p.length,j.length),w=D,O=0;S<w;)p.substring(O,w)==j.substring(O,w)?(S=w,O=S):D=w,w=Math.floor((D-S)/2+S);return Q(p.charCodeAt(w-1))&&w--,w}function l(p,j){var S=p.length,D=j.length;if(S==0||D==0)return 0;S>D?p=p.substring(S-D):S<D&&(j=j.substring(0,S));var w=Math.min(S,D);if(p==j)return w;for(var O=0,$=1;;){var B=p.substring(w-$),V=j.indexOf(B);if(V==-1)return O;$+=V,(V==0||p.substring(w-$)==j.substring(0,$))&&(O=$,$++)}}function u(p,j){if(!p||!j||p.slice(-1)!==j.slice(-1))return 0;for(var S=0,D=Math.min(p.length,j.length),w=D,O=0;S<w;)p.substring(p.length-w,p.length-O)==j.substring(j.length-w,j.length-O)?(S=w,O=S):D=w,w=Math.floor((D-S)/2+S);return fe(p.charCodeAt(p.length-w))&&w--,w}function h(p,j){var S=p.length>j.length?p:j,D=p.length>j.length?j:p;if(S.length<4||D.length*2<S.length)return null;function w(Ae,y,x){for(var G=Ae.substring(x,x+Math.floor(Ae.length/4)),X=-1,Y="",z,ue,ae,H;(X=y.indexOf(G,X+1))!==-1;){var te=a(Ae.substring(x),y.substring(X)),oe=u(Ae.substring(0,x),y.substring(0,X));Y.length<oe+te&&(Y=y.substring(X-oe,X)+y.substring(X,X+te),z=Ae.substring(0,x-oe),ue=Ae.substring(x+te),ae=y.substring(0,X-oe),H=y.substring(X+te))}return Y.length*2>=Ae.length?[z,ue,ae,H,Y]:null}var O=w(S,D,Math.ceil(S.length/4)),$=w(S,D,Math.ceil(S.length/2)),B;if(!O&&!$)return null;$?O?B=O[4].length>$[4].length?O:$:B=$:B=O;var V,ie,de,me;p.length>j.length?(V=B[0],ie=B[1],de=B[2],me=B[3]):(de=B[0],me=B[1],V=B[2],ie=B[3]);var Me=B[4];return[V,ie,de,me,Me]}function c(p){for(var j=!1,S=[],D=0,w=null,O=0,$=0,B=0,V=0,ie=0;O<p.length;)p[O][0]==n?(S[D++]=O,$=V,B=ie,V=0,ie=0,w=p[O][1]):(p[O][0]==t?V+=p[O][1].length:ie+=p[O][1].length,w&&w.length<=Math.max($,B)&&w.length<=Math.max(V,ie)&&(p.splice(S[D-1],0,[e,w]),p[S[D-1]+1][0]=t,D--,D--,O=D>0?S[D-1]:-1,$=0,B=0,V=0,ie=0,w=null,j=!0)),O++;for(j&&se(p),F(p),O=1;O<p.length;){if(p[O-1][0]==e&&p[O][0]==t){var de=p[O-1][1],me=p[O][1],Me=l(de,me),Ae=l(me,de);Me>=Ae?(Me>=de.length/2||Me>=me.length/2)&&(p.splice(O,0,[n,me.substring(0,Me)]),p[O-1][1]=de.substring(0,de.length-Me),p[O+1][1]=me.substring(Me),O++):(Ae>=de.length/2||Ae>=me.length/2)&&(p.splice(O,0,[n,de.substring(0,Ae)]),p[O-1][0]=t,p[O-1][1]=me.substring(0,me.length-Ae),p[O+1][0]=e,p[O+1][1]=de.substring(Ae),O++),O++}O++}}var f=/[^a-zA-Z0-9]/,g=/\s/,C=/[\r\n]/,I=/\n\r?\n$/,b=/^\r?\n\r?\n/;function F(p){function j(Ae,y){if(!Ae||!y)return 6;var x=Ae.charAt(Ae.length-1),G=y.charAt(0),X=x.match(f),Y=G.match(f),z=X&&x.match(g),ue=Y&&G.match(g),ae=z&&x.match(C),H=ue&&G.match(C),te=ae&&Ae.match(I),oe=H&&y.match(b);return te||oe?5:ae||H?4:X&&!z&&ue?3:z||ue?2:X||Y?1:0}for(var S=1;S<p.length-1;){if(p[S-1][0]==n&&p[S+1][0]==n){var D=p[S-1][1],w=p[S][1],O=p[S+1][1],$=u(D,w);if($){var B=w.substring(w.length-$);D=D.substring(0,D.length-$),w=B+w.substring(0,w.length-$),O=B+O}for(var V=D,ie=w,de=O,me=j(D,w)+j(w,O);w.charAt(0)===O.charAt(0);){D+=w.charAt(0),w=w.substring(1)+O.charAt(0),O=O.substring(1);var Me=j(D,w)+j(w,O);Me>=me&&(me=Me,V=D,ie=w,de=O)}p[S-1][1]!=V&&(V?p[S-1][1]=V:(p.splice(S-1,1),S--),p[S][1]=ie,de?p[S+1][1]=de:(p.splice(S+1,1),S--))}S++}}function se(p,j){p.push([n,""]);for(var S=0,D=0,w=0,O="",$="",B;S<p.length;){if(S<p.length-1&&!p[S][1]){p.splice(S,1);continue}switch(p[S][0]){case t:w++,$+=p[S][1],S++;break;case e:D++,O+=p[S][1],S++;break;case n:var V=S-w-D-1;if(j){if(V>=0&&T(p[V][1])){var ie=p[V][1].slice(-1);if(p[V][1]=p[V][1].slice(0,-1),O=ie+O,$=ie+$,!p[V][1]){p.splice(V,1),S--;var de=V-1;p[de]&&p[de][0]===t&&(w++,$=p[de][1]+$,de--),p[de]&&p[de][0]===e&&(D++,O=p[de][1]+O,de--),V=de}}if(M(p[S][1])){var ie=p[S][1].charAt(0);p[S][1]=p[S][1].slice(1),O+=ie,$+=ie}}if(S<p.length-1&&!p[S][1]){p.splice(S,1);break}if(O.length>0||$.length>0){O.length>0&&$.length>0&&(B=a($,O),B!==0&&(V>=0?p[V][1]+=$.substring(0,B):(p.splice(0,0,[n,$.substring(0,B)]),S++),$=$.substring(B),O=O.substring(B)),B=u($,O),B!==0&&(p[S][1]=$.substring($.length-B)+p[S][1],$=$.substring(0,$.length-B),O=O.substring(0,O.length-B)));var me=w+D;O.length===0&&$.length===0?(p.splice(S-me,me),S=S-me):O.length===0?(p.splice(S-me,me,[t,$]),S=S-me+1):$.length===0?(p.splice(S-me,me,[e,O]),S=S-me+1):(p.splice(S-me,me,[e,O],[t,$]),S=S-me+2)}S!==0&&p[S-1][0]===n?(p[S-1][1]+=p[S][1],p.splice(S,1)):S++,w=0,D=0,O="",$="";break}}p[p.length-1][1]===""&&p.pop();var Me=!1;for(S=1;S<p.length-1;)p[S-1][0]===n&&p[S+1][0]===n&&(p[S][1].substring(p[S][1].length-p[S-1][1].length)===p[S-1][1]?(p[S][1]=p[S-1][1]+p[S][1].substring(0,p[S][1].length-p[S-1][1].length),p[S+1][1]=p[S-1][1]+p[S+1][1],p.splice(S-1,1),Me=!0):p[S][1].substring(0,p[S+1][1].length)==p[S+1][1]&&(p[S-1][1]+=p[S+1][1],p[S][1]=p[S][1].substring(p[S+1][1].length)+p[S+1][1],p.splice(S+1,1),Me=!0)),S++;Me&&se(p,j)}function Q(p){return p>=55296&&p<=56319}function fe(p){return p>=56320&&p<=57343}function M(p){return fe(p.charCodeAt(0))}function T(p){return Q(p.charCodeAt(p.length-1))}function W(p){for(var j=[],S=0;S<p.length;S++)p[S][1].length>0&&j.push(p[S]);return j}function q(p,j,S,D){return T(p)||M(D)?null:W([[n,p],[e,j],[t,S],[n,D]])}function ge(p,j,S){var D=typeof S=="number"?{index:S,length:0}:S.oldRange,w=typeof S=="number"?null:S.newRange,O=p.length,$=j.length;if(D.length===0&&(w===null||w.length===0)){var B=D.index,V=p.slice(0,B),ie=p.slice(B),de=w?w.index:null;e:{var me=B+$-O;if(de!==null&&de!==me||me<0||me>$)break e;var Me=j.slice(0,me),Ae=j.slice(me);if(Ae!==ie)break e;var y=Math.min(B,me),x=V.slice(0,y),G=Me.slice(0,y);if(x!==G)break e;var X=V.slice(y),Y=Me.slice(y);return q(x,X,Y,ie)}e:{if(de!==null&&de!==B)break e;var z=B,Me=j.slice(0,z),Ae=j.slice(z);if(Me!==V)break e;var ue=Math.min(O-z,$-z),ae=ie.slice(ie.length-ue),H=Ae.slice(Ae.length-ue);if(ae!==H)break e;var X=ie.slice(0,ie.length-ue),Y=Ae.slice(0,Ae.length-ue);return q(V,X,Y,ae)}}if(D.length>0&&w&&w.length===0)e:{var x=p.slice(0,D.index),ae=p.slice(D.index+D.length),y=x.length,ue=ae.length;if($<y+ue)break e;var G=j.slice(0,y),H=j.slice($-ue);if(x!==G||ae!==H)break e;var X=p.slice(y,O-ue),Y=j.slice(y,$-ue);return q(x,X,Y,ae)}return null}function le(p,j,S,D){return r(p,j,S,D,!0)}return le.INSERT=t,le.DELETE=e,le.EQUAL=n,Ws=le,Ws}var gg=fg();const zs=yt(gg);function er(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 pg(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 tr="__INTERNAL_EDITOR__",Ys=`${tr}DOCS_NORMAL`,Vs=`${tr}DOCS_FORMULA_BAR`,ca=`${tr}ZEN_EDITOR`,ha=`\r
  2. `,Ig="isRowStylePrecedeColumnStyle",vg=Symbol("AUTO_HEIGHT_FOR_MERGED_CELLS");function yg(e){return`${tr}${e}`}function da(e){return e.startsWith(tr)}var Gs=Symbol("$$IDENTIFIER_DECORATOR");function Sg(e){return e&&e[Gs]===!0}function Ks(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 Og(e){return!!(e&&typeof e.useExisting<"u")}function qs(e){return!!(e&&typeof e.useAsync<"u")}var fa=Symbol("AsyncHook");function Lr(e){return!!(e&&e.__symbol===fa)}function Ct(e){return typeof e>"u"?"undefined":Ks(e)&&!e[Gs]?e.name:e.toString()}var 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)}}(),ot=function(e){bg(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error);d.Quantity=void 0,function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"}(d.Quantity||(d.Quantity={})),d.LookUp=void 0,function(e){e.SELF="self",e.SKIP_SELF="skipSelf"}(d.LookUp||(d.LookUp={}));var ga=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)}}(),ma=Symbol("$$TARGET"),Zs=Symbol("$$DEPENDENCIES"),wg=function(e){ga(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),_a=function(e){ga(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 pa(e){var t=e;return t[Zs]||[]}function ei(e,t){var n=pa(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new wg(t,e);return r}function ti(e,t,n,r,s){r===void 0&&(r=d.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new _a(e,n);var o=e;o[ma]===o?o[Zs].push(i):(o[Zs]=[i],o[ma]=o)}var Ea=new Set;function _t(e){if(Ea.has(e))throw new ot('Identifier "'.concat(e,'" already exists.'));Ea.add(e);var t=function(n,r,s){ti(n,t,s)};return t.toString=function(){return e},t[Gs]=!0,t}function Ag(e,t,n){var r=ei(e,t);r.lookUp=n}function Ca(e){return function t(){return this instanceof t?this:function(n,r,s){Ag(n,s,e)}}}var Ra=Ca(d.LookUp.SKIP_SELF),Ia=Ca(d.LookUp.SELF),Tg=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)}}(),ni=function(e){Tg(t,e);function t(n,r,s){var i=this,o='Expect "'.concat(r,'" dependency items 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 ri(e,t,n){if(t===d.Quantity.OPTIONAL&&n>1||t===d.Quantity.REQUIRED&&n!==1)throw new ni(e,t,n)}function Ng(e,t){return e===d.Quantity.MANY?t:t[0]}function Mg(e,t,n){var r=ei(e,t);r.quantity=n}function si(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)ti(r,n,i,e);else{if(e===d.Quantity.REQUIRED)throw new _a(r,i);Mg(r,i,e)}}}}var va=si(d.Quantity.MANY),ya=si(d.Quantity.OPTIONAL),at=si(d.Quantity.REQUIRED);function Dg(e,t,n){var r=ei(e,t);r.withNew=n}function Lg(e){return function t(){return this instanceof t?this:function(n,r,s){Dg(n,s,e)}}}var Sa=Lg(!0);function Oa(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:d.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o,a=d.Quantity.REQUIRED,l=!1;return s.forEach(function(u){if(u instanceof Ia)o=d.LookUp.SELF;else if(u instanceof Ra)o=d.LookUp.SKIP_SELF;else if(u instanceof ya)a=d.Quantity.OPTIONAL;else if(u instanceof va)a=d.Quantity.MANY;else if(u instanceof Sa)l=!0;else throw new ot("unknown dep modifier ".concat(u,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}function Ug(e,t,n){n===void 0&&(n=0);var r=Oa(t,n);r.forEach(function(s){ti(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}function Pg(e){return{unwrap:e}}function Fg(e){return!!e&&typeof e.unwrap=="function"}function kg(e){return Fg(e)?e.unwrap():e}function ii(e){return!!e&&typeof e.dispose=="function"}var ba=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 $g(e){return e.length===1}var Ur=[];function wa(e){Ur.push(e)}function Aa(){Ur.pop()}function xg(){Ur.length=0}var Ta=function(e){ba(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(Sg(n)?Ct(n):n.name,'".');return e.call(this,i)||this}return t}(ot),Pr=function(e){ba(t,e);function t(n){var r=this,s='Cannot find "'.concat(Ct(n),'" registered by any injector. The stack of dependencies is: "').concat(Ur.map(function(i){return Ct(i)}).join(" -> "),'".');return r=e.call(this,s)||this,xg(),r}return t}(ot),Bg=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=d.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return ri(t,n,r.length),Ng(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 $g(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 ii(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=d.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new Pr(t);return ri(t,n,r.length),n===d.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return ii(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}(),oi;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")oi=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}});oi=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var jg=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=oi(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}(),bn=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)}}(),Fr=function(){return Fr=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},Fr.apply(this,arguments)},fn=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))},Wg=300,kr=Symbol("$$NOT_INSTANTIATED_SYMBOL"),zg=function(e){bn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Ct(n),'".'))||this}return t}(ot),Yg=function(e){bn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(ot),Vg=function(e){bn(t,e);function t(n){return e.call(this,'Async item "'.concat(Ct(n),'" returns another async item.'))||this}return t}(ot),Gg=function(e){bn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(Ct(n),'" from sync api.'))||this}return t}(ot),Na=function(e){bn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(Ct(n),'" after it is already resolved.'))||this}return t}(ot),Kg=function(e){bn(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 Bg(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 Na(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 Na(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 Kg(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,fn([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 Lr(i)})||Lr(s))throw new Gg(t);return s},e.prototype._get=function(t,n,r,s){var i=d.Quantity.REQUIRED;if(n===d.Quantity.REQUIRED||n===d.Quantity.OPTIONAL||n===d.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==kr)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,d.Quantity.REQUIRED);if(n!==kr)return Promise.resolve(n);var r=this.createDependency(t,d.Quantity.REQUIRED);return Lr(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,fn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;wa(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):Og(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),Aa()}catch(i){throw Aa(),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 jg(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=pa(i).sort(function(b,F){return b.paramIndex-F.paramIndex}).map(function(b){return Fr(Fr({},b),{identifier:kg(b.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(b){throw b instanceof Pr||b instanceof ni&&b.actual===0?new Ta(i,h.identifier,h.paramIndex):b}}var f=fn([],r,!0),g=o.length>0?o[0].paramIndex:f.length;if(f.length!==g){console.warn("[redi]: Expect ".concat(g," custom parameter(s) of ").concat(Ct(i)," but get ").concat(f.length,"."));var C=g-f.length;C>0?f=fn(fn([],f,!0),Array.from({length:C}).fill(void 0),!0):f=f.slice(0,g)}var I=new(i.bind.apply(i,fn(fn([void 0],f,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,I),this.markResolutionCompleted(),I},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=Oa(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(f){throw f instanceof Pr||f instanceof ni&&f.actual===0?new Ta(t,u.identifier,u.paramIndex):f}}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:fa,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!==kr)return i;var o;if(Array.isArray(s)){var a=s[1];if(qs(a))throw new Vg(t);o=r._resolveDependency(t,a)}else Ks(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=d.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?kr:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):(ri(t,n,0),n===d.Quantity.MANY?[]:null)};return r===d.LookUp.SKIP_SELF?o():t===e?this:r===d.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=d.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===d.Quantity.OPTIONAL)return null;throw wa(t),new Pr(t)};return r===d.LookUp.SKIP_SELF?a():this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Wg)throw new zg(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Yg},e}(),Ma=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,Da="REDI_GLOBAL_LOCK",Xg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Ma[Da]?Xg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
  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`):Ma[Da]=!0;var La="REDI_CONTEXT_LOCK",Qg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Ua=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;Ua[La]?Qg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):Ua[La]=!0;var nr=bt.createContext({injector:null});nr.displayName="RediContext";var ai=nr.Provider,Pa=nr.Consumer,$r=function(){return $r=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},$r.apply(this,arguments)};function Jg(e){var t=e.children,n=e.dependencies,r=bt.useRef(null);return bt.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),bt.createElement(Pa,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(n):new Rt(n),r.current=i),bt.createElement(ai,{value:{injector:i}},t)})}function qg(e,t){return function(r){return bt.createElement(ai,{value:{injector:t}},bt.createElement(e,$r({},r)))}}function Zg(e,t){return function(r){return bt.createElement(Jg,{dependencies:t},bt.createElement(e,$r({},r)))}}var em=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)}}(),tm=function(e){em(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 nm(e,t,n){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new tm(r);var i=s.injector,o=i.get(e,t||d.Quantity.REQUIRED,n);return o}}}}var rm=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)}}(),sm=function(e){rm(t,e);function t(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return t}(ot);function Fa(){var e=bt.useContext(nr);if(!e.injector)throw new sm;return e.injector}function im(e,t,n){var r=Fa();return bt.useMemo(function(){return r.get(e,t,n)},[e,t,n])}var om=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 ka(e,t){var n=e instanceof Ce.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 $a(e){return typeof e=="function"?e():e}function am(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},om([],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=$a(o).subscribe(function(f){i.current=!0,h=f});c.unsubscribe()}return h!=null?h:t}());if(lt.useEffect(function(){var h=null;return o&&(s.current=$a(o),h=s.current.subscribe(function(c){u.current=c,l(function(f){return f+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 lm(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 li=new WeakMap;function um(e,t){var n=lt.useRef(void 0),r=ka(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&&li.delete(n.current),n.current=e,li.set(e,s)),{Provider:i,value:r}}function cm(e){var t=li.get(e);if(!t)throw new ot("try to read context value but no ancestor component subscribed it.");return lt.useContext(t)}function hm(e,t){t.forEach(n=>e.add(n))}function xa(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Ba(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 ui extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class Ha extends Error{constructor(){super("Canceled by facade"),this.name="CanceledError"}}async function ja(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 Wa(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 za(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 Ya(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 Va(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))}typeof SuppressedError=="function"&&SuppressedError;function rr(e){return typeof e=="function"}function dm(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 ci=dm(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
  5. `+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
  6. `):"",this.name="UnsubscriptionError",this.errors=n}});function Ga(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ka=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=za(o),l=a.next();!l.done;l=a.next()){var u=l.value;u.remove(this)}}catch(I){t={error:I}}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(rr(h))try{h()}catch(I){i=I instanceof ci?I.errors:[I]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var f=za(c),g=f.next();!g.done;g=f.next()){var C=g.value;try{Xa(C)}catch(I){i=i!=null?i:[],I instanceof ci?i=Va(Va([],Ya(i)),Ya(I.errors)):i.push(I)}}}catch(I){r={error:I}}finally{try{g&&!g.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(i)throw new ci(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Xa(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)&&Ga(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ga(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();Ka.EMPTY;function fm(e){return e instanceof Ka||e&&"closed"in e&&rr(e.remove)&&rr(e.add)&&rr(e.unsubscribe)}function Xa(e){rr(e)?e():e.unsubscribe()}function Je(e){let t=!1;return e?fm(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Je(()=>{})}function gm(e){return Je(()=>{e.unsubscribe()})}class xr{constructor(){R(this,"_disposables",new Set)}add(t){const n=Je(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 tt{constructor(){R(this,"_disposed",!1);R(this,"_collection",new xr)}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 mm extends tt{constructor(){super(...arguments);R(this,"dispose$",new Ce.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class _m extends tt{constructor(n){super();R(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 sr=_t("univer.context-service");class Qa extends tt{constructor(){super(...arguments);R(this,"_contextChanged$",new Ce.Subject);R(this,"contextChanged$",this._contextChanged$.asObservable());R(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 Ce.Observable(r=>{const s=this._contextChanged$.pipe(Ce.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 Ja=(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))(Ja||{});const wt=_t("univer.log");class qa extends tt{constructor(){super(...arguments);R(this,"_logLevel",3)}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)}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)}}var pm=Object.defineProperty,Em=Object.getOwnPropertyDescriptor,Cm=(e,t,n,r)=>{for(var s=r>1?void 0:r?Em(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&&pm(t,n,s),s},Za=(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 Mt=_t("anywhere.command-service");class Rm{constructor(){R(this,"_commands",new Map);R(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),Je(()=>{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 el={id:"nil",type:0,handler:()=>!0};d.CommandService=class extends tt{constructor(n,r){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new Rm,this._registerCommand(el)}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),Je(()=>{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),Je(()=>{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 ui)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,f=>f.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 ui)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Je(()=>er(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 xr;s=new Im(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Je(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Je(()=>{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}},d.CommandService=Cm([Za(0,at(Rt)),Za(1,wt)],d.CommandService);class Im{constructor(t){R(this,"name");R(this,"multi",!0);R(this,"type",0);R(this,"priority",0);R(this,"_implementations",[]);R(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(wt),s=t.get(sr),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),Je(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function hi(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Wa(r)}function vm(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return ja(r)}function tl(e){return new Ce.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function nl(e){return function(n){return new Ce.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function ym(e=0){return t=>{let n=[];return t.pipe(Ce.tap(r=>n.push(r)),Ce.debounceTime(e),Ce.map(()=>n),Ce.tap(()=>n=[]))}}function Sm(e){const t=new Ce.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(Ce.take(1))}const Om=e=>new Promise(t=>{Ce.merge(tl(e.onCommandExecuted.bind(e)).pipe(xt.filter(([n])=>n.type===wn.MUTATION)),Ce.timer(300)).pipe(xt.debounceTime(16),xt.first()).subscribe(()=>{t()})});function rl(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 bm(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 sl(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 wm(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=rl(e,t):r=sl(e,t),n){const s=e[r];return e.indexOf(s)}return r}function Am(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const ir=2,il=1;function Tm(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,f=h,g=u,C=i,I=s;return Math.abs(a-n)>ir||Math.abs(l-r)>ir||Math.abs(f-C)>ir||Math.abs(g-I)>ir||Math.abs(c-o)>il}var di=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(di||{}),Ve=(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))(Ve||{}),fi=(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))(fi||{}),It=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(It||{}),gi=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(gi||{}),mi=(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))(mi||{}),_i=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(_i||{}),pi=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(pi||{}),Ei=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Ei||{}),Ci=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Ci||{});function Nm(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Ri=(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))(Ri||{}),An=(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))(An||{}),or=(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))(or||{}),Ii=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Ii||{}),ol=(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))(ol||{}),al=(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))(al||{}),ll=(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))(ll||{}),ul=(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))(ul||{}),vi=(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))(vi||{}),yi=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(yi||{}),Tn=(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))(Tn||{}),Si=(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))(Si||{}),Ht=(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))(Ht||{}),qt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(qt||{}),gn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(gn||{}),Br=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Br||{}),Hr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Hr||{}),Dt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Dt||{}),Oe=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Oe||{}),Zt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Zt||{}),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||{}),jr=(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))(jr||{});const Mm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Dm=e=>crypto.getRandomValues(new Uint8Array(e)),Lm=(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}}},Um=(e,t=21)=>Lm(e,t|0,Dm),Pm=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Mm[n[e]&63];return t};const cl=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"]),Fm=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 km(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Fm.test(e)){if(hl(e))return!0;try{const r=new URL(dl(e)).hostname.split(".").pop();if(r&&cl.has(r))return!0}catch{return!1}}return!1}function hl(e){return/^[a-zA-Z]+:\/\//.test(e)}function $m(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function dl(e){return hl(e)?e:$m(e)?`mailto://${e}`:`https://${e}`}const xm=/^-ms-/,Bm=/-([a-z])/g,en=["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 Oi(e,t){const n=re.getValueType(e),r=re.getValueType(t);return n!==r?!1:re.isArray(e)?Hm(e,t):re.isObject(e)?jm(e,t):re.isDate(e)?e.getTime()===t.getTime():re.isRegExp(e)?e.toString()===t.toString():e===t}function Hm(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(!Oi(s,i))return!1}return!0}function jm(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(!Oi(i,o))return!1}return!0}class re{static stringAt(t){let n="",r=t;for(;r>=en.length;)r/=en.length,r-=1,n+=en[r%en.length];const s=t%en.length;return n+=en[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+=en.length**i+en.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 jt(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 f=(h=a[u])!=null?h:[];a[u]=f,r(l,f);return}if(re.isObject(l)){const f=(c=a[u])!=null?c:{};a[u]=f,s(l,f);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 f=(h=a[l])!=null?h:{};a[l]=f,s(u,f);return}if(re.isArray(u)){const f=(c=a[l])!=null?c:[];a[l]=f,r(u,f);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 Oi(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 km(t)}static normalizeUrl(t){return dl(t)}static topLevelDomainCombiningString(){return[...cl].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(xm,"ms-").replace(Bm,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 jt(e=21,t){return t?Um(t,e)():Pm(e)}function bi(...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 Wm=()=>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(wi(r,{...a,ed:Math.min(u,n)}))):o.push(wi(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 zm(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:f}=u,g=[];h!=null&&(typeof h=="number"?g.push(`margin-top: ${h}px`):g.push(`margin-top: ${h.v}px`)),c!=null&&(typeof c=="number"?g.push(`margin-bottom: ${c}px`):g.push(`margin-bottom: ${c.v}px`)),f!=null&&g.push(`line-height: ${f}`),l>o+1?i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}>${Wr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Wr(e,o,r.length)),i}else return Wr(e,0,e.dataStream.length)}function wi(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:f,cl:g,va:C}=s;let I=e.slice(n,r);const b=[];return a===Oe.TRUE&&(I=`<i>${I}</i>`),C===Dt.SUPERSCRIPT?I=`<sup>${I}</sup>`:C===Dt.SUBSCRIPT&&(I=`<sub>${I}</sub>`),(u==null?void 0:u.s)===Oe.TRUE&&(I=`<u>${I}</u>`),(h==null?void 0:h.s)===Oe.TRUE&&(I=`<s>${I}</s>`),l===Oe.TRUE&&(I=`<strong>${I}</strong>`),i&&b.push(`font-family: ${i}`),g&&b.push(`color: ${g.rgb}`),o&&b.push(`font-size: ${o}pt`),c&&b.push("text-decoration: overline"),f&&b.push(`background: ${f.rgb}`),b.length?`<span style="${b.join("; ")};">${I}</span>`:I}const fl={[jr.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 ar{constructor(){R(this,"_themeValue",ct.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=It.UNSUPPORTED,this._themeColors=jr.OFFICE,this._themeTint=0}asRgbColor(){return new zr(this._rgbValue,this)}asThemeColor(){return new Yr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case It.THEME:return this.asThemeColor();case It.RGB:return this.asRgbColor();case It.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=It.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=It.THEME,this._themeColors=t}setThemeTint(t){this._colorType=It.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=It.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class mn{constructor(t){R(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 ar().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 mn(this._builder)}equals(t){return!1}}class gl{constructor(t){R(this,"_saturation",0);R(this,"_hue",0);R(this,"_lightness",0);R(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 ar;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 St=class St extends mn{constructor(n,r){super(r);R(this,"_cssString");R(this,"_red");R(this,"_green");R(this,"_blue");R(this,"_alpha");let s=n.match(St.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(St.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 mn.rgbColorToHexValue(this)}getRed(){let n=this._red+St.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+St.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+St.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return It.RGB}clone(){return new St(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof St?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};R(St,"RGB_COLOR_AMT",0),R(St,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),R(St,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let zr=St;const ln=class ln extends mn{constructor(n,r,s,i){super(i);R(this,"_themeColorType");R(this,"_themeTint");R(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=fl[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(ln._cacheThemeColor.has(this._themeColors)){if(s=ln._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,ln._cacheThemeColor.set(this._themeColors,s);const i=new gl(mn.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 ln(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof ln?n._themeColorType===this._themeColorType:!1}getColorType(){return It.THEME}getThemeColorType(){return this._themeColorType}};R(ln,"_cacheThemeColor",new Map);let Yr=ln;const Ym="rgb(",Vm="rgba(",Ai={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 At{constructor(t){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof At){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=ml(t);if(n==null){this._setNullColor();return}this._color=n;const r=Jm(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 At(t).toRgb(),i=new At(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 At(l)}static getContrastRatio(t,n){const r=new At(t).getLuminance(),s=new At(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=[Vr(Math.round(n).toString(16)),Vr(Math.round(r).toString(16)),Vr(Math.round(s).toString(16)),Vr(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 t_(this.toRgb())}toHsl(){return e_(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new At(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new At(n)}setAlpha(t){return new At({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=Ti(t),n=Ti(n),r=Ti(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 Vr=e=>e.length===1?`0${e}`:e,Ti=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),ml=e=>{if(r_(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(Ai[t]){const n=Ai[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 Gm(t);if(t.startsWith("rgb"))return Km(t);if(t.startsWith("hsl"))return Xm(t);if(t.startsWith("hsv"))return Qm(t)},Gm=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},Km=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},Xm=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},Qm=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},Jm=e=>{const t=ml(e);if(t!=null)return"r"in t?t:"l"in t?qm(t):Zm(t)},Ni=(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),qm=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=Ni(u,l,t+1/3),i=Ni(u,l,t),o=Ni(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},Zm=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],f=[o,o,l,r,r,a][u],g={r:h*255,g:c*255,b:f*255};return e.a!==void 0&&(g.a=e.a),g},e_=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},t_=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},n_=e=>e==null,r_=e=>!n_(e)&&typeof e=="object";function s_(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 i_(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 o_(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 a_(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Zt.STRING;if(typeof e.v=="number")return Zt.NUMBER;if(typeof e.v=="boolean")return Zt.BOOLEAN}function l_(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 u_(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var Le=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(Le||{}),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 c_(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var _l=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(_l||{}),pl=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(pl||{});function h_(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:f,endColumn:g}=n[u];if(e===h&&t===f){i=c,o=g,a=h,l=f,s=!0;break}if(e>=h&&e<=c&&t>=f&&t<=g){i=c,o=g,a=h,l=f,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var Nn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(Nn||{});function El(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,f=t,g=n;if(r&&i){const{startRow:C,startColumn:I,endRow:b,endColumn:F,startY:se,endY:Q,startX:fe,endX:M}=i;h=C,c=I,f=b,g=F,o=se,a=Q,l=fe,u=M}return s&&(o=i.startY,a=i.endY,l=i.startX,u=i.endX,f=i.endRow,g=i.endColumn),{startRow:h,startColumn:c,endRow:f,endColumn:g,startY:o,endY:a,startX:l,endX:u}}const d_=El;function f_(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,f=n;return(r||s)&&(u=i,h=o,c=a,f=l),{startRow:u,startColumn:h,endRow:c,endColumn:f}}function Cl(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function g_(e){return Cl(e)&&(e==null?void 0:e.coverable)!==!1}function Lt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new ar().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function m_(e){return re.isString(e)&&e.substring(0,1)==="="&&e.length>1}function __(e){return re.isString(e)&&e.length>0}function p_(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: ${Lt(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: ${Lt(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: ${Lt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Lt(e.bg)}; `)}],["bd",()=>{var o,a,l,u,h,c,f,g,C,I,b,F;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Gr((a=e.bd)==null?void 0:a.b.s)} ${(l=Lt(e.bd.b.cl))!=null?l:""}; `),(u=e.bd)!=null&&u.t&&(n+=`border-top: ${Gr((h=e.bd)==null?void 0:h.t.s)} ${(c=Lt(e.bd.t.cl))!=null?c:""}; `),(f=e.bd)!=null&&f.r&&(n+=`border-right: ${Gr((g=e.bd)==null?void 0:g.r.s)} ${(C=Lt(e.bd.r.cl))!=null?C:""}; `),(I=e.bd)!=null&&I.l&&(n+=`border-left: ${Gr((b=e.bd)==null?void 0:b.l.s)} ${(F=Lt(e.bd.l.cl))!=null?F:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Lt(e.cl)}; `)}],["va",()=>{e.va===Dt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===Dt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Tn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Tn.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===Ht.LEFT?n+="text-align: left; ":e.ht===Ht.RIGHT?n+="text-align: right; ":e.ht===Ht.CENTER?n+="text-align: center; ":e.ht===Ht.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===qt.BOTTOM?n+="vertical-align: bottom; ":e.vt===qt.TOP?n+="vertical-align: top; ":e.vt===qt.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===gn.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===gn.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,c,f,g,C,I,b,F;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(c=e.pd)==null?void 0:c.t}pt`,l=`${(f=e.pd)==null?void 0:f.l}pt`,u=`${(g=e.pd)==null?void 0:g.r}pt`;(C=e.pd)!=null&&C.b&&(n+=`padding-bottom: ${o}; `),(I=e.pd)!=null&&I.t&&(n+=`padding-top: ${a}; `),(b=e.pd)!=null&&b.l&&(n+=`padding-left: ${l}; `),(F=e.pd)!=null&&F.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 Gr(e){let t="";return e===Ve.NONE?t="none":e===Ve.THIN?t="0.5pt solid":e===Ve.HAIR?t="0.5pt double":e===Ve.DOTTED?t="0.5pt dotted":e===Ve.DASHED||e===Ve.DASH_DOT?t="0.5pt dashed":e===Ve.DASH_DOT_DOT?t="0.5pt dotted":e===Ve.DOUBLE?t="0.5pt double":e===Ve.MEDIUM?t="1pt solid":e===Ve.MEDIUM_DASHED||e===Ve.MEDIUM_DASH_DOT?t="1pt dashed":e===Ve.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Ve.SLANT_DASH_DOT?t="0.5pt dashed":e===Ve.THICK&&(t="1.5pt solid"),t}function E_(e){let t=0;if(e=e.trim(),e==="none")t=Ve.NONE;else if(e==="0.5pt solid")t=Ve.THIN;else if(e==="0.5pt double")t=Ve.HAIR;else if(e==="0.5pt dotted")t=Ve.DOTTED;else if(e==="0.5pt dashed")t=Ve.DASHED;else if(e==="1pt solid")t=Ve.MEDIUM;else if(e==="1pt dashed")t=Ve.MEDIUM_DASHED;else if(e==="1pt dotted")t=Ve.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Ve.THICK;else if(!e.includes("none"))t=Ve.THIN;else return Ve.NONE;return t}function C_(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 R_(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===Le.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===Le.ROW||o!==Le.ROW&&o!==Le.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 I_(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Mi(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=>Mi(e[n],t[n])):e===t:!1}function Rl(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Mi(n,r)}function v_(e,t){return t.some(n=>e.indexOf(n)>-1)}var Kr={exports:{}},y_=Kr.exports,Il;function S_(){return Il||(Il=1,function(e,t){(function(n,r){e.exports=r()})(y_,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",u="day",h="week",c="month",f="quarter",g="year",C="date",I="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|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,se={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 w=["th","st","nd","rd"],O=D%100;return"["+D+(w[(O-20)%10]||w[O]||w[0])+"]"}},Q=function(D,w,O){var $=String(D);return!$||$.length>=w?D:""+Array(w+1-$.length).join(O)+D},fe={s:Q,z:function(D){var w=-D.utcOffset(),O=Math.abs(w),$=Math.floor(O/60),B=O%60;return(w<=0?"+":"-")+Q($,2,"0")+":"+Q(B,2,"0")},m:function D(w,O){if(w.date()<O.date())return-D(O,w);var $=12*(O.year()-w.year())+(O.month()-w.month()),B=w.clone().add($,c),V=O-B<0,ie=w.clone().add($+(V?-1:1),c);return+(-($+(O-B)/(V?B-ie:ie-B))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:c,y:g,w:h,d:u,D:C,h:l,m:a,s:o,ms:i,Q:f}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},M="en",T={};T[M]=se;var W="$isDayjsObject",q=function(D){return D instanceof j||!(!D||!D[W])},ge=function D(w,O,$){var B;if(!w)return M;if(typeof w=="string"){var V=w.toLowerCase();T[V]&&(B=V),O&&(T[V]=O,B=V);var ie=w.split("-");if(!B&&ie.length>1)return D(ie[0])}else{var de=w.name;T[de]=w,B=de}return!$&&B&&(M=B),B||!$&&M},le=function(D,w){if(q(D))return D.clone();var O=typeof w=="object"?w:{};return O.date=D,O.args=arguments,new j(O)},p=fe;p.l=ge,p.i=q,p.w=function(D,w){return le(D,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var j=function(){function D(O){this.$L=ge(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[W]=!0}var w=D.prototype;return w.parse=function(O){this.$d=function($){var B=$.date,V=$.utc;if(B===null)return new Date(NaN);if(p.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var ie=B.match(b);if(ie){var de=ie[2]-1||0,me=(ie[7]||"0").substring(0,3);return V?new Date(Date.UTC(ie[1],de,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,me)):new Date(ie[1],de,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,me)}}return new Date(B)}(O),this.init()},w.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},w.$utils=function(){return p},w.isValid=function(){return this.$d.toString()!==I},w.isSame=function(O,$){var B=le(O);return this.startOf($)<=B&&B<=this.endOf($)},w.isAfter=function(O,$){return le(O)<this.startOf($)},w.isBefore=function(O,$){return this.endOf($)<le(O)},w.$g=function(O,$,B){return p.u(O)?this[$]:this.set(B,O)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(O,$){var B=this,V=!!p.u($)||$,ie=p.p(O),de=function(Y,z){var ue=p.w(B.$u?Date.UTC(B.$y,z,Y):new Date(B.$y,z,Y),B);return V?ue:ue.endOf(u)},me=function(Y,z){return p.w(B.toDate()[Y].apply(B.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(z)),B)},Me=this.$W,Ae=this.$M,y=this.$D,x="set"+(this.$u?"UTC":"");switch(ie){case g:return V?de(1,0):de(31,11);case c:return V?de(1,Ae):de(0,Ae+1);case h:var G=this.$locale().weekStart||0,X=(Me<G?Me+7:Me)-G;return de(V?y-X:y+(6-X),Ae);case u:case C:return me(x+"Hours",0);case l:return me(x+"Minutes",1);case a:return me(x+"Seconds",2);case o:return me(x+"Milliseconds",3);default:return this.clone()}},w.endOf=function(O){return this.startOf(O,!1)},w.$set=function(O,$){var B,V=p.p(O),ie="set"+(this.$u?"UTC":""),de=(B={},B[u]=ie+"Date",B[C]=ie+"Date",B[c]=ie+"Month",B[g]=ie+"FullYear",B[l]=ie+"Hours",B[a]=ie+"Minutes",B[o]=ie+"Seconds",B[i]=ie+"Milliseconds",B)[V],me=V===u?this.$D+($-this.$W):$;if(V===c||V===g){var Me=this.clone().set(C,1);Me.$d[de](me),Me.init(),this.$d=Me.set(C,Math.min(this.$D,Me.daysInMonth())).$d}else de&&this.$d[de](me);return this.init(),this},w.set=function(O,$){return this.clone().$set(O,$)},w.get=function(O){return this[p.p(O)]()},w.add=function(O,$){var B,V=this;O=Number(O);var ie=p.p($),de=function(Ae){var y=le(V);return p.w(y.date(y.date()+Math.round(Ae*O)),V)};if(ie===c)return this.set(c,this.$M+O);if(ie===g)return this.set(g,this.$y+O);if(ie===u)return de(1);if(ie===h)return de(7);var me=(B={},B[a]=r,B[l]=s,B[o]=n,B)[ie]||1,Me=this.$d.getTime()+O*me;return p.w(Me,this)},w.subtract=function(O,$){return this.add(-1*O,$)},w.format=function(O){var $=this,B=this.$locale();if(!this.isValid())return B.invalidDate||I;var V=O||"YYYY-MM-DDTHH:mm:ssZ",ie=p.z(this),de=this.$H,me=this.$m,Me=this.$M,Ae=B.weekdays,y=B.months,x=B.meridiem,G=function(z,ue,ae,H){return z&&(z[ue]||z($,V))||ae[ue].slice(0,H)},X=function(z){return p.s(de%12||12,z,"0")},Y=x||function(z,ue,ae){var H=z<12?"AM":"PM";return ae?H.toLowerCase():H};return V.replace(F,function(z,ue){return ue||function(ae){switch(ae){case"YY":return String($.$y).slice(-2);case"YYYY":return p.s($.$y,4,"0");case"M":return Me+1;case"MM":return p.s(Me+1,2,"0");case"MMM":return G(B.monthsShort,Me,y,3);case"MMMM":return G(y,Me);case"D":return $.$D;case"DD":return p.s($.$D,2,"0");case"d":return String($.$W);case"dd":return G(B.weekdaysMin,$.$W,Ae,2);case"ddd":return G(B.weekdaysShort,$.$W,Ae,3);case"dddd":return Ae[$.$W];case"H":return String(de);case"HH":return p.s(de,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return Y(de,me,!0);case"A":return Y(de,me,!1);case"m":return String(me);case"mm":return p.s(me,2,"0");case"s":return String($.$s);case"ss":return p.s($.$s,2,"0");case"SSS":return p.s($.$ms,3,"0");case"Z":return ie}return null}(z)||ie.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(O,$,B){var V,ie=this,de=p.p($),me=le(O),Me=(me.utcOffset()-this.utcOffset())*r,Ae=this-me,y=function(){return p.m(ie,me)};switch(de){case g:V=y()/12;break;case c:V=y();break;case f:V=y()/3;break;case h:V=(Ae-Me)/6048e5;break;case u:V=(Ae-Me)/864e5;break;case l:V=Ae/s;break;case a:V=Ae/r;break;case o:V=Ae/n;break;default:V=Ae}return B?V:p.a(V)},w.daysInMonth=function(){return this.endOf(c).$D},w.$locale=function(){return T[this.$L]},w.locale=function(O,$){if(!O)return this.$L;var B=this.clone(),V=ge(O,$,!0);return V&&(B.$L=V),B},w.clone=function(){return p.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},D}(),S=j.prototype;return le.prototype=S,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",u],["$M",c],["$y",g],["$D",C]].forEach(function(D){S[D[1]]=function(w){return this.$g(w,D[0],D[1])}}),le.extend=function(D,w){return D.$i||(D(w,j,le),D.$i=!0),le},le.locale=ge,le.isDayjs=q,le.unix=function(D){return le(1e3*D)},le.en=T[M],le.Ls=T,le.p={},le})}(Kr)),Kr.exports}var O_=S_();const Wt=yt(O_);var Xr={exports:{}},b_=Xr.exports,vl;function w_(){return vl||(vl=1,function(e,t){(function(n,r){e.exports=r()})(b_,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)}}})}(Xr)),Xr.exports}var A_=w_();const T_=yt(A_);var Qr={exports:{}},N_=Qr.exports,yl;function M_(){return yl||(yl=1,function(e,t){(function(n,r){e.exports=r()})(N_,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(b){return(b=+b)+(b>68?1900:2e3)},h=function(b){return function(F){this[b]=+F}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(b){(this.zone||(this.zone={})).offset=function(F){if(!F||F==="Z")return 0;var se=F.match(/([+-]|\d\d)/g),Q=60*se[1]+(+se[2]||0);return Q===0?0:se[0]==="+"?-Q:Q}(b)}],f=function(b){var F=l[b];return F&&(F.indexOf?F:F.s.concat(F.f))},g=function(b,F){var se,Q=l.meridiem;if(Q){for(var fe=1;fe<=24;fe+=1)if(b.indexOf(Q(fe,0,F))>-1){se=fe>12;break}}else se=b===(F?"pm":"PM");return se},C={A:[a,function(b){this.afternoon=g(b,!1)}],a:[a,function(b){this.afternoon=g(b,!0)}],Q:[s,function(b){this.month=3*(b-1)+1}],S:[s,function(b){this.milliseconds=100*+b}],SS:[i,function(b){this.milliseconds=10*+b}],SSS:[/\d{3}/,function(b){this.milliseconds=+b}],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(b){var F=l.ordinal,se=b.match(/\d+/);if(this.day=se[0],F)for(var Q=1;Q<=31;Q+=1)F(Q).replace(/\[|\]/g,"")===b&&(this.day=Q)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(b){var F=f("months"),se=(f("monthsShort")||F.map(function(Q){return Q.slice(0,3)})).indexOf(b)+1;if(se<1)throw new Error;this.month=se%12||se}],MMMM:[a,function(b){var F=f("months").indexOf(b)+1;if(F<1)throw new Error;this.month=F%12||F}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(b){this.year=u(b)}],YYYY:[/\d{4}/,h("year")],Z:c,ZZ:c};function I(b){var F,se;F=b,se=l&&l.formats;for(var Q=(b=F.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(le,p,j){var S=j&&j.toUpperCase();return p||se[j]||n[j]||se[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,w,O){return w||O.slice(1)})})).match(r),fe=Q.length,M=0;M<fe;M+=1){var T=Q[M],W=C[T],q=W&&W[0],ge=W&&W[1];Q[M]=ge?{regex:q,parser:ge}:T.replace(/^\[|\]$/g,"")}return function(le){for(var p={},j=0,S=0;j<fe;j+=1){var D=Q[j];if(typeof D=="string")S+=D.length;else{var w=D.regex,O=D.parser,$=le.slice(S),B=w.exec($)[0];O.call(p,B),le=le.replace(B,"")}}return function(V){var ie=V.afternoon;if(ie!==void 0){var de=V.hours;ie?de<12&&(V.hours+=12):de===12&&(V.hours=0),delete V.afternoon}}(p),p}}return function(b,F,se){se.p.customParseFormat=!0,b&&b.parseTwoDigitYear&&(u=b.parseTwoDigitYear);var Q=F.prototype,fe=Q.parse;Q.parse=function(M){var T=M.date,W=M.utc,q=M.args;this.$u=W;var ge=q[1];if(typeof ge=="string"){var le=q[2]===!0,p=q[3]===!0,j=le||p,S=q[2];p&&(S=q[2]),l=this.$locale(),!le&&S&&(l=se.Ls[S]),this.$d=function($,B,V,ie){try{if(["x","X"].indexOf(B)>-1)return new Date((B==="X"?1e3:1)*$);var de=I(B)($),me=de.year,Me=de.month,Ae=de.day,y=de.hours,x=de.minutes,G=de.seconds,X=de.milliseconds,Y=de.zone,z=de.week,ue=new Date,ae=Ae||(me||Me?1:ue.getDate()),H=me||ue.getFullYear(),te=0;me&&!Me||(te=Me>0?Me-1:ue.getMonth());var oe,_e=y||0,we=x||0,Ue=G||0,K=X||0;return Y?new Date(Date.UTC(H,te,ae,_e,we,Ue,K+60*Y.offset*1e3)):V?new Date(Date.UTC(H,te,ae,_e,we,Ue,K)):(oe=new Date(H,te,ae,_e,we,Ue,K),z&&(oe=ie(oe).week(z).toDate()),oe)}catch{return new Date("")}}(T,ge,W,se),this.init(),S&&S!==!0&&(this.$L=this.locale(S).$L),j&&T!=this.format(ge)&&(this.$d=new Date("")),l={}}else if(ge instanceof Array)for(var D=ge.length,w=1;w<=D;w+=1){q[1]=ge[w-1];var O=se.apply(this,q);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}w===D&&(this.$d=new Date(""))}else fe.call(this,M)}}})}(Qr)),Qr.exports}var D_=M_();const L_=yt(D_);var Jr={exports:{}},U_=Jr.exports,Sl;function P_(){return Sl||(Sl=1,function(e,t){(function(n,r){e.exports=r()})(U_,function(){return function(n,r,s){var i=r.prototype,o=function(c){return c&&(c.indexOf?c:c.s)},a=function(c,f,g,C,I){var b=c.name?c:c.$locale(),F=o(b[f]),se=o(b[g]),Q=F||se.map(function(M){return M.slice(0,C)});if(!I)return Q;var fe=b.weekStart;return Q.map(function(M,T){return Q[(T+(fe||0))%7]})},l=function(){return s.Ls[s.locale()]},u=function(c,f){return c.formats[f]||function(g){return g.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(C,I,b){return I||b.slice(1)})}(c.formats[f.toUpperCase()])},h=function(){var c=this;return{months:function(f){return f?f.format("MMMM"):a(c,"months")},monthsShort:function(f){return f?f.format("MMM"):a(c,"monthsShort","months",3)},firstDayOfWeek:function(){return c.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):a(c,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):a(c,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):a(c,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return u(c.$locale(),f)},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(f){return u(c,f)},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)}}})}(Jr)),Jr.exports}var F_=P_();const k_=yt(F_);var qr={exports:{}},$_=qr.exports,Ol;function x_(){return Ol||(Ol=1,function(e,t){(function(n,r){e.exports=r()})($_,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,f){return c.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(g,C,I){var b=I&&I.toUpperCase();return C||f[I]||n[I]||f[b].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(F,se,Q){return se||Q.slice(1)})})}(l,u===void 0?{}:u);return a.call(this,h)}}})}(qr)),qr.exports}var B_=x_();const H_=yt(B_);var Zr={exports:{}},j_=Zr.exports,bl;function W_(){return bl||(bl=1,function(e,t){(function(n,r){e.exports=r()})(j_,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(I){var b={date:I,utc:!0,args:arguments};return new o(b)},l.utc=function(I){var b=a(this.toDate(),{locale:this.$L,utc:!0});return I?b.add(this.utcOffset(),n):b},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(I){I.utc&&(this.$u=!0),this.$utils().u(I.$offset)||(this.$offset=I.$offset),u.call(this,I)};var h=l.init;l.init=function(){if(this.$u){var I=this.$d;this.$y=I.getUTCFullYear(),this.$M=I.getUTCMonth(),this.$D=I.getUTCDate(),this.$W=I.getUTCDay(),this.$H=I.getUTCHours(),this.$m=I.getUTCMinutes(),this.$s=I.getUTCSeconds(),this.$ms=I.getUTCMilliseconds()}else h.call(this)};var c=l.utcOffset;l.utcOffset=function(I,b){var F=this.$utils().u;if(F(I))return this.$u?0:F(this.$offset)?c.call(this):this.$offset;if(typeof I=="string"&&(I=function(M){M===void 0&&(M="");var T=M.match(r);if(!T)return null;var W=(""+T[0]).match(s)||["-",0,0],q=W[0],ge=60*+W[1]+ +W[2];return ge===0?0:q==="+"?ge:-ge}(I),I===null))return this;var se=Math.abs(I)<=16?60*I:I,Q=this;if(b)return Q.$offset=se,Q.$u=I===0,Q;if(I!==0){var fe=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(Q=this.local().add(se+fe,n)).$offset=se,Q.$x.$localOffset=fe}else Q=this.utc();return Q};var f=l.format;l.format=function(I){var b=I||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,b)},l.valueOf=function(){var I=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*I},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var g=l.toDate;l.toDate=function(I){return I==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var C=l.diff;l.diff=function(I,b,F){if(I&&this.$u===I.$u)return C.call(this,I,b,F);var se=this.local(),Q=a(I).local();return C.call(se,Q,b,F)}}})}(Zr)),Zr.exports}var z_=W_();const Y_=yt(z_);var es={exports:{}},V_=es.exports,wl;function G_(){return wl||(wl=1,function(e,t){(function(n,r){e.exports=r()})(V_,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")}}})}(es)),es.exports}var K_=G_();const X_=yt(K_);var ts={exports:{}},Q_=ts.exports,Al;function J_(){return Al||(Al=1,function(e,t){(function(n,r){e.exports=r()})(Q_,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 f=o(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),g=this.diff(f,n,!0);return g<0?o(this).startOf("week").week():Math.ceil(g)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(ts)),ts.exports}var q_=J_();const Z_=yt(q_);var ns={exports:{}},ep=ns.exports,Tl;function tp(){return Tl||(Tl=1,function(e,t){(function(n,r){e.exports=r()})(ep,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}}})}(ns)),ns.exports}var np=tp();const rp=yt(np);Wt.extend(L_),Wt.extend(T_),Wt.extend(X_),Wt.extend(k_),Wt.extend(Z_),Wt.extend(rp),Wt.extend(Y_),Wt.extend(H_);function rs(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 sp(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function ip(e){if(e==null)return!1;const t=e.paragraphStyle;return Nl(t)}function Nl(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 Ml(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Dl(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const op=/\s/g;function ap(e){return e===null||e.toString().replace(op,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function lp(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 Ge=Symbol("newer"),st=Symbol("older");class up{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:t.key}):{done:!0,value:void 0}}}class cp{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:t.value}):{done:!0,value:void 0}}}class hp{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}ah=Ge,oh=st;class Ll{constructor(t,n){R(this,"key");R(this,"value");R(this,ah);R(this,oh);this.key=t,this.value=n,this[Ge]=void 0,this[st]=void 0}toJSON(){return{key:this.key,value:this.value}}}class lr{constructor(...t){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(ur.hasLength(t,1)){if(ur.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(ur.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(ur.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),Je(()=>er(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[Ge]&&(t===this.oldest&&(this.oldest=t[Ge]),t[Ge][st]=t[st]),t[st]&&(t[st][Ge]=t[Ge]),t[Ge]=void 0,t[st]=this.newest,this.newest&&(this.newest[Ge]=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 Ll(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ge]=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 Ll(t,n)),this.newest?(this.newest[Ge]=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[Ge]?(this.oldest=this.oldest[Ge],this.oldest[st]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ge]=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[Ge]&&n[st]?(n[st][Ge]=n[Ge],n[Ge][st]=n[st]):n[Ge]?(n[Ge][st]=void 0,this.oldest=n[Ge]):n[st]?(n[st][Ge]=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 up(this.oldest)}values(){return new cp(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new hp(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[Ge]}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[Ge];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ge],n&&(t+=" < ");return t}}class ur{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 ss={exports:{}},dp=ss.exports,Ul;function fp(){return Ul||(Ul=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:dp,function(){return function(){var n={d:function(E,m){for(var _ in m)n.o(m,_)&&!n.o(E,_)&&Object.defineProperty(E,_,{enumerable:!0,get:m[_]})},o:function(E,m){return Object.prototype.hasOwnProperty.call(E,m)}},r={};n.d(r,{default:function(){return gt}});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(E){const m=i.exec(E);if(!m)throw new SyntaxError("Malformed locale: ".concat(E));return{lang:m[1]+(m[2]?"_"+m[2]:""),language:m[1],territory:m[2]||"",codeset:m[3]||"",modifier:m[4]||""}}function u(E){if(typeof E=="number")return s[65535&E]||null;const m=parseInt(E,16);return isFinite(m)&&s[65535&m]?s[65535&m]||null:i.test(E)?E:null}function h(E){const m=u(E);let _=null;if(m){const A=l(m);_=o[A.lang]||o[A.language]||null}return _}function c(E){return Object.assign({},a,E)}function f(E,m){const _=typeof m=="object"?m:l(m);return o[_.lang]=c(E),_.language===_.lang||o[_.language]||(o[_.language]=c(E)),o[_.lang]}const g=c({group:","});function C(E,m){if(typeof E!="number")return E;if(E<0)return-C(-E,m);if(m){const _=10**(m||0)||1;return C(E*_,0)/_}return Math.round(E)}g.isDefault=!0,f({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),f({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"),f({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"),f({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"),f({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),f({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"),f({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"),f({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"),f({group:","},"en"),f({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"),f({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"),f({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"),f({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),f({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"),f({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"),f({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"),f({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"),f({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"),f({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"),f({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"),f({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),f({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"),f({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"),f({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"),f({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 I(E,m,_){const A=E<0?-1:1,N=10**(m||2),P=10**(_||2);let U,k,v=Math.abs(E),Z=0,Ee=0,J=0,pe=1;if((E=v)%1==0)k=[E*A,1];else if(E<1e-19)k=[A,1e19];else if(E>1e19)k=[1e19*A,1];else{do if(v=1/(v-Math.floor(v)),U=pe,pe=pe*Math.floor(v)+Z,Z=U,Ee=J,J=Math.floor(E*pe+.5),J>=N||pe>=P)return[A*Ee,Z];while(Math.abs(E-J/pe)>=1e-10&&v!==Math.floor(v));k=[A*J,pe]}return k}const b={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},F=Object.assign({},b);function se(E){if(E===null&&(E=b),E){for(const m in E)if(m in b){const _=E[m];F[m]=_==null?b[m]:_}}return{...F}}const Q={"#":"",0:"0","?":" "},fe={"@":"text","-":"minus","+":"plus"},M=["#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"],T=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],W=new RegExp("["+T.join("")+"]");function q(E,m,_){return m[_+"_max"]=E.length,m[_+"_min"]=E.replace(/#/g,"").length,m}const ge={};function le(E){if(!(E in ge)){const m=[],_=E.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,A=>"?".repeat(A.length));for(let A=0;A<_.length;A++){const N=_.charAt(A);m[A]=N in Q?Q[N]:N}ge[E]=m.join("")}return ge[E]}function p(E,m){typeof E=="string"&&(E={type:"string",value:E=E.replace(/ /g,Q["?"])}),m.push(E)}function j(E){const m=[],_={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:m};let A=E+"",N="int",P=!1,U=null;const k=[];let v,Z,Ee=!1;for(;A&&!P;){if(v=/^General/i.exec(A))_.general=!0,p({type:"general"},m);else if(N==="int"&&(v=/^[#?0]+(?:,[#?0]+)*/.exec(A))||N==="den"&&(v=/^[#?\d]+/.exec(A))||(v=/^[#?0]+/.exec(A)))_[N+"_pattern"].push(v[0]),U={type:N,num:v[0]},p(U,m);else if((v=/^\//.exec(A))&&_[N+"_pattern"].length){if(!U)throw new SyntaxError("Missing a numerator in pattern ".concat(E));_.fractions=!0,_.num_pattern.push(_[N+"_pattern"].pop()),U.type="num",N="den",p({type:"div"},m)}else if(v=/^,+/.exec(A)){const L=A.charAt(1)in Q;Z.slice(-1)in Q&&(v[0].length>1||!L)?_.scale=.001**v[0].length:_.dec_fractions||p(v[0],m)}else{if(v=/^;/.exec(A)){P=!0;break}if(v=/^[@+-]/.exec(A))v[0]==="@"&&(_.text=!0),p({type:fe[v[0]]},m);else if(v=/^(?:\[(h+|m+|s+)\])/i.exec(A)){const L=v[1].toLowerCase(),ee=L[0],Ie={type:"",size:0,date:1,raw:v[0],pad:L.length};ee==="h"?(Ie.size=16,Ie.type="hour-elap"):ee==="m"?(Ie.size=32,Ie.type="min-elap"):(Ie.size=64,Ie.type="sec-elap"),_.date=_.date|Ie.size,k.push(Ie),p(Ie,m)}else if(v=/^(?:B2)/i.exec(A))Ee||(_.date_system=6);else if(v=/^(?:B1)/i.exec(A))Ee||(_.date_system=1);else if(v=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(A)){const L={type:"",size:0,date:1,raw:v[0]},ee=v[0].toLowerCase(),Ie=ee[0];if(ee==="y"||ee==="yy")L.size=2,L.type="year-short";else if(Ie==="y"||Ie==="e")L.size=2,L.type="year";else if(ee==="b"||ee==="bb")L.size=2,L.type="b-year-short";else if(Ie==="b")L.size=2,L.type="b-year";else if(ee==="d"||ee==="dd")L.size=8,L.type="day",L.pad=/dd/.test(ee);else if(ee==="ddd")L.size=8,L.type="weekday-short";else if(Ie==="d")L.size=8,L.type="weekday";else if(Ie==="h")L.size=16,L.type="hour",L.pad=/hh/i.test(ee);else if(Ie==="m"){ee.length===3?(L.size=4,L.type="monthname-short"):ee.length===5?(L.size=4,L.type="monthname-single"):ee.length>=4&&(L.size=4,L.type="monthname");const Te=k[k.length-1];!L.type&&Te&&!Te.used&&80&Te.size&&(Te.used=!0,L.size=32,L.type="min",L.pad=/mm/.test(ee)),L.type||(L.size=4,L.type="month",L.pad=/mm/.test(ee),L.indeterminate=!0)}else if(Ie==="s"){L.size=64,L.type="sec",L.pad=/ss/.test(ee);const Te=k[k.length-1];Te&&32&Te.size?L.used=!0:Te&&Te.indeterminate&&(delete Te.indeterminate,Te.size=32,Te.type="min",L.used=!0)}_.date=_.date|L.size,_.date_eval=!0,k.push(L),p(L,m)}else if(v=/^(?:AM\/PM|am\/pm|A\/P)/.exec(A))_.clock=12,_.date=16|_.date,_.date_eval=!0,p({type:"am",short:v[0]==="A/P"},m);else if(_.date&&(v=/^\.0{1,3}/i.exec(A))){const L=v[0].length-1,ee=[64,128,256,512][L];_.date=_.date|ee,_.date_eval=!0,_.sec_decimals=Math.max(_.sec_decimals,L),p({type:"subsec",size:ee,decimals:L,date:1,raw:v[0]},m)}else if((v=/^\\(.)/.exec(A))||(v=/^"([^"]*?)"/.exec(A)))p(v[1],m);else if(v=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(A))_.condition=[v[1],parseFloat(v[2],10)];else if(v=/^\[\$([^\]]+)\]/.exec(A)){const L=v[1].split("-"),ee=L.length<2?"":L[L.length-1],Ie=L[0];Ie&&p(Ie,m);const Te=u(ee);Te&&(_.locale=Te);const ke=parseInt(ee,16);isFinite(ke)&&16711680&ke&&(ke>>16&255)===6&&(_.date_system=6),Ee=!0}else if(v=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(A))_.color=v[2]?M[parseInt(v[2],10)]||"#000":v[1].toLowerCase();else if(!(v=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(A))){if(v=/^%/.exec(A))_.scale=100,_.percent=!0,p("%",m);else if(v=/^_(\\.|.)/.exec(A))p(" ",m);else if(v=/^\./.exec(A))p({type:"point",value:v[0]},m),_.dec_fractions=!0,N="frac";else if(v=/^[Ee]([+-]?|(?=[0#?]))/.exec(A))_.exponential=!0,_.exp_plus=v[1]==="+",N="man",p({type:"exp",plus:v[1]==="+"},m);else if(!(v=/^\*(\\.|.)/.exec(A))){if(v=/^[BENn[]/.exec(A))throw new SyntaxError("Unexpected char ".concat(A.charAt(0)," in pattern ").concat(E));A[0]==="("&&(_.parens=!0),v=[A[0]],p(v[0],m)}}}Z=v[0],A=A.slice(v?v[0].length:1)}if(_.pattern=E.slice(0,E.length-A.length),/^((?:\[[^\]]+\])+)(;|$)/.test(_.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(_.pattern)&&p({type:"text"},m),_.fractions&&_.dec_fractions||_.fractions&&_.exponential)throw new SyntaxError("Invalid pattern: ".concat(_.pattern));const J=_.int_pattern.join("");if(_.grouping=J.indexOf(",")>=0,_.grouping){const L=J.split(","),ee=L.length;ee===2?(_.group_pri=L[1].length,_.group_sec=_.group_pri):ee>2&&(_.group_pri=L[ee-1].length,_.group_sec=L[ee-2].length)}else _.group_pri=0,_.group_sec=0;q(J.replace(/[,]/g,""),_,"int"),q(_.frac_pattern.join(""),_,"frac"),q(_.man_pattern.join(""),_,"man");let pe=_.num_pattern.join(""),be=_.den_pattern.join("");const ce=/\?/.test(be)||/\?/.test(pe);return be=be.replace(/\d/g,ce?"?":"#"),ce&&(be=be.replace(/#$/g,"?")),q(pe,_,"num"),q(be,_,"den"),ce&&(pe=pe.replace(/#$/g,"?")),_.int_padding=le(_.int_pattern.join("")),_.man_padding=le(_.man_pattern.join("")),_.num_padding=le(pe),_.den_padding=le(be),_.den_pattern.length&&(_.denominator=parseInt(_.den_pattern.join("").replace(/\D/g,""),10)),_.integer=!!_.int_pattern.join("").length,_.fractions&&m.forEach((L,ee)=>{const Ie=m[ee+1];L.type==="string"&&Ie&&(Ie.type==="num"?L.rule="num+int":Ie.type==="div"?L.rule="num":Ie.type==="den"&&(L.rule="den"))}),_}const S=E=>{const m=E.condition;m&&m[1]<0&&(m[0]==="<"||m[0]==="<="||m[0]==="=")||E.tokens.unshift({type:"minus",volatile:!0})};function D(E){const m=[];let _,A=!1,N=null,P=E,U=0,k=!1,v=0,Z=0;do{if(k=j(P),(k.date||k.general)&&(k.int_pattern.length||k.frac_pattern.length||k.scale!==1||k.text))throw new Error("Illegal format");if(k.condition&&(Z++,A=!0),k.text){if(N)throw new Error("Unexpected partition");N=k}k.locale&&(_=u(k.locale)),m.push(k),U=P.charAt(k.pattern.length)===";"?1:0,P=P.slice(k.pattern.length+U),v++}while(U&&v<4&&Z<3);if(U)throw new Error("Unexpected partition");if(Z>2)throw new Error("Unexpected condition");const Ee=m[3];if(Ee&&(Ee.int_pattern.length||Ee.frac_pattern.length||Ee.date))throw new Error("Unexpected partition");if(A){const J=m.length;if(J===1&&(m[1]=j("General"),m[1].generated=!0),J<3){const pe=m[0],be=m[1];if(S(pe),be.condition)S(be);else{const ce=pe.condition;(ce[0]==="="||ce[1]>=0&&(ce[0]===">"||ce[0]===">="))&&be.tokens.unshift({type:"minus",volatile:!0})}}else m.forEach(S)}else{if(m.length<4&&N)for(let J=0,pe=m.length;J<pe;J++)m[J]===N&&m.splice(J,1);if(m.length<1&&N&&(m[0]=j("General"),m[0].generated=!0),m.length<2){const J=j(m[0].pattern);J.tokens.unshift({type:"minus",volatile:!0}),J.generated=!0,m.push(J)}if(m.length<3){const J=j(m[0].pattern);J.generated=!0,m.push(J)}if(m.length<4)if(N)m.push(N);else{const J=j("@");J.generated=!0,m.push(J)}m[0].condition=[">",0],m[1].condition=["<",0],m[2].condition=null}return{pattern:E,partitions:m,locale:_}}const w=Math.floor;function O(E){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&E>=0){if(E===0)return[1900,1,0];if(E===60)return[1900,2,29];if(E<60)return[1900,E<32?1:2,(E-1)%31+1]}let _=E+68569+2415019;const A=w(4*_/146097);_-=w((146097*A+3)/4);const N=w(4e3*(_+1)/1461001);_=_-w(1461*N/4)+31;const P=w(80*_/2447),U=_-w(2447*P/80);_=w(P/11);const k=P+2-12*_;return[0|100*(A-49)+N+_,0|k,0|U]}function $(E){return O(E+1462)}function B(E){if(E===60)throw new Error("#VALUE!");if(E<=1)return[1317,8,29];if(E<60)return[1317,E<32?9:10,1+(E-2)%30];const m=10631/30,_=.1335;let A=E+466935;const N=w(A/10631);A-=10631*N;const P=w((A-_)/m);A-=w(P*m+_);const U=w((A+28.5001)/29.5);return U===13?[30*N+P,12,30]:[30*N+P,U,A-w(29.5001*U-29)]}function V(E){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const A=w(E);return m===6?B(A):m===-1?$(A):O(A,_)}const ie=Math.floor,de=86400;function me(E,m){let _=null;if(Array.isArray(E)){const[A,N,P,U,k,v]=E;_=Date.UTC(A,N==null?0:N-1,P!=null?P:1,U||0,k||0,v||0)}else if(E instanceof Date&&(_=1*E,!m||!m.ignoreTimezone)){const A=new Date;A.setUTCFullYear(E.getFullYear(),E.getMonth(),E.getDate()),A.setUTCHours(E.getHours(),E.getMinutes(),E.getSeconds(),E.getMilliseconds()),_=1*A}if(_!=null&&isFinite(_)){const A=_/864e5;return A-(A<=-25509?-25568:-25569)}return E}function Me(E,m){let _=0|E;const A=de*(E-_);let N=ie(A);A-N>.9999&&(N+=1,N===de&&(N=0,_+=1));const P=N<0?de+N:N,[U,k,v]=V(E,0,m&&m.leap1900),Z=ie(P/60/60)%60,Ee=ie(P/60)%60,J=ie(P)%60;if(m&&m.nativeDate){const pe=new Date(0);return pe.setUTCFullYear(U,k-1,v),pe.setUTCHours(Z,Ee,J),pe}return[U,k,v,Z,Ee,J]}function Ae(E){return!!(E[0]&&E[0].percent||E[1]&&E[1].percent||E[2]&&E[2].percent||E[3]&&E[3].percent)}function y(E){return!!(E[0]&&E[0].date||E[1]&&E[1].date||E[2]&&E[2].date||E[3]&&E[3].date)}function x(E){const[m,_,A,N]=E;return!(m&&!m.generated||_&&!_.generated||A&&!A.generated||!N||!N.text||N.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},z=(E,m)=>E.replace(/\./,m.decimal);function ue(E,m,_,A){const N=0|_;if(typeof _=="string")E.push(_);else if(_===N)E.push(Math.abs(N));else{const P=Math.abs(_);let U=P?Math.floor(Math.log10(P)):0,k=U<0?P*10**-U:P/10**U;k===10&&(k=1,U++);const v=function(Ee){let J=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const pe=Math.abs(Ee);if(!pe)return Y;const be=J&&Ee<0?1:0,ce=Math.floor(pe),L=Math.floor(Math.log10(pe)+1);let ee=0,Ie=0;if(ce!==pe){ee=1;const Te=String(C(L<0?pe*10**-L:pe/10**L,15));let ke=Te.length,$e=!0,We=0;for(;We<=Te.length;){if(Te[We]==="."){ke--;break}Te[We]==="0"&&$e?ke--:$e=!1,We++}Ie=ke-L,Ie<0&&(Ie=0,ee=0)}return{total:be+Math.max(L,1)+ee+Ie,digits:Math.max(L,0)+Ie,sign:be,period:ee,int:Math.max(L,1),frac:Ie}}(P),Z=()=>{const Ee=Math.abs(U);let J;J=k===1?k:C(k,5),E.push(z(J+"",A),A.exponent,U<0?A.negative:A.positive,Ee<10?"0":"",Ee)};if(U>=-4&&U<=-1){const Ee=P.toPrecision(10+U).replace(/\.?0+$/,"");E.push(z(Ee,A))}else if(U===10){const Ee=P.toFixed(10).slice(0,12).replace(/\.$/,"");E.push(z(Ee,A))}else if(Math.abs(U)<=9)if(v.total<=11){const Ee=C(P,9).toFixed(v.frac);E.push(z(Ee,A))}else U===9?E.push(Math.floor(P)):U>=0&&U<9?E.push(C(P,9-U)):Z();else v.total>=12?Z():Math.floor(P)===P?E.push(Math.floor(P)):E.push(z(C(P,9).toFixed(v.frac),A))}return E}const ae=86400,H={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},te=function(E){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const _=Math.floor(Math.log10(E));return m>1?Math.floor(_/m)*m:_};function oe(E,m,_,A){let N="",P="",U="",k="",v="",Z=0,Ee=0|E,J=0,pe=0,be=1,ce=0,L=0,ee=0,Ie=0,Te=0,ke=0;const $e=A||g;if(!m.text&&isFinite(m.scale)&&m.scale!==1&&(E=function(ye){if(ye===0)return ye;const De=Math.ceil(Math.log10(ye<0?-ye:ye)),ne=10**(16-Math.floor(De));return Math.round(ye*ne)/ne}(E*m.scale)),m.exponential){let ye=Math.abs(E);if(ye){const De=10**-te(ye,m.int_max),ne=C(ye*De,m.frac_max)/De;Z=te(ne,m.int_max)}ye/=10**Z,E=E<0?-ye:ye,N+=Math.abs(Z)}if(m.integer){const ye=Math.abs(C(E,m.fractions?1:m.frac_max));v+=ye<1?"":Math.floor(ye)}if(m.grouping){let ye="",De=v.length;for(De>m.group_pri&&(De-=m.group_pri,ye=$e.group+v.slice(De,De+m.group_pri)+ye);De>m.group_sec;)De-=m.group_sec,ye=$e.group+v.slice(De,De+m.group_sec)+ye;v=De?v.slice(0,De)+ye:ye}m.dec_fractions&&(k=String(C(E,m.frac_max)).split(".")[1]||"");let We=!1;if(m.fractions){const ye=Math.abs(m.integer?E%1:E);if(ye)if(We=!0,isFinite(m.denominator))U+=m.denominator,P+=C(ye*m.denominator),P==="0"&&(P="",U="",We=!1,v||(v="0"));else{const De=I(ye,m.integer?m.num_max:1/0,m.den_max);P+=De[0],U+=De[1],m.integer&&P==="0"&&(v||(v="0"),P="",U="",We=!1)}}if(m.date){Ee=Math.trunc(E);const ye=ae*(E-Ee);if(J=Math.floor(ye),ke=ye-J,Math.abs(ke)<1e-6?ke=0:ke>.9999&&(ke=0,J+=1,J===ae&&(J=0,Ee+=1)),ke){const De=512&m.date||256&m.date||128&m.date;(De===512&&ke>.9995||De===256&&ke>.995||De===128&&ke>.95||!De&&ke>=.5)&&(J++,ke=0)}if(Ee||m.date_system){const De=V(E,m.date_system,_.leap1900);pe=De[0],be=De[1],ce=De[2]}if(J){const De=J<0?ae+J:J;Te=Math.floor(De)%60,Ie=Math.floor(De/60)%60,ee=Math.floor(De/60/60)%60}if(L=(6+Ee)%7,m.date_eval&&(mt=E,Et=Ee+J/ae,_.dateSpanLarge?mt<-694324||Et>=35830291:mt<0||Et>=2958466)){if(_.dateErrorThrows)throw new Error("Date out of bounds");return _.dateErrorNumber?ue(E<0?[$e.negative]:[],0,E,$e).join(""):_.overflow}}var mt,Et;if(m.int_padding&&(v=m.int_padding.length===1?v||m.int_padding:m.int_padding.substring(0,m.int_padding.length-v.length)+v),m.num_padding&&(P=m.num_padding.length===1?P||m.num_padding:m.num_padding.substring(0,m.num_padding.length-P.length)+P),m.den_padding&&(U=m.den_padding.length===1?U||m.den_padding:U+m.den_padding.slice(U.length)),m.man_padding){const ye=m.exp_plus?"+":"";N=m.man_padding.length===1?(Z<0?"-":ye)+(N||m.man_padding):(Z<0?"-":ye)+m.man_padding.slice(0,m.man_padding.length-N.length)+N}const Re=[];let et=0;const Se={int:0,frac:0,man:0,num:0,den:0};for(let ye=0,De=m.tokens.length;ye<De;ye++){const ne=m.tokens[ye],dt=ne.num?ne.num.length:0;if(ne.type==="string")ne.rule?ne.rule==="num"?We?Re.push(ne.value):(m.num_min>0||m.den_min>0)&&Re.push(ne.value.replace(/./g,Q["?"])):ne.rule==="num+int"?We&&v?Re.push(ne.value):m.den_min>0&&(v||m.num_min)&&Re.push(ne.value.replace(/./g,Q["?"])):ne.rule==="den"&&(We?Re.push(ne.value):(m.den_min>0||m.den_min>0)&&Re.push(ne.value.replace(/./g,Q["?"]))):Re.push(ne.value);else if(ne.type==="error")Re.push(_.invalid);else if(ne.type==="point")Re.push(m.date?ne.value:$e.decimal);else if(ne.type==="general")ue(Re,0,E,$e);else if(ne.type==="exp")Re.push($e.exponent);else if(ne.type==="minus")ne.volatile&&m.date||ne.volatile&&(E>=0||typeof E!="number")||(ne.volatile&&!m.fractions&&(m.integer||m.dec_fractions)?(E<0&&v&&v!=="0"||k)&&Re.push($e.negative):Re.push($e.negative));else if(ne.type==="plus")Re.push($e.positive);else if(ne.type==="text")Re.push(E);else if(ne.type==="div")We?Re.push("/"):m.num_min>0||m.den_min>0?Re.push(Q["?"]):Re.push(Q["#"]);else if(ne.type==="int")if(m.int_pattern.length===1)Re.push(v);else{const He=et?m.int_pattern.join("").length-Se.int:1/0,$t=et===m.int_pattern.length-1?0:m.int_pattern.join("").length-(Se.int+ne.num.length);Re.push(v.substring(v.length-He,v.length-$t)),et++,Se.int+=ne.num.length}else if(ne.type==="frac"){const He=Se.frac;for(let $t=0;$t<dt;$t++)Re.push(k[$t+He]||Q[ne.num[$t]]);Se.frac+=dt}else if(ne.type in H)m[ne.type+"_pattern"].length===1?(ne.type==="int"&&Re.push(v),ne.type==="frac"&&Re.push(k),ne.type==="man"&&Re.push(N),ne.type==="num"&&Re.push(P),ne.type==="den"&&Re.push(U)):(Re.push(H[ne.type].slice(Se[ne.type],Se[ne.type]+dt)),Se[ne.type]+=dt);else if(ne.type==="year")pe<0&&Re.push($e.negative),Re.push(String(Math.abs(pe)).padStart(4,"0"));else if(ne.type==="year-short"){const He=pe%100;Re.push(He<10?"0":"",He)}else if(ne.type==="month")Re.push(ne.pad&&be<10?"0":"",be);else if(ne.type==="monthname-single")m.date_system===6?Re.push($e.mmmm6[be-1].charAt(0)):Re.push($e.mmmm[be-1].charAt(0));else if(ne.type==="monthname-short")m.date_system===6?Re.push($e.mmm6[be-1]):Re.push($e.mmm[be-1]);else if(ne.type==="monthname")m.date_system===6?Re.push($e.mmmm6[be-1]):Re.push($e.mmmm[be-1]);else if(ne.type==="weekday-short")Re.push($e.ddd[L]);else if(ne.type==="weekday")Re.push($e.dddd[L]);else if(ne.type==="day")Re.push(ne.pad&&ce<10?"0":"",ce);else if(ne.type==="hour"){const He=ee%m.clock||(m.clock<24?m.clock:0);Re.push(ne.pad&&He<10?"0":"",He)}else if(ne.type==="min")Re.push(ne.pad&&Ie<10?"0":"",Ie);else if(ne.type==="sec")Re.push(ne.pad&&Te<10?"0":"",Te);else if(ne.type==="subsec"){Re.push($e.decimal);const He=ke.toFixed(m.sec_decimals);Re.push(He.slice(2,2+ne.decimals))}else if(ne.type==="am"){const He=ee<12?0:1;ne.short&&!A?Re.push("AP"[He]):Re.push($e.ampm[He])}else if(ne.type==="hour-elap"){E<0&&Re.push($e.negative);const He=24*Ee+Math.floor(Math.abs(J)/3600);Re.push(String(Math.abs(He)).padStart(ne.pad,"0"))}else if(ne.type==="min-elap"){E<0&&Re.push($e.negative);const He=1440*Ee+Math.floor(Math.abs(J)/60);Re.push(String(Math.abs(He)).padStart(ne.pad,"0"))}else if(ne.type==="sec-elap"){E<0&&Re.push($e.negative);const He=Ee*ae+Math.abs(J);Re.push(String(Math.abs(He)).padStart(ne.pad,"0"))}else if(ne.type==="b-year")Re.push(pe+543);else if(ne.type==="b-year-short"){const He=(pe+543)%100;Re.push(He<10?"0":"",He)}}return _.nbsp?Re.join(""):Re.join("").replace(/\u00a0/g," ")}function _e(E,m){for(let _=0;_<3;_++){const A=m[_];if(A){let N;if(A.condition){const P=A.condition[0],U=A.condition[1];P==="="?N=E===U:P===">"?N=E>U:P==="<"?N=E<U:P===">="?N=E>=U:P==="<="?N=E<=U:P==="<>"&&(N=E!==U)}else N=!0;if(N)return A}}}const we=j("@"),Ue="black",K={};function ve(E,m){if(E){const _=E[0];m[_]=m[_]||{},ve(E.slice(1),m[_])}else m.$=!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(E=>{ve(E,K),ve(E+" x",K),ve(E+" l",K),ve(E+" l x",K),ve("l "+E,K),ve("l "+E+" x",K),ve(E+" D",K),ve(E+" D x",K),ve("D "+E,K),ve("D "+E+" x",K)});const Ke={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},Fe={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"},qe=new Date().getUTCFullYear();function Ot(E){const m=new RegExp("^([\\s+%"+T.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+T.join("")+")]*)$").exec(E);if(m){const[,_,A,N,P,U]=m;let k=1,v="",Z=!1,Ee=!1,J=!1,pe=!1,be=!1,ce=null,L=!1,ee=parseFloat(A.replace(/,/g,""));if(!isFinite(ee))return null;for(let Te=0;Te<_.length;Te++){const ke=_[Te];if(ke==="-"){if(Z||Ee)return null;Z=!0,k=-1}else if(W.test(ke)){if(be)return null;be=!0,ce=ke}else if(ke==="("){if(Ee||Z)return null;Ee=!0,k=-1}else if(ke==="%"){if(pe)return null;pe=!0}}for(let Te=0;Te<U.length;Te++){const ke=U[Te];if(W.test(ke)){if(be)return null;be=!0,ce=ke,L=!0}else if(ke===")"){if(J||!Ee)return null;J=!0}else if(ke==="%"){if(pe)return null;pe=!0}}if(P){if(pe||be)return null;v="0.00E+00"}else if(pe){if(be)return null;v=N.includes(".")?"0.00%":"0%",ee*=.01}else if(be){const Te=N.includes(".")?"#,##0.00":"#,##0";v=L?Te+ce:ce+Te}else N.includes(",")&&(v=N.includes(".")?"#,##0.00":"#,##0");const Ie={v:ee*k};return v&&(Ie.z=v),Ie}}const Xe=(E,m,_)=>{const A=_.path||"",N=Object.keys(m);for(let P=0;P<N.length;P++){let U;const k=N[P];if(m[k]){if(k==="$"||k==="€")E||(U=_);else if(k==="-"){const v=/^(\s*([./-]|,\s)\s*|\s+)/.exec(E);if(v){const Z=v[1]==="-"||v[1]==="/"||v[1]==="."?v[1]:" ";if(!_.sep||_.sep===Z){const Ee=v[0].replace(/\s+/g," ");U=Xe(E.slice(v[0].length),m[k],{..._,sep:Z,path:A+Ee})}}}else if(k===" "){const v=/^[,.]?\s+/.exec(E);if(v){const Z=v[0].replace(/\s+/g," ");U=Xe(E.slice(v[0].length),m[k],{..._,path:A+Z})}}else if(k==="j"||k==="d"){const v=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(E);v&&(U=Xe(E.slice(v[0].length),m[k],{..._,day:v[0],path:A+k}))}else if(k==="n"||k==="m"){const v=/^(0?[1-9]|1[012])\b/.exec(E);v&&(U=Xe(E.slice(v[0].length),m[k],{..._,month:+v[0],_mon:v[0],path:A+k}))}else if(k==="F"||k==="M"){const v=/^([a-z]{3,9})\b/i.exec(E),Z=v&&(k==="F"?je:Ke)[v[0].toLowerCase()];Z&&(U=Xe(E.slice(v[0].length),m[k],{..._,month:Z,_mon:v[0],path:A+k}))}else if(k==="l"||k==="D"){const v=/^([a-z]{3,9})\b/i.exec(E);(v&&Fe[v[0].toLowerCase()])===k&&(U=Xe(E.slice(v[0].length),m[k],{..._,path:A+k}))}else if(k==="y"){const v=/^\d\d\b/.exec(E);if(v){const Z=+v[0]>=30?+v[0]+1900:+v[0]+2e3;U=Xe(E.slice(v[0].length),m[k],{..._,year:Z,path:A+k})}}else if(k==="Y"){const v=/^\d\d\d\d\b/.exec(E);v&&(U=Xe(E.slice(v[0].length),m[k],{..._,year:+v[0],path:A+k}))}else{if(k!=="x")throw new Error('Unknown date token "'.concat(k,'"'));{const v=Qe(E);v&&(U=Xe("",m[k],{..._,time:v.v,tf:v.z,path:A+k}))}}if(U)return U}}};function rt(E,m){const _=Xe(E.trim(),K,{path:""});if(_){var A;if(_.sep==="."&&_.path.length===3)return null;const N=+((A=_.year)!==null&&A!==void 0?A:qe);if(_.day||(_.day=1),!function(k,v,Z){if(Z<1||v<1||v>12)return!1;if(v===2){if(Z>(k%4==0&&k%100!=0||k%400==0||k===1900?29:28))return!1}else if((v===4||v===6||v===9||v===11)&&Z>30||(v===1||v===3||v===5||v===7||v===8||v===10||v===12)&&Z>31)return!1;return!0}(N,_.month,_.day))return null;let P=-1/0;if(N<1900)return null;N<=1900&&_.month<=2?P=25568:N<1e4&&(P=25569);const U=Date.UTC(N,_.month-1,_.day)/864e5+P+(_.time||0);if(U>=0&&U<=2958465){const k=_._mon[0]==="0"||_.day[0]==="0"||_._mon.length===2&&_.day.length===2,v=_.path.replace(/[jdlDnmMFyYx-]/g,Z=>Z==="j"||Z==="d"?k?"dd":"d":Z==="D"?"ddd":Z==="l"?"dddd":Z==="n"||Z==="m"?k?"mm":"m":Z==="M"?"mmm":Z==="F"?"mmmm":Z==="y"?"yy":Z==="x"?_.tf||"":Z==="Y"?"yyyy":Z);return m&&m.nativeDate?{v:Me(U,m),z:v}:{v:U,z:v}}}return null}function Qe(E){const m=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(E);if(m){const[,_,A,N,P,U]=m;if(P&&!N||!U&&!A&&!N)return null;let k=1*(_||0);if(U){if(k>=13)return null;U[0]!=="p"&&U[0]!=="P"||(k+=12)}return{v:(60*k*60+60*(1*(A||0))+1*(N||0)+1*(P||0))/86400,z:(_.length===2?"hh":"h")+":mm"+(N?":ss":"")+(U?" AM/PM":"")}}return null}function ft(E){return/^\s*true\s*$/i.test(E)?{v:!0}:/^\s*false\s*$/i.test(E)?{v:!1}:null}const ut={};function Qt(E,m){const{pattern:_,partitions:A,locale:N}=E,P=v=>{const Z=Object.assign({},se(),m,v);return N&&(Z.locale=N),Z},U=(v,Z)=>{const Ee=P(Z);return function(J,pe,be){const ce=h(be.locale),L=pe[3]?pe[3]:we;if(typeof J=="boolean"&&(J=J?"TRUE":"FALSE"),J==null)return"";if(typeof J!="number")return oe(J,L,be,ce);if(!isFinite(J)){const Ie=ce||g;return isNaN(J)?Ie.nan:(J<0?Ie.negative:"")+Ie.infinity}const ee=_e(J,pe);return ee?oe(J,ee,be,ce):be.overflow}(me(v,Ee),A,Ee)};U.color=(v,Z)=>function(Ee,J){if(typeof Ee!="number"||!isFinite(Ee))return(J[3]?J[3].color:we.color)||Ue;const pe=_e(Ee,J);return pe&&pe.color||Ue}(me(v,P(Z)),A);const k=function(v){var Z;let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[J,pe]=v,be=J.frac_max,ce={type:"general",isDate:y(v),isText:x(v),isPercent:Ae(v),maxDecimals:J.general?9:be,scale:(Z=J.scale)!==null&&Z!==void 0?Z:1,color:0,parentheses:0,grouped:J.grouping?1:0,_partitions:v},L=!ce.isDate&&!ce.isText&&!J.error&&J.tokens.some($e=>$e.type==="string"&&(Ee?$e.value===Ee:W.test($e.value)));let ee="G",Ie=be>=0?Math.min(15,be):"",Te="",ke="";if(pe&&pe.color&&(ke="-",ce.color=1),J.parens&&(Te="()",ce.parentheses=1),L)ee="C",ce.type="currency";else if(J.error)ce.type="error",ce.maxDecimals=0;else if(ce.isDate){let $e=0,We=0,mt="";J.tokens.forEach(Re=>{const et=Re.type;/^(b-)?year/.test(et)?(mt+="Y",We++):et.startsWith("month")?(mt+="M",We++):/^(week)?day/.test(et)?(mt+="D",We++):et!=="hour"&&et!=="min"&&et!=="sec"&&et!=="am"||(mt+=et[0],$e++)}),ce.type="date",We&&$e?ce.type="datetime":!We&&$e&&(ce.type="time");const Et=X.find(Re=>mt.startsWith(Re[0]));ee=Et?"D":"G",Ie=Et?Et[1]:""}else ce.isText?(ee="G",ce.type="text",Ie="",ce.maxDecimals=0):J.general?(ee="G",ce.type="general",Ie=""):J.fractions?(ee="G",ce.type="fraction",Ie=""):J.exponential?(ee="S",ce.type="scientific"):ce.isPercent?(ee="P",ce.type="percent"):J.grouping?(ee=",",ce.type="grouped"):(J.int_max||be)&&(ee="F",ce.type="number");return ce.code=ee+Ie+ke+Te,ce.level=G[ce.type],Object.freeze(ce)}(A,(m||{}).currency)||new SyntaxError;return U.info=k,U.dateInfo=function(v){const[Z]=v;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}}(A),U.isPercent=()=>!!k.isPercent,U.isDate=()=>!!k.isDate,U.isText=()=>!!k.isText,U.pattern=_,E.error&&(U.error=E.error),U.options=P,U.locale=N||m&&m.locale||"",Object.freeze(U)}function xe(E,m){E||(E="General");let _=null;return ut[E]?_=ut[E]:(_=Object.assign({},se(),m).throws?D(E):function(A){try{return D(A)}catch(N){const P={tokens:[{type:"error"}],error:N.message};return{pattern:A,partitions:[P,P,P,P],error:N.message,locale:null}}}(E),_.error||(ut[E]=_)),Qt(_,m)}xe.isDate=E=>xe(E,{throws:!1}).isDate(),xe.isPercent=E=>xe(E,{throws:!1}).isPercent(),xe.isText=E=>xe(E,{throws:!1}).isText(),xe.getInfo=(E,m)=>xe(E,{...m,throws:!1}).info,xe.getDateInfo=(E,m)=>xe(E,{...m,throws:!1}).dateInfo,xe.dateToSerial=me,xe.dateFromSerial=Me,xe.options=se,xe.dec2frac=I,xe.round=C,xe.codeToLocale=s,xe.parseLocale=l,xe.getLocale=h,xe.addLocale=(E,m)=>{const _=l(m);return delete ut[_.lang],delete ut[_.language],f(E,_)},xe.format=function(E,m,_){let A=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const N=_&&typeof _=="object"?_:{locale:_,throws:!A};return xe(E,N)(me(m,N),N)},xe.is_date=xe.isDate,xe.parseNumber=Ot,xe.parseDate=rt,xe.parseTime=Qe,xe.parseBool=ft,xe.parseValue=function(E,m){var _,A,N;return(_=(A=(N=Ot(E))!==null&&N!==void 0?N:rt(E,m))!==null&&A!==void 0?A:Qe(E))!==null&&_!==void 0?_:ft(E)};var gt=xe;return r=r.default}()})}(ss)),ss.exports}var Di,Pl;function gp(){return Pl||(Pl=1,Di=fp()),Di}var mp=gp();const Fl=yt(mp);function tn(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=tn(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 _p(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 pp(e,t,n){const r=n;if(tn(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 Pi(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?Ep(e,t,n,r):Cp(e,t,n,r)}function Ep(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 Cp(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 Ut{constructor(t={}){R(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new Ut({[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){Pi(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{Pi(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 Ut;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 Ut;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 tn(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=tn(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 Ut;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=tn(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 Rp={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},Ip={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},vp={startRow:0,startColumn:0,endRow:0,endColumn:0},yp={row:0,column:0},ht={ff:"Arial",fs:11,it:Oe.FALSE,bl:Oe.FALSE,ul:{s:Oe.FALSE},st:{s:Oe.FALSE},ol:{s:Oe.FALSE},tr:{a:0,v:Oe.FALSE},td:Tn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Ht.UNSPECIFIED,vt:qt.UNSPECIFIED,tb:gn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},kl={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},Sp=[Ys,ca,Vs];var $l=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))($l||{});function is(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 Oe.FALSE;switch(e){case"bl":case"it":{if(o[e]===Oe.FALSE)return Oe.FALSE;break}case"ul":case"st":{if(o[e].s===Oe.FALSE)return Oe.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
  7. `)===r?Oe.TRUE:Oe.FALSE}const br=class br{constructor(t,n,r){R(this,"_range");R(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 Ut;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 Ut;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 br(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?is("ul",t.body)===Oe.TRUE?{s:Oe.TRUE}:{s:Oe.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?is("st",t.body)===Oe.TRUE?{s:Oe.TRUE}:{s:Oe.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?is("it",t.body)===Oe.TRUE?Br.ITALIC:Br.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?is("bl",t.body)===Oe.TRUE?Hr.BOLD:Hr.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()===gn.WRAP?Oe.TRUE:Oe.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){br.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]}))}};R(br,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===Le.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===Le.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===Le.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 Mn=br;function Op(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||Le.NORMAL;if(!r&&i===nt.ALL&&o===nt.ALL)return s;const l=xl(s.startRow,n,s.startColumn,t,a),u=xl(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 xl(e,t,n,r,s){return s===Le.NORMAL?{row:e+t,column:n+r}:s===Le.ROW?{row:e+t,column:n}:s===Le.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function Fi(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 f of e){if(f.startRow>c)break;if(f.startRow<=h&&f.endRow>=c&&f.startColumn<=l&&f.endColumn>=u){i.push({startColumn:l,endColumn:u,startRow:h,endRow:c});break}}}return i}function bp(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 wp(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 Ap(e){const t=Fi(e),n=bp(t);return wp(n)}function Tp(e,t){const n=[];return e.forEach(r=>{n.push(...zt.subtract(r,t))}),zt.mergeRanges(n)}function Np(e,t){const n=Bl(e.startRow,e.endRow,t.startRow,t.endRow),r=Bl(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=Mp(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Bl(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 Mp(e,t,n,r,s,i){const o=e!==void 0?e:Hl(n,r,s,i),a=t!==void 0?t:Hl(n,r,s,i);return o===Le.ALL||a===Le.ALL?o===a?o:o===Le.ALL?a:o:o===a?o:(o===Le.NORMAL||a===Le.NORMAL,Le.NORMAL)}function Hl(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?Le.NORMAL:s?Le.ROW:i?Le.COLUMN:Le.ALL}const Xt=class Xt{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===Le.NORMAL||n.rangeType===void 0&&t.rangeType===Le.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,f=i<=h&&o>=u;return c&&f}static intersects(t,n){if(t.rangeType===Le.ROW&&n.rangeType===Le.COLUMN||t.rangeType===Le.COLUMN&&n.rangeType===Le.ROW)return!0;if(t.rangeType===Le.ROW&&n.rangeType===Le.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===Le.COLUMN&&n.rangeType===Le.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,f=Math.abs(o+a-h-c),g=Math.abs(o-a)+Math.abs(h-c),C=Math.abs(s+i-l-u),I=Math.abs(s-i)+Math.abs(l-u);return f<=g&&C<=I}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,f,g,C;if(a<=s)a>=r?f=a:f=r;else return null;if(l>=r)l>=s?C=s:C=l;else return null;if(u<=o)u>i?c=u:c=i;else return null;if(h>=i)h>=o?g=o:g=h;else return null;return{startRow:f,endRow:C,startColumn:c,endColumn:g,rangeType:Le.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 Xt.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:Le.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===Le.COLUMN),r=t.some(i=>i.rangeType===Le.ROW),s=Xt.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?Le.ROW:n?Le.COLUMN:Le.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 Ap(t)}static splitIntoGrid(t){return Fi(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=Tp(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)}};R(Xt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),R(Xt,"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})),R(Xt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),R(Xt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),R(Xt,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let zt=Xt;function Dp(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=Lp(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function Lp(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 Up(e,t){Mn.foreach(t,(n,r)=>{e[n][r]=void 0})}function Pp(e,t){const n=e.toFullArray(),r=[];for(;;){const s=Dp(n,t);if(!s)break;r.push(s),Up(n,s)}return r}class Fp{constructor(t,n){R(this,"_values",[]);R(this,"_keys",[]);R(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 ki(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 kp(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 os=65,jl=90,$p=97;function xp(e){const t=jl-os+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+os)+n,e=Math.floor(e/t)-1;return n}function Wl(e,t){let n="";for(;t>0;)n+=e,t--;return n}function Bp(e,t=!1){const n=jl-os+1;let r=$p;t&&(r=os);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Wl(s,i)}function Hp(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function jp(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function cr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var zl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(zl||{}),Yl=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Yl||{}),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||{}),hr=(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))(hr||{}),nn=(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))(nn||{}),_n=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(_n||{}),Vl=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Vl||{}),$i=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))($i||{}),Gl=(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))(Gl||{}),Kl=(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))(Kl||{}),Xl=(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))(Xl||{}),Ql=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Ql||{}),Jl=(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))(Jl||{}),ql=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(ql||{}),Zl=(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))(Zl||{}),eu=(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))(eu||{}),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||{}),ru=(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))(ru||{}),su=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(su||{}),iu=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(iu||{}),ou=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(ou||{}),au=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(au||{}),lu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(lu||{}),uu=(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))(uu||{}),Dn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Dn||{}),cu=(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))(cu||{}),hu=(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))(hu||{}),du=(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))(du||{}),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||{}),gu=(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))(gu||{}),mu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(mu||{}),_u=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(_u||{}),pu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(pu||{}),Eu=(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))(Eu||{}),xi=(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))(xi||{}),Cu=(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))(Cu||{}),Ru=(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))(Ru||{}),Be=(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))(Be||{}),Pt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Pt||{}),Bi=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Bi||{});class as extends tt{}function Wp(e=re.generateRandomId(6),t=An.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:$i.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:Oe.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:Oe.TRUE,doNotHyphenateCaps:Oe.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:Oe.FALSE,useFirstPageHeaderFooter:Oe.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var dr={},ls={},us={},Iu;function zp(){if(Iu)return us;Iu=1,Object.defineProperty(us,"__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 us.default=n,us}var cs={},vu;function Yp(){if(vu)return cs;vu=1,Object.defineProperty(cs,"__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 cs.default=e,cs}var Hi={},yu;function Su(){return yu||(yu=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 f in h){const g=f;c.write(g,h[g])}}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 f=this.container,g=this.parents.length-1,C=this.idx;for(;C>=0;)c.unshift(f[C]),C===0?(C=this.indexes[g*2],f=this.parents[g--]):C-=n(f[C-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 f=this.container[c];return Array.isArray(f)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(c),this.idx=0,this.container=f):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,f=this.parents[this.parents.length-1];return c>=f.length?!1:(t(!isNaN(c)),this.indexes[this.indexes.length-1]=c,this.container=f[c],!0)}_init(c,f,g,C){this.container=c,this.idx=f,this.parents=g.slice(),this.indexes=C.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,f){const g=this.getComponent();g&&f(g,c);for(const C of this)c&&c.descend(C),this.traverse(c,f),c&&c.ascend()}eachPick(c,f){this.traverse(c,(g,C)=>{g.p!=null&&f(g.p,C)})}eachDrop(c,f){this.traverse(c,(g,C)=>{g.d!=null&&f(g.d,C)})}}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 f=this.pendingDescent[c];let g=this.idx+1;if(g<this.container.length&&n(this.container[g])&&g++,t(g===this.container.length||!n(this.container[g])),g===this.container.length)this.container.push(f),this.idx=g;else if(this.container[g]===f)this.idx=g;else{if(!Array.isArray(this.container[g])){const C=this.container.splice(g,this.container.length-g);this.container.push(C),this.lcIdx>-1&&(this.lcIdx=g)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(f,this.container[this.lcIdx][0])),g=this.lcIdx+1,this.lcIdx=-1);g<this.container.length&&r(f,this.container[g][0]);)g++;if(this.indexes.push(g),this.idx=0,g<this.container.length&&this.container[g][0]===f)this.container=this.container[g];else{const C=[f];this.container.splice(g,0,C),this.container=C}}}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 f={};return this.container.splice(c,0,f),f}}write(c,f){const g=this.getComponent();t(g[c]==null||g[c]===f,"Internal consistency error: Overwritten component. File a bug"),g[c]=f}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,f=s){if(c===null)return;if(t(Array.isArray(c)),c===this._op)throw Error("Cannot merge into my own tree");const g=this.lcIdx,C=this.parents.length;let I=0;for(let b=0;b<c.length;b++){const F=c[b];typeof F=="string"||typeof F=="number"?(I++,this.descend(F)):Array.isArray(F)?this.mergeTree(F,f):typeof F=="object"&&f(F,this)}for(;I--;)this.ascend();this.lcIdx=this.parents.length===C?g:-1}at(c,f){this.descendPath(c),f(this);for(let g=0;g<c.length;g++)this.ascend();return this}writeAtPath(c,f,g){return this.at(c,()=>this.write(f,g)),this.reset(),this}writeMove(c,f,g=0){return this.writeAtPath(c,"p",g).writeAtPath(f,"d",g)}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,f){let g,C;C=g=h?h.descendFirst():!1;function I(b){let F;for(;C;){const se=F=h.getKey();if(b!=null){let Q=!1;if(c&&typeof se=="number"&&(F=c(se,h.getComponent()),F<0&&(F=~F,Q=!0)),r(F,b))return null;if(F===b&&!Q)return h}f&&typeof F=="number"&&f(F,h.getComponent()),C=h.nextSibling()}return null}return I.end=()=>{g&&h.ascend()},I}e.advancer=l;function u(h,c,f){let g,C,I,b;for(g=C=h&&h.descendFirst(),I=b=c&&c.descendFirst();g||I;){let F=g?h.getKey():null,se=I?c.getKey():null;F!==null&&se!==null&&(r(se,F)?se=null:F!==se&&(F=null)),f(F==null?se:F,F!=null?h:null,se!=null?c:null),F!=null&&g&&(g=h.nextSibling()),se!=null&&I&&(I=c.nextSibling())}C&&h.ascend(),b&&c.ascend()}e.eachChildOf=u}(Hi)),Hi}var ji={},Ou;function bu(){return Ou||(Ou=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={}))}(ji)),ji}var pn={},En={},wu;function Wi(){return wu||(wu=1,Object.defineProperty(En,"__esModule",{value:!0}),En.uniToStrPos=En.strPosToUni=void 0,En.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},En.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),En}var zi={},Au;function Yi(){return Au||(Au=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Wi(),n=M=>{if(!Array.isArray(M))throw Error("Op must be an array of components");let T=null;for(let W=0;W<M.length;W++){const q=M[W];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 T=="number")throw Error("Adjacent skip components should be combined");break}T=q}if(typeof T=="number")throw Error("Op has a trailing skip")};function r(M,T){let W=0,q=0;for(let ge=0;ge<M.length;ge++){const le=M[ge];switch(T(le,W,q),typeof le){case"object":W+=e.dlen(le.d);break;case"string":q+=t.strPosToUni(le);break;case"number":W+=le,q+=le;break}}}e.eachOp=r;function s(M,T){const W=[],q=a(W);return r(M,(ge,le,p)=>{q(T(ge,le,p))}),c(W)}const i=M=>M,o=M=>s(M,i);e.dlen=M=>typeof M=="number"?M:t.strPosToUni(M);const a=M=>T=>{if(!(!T||T.d===0||T.d===""))if(M.length===0)M.push(T);else if(typeof T==typeof M[M.length-1])if(typeof T=="object"){const W=M[M.length-1];W.d=typeof W.d=="string"&&typeof T.d=="string"?W.d+T.d:e.dlen(W.d)+e.dlen(T.d)}else M[M.length-1]+=T;else M.push(T)},l=M=>typeof M=="number"?M:typeof M=="string"?t.strPosToUni(M):typeof M.d=="number"?M.d:t.strPosToUni(M.d);e.uniSlice=(M,T,W)=>{const q=t.uniToStrPos(M,T),ge=W==null?1/0:t.uniToStrPos(M,W);return M.slice(q,ge)};const u=(M,T,W)=>typeof M=="number"?W==null?M-T:Math.min(M,W)-T:e.uniSlice(M,T,W),h=M=>{let T=0,W=0;return{take:(le,p)=>{if(T===M.length)return le===-1?null:le;const j=M[T];let S;if(typeof j=="number")return le===-1||j-W<=le?(S=j-W,++T,W=0,S):(W+=le,le);if(typeof j=="string"){if(le===-1||p==="i"||t.strPosToUni(j.slice(W))<=le)return S=j.slice(W),++T,W=0,S;{const D=W+t.uniToStrPos(j.slice(W),le);return S=j.slice(W,D),W=D,S}}else{if(le===-1||p==="d"||e.dlen(j.d)-W<=le)return S={d:u(j.d,W)},++T,W=0,S;{let D=u(j.d,W,W+le);return W+=le,{d:D}}}},peek:()=>M[T]}},c=M=>(M.length>0&&typeof M[M.length-1]=="number"&&M.pop(),M);function f(M,T,W){if(W!=="left"&&W!=="right")throw Error("side ("+W+") must be 'left' or 'right'");n(M),n(T);const q=[],ge=a(q),{take:le,peek:p}=h(M);for(let S=0;S<T.length;S++){const D=T[S];let w,O;switch(typeof D){case"number":for(w=D;w>0;)O=le(w,"i"),ge(O),typeof O!="string"&&(w-=l(O));break;case"string":W==="left"&&typeof p()=="string"&&ge(le(-1)),ge(t.strPosToUni(D));break;case"object":for(w=e.dlen(D.d);w>0;)switch(O=le(w,"i"),typeof O){case"number":w-=O;break;case"string":ge(O);break;case"object":w-=e.dlen(O.d)}break}}let j;for(;j=le(-1);)ge(j);return c(q)}function g(M,T){n(M),n(T);const W=[],q=a(W),{take:ge}=h(M);for(let p=0;p<T.length;p++){const j=T[p];let S,D;switch(typeof j){case"number":for(S=j;S>0;)D=ge(S,"d"),q(D),typeof D!="object"&&(S-=l(D));break;case"string":q(j);break;case"object":S=e.dlen(j.d);let w=0;for(;w<S;)switch(D=ge(S-w,"d"),typeof D){case"number":q({d:u(j.d,w,w+D)}),w+=D;break;case"string":w+=t.strPosToUni(D);break;case"object":q(D)}break}}let le;for(;le=ge(-1);)q(le);return c(W)}const C=(M,T)=>{let W=0;for(let q=0;q<T.length&&M>W;q++){const ge=T[q];switch(typeof ge){case"number":{W+=ge;break}case"string":const le=t.strPosToUni(ge);W+=le,M+=le;break;case"object":M-=Math.min(e.dlen(ge.d),M-W);break}}return M},I=(M,T)=>typeof M=="number"?C(M,T):M.map(W=>C(W,T));function b(M,T,W){return s(M,(q,ge)=>typeof q=="object"&&typeof q.d=="number"?{d:W.slice(T,ge,ge+q.d)}:q)}function F(M){return s(M,T=>{switch(typeof T){case"object":if(typeof T.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return T.d;case"string":return{d:T};case"number":return T}})}function se(M){return s(M,T=>typeof T=="object"&&typeof T.d=="string"?{d:t.strPosToUni(T.d)}:T)}function Q(M){let T=!0;return r(M,W=>{typeof W=="object"&&typeof W.d=="number"&&(T=!1)}),T}function fe(M){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:c,normalize:o,checkOp:n,create(T=""){if(typeof T!="string")throw Error("Initial data must be a string");return M.create(T)},apply(T,W){n(W);const q=M.builder(T);for(let ge=0;ge<W.length;ge++){const le=W[ge];switch(typeof le){case"number":q.skip(le);break;case"string":q.append(le);break;case"object":q.del(e.dlen(le.d));break}}return q.build()},transform:f,compose:g,transformPosition:C,transformSelection:I,isInvertible:Q,makeInvertible(T,W){return b(T,W,M)},stripInvertible:se,invert:F,invertWithDoc(T,W){return F(b(T,W,M))},isNoop:T=>T.length===0}}e.default=fe}(zi)),zi}var hs={},Tu;function Vp(){if(Tu)return hs;Tu=1,Object.defineProperty(hs,"__esModule",{value:!0});const e=Yi(),t=Wi();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 hs.default=n,n.provides={text:!0},hs}var Nu;function Gp(){return Nu||(Nu=1,function(e){var t=pn.__createBinding||(Object.create?function(f,g,C,I){I===void 0&&(I=C),Object.defineProperty(f,I,{enumerable:!0,get:function(){return g[C]}})}:function(f,g,C,I){I===void 0&&(I=C),f[I]=g[C]}),n=pn.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g}),r=pn.__importStar||function(f){if(f&&f.__esModule)return f;var g={};if(f!=null)for(var C in f)Object.hasOwnProperty.call(f,C)&&t(g,f,C);return n(g,f),g},s=pn.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Wi(),o=r(Yi()),a=s(Vp()),l={create(f){return f},toString(f){return f},builder(f){if(typeof f!="string")throw Error("Invalid document snapshot: "+f);const g=[];return{skip(C){let I=i.uniToStrPos(f,C);if(I>f.length)throw Error("The op is too long for this document");g.push(f.slice(0,I)),f=f.slice(I)},append(C){g.push(C)},del(C){f=f.slice(i.uniToStrPos(f,C))},build(){return g.join("")+f}}},slice:o.uniSlice},u=o.default(l),h=Object.assign(Object.assign({},u),{api:a.default});e.type=h,e.insert=(f,g)=>g.length===0?[]:f===0?[g]:[f,g],e.remove=(f,g)=>o.dlen(g)===0?[]:f===0?[{d:g}]:[f,{d:g}];var c=Yi();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return c.default}})}(pn)),pn}var Mu;function Kp(){return Mu||(Mu=1,function(e){var t=ls.__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(zp()),r=t(Yp()),s=Su(),i=bu();function o(y,x){if(!y)throw new Error(x)}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:F,checkValidOp:ge,normalize:le,apply:p,transformPosition:j,compose:S,tryTransform:V,transform:de,makeInvertible:O,invert:D,invertWithDoc:$,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(y,x,G)=>Ae(()=>!0,y,x,G),typeAllowingConflictsPred:y=>Object.assign(Object.assign({},e.type),{transform:(x,G,X)=>Ae(y,x,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,h=y=>y&&(y.p!=null||y.r!==void 0),c=y=>y&&(y.d!=null||y.i!==void 0);function f(y,x){return o(y!=null),typeof x=="number"?(o(Array.isArray(y),"Invalid key - child is not an array"),(y=y.slice()).splice(x,1)):(o(l(y),"Invalid key - child is not an object"),delete(y=Object.assign({},y))[x]),y}function g(y,x,G){return typeof x=="number"?(o(y!=null,"Container is missing for key"),o(Array.isArray(y),"Cannot use numerical key for object container"),o(y.length>=x,"Cannot insert into out of bounds index"),y.splice(x,0,G)):(o(l(y),"Cannot insert into missing item"),o(y[x]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),y[x]=G),G}e.removeOp=(y,x=!0)=>s.writeCursor().writeAtPath(y,"r",x).get(),e.moveOp=(y,x)=>s.writeCursor().writeMove(y,x).get(),e.insertOp=(y,x)=>s.writeCursor().writeAtPath(y,"i",x).get(),e.replaceOp=(y,x,G)=>s.writeCursor().at(y,X=>{X.write("r",x),X.write("i",G)}).get(),e.editOp=(y,x,G,X=!1)=>s.writeCursor().at(y,Y=>T(Y,x,G,X)).get();const C=(y,x)=>y!=null&&(typeof x=="number"?Array.isArray(y):typeof y=="object"),I=(y,x)=>C(y,x)?y[x]:void 0,b={};function F(y){let x=y.type?y.type:y;x.name&&(b[x.name]=x),x.uri&&(b[x.uri]=x)}const se=y=>{const x=b[y];if(x)return x;throw Error("Missing type: "+y)};F(Gp());const Q=(y,x)=>y+x;F({name:"number",apply:Q,compose:Q,invert:y=>-y,transform:y=>y});const fe=y=>y==null?null:y.et?se(y.et):y.es?b["text-unicode"]:y.ena!=null?b.number:null,M=y=>y.es?y.es:y.ena!=null?y.ena:y.e,T=(y,x,G,X=!1)=>{const[Y,z]=typeof x=="string"?[se(x),x]:[x,x.name];!X&&Y.isNoop&&Y.isNoop(G)||(z==="number"?y.write("ena",G):z==="text-unicode"?y.write("es",G):(y.write("et",z),y.write("e",G)))};function W(y){o(typeof y=="number"),o(y>=0),o(y===(0|y))}function q(y){typeof y=="number"?W(y):o(typeof y=="string")}function ge(y){if(y===null)return;const x=new Set,G=new Set,X=z=>{let ue=!0,ae=!1;for(let H in z){const te=z[H];if(ue=!1,o(H==="p"||H==="r"||H==="d"||H==="i"||H==="e"||H==="es"||H==="ena"||H==="et","Invalid component item '"+H+"'"),H==="p")W(te),o(!x.has(te)),x.add(te),o(z.r===void 0);else if(H==="d")W(te),o(!G.has(te)),G.add(te),o(z.i===void 0);else if(H==="e"||H==="es"||H==="ena"){o(!ae),ae=!0;const oe=fe(z);o(oe,"Missing type in edit"),oe.checkValidOp&&oe.checkValidOp(M(z))}}o(!ue)},Y=(z,ue,ae)=>{if(!Array.isArray(z))throw Error("Op must be null or a list");if(z.length===0)throw Error("Empty descent");ue||q(z[0]);let H=1,te=0,oe=0;for(let _e=0;_e<z.length;_e++){const we=z[_e];if(o(we!=null),Array.isArray(we)){const Ue=Y(we,!1);if(te){const K=typeof oe,ve=typeof Ue;K===ve?o(oe<Ue,"descent keys are not in order"):o(K==="number"&&ve==="string")}oe=Ue,te++,H=3}else typeof we=="object"?(o(H===1,`Prev not scalar - instead ${H}`),X(we),H=2):(o(H!==3),q(we),o(s.isValidPathItem(we),"Invalid path key"),H=1)}return o(te!==1,"Operation makes multiple descents. Remove some []"),o(H===2||H===3),z[0]};Y(y,!0),o(x.size===G.size,"Mismatched picks and drops in op");for(let z=0;z<x.size;z++)o(x.has(z)),o(G.has(z))}function le(y){let x=0,G=[];const X=s.writeCursor();return X.mergeTree(y,(Y,z)=>{const ue=fe(Y);if(ue){const H=M(Y);T(z,ue,ue.normalize?ue.normalize(H):H)}for(const H of["r","p","i","d"])if(Y[H]!==void 0){const te=H==="p"||H==="d"?(ae=Y[H],G[ae]==null&&(G[ae]=x++),G[ae]):Y[H];z.write(H,te)}var ae}),X.get()}function p(y,x){if(ge(x),x===null)return y;const G=[];return function X(Y,z){let ue=Y,ae=0,H={root:Y},te=0,oe=H,_e="root";function we(){for(;te<ae;te++){let Ue=z[te];typeof Ue!="object"&&(o(C(oe,_e)),oe=oe[_e]=u(oe[_e]),_e=Ue)}}for(;ae<z.length;ae++){const Ue=z[ae];if(Array.isArray(Ue)){const K=X(ue,Ue);K!==ue&&K!==void 0&&(we(),ue=oe[_e]=K)}else if(typeof Ue=="object"){Ue.d!=null?(we(),ue=g(oe,_e,G[Ue.d])):Ue.i!==void 0&&(we(),ue=g(oe,_e,Ue.i));const K=fe(Ue);if(K)we(),ue=oe[_e]=K.apply(ue,M(Ue));else if(Ue.e!==void 0)throw Error("Subtype "+Ue.et+" undefined")}else ue=I(ue,Ue)}return H.root}(y=function X(Y,z){const ue=[];let ae=0;for(;ae<z.length;ae++){const _e=z[ae];if(Array.isArray(_e))break;typeof _e!="object"&&(ue.push(Y),Y=I(Y,_e))}for(let _e=z.length-1;_e>=ae;_e--)Y=X(Y,z[_e]);for(--ae;ae>=0;ae--){const _e=z[ae];if(typeof _e!="object"){const we=ue.pop();Y=Y===I(we,_e)?we:Y===void 0?f(we,_e):(te=_e,oe=Y,(H=u(H=we))[te]=oe,H)}else h(_e)&&(o(Y!==void 0,"Cannot pick up or remove undefined"),_e.p!=null&&(G[_e.p]=Y),Y=void 0)}var H,te,oe;return Y}(y,x),x)}function j(y,x){y=y.slice(),ge(x);const G=s.readCursor(x);let X,Y,z=!1;const ue=[];for(let H=0;;H++){const te=y[H],oe=G.getComponent();if(oe&&(oe.r!==void 0?z=!0:oe.p!=null&&(z=!1,X=oe.p,Y=H)),H>=y.length)break;let _e=0;const we=s.advancer(G,void 0,(K,ve)=>{h(ve)&&_e++});ue.unshift(we);const Ue=we(te);if(typeof te=="number"&&(y[H]-=_e),!Ue)break}if(ue.forEach(H=>H.end()),z)return null;const ae=()=>{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],oe=a(G),_e=fe(oe);if(_e){const K=M(oe);_e.transformPosition&&(y[H]=_e.transformPosition(y[H],K));break}let we=0;const Ue=s.advancer(G,(K,ve)=>c(ve)?~(K-we):K-we,(K,ve)=>{c(ve)&&we++})(te);if(typeof te=="number"&&(y[H]+=we),!Ue)break}};return X!=null?G.eachDrop(null,H=>{H===X&&ae()}):ae(),y}function S(y,x){if(ge(y),ge(x),y==null)return x;if(x==null)return y;let G=0;const X=s.readCursor(y),Y=s.readCursor(x),z=s.writeCursor(),ue=[],ae=[],H=[],te=[],oe=[],_e=[],we=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 Ue=s.writeCursor();return function K(ve,Ke,je,Fe,qe,Ot,Xe,rt){o(Ke||je);const Qe=a(Ke),ft=a(je),ut=!!ft&&ft.r!==void 0,Qt=!!Qe&&Qe.i!==void 0,xe=Qe?Qe.d:null,gt=ft?ft.p:null,E=(Ot||ut)&&gt==null;if(gt!=null)Fe=te[gt],Xe=ae[gt]=new s.WriteCursor;else if(ft&&ft.r!==void 0)Fe=null;else{const L=a(Fe);L&&L.d!=null&&(Fe=null)}const m=a(Fe);if(xe!=null)if(ve=H[xe],rt=ue[xe]=new s.WriteCursor,E)Ot&&!ut&&rt.write("r",!0);else{const L=oe[xe]=G++;Xe.write("d",L)}else if(Qe&&Qe.i!==void 0)ve=null;else{const L=a(ve);L&&L.p!=null&&(ve=null)}let _;Qt?(o(qe===void 0),_=Qe.i):_=qe;const A=(gt==null?!Qt||Ot||ut:_===void 0)?null:Xe.getComponent();if(gt!=null){if(!(qe!==void 0||Qt)){const L=xe!=null?oe[xe]:G++;_e[gt]=L,rt.write("p",L)}}else ut&&(Qt||qe!==void 0||(ft.r,rt.write("r",ft.r)));const N=E?null:fe(Qe),P=fe(m);if((N||P)&&(N&&N.name,P&&P.name),N&&P){o(N===P);const L=M(Qe),ee=M(m),Ie=N.compose(L,ee);T(Xe,N,Ie),we.add(m)}else N?T(Xe,N,M(Qe)):P&&(T(Xe,P,M(m)),we.add(m));const U=typeof _=="object"&&_!=null;let k=!1,v=0,Z=0,Ee=0,J=0,pe=0;const be=s.advancer(Fe,(L,ee)=>c(ee)?J-L-1:L-J,(L,ee)=>{c(ee)&&J++}),ce=s.advancer(ve,(L,ee)=>h(ee)?v-L-1:L-v,(L,ee)=>{h(ee)&&v++});if(s.eachChildOf(Ke,je,(L,ee,Ie)=>{let Te,ke,$e=L,We=L,mt=L;if(typeof L=="number"){let De=L+Ee;ke=be(De),We=De+J;let ne=L+Z;Te=ce(ne),c(a(ke))&&(Te=null),$e=ne+v,mt=L+pe,o($e>=0,"p1PickKey is negative"),o(We>=0,"p2DropKey is negative");const dt=c(a(ee)),He=h(a(Ie));(dt||He&&!E)&&pe--,dt&&Z--,He&&Ee--}else Te=ce(L),ke=be(L);rt.descend($e),Xe.descend(We);const Et=U&&!c(a(ee))?_[mt]:void 0,Re=K(Te,ee,Ie,ke,Et,E,Xe,rt);var et,Se,ye;U&&!E?Et!==Re&&(k||(_=Array.isArray(_)?_.slice():Object.assign({},_),k=!0),et=_,ye=Re,typeof(Se=mt)=="number"?(o(Array.isArray(et)),o(Se<et.length)):(o(!Array.isArray(et)),o(et[Se]!==void 0)),ye===void 0?typeof Se=="number"?et.splice(Se,1):delete et[Se]:et[Se]=ye):o(Re===void 0),Xe.ascend(),rt.ascend()}),ce.end(),be.end(),A!=null)A.i=_;else if(!Ot&&!ut&&gt==null)return _}(X,X.clone(),Y,Y.clone(),void 0,!1,z,Ue),z.reset(),z.mergeTree(Ue.get()),z.reset(),z.get(),ue.map(K=>K.get()),ae.map(K=>K.get()),X.traverse(z,(K,ve)=>{const Ke=K.p;if(Ke!=null){const je=oe[Ke];je!=null&&ve.write("p",je);const Fe=ue[Ke];Fe&&Fe.get(),Fe&&ve.mergeTree(Fe.get())}else K.r!==void 0&&ve.write("r",K.r)}),z.reset(),z.get(),Y.traverse(z,(K,ve)=>{const Ke=K.d;if(Ke!=null){const Fe=_e[Ke];Fe!=null&&ve.write("d",Fe);const qe=ae[Ke];qe&&ve.mergeTree(qe.get())}else K.i!==void 0&&ve.write("i",K.i);const je=fe(K);je&&!we.has(K)&&T(ve,je,M(K))}),z.get()}function D(y){if(y==null)return null;const x=new s.ReadCursor(y),G=new s.WriteCursor;let X;const Y=[],z=[];return function ue(ae,H,te){const oe=ae.getComponent();let _e,we=!1;if(oe){oe.p!=null&&(H.write("d",oe.p),Y[oe.p]=ae.clone()),oe.r!==void 0&&H.write("i",oe.r),oe.d!=null&&(H.write("p",oe.d),te=void 0),oe.i!==void 0&&(te=_e=oe.i);const K=fe(oe);K&&(te===void 0?(X||(X=new Set),X.add(oe)):(M(oe),te=K.apply(te,M(oe)),we=!0))}let Ue=0;for(const K of ae){H.descend(K);const ve=typeof K=="number"?K-Ue:K,Ke=I(te,ve);c(ae.getComponent())&&Ue++;const je=ue(ae,H,Ke);if(te!==void 0&&je!==void 0){if(we||(we=!0,te=u(te)),!C(te,ve))throw Error("Cannot modify child - invalid operation");te[ve]=je}H.ascend()}if(_e===void 0)return we?te:void 0;H.write("r",te)}(x,G,void 0),X&&(G.reset(),function ue(ae,H,te){const oe=H.getComponent();if(oe){const K=oe.d;if(K!=null&&(ae=Y[K],te=z[K]=s.writeCursor()),X.has(oe)){const ve=fe(oe);if(!ve.invert)throw Error(`Cannot invert subtype ${ve.name}`);T(te,ve,ve.invert(M(oe)))}}let _e=0,we=0;const Ue=s.advancer(ae,(K,ve)=>h(ve)?_e-K-1:K-_e,(K,ve)=>{h(ve)&&_e++});for(const K of H)if(typeof K=="number"){const ve=K-we,Ke=Ue(ve),je=ve+_e;te.descend(je),ue(Ke,H,te),c(H.getComponent())&&we++,te.ascend()}else te.descend(K),ue(Ue(K),H,te),te.ascend();Ue.end()}(x.clone(),x,G),z.length&&(G.reset(),x.traverse(G,(ue,ae)=>{const H=ue.p;if(H!=null){const te=z[H];te&&te.get(),te&&ae.mergeTree(te.get())}}))),G.get()}const w=(y,x)=>y.some(G=>typeof G=="object"&&(Array.isArray(G)?w(G,x):x(G)));function O(y,x){if(y==null||!w(y,H=>{var te;return H.r!==void 0||((te=fe(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 z=[],ue=[],ae=(H,te,oe)=>{const _e=H.getComponent();let we=!1;if(_e){_e.d!=null&&te.write("d",_e.d),_e.i!==void 0&&te.write("i",_e.i);const K=_e.p;if(K!=null&&(z[K]=H.clone(),o(oe!==void 0,"Operation picks up at an invalid key"),ue[K]=oe,te.write("p",_e.p)),_e.r!==void 0&&oe===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const ve=fe(_e);ve&&(ve.makeInvertible?Y=!0:T(te,ve,M(_e),!0))}let Ue=0;for(const K of H){te.descend(K);const ve=typeof K=="number"?K-Ue:K,Ke=I(oe,ve),je=ae(H,te,Ke);Ke!==je&&(we||(we=!0,oe=u(oe)),je===void 0?(oe=f(oe,ve),typeof K=="number"&&Ue++):oe[ve]=je),te.ascend()}return _e&&(_e.r!==void 0?(te.write("r",r.default(oe)),oe=void 0):_e.p!=null&&(oe=void 0)),oe};return ae(G,X,x),X.get(),Y&&(X.reset(),function H(te,oe,_e,we,Ue){const K=oe.getComponent();if(K){K.i!==void 0?(we=K.i,Ue=!0):K.d!=null&&(we=ue[K.d],te=z[K.d],Ue=!1,K.d);let Fe=fe(K);if(Fe&&Fe.makeInvertible){const qe=M(K);T(_e,Fe,Fe.makeInvertible(qe,we),!0)}}let ve=0,Ke=0;const je=s.advancer(te,(Fe,qe)=>h(qe)?ve-Fe-1:Fe-ve,(Fe,qe)=>{h(qe)&&ve++});for(const Fe of oe)if(typeof Fe=="number"){const qe=Fe-Ke,Ot=je(qe),Xe=qe+ve,rt=I(we,Ue?qe:Xe);_e.descend(Fe),H(Ot,oe,_e,rt,Ue),c(oe.getComponent())&&Ke++,_e.ascend()}else{const qe=I(we,Fe);_e.descend(Fe),H(je(Fe),oe,_e,qe,Ue),_e.ascend()}je.end()}(G.clone(),G,X,x,!1)),X.get()}function $(y,x){return D(O(y,x))}const B=y=>{if(y==null)return null;const x=y.slice();for(let G=0;G<y.length;G++){const X=x[G];Array.isArray(X)&&(x[G]=B(X))}return x};function V(y,x,G){o(G==="left"||G==="right","Direction must be left or right");const X=G==="left"?0:1;if(x==null)return{ok:!0,result:y};ge(y),ge(x);let Y=null;const z=[],ue=[],ae=[],H=[],te=[],oe=[],_e=[],we=[],Ue=[],K=[],ve=[],Ke=[],je=[],Fe=[],qe=[];let Ot=0;const Xe=s.readCursor(y),rt=s.readCursor(x),Qe=s.writeCursor();if(function m(_,A=null,N){const P=a(A);P&&(P.r!==void 0?N=A.clone():P.p!=null&&(N=null,oe[P.p]=_.clone()));const U=_.getComponent();let k;U&&(k=U.p)!=null&&(te[k]=A?A.clone():null,ae[k]=_.clone(),N&&(K[k]=!0,Ue[k]=N),P&&P.p!=null&&(Fe[k]=P.p));const v=s.advancer(A);for(const Z of _)m(_,v(Z),N);v.end()}(rt,Xe,null),function m(_,A,N,P,U){const k=N.getComponent();let v,Z=!1;k&&((v=k.d)!=null?(H[v]=N.clone(),P!=null&&(qe[P]==null&&(qe[P]=[]),qe[P].push(v)),K[v],_=te[v]||null,A=ae[v]||null,K[v]?(U&&(ve[v]=!0),U=Ue[v]||null):!U||X!==1&&Fe[v]!=null||Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(U.getPath()),op2:e.moveOp(A.getPath(),N.getPath())}),Z=!0):k.i!==void 0&&(_=A=null,Z=!0,U&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(U.getPath()),op2:e.insertOp(N.getPath(),k.i)})));const Ee=a(_);Ee&&(Ee.r!==void 0?U=_.clone():Ee.p!=null&&(Ee.p,P=Ee.p,U=null));const J=fe(k);J&&U&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(U.getPath()),op2:e.editOp(N.getPath(),J,M(k),!0)});let pe=0,be=0;const ce=s.advancer(A,(ee,Ie)=>h(Ie)?pe-ee-1:ee-pe,(ee,Ie)=>{h(Ie)&&pe++}),L=s.advancer(_);for(const ee of N)if(typeof ee=="number"){const Ie=ee-be,Te=ce(Ie);be+=+m(L(Ie+pe),Te,N,P,U)}else{const Ie=ce(ee);m(L(ee),Ie,N,P,U)}return ce.end(),L.end(),Z}(Xe,rt,rt.clone(),null,null),H.map(m=>m&&m.get()),Y)return{ok:!1,conflict:Y};ve.map(m=>!!m);const ft=[];let ut=null;(function m(_,A,N,P,U){let k=!1;const v=a(A);if(h(v)){const ce=v.p;ce!=null?(N=H[ce],P=Ke[ce]=s.writeCursor(),k=!0,U=null):(N=null,U=A.clone())}else c(a(N))&&(N=null);const Z=_.getComponent();if(Z){const ce=Z.p;ce!=null?(U&&(we[ce]=U),ft[ce]=U||X===1&&k?null:P.getComponent(),z[ce]=_.clone(),N&&(_e[ce]=N.clone())):Z.r!==void 0&&(U||P.write("r",!0),(U||k)&&(ut==null&&(ut=new Set),ut.add(Z)))}let Ee=0,J=0;const pe=s.advancer(A,void 0,(ce,L)=>{h(L)&&Ee++}),be=s.advancer(N,(ce,L)=>c(L)?~(ce-J):ce-J,(ce,L)=>{c(L)&&J++});if(_)for(const ce of _)if(typeof ce=="string"){const L=pe(ce),ee=be(ce);P.descend(ce),m(_,L,ee,P,U),P.ascend()}else{const L=pe(ce),ee=ce-Ee,Ie=h(a(L))?null:be(ee),Te=ee+J;o(Te>=0),P.descend(Te),m(_,L,Ie,P,U),P.ascend()}pe.end(),be.end()})(Xe,rt,rt.clone(),Qe,null),Qe.reset();let Qt=[];if(function m(_,A,N,P,U,k){o(A);const v=A.getComponent();let Z=a(P),Ee=!1;const J=(Se,ye,De)=>Se?e.moveOp(Se.getPath(),ye.getPath()):e.insertOp(ye.getPath(),De.i);if(c(v)){const Se=v.d;Se!=null&&(ue[Se]=A.clone());const ye=Se!=null?ft[Se]:null;let De=!1;if(v.i!==void 0||Se!=null&&ye){let ne;Z&&(Z.i!==void 0||(ne=Z.d)!=null&&!K[ne])&&(De=ne!=null?Se!=null&&Se===Fe[ne]:n.default(Z.i,v.i),De||ne!=null&&X!==1&&Fe[ne]!=null||Y==null&&(Y={type:i.ConflictType.DROP_COLLISION,op1:J(Se!=null?z[Se]:null,A,v),op2:J(ne!=null?ae[ne]:null,P,Z)})),De||(k?Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:J(Se!=null?z[Se]:null,A,v),op2:e.removeOp(k.getPath())}):(Se!=null?(Qt[Ot]=Se,U.write("d",ye.p=Ot++)):U.write("i",r.default(v.i)),Ee=!0))}else if(Se!=null&&!ye){const ne=we[Se];ne&&(k=ne.clone())}Se!=null?(_=z[Se],N=oe[Se],P=_e[Se]):v.i!==void 0&&(_=N=null,De||(P=null))}else h(a(_))&&(_=N=P=null);const pe=a(_),be=a(N);if(h(be)){const Se=be.p;be.r!==void 0&&(!pe||pe.r===void 0)||K[Se]?(P=null,k=N.clone()):Se!=null&&(P=H[Se],X!==1&&Fe[Se]!=null||((U=je[Se])||(U=je[Se]=s.writeCursor()),U.reset(),k=null))}else!c(v)&&c(Z)&&(P=null);Z=P!=null?P.getComponent():null;const ce=fe(v);if(ce){const Se=M(v);if(k)Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(A.getPath(),ce,Se,!0),op2:e.removeOp(k.getPath())});else{const ye=fe(Z);let De;if(ye){if(ce!==ye)throw Error("Transforming incompatible types");const ne=M(Z);De=ce.transform(Se,ne,G)}else De=r.default(Se);T(U,ce,De)}}let L=0,ee=0,Ie=0,Te=0,ke=0,$e=0,We=_!=null&&_.descendFirst(),mt=We;const Et=s.advancer(N,void 0,(Se,ye)=>{h(ye)&&Ie++});let Re=P!=null&&P.descendFirst(),et=Re;for(const Se of A)if(typeof Se=="number"){let ye;const De=c(A.getComponent()),ne=Se-ee;{let un;for(;We&&typeof(un=_.getKey())=="number";){un+=L;const Nt=_.getComponent(),Xn=h(Nt);if(un>ne||un===ne&&(!Xn||X===0&&De))break;if(Xn){L--;const In=Nt.p;Fe.includes(In),Nt.d,a(je[Nt.d]),h(a(je[Nt.d])),(Nt.r===void 0||ut&&ut.has(Nt))&&(In==null||!ft[In]||X!==1&&Fe.includes(In))||ke--}We=_.nextSibling()}ye=We&&un===ne?_:null}const dt=ne-L;let He=Et(dt);const $t=dt-Ie;let As=null;{let un,Nt;for(;Re&&typeof(un=P.getKey())=="number";){Nt=un-Te;const Xn=P.getComponent(),In=c(Xn);if(Nt>$t)break;if(Nt===$t){if(!In){As=P;break}{if(X===0&&De){As=P;break}const cn=He&&h(He.getComponent());if(X===0&&cn)break}}if(In){const cn=Xn.d;K[cn],Fe[cn],Xn.i===void 0&&(K[cn]||Fe[cn]!=null&&X!==1)?(K[cn]||Fe[cn]!=null&&X===0)&&(Te++,$e--):Te++}Re=P.nextSibling()}}const lh=$t+Te+ke+$e;o(lh>=0,"trying to descend to a negative index"),U.descend(lh),De&&(ye=He=As=null,ee++),m(ye,A,He,As,U,k)&&$e++,U.ascend()}else{let ye;for(;We&&(ye=_.getKey(),typeof ye!="string"||!(ye>Se||ye===Se));)We=_.nextSibling();const De=We&&ye===Se?_:null,ne=Et(Se);let dt;for(;Re&&(dt=P.getKey(),typeof dt!="string"||!(dt>Se||dt===Se));)Re=P.nextSibling();const He=Re&&dt===Se?P:null;U.descend(Se),m(De,A,ne,He,U,k),U.ascend()}return Et.end(),mt&&_.ascend(),et&&P.ascend(),Ee}(Xe,Xe.clone(),rt,rt.clone(),Qe,null),Y)return{ok:!1,conflict:Y};Qe.reset();const xe=(m,_,A)=>m.traverse(_,(N,P)=>{N.d!=null&&A(N.d,m,P)});(K.length||Ke.length)&&(xe(rt,Qe,(m,_,A)=>{K[m]&&!ve[m]&&A.write("r",!0),Ke[m]&&A.mergeTree(Ke[m].get())}),Qe.reset());const gt=[],E=[];if((je.length||K.length)&&!Y){const m=s.readCursor(B(Qe.get()));if(xe(m,null,(_,A)=>{gt[_]=A.clone()}),je.forEach(_=>{_&&xe(s.readCursor(_.get()),null,(A,N)=>{gt[A]=N.clone()})}),function _(A,N,P,U,k,v){const Z=a(N);if(Z&&h(Z))if(Z.p!=null){const L=Z.p;gt[L].getPath(),P=gt[L],U=E[L]=s.writeCursor()}else Z.r!==void 0&&(P=null);else c(a(P))&&(P=null);const Ee=A.getComponent();if(Ee){let L;if((L=Ee.d)!=null){const ee=je[L];ee&&(ee.get(),U.mergeTree(ee.get()),P=s.readCursor(ee.get()))}}let J=0,pe=0;const be=s.advancer(N,void 0,(L,ee)=>{h(ee)&&J--}),ce=s.advancer(P,(L,ee)=>c(ee)?-(L-pe)-1:L-pe,(L,ee)=>{c(ee)&&pe++});for(const L of A)if(typeof L=="number"){const ee=be(L),Ie=L+J,Te=ce(Ie),ke=Ie+pe;U.descend(ke),_(A,ee,Te,U),U.ascend()}else U.descend(L),_(A,be(L),ce(L),U),U.ascend();be.end(),ce.end()}(rt,m,m.clone(),Qe),Qe.reset(),Y)return{ok:!1,conflict:Y};if(Qe.get(),E.length){const _=E.map(N=>N?N.get():null),A=s.readCursor(B(Qe.get()));if(xe(A,Qe,(N,P,U)=>{const k=_[N];k&&(U.mergeTree(k),_[N]=null)}),_.find(N=>N)){const N=s.writeCursor(),P=s.writeCursor();let U=0,k=0;_.forEach(v=>{v!=null&&xe(s.readCursor(v),null,Z=>{const Ee=Qt[Z];N.writeMove(z[Ee].getPath(),ue[Ee].getPath(),U++);const J=qe[Ee];J&&J.forEach(pe=>{K[pe]||X!==1&&Fe[pe]!=null||P.writeMove(ae[pe].getPath(),H[pe].getPath(),k++)})})}),Y={type:i.ConflictType.BLACKHOLE,op1:N.get(),op2:P.get()}}}}return Y?{ok:!1,conflict:Y}:{ok:!0,result:Qe.get()}}const ie=y=>{const x=new Error("Transform detected write conflict");throw x.conflict=y,x.type=x.name="writeConflict",x};function de(y,x,G){const X=V(y,x,G);if(X.ok)return X.result;ie(X.conflict)}const me=y=>{const x=s.writeCursor();return s.readCursor(y).traverse(x,(G,X)=>{(c(G)||fe(G))&&X.write("r",!0)}),x.get()},Me=(y,x)=>{const{type:G,op1:X,op2:Y}=y;switch(G){case i.ConflictType.DROP_COLLISION:return x==="left"?[null,me(Y)]:[me(X),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let z=!1;return s.readCursor(X).traverse(null,ue=>{ue.r!==void 0&&(z=!0)}),z?[null,me(Y)]:[me(X),null];case i.ConflictType.BLACKHOLE:return[me(X),me(Y)];default:throw Error("Unrecognised conflict: "+G)}};function Ae(y,x,G,X){let Y=null;for(;;){const z=V(x,G,X);if(z.ok)return S(Y,z.result);{const{conflict:ue}=z;y(ue)||ie(ue);const[ae,H]=Me(ue,X);x=S(le(x),ae),G=S(le(G),H),Y=S(Y,H)}}}}(ls)),ls}var Du;function Xp(){return Du||(Du=1,function(e){var t=dr.__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=dr.__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(Kp(),e);var r=Su();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=bu();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(dr)),dr}var pt=Xp();const Qp=ch({__proto__:null,default:yt(pt)},[pt]);var he=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(he||{});function fr(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();Rl(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 Lu(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:f,ed:g}=c;if(g<=r)i.push(c);else if(r>f&&r<g){a=!0;const C={...c,ed:r};i.push(C),l.length&&i.push(...l);const I={...c,st:r+n,ed:g+n};i.push(I)}else c.st+=n,c.ed+=n,a||(a=!0,i.push(...l)),i.push(c)}a||(a=!0,i.push(...l)),e.textRuns=fr(i)}function Uu(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(cr("startIndex"))}}function Pu(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(cr("startIndex"))}}function Fu(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(cr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function ku(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(cr("startIndex"))}}const $u="$",xu=e=>e.split($u)[0];function Vi(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=xu(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=xu(i.rangeId),i.rangeId===n.rangeId&&Ba(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}${$u}${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 Bu(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 Ki(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 Jp(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=Vi(s)}function qp(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;Ki(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=Bu(s)}function Hu(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:f}=h;if(s<=c&&i>=f){o.push({...h,st:c-s,ed:f-s});continue}else c<=s&&f>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=c&&s<f?(o.push({...h,st:s-s,ed:f-s}),h.ed=s):i>c&&i<=f?(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 ju(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 Wu(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 zu(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 Yu(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:f}=h;if(s<=c&&i>=f){o.push({...h,startIndex:c-n,endIndex:f-n});continue}else if(c<=s&&f>=i){const g=rs(c,f,s,i);if(g.length===0||(h.startIndex=g[0],h.endIndex=g[1],h.startIndex===h.endIndex))continue}else i<c&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.tables=a}return o}function Zp(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:f}=h;if(c>=s&&f<=i){o.push(h);continue}else if(Math.max(s,c)<=Math.min(i,f)){const g=rs(c,f,s,i);if(g.length===0)continue;h.startIndex=g[0],h.endIndex=g[1]}else i<c&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=Vi(a)}return o}function eE(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:f,endIndex:g}=c;if(f>=i&&g<=o){a.push(c);continue}else if(Math.max(i,f)<=Math.min(o,g)){const C=rs(f,g,i,o);if(C.length===0)continue;c.startIndex=C[0],c.endIndex=C[1]}else o<f&&r&&(c.startIndex-=t,c.endIndex-=t);l.push(c)}e.customDecorations=l}return a}var Vu=(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))(Vu||{}),Ft=(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))(Ft||{});const ds={"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}},Ln=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:hr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Un=e=>e.map((t,n)=>({...t,bulletAlignment:hr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Gu=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:hr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),gr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Ln(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Ln(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Ln(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Ln(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Ln(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Ln(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:Un([{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:Un([{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:Un(["%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:Un([{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:Un([{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:Un([{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:Gu("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Gu("☑",{st:{s:Oe.TRUE}})}},fs=e=>{const{glyphFormat:t,glyphType:n}=e,r=re.deepClone(gr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},tE={ORDER_LIST_QUICK_2:fs(ds["a)"]),ORDER_LIST_QUICK_3:fs(ds["a."]),ORDER_LIST_QUICK_4:fs(ds["i."]),ORDER_LIST_QUICK_6:fs(ds["I."])};Object.assign(gr,tE);const nE={"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 rE(e,t,n,r,s){const i=sE(e,t,n,r,s),o=iE(e,t,n,r,s),a=oE(e,t,n,r,s),l=aE(e,t,n,r,s),u=lE(e,t,n,r,s),h=uE(e,t,n,r),c=cE(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:u,customRanges:h,customDecorations:c}}function sE(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=Hu(e,n,r);if(s!==Pe.REPLACE){const l=Ku(o,a,s);t.textRuns=l}return Lu(e,t,n,r),a}function Ku(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:g,ed:C,ts:I}=e[o],{st:b,ed:F,ts:se,sId:Q}=t[a];let fe;if(n===Pe.COVER?fe={...se,...I}:fe={...I},C<b)u()||r.push(e[o]),o++;else if(F<g)u()||r.push(t[a]),a++;else{const M={st:Math.min(g,b),ed:Math.max(g,b),ts:g<b?{...I}:{...se},sId:g<b?void 0:Q};M.ed>M.st&&r.push(M),r.push({st:Math.max(g,b),ed:Math.min(C,F),ts:fe,sId:Q}),C<F?(o++,t[a].st=C,t[a].st===t[a].ed&&a++):(a++,e[o].st=F,e[o].st===e[o].ed&&o++);const T={st:Math.min(C,F),ed:Math.max(C,F),ts:C<F?{...se}:{...I},sId:C<F?Q:void 0};l=T.ed>T.st?T:null}}u();const h=r[r.length-1],c=e[s-1],f=t[i-1];return h&&h.ed!==Math.max(c.ed,f.ed)&&(c.ed>f.ed?r.push(c):r.push(f)),fr(r)}function iE(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=ju(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h,paragraphStyle:c,bullet:f}=u;let g=[];for(const C of a){const{startIndex:I,paragraphStyle:b,bullet:F}=C;let se,Q;if(s===Pe.COVER?(se={...b,...c},Q={listId:"",listType:Ft.BULLET_LIST,nestingLevel:0,textStyle:{},...F,...f}):(se={...c,...b},Q={listId:"",listType:Ft.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...F}),h===I){g.push({startIndex:h,paragraphStyle:se,bullet:Q});break}}l.push(...g),g=[]}t.paragraphs=l}return Uu(e,t,n,r),a}function oE(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=Wu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h}=u;let c=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===Pe.COVER?c.push({...f,...u}):c.push({...u,...f});break}}l.push(...c),c=[]}t.sectionBreaks=l}return Pu(e,t,n,r),a}function aE(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=zu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h}=u;let c=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===Pe.COVER?c.push({...f,...u}):c.push({...u,...f});break}}l.push(...c),c=[]}t.customBlocks=l}return Fu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function lE(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Yu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const u of o){const{startIndex:h,endIndex:c}=u;let f=[];for(const g of a){const{startIndex:C,endIndex:I}=g;if(C>=h&&I<=c){s===Pe.COVER?f.push({...g,...u}):f.push({...u,...g});break}}l.push(...f),f=[]}t.tables=l}return ku(e,t,n,r),a}function uE(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(c=>{const{startIndex:f,endIndex:g}=c;f>=i&&g<=o?u.set(c.rangeId,c):l.push(c)});const h=[];return a?(a.forEach(c=>{const{startIndex:f,endIndex:g}=c;l.push({...c,startIndex:f+r,endIndex:g+r})}),e.customRanges=Vi(l),h):[]}function cE(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),Ki(e.customDecorations,r),Ki(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===_n.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=Bu(o),i}var Xi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Xi||{});function gs(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 fr(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 Xu(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 Qu(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 hE(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 Ju(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=gs(e,t,n,r);const a=Xu(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=Qu(e,t,n),s===1){const u=Zu(e,t,n);u?o.customDecorations=u:r&&(o.customDecorations=[])}const{customRanges:l}=qu(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=Ju(e,t,n),o}function dE(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 qu(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 Zu(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 fE(e,t,n){return e==null||t==null?e!=null?e:t:Ku(e,t,n)}function gE(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 mE(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 Qi(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=fE(l,s,n),r.customRanges=gE(h,o,n);const f=mE(c,a,n);f.length&&(r.customDecorations=f);const g=[];let C=0,I=0;for(;C<i.length&&I<u.length;){const b=i[C],F=u[I],{startIndex:se}=b,{startIndex:Q}=F;se===Q?(g.push(re.deepMerge(b,F)),C++,I++):se<Q?(g.push(re.deepClone(b)),C++):(g.push(re.deepClone(F)),I++)}return C<i.length&&g.push(...i.slice(C)),I<u.length&&g.push(...u.slice(I)),g.length&&(r.paragraphs=g),r}function _E(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 Pn{constructor(t){R(this,"_index",0);R(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===he.DELETE||n.t===he.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:he.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:he.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 Fn{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function ec(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=Hu(e,t,n),a=ju(e,t,n),l=Wu(e,t,n),u=zu(e,t,n),h=Yu(e,t,n),c=Zp(e,t,n),f=eE(e,t,n);let g="";return r&&(e.dataStream=Dl(r,s,i),g=r.slice(s,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:u,tables:h,customRanges:c,customDecorations:f}}function tc(e,t,n,r){e.dataStream=Ml(e.dataStream,r,t.dataStream),Lu(e,t,n,r),Uu(e,t,n,r),Pu(e,t,n,r),Fu(e,t,n,r),ku(e,t,n,r),Jp(e,t,n,r),qp(e,t,n,r)}function pE(e,t,n,r,s=Pe.COVER){return rE(e,t,n,r,s)}function EE(e,t,n){return t<=0?{dataStream:""}:ec(e,t,n)}function CE(e,t,n,r){n!==0&&tc(e,t,n,r)}function RE(e,t){const n=new Fn;return n.reset(),t.forEach(r=>{const s=re.deepClone(r);switch(s.t){case he.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&pE(e,o,a,n.cursor,i),n.moveCursor(a);break}case he.INSERT:{const{body:i,len:o}=s;CE(e,i,o,n.cursor),n.moveCursor(o);break}case he.DELETE:{const{len:i}=s;EE(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=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:I,ed:b,ts:F}=t[l],{st:se,ed:Q,ts:fe,sId:M}=e[u];let T={};if(s===0)T={...F},n===Pe.COVER&&r===Pe.REPLACE&&fe&&(T=Object.assign({},fe,T));else if(T={...F},n===Pe.REPLACE){if(r===Pe.REPLACE)T={...fe};else if(F&&fe){const W=Object.keys(F);for(const q of W)fe[q]&&delete T[q]}}else if(r===Pe.REPLACE){if(fe){const W=Object.keys(fe);for(const q of W)fe[q]!==void 0&&(T[q]=fe[q])}}else if(fe){const W=Object.keys(fe);for(const q of W)T[q]!==void 0&&delete T[q]}if(b<se)c()||i.push(t[l]),l++;else if(Q<I)c()||i.push(e[u]),u++;else{const W={st:Math.min(I,se),ed:Math.max(I,se),ts:I<se?{...F}:{...fe},sId:I<se?void 0:M};W.ed>W.st&&i.push(),i.push({st:Math.max(I,se),ed:Math.min(b,Q),ts:T,sId:M}),b<Q?(l++,e[u].st=b,e[u].st===e[u].ed&&u++):(u++,t[l].st=Q,t[l].st===t[l].ed&&l++);const q={st:Math.min(b,Q),ed:Math.max(b,Q),ts:b<Q?{...fe}:{...F},sId:b<Q?M:void 0};h=q.ed>q.st?q:null}}c();const f=i[i.length-1],g=t[o-1],C=e[a-1];return f.ed!==Math.max(g.ed,C.ed)&&(g.ed>C.ed?i.push(g):i.push(C)),fr(i,!0)}function vE(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 nc(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 yE(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===_n.DELETED||i===_n.DELETED)&&(o=!0,n.push({...r,type:_n.DELETED}));break}o||n.push(r)}return n}function SE(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:f}=r,{textRuns:g,paragraphs:C=[],customRanges:I,customDecorations:b}=i,F=IE(u,g,s,o,n?1:0);F&&(a.textRuns=F);const se=vE(c,I,s,o,n?1:0);se&&(a.customRanges=se);const Q=yE(f,b);Q&&(a.customDecorations=Q);const fe=[];let M=0,T=0;for(;M<h.length&&T<C.length;){const W=h[M],q=C[T],{startIndex:ge}=W,{startIndex:le}=q;if(ge===le){let p={startIndex:ge};n?p=nc(W,q,s,o,1):p=nc(W,q,s,o,0),fe.push(p),M++,T++}else ge<le?M++:(fe.push(re.deepClone(q)),T++)}return T<C.length&&fe.push(...C.slice(T)),fe.length&&(a.paragraphs=fe),{coverType:l,body:a}}function rc(e){return Object.keys(e).length===1}const Yn=class Yn{constructor(){R(this,"_actions",[])}static apply(t,n){return RE(t,n)}static compose(t,n){const r=new Pn(t),s=new Pn(n),i=new Yn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===he.INSERT)i.push(s.next());else if(r.peekType()===he.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===he.INSERT&&l.t===he.RETAIN)l.body==null?i.push(a):i.push({...a,body:Qi(a.body,l.body,l.coverType)});else if(a.t===he.RETAIN&&l.t===he.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:he.RETAIN,coverType:u,body:Qi(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===he.RETAIN&&l.t===he.DELETE?i.push(l):a.t===he.INSERT&&(l.t,he.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 Pn(t),i=new Pn(n),o=new Yn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===he.INSERT&&(r==="left"||i.peekType()!==he.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===he.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===he.DELETE)continue;if(u.t===he.DELETE){o.push(u);continue}if(l.body==null||u.body==null)o.push(u);else{const{coverType:h,body:c}=SE(l,u,r==="left");o.push({...u,t:he.RETAIN,coverType:h,body:c})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new Pn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===he.DELETE){n-=Math.min(o,n-i);continue}else a===he.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===he.INSERT)n.push({t:he.DELETE,len:r.len,body:r.body});else if(r.t===he.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:he.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:he.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===he.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===he.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!==he.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:he.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:he.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:he.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===he.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===he.DELETE&&s.t===he.DELETE)return r.len+=s.len,this;if(r.t===he.DELETE&&s.t===he.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===he.RETAIN&&s.t===he.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===he.INSERT&&rc(r.body)&&s.t===he.INSERT&&rc(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===he.RETAIN&&_E(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};R(Yn,"id","text-x"),R(Yn,"uri","https://github.com/dream-num/univer#text-x");let ze=Yn;Object.defineProperty(ze,"name",{value:"text-x"});const Vn=class Vn{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),pt.type.registerSubtype(t))}static apply(t,n){if(!pt.type.isNoop(n))return pt.type.apply(t,n)}static compose(t,n){return pt.type.compose(t,n)}static transform(t,n,r){return pt.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 pt.type.invertWithDoc(t,n)}static isNoop(t){return pt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Vn),this._instance}removeOp(t,n){return pt.removeOp(t,n)}moveOp(t,n){return pt.moveOp(t,n)}insertOp(t,n){return pt.insertOp(t,n)}replaceOp(t,n,r){return pt.replaceOp(t,n,r)}editOp(t,n=["body"]){return pt.editOp(n,ze.name,t)}};R(Vn,"uri","https://github.com/dream-num/univer#json-x"),R(Vn,"_subTypes",new Map),R(Vn,"_instance",null);let Yt=Vn;Yt.registerSubtype(ze);const Ji={id:"default_doc",documentStyle:{}};class OE extends as{constructor(n){var r;super();R(this,"type",Be.UNIVER_DOC);R(this,"_name$",new Ce.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...Ji,...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{...gr,...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 kt extends OE{constructor(n){var s,i;super(re.isEmptyObject(n)?Wp():n);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);R(this,"change$",new Ce.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={...Ji,...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(!Yt.isNoop(n))return this.snapshot=Yt.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=Xi.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 kt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new kt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}function bE(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:he.RETAIN,len:l-i}),s.push({t:he.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:u-l-1}]},len:u-l}),i=u}return s}function wE(e){var h,c,f;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(f=(c=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:c.customDecorations)==null?void 0:f.find(g=>g.id===t);if(!i)return!1;const o=new ze,{startIndex:a,endIndex:l}=i,u=l-a+1;return o.push({t:he.RETAIN,len:a}),o.push({t:he.RETAIN,len:u,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:u-1,id:t,type:_n.DELETED}]}}),o}function sc(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function AE(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):sc(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function TE(e){return{...re.deepClone(e),rangeId:jt()}}function NE(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 ic(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 ME(e,t){var i,o,a,l,u;const n=ic(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 DE(e){var c,f,g;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(f=(c=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:c.customRanges)==null?void 0:f.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:he.RETAIN,len:o}),l.push({t:he.RETAIN,len:u,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:he.INSERT,body:s,len:s.dataStream.length});const h=a+1+((g=s==null?void 0:s.dataStream.length)!=null?g:0);return l.selections=[{startOffset:h,endOffset:h,collapsed:!0}],l}function LE(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 Q,fe,M;const c=ME(h,o);if(!c||!o)return!1;const{startOffset:f,endOffset:g}=c,C=(Q=o.customRanges)!=null?Q:[],I=(T,W,q)=>{var S,D,w,O;const ge=ic(T,W,C,r),le=Math.min((D=(S=ge[0])==null?void 0:S.startIndex)!=null?D:1/0,T),p=Math.max((O=(w=ge[ge.length-1])==null?void 0:w.endIndex)!=null?O:-1/0,W),j={rangeId:q?`${n}$${q}`:n,rangeType:r,startIndex:0,endIndex:p-le,wholeEntity:s,properties:{...i}};l.push({t:he.RETAIN,len:le-a}),l.push({t:he.RETAIN,len:p-le+1,body:{dataStream:"",customRanges:[j]},coverType:Pe.COVER}),a=p+1},b=((fe=o.paragraphs)!=null?fe:[]).filter(T=>T.startIndex<g&&T.startIndex>f),F=((M=o.customBlocks)!=null?M:[]).filter(T=>T.startIndex<g&&T.startIndex>f);NE([f,g-1],[...b.map(T=>T.startIndex),...F.map(T=>T.startIndex)]).forEach(([T,W],q)=>I(T,W,q)),u=!0,l.selections=[{startOffset:c.endOffset,endOffset:c.endOffset,collapsed:!0}]}),u?l:!1}function oc(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:he.RETAIN,len:h-l}),l=h),l<c&&(i.push({t:he.DELETE,len:c-l}),l=c)}),r&&i.push({t:he.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:he.RETAIN,len:u.startIndex-l}),l=u.startIndex),i.push({t:he.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...u,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}function UE(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:he.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:he.RETAIN,len:a-s,body:{...re.deepClone(t),dataStream:""}}),s=a)}),r}const PE=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=zs(o?o.dataStream:"",n.dataStream);let l=0;const u=a.map(([f,g])=>{switch(f){case 0:{const C={t:he.RETAIN,body:{...Tt(n,l,l+g.length,!1),dataStream:""},len:g.length};return l+=g.length,C}case 1:{const C={t:he.INSERT,body:Tt(n,l,l+g.length),len:g.length};return l+=g.length,C}default:return{t:he.DELETE,len:g.length}}}),h=new ze;return h.push({t:he.RETAIN,len:t.startOffset}),h.push(...u),h};function FE(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 kE=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=zs(o?o.dataStream:"",n.dataStream);let l=0;const u=a.map(([f,g])=>{switch(f){case 0:{const C=gs(n,l,l+g.length,!1),I=gs(o,l,l+g.length,!1),b={t:he.RETAIN,body:FE(C,I)?void 0:{textRuns:C,dataStream:""},len:g.length};return l+=g.length,b}case 1:{const C={t:he.INSERT,body:Tt(n,l,l+g.length),len:g.length};return l+=g.length,C}default:return{t:he.DELETE,len:g.length}}});if(u.every(f=>f.t===he.RETAIN&&!f.body))return!1;const h=new ze;return h.push({t:he.RETAIN,len:t.startOffset}),h.push(...u),h};function $E(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 xE(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 BE=e=>{var I,b,F,se;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new ze,l=Yt.getInstance(),u=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const c=(b=(I=n.getSnapshot().drawingsOrder)==null?void 0:I.length)!=null?b:0;let f=0;if(s)i>0&&a.push({t:he.RETAIN,len:i});else{const Q=oc([t],h,0,null,!1);a.push(...Q);const fe=$E(h,[t]),M=(F=n.getDrawings())!=null?F:{},T=(se=n.getDrawingsOrder())!=null?se:[],W=fe.sort((q,ge)=>T.indexOf(q)>T.indexOf(ge)?-1:T.indexOf(q)<T.indexOf(ge)?1:0);if(W.length>0)for(const q of W){const ge=M[q],le=T.indexOf(q);if(ge==null||le<0)continue;const p=l.removeOp(["drawings",q],ge),j=l.removeOp(["drawingsOrder",le],q);u.push(p),u.push(j),f++}}a.push({t:he.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((Q,fe)=>({startIndex:fe,blockId:Q.drawingId}))},len:r.length});const g=xE(n,o),C=l.editOp(a.serialize(),g);u.push(C);for(const Q of r){const{drawingId:fe}=Q,M=l.insertOp(["drawings",fe],Q),T=l.insertOp(["drawingsOrder",c-f],fe);u.push(M),u.push(T)}return u.reduce((Q,fe)=>Yt.compose(Q,fe),null)},HE=e=>{var c,f,g;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(f=(c=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:c.paragraphs)!=null?f:[],o=t.every(C=>{var I;return((I=C.bullet)==null?void 0:I.listType.indexOf(s))===0});let l=re.generateRandomId(6);if(t.length===1){const C=i.indexOf(t[0]),I=i[C-1],b=i[C+1];I&&I.bullet&&I.bullet.listType.indexOf(s)===0?(l=I.bullet.listId,s!==Ft.CHECK_LIST&&(s=I.bullet.listType)):b&&b.bullet&&b.bullet.listType.indexOf(s)===0&&(l=b.bullet.listId,s!==Ft.CHECK_LIST&&(s=b.bullet.listType))}const u=new Fn;u.reset();const h=new ze;for(const C of t){const{startIndex:I,paragraphStyle:b={},bullet:F}=C;h.push({t:he.RETAIN,len:I-u.cursor}),h.push({t:he.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:b,startIndex:0}:{startIndex:0,paragraphStyle:{...b},bullet:{nestingLevel:(g=F==null?void 0:F.nestingLevel)!=null?g:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),u.moveCursorTo(I+1)}return h},jE=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(f=>f.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ft.CHECK_LIST)===-1)return!1;const o=new Fn;o.reset();const a=new ze,{startIndex:l,paragraphStyle:u={}}=i,h=i.bullet.listType===Ft.CHECK_LIST?Ft.CHECK_LIST_CHECKED:Ft.CHECK_LIST;return a.push({t:he.RETAIN,len:l-o.cursor}),a.push({t:he.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:u,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},WE=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 Fn;l.reset();const u=new ze;for(const f of t){const{startIndex:g,paragraphStyle:C={},bullet:I}=f;u.push({t:he.RETAIN,len:g-l.cursor}),u.push({t:he.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:C,bullet:{nestingLevel:(c=I==null?void 0:I.nestingLevel)!=null?c:0,textStyle:(I==null?void 0:I.listType)===n?I.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(g+1)}return u};function zE(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const YE=e=>{var h,c,f;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Fn;i.reset();const o=new ze,a=(h=r.getSnapshot().lists)!=null?h:{},l=(f=(c=r.getBody())==null?void 0:c.tables)!=null?f:[],u={...gr,...a};for(const g of t){const{startIndex:C,paragraphStyle:I={},bullet:b}=g,F=zE(g,l);if(o.push({t:he.RETAIN,len:C-i.cursor}),b){const se=b.listType;let Q=u[se].nestingLevel.length-1;F&&(Q=Math.min(Q,2)),o.push({t:he.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...I},bullet:{...b,nestingLevel:Math.max(Math.min(b.nestingLevel+s,Q),0)}}]},coverType:Pe.REPLACE})}else o.push({t:he.RETAIN,len:1});i.moveCursorTo(C+1)}return o};var ac=(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))(ac||{}),rn=(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))(rn||{});function VE(e){return`${e}`}const GE=[rn.TABLE_START,rn.TABLE_ROW_START,rn.TABLE_CELL_START,rn.TABLE_CELL_END,rn.TABLE_ROW_END,rn.TABLE_END],lc=e=>{const t=e.endsWith(`\r
  10. `)?e.slice(0,-2):e;return GE.reduce((n,r)=>n.replaceAll(r,""),t)},KE=e=>e?lc(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 h=t.slice(s,l);if(re.isLegalUrl(h)){const c=jt(),f=`${h}`,g={startIndex:s,endIndex:s+f.length-1,rangeId:c,rangeType:nn.HYPERLINK,properties:{url:e}};r.push(g),i+=f,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 QE(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 JE(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 qE(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class it{}R(it,"customRange",{add:LE,delete:DE,copyCustomRange:TE,getCustomRangesInterestsWithSelection:AE,isIntersecting:sc}),R(it,"customDecoration",{add:bE,delete:wE}),R(it,"selection",{replace:PE,makeSelection:QE,normalizeSelection:JE,delete:oc,replaceTextRuns:kE,retain:UE}),R(it,"range",{isIntersects:qE}),R(it,"transform",{getPlainText:lc,fromPlainText:XE,isEmptyDocument:KE}),R(it,"paragraph",{bullet:{set:WE,switch:HE,toggleChecklist:jE,changeNestLevel:YE}}),R(it,"drawing",{add:BE});function ZE(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 uc(e){var t;return e.body=ZE((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class kn{constructor(t={}){R(this,"_style");this._style=t}static create(t={}){return new kn(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===Oe.TRUE}get bold(){return this._style.bl===Oe.TRUE}get underline(){return this._style.ul&&Gt.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&Gt.create(this._style.bbl)}get strikethrough(){return this._style.st&&Gt.create(this._style.st)}get overline(){return this._style.ol&&Gt.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 Vt.create(re.deepClone(this._style))}getValue(){return{...this._style}}}class Vt extends kn{static create(t={}){return new Vt(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 Vt.create(re.deepClone(this._style))}build(){return this.getValue()}}class Gt{constructor(t={s:1}){R(this,"_decoration");this._decoration=t}static create(t={s:1}){return new Gt(t)}get show(){return this._decoration.s===Oe.TRUE}get followFontColor(){return this._decoration.c===Oe.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 Gt.create(re.deepClone(this._decoration))}build(){return{...this._decoration}}}class $n{constructor(t={}){R(this,"_style");this._style=t}static create(t={}){return new $n(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===Oe.TRUE}get keepNext(){return this._style.keepNext===Oe.TRUE}get wordWrap(){return this._style.wordWrap===Oe.TRUE}get widowControl(){return this._style.widowControl===Oe.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===Oe.TRUE}copy(){return xn.create(re.deepClone(this._style))}getValue(){return this._style}}class xn extends $n{static create(t={}){return new xn(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 xn.create(re.deepClone(this._style))}build(){return this.getValue()}}class Kt{constructor(t){R(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=uc(t)}static create(t){return new Kt(t)}static createByBody(t){return new Kt({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 it.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
  11. `)}getParagraphStyle(){var t,n;return $n.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?kn.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===nn.HYPERLINK))!=null?r:[]}getData(){return this._data}}class sn extends Kt{constructor(n){super(n);R(this,"_doc");this._doc=new kt(n)}static newEmptyData(){return uc({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 Vt?r.build():r:a=s instanceof Vt?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 Kt?n.getData():n:(s=Math.min(n,s),i=r instanceof Kt?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 Vt?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:nn.HYPERLINK,rangeId:jt(),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,Kt.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:nn.HYPERLINK,rangeId:jt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}function eC(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 Bn=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(Bn||{});function tC(e){return`sheet_interceptor_${e}`}const cc=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 nC{constructor(t){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),cc(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)})),()=>er(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function rC(e){return`sheet_async_interceptor_${e}`}const sC=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 iC{constructor(t){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),sC(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)})),()=>er(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function oC(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}class ms extends tt{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 qi=Symbol("initializers");class Zi extends tt{constructor(t){super(),this._injector=t;const n=this,r=Object.getPrototypeOf(this)[qi];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[qi];r||(r=[],this.prototype[qi]=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 _s{constructor(){R(this,"_data",[])}static create(){return new _s}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 eo{constructor(){R(this,"_data",new Map)}static create(){return new eo}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}const aC="0.5.5";function lC(e="",t=An.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:aC,locale:t,styles:{},sheets:{},resources:[]}}class hc{constructor(t={}){R(this,"_styles");R(this,"_cacheMap",new lr(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 uC=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!zt.equals(r,n))),cC=(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)}),to={t:0,b:2,l:2,r:2},hC=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),dc=90;function mr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Ht.UNSPECIFIED,verticalAlign:a=qt.UNSPECIFIED,wrapStrategy:l=gn.UNSPECIFIED,cellValueType:u}=n,{t:h,r:c,b:f,l:g}=i||to,{vertexAngle:C,centerAngle:I}=pc(s),b={id:"d",body:{dataStream:`${e}${ha}`,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:f,marginRight:c,marginLeft:g,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:I,vertexAngle:C,wrapStrategy:l,cellValueType:u,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new kt(b)}function dC(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 fc(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 gc(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===nn.HYPERLINK))return;const s=it.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:nn.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&ze.apply(r,s.serialize())}function mc(e){return e!=null}const fC='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function _c(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=Dn.ITALIC;(e.it===0||e.it===void 0)&&(r=Dn.NORMAL);let s=Dn.BOLD;(e.bl===0||e.bl===void 0)&&(s=Dn.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===Dt.SUBSCRIPT||a===Dt.SUPERSCRIPT){const c=gC(o,l),{sbr:f,spr:g}=c;l*=a===Dt.SUBSCRIPT?f:g}const u=`${r} ${s} ${l}pt ${o}`,h=`${u}, ${fC} `;return{fontCache:u,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function gC(e,t){return hC(t)}function pc(e){const{a:t=0,v:n=Oe.FALSE}=e||{a:0,v:Oe.FALSE};let r=0,s=t;return n===Oe.TRUE&&(r=dc,s=dc),{centerAngle:r,vertexAngle:s}}class mC{constructor(t,n){R(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!==Oe.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:Le.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:Le.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:Le.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:Le.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 tn(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Oe.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 _C{constructor(t,n,r){R(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:Oe.FALSE,h:s.defaultRowHeight},{ia:l,ah:u,h=s.defaultRowHeight}=a;i+=(l==null||l===Oe.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:Le.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:Le.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:Le.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:Le.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Oe.TRUE:!0}getSize(){return tn(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 pC="DEFAULT_WORKSHEET_ROW_COUNT",Ec=1e3,EC="DEFAULT_WORKSHEET_COLUMN_COUNT",Cc=20,CC="DEFAULT_WORKSHEET_ROW_HEIGHT",Rc=24,RC="DEFAULT_WORKSHEET_COLUMN_WIDTH",Ic=88,IC="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",vc=46,vC="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",yc=20;function Sc(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Oe.FALSE,rowCount:Ec,columnCount:Cc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Ic,defaultRowHeight:Rc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Oe.TRUE,rowHeader:{width:vc,hidden:Oe.FALSE},columnHeader:{height:yc,hidden:Oe.FALSE},rightToLeft:Oe.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class yC extends tt{constructor(n){super();R(this,"_cellCache",new Map);R(this,"_rowCache",new Map);R(this,"_columnCache",new Map);R(this,"_hasRow",!1);R(this,"_hasColumn",!1);R(this,"_hasAll",!1);R(this,"_allIndex",-1);R(this,"_mergeData");R(this,"_rangeMap",new lr(5e4));R(this,"_skeletonCache",new lr(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===Le.ROW?this._createRowCache(s,r):i===Le.COLUMN?this._createColumnCache(s,r):i===Le.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||[])zt.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:f,startColumn:g,endColumn:C}=a[h];for(let I=n;I<=s;I++){let b=!1;for(let F=r;F<=i;F++)if(I>=c&&I<=f&&F>=g&&F<=C){o.push({startRow:c,endRow:f,startColumn:g,endColumn:C}),u.push(h),b=!0;break}if(b)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 Oc extends tt{constructor(n){super();R(this,"_cellContentInterceptor",null);R(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,Bn.Value|Bn.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,Bn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,Bn.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,Je(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Je(()=>this._rowFilteredInterceptor=null)}}const bc={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class _r{constructor(t,n,r){R(this,"_sheetId");R(this,"_snapshot");R(this,"_cellData");R(this,"_rowManager");R(this,"_columnManager");R(this,"_viewModel");R(this,"_spanModel");var a;this.unitId=t,this._styles=r,this._snapshot=Sc(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:re.generateRandomId(6),this._cellData=new Ut(o),this._viewModel=new Oc((l,u)=>this.getCellRaw(l,u)),this._rowManager=new _C(this._snapshot,this._viewModel,i),this._columnManager=new mC(this._snapshot,s),this._spanModel=new yC(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?bi(a,i,o,l):bi(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 f=+c,g=t.getValue(u,f),C=g!=null&&g.s?this._styles.get(g.s):null,I=(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);(g&&(g.v||g.p)||C!=null&&C.bg||I)&&(a?r=Math.min(r,u):(r=u,a=!0),s=Math.max(s,u),l?i=Math.min(i,f):(l=!0,i=f),o=Math.max(o,f))})}),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 _r(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:f,endColumn:g}=r;t===h&&n===f?(o=c,a=g,l=h,u=f,i=!0):t>=h&&t<=c&&n>=f&&n<=g&&(o=c,a=g,l=h,u=f,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=Nn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new Ut;return ki(t,r,n,s).forEach((u,h)=>{var f;let c;if(i===Nn.Raw)c=this.getCellRaw(u,h);else if(i===Nn.Intercepted)c=this.getCell(u,h);else if(i===Nn.Both){const g=this.getCellRaw(u,h);if(g){c={...g};const C=(f=this.getCell(u,h))==null?void 0:f.v;mc(C)&&c&&(c.displayV=String(C))}}c&&l.setValue(u,h,c)}),a.forEach(u=>{const{startColumn:h,startRow:c,endColumn:f,endRow:g}=u;ki(c,g,h,f).forEach((C,I)=>{C===c&&I===h&&l.setValue(C,I,{...o.getValue(C,I),rowSpan:g-c+1,colSpan:f-h+1}),(C!==c||I!==h)&&l.realDeleteValue(C,I)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Mn(this,t,{getStyles:()=>this._styles}):new Mn(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,f=a.getMergedCell(l,u);if(f){if(l!==f.startRow||u!==f.startColumn){u=f.endColumn+1;continue}if(c&&n){u=f.endColumn+1;continue}const C={row:l,col:u,value:h};return C.colSpan=f.endColumn-f.startColumn+1,C.rowSpan=f.endRow-f.startRow+1,u=f.endColumn+1,{done:!1,value:C}}if(c&&n)u+=1;else{const g={row:l,col:u,value:h};return u+=1,{done:!1,value:g}}}}}}}}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 C=u!==c.startRow,I=C||h!==c.startColumn;if(r&&I||!r&&C){u=c.endRow+1;continue}const b=l.getCell(c.startRow,c.startColumn);if(!b&&n){u=c.endRow+1;continue}const se={row:u,col:c.startColumn,value:b};return se.colSpan=c.endColumn-c.startColumn+1,se.rowSpan=c.endRow-c.startRow+1,u=c.endRow+1,{done:!1,value:se}}const f=l.getCell(u,h);if(!f&&n)u+=1;else{const C={row:u,col:h,value:f};return u+=1,{done:!1,value:C}}}}}}}}_getCellDocumentModel(t,n=bc){var I;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...bc,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const u=dC(o),h=i?ht.tr:u.textRotation||ht.tr;let c=u.horizontalAlign||ht.ht;const f=u.verticalAlign||ht.vt,g=u.wrapStrategy||ht.tb,C=u.paddingData||to;if(t.f&&s)a=mr(t.f.toString(),{},{verticalAlign:f}),c=ht.ht;else if(t.p){const{centerAngle:b,vertexAngle:F}=pc(h);a=this._updateConfigAndGetDocumentModel(r?re.deepClone(t.p):t.p,c,C,{horizontalAlign:c,verticalAlign:f,centerAngle:b,vertexAngle:F,wrapStrategy:g,zeroWidthParagraphBreak:1})}else if(t.v!=null){const b=fc(o);l=_c(b).fontCache;let F=wc(t);t.t===Zt.FORCE_STRING&&s&&(F=`'${F}`),a=mr(F,b,{...u,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&gc(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:g,verticalAlign:f,horizontalAlign:c,paddingData:C,fill:(I=o==null?void 0:o.bg)==null?void 0:I.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 kt(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=fc(r);if(n!=null)return n.documentModel==null&&(n.documentModel=mr("",s)),n;const i="";let o="document";const a=ht.tr,l=ht.ht,u=ht.vt,h=ht.tb,c=to;return o=_c({}).fontCache,{documentModel:mr(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 wc(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===Zt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Zt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function SC(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 OC=Object.defineProperty,bC=Object.getOwnPropertyDescriptor,wC=(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},AC=(e,t)=>(n,r)=>t(n,r,e);function TC(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}d.Workbook=class extends as{constructor(n={},r){super();R(this,"type",Be.UNIVER_SHEET);R(this,"_sheetCreated$",new Ce.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new Ce.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new Ce.BehaviorSubject(null));R(this,"activeSheet$",this._activeSheet$.asObservable());R(this,"_worksheets");R(this,"_styles");R(this,"_snapshot");R(this,"_unitId");R(this,"_count");R(this,"_name$");R(this,"name$");this._logService=r;const s=lC();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 hc(i),this._count=1,this._worksheets=new Map,this._name$=new Ce.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 _r(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()!==Oe.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===Oe.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Oe.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 _r(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}},d.Workbook=wC([AC(1,wt)],d.Workbook);class no extends as{constructor(n){var r;super();R(this,"type",Be.UNIVER_SLIDE);R(this,"_activePage$",new Ce.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...kl,...n},this._unitId=(r=this._snapshot.id)!=null?r:re.generateRandomId(6),this._name$=new Ce.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:jt(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=jt(6);return{id:n,pageType:xi.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 pr="FOCUSING_UNIT",Hn="FOCUSING_SHEET",Er="FOCUSING_DOC",Cr="FOCUSING_SLIDE",NC="FOCUSING_EDITOR_BUT_HIDDEN",Ac="EDITOR_ACTIVATED",MC="FOCUSING_EDITOR_INPUT_FORMULA",Tc="FOCUSING_FX_BAR_EDITOR",DC="FOCUSING_UNIVER_EDITOR",LC="FOCUSING_EDITOR_INPUT_FORMULA",UC="FOCUSING_PANEL_EDITOR",PC="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",FC="FOCUSING_COMMON_DRAWINGS",kC="FORMULA_EDITOR_ACTIVATED";var $C=Object.defineProperty,xC=Object.getOwnPropertyDescriptor,BC=(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&&$C(t,n,s),s},Nc=(e,t)=>(n,r)=>t(n,r,e);const on=_t("univer.current");d.UniverInstanceService=class extends tt{constructor(n,r){super();R(this,"_unitsByType",new Map);R(this,"_createHandler");R(this,"_ctorByType",new Map);R(this,"_currentUnits",new Map);R(this,"_currentUnits$",new Ce.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new Ce.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new Ce.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new Ce.BehaviorSubject(null));R(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(Ce.map(r=>{var s;return(s=r.get(n))!=null?s:null}),Ce.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(Ce.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(Ce.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(Be.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,Be.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,Be.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType(Be.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 d.Workbook?(this._contextService.setContextValue(pr,!0),this._contextService.setContextValue(Er,!1),this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Cr,!1),this.setCurrentUnitForType(n)):this.focused instanceof kt?(this._contextService.setContextValue(pr,!0),this._contextService.setContextValue(Er,!0),this._contextService.setContextValue(Hn,!1),this._contextService.setContextValue(Cr,!1),this.setCurrentUnitForType(n)):this.focused instanceof no?(this._contextService.setContextValue(pr,!0),this._contextService.setContextValue(Er,!1),this._contextService.setContextValue(Hn,!1),this._contextService.setContextValue(Cr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(pr,!1),this._contextService.setContextValue(Er,!1),this._contextService.setContextValue(Hn,!1),this._contextService.setContextValue(Cr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:Be.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]}}},d.UniverInstanceService=BC([Nc(0,at(Rt)),Nc(1,sr)],d.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 HC={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var jC=Object.defineProperty,WC=Object.getOwnPropertyDescriptor,zC=(e,t,n,r)=>{for(var s=r>1?void 0:r?WC(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},YC=(e,t)=>(n,r)=>t(n,r,e);d.LifecycleService=class extends tt{constructor(n){super();R(this,"_lifecycle$",new Ce.BehaviorSubject(Ye.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(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 Ce.merge(Mc(this.stage),this._lifecycle$.pipe(Ce.skip(1))).pipe(nl(n=>n===Ye.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${HC[n]}".`)}},d.LifecycleService=zC([YC(0,wt)],d.LifecycleService);function Mc(e){switch(e){case Ye.Starting:return Ce.of(Ye.Starting);case Ye.Ready:return Ce.of(Ye.Starting,Ye.Ready);case Ye.Rendered:return Ce.of(Ye.Starting,Ye.Ready,Ye.Rendered);default:return Ce.of(Ye.Starting,Ye.Ready,Ye.Rendered,Ye.Steady)}}var VC=Object.defineProperty,GC=Object.getOwnPropertyDescriptor,KC=(e,t,n,r)=>{for(var s=r>1?void 0:r?GC(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&&VC(t,n,s),s},ro=(e,t)=>(n,r)=>t(n,r,e);const an=_t("univer.undo-redo.service"),XC=20;class Dc{dispose(){}async dispatchToHandlers(){return!1}}const Lc="univer.command.redo",Uc="univer.command.undo",Cn=new class extends Dc{constructor(){super(...arguments);R(this,"type",wn.COMMAND);R(this,"id",Uc)}handler(t){const n=t.get(an),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(Mt);return hi(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},Rn=new class extends Dc{constructor(){super(...arguments);R(this,"type",wn.COMMAND);R(this,"id",Lc)}handler(t){const n=t.get(an),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(Mt);return hi(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};d.LocalUndoRedoService=class extends tt{constructor(n,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new Ce.BehaviorSubject({undos:0,redos:0}));R(this,"_undoStacks",new Map);R(this,"_redoStacks",new Map);R(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(Cn)),this.disposeWithMe(this._commandService.registerCommand(Rn)),this.disposeWithMe(Je(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Je(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),Je(()=>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(Hn),s=this._contextService.getContextValue(Tc),i=this._contextService.getContextValue(Ac);return r?s?n=Vs:i?n=Ys: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}},d.LocalUndoRedoService=KC([ro(0,on),ro(1,Mt),ro(2,sr)],d.LocalUndoRedoService);const ps=_t("core.resource-manager.service"),so={[Pt.Editor]:"Editor",[Pt.Owner]:"Owner",[Pt.Reader]:"Reader",[Pt.UNRECOGNIZED]:"UNRECOGNIZED"},Es=e=>e?{userID:`${so[e]}_${re.generateRandomId(8)}`,name:so[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},QC=(e,t)=>e.startsWith(so[t]);class jn{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new Ce.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new Ce.BehaviorSubject(Es()));R(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 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},Pc=(e,t)=>(n,r)=>t(n,r,e);d.AuthzIoLocalService=class{constructor(t,n){R(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(Es(Pt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?QC(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:[Be.UNIVER_SHEET,Be.UNIVER_DOC,Be.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return jt(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:Pt.Owner,shareScope:-1,scope:{read:Bi.AllCollaborator,edit:Bi.AllCollaborator},creator:Es(Pt.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(Pt.Owner)||this._getRole(Pt.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){}},d.AuthzIoLocalService=ZC([Pc(0,ps),Pc(1,at(jn))],d.AuthzIoLocalService);const Fc=_t("IAuthzIoIoService"),kc=_t("univer.config-service");class $c{constructor(){R(this,"_configChanged$",new Ce.Subject);R(this,"configChanged$",this._configChanged$.asObservable());R(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=js(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 Ce.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(Ce.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class xc extends tt{constructor(){super(...arguments);R(this,"_error$",new Ce.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class Rr extends tt{constructor(){super();R(this,"_currentLocale$",new Ce.BehaviorSubject(An.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new Ce.Subject);R(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(Je(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=js((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 eR=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&&eR(t,n,s),s},rR=(e,t)=>(n,r)=>t(n,r,e);d.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:or.PERSON,mentions:[{objectType:or.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}}},d.MentionIOLocalService=nR([rR(0,at(jn))],d.MentionIOLocalService);const Bc=_t("univer.service.mention-io");var io=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(io||{});const Hc=_t("univer.permission-service");class jc extends tt{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new Ce.Subject);R(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());R(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 Ce.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 Ce.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=io.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 Ce.combineLatest(r).pipe(xt.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 Wc(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 zc=Symbol("DependentOn");class oo extends tt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(oo,"pluginName"),R(oo,"type",Be.UNIVER_UNKNOWN);class sR{constructor(){R(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 iR{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var oR=Object.defineProperty,aR=Object.getOwnPropertyDescriptor,Yc=(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&&oR(t,n,s),s},Cs=(e,t)=>(n,r)=>t(n,r,e);const lR=4;function uR(...e){return function(t){t[zc]=e}}d.PluginService=class{constructor(t){R(this,"_pluginHolderForUniver");R(this,"_pluginHoldersForTypes",new Map);R(this,"_seenPlugins",new Set);R(this,"_flushTimer");this._injector=t,this._pluginHolderForUniver=this._injector.createInstance(Rs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set(Be.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===Be.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(Rs,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===Be.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()},lR))}_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()}},d.PluginService=Yc([Cs(0,at(Rt))],d.PluginService);let Rs=class extends tt{constructor(t,n,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new iR);R(this,"_pluginStore",new sR);R(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Ce.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[zc];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){Mc(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}})}};Rs=Yc([Cs(2,wt),Cs(3,at(Rt)),Cs(4,at(d.LifecycleService))],Rs);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},Vc=(e,t)=>(n,r)=>t(n,r,e);let ao=class extends tt{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case Be.UNRECOGNIZED:case Be.UNIVER_UNKNOWN:case Be.UNIVER_SLIDE:case Be.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(Be.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 Be.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(Be.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$(Be.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(Be.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();da(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(Be.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(Be.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}};ao=dR([Vc(0,at(ps)),Vc(1,at(on))],ao);const lo=_t("resource-loader-service");class Gc extends tt{constructor(){super(...arguments);R(this,"_resourceMap",new Map);R(this,"_register$",new Ce.Subject);R(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),Je(()=>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 uo extends tt{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new Ce.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Je(()=>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 Kc{constructor(t={},n){R(this,"_startedTypes",new Set);R(this,"_injector");R(this,"_disposingCallbacks",new xr);const r=this._injector=fR(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(uo).setTheme(s),o&&this._injector.get(Rr).load(o),i&&this._injector.get(Rr).setLocale(i),a&&this._injector.get(wt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(on)}get _pluginService(){return this._injector.get(d.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Je(t));return Je(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(Rr).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(wt).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(Be.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(wt).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(Be.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(wt).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(Be.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType(Be.UNIVER_SHEET,d.Workbook),this._univerInstanceService.registerCtorForType(Be.UNIVER_DOC,kt),this._univerInstanceService.registerCtorForType(Be.UNIVER_SLIDE,no);const n=t.get(on);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(d.LifecycleService).stage<Ye.Ready&&(this._injector.get(d.LifecycleService).stage=Ye.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function fR(e,t){const n=Wc([[xc],[Rr],[uo],[d.LifecycleService],[d.PluginService],[jn],[on,{useClass:d.UniverInstanceService}],[Hc,{useClass:jc}],[wt,{useClass:qa,lazy:!0}],[Mt,{useClass:d.CommandService}],[an,{useClass:d.LocalUndoRedoService,lazy:!0}],[kc,{useClass:$c}],[sr,{useClass:Qa}],[ps,{useClass:Gc,lazy:!0}],[lo,{useClass:ao,lazy:!0}],[Fc,{useClass:d.AuthzIoLocalService,lazy:!0}],[Bc,{useClass:d.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Rt(n);return xa(r,[[jn],[lo]]),r}var gR=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&&gR(t,n,s),s},pR=(e,t)=>(n,r)=>t(n,r,e);d.FBlob=class extends ms{constructor(t,n){super(),this._blob=t,this._injector=n}copyBlob(){return this._injector.createInstance(d.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}},d.FBlob=_R([pR(1,at(Rt))],d.FBlob);var ER=Object.defineProperty,CR=Object.getOwnPropertyDescriptor,RR=(e,t,n,r)=>{for(var s=r>1?void 0:r?CR(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&&ER(t,n,s),s},IR=(e,t)=>(n,r)=>t(n,r,e);let co=class extends Zi{constructor(e,t){super(t),this.doc=e}};co=RR([IR(1,at(Rt))],co);var ho=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(ho||{}),fo=(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))(fo||{}),go=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(go||{}),mo=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(mo||{}),_o=(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))(_o||{});const Gn=class Gn{static get(){if(this._instance)return this._instance;const t=new Gn;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 Gn.prototype)this[t]=Gn.prototype[t]}get UniverInstanceType(){return Be}get LifecycleStages(){return Ye}get DataValidationType(){return _o}get DataValidationErrorStyle(){return ho}get DataValidationRenderMode(){return go}get DataValidationOperator(){return fo}get DataValidationStatus(){return mo}get CommandType(){return wn}get BaselineOffset(){return Dt}get BooleanNumber(){return Oe}get HorizontalAlign(){return Ht}get TextDecoration(){return Si}get TextDirection(){return Tn}get VerticalAlign(){return qt}get BorderType(){return fi}get BorderStyleTypes(){return Ve}get AutoFillSeries(){return di}get ColorType(){return It}get CommonHideTypes(){return gi}get CopyPasteType(){return mi}get DeleteDirection(){return _i}get DeveloperMetadataVisibility(){return pi}get Dimension(){return Ei}get Direction(){return Ci}get InterpolationPointType(){return Ri}get LocaleType(){return An}get MentionType(){return or}get ProtectionType(){return Ii}get RelativeDate(){return vi}get SheetTypes(){return yi}get ThemeColorType(){return ct}};R(Gn,"_instance");let Is=Gn;const Kn=class Kn{static get(){if(this._instance)return this._instance;const t=new Kn;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 Kn.prototype)this[t]=Kn.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"}};R(Kn,"_instance");let vs=Kn;var vR=Object.defineProperty,yR=Object.getOwnPropertyDescriptor,SR=(e,t,n,r)=>{for(var s=r>1?void 0:r?yR(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&&vR(t,n,s),s},Xc=(e,t)=>(n,r)=>t(n,r,e);d.FHooks=class extends ms{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return Je(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Starting)).subscribe(t))}onReady(t){return Je(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Ready)).subscribe(t))}onRendered(t){return Je(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Rendered)).subscribe(t))}onSteady(t){return Je(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(Mt).beforeCommandExecuted(r=>{if(r.id===Cn.id){const i=this._injector.get(an).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(Mt).onCommandExecuted(r=>{if(r.id===Cn.id){const i=this._injector.get(an).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(Mt).beforeCommandExecuted(r=>{if(r.id===Rn.id){const i=this._injector.get(an).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(Mt).onCommandExecuted(r=>{if(r.id===Rn.id){const i=this._injector.get(an).pitchTopRedoElement();i&&t(i)}})}},d.FHooks=SR([Xc(0,at(Rt)),Xc(1,at(d.LifecycleService))],d.FHooks);var OR=Object.defineProperty,bR=Object.getOwnPropertyDescriptor,wR=(e,t,n,r)=>{for(var s=r>1?void 0:r?bR(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&&OR(t,n,s),s},Qc=(e,t)=>(n,r)=>t(n,r,e);let po=class extends ms{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};po=wR([Qc(0,at(Rt)),Qc(1,at(jn))],po);const ws=class ws{static get(){if(this._instance)return this._instance;const t=new ws;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 Fl}get tools(){return re}};R(ws,"_instance");let ys=ws;var 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},Ss=(e,t)=>(n,r)=>t(n,r,e);d.FUniver=class extends Zi{constructor(n,r,s,i){super(n);R(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 Rn.id:this.fireEvent(this.Event.BeforeRedo,c);break;case Cn.id:this.fireEvent(this.Event.BeforeUndo,c);break;default:this.fireEvent(this.Event.BeforeCommandExecute,c);break}if(c.cancel)throw new Ha})),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 Rn.id:this.fireEvent(this.Event.Redo,c);break;case Cn.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 Kc?n.__getInjector():n).createInstance(d.FUniver)}_ensureEventRegistry(n){return this._eventRegistry.has(n)||this._eventRegistry.set(n,new _s),this._eventRegistry.get(n)}_initUnitEvent(n){const r=n.get(on);this.disposeWithMe(r.unitDisposed$.subscribe(s=>{this._eventRegistry.get(this.Event.DocDisposed)&&s.type===Be.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===Be.UNIVER_DOC){const i=s,o=n.createInstance(co,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(d.LifecycleService).stage}undo(){return this._commandService.executeCommand(Cn.id)}redo(){return this._commandService.executeCommand(Rn.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(d.FHooks)}get Enum(){return Is.get()}get Event(){return vs.get()}get Util(){return ys.get()}addEvent(n,r){return this._ensureEventRegistry(n).add(r),Je(()=>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(po)}newBlob(){return this._injector.createInstance(d.FBlob)}newColor(){return new ar}newRichText(n){return sn.create(n)}newRichTextValue(n){return Kt.create(n)}newParagraphStyle(n){return xn.create(n)}newParagraphStyleValue(n){return $n.create(n)}newTextStyle(n){return Vt.create(n)}newTextStyleValue(n){return kn.create(n)}newTextDecoration(n){return new Gt(n)}},d.FUniver=NR([Ss(0,at(Rt)),Ss(1,Mt),Ss(2,on),Ss(3,at(d.LifecycleService))],d.FUniver);function Jc(e){return/^-?\d+(\.\d+)?$/.test(e)}function MR(e){return Jc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function DR(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 LR(e,t){return t.forEach(n=>e.add(n)),e}function UR(e,t,n,r){var u;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new kt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const h=new ze,c=Yt.getInstance();if(a>0&&h.retain(a),n.length>0){const f=i.sliceBody(a,a+o),g={dataStream:n};if(Array.isArray(f==null?void 0:f.textRuns)&&f.textRuns.length&&(g.textRuns=[{...f.textRuns[0],st:0,ed:n.length}]),(u=f==null?void 0:f.customRanges)!=null&&u.length){const C=f.customRanges[0];g.customRanges=[{...C,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,g)}h.delete(o),i.apply(c.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const PR="__default_document_sub_component_id20231101__";class qc{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class FR extends Ce.Subject{constructor(){super(...arguments);R(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 qc;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 kR(e){return new Ce.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const $R=_t("ILocalStorageService");function xR(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function BR(e){return new Promise(t=>setTimeout(t,e))}function HR(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var Eo=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(Eo||{}),Zc=(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))(Zc||{});const Co=_t("core.image-io.service");class jR{constructor(t,n=100){R(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new lr(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(Co)?this._injector.get(Co):null;if(t===Eo.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 WR=["script","style","meta","comment","link"];var eh=(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))(eh||{});const th=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ro=1,Ir=8;class Io{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!==Ro)throw new Error(`Got v${s} data when expected v${Ro}.`);const i=th[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 Io(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=th.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,Ir,t),this.coords=new this.ArrayType(this.data,Ir+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Ir+o+a+l),this.ids=new this.IndexArrayType(this.data,Ir,t),this.coords=new this.ArrayType(this.data,Ir+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Ro<<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 vo(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,f=l.pop()||0;if(c-f<=a){for(let b=f;b<=c;b++){const F=o[2*b],se=o[2*b+1];F>=t&&F<=r&&se>=n&&se<=s&&u.push(i[b])}continue}const g=f+c>>1,C=o[2*g],I=o[2*g+1];C>=t&&C<=r&&I>=n&&I<=s&&u.push(i[g]),(h===0?t<=C:n<=I)&&(l.push(f),l.push(g-1),l.push(1-h)),(h===0?r>=C:s>=I)&&(l.push(g+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,f=a.pop()||0;if(c-f<=o){for(let b=f;b<=c;b++)rh(i[2*b],i[2*b+1],t,n)<=u&&l.push(s[b]);continue}const g=f+c>>1,C=i[2*g],I=i[2*g+1];rh(C,I,t,n)<=u&&l.push(s[g]),(h===0?t-r<=C:n-r<=I)&&(a.push(f),a.push(g-1),a.push(1-h)),(h===0?t+r>=C:n+r>=I)&&(a.push(g+1),a.push(c),a.push(1-h))}return l}}function vo(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;nh(e,t,o,r,s,i),vo(e,t,n,r,o-1,1-i),vo(e,t,n,o+1,s,1-i)}function nh(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),f=.5*Math.exp(2*c/3),g=.5*Math.sqrt(c*f*(u-f)/u)*(h-u/2<0?-1:1),C=Math.max(r,Math.floor(n-h*f/u+g)),I=Math.min(s,Math.floor(n+(u-h)*f/u+g));nh(e,t,n,C,I,i)}const o=t[2*n+i];let a=r,l=s;for(vr(e,t,r,n),t[2*s+i]>o&&vr(e,t,r,s);a<l;){for(vr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?vr(e,t,r,l):(l++,vr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function vr(e,t,n,r){yo(e,n,r),yo(t,2*n,2*r),yo(t,2*n+1,2*r+1)}function yo(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function rh(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function sh(e,t,n=0,r=e.length-1,s=zR){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),f=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1),g=Math.max(n,Math.floor(t-u*c/l+f)),C=Math.min(r,Math.floor(t+(l-u)*c/l+f));sh(e,t,g,C,s)}const i=e[t];let o=n,a=r;for(yr(e,n,t),s(e[r],i)>0&&yr(e,n,r);o<a;){for(yr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?yr(e,n,a):(a++,yr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function yr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function zR(e,t){return e<t?-1:e>t?1:0}class So{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(!bs(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;bs(t,l)&&(n.leaf?r.push(a):bo(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!bs(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(bs(t,o)){if(n.leaf||bo(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=zn([]),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=YR(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!u&&!r.leaf&&bo(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=zn(t.slice(n,r+1)),Wn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=zn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),u=l*Math.ceil(Math.sqrt(o));ih(t,n,r,u,this.compareMinX);for(let h=n;h<=r;h+=u){const c=Math.min(h+u-1,r);ih(t,h,c,l,this.compareMinY);for(let f=h;f<=c;f+=l){const g=Math.min(f+l-1,c);a.children.push(this._build(t,f,g,s-1))}}return Wn(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=Oo(u),c=KR(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=zn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Wn(r,this.toBBox),Wn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=zn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Wn(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=Sr(t,0,a,this.toBBox),u=Sr(t,a,r,this.toBBox),h=XR(l,u),c=Oo(l)+Oo(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:VR,i=t.leaf?this.compareMinY:GR,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=Sr(t,0,n,i),a=Sr(t,r-n,r,i);let l=Os(o)+Os(a);for(let u=n;u<r-n;u++){const h=t.children[u];Or(o,t.leaf?i(h):h),l+=Os(o)}for(let u=r-n-1;u>=n;u--){const h=t.children[u];Or(a,t.leaf?i(h):h),l+=Os(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():Wn(t[n],this.toBBox)}}function YR(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 Wn(e,t){Sr(e,0,e.children.length,t,e)}function Sr(e,t,n,r,s){s||(s=zn(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 VR(e,t){return e.minX-t.minX}function GR(e,t){return e.minY-t.minY}function Oo(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Os(e){return e.maxX-e.minX+(e.maxY-e.minY)}function KR(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 XR(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 bo(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function bs(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function zn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ih(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;sh(e,o,t,n,s),i.push(t,o,o,n)}}class QR{constructor(t=!1){R(this,"_tree",new Map);R(this,"_oneCellCache",new Map);R(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 So),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 f=l;f<=h;f++){const g=a.get(f);if(g)for(let C=u;C<=c;C++){const I=g.get(C);I&&I.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:h,items:c}=u,f=h.range(o,i,l,a),g=[];for(const I of f){const b=c[I];g.push(...Array.from(b.ids))}return g}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 Io(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 So;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}hh(),d.ABCToNumber=kp,d.AUTO_HEIGHT_FOR_MERGED_CELLS=vg,d.AbsoluteRefType=nt,d.ActionIterator=Pn,d.AlignTypeH=fu,d.AlignTypeV=gu,d.ArrangeTypeEnum=pu,d.ArrowsAndMarkersShapes=al,d.AsyncInterceptorManager=iC,d.AutoFillSeries=di,d.BaselineOffset=Dt,d.BasicShapes=ol,d.BlockType=Vl,d.BooleanNumber=Oe,d.BorderStyleTypes=Ve,d.BorderType=fi,d.BuildTextUtils=it,d.BulletAlignment=hr,d.COLORS=Ai,d.CanceledError=Ha,d.CellModeEnum=Nn,d.CellValueType=Zt,d.Color=mn,d.ColorBuilder=ar,d.ColorKit=At,d.ColorType=It,d.ColumnSeparatorType=Xl,d.CommandType=wn,d.CommonHideTypes=gi,d.ConfigService=$c,d.ContextService=Qa,d.CopyPasteType=mi,d.CustomCommandExecutionError=ui,d.CustomDecorationType=_n,d.CustomRangeType=nn,d.DEFAULT_CELL=yp,d.DEFAULT_DOC=Ji,d.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=PR,d.DEFAULT_EMPTY_DOCUMENT_VALUE=ha,d.DEFAULT_RANGE=Ip,d.DEFAULT_RANGE_ARRAY=Rp,d.DEFAULT_SELECTION=vp,d.DEFAULT_SLIDE=kl,d.DEFAULT_STYLES=ht,d.DEFAULT_WORKSHEET_COLUMN_COUNT=Cc,d.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=EC,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=yc,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=vC,d.DEFAULT_WORKSHEET_COLUMN_WIDTH=Ic,d.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=RC,d.DEFAULT_WORKSHEET_ROW_COUNT=Ec,d.DEFAULT_WORKSHEET_ROW_COUNT_KEY=pC,d.DEFAULT_WORKSHEET_ROW_HEIGHT=Rc,d.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=CC,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=vc,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=IC,d.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Vs,d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Ys,d.DOCS_ZEN_EDITOR_UNIT_ID_KEY=ca,d.DOC_RANGE_TYPE=pl,d.DashStyleType=nu,d.DataStreamTreeNodeType=ac,d.DataStreamTreeTokenType=rn,d.DataValidationErrorStyle=ho,d.DataValidationImeMode=eh,d.DataValidationOperator=fo,d.DataValidationRenderMode=go,d.DataValidationStatus=mo,d.DataValidationType=_o,d.DeleteDirection=_i,d.DependentOn=uR,d.DesktopLogService=qa,d.DeveloperMetadataVisibility=pi,d.Dimension=Ei,d.Direction=Ci,d.Disposable=tt,d.DisposableCollection=xr,d.DocStyleType=zl,d.DocumentDataModel=kt,d.DocumentFlavor=$i,d.DrawingTypeEnum=Eu,d.EDITOR_ACTIVATED=Ac,d.EXTENSION_NAMES=$l,d.ErrorService=xc,d.EventState=qc,d.EventSubject=FR,d.FBase=ms,d.FBaseInitialable=Zi,d.FEnum=Is,d.FEventName=vs,d.FOCUSING_COMMON_DRAWINGS=FC,d.FOCUSING_DOC=Er,d.FOCUSING_EDITOR_BUT_HIDDEN=NC,d.FOCUSING_EDITOR_INPUT_FORMULA=MC,d.FOCUSING_EDITOR_STANDALONE=LC,d.FOCUSING_FX_BAR_EDITOR=Tc,d.FOCUSING_PANEL_EDITOR=UC,d.FOCUSING_SHEET=Hn,d.FOCUSING_SLIDE=Cr,d.FOCUSING_UNIT=pr,d.FOCUSING_UNIVER_EDITOR=DC,d.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=PC,d.FORMULA_EDITOR_ACTIVATED=kC,d.FUtil=ys,d.FollowNumberWithType=Yl,d.FontItalic=Br,d.FontStyleType=Dn,d.FontWeight=Hr,d.GridType=Gl,d.HLSColor=gl,d.HorizontalAlign=Ht,d.IAuthzIoService=Fc,d.ICommandService=Mt,d.IConfigService=kc,d.IContextService=sr,d.IImageIoService=Co,d.ILocalStorageService=$R,d.ILogService=wt,d.IMentionIOService=Bc,d.IPermissionService=Hc,d.IResourceLoaderService=lo,d.IResourceManagerService=ps,d.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=Ig,d.IUndoRedoService=an,d.IUniverInstanceService=on,d.ImageCacheMap=jR,d.ImageSourceType=Eo,d.ImageUploadStatusType=Zc,d.Inject=at,d.Injector=Rt,d.InterceptorEffectEnum=Bn,d.InterceptorManager=nC,d.InterpolationPointType=Ri,d.JSON1=Qp,d.JSONX=Yt,d.LRUHelper=ur,d.LRUMap=lr,d.LifecycleStages=Ye,d.ListGlyphType=Ne,d.LocaleService=Rr,d.LocaleType=An,d.LogLevel=Ja,d.MOVE_BUFFER_VALUE=ir,d.Many=va,d.MemoryCursor=Fn,d.MentionType=or,d.NamedStyleType=eu,d.NilCommand=el,d.NumberUnitType=du,d.ObjectMatrix=Ut,d.ObjectRelativeFromH=cu,d.ObjectRelativeFromV=hu,d.Optional=ya,d.OtherShapes=ll,d.PRESET_LIST_TYPE=gr,d.PageElementType=Cu,d.PageOrientType=_u,d.PageType=xi,d.ParagraphElementType=Jl,d.ParagraphStyleBuilder=xn,d.ParagraphStyleValue=$n,d.PermissionService=jc,d.PermissionStatus=io,d.Plugin=oo,d.PositionedObjectLayoutType=Zl,d.PresetListType=Ft,d.ProtectionType=Ii,d.QuickListType=Vu,d.QuickListTypeMap=nE,d.RANGE_DIRECTION=_l,d.RANGE_TYPE=Le,d.RBush=So,d.RCDisposable=_m,d.RGBA_PAREN=Vm,d.RGB_PAREN=Ym,d.ROTATE_BUFFER_VALUE=il,d.RTree=QR,d.Range=Mn,d.Rectangle=zt,d.RediConsumer=Pa,d.RediContext=nr,d.RediError=ot,d.RediProvider=ai,d.RedoCommand=Rn,d.RedoCommandId=Lc,d.RefAlias=Fp,d.Registry=_s,d.RegistryAsMap=eo,d.RelativeDate=vi,d.RelativeSlideLink=Ru,d.ResourceManagerService=Gc,d.RgbColor=zr,d.RichTextBuilder=sn,d.RichTextValue=Kt,d.RxDisposable=mm,d.SHEET_EDITOR_UNITS=Sp,d.SectionType=Kl,d.Self=Ia,d.SheetTypes=yi,d.SheetViewModel=Oc,d.SkipSelf=Ra,d.SliceBodyType=Xi,d.SlideDataModel=no,d.SpacingRule=tu,d.SpecialShapes=ul,d.Styles=hc,d.THEME_COLORS=fl,d.TabStopAlignment=ru,d.TableAlignmentType=iu,d.TableLayoutType=ou,d.TableRowHeightRule=lu,d.TableSizeType=su,d.TableTextWrapType=au,d.TextDecoration=Si,d.TextDecorationBuilder=Gt,d.TextDirection=Tn,d.TextDirectionType=Ql,d.TextStyleBuilder=Vt,d.TextStyleValue=kn,d.TextX=ze,d.TextXActionType=he,d.ThemeColor=Yr,d.ThemeColorType=ct,d.ThemeColors=jr,d.ThemeService=uo,d.Tools=re,d.UndoCommand=Cn,d.UndoCommandId=Uc,d.UnitModel=as,d.Univer=Kc,d.UniverInstanceType=Be,d.UpdateDocsAttributeType=Pe,d.UserManagerService=jn,d.VerticalAlign=qt,d.VerticalAlignmentType=uu,d.WithDependency=nm,d.WithNew=Sa,d.Worksheet=_r,d.WrapStrategy=gn,d.WrapTextType=ql,d.addLinkToDocumentModel=gc,d.afterInitApply=Om,d.afterTime=Sm,d.awaitTime=BR,d.binSearchFirstGreaterThanTarget=sl,d.binarySearchArray=bm,d.bufferDebounceTime=ym,d.cellToRange=I_,d.characterSpacingControlType=mu,d.checkForSubstrings=v_,d.checkIfMove=Tm,d.checkParagraphHasBullet=sp,d.checkParagraphHasIndent=ip,d.checkParagraphHasIndentByStyle=Nl,d.codeToBlob=Am,d.composeBody=Qi,d.composeInterceptors=cc,d.composeStyles=bi,d.concatMatrixArray=_p,d.connectDependencies=Zg,d.connectInjector=qg,d.convertBodyToHtml=zm,d.convertCellToRange=El,d.covertTextRunToHtml=wi,d.createAsyncInterceptorKey=rC,d.createDefaultUser=Es,d.createDocumentModelWithStyle=mr,d.createIdentifier=_t,d.createInterceptorKey=tC,d.createInternalEditorID=yg,d.createRowColIter=ki,d.dayjs=Wt,d.debounce=og,d.dedupe=mg,d.deepCompare=Mi,d.delayAnimationFrame=HR,d.deleteContent=Dl,d.extractPureTextFromCell=wc,d.forwardRef=Pg,d.fromCallback=tl,d.fromEventSubject=kR,d.fromObservable=gm,d.generateRandomId=jt,d.get=kf,d.getArrayLength=tn,d.getBodySlice=Tt,d.getBodySliceHtml=Wr,d.getBorderStyleType=E_,d.getCellInfoInMergeData=h_,d.getCellValueType=a_,d.getColorStyle=Lt,d.getCustomBlockSlice=Ju,d.getCustomDecorationSlice=Zu,d.getCustomRangeSlice=qu,d.getDocsUpdateBody=C_,d.getIntersectRange=Np,d.getOriginCellValue=SC,d.getParagraphsSlice=Qu,d.getReverseDirection=Nm,d.getSectionBreakSlice=hE,d.getTableSlice=Xu,d.getTextRunSlice=gs,d.getWorksheetUID=TC,d.groupBy=Eg,d.handleStyleToString=p_,d.hashAlgorithm=lp,d.horizontalLineSegmentsSubtraction=rs,d.insertMatrixArray=Li,d.insertTextToContent=Ml,d.isAsyncDependencyItem=qs,d.isAsyncHook=Lr,d.isBlackColor=s_,d.isBooleanString=Rg,d.isCellCoverable=g_,d.isCellV=u_,d.isClassDependencyItem=Xs,d.isCtor=Ks,d.isDisposable=ii,d.isEmptyCell=Cl,d.isFactoryDependencyItem=Qs,d.isFormulaId=__,d.isFormulaString=m_,d.isICellData=o_,d.isInternalEditorID=da,d.isNodeEnv=Wm,d.isNotNullOrUndefined=mc,d.isNullCell=l_,d.isNumeric=Jc,d.isRangesEqual=uC,d.isRealNum=ap,d.isSafeNumeric=MR,d.isSameStyleTextRun=Rl,d.isUnitRangesEqual=cC,d.isValidRange=R_,d.isValueDependencyItem=Js,d.isWhiteColor=i_,d.makeArray=Cg,d.makeCellRangeToRangeData=f_,d.makeCellToSelection=d_,d.makeCustomRangeStream=VE,d.merge=js,d.mergeOverrideWithDependencies=Wc,d.mergeSets=LR,d.mergeWith=cg,d.mergeWorksheetSnapshotWithDefault=Sc,d.mixinClass=oC,d.moveMatrixArray=Pi,d.moveRangeByOffset=Op,d.nameCharacterCheck=xR,d.normalizeBody=dE,d.normalizeTextRuns=fr,d.numberToABC=xp,d.numberToListABC=Bp,d.numfmt=Fl,d.queryObjectMatrix=Pp,d.registerDependencies=hm,d.remove=er,d.repeatStringNumTimes=Wl,d.replaceInDocumentBody=UR,d.requestImmediateMacroTask=DR,d.rotate=pg,d.searchArray=wm,d.searchInOrderedArray=rl,d.selectionToArray=c_,d.sequence=Wa,d.sequenceAsync=ja,d.sequenceExecute=hi,d.sequenceExecuteAsync=vm,d.set=dg,d.setDependencies=Ug,d.shallowEqual=Ba,d.skipParseTagNames=WR,d.sliceMatrixArray=pp,d.sortRules=Hp,d.sortRulesByDesc=jp,d.sortRulesFactory=cr,d.spliceArray=Ui,d.splitIntoGrid=Fi,d.takeAfter=nl,d.textDiff=zs,d.throttle=eC,d.toDisposable=Je,d.touchDependencies=xa,d.updateAttributeByDelete=ec,d.updateAttributeByInsert=tc,d.useDependency=im,d.useDependencyContext=um,d.useDependencyContextValue=cm,d.useDependencyValue=ka,d.useInjector=Fa,d.useObservable=am,d.useUpdateBinder=lm,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});