@univerjs/core 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +8 -8
- package/lib/es/index.js +3408 -3242
- package/lib/types/common/interceptor.d.ts +17 -2
- package/lib/types/facade/f-base.d.ts +12 -19
- package/lib/types/facade/f-enum.d.ts +20 -0
- package/lib/types/facade/f-event.d.ts +33 -0
- package/lib/types/facade/f-univer.d.ts +40 -6
- package/lib/types/facade/f-usermanager.d.ts +3 -1
- package/lib/types/facade/f-util.d.ts +25 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/services/undoredo/undoredo.service.d.ts +2 -2
- package/lib/types/sheets/typedef.d.ts +21 -7
- package/lib/types/sheets/view-model.d.ts +11 -15
- package/lib/types/sheets/worksheet.d.ts +2 -0
- package/lib/umd/index.js +8 -8
- package/package.json +5 -18
package/lib/umd/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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,kt,ot){"use strict";var Iv=Object.defineProperty;var Sv=(d,Ce,kt)=>Ce in d?Iv(d,Ce,{enumerable:!0,configurable:!0,writable:!0,value:kt}):d[Ce]=kt;var R=(d,Ce,kt)=>Sv(d,typeof Ce!="symbol"?Ce+"":Ce,kt);var $c,xc;function Hc(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 jc(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 yt=Hc(ot);function Wc(){Yc()}const vr=typeof global<"u"?global:typeof self<"u"?self:window;function Yc(){typeof vr.requestIdleCallback!="function"&&(vr.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 vr.cancelIdleCallback!="function"&&(vr.cancelIdleCallback=function(n){clearTimeout(n)})}var zi=typeof global=="object"&&global&&global.Object===Object&&global,zc=typeof self=="object"&&self&&self.Object===Object&&self,nn=zi||zc||Function("return this")(),pn=nn.Symbol,Vi=Object.prototype,Vc=Vi.hasOwnProperty,Gc=Vi.toString,kn=pn?pn.toStringTag:void 0;function Kc(e){var t=Vc.call(e,kn),n=e[kn];try{e[kn]=void 0;var r=!0}catch{}var s=Gc.call(e);return r&&(t?e[kn]=n:delete e[kn]),s}var Xc=Object.prototype,Qc=Xc.toString;function Jc(e){return Qc.call(e)}var qc="[object Null]",Zc="[object Undefined]",Gi=pn?pn.toStringTag:void 0;function $n(e){return e==null?e===void 0?Zc:qc:Gi&&Gi in Object(e)?Kc(e):Jc(e)}function En(e){return e!=null&&typeof e=="object"}var eh="[object Symbol]";function Cr(e){return typeof e=="symbol"||En(e)&&$n(e)==eh}function th(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 vn=Array.isArray,nh=1/0,Ki=pn?pn.prototype:void 0,Xi=Ki?Ki.toString:void 0;function Qi(e){if(typeof e=="string")return e;if(vn(e))return th(e,Qi)+"";if(Cr(e))return Xi?Xi.call(e):"";var t=e+"";return t=="0"&&1/e==-nh?"-0":t}var rh=/\s/;function sh(e){for(var t=e.length;t--&&rh.test(e.charAt(t)););return t}var ih=/^\s+/;function oh(e){return e&&e.slice(0,sh(e)+1).replace(ih,"")}function vt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ji=NaN,ah=/^[-+]0x[0-9a-f]+$/i,lh=/^0b[01]+$/i,uh=/^0o[0-7]+$/i,ch=parseInt;function qi(e){if(typeof e=="number")return e;if(Cr(e))return Ji;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=oh(e);var n=lh.test(e);return n||uh.test(e)?ch(e.slice(2),n?2:8):ah.test(e)?Ji:+e}function Zi(e){return e}var hh="[object AsyncFunction]",dh="[object Function]",fh="[object GeneratorFunction]",gh="[object Proxy]";function gs(e){if(!vt(e))return!1;var t=$n(e);return t==dh||t==fh||t==hh||t==gh}var ms=nn["__core-js_shared__"],eo=function(){var e=/[^.]+$/.exec(ms&&ms.keys&&ms.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mh(e){return!!eo&&eo in e}var _h=Function.prototype,ph=_h.toString;function Eh(e){if(e!=null){try{return ph.call(e)}catch{}try{return e+""}catch{}}return""}var vh=/[\\^$.*+?()[\]{}|]/g,Ch=/^\[object .+?Constructor\]$/,Rh=Function.prototype,Ih=Object.prototype,Sh=Rh.toString,Oh=Ih.hasOwnProperty,yh=RegExp("^"+Sh.call(Oh).replace(vh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wh(e){if(!vt(e)||mh(e))return!1;var t=gs(e)?yh:Ch;return t.test(Eh(e))}function bh(e,t){return e==null?void 0:e[t]}function _s(e,t){var n=bh(e,t);return wh(n)?n:void 0}var to=Object.create,Ah=function(){function e(){}return function(t){if(!vt(t))return{};if(to)return to(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Th(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 Nh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Mh=800,Dh=16,Lh=Date.now;function Uh(e){var t=0,n=0;return function(){var r=Lh(),s=Dh-(r-n);if(n=r,s>0){if(++t>=Mh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ph(e){return function(){return e}}var Rr=function(){try{var e=_s(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Fh=Rr?function(e,t){return Rr(e,"toString",{configurable:!0,enumerable:!1,value:Ph(t),writable:!0})}:Zi,kh=Uh(Fh),$h=9007199254740991,xh=/^(?:0|[1-9]\d*)$/;function ps(e,t){var n=typeof e;return t=t==null?$h:t,!!t&&(n=="number"||n!="symbol"&&xh.test(e))&&e>-1&&e%1==0&&e<t}function Es(e,t,n){t=="__proto__"&&Rr?Rr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ir(e,t){return e===t||e!==e&&t!==t}var Bh=Object.prototype,Hh=Bh.hasOwnProperty;function no(e,t,n){var r=e[t];(!(Hh.call(e,t)&&Ir(r,n))||n===void 0&&!(t in e))&&Es(e,t,n)}function jh(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?Es(n,a,l):no(n,a,l)}return n}var ro=Math.max;function Wh(e,t,n){return t=ro(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=ro(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),Th(e,this,a)}}function Yh(e,t){return kh(Wh(e,t,Zi),e+"")}var zh=9007199254740991;function so(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=zh}function vs(e){return e!=null&&so(e.length)&&!gs(e)}function Vh(e,t,n){if(!vt(n))return!1;var r=typeof t;return(r=="number"?vs(n)&&ps(t,n.length):r=="string"&&t in n)?Ir(n[t],e):!1}function io(e){return Yh(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&&Vh(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 Gh=Object.prototype;function oo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Gh;return e===n}function Kh(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Xh="[object Arguments]";function ao(e){return En(e)&&$n(e)==Xh}var lo=Object.prototype,Qh=lo.hasOwnProperty,Jh=lo.propertyIsEnumerable,Cs=ao(function(){return arguments}())?ao:function(e){return En(e)&&Qh.call(e,"callee")&&!Jh.call(e,"callee")};function qh(){return!1}var uo=typeof d=="object"&&d&&!d.nodeType&&d,co=uo&&typeof module=="object"&&module&&!module.nodeType&&module,Zh=co&&co.exports===uo,ho=Zh?nn.Buffer:void 0,ed=ho?ho.isBuffer:void 0,fo=ed||qh,td="[object Arguments]",nd="[object Array]",rd="[object Boolean]",sd="[object Date]",id="[object Error]",od="[object Function]",ad="[object Map]",ld="[object Number]",ud="[object Object]",cd="[object RegExp]",hd="[object Set]",dd="[object String]",fd="[object WeakMap]",gd="[object ArrayBuffer]",md="[object DataView]",_d="[object Float32Array]",pd="[object Float64Array]",Ed="[object Int8Array]",vd="[object Int16Array]",Cd="[object Int32Array]",Rd="[object Uint8Array]",Id="[object Uint8ClampedArray]",Sd="[object Uint16Array]",Od="[object Uint32Array]",qe={};qe[_d]=qe[pd]=qe[Ed]=qe[vd]=qe[Cd]=qe[Rd]=qe[Id]=qe[Sd]=qe[Od]=!0,qe[td]=qe[nd]=qe[gd]=qe[rd]=qe[md]=qe[sd]=qe[id]=qe[od]=qe[ad]=qe[ld]=qe[ud]=qe[cd]=qe[hd]=qe[dd]=qe[fd]=!1;function yd(e){return En(e)&&so(e.length)&&!!qe[$n(e)]}function wd(e){return function(t){return e(t)}}var go=typeof d=="object"&&d&&!d.nodeType&&d,xn=go&&typeof module=="object"&&module&&!module.nodeType&&module,bd=xn&&xn.exports===go,Rs=bd&&zi.process,mo=function(){try{var e=xn&&xn.require&&xn.require("util").types;return e||Rs&&Rs.binding&&Rs.binding("util")}catch{}}(),_o=mo&&mo.isTypedArray,po=_o?wd(_o):yd;function Ad(e,t){var n=vn(e),r=!n&&Cs(e),s=!n&&!r&&fo(e),i=!n&&!r&&!s&&po(e),o=n||r||s||i,a=o?Kh(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ps(c,l))||a.push(c);return a}function Td(e,t){return function(n){return e(t(n))}}function Nd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Md=Object.prototype,Dd=Md.hasOwnProperty;function Ld(e){if(!vt(e))return Nd(e);var t=oo(e),n=[];for(var r in e)r=="constructor"&&(t||!Dd.call(e,r))||n.push(r);return n}function Eo(e){return vs(e)?Ad(e):Ld(e)}var Ud=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pd=/^\w*$/;function Fd(e,t){if(vn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Cr(e)?!0:Pd.test(e)||!Ud.test(e)||t!=null&&e in Object(t)}var Bn=_s(Object,"create");function kd(){this.__data__=Bn?Bn(null):{},this.size=0}function $d(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xd="__lodash_hash_undefined__",Bd=Object.prototype,Hd=Bd.hasOwnProperty;function jd(e){var t=this.__data__;if(Bn){var n=t[e];return n===xd?void 0:n}return Hd.call(t,e)?t[e]:void 0}var Wd=Object.prototype,Yd=Wd.hasOwnProperty;function zd(e){var t=this.__data__;return Bn?t[e]!==void 0:Yd.call(t,e)}var Vd="__lodash_hash_undefined__";function Gd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bn&&t===void 0?Vd:t,this}function rn(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])}}rn.prototype.clear=kd,rn.prototype.delete=$d,rn.prototype.get=jd,rn.prototype.has=zd,rn.prototype.set=Gd;function Kd(){this.__data__=[],this.size=0}function Sr(e,t){for(var n=e.length;n--;)if(Ir(e[n][0],t))return n;return-1}var Xd=Array.prototype,Qd=Xd.splice;function Jd(e){var t=this.__data__,n=Sr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Qd.call(t,n,1),--this.size,!0}function qd(e){var t=this.__data__,n=Sr(t,e);return n<0?void 0:t[n][1]}function Zd(e){return Sr(this.__data__,e)>-1}function ef(e,t){var n=this.__data__,r=Sr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $t(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])}}$t.prototype.clear=Kd,$t.prototype.delete=Jd,$t.prototype.get=qd,$t.prototype.has=Zd,$t.prototype.set=ef;var vo=_s(nn,"Map");function tf(){this.size=0,this.__data__={hash:new rn,map:new(vo||$t),string:new rn}}function nf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Or(e,t){var n=e.__data__;return nf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function rf(e){var t=Or(this,e).delete(e);return this.size-=t?1:0,t}function sf(e){return Or(this,e).get(e)}function of(e){return Or(this,e).has(e)}function af(e,t){var n=Or(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function zt(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])}}zt.prototype.clear=tf,zt.prototype.delete=rf,zt.prototype.get=sf,zt.prototype.has=of,zt.prototype.set=af;var lf="Expected a function";function Is(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(lf);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(Is.Cache||zt),n}Is.Cache=zt;var uf=500;function cf(e){var t=Is(e,function(r){return n.size===uf&&n.clear(),r}),n=t.cache;return t}var hf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,df=/\\(\\)?/g,ff=cf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(hf,function(n,r,s,i){t.push(s?i.replace(df,"$1"):r||n)}),t});function gf(e){return e==null?"":Qi(e)}function Co(e,t){return vn(e)?e:Fd(e,t)?[e]:ff(gf(e))}var mf=1/0;function Ro(e){if(typeof e=="string"||Cr(e))return e;var t=e+"";return t=="0"&&1/e==-mf?"-0":t}function _f(e,t){t=Co(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ro(t[n++])];return n&&n==r?e:void 0}function pf(e,t,n){var r=e==null?void 0:_f(e,t);return r===void 0?n:r}var Io=Td(Object.getPrototypeOf,Object),Ef="[object Object]",vf=Function.prototype,Cf=Object.prototype,So=vf.toString,Rf=Cf.hasOwnProperty,If=So.call(Object);function Sf(e){if(!En(e)||$n(e)!=Ef)return!1;var t=Io(e);if(t===null)return!0;var n=Rf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&So.call(n)==If}function Of(){this.__data__=new $t,this.size=0}function yf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function wf(e){return this.__data__.get(e)}function bf(e){return this.__data__.has(e)}var Af=200;function Tf(e,t){var n=this.__data__;if(n instanceof $t){var r=n.__data__;if(!vo||r.length<Af-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zt(r)}return n.set(e,t),this.size=n.size,this}function Cn(e){var t=this.__data__=new $t(e);this.size=t.size}Cn.prototype.clear=Of,Cn.prototype.delete=yf,Cn.prototype.get=wf,Cn.prototype.has=bf,Cn.prototype.set=Tf;var Oo=typeof d=="object"&&d&&!d.nodeType&&d,yo=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,Nf=yo&&yo.exports===Oo,wo=Nf?nn.Buffer:void 0;wo&&wo.allocUnsafe;function Mf(e,t){return e.slice()}var bo=nn.Uint8Array;function Df(e){var t=new e.constructor(e.byteLength);return new bo(t).set(new bo(e)),t}function Lf(e,t){var n=Df(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function Uf(e){return typeof e.constructor=="function"&&!oo(e)?Ah(Io(e)):{}}function Pf(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 Ff=Pf(),Ss=function(){return nn.Date.now()},kf="Expected a function",$f=Math.max,xf=Math.min;function Bf(e,t,n){var r,s,i,o,a,l,c=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(kf);t=qi(t)||0,vt(n)&&(h=!!n.leading,u="maxWait"in n,i=u?$f(qi(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function g(T){var W=r,Z=s;return r=s=void 0,c=T,o=e.apply(Z,W),o}function v(T){return c=T,a=setTimeout(N,t),h?g(T):o}function C(T){var W=T-l,Z=T-c,fe=t-W;return u?xf(fe,i-Z):fe}function w(T){var W=T-l,Z=T-c;return l===void 0||W>=t||W<0||u&&Z>=i}function N(){var T=Ss();if(w(T))return G(T);a=setTimeout(N,C(T))}function G(T){return a=void 0,f&&r?g(T):(r=s=void 0,o)}function z(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function oe(){return a===void 0?o:G(Ss())}function M(){var T=Ss(),W=w(T);if(r=arguments,s=this,l=T,W){if(a===void 0)return v(l);if(u)return clearTimeout(a),a=setTimeout(N,t),g(l)}return a===void 0&&(a=setTimeout(N,t)),o}return M.cancel=z,M.flush=oe,M}function Os(e,t,n){(n!==void 0&&!Ir(e[t],n)||n===void 0&&!(t in e))&&Es(e,t,n)}function Hf(e){return En(e)&&vs(e)}function ys(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function jf(e){return jh(e,Eo(e))}function Wf(e,t,n,r,s,i,o){var a=ys(e,n),l=ys(t,n),c=o.get(l);if(c){Os(e,n,c);return}var h=i?i(a,l,n+"",e,t,o):void 0,u=h===void 0;if(u){var f=vn(l),g=!f&&fo(l),v=!f&&!g&&po(l);h=l,f||g||v?vn(a)?h=a:Hf(a)?h=Nh(a):g?(u=!1,h=Mf(l)):v?(u=!1,h=Lf(l)):h=[]:Sf(l)||Cs(l)?(h=a,Cs(a)?h=jf(a):(!vt(a)||gs(a))&&(h=Uf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Os(e,n,h)}function ws(e,t,n,r,s){e!==t&&Ff(t,function(i,o){if(s||(s=new Cn),vt(i))Wf(e,t,o,n,ws,r,s);else{var a=r?r(ys(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Os(e,o,a)}},Eo)}var Yf=io(function(e,t,n,r){ws(e,t,n,r)}),bs=io(function(e,t,n){ws(e,t,n)});function zf(e,t,n,r){if(!vt(e))return e;t=Co(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=Ro(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];c=void 0,c===void 0&&(c=vt(h)?h:ps(t[s+1])?[]:{})}no(a,l,c),a=a[l]}return e}function Vf(e,t,n){return e==null?e:zf(e,t,n)}function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var As,Ao;function Gf(){if(Ao)return As;Ao=1;var e=-1,t=1,n=0;function r(p,j,O,L,b){if(p===j)return p?[[n,p]]:[];if(O!=null){var y=fe(p,j,O);if(y)return y}var $=a(p,j),B=p.substring(0,$);p=p.substring($),j=j.substring($),$=c(p,j);var K=p.substring(p.length-$);p=p.substring(0,p.length-$),j=j.substring(0,j.length-$);var se=s(p,j);return B&&se.unshift([n,B]),K&&se.push([n,K]),G(se,b),L&&u(se),se}function s(p,j){var O;if(!p)return[[t,j]];if(!j)return[[e,p]];var L=p.length>j.length?p:j,b=p.length>j.length?j:p,y=L.indexOf(b);if(y!==-1)return O=[[t,L.substring(0,y)],[n,b],[t,L.substring(y+b.length)]],p.length>j.length&&(O[0][0]=O[2][0]=e),O;if(b.length===1)return[[e,p],[t,j]];var $=h(p,j);if($){var B=$[0],K=$[1],se=$[2],de=$[3],me=$[4],Ne=r(B,se),be=r(K,de);return Ne.concat([[n,me]],be)}return i(p,j)}function i(p,j){for(var O=p.length,L=j.length,b=Math.ceil((O+L)/2),y=b,$=2*b,B=new Array($),K=new Array($),se=0;se<$;se++)B[se]=-1,K[se]=-1;B[y+1]=0,K[y+1]=0;for(var de=O-L,me=de%2!==0,Ne=0,be=0,S=0,x=0,X=0;X<b;X++){for(var Q=-X+Ne;Q<=X-be;Q+=2){var V=y+Q,Y;Q===-X||Q!==X&&B[V-1]<B[V+1]?Y=B[V+1]:Y=B[V-1]+1;for(var ue=Y-Q;Y<O&&ue<L&&p.charAt(Y)===j.charAt(ue);)Y++,ue++;if(B[V]=Y,Y>O)be+=2;else if(ue>L)Ne+=2;else if(me){var ae=y+de-Q;if(ae>=0&&ae<$&&K[ae]!==-1){var H=O-K[ae];if(Y>=H)return o(p,j,Y,ue)}}}for(var ne=-X+S;ne<=X-x;ne+=2){var ae=y+ne,H;ne===-X||ne!==X&&K[ae-1]<K[ae+1]?H=K[ae+1]:H=K[ae-1]+1;for(var ie=H-ne;H<O&&ie<L&&p.charAt(O-H-1)===j.charAt(L-ie-1);)H++,ie++;if(K[ae]=H,H>O)x+=2;else if(ie>L)S+=2;else if(!me){var V=y+de-ne;if(V>=0&&V<$&&B[V]!==-1){var Y=B[V],ue=y+Y-V;if(H=O-H,Y>=H)return o(p,j,Y,ue)}}}}return[[e,p],[t,j]]}function o(p,j,O,L){var b=p.substring(0,O),y=j.substring(0,L),$=p.substring(O),B=j.substring(L),K=r(b,y),se=r($,B);return K.concat(se)}function a(p,j){if(!p||!j||p.charAt(0)!==j.charAt(0))return 0;for(var O=0,L=Math.min(p.length,j.length),b=L,y=0;O<b;)p.substring(y,b)==j.substring(y,b)?(O=b,y=O):L=b,b=Math.floor((L-O)/2+O);return z(p.charCodeAt(b-1))&&b--,b}function l(p,j){var O=p.length,L=j.length;if(O==0||L==0)return 0;O>L?p=p.substring(O-L):O<L&&(j=j.substring(0,O));var b=Math.min(O,L);if(p==j)return b;for(var y=0,$=1;;){var B=p.substring(b-$),K=j.indexOf(B);if(K==-1)return y;$+=K,(K==0||p.substring(b-$)==j.substring(0,$))&&(y=$,$++)}}function c(p,j){if(!p||!j||p.slice(-1)!==j.slice(-1))return 0;for(var O=0,L=Math.min(p.length,j.length),b=L,y=0;O<b;)p.substring(p.length-b,p.length-y)==j.substring(j.length-b,j.length-y)?(O=b,y=O):L=b,b=Math.floor((L-O)/2+O);return oe(p.charCodeAt(p.length-b))&&b--,b}function h(p,j){var O=p.length>j.length?p:j,L=p.length>j.length?j:p;if(O.length<4||L.length*2<O.length)return null;function b(be,S,x){for(var X=be.substring(x,x+Math.floor(be.length/4)),Q=-1,V="",Y,ue,ae,H;(Q=S.indexOf(X,Q+1))!==-1;){var ne=a(be.substring(x),S.substring(Q)),ie=c(be.substring(0,x),S.substring(0,Q));V.length<ie+ne&&(V=S.substring(Q-ie,Q)+S.substring(Q,Q+ne),Y=be.substring(0,x-ie),ue=be.substring(x+ne),ae=S.substring(0,Q-ie),H=S.substring(Q+ne))}return V.length*2>=be.length?[Y,ue,ae,H,V]:null}var y=b(O,L,Math.ceil(O.length/4)),$=b(O,L,Math.ceil(O.length/2)),B;if(!y&&!$)return null;$?y?B=y[4].length>$[4].length?y:$:B=$:B=y;var K,se,de,me;p.length>j.length?(K=B[0],se=B[1],de=B[2],me=B[3]):(de=B[0],me=B[1],K=B[2],se=B[3]);var Ne=B[4];return[K,se,de,me,Ne]}function u(p){for(var j=!1,O=[],L=0,b=null,y=0,$=0,B=0,K=0,se=0;y<p.length;)p[y][0]==n?(O[L++]=y,$=K,B=se,K=0,se=0,b=p[y][1]):(p[y][0]==t?K+=p[y][1].length:se+=p[y][1].length,b&&b.length<=Math.max($,B)&&b.length<=Math.max(K,se)&&(p.splice(O[L-1],0,[e,b]),p[O[L-1]+1][0]=t,L--,L--,y=L>0?O[L-1]:-1,$=0,B=0,K=0,se=0,b=null,j=!0)),y++;for(j&&G(p),N(p),y=1;y<p.length;){if(p[y-1][0]==e&&p[y][0]==t){var de=p[y-1][1],me=p[y][1],Ne=l(de,me),be=l(me,de);Ne>=be?(Ne>=de.length/2||Ne>=me.length/2)&&(p.splice(y,0,[n,me.substring(0,Ne)]),p[y-1][1]=de.substring(0,de.length-Ne),p[y+1][1]=me.substring(Ne),y++):(be>=de.length/2||be>=me.length/2)&&(p.splice(y,0,[n,de.substring(0,be)]),p[y-1][0]=t,p[y-1][1]=me.substring(0,me.length-be),p[y+1][0]=e,p[y+1][1]=de.substring(be),y++),y++}y++}}var f=/[^a-zA-Z0-9]/,g=/\s/,v=/[\r\n]/,C=/\n\r?\n$/,w=/^\r?\n\r?\n/;function N(p){function j(be,S){if(!be||!S)return 6;var x=be.charAt(be.length-1),X=S.charAt(0),Q=x.match(f),V=X.match(f),Y=Q&&x.match(g),ue=V&&X.match(g),ae=Y&&x.match(v),H=ue&&X.match(v),ne=ae&&be.match(C),ie=H&&S.match(w);return ne||ie?5:ae||H?4:Q&&!Y&&ue?3:Y||ue?2:Q||V?1:0}for(var O=1;O<p.length-1;){if(p[O-1][0]==n&&p[O+1][0]==n){var L=p[O-1][1],b=p[O][1],y=p[O+1][1],$=c(L,b);if($){var B=b.substring(b.length-$);L=L.substring(0,L.length-$),b=B+b.substring(0,b.length-$),y=B+y}for(var K=L,se=b,de=y,me=j(L,b)+j(b,y);b.charAt(0)===y.charAt(0);){L+=b.charAt(0),b=b.substring(1)+y.charAt(0),y=y.substring(1);var Ne=j(L,b)+j(b,y);Ne>=me&&(me=Ne,K=L,se=b,de=y)}p[O-1][1]!=K&&(K?p[O-1][1]=K:(p.splice(O-1,1),O--),p[O][1]=se,de?p[O+1][1]=de:(p.splice(O+1,1),O--))}O++}}function G(p,j){p.push([n,""]);for(var O=0,L=0,b=0,y="",$="",B;O<p.length;){if(O<p.length-1&&!p[O][1]){p.splice(O,1);continue}switch(p[O][0]){case t:b++,$+=p[O][1],O++;break;case e:L++,y+=p[O][1],O++;break;case n:var K=O-b-L-1;if(j){if(K>=0&&T(p[K][1])){var se=p[K][1].slice(-1);if(p[K][1]=p[K][1].slice(0,-1),y=se+y,$=se+$,!p[K][1]){p.splice(K,1),O--;var de=K-1;p[de]&&p[de][0]===t&&(b++,$=p[de][1]+$,de--),p[de]&&p[de][0]===e&&(L++,y=p[de][1]+y,de--),K=de}}if(M(p[O][1])){var se=p[O][1].charAt(0);p[O][1]=p[O][1].slice(1),y+=se,$+=se}}if(O<p.length-1&&!p[O][1]){p.splice(O,1);break}if(y.length>0||$.length>0){y.length>0&&$.length>0&&(B=a($,y),B!==0&&(K>=0?p[K][1]+=$.substring(0,B):(p.splice(0,0,[n,$.substring(0,B)]),O++),$=$.substring(B),y=y.substring(B)),B=c($,y),B!==0&&(p[O][1]=$.substring($.length-B)+p[O][1],$=$.substring(0,$.length-B),y=y.substring(0,y.length-B)));var me=b+L;y.length===0&&$.length===0?(p.splice(O-me,me),O=O-me):y.length===0?(p.splice(O-me,me,[t,$]),O=O-me+1):$.length===0?(p.splice(O-me,me,[e,y]),O=O-me+1):(p.splice(O-me,me,[e,y],[t,$]),O=O-me+2)}O!==0&&p[O-1][0]===n?(p[O-1][1]+=p[O][1],p.splice(O,1)):O++,b=0,L=0,y="",$="";break}}p[p.length-1][1]===""&&p.pop();var Ne=!1;for(O=1;O<p.length-1;)p[O-1][0]===n&&p[O+1][0]===n&&(p[O][1].substring(p[O][1].length-p[O-1][1].length)===p[O-1][1]?(p[O][1]=p[O-1][1]+p[O][1].substring(0,p[O][1].length-p[O-1][1].length),p[O+1][1]=p[O-1][1]+p[O+1][1],p.splice(O-1,1),Ne=!0):p[O][1].substring(0,p[O+1][1].length)==p[O+1][1]&&(p[O-1][1]+=p[O+1][1],p[O][1]=p[O][1].substring(p[O+1][1].length)+p[O+1][1],p.splice(O+1,1),Ne=!0)),O++;Ne&&G(p,j)}function z(p){return p>=55296&&p<=56319}function oe(p){return p>=56320&&p<=57343}function M(p){return oe(p.charCodeAt(0))}function T(p){return z(p.charCodeAt(p.length-1))}function W(p){for(var j=[],O=0;O<p.length;O++)p[O][1].length>0&&j.push(p[O]);return j}function Z(p,j,O,L){return T(p)||M(L)?null:W([[n,p],[e,j],[t,O],[n,L]])}function fe(p,j,O){var L=typeof O=="number"?{index:O,length:0}:O.oldRange,b=typeof O=="number"?null:O.newRange,y=p.length,$=j.length;if(L.length===0&&(b===null||b.length===0)){var B=L.index,K=p.slice(0,B),se=p.slice(B),de=b?b.index:null;e:{var me=B+$-y;if(de!==null&&de!==me||me<0||me>$)break e;var Ne=j.slice(0,me),be=j.slice(me);if(be!==se)break e;var S=Math.min(B,me),x=K.slice(0,S),X=Ne.slice(0,S);if(x!==X)break e;var Q=K.slice(S),V=Ne.slice(S);return Z(x,Q,V,se)}e:{if(de!==null&&de!==B)break e;var Y=B,Ne=j.slice(0,Y),be=j.slice(Y);if(Ne!==K)break e;var ue=Math.min(y-Y,$-Y),ae=se.slice(se.length-ue),H=be.slice(be.length-ue);if(ae!==H)break e;var Q=se.slice(0,se.length-ue),V=be.slice(0,be.length-ue);return Z(K,Q,V,ae)}}if(L.length>0&&b&&b.length===0)e:{var x=p.slice(0,L.index),ae=p.slice(L.index+L.length),S=x.length,ue=ae.length;if($<S+ue)break e;var X=j.slice(0,S),H=j.slice($-ue);if(x!==X||ae!==H)break e;var Q=p.slice(S,y-ue),V=j.slice(S,$-ue);return Z(x,Q,V,ae)}return null}function le(p,j,O,L){return r(p,j,O,L,!0)}return le.INSERT=t,le.DELETE=e,le.EQUAL=n,As=le,As}var Kf=Gf();const To=Ct(Kf);function Hn(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function Xf(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Qf(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Jf(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function qf(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 Zf(e){return Array.isArray(e)?e:[e]}function eg(e){return["true","false"].includes(e.toLowerCase())}const jn="__INTERNAL_EDITOR__",Ts=`${jn}DOCS_NORMAL`,Ns=`${jn}DOCS_FORMULA_BAR`,No=`${jn}ZEN_EDITOR`,Mo=`\r
|
|
2
|
-
`,tg="isRowStylePrecedeColumnStyle";function ng(e){return`${jn}${e}`}function Do(e){return e.startsWith(jn)}var Ms=Symbol("$$IDENTIFIER_DECORATOR");function rg(e){return e&&e[Ms]===!0}function Ds(e){return typeof e=="function"}function Ls(e){return!!(e&&typeof e.useClass<"u")}function Us(e){return!!(e&&typeof e.useFactory<"u")}function Ps(e){return!!(e&&typeof e.useValue<"u")}function sg(e){return!!(e&&typeof e.useExisting<"u")}function Fs(e){return!!(e&&typeof e.useAsync<"u")}var Lo=Symbol("AsyncHook");function yr(e){return!!(e&&e.__symbol===Lo)}function Et(e){return typeof e>"u"?"undefined":Ds(e)&&!e[Ms]?e.name:e.toString()}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 ig=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)}}(),it=function(e){ig(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error),Uo=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)}}(),Po=Symbol("$$TARGET"),ks=Symbol("$$DEPENDENCIES"),og=function(e){Uo(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(Et(r),'".');return e.call(this,s)||this}return t}(it),Fo=function(e){Uo(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Et(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(it);function ko(e){var t=e;return t[ks]||[]}function $s(e,t){var n=ko(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new og(t,e);return r}function xs(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 Fo(e,n);var o=e;o[Po]===o?o[ks].push(i):(o[ks]=[i],o[Po]=o)}var $o=new Set;function mt(e){if($o.has(e))throw new it('Identifier "'.concat(e,'" already exists.'));$o.add(e);var t=function(n,r,s){xs(n,t,s)};return t.toString=function(){return e},t[Ms]=!0,t}var ag=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)}}(),Bs=function(e){ag(t,e);function t(n,r,s){var i=this,o='Expect "'.concat(r,'" dependency items for id "').concat(Et(n),'" but get ').concat(s,".");return s==0&&(o+=" Did you forget to register it?"),s>1&&(o+=" You register it more than once."),i=e.call(this,o)||this,i.quantity=r,i.actual=s,i}return t}(it);function Hs(e,t,n){if(t===d.Quantity.OPTIONAL&&n>1||t===d.Quantity.REQUIRED&&n!==1)throw new Bs(e,t,n)}function lg(e,t){return e===d.Quantity.MANY?t:t[0]}function ug(e,t,n){var r=$s(e,t);r.quantity=n}function js(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)xs(r,n,i,e);else{if(e===d.Quantity.REQUIRED)throw new Fo(r,i);ug(r,i,e)}}}}var xo=js(d.Quantity.MANY),Bo=js(d.Quantity.OPTIONAL),lt=js(d.Quantity.REQUIRED);function cg(e){return{unwrap:e}}function hg(e){return!!e&&typeof e.unwrap=="function"}function dg(e){return hg(e)?e.unwrap():e}function Ws(e){return!!e&&typeof e.dispose=="function"}var Ho=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 fg(e){return e.length===1}var wr=[];function jo(e){wr.push(e)}function Wo(){wr.pop()}function gg(){wr.length=0}var Yo=function(e){Ho(t,e);function t(n,r,s){var i='Cannot find "'.concat(Et(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(rg(n)?Et(n):n.name,'".');return e.call(this,i)||this}return t}(it),br=function(e){Ho(t,e);function t(n){var r=this,s='Cannot find "'.concat(Et(n),'" registered by any injector. The stack of dependencies is: "').concat(wr.map(function(i){return Et(i)}).join(" -> "),'".');return r=e.call(this,s)||this,gg(),r}return t}(it),mg=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 Hs(t,n,r.length),lg(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 fg(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),_g=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 Ws(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 br(t);return Hs(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 Ws(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function pg(e,t,n){var r=$s(e,t);r.lookUp=n}function zo(e){return function t(){return this instanceof t?this:function(n,r,s){pg(n,s,e)}}}var Vo=zo(d.LookUp.SKIP_SELF),Go=zo(d.LookUp.SELF);function Eg(e,t,n){var r=$s(e,t);r.withNew=n}function vg(e){return function t(){return this instanceof t?this:function(n,r,s){Eg(n,s,e)}}}var Ko=vg(!0);function Xo(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=void 0,a=d.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof Go)o=d.LookUp.SELF;else if(c instanceof Vo)o=d.LookUp.SKIP_SELF;else if(c instanceof Bo)a=d.Quantity.OPTIONAL;else if(c instanceof xo)a=d.Quantity.MANY;else if(c instanceof Ko)l=!0;else throw new it("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var Ys;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")Ys=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}});Ys=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var Cg=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=Ys(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}(),Rn=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)}}(),Ar=function(){return Ar=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},Ar.apply(this,arguments)},sn=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))},Rg=300,Tr=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Ig=function(e){Rn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Et(n),'".'))||this}return t}(it),Sg=function(e){Rn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(it),Og=function(e){Rn(t,e);function t(n){return e.call(this,'Async item "'.concat(Et(n),'" returns another async item.'))||this}return t}(it),yg=function(e){Rn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(Et(n),'" from sync api.'))||this}return t}(it),Qo=function(e){Rn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(it),wg=function(e){Rn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(it),Rt=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new mg(t||[]),this.resolvedDependencyCollection=new _g,n&&n.children.push(this)}return 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},e.prototype.deleteSelfFromParent=function(){if(this.parent){var t=this.parent.children.indexOf(this);t>-1&&this.parent.children.splice(t,1)}},e.prototype.add=function(t){this._ensureInjectorNotDisposed();var n=t[0],r=t[1];if(this.resolvedDependencyCollection.has(n))throw new Qo(n);typeof r>"u"?this.dependencyCollection.add(n):Fs(r)||Ls(r)||Ps(r)||Us(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new Qo(n);this.dependencyCollection.delete(n),t.length===1?this.dependencyCollection.add(n):this.dependencyCollection.add(n,t[1])},e.prototype.delete=function(t){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(t))throw new wg(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,sn([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 yr(i)})||yr(s))throw new yg(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!==Tr)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!==Tr)return Promise.resolve(n);var r=this.createDependency(t,d.Quantity.REQUIRED);return yr(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,sn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;jo(t);try{Ps(n)?s=this._resolveValueDependency(t,n):Us(n)?s=this._resolveFactory(t,n,r):Ls(n)?s=this._resolveClass(t,n,r):sg(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),Wo()}catch(i){throw Wo(),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 Cg(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 c=o.getValue(),h=c[l];return typeof h!="function"||(h=h.bind(c),a[l]=h),h}},set:function(a,l,c){return o.getValue()[l]=c,!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=ko(i).sort(function(w,N){return w.paramIndex-N.paramIndex}).map(function(w){return Ar(Ar({},w),{identifier:dg(w.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var h=c[l];try{var u=this._get(h.identifier,h.quantity,h.lookUp,h.withNew);a.push(u)}catch(w){throw w instanceof br||w instanceof Bs&&w.actual===0?new Yo(i,h.identifier,h.paramIndex):w}}var f=sn([],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(Et(i)," but get ").concat(f.length,"."));var v=g-f.length;v>0?f=sn(sn([],f,!0),new Array(v).fill(void 0),!0):f=f.slice(0,g)}var C=new(i.bind.apply(i,sn(sn([void 0],f,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,C),this.markResolutionCompleted(),C},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=Xo(n.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var h=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(h)}catch(f){throw f instanceof br||f instanceof Bs&&f.actual===0?new Yo(t,c.identifier,c.paramIndex):f}}var u=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,u),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,u),u},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:Lo,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!==Tr)return i;var o;if(Array.isArray(s)){var a=s[1];if(Fs(a))throw new Og(t);o=r._resolveDependency(t,a)}else Ds(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)?Tr:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):(Hs(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),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(t,h,s)}):l&&(c=i._resolveDependency(t,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===d.Quantity.OPTIONAL)return null;throw jo(t),new br(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>=Rg)throw new Ig(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Sg},e}();function bg(e,t,n){n===void 0&&(n=0);var r=Xo(t,n);r.forEach(function(s){xs(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var Jo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,qo="REDI_GLOBAL_LOCK",Ag=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Jo[qo]?Ag||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
|
|
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,Ft,ot){"use strict";var bv=Object.defineProperty;var Av=(d,Ce,Ft)=>Ce in d?bv(d,Ce,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):d[Ce]=Ft;var R=(d,Ce,Ft)=>Av(d,typeof Ce!="symbol"?Ce+"":Ce,Ft);var Wc,Yc;function Vc(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 Gc(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 Ot=Vc(ot);function Kc(){Xc()}const vr=typeof global<"u"?global:typeof self<"u"?self:window;function Xc(){typeof vr.requestIdleCallback!="function"&&(vr.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 vr.cancelIdleCallback!="function"&&(vr.cancelIdleCallback=function(n){clearTimeout(n)})}var eo=typeof global=="object"&&global&&global.Object===Object&&global,Qc=typeof self=="object"&&self&&self.Object===Object&&self,nn=eo||Qc||Function("return this")(),mn=nn.Symbol,to=Object.prototype,Jc=to.hasOwnProperty,qc=to.toString,kn=mn?mn.toStringTag:void 0;function Zc(e){var t=Jc.call(e,kn),n=e[kn];try{e[kn]=void 0;var r=!0}catch{}var s=qc.call(e);return r&&(t?e[kn]=n:delete e[kn]),s}var eh=Object.prototype,th=eh.toString;function nh(e){return th.call(e)}var rh="[object Null]",sh="[object Undefined]",no=mn?mn.toStringTag:void 0;function $n(e){return e==null?e===void 0?sh:rh:no&&no in Object(e)?Zc(e):nh(e)}function _n(e){return e!=null&&typeof e=="object"}var ih="[object Symbol]";function Cr(e){return typeof e=="symbol"||_n(e)&&$n(e)==ih}function oh(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 pn=Array.isArray,ah=1/0,ro=mn?mn.prototype:void 0,so=ro?ro.toString:void 0;function io(e){if(typeof e=="string")return e;if(pn(e))return oh(e,io)+"";if(Cr(e))return so?so.call(e):"";var t=e+"";return t=="0"&&1/e==-ah?"-0":t}var lh=/\s/;function uh(e){for(var t=e.length;t--&&lh.test(e.charAt(t)););return t}var ch=/^\s+/;function hh(e){return e&&e.slice(0,uh(e)+1).replace(ch,"")}function vt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var oo=NaN,dh=/^[-+]0x[0-9a-f]+$/i,fh=/^0b[01]+$/i,gh=/^0o[0-7]+$/i,mh=parseInt;function ao(e){if(typeof e=="number")return e;if(Cr(e))return oo;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=hh(e);var n=fh.test(e);return n||gh.test(e)?mh(e.slice(2),n?2:8):dh.test(e)?oo:+e}function lo(e){return e}var _h="[object AsyncFunction]",ph="[object Function]",Eh="[object GeneratorFunction]",vh="[object Proxy]";function vs(e){if(!vt(e))return!1;var t=$n(e);return t==ph||t==Eh||t==_h||t==vh}var Cs=nn["__core-js_shared__"],uo=function(){var e=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ch(e){return!!uo&&uo in e}var Rh=Function.prototype,Ih=Rh.toString;function Sh(e){if(e!=null){try{return Ih.call(e)}catch{}try{return e+""}catch{}}return""}var yh=/[\\^$.*+?()[\]{}|]/g,Oh=/^\[object .+?Constructor\]$/,wh=Function.prototype,bh=Object.prototype,Ah=wh.toString,Th=bh.hasOwnProperty,Nh=RegExp("^"+Ah.call(Th).replace(yh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mh(e){if(!vt(e)||Ch(e))return!1;var t=vs(e)?Nh:Oh;return t.test(Sh(e))}function Dh(e,t){return e==null?void 0:e[t]}function Rs(e,t){var n=Dh(e,t);return Mh(n)?n:void 0}var co=Object.create,Lh=function(){function e(){}return function(t){if(!vt(t))return{};if(co)return co(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Uh(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 Ph(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Fh=800,kh=16,$h=Date.now;function xh(e){var t=0,n=0;return function(){var r=$h(),s=kh-(r-n);if(n=r,s>0){if(++t>=Fh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Bh(e){return function(){return e}}var Rr=function(){try{var e=Rs(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Hh=Rr?function(e,t){return Rr(e,"toString",{configurable:!0,enumerable:!1,value:Bh(t),writable:!0})}:lo,jh=xh(Hh),Wh=9007199254740991,Yh=/^(?:0|[1-9]\d*)$/;function Is(e,t){var n=typeof e;return t=t==null?Wh:t,!!t&&(n=="number"||n!="symbol"&&Yh.test(e))&&e>-1&&e%1==0&&e<t}function Ss(e,t,n){t=="__proto__"&&Rr?Rr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ir(e,t){return e===t||e!==e&&t!==t}var zh=Object.prototype,Vh=zh.hasOwnProperty;function ho(e,t,n){var r=e[t];(!(Vh.call(e,t)&&Ir(r,n))||n===void 0&&!(t in e))&&Ss(e,t,n)}function Gh(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?Ss(n,a,l):ho(n,a,l)}return n}var fo=Math.max;function Kh(e,t,n){return t=fo(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=fo(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),Uh(e,this,a)}}function Xh(e,t){return jh(Kh(e,t,lo),e+"")}var Qh=9007199254740991;function go(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Qh}function ys(e){return e!=null&&go(e.length)&&!vs(e)}function Jh(e,t,n){if(!vt(n))return!1;var r=typeof t;return(r=="number"?ys(n)&&Is(t,n.length):r=="string"&&t in n)?Ir(n[t],e):!1}function mo(e){return Xh(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&&Jh(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 qh=Object.prototype;function _o(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||qh;return e===n}function Zh(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ed="[object Arguments]";function po(e){return _n(e)&&$n(e)==ed}var Eo=Object.prototype,td=Eo.hasOwnProperty,nd=Eo.propertyIsEnumerable,Os=po(function(){return arguments}())?po:function(e){return _n(e)&&td.call(e,"callee")&&!nd.call(e,"callee")};function rd(){return!1}var vo=typeof d=="object"&&d&&!d.nodeType&&d,Co=vo&&typeof module=="object"&&module&&!module.nodeType&&module,sd=Co&&Co.exports===vo,Ro=sd?nn.Buffer:void 0,id=Ro?Ro.isBuffer:void 0,Io=id||rd,od="[object Arguments]",ad="[object Array]",ld="[object Boolean]",ud="[object Date]",cd="[object Error]",hd="[object Function]",dd="[object Map]",fd="[object Number]",gd="[object Object]",md="[object RegExp]",_d="[object Set]",pd="[object String]",Ed="[object WeakMap]",vd="[object ArrayBuffer]",Cd="[object DataView]",Rd="[object Float32Array]",Id="[object Float64Array]",Sd="[object Int8Array]",yd="[object Int16Array]",Od="[object Int32Array]",wd="[object Uint8Array]",bd="[object Uint8ClampedArray]",Ad="[object Uint16Array]",Td="[object Uint32Array]",qe={};qe[Rd]=qe[Id]=qe[Sd]=qe[yd]=qe[Od]=qe[wd]=qe[bd]=qe[Ad]=qe[Td]=!0,qe[od]=qe[ad]=qe[vd]=qe[ld]=qe[Cd]=qe[ud]=qe[cd]=qe[hd]=qe[dd]=qe[fd]=qe[gd]=qe[md]=qe[_d]=qe[pd]=qe[Ed]=!1;function Nd(e){return _n(e)&&go(e.length)&&!!qe[$n(e)]}function Md(e){return function(t){return e(t)}}var So=typeof d=="object"&&d&&!d.nodeType&&d,xn=So&&typeof module=="object"&&module&&!module.nodeType&&module,Dd=xn&&xn.exports===So,ws=Dd&&eo.process,yo=function(){try{var e=xn&&xn.require&&xn.require("util").types;return e||ws&&ws.binding&&ws.binding("util")}catch{}}(),Oo=yo&&yo.isTypedArray,wo=Oo?Md(Oo):Nd;function Ld(e,t){var n=pn(e),r=!n&&Os(e),s=!n&&!r&&Io(e),i=!n&&!r&&!s&&wo(e),o=n||r||s||i,a=o?Zh(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Is(c,l))||a.push(c);return a}function Ud(e,t){return function(n){return e(t(n))}}function Pd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Fd=Object.prototype,kd=Fd.hasOwnProperty;function $d(e){if(!vt(e))return Pd(e);var t=_o(e),n=[];for(var r in e)r=="constructor"&&(t||!kd.call(e,r))||n.push(r);return n}function bo(e){return ys(e)?Ld(e):$d(e)}var xd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bd=/^\w*$/;function Hd(e,t){if(pn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Cr(e)?!0:Bd.test(e)||!xd.test(e)||t!=null&&e in Object(t)}var Bn=Rs(Object,"create");function jd(){this.__data__=Bn?Bn(null):{},this.size=0}function Wd(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Yd="__lodash_hash_undefined__",zd=Object.prototype,Vd=zd.hasOwnProperty;function Gd(e){var t=this.__data__;if(Bn){var n=t[e];return n===Yd?void 0:n}return Vd.call(t,e)?t[e]:void 0}var Kd=Object.prototype,Xd=Kd.hasOwnProperty;function Qd(e){var t=this.__data__;return Bn?t[e]!==void 0:Xd.call(t,e)}var Jd="__lodash_hash_undefined__";function qd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bn&&t===void 0?Jd:t,this}function rn(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])}}rn.prototype.clear=jd,rn.prototype.delete=Wd,rn.prototype.get=Gd,rn.prototype.has=Qd,rn.prototype.set=qd;function Zd(){this.__data__=[],this.size=0}function Sr(e,t){for(var n=e.length;n--;)if(Ir(e[n][0],t))return n;return-1}var ef=Array.prototype,tf=ef.splice;function nf(e){var t=this.__data__,n=Sr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():tf.call(t,n,1),--this.size,!0}function rf(e){var t=this.__data__,n=Sr(t,e);return n<0?void 0:t[n][1]}function sf(e){return Sr(this.__data__,e)>-1}function of(e,t){var n=this.__data__,r=Sr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function kt(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])}}kt.prototype.clear=Zd,kt.prototype.delete=nf,kt.prototype.get=rf,kt.prototype.has=sf,kt.prototype.set=of;var Ao=Rs(nn,"Map");function af(){this.size=0,this.__data__={hash:new rn,map:new(Ao||kt),string:new rn}}function lf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function yr(e,t){var n=e.__data__;return lf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function uf(e){var t=yr(this,e).delete(e);return this.size-=t?1:0,t}function cf(e){return yr(this,e).get(e)}function hf(e){return yr(this,e).has(e)}function df(e,t){var n=yr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Yt(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])}}Yt.prototype.clear=af,Yt.prototype.delete=uf,Yt.prototype.get=cf,Yt.prototype.has=hf,Yt.prototype.set=df;var ff="Expected a function";function bs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ff);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(bs.Cache||Yt),n}bs.Cache=Yt;var gf=500;function mf(e){var t=bs(e,function(r){return n.size===gf&&n.clear(),r}),n=t.cache;return t}var _f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pf=/\\(\\)?/g,Ef=mf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_f,function(n,r,s,i){t.push(s?i.replace(pf,"$1"):r||n)}),t});function vf(e){return e==null?"":io(e)}function To(e,t){return pn(e)?e:Hd(e,t)?[e]:Ef(vf(e))}var Cf=1/0;function No(e){if(typeof e=="string"||Cr(e))return e;var t=e+"";return t=="0"&&1/e==-Cf?"-0":t}function Rf(e,t){t=To(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[No(t[n++])];return n&&n==r?e:void 0}function If(e,t,n){var r=e==null?void 0:Rf(e,t);return r===void 0?n:r}var Mo=Ud(Object.getPrototypeOf,Object),Sf="[object Object]",yf=Function.prototype,Of=Object.prototype,Do=yf.toString,wf=Of.hasOwnProperty,bf=Do.call(Object);function Af(e){if(!_n(e)||$n(e)!=Sf)return!1;var t=Mo(e);if(t===null)return!0;var n=wf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Do.call(n)==bf}function Tf(){this.__data__=new kt,this.size=0}function Nf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Mf(e){return this.__data__.get(e)}function Df(e){return this.__data__.has(e)}var Lf=200;function Uf(e,t){var n=this.__data__;if(n instanceof kt){var r=n.__data__;if(!Ao||r.length<Lf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yt(r)}return n.set(e,t),this.size=n.size,this}function En(e){var t=this.__data__=new kt(e);this.size=t.size}En.prototype.clear=Tf,En.prototype.delete=Nf,En.prototype.get=Mf,En.prototype.has=Df,En.prototype.set=Uf;var Lo=typeof d=="object"&&d&&!d.nodeType&&d,Uo=Lo&&typeof module=="object"&&module&&!module.nodeType&&module,Pf=Uo&&Uo.exports===Lo,Po=Pf?nn.Buffer:void 0;Po&&Po.allocUnsafe;function Ff(e,t){return e.slice()}var Fo=nn.Uint8Array;function kf(e){var t=new e.constructor(e.byteLength);return new Fo(t).set(new Fo(e)),t}function $f(e,t){var n=kf(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function xf(e){return typeof e.constructor=="function"&&!_o(e)?Lh(Mo(e)):{}}function Bf(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 Hf=Bf(),As=function(){return nn.Date.now()},jf="Expected a function",Wf=Math.max,Yf=Math.min;function zf(e,t,n){var r,s,i,o,a,l,c=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(jf);t=ao(t)||0,vt(n)&&(h=!!n.leading,u="maxWait"in n,i=u?Wf(ao(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function g(T){var W=r,Z=s;return r=s=void 0,c=T,o=e.apply(Z,W),o}function v(T){return c=T,a=setTimeout(N,t),h?g(T):o}function C(T){var W=T-l,Z=T-c,fe=t-W;return u?Yf(fe,i-Z):fe}function w(T){var W=T-l,Z=T-c;return l===void 0||W>=t||W<0||u&&Z>=i}function N(){var T=As();if(w(T))return G(T);a=setTimeout(N,C(T))}function G(T){return a=void 0,f&&r?g(T):(r=s=void 0,o)}function z(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function oe(){return a===void 0?o:G(As())}function M(){var T=As(),W=w(T);if(r=arguments,s=this,l=T,W){if(a===void 0)return v(l);if(u)return clearTimeout(a),a=setTimeout(N,t),g(l)}return a===void 0&&(a=setTimeout(N,t)),o}return M.cancel=z,M.flush=oe,M}function Ts(e,t,n){(n!==void 0&&!Ir(e[t],n)||n===void 0&&!(t in e))&&Ss(e,t,n)}function Vf(e){return _n(e)&&ys(e)}function Ns(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Gf(e){return Gh(e,bo(e))}function Kf(e,t,n,r,s,i,o){var a=Ns(e,n),l=Ns(t,n),c=o.get(l);if(c){Ts(e,n,c);return}var h=i?i(a,l,n+"",e,t,o):void 0,u=h===void 0;if(u){var f=pn(l),g=!f&&Io(l),v=!f&&!g&&wo(l);h=l,f||g||v?pn(a)?h=a:Vf(a)?h=Ph(a):g?(u=!1,h=Ff(l)):v?(u=!1,h=$f(l)):h=[]:Af(l)||Os(l)?(h=a,Os(a)?h=Gf(a):(!vt(a)||vs(a))&&(h=xf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Ts(e,n,h)}function Ms(e,t,n,r,s){e!==t&&Hf(t,function(i,o){if(s||(s=new En),vt(i))Kf(e,t,o,n,Ms,r,s);else{var a=r?r(Ns(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Ts(e,o,a)}},bo)}var Xf=mo(function(e,t,n,r){Ms(e,t,n,r)}),Ds=mo(function(e,t,n){Ms(e,t,n)});function Qf(e,t,n,r){if(!vt(e))return e;t=To(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=No(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];c=void 0,c===void 0&&(c=vt(h)?h:Is(t[s+1])?[]:{})}ho(a,l,c),a=a[l]}return e}function Jf(e,t,n){return e==null?e:Qf(e,t,n)}function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ls,ko;function qf(){if(ko)return Ls;ko=1;var e=-1,t=1,n=0;function r(p,j,y,L,b){if(p===j)return p?[[n,p]]:[];if(y!=null){var O=fe(p,j,y);if(O)return O}var $=a(p,j),B=p.substring(0,$);p=p.substring($),j=j.substring($),$=c(p,j);var K=p.substring(p.length-$);p=p.substring(0,p.length-$),j=j.substring(0,j.length-$);var se=s(p,j);return B&&se.unshift([n,B]),K&&se.push([n,K]),G(se,b),L&&u(se),se}function s(p,j){var y;if(!p)return[[t,j]];if(!j)return[[e,p]];var L=p.length>j.length?p:j,b=p.length>j.length?j:p,O=L.indexOf(b);if(O!==-1)return y=[[t,L.substring(0,O)],[n,b],[t,L.substring(O+b.length)]],p.length>j.length&&(y[0][0]=y[2][0]=e),y;if(b.length===1)return[[e,p],[t,j]];var $=h(p,j);if($){var B=$[0],K=$[1],se=$[2],de=$[3],me=$[4],Ne=r(B,se),be=r(K,de);return Ne.concat([[n,me]],be)}return i(p,j)}function i(p,j){for(var y=p.length,L=j.length,b=Math.ceil((y+L)/2),O=b,$=2*b,B=new Array($),K=new Array($),se=0;se<$;se++)B[se]=-1,K[se]=-1;B[O+1]=0,K[O+1]=0;for(var de=y-L,me=de%2!==0,Ne=0,be=0,S=0,x=0,X=0;X<b;X++){for(var J=-X+Ne;J<=X-be;J+=2){var V=O+J,Y;J===-X||J!==X&&B[V-1]<B[V+1]?Y=B[V+1]:Y=B[V-1]+1;for(var ue=Y-J;Y<y&&ue<L&&p.charAt(Y)===j.charAt(ue);)Y++,ue++;if(B[V]=Y,Y>y)be+=2;else if(ue>L)Ne+=2;else if(me){var ae=O+de-J;if(ae>=0&&ae<$&&K[ae]!==-1){var H=y-K[ae];if(Y>=H)return o(p,j,Y,ue)}}}for(var ne=-X+S;ne<=X-x;ne+=2){var ae=O+ne,H;ne===-X||ne!==X&&K[ae-1]<K[ae+1]?H=K[ae+1]:H=K[ae-1]+1;for(var ie=H-ne;H<y&&ie<L&&p.charAt(y-H-1)===j.charAt(L-ie-1);)H++,ie++;if(K[ae]=H,H>y)x+=2;else if(ie>L)S+=2;else if(!me){var V=O+de-ne;if(V>=0&&V<$&&B[V]!==-1){var Y=B[V],ue=O+Y-V;if(H=y-H,Y>=H)return o(p,j,Y,ue)}}}}return[[e,p],[t,j]]}function o(p,j,y,L){var b=p.substring(0,y),O=j.substring(0,L),$=p.substring(y),B=j.substring(L),K=r(b,O),se=r($,B);return K.concat(se)}function a(p,j){if(!p||!j||p.charAt(0)!==j.charAt(0))return 0;for(var y=0,L=Math.min(p.length,j.length),b=L,O=0;y<b;)p.substring(O,b)==j.substring(O,b)?(y=b,O=y):L=b,b=Math.floor((L-y)/2+y);return z(p.charCodeAt(b-1))&&b--,b}function l(p,j){var y=p.length,L=j.length;if(y==0||L==0)return 0;y>L?p=p.substring(y-L):y<L&&(j=j.substring(0,y));var b=Math.min(y,L);if(p==j)return b;for(var O=0,$=1;;){var B=p.substring(b-$),K=j.indexOf(B);if(K==-1)return O;$+=K,(K==0||p.substring(b-$)==j.substring(0,$))&&(O=$,$++)}}function c(p,j){if(!p||!j||p.slice(-1)!==j.slice(-1))return 0;for(var y=0,L=Math.min(p.length,j.length),b=L,O=0;y<b;)p.substring(p.length-b,p.length-O)==j.substring(j.length-b,j.length-O)?(y=b,O=y):L=b,b=Math.floor((L-y)/2+y);return oe(p.charCodeAt(p.length-b))&&b--,b}function h(p,j){var y=p.length>j.length?p:j,L=p.length>j.length?j:p;if(y.length<4||L.length*2<y.length)return null;function b(be,S,x){for(var X=be.substring(x,x+Math.floor(be.length/4)),J=-1,V="",Y,ue,ae,H;(J=S.indexOf(X,J+1))!==-1;){var ne=a(be.substring(x),S.substring(J)),ie=c(be.substring(0,x),S.substring(0,J));V.length<ie+ne&&(V=S.substring(J-ie,J)+S.substring(J,J+ne),Y=be.substring(0,x-ie),ue=be.substring(x+ne),ae=S.substring(0,J-ie),H=S.substring(J+ne))}return V.length*2>=be.length?[Y,ue,ae,H,V]:null}var O=b(y,L,Math.ceil(y.length/4)),$=b(y,L,Math.ceil(y.length/2)),B;if(!O&&!$)return null;$?O?B=O[4].length>$[4].length?O:$:B=$:B=O;var K,se,de,me;p.length>j.length?(K=B[0],se=B[1],de=B[2],me=B[3]):(de=B[0],me=B[1],K=B[2],se=B[3]);var Ne=B[4];return[K,se,de,me,Ne]}function u(p){for(var j=!1,y=[],L=0,b=null,O=0,$=0,B=0,K=0,se=0;O<p.length;)p[O][0]==n?(y[L++]=O,$=K,B=se,K=0,se=0,b=p[O][1]):(p[O][0]==t?K+=p[O][1].length:se+=p[O][1].length,b&&b.length<=Math.max($,B)&&b.length<=Math.max(K,se)&&(p.splice(y[L-1],0,[e,b]),p[y[L-1]+1][0]=t,L--,L--,O=L>0?y[L-1]:-1,$=0,B=0,K=0,se=0,b=null,j=!0)),O++;for(j&&G(p),N(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],Ne=l(de,me),be=l(me,de);Ne>=be?(Ne>=de.length/2||Ne>=me.length/2)&&(p.splice(O,0,[n,me.substring(0,Ne)]),p[O-1][1]=de.substring(0,de.length-Ne),p[O+1][1]=me.substring(Ne),O++):(be>=de.length/2||be>=me.length/2)&&(p.splice(O,0,[n,de.substring(0,be)]),p[O-1][0]=t,p[O-1][1]=me.substring(0,me.length-be),p[O+1][0]=e,p[O+1][1]=de.substring(be),O++),O++}O++}}var f=/[^a-zA-Z0-9]/,g=/\s/,v=/[\r\n]/,C=/\n\r?\n$/,w=/^\r?\n\r?\n/;function N(p){function j(be,S){if(!be||!S)return 6;var x=be.charAt(be.length-1),X=S.charAt(0),J=x.match(f),V=X.match(f),Y=J&&x.match(g),ue=V&&X.match(g),ae=Y&&x.match(v),H=ue&&X.match(v),ne=ae&&be.match(C),ie=H&&S.match(w);return ne||ie?5:ae||H?4:J&&!Y&&ue?3:Y||ue?2:J||V?1:0}for(var y=1;y<p.length-1;){if(p[y-1][0]==n&&p[y+1][0]==n){var L=p[y-1][1],b=p[y][1],O=p[y+1][1],$=c(L,b);if($){var B=b.substring(b.length-$);L=L.substring(0,L.length-$),b=B+b.substring(0,b.length-$),O=B+O}for(var K=L,se=b,de=O,me=j(L,b)+j(b,O);b.charAt(0)===O.charAt(0);){L+=b.charAt(0),b=b.substring(1)+O.charAt(0),O=O.substring(1);var Ne=j(L,b)+j(b,O);Ne>=me&&(me=Ne,K=L,se=b,de=O)}p[y-1][1]!=K&&(K?p[y-1][1]=K:(p.splice(y-1,1),y--),p[y][1]=se,de?p[y+1][1]=de:(p.splice(y+1,1),y--))}y++}}function G(p,j){p.push([n,""]);for(var y=0,L=0,b=0,O="",$="",B;y<p.length;){if(y<p.length-1&&!p[y][1]){p.splice(y,1);continue}switch(p[y][0]){case t:b++,$+=p[y][1],y++;break;case e:L++,O+=p[y][1],y++;break;case n:var K=y-b-L-1;if(j){if(K>=0&&T(p[K][1])){var se=p[K][1].slice(-1);if(p[K][1]=p[K][1].slice(0,-1),O=se+O,$=se+$,!p[K][1]){p.splice(K,1),y--;var de=K-1;p[de]&&p[de][0]===t&&(b++,$=p[de][1]+$,de--),p[de]&&p[de][0]===e&&(L++,O=p[de][1]+O,de--),K=de}}if(M(p[y][1])){var se=p[y][1].charAt(0);p[y][1]=p[y][1].slice(1),O+=se,$+=se}}if(y<p.length-1&&!p[y][1]){p.splice(y,1);break}if(O.length>0||$.length>0){O.length>0&&$.length>0&&(B=a($,O),B!==0&&(K>=0?p[K][1]+=$.substring(0,B):(p.splice(0,0,[n,$.substring(0,B)]),y++),$=$.substring(B),O=O.substring(B)),B=c($,O),B!==0&&(p[y][1]=$.substring($.length-B)+p[y][1],$=$.substring(0,$.length-B),O=O.substring(0,O.length-B)));var me=b+L;O.length===0&&$.length===0?(p.splice(y-me,me),y=y-me):O.length===0?(p.splice(y-me,me,[t,$]),y=y-me+1):$.length===0?(p.splice(y-me,me,[e,O]),y=y-me+1):(p.splice(y-me,me,[e,O],[t,$]),y=y-me+2)}y!==0&&p[y-1][0]===n?(p[y-1][1]+=p[y][1],p.splice(y,1)):y++,b=0,L=0,O="",$="";break}}p[p.length-1][1]===""&&p.pop();var Ne=!1;for(y=1;y<p.length-1;)p[y-1][0]===n&&p[y+1][0]===n&&(p[y][1].substring(p[y][1].length-p[y-1][1].length)===p[y-1][1]?(p[y][1]=p[y-1][1]+p[y][1].substring(0,p[y][1].length-p[y-1][1].length),p[y+1][1]=p[y-1][1]+p[y+1][1],p.splice(y-1,1),Ne=!0):p[y][1].substring(0,p[y+1][1].length)==p[y+1][1]&&(p[y-1][1]+=p[y+1][1],p[y][1]=p[y][1].substring(p[y+1][1].length)+p[y+1][1],p.splice(y+1,1),Ne=!0)),y++;Ne&&G(p,j)}function z(p){return p>=55296&&p<=56319}function oe(p){return p>=56320&&p<=57343}function M(p){return oe(p.charCodeAt(0))}function T(p){return z(p.charCodeAt(p.length-1))}function W(p){for(var j=[],y=0;y<p.length;y++)p[y][1].length>0&&j.push(p[y]);return j}function Z(p,j,y,L){return T(p)||M(L)?null:W([[n,p],[e,j],[t,y],[n,L]])}function fe(p,j,y){var L=typeof y=="number"?{index:y,length:0}:y.oldRange,b=typeof y=="number"?null:y.newRange,O=p.length,$=j.length;if(L.length===0&&(b===null||b.length===0)){var B=L.index,K=p.slice(0,B),se=p.slice(B),de=b?b.index:null;e:{var me=B+$-O;if(de!==null&&de!==me||me<0||me>$)break e;var Ne=j.slice(0,me),be=j.slice(me);if(be!==se)break e;var S=Math.min(B,me),x=K.slice(0,S),X=Ne.slice(0,S);if(x!==X)break e;var J=K.slice(S),V=Ne.slice(S);return Z(x,J,V,se)}e:{if(de!==null&&de!==B)break e;var Y=B,Ne=j.slice(0,Y),be=j.slice(Y);if(Ne!==K)break e;var ue=Math.min(O-Y,$-Y),ae=se.slice(se.length-ue),H=be.slice(be.length-ue);if(ae!==H)break e;var J=se.slice(0,se.length-ue),V=be.slice(0,be.length-ue);return Z(K,J,V,ae)}}if(L.length>0&&b&&b.length===0)e:{var x=p.slice(0,L.index),ae=p.slice(L.index+L.length),S=x.length,ue=ae.length;if($<S+ue)break e;var X=j.slice(0,S),H=j.slice($-ue);if(x!==X||ae!==H)break e;var J=p.slice(S,O-ue),V=j.slice(S,$-ue);return Z(x,J,V,ae)}return null}function le(p,j,y,L){return r(p,j,y,L,!0)}return le.INSERT=t,le.DELETE=e,le.EQUAL=n,Ls=le,Ls}var Zf=qf();const $o=Ct(Zf);function Hn(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function eg(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function tg(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function ng(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function rg(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 sg(e){return Array.isArray(e)?e:[e]}function ig(e){return["true","false"].includes(e.toLowerCase())}const jn="__INTERNAL_EDITOR__",Us=`${jn}DOCS_NORMAL`,Ps=`${jn}DOCS_FORMULA_BAR`,xo=`${jn}ZEN_EDITOR`,Bo=`\r
|
|
2
|
+
`,og="isRowStylePrecedeColumnStyle";function ag(e){return`${jn}${e}`}function Ho(e){return e.startsWith(jn)}var Fs=Symbol("$$IDENTIFIER_DECORATOR");function lg(e){return e&&e[Fs]===!0}function ks(e){return typeof e=="function"}function $s(e){return!!(e&&typeof e.useClass<"u")}function xs(e){return!!(e&&typeof e.useFactory<"u")}function Bs(e){return!!(e&&typeof e.useValue<"u")}function ug(e){return!!(e&&typeof e.useExisting<"u")}function Hs(e){return!!(e&&typeof e.useAsync<"u")}var jo=Symbol("AsyncHook");function Or(e){return!!(e&&e.__symbol===jo)}function Et(e){return typeof e>"u"?"undefined":ks(e)&&!e[Fs]?e.name:e.toString()}var cg=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)}}(),it=function(e){cg(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 Wo=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)}}(),Yo=Symbol("$$TARGET"),js=Symbol("$$DEPENDENCIES"),hg=function(e){Wo(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(Et(r),'".');return e.call(this,s)||this}return t}(it),zo=function(e){Wo(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Et(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(it);function Vo(e){var t=e;return t[js]||[]}function Ws(e,t){var n=Vo(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new hg(t,e);return r}function Ys(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 zo(e,n);var o=e;o[Yo]===o?o[js].push(i):(o[js]=[i],o[Yo]=o)}var Go=new Set;function mt(e){if(Go.has(e))throw new it('Identifier "'.concat(e,'" already exists.'));Go.add(e);var t=function(n,r,s){Ys(n,t,s)};return t.toString=function(){return e},t[Fs]=!0,t}function dg(e,t,n){var r=Ws(e,t);r.lookUp=n}function Ko(e){return function t(){return this instanceof t?this:function(n,r,s){dg(n,s,e)}}}var Xo=Ko(d.LookUp.SKIP_SELF),Qo=Ko(d.LookUp.SELF),fg=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)}}(),zs=function(e){fg(t,e);function t(n,r,s){var i=this,o='Expect "'.concat(r,'" dependency items for id "').concat(Et(n),'" but get ').concat(s,".");return s===0&&(o+=" Did you forget to register it?"),s>1&&(o+=" You register it more than once."),i=e.call(this,o)||this,i.quantity=r,i.actual=s,i}return t}(it);function Vs(e,t,n){if(t===d.Quantity.OPTIONAL&&n>1||t===d.Quantity.REQUIRED&&n!==1)throw new zs(e,t,n)}function gg(e,t){return e===d.Quantity.MANY?t:t[0]}function mg(e,t,n){var r=Ws(e,t);r.quantity=n}function Gs(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)Ys(r,n,i,e);else{if(e===d.Quantity.REQUIRED)throw new zo(r,i);mg(r,i,e)}}}}var Jo=Gs(d.Quantity.MANY),qo=Gs(d.Quantity.OPTIONAL),at=Gs(d.Quantity.REQUIRED);function _g(e,t,n){var r=Ws(e,t);r.withNew=n}function pg(e){return function t(){return this instanceof t?this:function(n,r,s){_g(n,s,e)}}}var Zo=pg(!0);function ea(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(c){if(c instanceof Qo)o=d.LookUp.SELF;else if(c instanceof Xo)o=d.LookUp.SKIP_SELF;else if(c instanceof qo)a=d.Quantity.OPTIONAL;else if(c instanceof Jo)a=d.Quantity.MANY;else if(c instanceof Zo)l=!0;else throw new it("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}function Eg(e,t,n){n===void 0&&(n=0);var r=ea(t,n);r.forEach(function(s){Ys(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}function vg(e){return{unwrap:e}}function Cg(e){return!!e&&typeof e.unwrap=="function"}function Rg(e){return Cg(e)?e.unwrap():e}function Ks(e){return!!e&&typeof e.dispose=="function"}var ta=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 Ig(e){return e.length===1}var wr=[];function na(e){wr.push(e)}function ra(){wr.pop()}function Sg(){wr.length=0}var sa=function(e){ta(t,e);function t(n,r,s){var i='Cannot find "'.concat(Et(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(lg(n)?Et(n):n.name,'".');return e.call(this,i)||this}return t}(it),br=function(e){ta(t,e);function t(n){var r=this,s='Cannot find "'.concat(Et(n),'" registered by any injector. The stack of dependencies is: "').concat(wr.map(function(i){return Et(i)}).join(" -> "),'".');return r=e.call(this,s)||this,Sg(),r}return t}(it),yg=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 Vs(t,n,r.length),gg(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 Ig(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),Og=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 Ks(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 br(t);return Vs(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 Ks(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}(),Xs;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")Xs=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}});Xs=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var wg=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=Xs(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}(),vn=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)}}(),Ar=function(){return Ar=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},Ar.apply(this,arguments)},sn=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))},bg=300,Tr=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Ag=function(e){vn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Et(n),'".'))||this}return t}(it),Tg=function(e){vn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(it),Ng=function(e){vn(t,e);function t(n){return e.call(this,'Async item "'.concat(Et(n),'" returns another async item.'))||this}return t}(it),Mg=function(e){vn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(Et(n),'" from sync api.'))||this}return t}(it),ia=function(e){vn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(it),Dg=function(e){vn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(it),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 yg(t||[]),this.resolvedDependencyCollection=new Og,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 ia(n);typeof r>"u"?this.dependencyCollection.add(n):Hs(r)||$s(r)||Bs(r)||xs(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new ia(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 Dg(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,sn([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 Or(i)})||Or(s))throw new Mg(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!==Tr)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!==Tr)return Promise.resolve(n);var r=this.createDependency(t,d.Quantity.REQUIRED);return Or(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,sn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;na(t);try{Bs(n)?s=this._resolveValueDependency(t,n):xs(n)?s=this._resolveFactory(t,n,r):$s(n)?s=this._resolveClass(t,n,r):ug(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),ra()}catch(i){throw ra(),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 wg(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 c=o.getValue(),h=c[l];return typeof h!="function"||(h=h.bind(c),a[l]=h),h}},set:function(a,l,c){return o.getValue()[l]=c,!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=Vo(i).sort(function(w,N){return w.paramIndex-N.paramIndex}).map(function(w){return Ar(Ar({},w),{identifier:Rg(w.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var h=c[l];try{var u=this._get(h.identifier,h.quantity,h.lookUp,h.withNew);a.push(u)}catch(w){throw w instanceof br||w instanceof zs&&w.actual===0?new sa(i,h.identifier,h.paramIndex):w}}var f=sn([],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(Et(i)," but get ").concat(f.length,"."));var v=g-f.length;v>0?f=sn(sn([],f,!0),Array.from({length:v}).fill(void 0),!0):f=f.slice(0,g)}var C=new(i.bind.apply(i,sn(sn([void 0],f,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,C),this.markResolutionCompleted(),C},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=ea(n.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var h=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(h)}catch(f){throw f instanceof br||f instanceof zs&&f.actual===0?new sa(t,c.identifier,c.paramIndex):f}}var u=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,u),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,u),u},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:jo,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!==Tr)return i;var o;if(Array.isArray(s)){var a=s[1];if(Hs(a))throw new Ng(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)?Tr:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):(Vs(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),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(t,h,s)}):l&&(c=i._resolveDependency(t,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===d.Quantity.OPTIONAL)return null;throw na(t),new br(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>=bg)throw new Ag(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Tg},e}(),oa=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,aa="REDI_GLOBAL_LOCK",Lg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;oa[aa]?Lg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
|
|
3
3
|
Maybe your dependencies added redi as its dependency and bundled redi to its dist files. Or you import different versions of redi.
|
|
4
|
-
For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):
|
|
4
|
+
For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):oa[aa]=!0;var la="REDI_CONTEXT_LOCK",Ug=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]?Ug||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 Wn=Ot.createContext({injector:null});Wn.displayName="RediContext";var Qs=Wn.Provider,ca=Wn.Consumer,Nr=function(){return Nr=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},Nr.apply(this,arguments)};function Pg(e){var t=e.children,n=e.dependencies,r=Ot.useRef(null);return Ot.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),Ot.createElement(ca,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(n):new Rt(n),r.current=i),Ot.createElement(Qs,{value:{injector:i}},t)})}function Fg(e,t){return function(r){return Ot.createElement(Qs,{value:{injector:t}},Ot.createElement(e,Nr({},r)))}}function kg(e,t){return function(r){return Ot.createElement(Pg,{dependencies:t},Ot.createElement(e,Nr({},r)))}}var $g=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)}}(),xg=function(e){$g(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}(it);function Bg(e,t,n){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new xg(r);var i=s.injector,o=i.get(e,t||d.Quantity.REQUIRED,n);return o}}}}var Hg=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)}}(),jg=function(e){Hg(t,e);function t(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return t}(it);function ha(){var e=Ot.useContext(Wn);if(!e.injector)throw new jg;return e.injector}function Wg(e,t,n){var r=ha();return Ot.useMemo(function(){return r.get(e,t,n)},[e,t,n])}var Yg=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 da(e,t){var n=e instanceof Ce.BehaviorSubject&&typeof t>"u"?e.getValue():t,r=ot.useState(n),s=r[0],i=r[1];return ot.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function fa(e){return typeof e=="function"?e():e}function zg(e,t,n,r){if(typeof e=="function"&&!r)throw new it("Expected deps to be provided when observable is a function!");var s=ot.useRef(null),i=ot.useRef(!1),o=ot.useMemo(function(){return e},Yg([],typeof r<"u"?r:[e],!0)),a=ot.useState(0);a[0];var l=a[1],c=ot.useRef(function(){var h;if(o){var u=fa(o).subscribe(function(f){i.current=!0,h=f});u.unsubscribe()}return h!=null?h:t}());if(ot.useEffect(function(){var h=null;return o&&(s.current=fa(o),h=s.current.subscribe(function(u){c.current=u,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 c.current}function Vg(e){var t=ot.useState(0),n=t[1];ot.useEffect(function(){var r=e.subscribe(function(){return n(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var Js=new WeakMap;function Gg(e,t){var n=ot.useRef(void 0),r=da(e,t),s=ot.useMemo(function(){return ot.createContext(r)},[e]),i=ot.useCallback(function(o){return ot.createElement(s.Provider,{value:r},o.children)},[e,r]);return n.current!==e&&(n.current&&Js.delete(n.current),n.current=e,Js.set(e,s)),{Provider:i,value:r}}function Kg(e){var t=Js.get(e);if(!t)throw new it("try to read context value but no ancestor component subscribed it.");return ot.useContext(t)}function Xg(e,t){t.forEach(n=>e.add(n))}function ga(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function ma(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 qs extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}function Qg(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 Cn=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(Cn||{});function Jg(e){return`sheet_interceptor_${e}`}const _a=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 qg{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)),_a(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)})),()=>Hn(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function Zg(e){return`sheet_async_interceptor_${e}`}const em=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 tm{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)),em(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)})),()=>Hn(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class Rn{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function nm(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}async function pa(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 Ea(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 va(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 Ca(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function Ra(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Yn(e){return typeof e=="function"}function rm(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 Zs=rm(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
5
5
|
`+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
|
|
6
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function fa(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ga=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=ca(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(C){t={error:C}}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(Yn(h))try{h()}catch(C){i=C instanceof Ks?C.errors:[C]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var f=ca(u),g=f.next();!g.done;g=f.next()){var v=g.value;try{ma(v)}catch(C){i=i!=null?i:[],C instanceof Ks?i=da(da([],ha(i)),ha(C.errors)):i.push(C)}}}catch(C){r={error:C}}finally{try{g&&!g.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(i)throw new Ks(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ma(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)&&fa(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&fa(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();ga.EMPTY;function Zg(e){return e instanceof ga||e&&"closed"in e&&Yn(e.remove)&&Yn(e.add)&&Yn(e.unsubscribe)}function ma(e){Yn(e)?e():e.unsubscribe()}function Qe(e){let t=!1;return e?Zg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Qe(()=>{})}function em(e){return Qe(()=>{e.unsubscribe()})}class Mr{constructor(){R(this,"_disposables",new Set)}add(t){const n=Qe(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class rt{constructor(){R(this,"_disposed",!1);R(this,"_collection",new Mr)}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 tm extends rt{constructor(){super(...arguments);R(this,"dispose$",new Ce.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class nm extends rt{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 zn=mt("univer.context-service");class _a extends rt{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 pa=(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))(pa||{});const wt=mt("univer.log");class Ea extends rt{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 rm=Object.defineProperty,sm=Object.getOwnPropertyDescriptor,im=(e,t,n,r)=>{for(var s=r>1?void 0:r?sm(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&&rm(t,n,s),s},va=(e,t)=>(n,r)=>t(n,r,e),Vn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(Vn||{});const Mt=mt("anywhere.command-service");class om{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),Qe(()=>{this._commands.delete(t.id),this._commandTypes.delete(t.id)})}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const Ca={id:"nil",type:0,handler:()=>!0};d.CommandService=class extends rt{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 om,this._registerCommand(Ca)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._registerCommand(n)}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),Qe(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),Qe(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(h=>h(a,s));const c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(h=>h(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof Gs)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 u=Qf(this._commandExecutionStack,f=>f.type===0);u&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=u.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(u=>u(l,s));const h=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(u=>u(l,s)),c.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof Gs)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Qe(()=>Hn(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 Mr;s=new am(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Qe(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Qe(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}},d.CommandService=im([va(0,lt(Rt)),va(1,wt)],d.CommandService);class am{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(zn),i=t.get(Rt);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Qe(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function Xs(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return ua(r)}function lm(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return la(r)}function Ra(e){return new Ce.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Ia(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 um(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 cm(e){const t=new Ce.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(Ce.take(1))}const hm=e=>new Promise(t=>{Ce.merge(Ra(e.onCommandExecuted.bind(e)).pipe(kt.filter(([n])=>n.type===Vn.MUTATION)),Ce.timer(300)).pipe(kt.debounceTime(16),kt.first()).subscribe(()=>{t()})});function Sa(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 dm(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 Oa(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 fm(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=Sa(e,t):r=Oa(e,t),n){const s=e[r];return e.indexOf(s)}return r}function gm(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const Gn=2,ya=1;function mm(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:c=0,width:h=0,angle:u=0}=e,f=h,g=c,v=i,C=s;return Math.abs(a-n)>Gn||Math.abs(l-r)>Gn||Math.abs(f-v)>Gn||Math.abs(g-C)>Gn||Math.abs(u-o)>ya}var wa=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(wa||{}),Xe=(e=>(e[e.NONE=0]="NONE",e[e.THIN=1]="THIN",e[e.HAIR=2]="HAIR",e[e.DOTTED=3]="DOTTED",e[e.DASHED=4]="DASHED",e[e.DASH_DOT=5]="DASH_DOT",e[e.DASH_DOT_DOT=6]="DASH_DOT_DOT",e[e.DOUBLE=7]="DOUBLE",e[e.MEDIUM=8]="MEDIUM",e[e.MEDIUM_DASHED=9]="MEDIUM_DASHED",e[e.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",e[e.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",e[e.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",e[e.THICK=13]="THICK",e))(Xe||{}),ba=(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))(ba||{}),It=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(It||{}),Aa=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Aa||{}),Ta=(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))(Ta||{}),Na=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Na||{}),Ma=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Ma||{}),Da=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Da||{}),La=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(La||{});function _m(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Ua=(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))(Ua||{}),Kn=(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))(Kn||{}),Dr=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(Dr||{}),Pa=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Pa||{}),Fa=(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))(Fa||{}),ka=(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))(ka||{}),$a=(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))($a||{}),xa=(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))(xa||{}),Ba=(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))(Ba||{}),Ha=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(Ha||{}),Xn=(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))(Xn||{}),ja=(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))(ja||{}),Vt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT",e[e.JUSTIFIED=4]="JUSTIFIED",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTED=6]="DISTRIBUTED",e))(Vt||{}),an=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(an||{}),ln=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(ln||{}),Lr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Lr||{}),Ur=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Ur||{}),xt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(xt||{}),Ue=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Ue||{}),Gt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Gt||{}),ht=(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))(ht||{}),Pr=(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))(Pr||{});const pm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Em=e=>crypto.getRandomValues(new Uint8Array(e)),vm=(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}}},Cm=(e,t=21)=>vm(e,t|0,Em),Rm=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=pm[n[e]&63];return t};const Wa=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"]),Im=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 Sm(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Im.test(e)){if(Ya(e))return!0;try{const r=new URL(za(e)).hostname.split(".").pop();if(r&&Wa.has(r))return!0}catch{return!1}}return!1}function Ya(e){return/^[a-zA-Z]+:\/\//.test(e)}function Om(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function za(e){return Ya(e)?e:Om(e)?`mailto://${e}`:`https://${e}`}const ym=/^-ms-/,wm=/-([a-z])/g,Kt=["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 Qs(e,t){const n=he.getValueType(e),r=he.getValueType(t);return n!==r?!1:he.isArray(e)?bm(e,t):he.isObject(e)?Am(e,t):he.isDate(e)?e.getTime()===t.getTime():he.isRegExp(e)?e.toString()===t.toString():e===t}function bm(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(!Qs(s,i))return!1}return!0}function Am(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(!Qs(i,o))return!1}return!0}class he{static stringAt(t){let n="",r=t;for(;r>=Kt.length;)r/=Kt.length,r-=1,n+=Kt[r%Kt.length];const s=t%Kt.length;return n+=Kt[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+=Kt.length**i+Kt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return he.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 un(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,c)=>{var h,u;if(he.isArray(l)){const f=(h=a[c])!=null?h:[];a[c]=f,r(l,f);return}if(he.isObject(l)){const f=(u=a[c])!=null?u:{};a[c]=f,s(l,f);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(he.isObject(c)){const f=(h=a[l])!=null?h:{};a[l]=f,s(c,f);return}if(he.isArray(c)){const f=(u=a[l])!=null?u:[];a[l]=f,r(c,f);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(he.isArray(l)){const u=(c=t[a])!=null?c:[];t[a]=u,r(l,u);return}if(he.isObject(l)){const u=(h=t[a])!=null?h:{};t[a]=u,s(l,u);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return Qs(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]=he.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=he.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 Sm(t)}static normalizeUrl(t){return za(t)}static topLevelDomainCombiningString(){return[...Wa].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return he.isDefine(t)?he.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(ym,"ms-").replace(wm,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:he.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 un(e=21,t){return t?Cm(t,e)():Rm(e)}function Js(...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 Tm=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Fr(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;he.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(qs(r,{...a,ed:Math.min(c,n)}))):o.push(qs(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function Nm(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:c={}}=a,{spaceAbove:h,spaceBelow:u,lineSpacing:f}=c,g=[];h!=null&&(typeof h=="number"?g.push(`margin-top: ${h}px`):g.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?g.push(`margin-bottom: ${u}px`):g.push(`margin-bottom: ${u.v}px`)),f!=null&&g.push(`line-height: ${f}`),l>o+1?i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}>${Fr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Fr(e,o,r.length)),i}else return Fr(e,0,e.dataStream.length)}function qs(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:f,cl:g,va:v}=s;let C=e.slice(n,r);const w=[];return a===Ue.TRUE&&(C=`<i>${C}</i>`),v===xt.SUPERSCRIPT?C=`<sup>${C}</sup>`:v===xt.SUBSCRIPT&&(C=`<sub>${C}</sub>`),(c==null?void 0:c.s)===Ue.TRUE&&(C=`<u>${C}</u>`),(h==null?void 0:h.s)===Ue.TRUE&&(C=`<s>${C}</s>`),l===Ue.TRUE&&(C=`<strong>${C}</strong>`),i&&w.push(`font-family: ${i}`),g&&w.push(`color: ${g.rgb}`),o&&w.push(`font-size: ${o}pt`),u&&w.push("text-decoration: overline"),f&&w.push(`background: ${f.rgb}`),w.length?`<span style="${w.join("; ")};">${C}</span>`:C}const Va={[Pr.OFFICE]:{[ht.ACCENT1]:"#4472C4",[ht.ACCENT2]:"#ED7D31",[ht.ACCENT3]:"#A5A5A5",[ht.ACCENT4]:"#70AD47",[ht.ACCENT5]:"#5B9BD5",[ht.ACCENT6]:"#70AD47",[ht.DARK1]:"#000000",[ht.DARK2]:"#44546A",[ht.LIGHT1]:"#FFFFFF",[ht.LIGHT2]:"#E7E6E6",[ht.HYPERLINK]:"#0563C1",[ht.FOLLOWED_HYPERLINK]:"#954F72"}};class kr{constructor(){R(this,"_themeValue",ht.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=It.UNSUPPORTED,this._themeColors=Pr.OFFICE,this._themeTint=0}asRgbColor(){return new $r(this._rgbValue,this)}asThemeColor(){return new xr(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 cn{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 kr().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 cn(this._builder)}equals(t){return!1}}class Ga{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 kr;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,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*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 cn{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 cn.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 $r=St;const en=class en extends cn{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=Va[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(en._cacheThemeColor.has(this._themeColors)){if(s=en._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,en._cacheThemeColor.set(this._themeColors,s);const i=new Ga(cn.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 en(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof en?n._themeColorType===this._themeColorType:!1}getColorType(){return It.THEME}getThemeColorType(){return this._themeColorType}};R(en,"_cacheThemeColor",new Map);let xr=en;const Mm="rgb(",Dm="rgba(",Zs={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class bt{constructor(t){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof bt){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=Ka(t);if(n==null){this._setNullColor();return}this._color=n;const r=km(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var c,h;r=Math.min(1,Math.max(0,r));const s=new bt(t).toRgb(),i=new bt(n).toRgb(),o=(c=s.a)!=null?c:1,a=(h=i.a)!=null?h:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new bt(l)}static getContrastRatio(t,n){const r=new bt(t).getLuminance(),s=new bt(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Br(Math.round(n).toString(16)),Br(Math.round(r).toString(16)),Br(Math.round(s).toString(16)),Br(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return Hm(this.toRgb())}toHsl(){return Bm(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}setAlpha(t){return new bt({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=ei(t),n=ei(n),r=ei(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Br=e=>e.length===1?`0${e}`:e,ei=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Ka=e=>{if(Wm(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(Zs[t]){const n=Zs[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 Lm(t);if(t.startsWith("rgb"))return Um(t);if(t.startsWith("hsl"))return Pm(t);if(t.startsWith("hsv"))return Fm(t)},Lm=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},Um=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},Pm=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},Fm=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},km=e=>{const t=Ka(e);if(t!=null)return"r"in t?t:"l"in t?$m(t):xm(t)},ti=(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),$m=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,c=2*r-l;s=ti(c,l,t+1/3),i=ti(c,l,t),o=ti(c,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},xm=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),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],f=[o,o,l,r,r,a][c],g={r:h*255,g:u*255,b:f*255};return e.a!==void 0&&(g.a=e.a),g},Bm=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 c={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(c.a=e.a),c},Hm=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,c=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(c*100),v:Math.round(a*100)};return e.a!==void 0&&(h.a=e.a),h},jm=e=>e==null,Wm=e=>!jm(e)&&typeof e=="object";function Ym(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 zm(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 Vm(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 Gm(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Gt.STRING;if(typeof e.v=="number")return Gt.NUMBER;if(typeof e.v=="boolean")return Gt.BOOLEAN}function Km(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,s:i,custom:o}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||o!=null)}function Xm(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var De=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(De||{}),et=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(et||{});function Qm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var Xa=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(Xa||{}),Qa=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Qa||{});function Jm(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 c=0;c<n.length;c++){const{startRow:h,endRow:u,startColumn:f,endColumn:g}=n[c];if(e===h&&t===f){i=u,o=g,a=h,l=f,s=!0;break}if(e>=h&&e<=u&&t>=f&&t<=g){i=u,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 On=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(On||{});function Ja(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=t,u=n,f=t,g=n;if(r&&i){const{startRow:v,startColumn:C,endRow:w,endColumn:N,startY:G,endY:z,startX:oe,endX:M}=i;h=v,u=C,f=w,g=N,o=G,a=z,l=oe,c=M}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,f=i.endRow,g=i.endColumn),{startRow:h,startColumn:u,endRow:f,endColumn:g,startY:o,endY:a,startX:l,endX:c}}const qm=Ja;function Zm(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,h=n,u=t,f=n;return(r||s)&&(c=i,h=o,u=a,f=l),{startRow:c,startColumn:h,endRow:u,endColumn:f}}function qa(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function e_(e){return qa(e)&&(e==null?void 0:e.coverable)!==!1}function Dt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new kr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function t_(e){return he.isString(e)&&e.substring(0,1)==="="&&e.length>1}function n_(e){return he.isString(e)&&e.length>0}function r_(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: ${Dt(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: ${Dt(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: ${Dt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Dt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,f,g,v,C,w,N;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Hr((a=e.bd)==null?void 0:a.b.s)} ${(l=Dt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Hr((h=e.bd)==null?void 0:h.t.s)} ${(u=Dt(e.bd.t.cl))!=null?u:""}; `),(f=e.bd)!=null&&f.r&&(n+=`border-right: ${Hr((g=e.bd)==null?void 0:g.r.s)} ${(v=Dt(e.bd.r.cl))!=null?v:""}; `),(C=e.bd)!=null&&C.l&&(n+=`border-left: ${Hr((w=e.bd)==null?void 0:w.l.s)} ${(N=Dt(e.bd.l.cl))!=null?N:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Dt(e.cl)}; `)}],["va",()=>{e.va===xt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===xt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Xn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Xn.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===Vt.LEFT?n+="text-align: left; ":e.ht===Vt.RIGHT?n+="text-align: right; ":e.ht===Vt.CENTER?n+="text-align: center; ":e.ht===Vt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===an.BOTTOM?n+="vertical-align: bottom; ":e.vt===an.TOP?n+="vertical-align: top; ":e.vt===an.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===ln.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===ln.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,u,f,g,v,C,w,N;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(f=e.pd)==null?void 0:f.l}pt`,c=`${(g=e.pd)==null?void 0:g.r}pt`;(v=e.pd)!=null&&v.b&&(n+=`padding-bottom: ${o}; `),(C=e.pd)!=null&&C.t&&(n+=`padding-top: ${a}; `),(w=e.pd)!=null&&w.l&&(n+=`padding-left: ${l}; `),(N=e.pd)!=null&&N.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Hr(e){let t="";return e===Xe.NONE?t="none":e===Xe.THIN?t="0.5pt solid":e===Xe.HAIR?t="0.5pt double":e===Xe.DOTTED?t="0.5pt dotted":e===Xe.DASHED||e===Xe.DASH_DOT?t="0.5pt dashed":e===Xe.DASH_DOT_DOT?t="0.5pt dotted":e===Xe.DOUBLE?t="0.5pt double":e===Xe.MEDIUM?t="1pt solid":e===Xe.MEDIUM_DASHED||e===Xe.MEDIUM_DASH_DOT?t="1pt dashed":e===Xe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Xe.SLANT_DASH_DOT?t="0.5pt dashed":e===Xe.THICK&&(t="1.5pt solid"),t}function s_(e){let t=0;if(e=e.trim(),e==="none")t=Xe.NONE;else if(e==="0.5pt solid")t=Xe.THIN;else if(e==="0.5pt double")t=Xe.HAIR;else if(e==="0.5pt dotted")t=Xe.DOTTED;else if(e==="0.5pt dashed")t=Xe.DASHED;else if(e==="1pt solid")t=Xe.MEDIUM;else if(e==="1pt dashed")t=Xe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Xe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Xe.THICK;else if(!e.includes("none"))t=Xe.THIN;else return Xe.NONE;return t}function i_(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 o_(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===De.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===De.ROW||o!==De.ROW&&o!==De.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 a_(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function ni(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=>ni(e[n],t[n])):e===t:!1}function Za(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:ni(n,r)}function l_(e,t){return t.some(n=>e.indexOf(n)>-1)}var jr={exports:{}},u_=jr.exports,el;function c_(){return el||(el=1,function(e,t){(function(n,r){e.exports=r()})(u_,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",f="quarter",g="year",v="date",C="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|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,G={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(L){var b=["th","st","nd","rd"],y=L%100;return"["+L+(b[(y-20)%10]||b[y]||b[0])+"]"}},z=function(L,b,y){var $=String(L);return!$||$.length>=b?L:""+Array(b+1-$.length).join(y)+L},oe={s:z,z:function(L){var b=-L.utcOffset(),y=Math.abs(b),$=Math.floor(y/60),B=y%60;return(b<=0?"+":"-")+z($,2,"0")+":"+z(B,2,"0")},m:function L(b,y){if(b.date()<y.date())return-L(y,b);var $=12*(y.year()-b.year())+(y.month()-b.month()),B=b.clone().add($,u),K=y-B<0,se=b.clone().add($+(K?-1:1),u);return+(-($+(y-B)/(K?B-se:se-B))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:g,w:h,d:c,D:v,h:l,m:a,s:o,ms:i,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},M="en",T={};T[M]=G;var W="$isDayjsObject",Z=function(L){return L instanceof j||!(!L||!L[W])},fe=function L(b,y,$){var B;if(!b)return M;if(typeof b=="string"){var K=b.toLowerCase();T[K]&&(B=K),y&&(T[K]=y,B=K);var se=b.split("-");if(!B&&se.length>1)return L(se[0])}else{var de=b.name;T[de]=b,B=de}return!$&&B&&(M=B),B||!$&&M},le=function(L,b){if(Z(L))return L.clone();var y=typeof b=="object"?b:{};return y.date=L,y.args=arguments,new j(y)},p=oe;p.l=fe,p.i=Z,p.w=function(L,b){return le(L,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var j=function(){function L(y){this.$L=fe(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[W]=!0}var b=L.prototype;return b.parse=function(y){this.$d=function($){var B=$.date,K=$.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 se=B.match(w);if(se){var de=se[2]-1||0,me=(se[7]||"0").substring(0,3);return K?new Date(Date.UTC(se[1],de,se[3]||1,se[4]||0,se[5]||0,se[6]||0,me)):new Date(se[1],de,se[3]||1,se[4]||0,se[5]||0,se[6]||0,me)}}return new Date(B)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return p},b.isValid=function(){return this.$d.toString()!==C},b.isSame=function(y,$){var B=le(y);return this.startOf($)<=B&&B<=this.endOf($)},b.isAfter=function(y,$){return le(y)<this.startOf($)},b.isBefore=function(y,$){return this.endOf($)<le(y)},b.$g=function(y,$,B){return p.u(y)?this[$]:this.set(B,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,$){var B=this,K=!!p.u($)||$,se=p.p(y),de=function(V,Y){var ue=p.w(B.$u?Date.UTC(B.$y,Y,V):new Date(B.$y,Y,V),B);return K?ue:ue.endOf(c)},me=function(V,Y){return p.w(B.toDate()[V].apply(B.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(Y)),B)},Ne=this.$W,be=this.$M,S=this.$D,x="set"+(this.$u?"UTC":"");switch(se){case g:return K?de(1,0):de(31,11);case u:return K?de(1,be):de(0,be+1);case h:var X=this.$locale().weekStart||0,Q=(Ne<X?Ne+7:Ne)-X;return de(K?S-Q:S+(6-Q),be);case c:case v: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()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,$){var B,K=p.p(y),se="set"+(this.$u?"UTC":""),de=(B={},B[c]=se+"Date",B[v]=se+"Date",B[u]=se+"Month",B[g]=se+"FullYear",B[l]=se+"Hours",B[a]=se+"Minutes",B[o]=se+"Seconds",B[i]=se+"Milliseconds",B)[K],me=K===c?this.$D+($-this.$W):$;if(K===u||K===g){var Ne=this.clone().set(v,1);Ne.$d[de](me),Ne.init(),this.$d=Ne.set(v,Math.min(this.$D,Ne.daysInMonth())).$d}else de&&this.$d[de](me);return this.init(),this},b.set=function(y,$){return this.clone().$set(y,$)},b.get=function(y){return this[p.p(y)]()},b.add=function(y,$){var B,K=this;y=Number(y);var se=p.p($),de=function(be){var S=le(K);return p.w(S.date(S.date()+Math.round(be*y)),K)};if(se===u)return this.set(u,this.$M+y);if(se===g)return this.set(g,this.$y+y);if(se===c)return de(1);if(se===h)return de(7);var me=(B={},B[a]=r,B[l]=s,B[o]=n,B)[se]||1,Ne=this.$d.getTime()+y*me;return p.w(Ne,this)},b.subtract=function(y,$){return this.add(-1*y,$)},b.format=function(y){var $=this,B=this.$locale();if(!this.isValid())return B.invalidDate||C;var K=y||"YYYY-MM-DDTHH:mm:ssZ",se=p.z(this),de=this.$H,me=this.$m,Ne=this.$M,be=B.weekdays,S=B.months,x=B.meridiem,X=function(Y,ue,ae,H){return Y&&(Y[ue]||Y($,K))||ae[ue].slice(0,H)},Q=function(Y){return p.s(de%12||12,Y,"0")},V=x||function(Y,ue,ae){var H=Y<12?"AM":"PM";return ae?H.toLowerCase():H};return K.replace(N,function(Y,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 Ne+1;case"MM":return p.s(Ne+1,2,"0");case"MMM":return X(B.monthsShort,Ne,S,3);case"MMMM":return X(S,Ne);case"D":return $.$D;case"DD":return p.s($.$D,2,"0");case"d":return String($.$W);case"dd":return X(B.weekdaysMin,$.$W,be,2);case"ddd":return X(B.weekdaysShort,$.$W,be,3);case"dddd":return be[$.$W];case"H":return String(de);case"HH":return p.s(de,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return V(de,me,!0);case"A":return V(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 se}return null}(Y)||se.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,$,B){var K,se=this,de=p.p($),me=le(y),Ne=(me.utcOffset()-this.utcOffset())*r,be=this-me,S=function(){return p.m(se,me)};switch(de){case g:K=S()/12;break;case u:K=S();break;case f:K=S()/3;break;case h:K=(be-Ne)/6048e5;break;case c:K=(be-Ne)/864e5;break;case l:K=be/s;break;case a:K=be/r;break;case o:K=be/n;break;default:K=be}return B?K:p.a(K)},b.daysInMonth=function(){return this.endOf(u).$D},b.$locale=function(){return T[this.$L]},b.locale=function(y,$){if(!y)return this.$L;var B=this.clone(),K=fe(y,$,!0);return K&&(B.$L=K),B},b.clone=function(){return p.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},L}(),O=j.prototype;return le.prototype=O,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",g],["$D",v]].forEach(function(L){O[L[1]]=function(b){return this.$g(b,L[0],L[1])}}),le.extend=function(L,b){return L.$i||(L(b,j,le),L.$i=!0),le},le.locale=fe,le.isDayjs=Z,le.unix=function(L){return le(1e3*L)},le.en=T[M],le.Ls=T,le.p={},le})}(jr)),jr.exports}var h_=c_();const Bt=Ct(h_);var Wr={exports:{}},d_=Wr.exports,tl;function f_(){return tl||(tl=1,function(e,t){(function(n,r){e.exports=r()})(d_,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 c=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(u){switch(u){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 c.s(a.week(),u==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),u==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),u==="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 u}});return i.bind(this)(h)}}})}(Wr)),Wr.exports}var g_=f_();const m_=Ct(g_);var Yr={exports:{}},__=Yr.exports,nl;function p_(){return nl||(nl=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"},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={},c=function(w){return(w=+w)+(w>68?1900:2e3)},h=function(w){return function(N){this[w]=+N}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(w){(this.zone||(this.zone={})).offset=function(N){if(!N||N==="Z")return 0;var G=N.match(/([+-]|\d\d)/g),z=60*G[1]+(+G[2]||0);return z===0?0:G[0]==="+"?-z:z}(w)}],f=function(w){var N=l[w];return N&&(N.indexOf?N:N.s.concat(N.f))},g=function(w,N){var G,z=l.meridiem;if(z){for(var oe=1;oe<=24;oe+=1)if(w.indexOf(z(oe,0,N))>-1){G=oe>12;break}}else G=w===(N?"pm":"PM");return G},v={A:[a,function(w){this.afternoon=g(w,!1)}],a:[a,function(w){this.afternoon=g(w,!0)}],Q:[s,function(w){this.month=3*(w-1)+1}],S:[s,function(w){this.milliseconds=100*+w}],SS:[i,function(w){this.milliseconds=10*+w}],SSS:[/\d{3}/,function(w){this.milliseconds=+w}],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(w){var N=l.ordinal,G=w.match(/\d+/);if(this.day=G[0],N)for(var z=1;z<=31;z+=1)N(z).replace(/\[|\]/g,"")===w&&(this.day=z)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(w){var N=f("months"),G=(f("monthsShort")||N.map(function(z){return z.slice(0,3)})).indexOf(w)+1;if(G<1)throw new Error;this.month=G%12||G}],MMMM:[a,function(w){var N=f("months").indexOf(w)+1;if(N<1)throw new Error;this.month=N%12||N}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(w){this.year=c(w)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function C(w){var N,G;N=w,G=l&&l.formats;for(var z=(w=N.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(le,p,j){var O=j&&j.toUpperCase();return p||G[j]||n[j]||G[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(L,b,y){return b||y.slice(1)})})).match(r),oe=z.length,M=0;M<oe;M+=1){var T=z[M],W=v[T],Z=W&&W[0],fe=W&&W[1];z[M]=fe?{regex:Z,parser:fe}:T.replace(/^\[|\]$/g,"")}return function(le){for(var p={},j=0,O=0;j<oe;j+=1){var L=z[j];if(typeof L=="string")O+=L.length;else{var b=L.regex,y=L.parser,$=le.slice(O),B=b.exec($)[0];y.call(p,B),le=le.replace(B,"")}}return function(K){var se=K.afternoon;if(se!==void 0){var de=K.hours;se?de<12&&(K.hours+=12):de===12&&(K.hours=0),delete K.afternoon}}(p),p}}return function(w,N,G){G.p.customParseFormat=!0,w&&w.parseTwoDigitYear&&(c=w.parseTwoDigitYear);var z=N.prototype,oe=z.parse;z.parse=function(M){var T=M.date,W=M.utc,Z=M.args;this.$u=W;var fe=Z[1];if(typeof fe=="string"){var le=Z[2]===!0,p=Z[3]===!0,j=le||p,O=Z[2];p&&(O=Z[2]),l=this.$locale(),!le&&O&&(l=G.Ls[O]),this.$d=function($,B,K,se){try{if(["x","X"].indexOf(B)>-1)return new Date((B==="X"?1e3:1)*$);var de=C(B)($),me=de.year,Ne=de.month,be=de.day,S=de.hours,x=de.minutes,X=de.seconds,Q=de.milliseconds,V=de.zone,Y=de.week,ue=new Date,ae=be||(me||Ne?1:ue.getDate()),H=me||ue.getFullYear(),ne=0;me&&!Ne||(ne=Ne>0?Ne-1:ue.getMonth());var ie,_e=S||0,we=x||0,Le=X||0,J=Q||0;return V?new Date(Date.UTC(H,ne,ae,_e,we,Le,J+60*V.offset*1e3)):K?new Date(Date.UTC(H,ne,ae,_e,we,Le,J)):(ie=new Date(H,ne,ae,_e,we,Le,J),Y&&(ie=se(ie).week(Y).toDate()),ie)}catch{return new Date("")}}(T,fe,W,G),this.init(),O&&O!==!0&&(this.$L=this.locale(O).$L),j&&T!=this.format(fe)&&(this.$d=new Date("")),l={}}else if(fe instanceof Array)for(var L=fe.length,b=1;b<=L;b+=1){Z[1]=fe[b-1];var y=G.apply(this,Z);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}b===L&&(this.$d=new Date(""))}else oe.call(this,M)}}})}(Yr)),Yr.exports}var E_=p_();const v_=Ct(E_);var zr={exports:{}},C_=zr.exports,rl;function R_(){return rl||(rl=1,function(e,t){(function(n,r){e.exports=r()})(C_,function(){return function(n,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,f,g,v,C){var w=u.name?u:u.$locale(),N=o(w[f]),G=o(w[g]),z=N||G.map(function(M){return M.slice(0,v)});if(!C)return z;var oe=w.weekStart;return z.map(function(M,T){return z[(T+(oe||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,f){return u.formats[f]||function(g){return g.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,C,w){return C||w.slice(1)})}(u.formats[f.toUpperCase()])},h=function(){var u=this;return{months:function(f){return f?f.format("MMMM"):a(u,"months")},monthsShort:function(f){return f?f.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):a(u,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return c(u.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return h.bind(this)()},s.localeData=function(){var u=l();return{firstDayOfWeek:function(){return u.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 c(u,f)},meridiem:u.meridiem,ordinal:u.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(u){return a(l(),"weekdays",null,null,u)},s.weekdaysShort=function(u){return a(l(),"weekdaysShort","weekdays",3,u)},s.weekdaysMin=function(u){return a(l(),"weekdaysMin","weekdays",2,u)}}})}(zr)),zr.exports}var I_=R_();const S_=Ct(I_);var Vr={exports:{}},O_=Vr.exports,sl;function y_(){return sl||(sl=1,function(e,t){(function(n,r){e.exports=r()})(O_,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 c=this.$locale().formats,h=function(u,f){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(g,v,C){var w=C&&C.toUpperCase();return v||f[C]||n[C]||f[w].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(N,G,z){return G||z.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})}(Vr)),Vr.exports}var w_=y_();const b_=Ct(w_);var Gr={exports:{}},A_=Gr.exports,il;function T_(){return il||(il=1,function(e,t){(function(n,r){e.exports=r()})(A_,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(C){var w={date:C,utc:!0,args:arguments};return new o(w)},l.utc=function(C){var w=a(this.toDate(),{locale:this.$L,utc:!0});return C?w.add(this.utcOffset(),n):w},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(C){C.utc&&(this.$u=!0),this.$utils().u(C.$offset)||(this.$offset=C.$offset),c.call(this,C)};var h=l.init;l.init=function(){if(this.$u){var C=this.$d;this.$y=C.getUTCFullYear(),this.$M=C.getUTCMonth(),this.$D=C.getUTCDate(),this.$W=C.getUTCDay(),this.$H=C.getUTCHours(),this.$m=C.getUTCMinutes(),this.$s=C.getUTCSeconds(),this.$ms=C.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(C,w){var N=this.$utils().u;if(N(C))return this.$u?0:N(this.$offset)?u.call(this):this.$offset;if(typeof C=="string"&&(C=function(M){M===void 0&&(M="");var T=M.match(r);if(!T)return null;var W=(""+T[0]).match(s)||["-",0,0],Z=W[0],fe=60*+W[1]+ +W[2];return fe===0?0:Z==="+"?fe:-fe}(C),C===null))return this;var G=Math.abs(C)<=16?60*C:C,z=this;if(w)return z.$offset=G,z.$u=C===0,z;if(C!==0){var oe=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(z=this.local().add(G+oe,n)).$offset=G,z.$x.$localOffset=oe}else z=this.utc();return z};var f=l.format;l.format=function(C){var w=C||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,w)},l.valueOf=function(){var C=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*C},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(C){return C==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var v=l.diff;l.diff=function(C,w,N){if(C&&this.$u===C.$u)return v.call(this,C,w,N);var G=this.local(),z=a(C).local();return v.call(G,z,w,N)}}})}(Gr)),Gr.exports}var N_=T_();const M_=Ct(N_);var Kr={exports:{}},D_=Kr.exports,ol;function L_(){return ol||(ol=1,function(e,t){(function(n,r){e.exports=r()})(D_,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")}}})}(Kr)),Kr.exports}var U_=L_();const P_=Ct(U_);var Xr={exports:{}},F_=Xr.exports,al;function k_(){return al||(al=1,function(e,t){(function(n,r){e.exports=r()})(F_,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 c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(r).add(1,r).date(c),u=o(this).endOf(n);if(h.isBefore(u))return 1}var f=o(this).startOf(r).date(c).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)}}})}(Xr)),Xr.exports}var $_=k_();const x_=Ct($_);var Qr={exports:{}},B_=Qr.exports,ll;function H_(){return ll||(ll=1,function(e,t){(function(n,r){e.exports=r()})(B_,function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}})}(Qr)),Qr.exports}var j_=H_();const W_=Ct(j_);Bt.extend(v_),Bt.extend(m_),Bt.extend(P_),Bt.extend(S_),Bt.extend(x_),Bt.extend(W_),Bt.extend(M_),Bt.extend(b_);function Jr(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 Y_(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function z_(e){if(e==null)return!1;const t=e.paragraphStyle;return ul(t)}function ul(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 cl(e,t,n){return e.slice(0,t)+n+e.slice(t)}function hl(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const V_=/\s/g;function G_(e){return e===null||e.toString().replace(V_,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function K_(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 Ye=Symbol("newer"),st=Symbol("older");class X_{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ye],{done:!1,value:t.key}):{done:!0,value:void 0}}}class Q_{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ye],{done:!1,value:t.value}):{done:!0,value:void 0}}}class J_{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ye],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}xc=Ye,$c=st;class dl{constructor(t,n){R(this,"key");R(this,"value");R(this,xc);R(this,$c);this.key=t,this.value=n,this[Ye]=void 0,this[st]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Qn{constructor(...t){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(Jn.hasLength(t,1)){if(Jn.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(Jn.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(Jn.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),Qe(()=>Hn(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[Ye]&&(t===this.oldest&&(this.oldest=t[Ye]),t[Ye][st]=t[st]),t[st]&&(t[st][Ye]=t[Ye]),t[Ye]=void 0,t[st]=this.newest,this.newest&&(this.newest[Ye]=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 dl(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ye]=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 dl(t,n)),this.newest?(this.newest[Ye]=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[Ye]?(this.oldest=this.oldest[Ye],this.oldest[st]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ye]=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[Ye]&&n[st]?(n[st][Ye]=n[Ye],n[Ye][st]=n[st]):n[Ye]?(n[Ye][st]=void 0,this.oldest=n[Ye]):n[st]?(n[st][Ye]=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 X_(this.oldest)}values(){return new Q_(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new J_(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[Ye]}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[Ye];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ye],n&&(t+=" < ");return t}}class Jn{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 qr={exports:{}},q_=qr.exports,fl;function Z_(){return fl||(fl=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:q_,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 ft}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(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 c(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=c(E);let _=null;if(m){const A=l(m);_=o[A.lang]||o[A.language]||null}return _}function u(E){return Object.assign({},a,E)}function f(E,m){const _=typeof m=="object"?m:l(m);return o[_.lang]=u(E),_.language===_.lang||o[_.language]||(o[_.language]=u(E)),o[_.lang]}const g=u({group:","});function v(E,m){if(typeof E!="number")return E;if(E<0)return-v(-E,m);if(m){const _=10**(m||0)||1;return v(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 C(E,m,_){const A=E<0?-1:1,D=10**(m||2),F=10**(_||2);let P,k,I=Math.abs(E),ee=0,Ee=0,q=0,pe=1;if((E=I)%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(I=1/(I-Math.floor(I)),P=pe,pe=pe*Math.floor(I)+ee,ee=P,Ee=q,q=Math.floor(E*pe+.5),q>=D||pe>=F)return[A*Ee,ee];while(Math.abs(E-q/pe)>=1e-10&&I!==Math.floor(I));k=[A*q,pe]}return k}const w={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},N=Object.assign({},w);function G(E){if(E===null&&(E=w),E){for(const m in E)if(m in w){const _=E[m];N[m]=_==null?w[m]:_}}return{...N}}const z={"#":"",0:"0","?":" "},oe={"@":"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 Z(E,m,_){return m[_+"_max"]=E.length,m[_+"_min"]=E.replace(/#/g,"").length,m}const fe={};function le(E){if(!(E in fe)){const m=[],_=E.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,A=>"?".repeat(A.length));for(let A=0;A<_.length;A++){const D=_.charAt(A);m[A]=D in z?z[D]:D}fe[E]=m.join("")}return fe[E]}function p(E,m){typeof E=="string"&&(E={type:"string",value:E=E.replace(/ /g,z["?"])}),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+"",D="int",F=!1,P=null;const k=[];let I,ee,Ee=!1;for(;A&&!F;){if(I=/^General/i.exec(A))_.general=!0,p({type:"general"},m);else if(D==="int"&&(I=/^[#?0]+(?:,[#?0]+)*/.exec(A))||D==="den"&&(I=/^[#?\d]+/.exec(A))||(I=/^[#?0]+/.exec(A)))_[D+"_pattern"].push(I[0]),P={type:D,num:I[0]},p(P,m);else if((I=/^\//.exec(A))&&_[D+"_pattern"].length){if(!P)throw new SyntaxError("Missing a numerator in pattern ".concat(E));_.fractions=!0,_.num_pattern.push(_[D+"_pattern"].pop()),P.type="num",D="den",p({type:"div"},m)}else if(I=/^,+/.exec(A)){const U=A.charAt(1)in z;ee.slice(-1)in z&&(I[0].length>1||!U)?_.scale=.001**I[0].length:_.dec_fractions||p(I[0],m)}else{if(I=/^;/.exec(A)){F=!0;break}if(I=/^[@+-]/.exec(A))I[0]==="@"&&(_.text=!0),p({type:oe[I[0]]},m);else if(I=/^(?:\[(h+|m+|s+)\])/i.exec(A)){const U=I[1].toLowerCase(),te=U[0],Re={type:"",size:0,date:1,raw:I[0],pad:U.length};te==="h"?(Re.size=16,Re.type="hour-elap"):te==="m"?(Re.size=32,Re.type="min-elap"):(Re.size=64,Re.type="sec-elap"),_.date=_.date|Re.size,k.push(Re),p(Re,m)}else if(I=/^(?:B2)/i.exec(A))Ee||(_.date_system=6);else if(I=/^(?:B1)/i.exec(A))Ee||(_.date_system=1);else if(I=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(A)){const U={type:"",size:0,date:1,raw:I[0]},te=I[0].toLowerCase(),Re=te[0];if(te==="y"||te==="yy")U.size=2,U.type="year-short";else if(Re==="y"||Re==="e")U.size=2,U.type="year";else if(te==="b"||te==="bb")U.size=2,U.type="b-year-short";else if(Re==="b")U.size=2,U.type="b-year";else if(te==="d"||te==="dd")U.size=8,U.type="day",U.pad=/dd/.test(te);else if(te==="ddd")U.size=8,U.type="weekday-short";else if(Re==="d")U.size=8,U.type="weekday";else if(Re==="h")U.size=16,U.type="hour",U.pad=/hh/i.test(te);else if(Re==="m"){te.length===3?(U.size=4,U.type="monthname-short"):te.length===5?(U.size=4,U.type="monthname-single"):te.length>=4&&(U.size=4,U.type="monthname");const Ae=k[k.length-1];!U.type&&Ae&&!Ae.used&&80&Ae.size&&(Ae.used=!0,U.size=32,U.type="min",U.pad=/mm/.test(te)),U.type||(U.size=4,U.type="month",U.pad=/mm/.test(te),U.indeterminate=!0)}else if(Re==="s"){U.size=64,U.type="sec",U.pad=/ss/.test(te);const Ae=k[k.length-1];Ae&&32&Ae.size?U.used=!0:Ae&&Ae.indeterminate&&(delete Ae.indeterminate,Ae.size=32,Ae.type="min",U.used=!0)}_.date=_.date|U.size,_.date_eval=!0,k.push(U),p(U,m)}else if(I=/^(?:AM\/PM|am\/pm|A\/P)/.exec(A))_.clock=12,_.date=16|_.date,_.date_eval=!0,p({type:"am",short:I[0]==="A/P"},m);else if(_.date&&(I=/^\.0{1,3}/i.exec(A))){const U=I[0].length-1,te=[64,128,256,512][U];_.date=_.date|te,_.date_eval=!0,_.sec_decimals=Math.max(_.sec_decimals,U),p({type:"subsec",size:te,decimals:U,date:1,raw:I[0]},m)}else if((I=/^\\(.)/.exec(A))||(I=/^"([^"]*?)"/.exec(A)))p(I[1],m);else if(I=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(A))_.condition=[I[1],parseFloat(I[2],10)];else if(I=/^\[\$([^\]]+)\]/.exec(A)){const U=I[1].split("-"),te=U.length<2?"":U[U.length-1],Re=U[0];Re&&p(Re,m);const Ae=c(te);Ae&&(_.locale=Ae);const ke=parseInt(te,16);isFinite(ke)&&16711680&ke&&(ke>>16&255)===6&&(_.date_system=6),Ee=!0}else if(I=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(A))_.color=I[2]?M[parseInt(I[2],10)]||"#000":I[1].toLowerCase();else if(!(I=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(A))){if(I=/^%/.exec(A))_.scale=100,_.percent=!0,p("%",m);else if(I=/^_(\\.|.)/.exec(A))p(" ",m);else if(I=/^\./.exec(A))p({type:"point",value:I[0]},m),_.dec_fractions=!0,D="frac";else if(I=/^[Ee]([+-]?|(?=[0#?]))/.exec(A))_.exponential=!0,_.exp_plus=I[1]==="+",D="man",p({type:"exp",plus:I[1]==="+"},m);else if(!(I=/^\*(\\.|.)/.exec(A))){if(I=/^[BENn[]/.exec(A))throw new SyntaxError("Unexpected char ".concat(A.charAt(0)," in pattern ").concat(E));A[0]==="("&&(_.parens=!0),I=[A[0]],p(I[0],m)}}}ee=I[0],A=A.slice(I?I[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 q=_.int_pattern.join("");if(_.grouping=q.indexOf(",")>=0,_.grouping){const U=q.split(","),te=U.length;te===2?(_.group_pri=U[1].length,_.group_sec=_.group_pri):te>2&&(_.group_pri=U[te-1].length,_.group_sec=U[te-2].length)}else _.group_pri=0,_.group_sec=0;Z(q.replace(/[,]/g,""),_,"int"),Z(_.frac_pattern.join(""),_,"frac"),Z(_.man_pattern.join(""),_,"man");let pe=_.num_pattern.join(""),ye=_.den_pattern.join("");const ce=/\?/.test(ye)||/\?/.test(pe);return ye=ye.replace(/\d/g,ce?"?":"#"),ce&&(ye=ye.replace(/#$/g,"?")),Z(pe,_,"num"),Z(ye,_,"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(ye),_.den_pattern.length&&(_.denominator=parseInt(_.den_pattern.join("").replace(/\D/g,""),10)),_.integer=!!_.int_pattern.join("").length,_.fractions&&m.forEach((U,te)=>{const Re=m[te+1];U.type==="string"&&Re&&(Re.type==="num"?U.rule="num+int":Re.type==="div"?U.rule="num":Re.type==="den"&&(U.rule="den"))}),_}const O=E=>{const m=E.condition;m&&m[1]<0&&(m[0]==="<"||m[0]==="<="||m[0]==="=")||E.tokens.unshift({type:"minus",volatile:!0})};function L(E){const m=[];let _,A=!1,D=null,F=E,P=0,k=!1,I=0,ee=0;do{if(k=j(F),(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&&(ee++,A=!0),k.text){if(D)throw new Error("Unexpected partition");D=k}k.locale&&(_=c(k.locale)),m.push(k),P=F.charAt(k.pattern.length)===";"?1:0,F=F.slice(k.pattern.length+P),I++}while(P&&I<4&&ee<3);if(P)throw new Error("Unexpected partition");if(ee>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 q=m.length;if(q===1&&(m[1]=j("General"),m[1].generated=!0),q<3){const pe=m[0],ye=m[1];if(O(pe),ye.condition)O(ye);else{const ce=pe.condition;(ce[0]==="="||ce[1]>=0&&(ce[0]===">"||ce[0]===">="))&&ye.tokens.unshift({type:"minus",volatile:!0})}}else m.forEach(O)}else{if(m.length<4&&D)for(let q=0,pe=m.length;q<pe;q++)m[q]===D&&m.splice(q,1);if(m.length<1&&D&&(m[0]=j("General"),m[0].generated=!0),m.length<2){const q=j(m[0].pattern);q.tokens.unshift({type:"minus",volatile:!0}),q.generated=!0,m.push(q)}if(m.length<3){const q=j(m[0].pattern);q.generated=!0,m.push(q)}if(m.length<4)if(D)m.push(D);else{const q=j("@");q.generated=!0,m.push(q)}m[0].condition=[">",0],m[1].condition=["<",0],m[2].condition=null}return{pattern:E,partitions:m,locale:_}}const b=Math.floor;function y(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=b(4*_/146097);_-=b((146097*A+3)/4);const D=b(4e3*(_+1)/1461001);_=_-b(1461*D/4)+31;const F=b(80*_/2447),P=_-b(2447*F/80);_=b(F/11);const k=F+2-12*_;return[0|100*(A-49)+D+_,0|k,0|P]}function $(E){return y(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 D=b(A/10631);A-=10631*D;const F=b((A-_)/m);A-=b(F*m+_);const P=b((A+28.5001)/29.5);return P===13?[30*D+F,12,30]:[30*D+F,P,A-b(29.5001*P-29)]}function K(E){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const A=b(E);return m===6?B(A):m===-1?$(A):y(A,_)}const se=Math.floor,de=86400;function me(E,m){let _=null;if(Array.isArray(E)){const[A,D,F,P,k,I]=E;_=Date.UTC(A,D==null?0:D-1,F!=null?F:1,P||0,k||0,I||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 Ne(E,m){let _=0|E;const A=de*(E-_);let D=se(A);A-D>.9999&&(D+=1,D===de&&(D=0,_+=1));const F=D<0?de+D:D,[P,k,I]=K(E,0,m&&m.leap1900),ee=se(F/60/60)%60,Ee=se(F/60)%60,q=se(F)%60;if(m&&m.nativeDate){const pe=new Date(0);return pe.setUTCFullYear(P,k-1,I),pe.setUTCHours(ee,Ee,q),pe}return[P,k,I,ee,Ee,q]}function be(E){return!!(E[0]&&E[0].percent||E[1]&&E[1].percent||E[2]&&E[2].percent||E[3]&&E[3].percent)}function S(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,D]=E;return!(m&&!m.generated||_&&!_.generated||A&&!A.generated||!D||!D.text||D.generated)}const X={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},Q=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],V={total:1,sign:0,period:0,int:1,frac:0},Y=(E,m)=>E.replace(/\./,m.decimal);function ue(E,m,_,A){const D=0|_;if(typeof _=="string")E.push(_);else if(_===D)E.push(Math.abs(D));else{const F=Math.abs(_);let P=F?Math.floor(Math.log10(F)):0,k=P<0?F*10**-P:F/10**P;k===10&&(k=1,P++);const I=function(Ee){let q=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const pe=Math.abs(Ee);if(!pe)return V;const ye=q&&Ee<0?1:0,ce=Math.floor(pe),U=Math.floor(Math.log10(pe)+1);let te=0,Re=0;if(ce!==pe){te=1;const Ae=String(v(U<0?pe*10**-U:pe/10**U,15));let ke=Ae.length,$e=!0,We=0;for(;We<=Ae.length;){if(Ae[We]==="."){ke--;break}Ae[We]==="0"&&$e?ke--:$e=!1,We++}Re=ke-U,Re<0&&(Re=0,te=0)}return{total:ye+Math.max(U,1)+te+Re,digits:Math.max(U,0)+Re,sign:ye,period:te,int:Math.max(U,1),frac:Re}}(F),ee=()=>{const Ee=Math.abs(P);let q;q=k===1?k:v(k,5),E.push(Y(q+"",A),A.exponent,P<0?A.negative:A.positive,Ee<10?"0":"",Ee)};if(P>=-4&&P<=-1){const Ee=F.toPrecision(10+P).replace(/\.?0+$/,"");E.push(Y(Ee,A))}else if(P===10){const Ee=F.toFixed(10).slice(0,12).replace(/\.$/,"");E.push(Y(Ee,A))}else if(Math.abs(P)<=9)if(I.total<=11){const Ee=v(F,9).toFixed(I.frac);E.push(Y(Ee,A))}else P===9?E.push(Math.floor(F)):P>=0&&P<9?E.push(v(F,9-P)):ee();else I.total>=12?ee():Math.floor(F)===F?E.push(Math.floor(F)):E.push(Y(v(F,9).toFixed(I.frac),A))}return E}const ae=86400,H={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},ne=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 ie(E,m,_,A){let D="",F="",P="",k="",I="",ee=0,Ee=0|E,q=0,pe=0,ye=1,ce=0,U=0,te=0,Re=0,Ae=0,ke=0;const $e=A||g;if(!m.text&&isFinite(m.scale)&&m.scale!==1&&(E=function(Se){if(Se===0)return Se;const Me=Math.ceil(Math.log10(Se<0?-Se:Se)),re=10**(16-Math.floor(Me));return Math.round(Se*re)/re}(E*m.scale)),m.exponential){let Se=Math.abs(E);if(Se){const Me=10**-ne(Se,m.int_max),re=v(Se*Me,m.frac_max)/Me;ee=ne(re,m.int_max)}Se/=10**ee,E=E<0?-Se:Se,D+=Math.abs(ee)}if(m.integer){const Se=Math.abs(v(E,m.fractions?1:m.frac_max));I+=Se<1?"":Math.floor(Se)}if(m.grouping){let Se="",Me=I.length;for(Me>m.group_pri&&(Me-=m.group_pri,Se=$e.group+I.slice(Me,Me+m.group_pri)+Se);Me>m.group_sec;)Me-=m.group_sec,Se=$e.group+I.slice(Me,Me+m.group_sec)+Se;I=Me?I.slice(0,Me)+Se:Se}m.dec_fractions&&(k=String(v(E,m.frac_max)).split(".")[1]||"");let We=!1;if(m.fractions){const Se=Math.abs(m.integer?E%1:E);if(Se)if(We=!0,isFinite(m.denominator))P+=m.denominator,F+=v(Se*m.denominator),F==="0"&&(F="",P="",We=!1,I||(I="0"));else{const Me=C(Se,m.integer?m.num_max:1/0,m.den_max);F+=Me[0],P+=Me[1],m.integer&&F==="0"&&(I||(I="0"),F="",P="",We=!1)}}if(m.date){Ee=Math.trunc(E);const Se=ae*(E-Ee);if(q=Math.floor(Se),ke=Se-q,Math.abs(ke)<1e-6?ke=0:ke>.9999&&(ke=0,q+=1,q===ae&&(q=0,Ee+=1)),ke){const Me=512&m.date||256&m.date||128&m.date;(Me===512&&ke>.9995||Me===256&&ke>.995||Me===128&&ke>.95||!Me&&ke>=.5)&&(q++,ke=0)}if(Ee||m.date_system){const Me=K(E,m.date_system,_.leap1900);pe=Me[0],ye=Me[1],ce=Me[2]}if(q){const Me=q<0?ae+q:q;Ae=Math.floor(Me)%60,Re=Math.floor(Me/60)%60,te=Math.floor(Me/60/60)%60}if(U=(6+Ee)%7,m.date_eval&&(gt=E,pt=Ee+q/ae,_.dateSpanLarge?gt<-694324||pt>=35830291:gt<0||pt>=2958466)){if(_.dateErrorThrows)throw new Error("Date out of bounds");return _.dateErrorNumber?ue(E<0?[$e.negative]:[],0,E,$e).join(""):_.overflow}}var gt,pt;if(m.int_padding&&(I=m.int_padding.length===1?I||m.int_padding:m.int_padding.substring(0,m.int_padding.length-I.length)+I),m.num_padding&&(F=m.num_padding.length===1?F||m.num_padding:m.num_padding.substring(0,m.num_padding.length-F.length)+F),m.den_padding&&(P=m.den_padding.length===1?P||m.den_padding:P+m.den_padding.slice(P.length)),m.man_padding){const Se=m.exp_plus?"+":"";D=m.man_padding.length===1?(ee<0?"-":Se)+(D||m.man_padding):(ee<0?"-":Se)+m.man_padding.slice(0,m.man_padding.length-D.length)+D}const ve=[];let Ze=0;const Oe={int:0,frac:0,man:0,num:0,den:0};for(let Se=0,Me=m.tokens.length;Se<Me;Se++){const re=m.tokens[Se],ct=re.num?re.num.length:0;if(re.type==="string")re.rule?re.rule==="num"?We?ve.push(re.value):(m.num_min>0||m.den_min>0)&&ve.push(re.value.replace(/./g,z["?"])):re.rule==="num+int"?We&&I?ve.push(re.value):m.den_min>0&&(I||m.num_min)&&ve.push(re.value.replace(/./g,z["?"])):re.rule==="den"&&(We?ve.push(re.value):(m.den_min>0||m.den_min>0)&&ve.push(re.value.replace(/./g,z["?"]))):ve.push(re.value);else if(re.type==="error")ve.push(_.invalid);else if(re.type==="point")ve.push(m.date?re.value:$e.decimal);else if(re.type==="general")ue(ve,0,E,$e);else if(re.type==="exp")ve.push($e.exponent);else if(re.type==="minus")re.volatile&&m.date||re.volatile&&(E>=0||typeof E!="number")||(re.volatile&&!m.fractions&&(m.integer||m.dec_fractions)?(E<0&&I&&I!=="0"||k)&&ve.push($e.negative):ve.push($e.negative));else if(re.type==="plus")ve.push($e.positive);else if(re.type==="text")ve.push(E);else if(re.type==="div")We?ve.push("/"):m.num_min>0||m.den_min>0?ve.push(z["?"]):ve.push(z["#"]);else if(re.type==="int")if(m.int_pattern.length===1)ve.push(I);else{const He=Ze?m.int_pattern.join("").length-Oe.int:1/0,Ft=Ze===m.int_pattern.length-1?0:m.int_pattern.join("").length-(Oe.int+re.num.length);ve.push(I.substring(I.length-He,I.length-Ft)),Ze++,Oe.int+=re.num.length}else if(re.type==="frac"){const He=Oe.frac;for(let Ft=0;Ft<ct;Ft++)ve.push(k[Ft+He]||z[re.num[Ft]]);Oe.frac+=ct}else if(re.type in H)m[re.type+"_pattern"].length===1?(re.type==="int"&&ve.push(I),re.type==="frac"&&ve.push(k),re.type==="man"&&ve.push(D),re.type==="num"&&ve.push(F),re.type==="den"&&ve.push(P)):(ve.push(H[re.type].slice(Oe[re.type],Oe[re.type]+ct)),Oe[re.type]+=ct);else if(re.type==="year")pe<0&&ve.push($e.negative),ve.push(String(Math.abs(pe)).padStart(4,"0"));else if(re.type==="year-short"){const He=pe%100;ve.push(He<10?"0":"",He)}else if(re.type==="month")ve.push(re.pad&&ye<10?"0":"",ye);else if(re.type==="monthname-single")m.date_system===6?ve.push($e.mmmm6[ye-1].charAt(0)):ve.push($e.mmmm[ye-1].charAt(0));else if(re.type==="monthname-short")m.date_system===6?ve.push($e.mmm6[ye-1]):ve.push($e.mmm[ye-1]);else if(re.type==="monthname")m.date_system===6?ve.push($e.mmmm6[ye-1]):ve.push($e.mmmm[ye-1]);else if(re.type==="weekday-short")ve.push($e.ddd[U]);else if(re.type==="weekday")ve.push($e.dddd[U]);else if(re.type==="day")ve.push(re.pad&&ce<10?"0":"",ce);else if(re.type==="hour"){const He=te%m.clock||(m.clock<24?m.clock:0);ve.push(re.pad&&He<10?"0":"",He)}else if(re.type==="min")ve.push(re.pad&&Re<10?"0":"",Re);else if(re.type==="sec")ve.push(re.pad&&Ae<10?"0":"",Ae);else if(re.type==="subsec"){ve.push($e.decimal);const He=ke.toFixed(m.sec_decimals);ve.push(He.slice(2,2+re.decimals))}else if(re.type==="am"){const He=te<12?0:1;re.short&&!A?ve.push("AP"[He]):ve.push($e.ampm[He])}else if(re.type==="hour-elap"){E<0&&ve.push($e.negative);const He=24*Ee+Math.floor(Math.abs(q)/3600);ve.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="min-elap"){E<0&&ve.push($e.negative);const He=1440*Ee+Math.floor(Math.abs(q)/60);ve.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="sec-elap"){E<0&&ve.push($e.negative);const He=Ee*ae+Math.abs(q);ve.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="b-year")ve.push(pe+543);else if(re.type==="b-year-short"){const He=(pe+543)%100;ve.push(He<10?"0":"",He)}}return _.nbsp?ve.join(""):ve.join("").replace(/\u00a0/g," ")}function _e(E,m){for(let _=0;_<3;_++){const A=m[_];if(A){let D;if(A.condition){const F=A.condition[0],P=A.condition[1];F==="="?D=E===P:F===">"?D=E>P:F==="<"?D=E<P:F===">="?D=E>=P:F==="<="?D=E<=P:F==="<>"&&(D=E!==P)}else D=!0;if(D)return A}}}const we=j("@"),Le="black",J={};function Ie(E,m){if(E){const _=E[0];m[_]=m[_]||{},Ie(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=>{Ie(E,J),Ie(E+" x",J),Ie(E+" l",J),Ie(E+" l x",J),Ie("l "+E,J),Ie("l "+E+" x",J),Ie(E+" D",J),Ie(E+" D x",J),Ie("D "+E,J),Ie("D "+E+" x",J)});const Ve={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},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"},Je=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,D,F,P]=m;let k=1,I="",ee=!1,Ee=!1,q=!1,pe=!1,ye=!1,ce=null,U=!1,te=parseFloat(A.replace(/,/g,""));if(!isFinite(te))return null;for(let Ae=0;Ae<_.length;Ae++){const ke=_[Ae];if(ke==="-"){if(ee||Ee)return null;ee=!0,k=-1}else if(W.test(ke)){if(ye)return null;ye=!0,ce=ke}else if(ke==="("){if(Ee||ee)return null;Ee=!0,k=-1}else if(ke==="%"){if(pe)return null;pe=!0}}for(let Ae=0;Ae<P.length;Ae++){const ke=P[Ae];if(W.test(ke)){if(ye)return null;ye=!0,ce=ke,U=!0}else if(ke===")"){if(q||!Ee)return null;q=!0}else if(ke==="%"){if(pe)return null;pe=!0}}if(F){if(pe||ye)return null;I="0.00E+00"}else if(pe){if(ye)return null;I=D.includes(".")?"0.00%":"0%",te*=.01}else if(ye){const Ae=D.includes(".")?"#,##0.00":"#,##0";I=U?Ae+ce:ce+Ae}else D.includes(",")&&(I=D.includes(".")?"#,##0.00":"#,##0");const Re={v:te*k};return I&&(Re.z=I),Re}}const Ge=(E,m,_)=>{const A=_.path||"",D=Object.keys(m);for(let F=0;F<D.length;F++){let P;const k=D[F];if(m[k]){if(k==="$"||k==="€")E||(P=_);else if(k==="-"){const I=/^(\s*([./-]|,\s)\s*|\s+)/.exec(E);if(I){const ee=I[1]==="-"||I[1]==="/"||I[1]==="."?I[1]:" ";if(!_.sep||_.sep===ee){const Ee=I[0].replace(/\s+/g," ");P=Ge(E.slice(I[0].length),m[k],{..._,sep:ee,path:A+Ee})}}}else if(k===" "){const I=/^[,.]?\s+/.exec(E);if(I){const ee=I[0].replace(/\s+/g," ");P=Ge(E.slice(I[0].length),m[k],{..._,path:A+ee})}}else if(k==="j"||k==="d"){const I=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(E);I&&(P=Ge(E.slice(I[0].length),m[k],{..._,day:I[0],path:A+k}))}else if(k==="n"||k==="m"){const I=/^(0?[1-9]|1[012])\b/.exec(E);I&&(P=Ge(E.slice(I[0].length),m[k],{..._,month:+I[0],_mon:I[0],path:A+k}))}else if(k==="F"||k==="M"){const I=/^([a-z]{3,9})\b/i.exec(E),ee=I&&(k==="F"?je:Ve)[I[0].toLowerCase()];ee&&(P=Ge(E.slice(I[0].length),m[k],{..._,month:ee,_mon:I[0],path:A+k}))}else if(k==="l"||k==="D"){const I=/^([a-z]{3,9})\b/i.exec(E);(I&&Fe[I[0].toLowerCase()])===k&&(P=Ge(E.slice(I[0].length),m[k],{..._,path:A+k}))}else if(k==="y"){const I=/^\d\d\b/.exec(E);if(I){const ee=+I[0]>=30?+I[0]+1900:+I[0]+2e3;P=Ge(E.slice(I[0].length),m[k],{..._,year:ee,path:A+k})}}else if(k==="Y"){const I=/^\d\d\d\d\b/.exec(E);I&&(P=Ge(E.slice(I[0].length),m[k],{..._,year:+I[0],path:A+k}))}else{if(k!=="x")throw new Error('Unknown date token "'.concat(k,'"'));{const I=Ke(E);I&&(P=Ge("",m[k],{..._,time:I.v,tf:I.z,path:A+k}))}}if(P)return P}}};function tt(E,m){const _=Ge(E.trim(),J,{path:""});if(_){var A;if(_.sep==="."&&_.path.length===3)return null;const D=+((A=_.year)!==null&&A!==void 0?A:Je);if(_.day||(_.day=1),!function(k,I,ee){if(ee<1||I<1||I>12)return!1;if(I===2){if(ee>(k%4==0&&k%100!=0||k%400==0||k===1900?29:28))return!1}else if((I===4||I===6||I===9||I===11)&&ee>30||(I===1||I===3||I===5||I===7||I===8||I===10||I===12)&&ee>31)return!1;return!0}(D,_.month,_.day))return null;let F=-1/0;if(D<1900)return null;D<=1900&&_.month<=2?F=25568:D<1e4&&(F=25569);const P=Date.UTC(D,_.month-1,_.day)/864e5+F+(_.time||0);if(P>=0&&P<=2958465){const k=_._mon[0]==="0"||_.day[0]==="0"||_._mon.length===2&&_.day.length===2,I=_.path.replace(/[jdlDnmMFyYx-]/g,ee=>ee==="j"||ee==="d"?k?"dd":"d":ee==="D"?"ddd":ee==="l"?"dddd":ee==="n"||ee==="m"?k?"mm":"m":ee==="M"?"mmm":ee==="F"?"mmmm":ee==="y"?"yy":ee==="x"?_.tf||"":ee==="Y"?"yyyy":ee);return m&&m.nativeDate?{v:Ne(P,m),z:I}:{v:P,z:I}}}return null}function Ke(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,D,F,P]=m;if(F&&!D||!P&&!A&&!D)return null;let k=1*(_||0);if(P){if(k>=13)return null;P[0]!=="p"&&P[0]!=="P"||(k+=12)}return{v:(60*k*60+60*(1*(A||0))+1*(D||0)+1*(F||0))/86400,z:(_.length===2?"hh":"h")+":mm"+(D?":ss":"")+(P?" AM/PM":"")}}return null}function dt(E){return/^\s*true\s*$/i.test(E)?{v:!0}:/^\s*false\s*$/i.test(E)?{v:!1}:null}const at={};function Yt(E,m){const{pattern:_,partitions:A,locale:D}=E,F=I=>{const ee=Object.assign({},G(),m,I);return D&&(ee.locale=D),ee},P=(I,ee)=>{const Ee=F(ee);return function(q,pe,ye){const ce=h(ye.locale),U=pe[3]?pe[3]:we;if(typeof q=="boolean"&&(q=q?"TRUE":"FALSE"),q==null)return"";if(typeof q!="number")return ie(q,U,ye,ce);if(!isFinite(q)){const Re=ce||g;return isNaN(q)?Re.nan:(q<0?Re.negative:"")+Re.infinity}const te=_e(q,pe);return te?ie(q,te,ye,ce):ye.overflow}(me(I,Ee),A,Ee)};P.color=(I,ee)=>function(Ee,q){if(typeof Ee!="number"||!isFinite(Ee))return(q[3]?q[3].color:we.color)||Le;const pe=_e(Ee,q);return pe&&pe.color||Le}(me(I,F(ee)),A);const k=function(I){var ee;let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[q,pe]=I,ye=q.frac_max,ce={type:"general",isDate:S(I),isText:x(I),isPercent:be(I),maxDecimals:q.general?9:ye,scale:(ee=q.scale)!==null&&ee!==void 0?ee:1,color:0,parentheses:0,grouped:q.grouping?1:0,_partitions:I},U=!ce.isDate&&!ce.isText&&!q.error&&q.tokens.some($e=>$e.type==="string"&&(Ee?$e.value===Ee:W.test($e.value)));let te="G",Re=ye>=0?Math.min(15,ye):"",Ae="",ke="";if(pe&&pe.color&&(ke="-",ce.color=1),q.parens&&(Ae="()",ce.parentheses=1),U)te="C",ce.type="currency";else if(q.error)ce.type="error",ce.maxDecimals=0;else if(ce.isDate){let $e=0,We=0,gt="";q.tokens.forEach(ve=>{const Ze=ve.type;/^(b-)?year/.test(Ze)?(gt+="Y",We++):Ze.startsWith("month")?(gt+="M",We++):/^(week)?day/.test(Ze)?(gt+="D",We++):Ze!=="hour"&&Ze!=="min"&&Ze!=="sec"&&Ze!=="am"||(gt+=Ze[0],$e++)}),ce.type="date",We&&$e?ce.type="datetime":!We&&$e&&(ce.type="time");const pt=Q.find(ve=>gt.startsWith(ve[0]));te=pt?"D":"G",Re=pt?pt[1]:""}else ce.isText?(te="G",ce.type="text",Re="",ce.maxDecimals=0):q.general?(te="G",ce.type="general",Re=""):q.fractions?(te="G",ce.type="fraction",Re=""):q.exponential?(te="S",ce.type="scientific"):ce.isPercent?(te="P",ce.type="percent"):q.grouping?(te=",",ce.type="grouped"):(q.int_max||ye)&&(te="F",ce.type="number");return ce.code=te+Re+ke+Ae,ce.level=X[ce.type],Object.freeze(ce)}(A,(m||{}).currency)||new SyntaxError;return P.info=k,P.dateInfo=function(I){const[ee]=I;return{year:!!(2&ee.date),month:!!(4&ee.date),day:!!(8&ee.date),hours:!!(16&ee.date),minutes:!!(32&ee.date),seconds:!!(64&ee.date),clockType:ee.clock===12?12:24}}(A),P.isPercent=()=>!!k.isPercent,P.isDate=()=>!!k.isDate,P.isText=()=>!!k.isText,P.pattern=_,E.error&&(P.error=E.error),P.options=F,P.locale=D||m&&m.locale||"",Object.freeze(P)}function xe(E,m){E||(E="General");let _=null;return at[E]?_=at[E]:(_=Object.assign({},G(),m).throws?L(E):function(A){try{return L(A)}catch(D){const F={tokens:[{type:"error"}],error:D.message};return{pattern:A,partitions:[F,F,F,F],error:D.message,locale:null}}}(E),_.error||(at[E]=_)),Yt(_,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=Ne,xe.options=G,xe.dec2frac=C,xe.round=v,xe.codeToLocale=s,xe.parseLocale=l,xe.getLocale=h,xe.addLocale=(E,m)=>{const _=l(m);return delete at[_.lang],delete at[_.language],f(E,_)},xe.format=function(E,m,_){let A=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const D=_&&typeof _=="object"?_:{locale:_,throws:!A};return xe(E,D)(me(m,D),D)},xe.is_date=xe.isDate,xe.parseNumber=Ot,xe.parseDate=tt,xe.parseTime=Ke,xe.parseBool=dt,xe.parseValue=function(E,m){var _,A,D;return(_=(A=(D=Ot(E))!==null&&D!==void 0?D:tt(E,m))!==null&&A!==void 0?A:Ke(E))!==null&&_!==void 0?_:dt(E)};var ft=xe;return r=r.default}()})}(qr)),qr.exports}var ri,gl;function ep(){return gl||(gl=1,ri=Z_()),ri}var tp=ep();const np=Ct(tp);function Xt(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 si(e,t,n){const r=Xt(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function ii(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 rp(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let h=0;h<s;h++,c++){const u=r[h];l[c]=n[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function sp(e,t,n){const r=n;if(Xt(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 oi(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?ip(e,t,n,r):op(e,t,n,r)}function ip(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 op(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class Lt{constructor(t={}){R(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new Lt({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){oi(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{oi(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)si(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&si(r,void 0,i)})}removeRows(t,n){ii(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&ii(t,n,s)})}getFragment(t,n,r,s){const i=new Lt;let o=0;for(let a=t;a<=n;a++){const l={};let c=0;for(let h=r;h<=s;h++){const u=this.getValue(a,h);l[c]=u,c++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new Lt;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,he.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Xt(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=Xt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new Lt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const h=this.getValue(o,c);i.setValue(o-t,c-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 c=Xt(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<n&&(n=u):(o=!0,n=u)}),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 ap={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},lp={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},up={startRow:0,startColumn:0,endRow:0,endColumn:0},cp={row:0,column:0},ut={ff:"Arial",fs:11,it:Ue.FALSE,bl:Ue.FALSE,ul:{s:Ue.FALSE},st:{s:Ue.FALSE},ol:{s:Ue.FALSE},tr:{a:0,v:Ue.FALSE},td:Xn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Vt.UNSPECIFIED,vt:an.UNSPECIFIED,tb:ln.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},ml={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},hp=[Ts,No,Ns];var _l=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(_l||{});function Zr(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 Ue.FALSE;switch(e){case"bl":case"it":{if(o[e]===Ue.FALSE)return Ue.FALSE;break}case"ul":case"st":{if(o[e].s===Ue.FALSE)return Ue.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
|
|
7
|
-
`)===r?Ue.TRUE:Ue.FALSE}const Er=class Er{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 Lt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Lt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=he.numToWord(r+1)+(t+1),o=he.numToWord(s+1)+(n+1)):(i=he.numToWord(s+1)+(n+1),o=he.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ut.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new Er(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 c=0;c<=r-n;c++)for(let h=0;h<=i-s;h++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[h])==null)continue;const u=o[c][h].s;u&&(o[c][h].s=l.get(u))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ut.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Zr("ul",t.body)===Ue.TRUE?{s:Ue.TRUE}:{s:Ue.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?Zr("st",t.body)===Ue.TRUE?{s:Ue.TRUE}:{s:Ue.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 t&&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?Zr("it",t.body)===Ue.TRUE?Lr.ITALIC:Lr.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?Zr("bl",t.body)===Ue.TRUE?Ur.BOLD:Ur.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()===ln.WRAP?Ue.TRUE:Ue.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Er.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||ut[t]}))}};R(Er,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===De.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===De.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===De.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 yn=Er;function dp(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||et.NONE,o=s.endAbsoluteRefType||et.NONE,a=s.rangeType||De.NORMAL;if(!r&&i===et.ALL&&o===et.ALL)return s;const l=pl(s.startRow,n,s.startColumn,t,a),c=pl(s.endRow,n,s.endColumn,t,a);return r||i===et.NONE&&o===et.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===et.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===et.COLUMN?s={...s,startRow:l.row}:i===et.ROW&&(s={...s,startColumn:l.column}),o===et.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===et.COLUMN?s={...s,endRow:c.row}:o===et.ROW&&(s={...s,endColumn:c.column}),s)}function pl(e,t,n,r,s){return s===De.NORMAL?{row:e+t,column:n+r}:s===De.ROW?{row:e+t,column:n}:s===De.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function ai(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],c=r[a+1]-1,h=s[o],u=s[o+1]-1;for(const f of e){if(f.startRow>u)break;if(f.startRow<=h&&f.endRow>=u&&f.startColumn<=l&&f.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function fp(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 gp(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 mp(e){const t=ai(e),n=fp(t);return gp(n)}function _p(e,t){const n=[];return e.forEach(r=>{n.push(...Qt.subtract(r,t))}),Qt.mergeRanges(n)}function pp(e,t){const n=El(e.startRow,e.endRow,t.startRow,t.endRow),r=El(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=Ep(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function El(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),c=Math.min(i,a);if(l<=c){const h=l===-1/0?Number.NaN:l,u=c===1/0?Number.NaN:c;return[h,u]}else return null}function Ep(e,t,n,r,s,i){const o=e!==void 0?e:vl(n,r,s,i),a=t!==void 0?t:vl(n,r,s,i);return o===De.ALL||a===De.ALL?o===a?o:o===De.ALL?a:o:o===a?o:(o===De.NORMAL||a===De.NORMAL,De.NORMAL)}function vl(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?De.NORMAL:s?De.ROW:i?De.COLUMN:De.ALL}const Wt=class Wt{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===De.NORMAL||n.rangeType===void 0&&t.rangeType===De.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:h}=n,u=r<=l&&s>=a,f=i<=h&&o>=c;return u&&f}static intersects(t,n){if(t.rangeType===De.ROW&&n.rangeType===De.COLUMN||t.rangeType===De.COLUMN&&n.rangeType===De.ROW)return!0;if(t.rangeType===De.ROW&&n.rangeType===De.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===De.COLUMN&&n.rangeType===De.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,c=Number.isNaN(n.endRow)?r:n.endRow,h=Number.isNaN(n.startColumn)?0:n.startColumn,u=Number.isNaN(n.endColumn)?r:n.endColumn,f=Math.abs(o+a-h-u),g=Math.abs(o-a)+Math.abs(h-u),v=Math.abs(s+i-l-c),C=Math.abs(s-i)+Math.abs(l-c);return f<=g&&v<=C}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,h=n.endColumn;let u,f,g,v;if(a<=s)a>=r?f=a:f=r;else return null;if(l>=r)l>=s?v=s:v=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?g=o:g=h;else return null;return{startRow:f,endRow:v,startColumn:u,endColumn:g,rangeType:De.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 Wt.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:De.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===De.COLUMN),r=t.some(i=>i.rangeType===De.ROW),s=Wt.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?De.ROW:n?De.COLUMN:De.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 mp(t)}static splitIntoGrid(t){return ai(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=_p(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(Wt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),R(Wt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[et.ROW,et.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[et.ROW,et.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[et.COLUMN,et.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[et.COLUMN,et.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),R(Wt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),R(Wt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),R(Wt,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let Qt=Wt;function vp(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=Cp(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function Cp(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 Rp(e,t){yn.foreach(t,(n,r)=>{e[n][r]=void 0})}function Ip(e,t){const n=e.toFullArray(),r=[];for(;;){const s=vp(n,t);if(!s)break;r.push(s),Rp(n,s)}return r}class Sp{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 li(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 Op(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 es=65,Cl=90,yp=97;function wp(e){const t=Cl-es+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+es)+n,e=Math.floor(e/t)-1;return n}function Rl(e,t){let n="";for(;t>0;)n+=e,t--;return n}function bp(e,t=!1){const n=Cl-es+1;let r=yp;t&&(r=es);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Rl(s,i)}function Ap(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function Tp(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function qn(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var 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||{}),Ut=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Ut||{}),ui=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(ui||{});class ts extends rt{}var Il=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Il||{}),Sl=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Sl||{}),Te=(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))(Te||{}),Zn=(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))(Zn||{}),er=(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))(er||{}),hn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(hn||{}),Ol=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Ol||{}),ci=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(ci||{}),yl=(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))(yl||{}),wl=(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))(wl||{}),bl=(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))(bl||{}),Al=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Al||{}),Tl=(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))(Tl||{}),Nl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Nl||{}),Ml=(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))(Ml||{}),Dl=(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))(Dl||{}),Ll=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Ll||{}),Ul=(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))(Ul||{}),Pl=(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))(Pl||{}),Fl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Fl||{}),kl=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(kl||{}),$l=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))($l||{}),xl=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(xl||{}),Bl=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Bl||{}),Hl=(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))(Hl||{}),wn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(wn||{}),jl=(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))(jl||{}),Wl=(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))(Wl||{}),Yl=(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))(Yl||{}),zl=(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))(zl||{}),Vl=(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))(Vl||{}),Gl=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(Gl||{}),Kl=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(Kl||{}),Xl=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(Xl||{}),Ql=(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))(Ql||{}),hi=(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))(hi||{}),Jl=(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))(Jl||{}),ql=(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))(ql||{});function Np(e=he.generateRandomId(6),t=Kn.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:ci.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:Ue.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:Ue.TRUE,doNotHyphenateCaps:Ue.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:Ue.FALSE,useFirstPageHeaderFooter:Ue.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var dn={},tr={},ns={},Zl;function Mp(){if(Zl)return ns;Zl=1,Object.defineProperty(ns,"__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 ns.default=n,ns}var rs={},eu;function Dp(){if(eu)return rs;eu=1,Object.defineProperty(rs,"__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 rs.default=e,rs}var di={},tu;function nu(){return tu||(tu=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,u){if(!h)throw new Error(u)}const n=h=>h!=null&&typeof h=="object"&&!Array.isArray(h),r=(h,u)=>typeof h==typeof u?h>u:typeof h=="string"&&typeof u=="number";function s(h,u){for(let f in h){const g=f;u.write(g,h[g])}}e.isValidPathItem=h=>typeof h=="number"||typeof h=="string"&&h!=="__proto__";class i{constructor(u=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=u}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 u=[];let f=this.container,g=this.parents.length-1,v=this.idx;for(;v>=0;)u.unshift(f[v]),v===0?(v=this.indexes[g*2],f=this.parents[g--]):v-=n(f[v-1])?2:1;return u}}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 u;return this.container&&this.container.length>this.idx+1&&n(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||n(this.container[u])&&u+1>=this.container.length)return!1;n(this.container[u])&&u++;const f=this.container[u];return Array.isArray(f)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=f):this.idx=u,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const u=this.indexes[this.indexes.length-1]+1,f=this.parents[this.parents.length-1];return u>=f.length?!1:(t(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=f[u],!0)}_init(u,f,g,v){this.container=u,this.idx=f,this.parents=g.slice(),this.indexes=v.slice()}clone(){const u=new o;return u._init(this.container,this.idx,this.parents,this.indexes),u}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(u,f){const g=this.getComponent();g&&f(g,u);for(const v of this)u&&u.descend(v),this.traverse(u,f),u&&u.ascend()}eachPick(u,f){this.traverse(u,(g,v)=>{g.p!=null&&f(g.p,v)})}eachDrop(u,f){this.traverse(u,(g,v)=>{g.d!=null&&f(g.d,v)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const f=this.pendingDescent[u];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 v=this.container.splice(g,this.container.length-g);this.container.push(v),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 v=[f];this.container.splice(g,0,v),this.container=v}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&n(this.container[u]))return this.container[u];{const f={};return this.container.splice(u,0,f),f}}write(u,f){const g=this.getComponent();t(g[u]==null||g[u]===f,"Internal consistency error: Overwritten component. File a bug"),g[u]=f}get(){return this._op}descend(u){if(!e.isValidPathItem(u))throw Error("Invalid JSON key");this.pendingDescent.push(u)}descendPath(u){return this.pendingDescent.push(...u),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(u,f=s){if(u===null)return;if(t(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const g=this.lcIdx,v=this.parents.length;let C=0;for(let w=0;w<u.length;w++){const N=u[w];typeof N=="string"||typeof N=="number"?(C++,this.descend(N)):Array.isArray(N)?this.mergeTree(N,f):typeof N=="object"&&f(N,this)}for(;C--;)this.ascend();this.lcIdx=this.parents.length===v?g:-1}at(u,f){this.descendPath(u),f(this);for(let g=0;g<u.length;g++)this.ascend();return this}writeAtPath(u,f,g){return this.at(u,()=>this.write(f,g)),this.reset(),this}writeMove(u,f,g=0){return this.writeAtPath(u,"p",g).writeAtPath(f,"d",g)}getPath(){const u=super.getPath();return u.push(...this.pendingDescent),u}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=h=>new o(h);function l(h,u,f){let g,v;v=g=h?h.descendFirst():!1;function C(w){let N;for(;v;){const G=N=h.getKey();if(w!=null){let z=!1;if(u&&typeof G=="number"&&(N=u(G,h.getComponent()),N<0&&(N=~N,z=!0)),r(N,w))return null;if(N===w&&!z)return h}f&&typeof N=="number"&&f(N,h.getComponent()),v=h.nextSibling()}return null}return C.end=()=>{g&&h.ascend()},C}e.advancer=l;function c(h,u,f){let g,v,C,w;for(g=v=h&&h.descendFirst(),C=w=u&&u.descendFirst();g||C;){let N=g?h.getKey():null,G=C?u.getKey():null;N!==null&&G!==null&&(r(G,N)?G=null:N!==G&&(N=null)),f(N==null?G:N,N!=null?h:null,G!=null?u:null),N!=null&&g&&(g=h.nextSibling()),G!=null&&C&&(C=u.nextSibling())}v&&h.ascend(),w&&u.ascend()}e.eachChildOf=c}(di)),di}var fi={},ru;function su(){return ru||(ru=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={}))}(fi)),fi}var At={},fn={},iu;function gi(){return iu||(iu=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.uniToStrPos=fn.strPosToUni=void 0,fn.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},fn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),fn}var mi={},ou;function _i(){return ou||(ou=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=gi(),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 Z=M[W];switch(typeof Z){case"object":if(typeof Z.d!="number"&&typeof Z.d!="string")throw Error("Delete must be number or string");if(e.dlen(Z.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(Z.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(Z>0))throw Error("Skip components must be >0");if(typeof T=="number")throw Error("Adjacent skip components should be combined");break}T=Z}if(typeof T=="number")throw Error("Op has a trailing skip")};function r(M,T){let W=0,Z=0;for(let fe=0;fe<M.length;fe++){const le=M[fe];switch(T(le,W,Z),typeof le){case"object":W+=e.dlen(le.d);break;case"string":Z+=t.strPosToUni(le);break;case"number":W+=le,Z+=le;break}}}e.eachOp=r;function s(M,T){const W=[],Z=a(W);return r(M,(fe,le,p)=>{Z(T(fe,le,p))}),u(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 Z=t.uniToStrPos(M,T),fe=W==null?1/0:t.uniToStrPos(M,W);return M.slice(Z,fe)};const c=(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 O;if(typeof j=="number")return le===-1||j-W<=le?(O=j-W,++T,W=0,O):(W+=le,le);if(typeof j=="string"){if(le===-1||p==="i"||t.strPosToUni(j.slice(W))<=le)return O=j.slice(W),++T,W=0,O;{const L=W+t.uniToStrPos(j.slice(W),le);return O=j.slice(W,L),W=L,O}}else{if(le===-1||p==="d"||e.dlen(j.d)-W<=le)return O={d:c(j.d,W)},++T,W=0,O;{let L=c(j.d,W,W+le);return W+=le,{d:L}}}},peek:()=>M[T]}},u=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 Z=[],fe=a(Z),{take:le,peek:p}=h(M);for(let O=0;O<T.length;O++){const L=T[O];let b,y;switch(typeof L){case"number":for(b=L;b>0;)y=le(b,"i"),fe(y),typeof y!="string"&&(b-=l(y));break;case"string":W==="left"&&typeof p()=="string"&&fe(le(-1)),fe(t.strPosToUni(L));break;case"object":for(b=e.dlen(L.d);b>0;)switch(y=le(b,"i"),typeof y){case"number":b-=y;break;case"string":fe(y);break;case"object":b-=e.dlen(y.d)}break}}let j;for(;j=le(-1);)fe(j);return u(Z)}function g(M,T){n(M),n(T);const W=[],Z=a(W),{take:fe}=h(M);for(let p=0;p<T.length;p++){const j=T[p];let O,L;switch(typeof j){case"number":for(O=j;O>0;)L=fe(O,"d"),Z(L),typeof L!="object"&&(O-=l(L));break;case"string":Z(j);break;case"object":O=e.dlen(j.d);let b=0;for(;b<O;)switch(L=fe(O-b,"d"),typeof L){case"number":Z({d:c(j.d,b,b+L)}),b+=L;break;case"string":b+=t.strPosToUni(L);break;case"object":Z(L)}break}}let le;for(;le=fe(-1);)Z(le);return u(W)}const v=(M,T)=>{let W=0;for(let Z=0;Z<T.length&&M>W;Z++){const fe=T[Z];switch(typeof fe){case"number":{W+=fe;break}case"string":const le=t.strPosToUni(fe);W+=le,M+=le;break;case"object":M-=Math.min(e.dlen(fe.d),M-W);break}}return M},C=(M,T)=>typeof M=="number"?v(M,T):M.map(W=>v(W,T));function w(M,T,W){return s(M,(Z,fe)=>typeof Z=="object"&&typeof Z.d=="number"?{d:W.slice(T,fe,fe+Z.d)}:Z)}function N(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 G(M){return s(M,T=>typeof T=="object"&&typeof T.d=="string"?{d:t.strPosToUni(T.d)}:T)}function z(M){let T=!0;return r(M,W=>{typeof W=="object"&&typeof W.d=="number"&&(T=!1)}),T}function oe(M){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,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 Z=M.builder(T);for(let fe=0;fe<W.length;fe++){const le=W[fe];switch(typeof le){case"number":Z.skip(le);break;case"string":Z.append(le);break;case"object":Z.del(e.dlen(le.d));break}}return Z.build()},transform:f,compose:g,transformPosition:v,transformSelection:C,isInvertible:z,makeInvertible(T,W){return w(T,W,M)},stripInvertible:G,invert:N,invertWithDoc(T,W){return N(w(T,W,M))},isNoop:T=>T.length===0}}e.default=oe}(mi)),mi}var ss={},au;function Lp(){if(au)return ss;au=1,Object.defineProperty(ss,"__esModule",{value:!0});const e=_i(),t=gi();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 c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return ss.default=n,n.provides={text:!0},ss}var lu;function Up(){return lu||(lu=1,function(e){var t=At&&At.__createBinding||(Object.create?function(f,g,v,C){C===void 0&&(C=v),Object.defineProperty(f,C,{enumerable:!0,get:function(){return g[v]}})}:function(f,g,v,C){C===void 0&&(C=v),f[C]=g[v]}),n=At&&At.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g}),r=At&&At.__importStar||function(f){if(f&&f.__esModule)return f;var g={};if(f!=null)for(var v in f)Object.hasOwnProperty.call(f,v)&&t(g,f,v);return n(g,f),g},s=At&&At.__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=gi(),o=r(_i()),a=s(Lp()),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(v){let C=i.uniToStrPos(f,v);if(C>f.length)throw Error("The op is too long for this document");g.push(f.slice(0,C)),f=f.slice(C)},append(v){g.push(v)},del(v){f=f.slice(i.uniToStrPos(f,v))},build(){return g.join("")+f}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{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 u=_i();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(At)),At}var uu;function Pp(){return uu||(uu=1,function(e){var t=tr&&tr.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(Mp()),r=t(Dp()),s=nu(),i=su();function o(S,x){if(!S)throw new Error(x)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:S=>S,isNoop:S=>S==null,setDebug(S){},registerSubtype:N,checkValidOp:fe,normalize:le,apply:p,transformPosition:j,compose:O,tryTransform:K,transform:de,makeInvertible:y,invert:L,invertWithDoc:$,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,x,X)=>be(()=>!0,S,x,X),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(x,X,Q)=>be(S,x,X,Q)})};const a=S=>S?S.getComponent():null;function l(S){return S&&typeof S=="object"&&!Array.isArray(S)}const c=S=>Array.isArray(S)?S.slice():S!==null&&typeof S=="object"?Object.assign({},S):S,h=S=>S&&(S.p!=null||S.r!==void 0),u=S=>S&&(S.d!=null||S.i!==void 0);function f(S,x){return o(S!=null),typeof x=="number"?(o(Array.isArray(S),"Invalid key - child is not an array"),(S=S.slice()).splice(x,1)):(o(l(S),"Invalid key - child is not an object"),delete(S=Object.assign({},S))[x]),S}function g(S,x,X){return typeof x=="number"?(o(S!=null,"Container is missing for key"),o(Array.isArray(S),"Cannot use numerical key for object container"),o(S.length>=x,"Cannot insert into out of bounds index"),S.splice(x,0,X)):(o(l(S),"Cannot insert into missing item"),o(S[x]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),S[x]=X),X}e.removeOp=(S,x=!0)=>s.writeCursor().writeAtPath(S,"r",x).get(),e.moveOp=(S,x)=>s.writeCursor().writeMove(S,x).get(),e.insertOp=(S,x)=>s.writeCursor().writeAtPath(S,"i",x).get(),e.replaceOp=(S,x,X)=>s.writeCursor().at(S,Q=>{Q.write("r",x),Q.write("i",X)}).get(),e.editOp=(S,x,X,Q=!1)=>s.writeCursor().at(S,V=>T(V,x,X,Q)).get();const v=(S,x)=>S!=null&&(typeof x=="number"?Array.isArray(S):typeof S=="object"),C=(S,x)=>v(S,x)?S[x]:void 0,w={};function N(S){let x=S.type?S.type:S;x.name&&(w[x.name]=x),x.uri&&(w[x.uri]=x)}const G=S=>{const x=w[S];if(x)return x;throw Error("Missing type: "+S)};N(Up());const z=(S,x)=>S+x;N({name:"number",apply:z,compose:z,invert:S=>-S,transform:S=>S});const oe=S=>S==null?null:S.et?G(S.et):S.es?w["text-unicode"]:S.ena!=null?w.number:null,M=S=>S.es?S.es:S.ena!=null?S.ena:S.e,T=(S,x,X,Q=!1)=>{const[V,Y]=typeof x=="string"?[G(x),x]:[x,x.name];!Q&&V.isNoop&&V.isNoop(X)||(Y==="number"?S.write("ena",X):Y==="text-unicode"?S.write("es",X):(S.write("et",Y),S.write("e",X)))};function W(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function Z(S){typeof S=="number"?W(S):o(typeof S=="string")}function fe(S){if(S===null)return;const x=new Set,X=new Set,Q=Y=>{let ue=!0,ae=!1;for(let H in Y){const ne=Y[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(ne),o(!x.has(ne)),x.add(ne),o(Y.r===void 0);else if(H==="d")W(ne),o(!X.has(ne)),X.add(ne),o(Y.i===void 0);else if(H==="e"||H==="es"||H==="ena"){o(!ae),ae=!0;const ie=oe(Y);o(ie,"Missing type in edit"),ie.checkValidOp&&ie.checkValidOp(M(Y))}}o(!ue)},V=(Y,ue,ae)=>{if(!Array.isArray(Y))throw Error("Op must be null or a list");if(Y.length===0)throw Error("Empty descent");ue||Z(Y[0]);let H=1,ne=0,ie=0;for(let _e=0;_e<Y.length;_e++){const we=Y[_e];if(o(we!=null),Array.isArray(we)){const Le=V(we,!1);if(ne){const J=typeof ie,Ie=typeof Le;J===Ie?o(ie<Le,"descent keys are not in order"):o(J==="number"&&Ie==="string")}ie=Le,ne++,H=3}else typeof we=="object"?(o(H===1,`Prev not scalar - instead ${H}`),Q(we),H=2):(o(H!==3),Z(we),o(s.isValidPathItem(we),"Invalid path key"),H=1)}return o(ne!==1,"Operation makes multiple descents. Remove some []"),o(H===2||H===3),Y[0]};V(S,!0),o(x.size===X.size,"Mismatched picks and drops in op");for(let Y=0;Y<x.size;Y++)o(x.has(Y)),o(X.has(Y))}function le(S){let x=0,X=[];const Q=s.writeCursor();return Q.mergeTree(S,(V,Y)=>{const ue=oe(V);if(ue){const H=M(V);T(Y,ue,ue.normalize?ue.normalize(H):H)}for(const H of["r","p","i","d"])if(V[H]!==void 0){const ne=H==="p"||H==="d"?(ae=V[H],X[ae]==null&&(X[ae]=x++),X[ae]):V[H];Y.write(H,ne)}var ae}),Q.get()}function p(S,x){if(fe(x),x===null)return S;const X=[];return function Q(V,Y){let ue=V,ae=0,H={root:V},ne=0,ie=H,_e="root";function we(){for(;ne<ae;ne++){let Le=Y[ne];typeof Le!="object"&&(o(v(ie,_e)),ie=ie[_e]=c(ie[_e]),_e=Le)}}for(;ae<Y.length;ae++){const Le=Y[ae];if(Array.isArray(Le)){const J=Q(ue,Le);J!==ue&&J!==void 0&&(we(),ue=ie[_e]=J)}else if(typeof Le=="object"){Le.d!=null?(we(),ue=g(ie,_e,X[Le.d])):Le.i!==void 0&&(we(),ue=g(ie,_e,Le.i));const J=oe(Le);if(J)we(),ue=ie[_e]=J.apply(ue,M(Le));else if(Le.e!==void 0)throw Error("Subtype "+Le.et+" undefined")}else ue=C(ue,Le)}return H.root}(S=function Q(V,Y){const ue=[];let ae=0;for(;ae<Y.length;ae++){const _e=Y[ae];if(Array.isArray(_e))break;typeof _e!="object"&&(ue.push(V),V=C(V,_e))}for(let _e=Y.length-1;_e>=ae;_e--)V=Q(V,Y[_e]);for(--ae;ae>=0;ae--){const _e=Y[ae];if(typeof _e!="object"){const we=ue.pop();V=V===C(we,_e)?we:V===void 0?f(we,_e):(ne=_e,ie=V,(H=c(H=we))[ne]=ie,H)}else h(_e)&&(o(V!==void 0,"Cannot pick up or remove undefined"),_e.p!=null&&(X[_e.p]=V),V=void 0)}var H,ne,ie;return V}(S,x),x)}function j(S,x){S=S.slice(),fe(x);const X=s.readCursor(x);let Q,V,Y=!1;const ue=[];for(let H=0;;H++){const ne=S[H],ie=X.getComponent();if(ie&&(ie.r!==void 0?Y=!0:ie.p!=null&&(Y=!1,Q=ie.p,V=H)),H>=S.length)break;let _e=0;const we=s.advancer(X,void 0,(J,Ie)=>{h(Ie)&&_e++});ue.unshift(we);const Le=we(ne);if(typeof ne=="number"&&(S[H]-=_e),!Le)break}if(ue.forEach(H=>H.end()),Y)return null;const ae=()=>{let H=0;if(Q!=null){const ne=X.getPath();H=ne.length,S=ne.concat(S.slice(V))}for(;H<S.length;H++){const ne=S[H],ie=a(X),_e=oe(ie);if(_e){const J=M(ie);_e.transformPosition&&(S[H]=_e.transformPosition(S[H],J));break}let we=0;const Le=s.advancer(X,(J,Ie)=>u(Ie)?~(J-we):J-we,(J,Ie)=>{u(Ie)&&we++})(ne);if(typeof ne=="number"&&(S[H]+=we),!Le)break}};return Q!=null?X.eachDrop(null,H=>{H===Q&&ae()}):ae(),S}function O(S,x){if(fe(S),fe(x),S==null)return x;if(x==null)return S;let X=0;const Q=s.readCursor(S),V=s.readCursor(x),Y=s.writeCursor(),ue=[],ae=[],H=[],ne=[],ie=[],_e=[],we=new Set;Q.traverse(null,J=>{J.p!=null&&(H[J.p]=Q.clone())}),V.traverse(null,J=>{J.d!=null&&(ne[J.d]=V.clone())});const Le=s.writeCursor();return function J(Ie,Ve,je,Fe,Je,Ot,Ge,tt){o(Ve||je);const Ke=a(Ve),dt=a(je),at=!!dt&&dt.r!==void 0,Yt=!!Ke&&Ke.i!==void 0,xe=Ke?Ke.d:null,ft=dt?dt.p:null,E=(Ot||at)&&ft==null;if(ft!=null)Fe=ne[ft],Ge=ae[ft]=new s.WriteCursor;else if(dt&&dt.r!==void 0)Fe=null;else{const U=a(Fe);U&&U.d!=null&&(Fe=null)}const m=a(Fe);if(xe!=null)if(Ie=H[xe],tt=ue[xe]=new s.WriteCursor,E)Ot&&!at&&tt.write("r",!0);else{const U=ie[xe]=X++;Ge.write("d",U)}else if(Ke&&Ke.i!==void 0)Ie=null;else{const U=a(Ie);U&&U.p!=null&&(Ie=null)}let _;Yt?(o(Je===void 0),_=Ke.i):_=Je;const A=(ft==null?!Yt||Ot||at:_===void 0)?null:Ge.getComponent();if(ft!=null){if(!(Je!==void 0||Yt)){const U=xe!=null?ie[xe]:X++;_e[ft]=U,tt.write("p",U)}}else at&&(Yt||Je!==void 0||(dt.r,tt.write("r",dt.r)));const D=E?null:oe(Ke),F=oe(m);if((D||F)&&(D&&D.name,F&&F.name),D&&F){o(D===F);const U=M(Ke),te=M(m),Re=D.compose(U,te);T(Ge,D,Re),we.add(m)}else D?T(Ge,D,M(Ke)):F&&(T(Ge,F,M(m)),we.add(m));const P=typeof _=="object"&&_!=null;let k=!1,I=0,ee=0,Ee=0,q=0,pe=0;const ye=s.advancer(Fe,(U,te)=>u(te)?q-U-1:U-q,(U,te)=>{u(te)&&q++}),ce=s.advancer(Ie,(U,te)=>h(te)?I-U-1:U-I,(U,te)=>{h(te)&&I++});if(s.eachChildOf(Ve,je,(U,te,Re)=>{let Ae,ke,$e=U,We=U,gt=U;if(typeof U=="number"){let Me=U+Ee;ke=ye(Me),We=Me+q;let re=U+ee;Ae=ce(re),u(a(ke))&&(Ae=null),$e=re+I,gt=U+pe,o($e>=0,"p1PickKey is negative"),o(We>=0,"p2DropKey is negative");const ct=u(a(te)),He=h(a(Re));(ct||He&&!E)&&pe--,ct&&ee--,He&&Ee--}else Ae=ce(U),ke=ye(U);tt.descend($e),Ge.descend(We);const pt=P&&!u(a(te))?_[gt]:void 0,ve=J(Ae,te,Re,ke,pt,E,Ge,tt);var Ze,Oe,Se;P&&!E?pt!==ve&&(k||(_=Array.isArray(_)?_.slice():Object.assign({},_),k=!0),Ze=_,Se=ve,typeof(Oe=gt)=="number"?(o(Array.isArray(Ze)),o(Oe<Ze.length)):(o(!Array.isArray(Ze)),o(Ze[Oe]!==void 0)),Se===void 0?typeof Oe=="number"?Ze.splice(Oe,1):delete Ze[Oe]:Ze[Oe]=Se):o(ve===void 0),Ge.ascend(),tt.ascend()}),ce.end(),ye.end(),A!=null)A.i=_;else if(!Ot&&!at&&ft==null)return _}(Q,Q.clone(),V,V.clone(),void 0,!1,Y,Le),Y.reset(),Y.mergeTree(Le.get()),Y.reset(),Y.get(),ue.map(J=>J.get()),ae.map(J=>J.get()),Q.traverse(Y,(J,Ie)=>{const Ve=J.p;if(Ve!=null){const je=ie[Ve];je!=null&&Ie.write("p",je);const Fe=ue[Ve];Fe&&Fe.get(),Fe&&Ie.mergeTree(Fe.get())}else J.r!==void 0&&Ie.write("r",J.r)}),Y.reset(),Y.get(),V.traverse(Y,(J,Ie)=>{const Ve=J.d;if(Ve!=null){const Fe=_e[Ve];Fe!=null&&Ie.write("d",Fe);const Je=ae[Ve];Je&&Ie.mergeTree(Je.get())}else J.i!==void 0&&Ie.write("i",J.i);const je=oe(J);je&&!we.has(J)&&T(Ie,je,M(J))}),Y.get()}function L(S){if(S==null)return null;const x=new s.ReadCursor(S),X=new s.WriteCursor;let Q;const V=[],Y=[];return function ue(ae,H,ne){const ie=ae.getComponent();let _e,we=!1;if(ie){ie.p!=null&&(H.write("d",ie.p),V[ie.p]=ae.clone()),ie.r!==void 0&&H.write("i",ie.r),ie.d!=null&&(H.write("p",ie.d),ne=void 0),ie.i!==void 0&&(ne=_e=ie.i);const J=oe(ie);J&&(ne===void 0?(Q||(Q=new Set),Q.add(ie)):(M(ie),ne=J.apply(ne,M(ie)),we=!0))}let Le=0;for(const J of ae){H.descend(J);const Ie=typeof J=="number"?J-Le:J,Ve=C(ne,Ie);u(ae.getComponent())&&Le++;const je=ue(ae,H,Ve);if(ne!==void 0&&je!==void 0){if(we||(we=!0,ne=c(ne)),!v(ne,Ie))throw Error("Cannot modify child - invalid operation");ne[Ie]=je}H.ascend()}if(_e===void 0)return we?ne:void 0;H.write("r",ne)}(x,X,void 0),Q&&(X.reset(),function ue(ae,H,ne){const ie=H.getComponent();if(ie){const J=ie.d;if(J!=null&&(ae=V[J],ne=Y[J]=s.writeCursor()),Q.has(ie)){const Ie=oe(ie);if(!Ie.invert)throw Error(`Cannot invert subtype ${Ie.name}`);T(ne,Ie,Ie.invert(M(ie)))}}let _e=0,we=0;const Le=s.advancer(ae,(J,Ie)=>h(Ie)?_e-J-1:J-_e,(J,Ie)=>{h(Ie)&&_e++});for(const J of H)if(typeof J=="number"){const Ie=J-we,Ve=Le(Ie),je=Ie+_e;ne.descend(je),ue(Ve,H,ne),u(H.getComponent())&&we++,ne.ascend()}else ne.descend(J),ue(Le(J),H,ne),ne.ascend();Le.end()}(x.clone(),x,X),Y.length&&(X.reset(),x.traverse(X,(ue,ae)=>{const H=ue.p;if(H!=null){const ne=Y[H];ne&&ne.get(),ne&&ae.mergeTree(ne.get())}}))),X.get()}const b=(S,x)=>S.some(X=>typeof X=="object"&&(Array.isArray(X)?b(X,x):x(X)));function y(S,x){if(S==null||!b(S,H=>{var ne;return H.r!==void 0||((ne=oe(H))===null||ne===void 0?void 0:ne.makeInvertible)!=null}))return S;const X=new s.ReadCursor(S),Q=new s.WriteCursor;let V=!1;const Y=[],ue=[],ae=(H,ne,ie)=>{const _e=H.getComponent();let we=!1;if(_e){_e.d!=null&&ne.write("d",_e.d),_e.i!==void 0&&ne.write("i",_e.i);const J=_e.p;if(J!=null&&(Y[J]=H.clone(),o(ie!==void 0,"Operation picks up at an invalid key"),ue[J]=ie,ne.write("p",_e.p)),_e.r!==void 0&&ie===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Ie=oe(_e);Ie&&(Ie.makeInvertible?V=!0:T(ne,Ie,M(_e),!0))}let Le=0;for(const J of H){ne.descend(J);const Ie=typeof J=="number"?J-Le:J,Ve=C(ie,Ie),je=ae(H,ne,Ve);Ve!==je&&(we||(we=!0,ie=c(ie)),je===void 0?(ie=f(ie,Ie),typeof J=="number"&&Le++):ie[Ie]=je),ne.ascend()}return _e&&(_e.r!==void 0?(ne.write("r",r.default(ie)),ie=void 0):_e.p!=null&&(ie=void 0)),ie};return ae(X,Q,x),Q.get(),V&&(Q.reset(),function H(ne,ie,_e,we,Le){const J=ie.getComponent();if(J){J.i!==void 0?(we=J.i,Le=!0):J.d!=null&&(we=ue[J.d],ne=Y[J.d],Le=!1,J.d);let Fe=oe(J);if(Fe&&Fe.makeInvertible){const Je=M(J);T(_e,Fe,Fe.makeInvertible(Je,we),!0)}}let Ie=0,Ve=0;const je=s.advancer(ne,(Fe,Je)=>h(Je)?Ie-Fe-1:Fe-Ie,(Fe,Je)=>{h(Je)&&Ie++});for(const Fe of ie)if(typeof Fe=="number"){const Je=Fe-Ve,Ot=je(Je),Ge=Je+Ie,tt=C(we,Le?Je:Ge);_e.descend(Fe),H(Ot,ie,_e,tt,Le),u(ie.getComponent())&&Ve++,_e.ascend()}else{const Je=C(we,Fe);_e.descend(Fe),H(je(Fe),ie,_e,Je,Le),_e.ascend()}je.end()}(X.clone(),X,Q,x,!1)),Q.get()}function $(S,x){return L(y(S,x))}const B=S=>{if(S==null)return null;const x=S.slice();for(let X=0;X<S.length;X++){const Q=x[X];Array.isArray(Q)&&(x[X]=B(Q))}return x};function K(S,x,X){o(X==="left"||X==="right","Direction must be left or right");const Q=X==="left"?0:1;if(x==null)return{ok:!0,result:S};fe(S),fe(x);let V=null;const Y=[],ue=[],ae=[],H=[],ne=[],ie=[],_e=[],we=[],Le=[],J=[],Ie=[],Ve=[],je=[],Fe=[],Je=[];let Ot=0;const Ge=s.readCursor(S),tt=s.readCursor(x),Ke=s.writeCursor();if(function m(_,A=null,D){const F=a(A);F&&(F.r!==void 0?D=A.clone():F.p!=null&&(D=null,ie[F.p]=_.clone()));const P=_.getComponent();let k;P&&(k=P.p)!=null&&(ne[k]=A?A.clone():null,ae[k]=_.clone(),D&&(J[k]=!0,Le[k]=D),F&&F.p!=null&&(Fe[k]=F.p));const I=s.advancer(A);for(const ee of _)m(_,I(ee),D);I.end()}(tt,Ge,null),function m(_,A,D,F,P){const k=D.getComponent();let I,ee=!1;k&&((I=k.d)!=null?(H[I]=D.clone(),F!=null&&(Je[F]==null&&(Je[F]=[]),Je[F].push(I)),_=ne[I]||null,A=ae[I]||null,J[I]?(P&&(Ie[I]=!0),P=Le[I]||null):!P||Q!==1&&Fe[I]!=null||V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(P.getPath()),op2:e.moveOp(A.getPath(),D.getPath())}),ee=!0):k.i!==void 0&&(_=A=null,ee=!0,P&&V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(P.getPath()),op2:e.insertOp(D.getPath(),k.i)})));const Ee=a(_);Ee&&(Ee.r!==void 0?P=_.clone():Ee.p!=null&&(Ee.p,F=Ee.p,P=null));const q=oe(k);q&&P&&V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(P.getPath()),op2:e.editOp(D.getPath(),q,M(k),!0)});let pe=0,ye=0;const ce=s.advancer(A,(te,Re)=>h(Re)?pe-te-1:te-pe,(te,Re)=>{h(Re)&&pe++}),U=s.advancer(_);for(const te of D)if(typeof te=="number"){const Re=te-ye,Ae=ce(Re);ye+=+m(U(Re+pe),Ae,D,F,P)}else{const Re=ce(te);m(U(te),Re,D,F,P)}return ce.end(),U.end(),ee}(Ge,tt,tt.clone(),null,null),H.map(m=>m&&m.get()),V)return{ok:!1,conflict:V};Ie.map(m=>!!m);const dt=[];let at=null;(function m(_,A,D,F,P){let k=!1;const I=a(A);if(h(I)){const ce=I.p;ce!=null?(D=H[ce],F=Ve[ce]=s.writeCursor(),k=!0,P=null):(D=null,P=A.clone())}else u(a(D))&&(D=null);const ee=_.getComponent();if(ee){const ce=ee.p;ce!=null?(P&&(we[ce]=P),dt[ce]=P||Q===1&&k?null:F.getComponent(),Y[ce]=_.clone(),D&&(_e[ce]=D.clone())):ee.r!==void 0&&(P||F.write("r",!0),(P||k)&&(at==null&&(at=new Set),at.add(ee)))}let Ee=0,q=0;const pe=s.advancer(A,void 0,(ce,U)=>{h(U)&&Ee++}),ye=s.advancer(D,(ce,U)=>u(U)?~(ce-q):ce-q,(ce,U)=>{u(U)&&q++});if(_)for(const ce of _)if(typeof ce=="string"){const U=pe(ce),te=ye(ce);F.descend(ce),m(_,U,te,F,P),F.ascend()}else{const U=pe(ce),te=ce-Ee,Re=h(a(U))?null:ye(te),Ae=te+q;o(Ae>=0),F.descend(Ae),m(_,U,Re,F,P),F.ascend()}pe.end(),ye.end()})(Ge,tt,tt.clone(),Ke,null),Ke.reset();let Yt=[];if(function m(_,A,D,F,P,k){o(A);const I=A.getComponent();let ee=a(F),Ee=!1;const q=(Oe,Se,Me)=>Oe?e.moveOp(Oe.getPath(),Se.getPath()):e.insertOp(Se.getPath(),Me.i);if(u(I)){const Oe=I.d;Oe!=null&&(ue[Oe]=A.clone());const Se=Oe!=null?dt[Oe]:null;let Me=!1;if(I.i!==void 0||Oe!=null&&Se){let re;ee&&(ee.i!==void 0||(re=ee.d)!=null&&!J[re])&&(Me=re!=null?Oe!=null&&Oe===Fe[re]:n.default(ee.i,I.i),Me||re!=null&&Q!==1&&Fe[re]!=null||V==null&&(V={type:i.ConflictType.DROP_COLLISION,op1:q(Oe!=null?Y[Oe]:null,A,I),op2:q(re!=null?ae[re]:null,F,ee)})),Me||(k?V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:q(Oe!=null?Y[Oe]:null,A,I),op2:e.removeOp(k.getPath())}):(Oe!=null?(Yt[Ot]=Oe,P.write("d",Se.p=Ot++)):P.write("i",r.default(I.i)),Ee=!0))}else if(Oe!=null&&!Se){const re=we[Oe];re&&(k=re.clone())}Oe!=null?(_=Y[Oe],D=ie[Oe],F=_e[Oe]):I.i!==void 0&&(_=D=null,Me||(F=null))}else h(a(_))&&(_=D=F=null);const pe=a(_),ye=a(D);if(h(ye)){const Oe=ye.p;ye.r!==void 0&&(!pe||pe.r===void 0)||J[Oe]?(F=null,k=D.clone()):Oe!=null&&(F=H[Oe],Q!==1&&Fe[Oe]!=null||((P=je[Oe])||(P=je[Oe]=s.writeCursor()),P.reset(),k=null))}else!u(I)&&u(ee)&&(F=null);ee=F!=null?F.getComponent():null;const ce=oe(I);if(ce){const Oe=M(I);if(k)V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(A.getPath(),ce,Oe,!0),op2:e.removeOp(k.getPath())});else{const Se=oe(ee);let Me;if(Se){if(ce!==Se)throw Error("Transforming incompatible types");const re=M(ee);Me=ce.transform(Oe,re,X)}else Me=r.default(Oe);T(P,ce,Me)}}let U=0,te=0,Re=0,Ae=0,ke=0,$e=0,We=_!=null&&_.descendFirst(),gt=We;const pt=s.advancer(D,void 0,(Oe,Se)=>{h(Se)&&Re++});let ve=F!=null&&F.descendFirst(),Ze=ve;for(const Oe of A)if(typeof Oe=="number"){let Se;const Me=u(A.getComponent()),re=Oe-te;{let tn;for(;We&&typeof(tn=_.getKey())=="number";){tn+=U;const Nt=_.getComponent(),Fn=h(Nt);if(tn>re||tn===re&&(!Fn||Q===0&&Me))break;if(Fn){U--;const mn=Nt.p;Fe.includes(mn),Nt.d,a(je[Nt.d]),h(a(je[Nt.d])),(Nt.r===void 0||at&&at.has(Nt))&&(mn==null||!dt[mn]||Q!==1&&Fe.includes(mn))||ke--}We=_.nextSibling()}Se=We&&tn===re?_:null}const ct=re-U;let He=pt(ct);const Ft=ct-Re;let fs=null;{let tn,Nt;for(;ve&&typeof(tn=F.getKey())=="number";){Nt=tn-Ae;const Fn=F.getComponent(),mn=u(Fn);if(Nt>Ft)break;if(Nt===Ft){if(!mn){fs=F;break}{if(Q===0&&Me){fs=F;break}const _n=He&&h(He.getComponent());if(Q===0&&_n)break}}if(mn){const _n=Fn.d;Fe[_n],Fn.i===void 0&&(J[_n]||Fe[_n]!=null&&Q!==1)?(J[_n]||Fe[_n]!=null&&Q===0)&&(Ae++,$e--):Ae++}ve=F.nextSibling()}}const Bc=Ft+Ae+ke+$e;o(Bc>=0,"trying to descend to a negative index"),P.descend(Bc),Me&&(Se=He=fs=null,te++),m(Se,A,He,fs,P,k)&&$e++,P.ascend()}else{let Se;for(;We&&(Se=_.getKey(),typeof Se!="string"||!(Se>Oe||Se===Oe));)We=_.nextSibling();const Me=We&&Se===Oe?_:null,re=pt(Oe);let ct;for(;ve&&(ct=F.getKey(),typeof ct!="string"||!(ct>Oe||ct===Oe));)ve=F.nextSibling();const He=ve&&ct===Oe?F:null;P.descend(Oe),m(Me,A,re,He,P,k),P.ascend()}return pt.end(),gt&&_.ascend(),Ze&&F.ascend(),Ee}(Ge,Ge.clone(),tt,tt.clone(),Ke,null),V)return{ok:!1,conflict:V};Ke.reset();const xe=(m,_,A)=>m.traverse(_,(D,F)=>{D.d!=null&&A(D.d,m,F)});(J.length||Ve.length)&&(xe(tt,Ke,(m,_,A)=>{J[m]&&!Ie[m]&&A.write("r",!0),Ve[m]&&A.mergeTree(Ve[m].get())}),Ke.reset());const ft=[],E=[];if((je.length||J.length)&&!V){const m=s.readCursor(B(Ke.get()));if(xe(m,null,(_,A)=>{ft[_]=A.clone()}),je.forEach(_=>{_&&xe(s.readCursor(_.get()),null,(A,D)=>{ft[A]=D.clone()})}),function _(A,D,F,P,k,I){const ee=a(D);if(ee&&h(ee))if(ee.p!=null){const U=ee.p;ft[U].getPath(),F=ft[U],P=E[U]=s.writeCursor()}else ee.r!==void 0&&(F=null);else u(a(F))&&(F=null);const Ee=A.getComponent();if(Ee){let U;if((U=Ee.d)!=null){const te=je[U];te&&(te.get(),P.mergeTree(te.get()),F=s.readCursor(te.get()))}}let q=0,pe=0;const ye=s.advancer(D,void 0,(U,te)=>{h(te)&&q--}),ce=s.advancer(F,(U,te)=>u(te)?-(U-pe)-1:U-pe,(U,te)=>{u(te)&&pe++});for(const U of A)if(typeof U=="number"){const te=ye(U),Re=U+q,Ae=ce(Re),ke=Re+pe;P.descend(ke),_(A,te,Ae,P),P.ascend()}else P.descend(U),_(A,ye(U),ce(U),P),P.ascend();ye.end(),ce.end()}(tt,m,m.clone(),Ke),Ke.reset(),V)return{ok:!1,conflict:V};if(Ke.get(),E.length){const _=E.map(D=>D?D.get():null),A=s.readCursor(B(Ke.get()));if(xe(A,Ke,(D,F,P)=>{const k=_[D];k&&(P.mergeTree(k),_[D]=null)}),_.find(D=>D)){const D=s.writeCursor(),F=s.writeCursor();let P=0,k=0;_.forEach(I=>{I!=null&&xe(s.readCursor(I),null,ee=>{const Ee=Yt[ee];D.writeMove(Y[Ee].getPath(),ue[Ee].getPath(),P++);const q=Je[Ee];q&&q.forEach(pe=>{J[pe]||Q!==1&&Fe[pe]!=null||F.writeMove(ae[pe].getPath(),H[pe].getPath(),k++)})})}),V={type:i.ConflictType.BLACKHOLE,op1:D.get(),op2:F.get()}}}}return V?{ok:!1,conflict:V}:{ok:!0,result:Ke.get()}}const se=S=>{const x=new Error("Transform detected write conflict");throw x.conflict=S,x.type=x.name="writeConflict",x};function de(S,x,X){const Q=K(S,x,X);if(Q.ok)return Q.result;se(Q.conflict)}const me=S=>{const x=s.writeCursor();return s.readCursor(S).traverse(x,(X,Q)=>{(u(X)||oe(X))&&Q.write("r",!0)}),x.get()},Ne=(S,x)=>{const{type:X,op1:Q,op2:V}=S;switch(X){case i.ConflictType.DROP_COLLISION:return x==="left"?[null,me(V)]:[me(Q),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let Y=!1;return s.readCursor(Q).traverse(null,ue=>{ue.r!==void 0&&(Y=!0)}),Y?[null,me(V)]:[me(Q),null];case i.ConflictType.BLACKHOLE:return[me(Q),me(V)];default:throw Error("Unrecognised conflict: "+X)}};function be(S,x,X,Q){let V=null;for(;;){const Y=K(x,X,Q);if(Y.ok)return O(V,Y.result);{const{conflict:ue}=Y;S(ue)||se(ue);const[ae,H]=Ne(ue,Q);x=O(le(x),ae),X=O(le(X),H),V=O(V,H)}}}}(tr)),tr}var cu;function Fp(){return cu||(cu=1,function(e){var t=dn&&dn.__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=dn&&dn.__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(Pp(),e);var r=nu();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=su();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(dn)),dn}var _t=Fp();const kp=jc({__proto__:null,default:Ct(_t)},[_t]);var ge=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(ge||{});function nr(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&&he.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();Za(r,a)&&he.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function hu(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const h of l)h.st+=r,h.ed+=r;for(let h=0;h<o;h++){const u=s[h],{st:f,ed:g}=u;if(g<=r)i.push(u);else if(r>f&&r<g){a=!0;const v={...u,ed:r};i.push(v),l.length&&i.push(...l);const C={...u,st:r+n,ed:g+n};i.push(C)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=nr(i)}function du(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=n),o.push(h.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const h=i[l];h.startIndex+=r;const u=h.startIndex;a=o.indexOf(u)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(qn("startIndex"))}}function fu(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:c}=l;c>=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(qn("startIndex"))}}function gu(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=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(qn("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function mu(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:c,endIndex:h}=l;c>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(qn("startIndex"))}}const _u="$",pu=e=>e.split(_u)[0];function pi(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=pu(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=pu(i.rangeId),i.rangeId===n.rangeId&&oa(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 Ei(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 Eu(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 vi(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 $p(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;Ei(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=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=pi(s)}function xp(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;vi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=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=Eu(s)}function vu(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:f}=h;if(s<=u&&i>=f){o.push({...h,st:u-s,ed:f-s});continue}else u<=s&&f>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=u&&s<f?(o.push({...h,st:s-s,ed:f-s}),h.ed=s):i>u&&i<=f?(o.push({...h,st:u-s,ed:i-s}),h.st=i-t,h.ed-=t):u>=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 Cu(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<i){o.push({...h,startIndex:u-n});continue}else u>=i&&(h.startIndex-=t);a.push(h)}e.paragraphs=a}return o}function Ru(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.sectionBreaks=a}return o}function Iu(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function Su(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:f}=h;if(s<=u&&i>=f){o.push({...h,startIndex:u-n,endIndex:f-n});continue}else if(u<=s&&f>=i){const g=Jr(u,f,s,i);if(g.length===0||(h.startIndex=g[0],h.endIndex=g[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.tables=a}return o}function Bp(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:f}=h;if(u>=s&&f<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,f)){const g=Jr(u,f,s,i);if(g.length===0)continue;h.startIndex=g[0],h.endIndex=g[1]}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=pi(a)}return o}function Hp(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:f,endIndex:g}=u;if(f>=i&&g<=o){a.push(u);continue}else if(Math.max(i,f)<=Math.min(o,g)){const v=Jr(f,g,i,o);if(v.length===0)continue;u.startIndex=v[0],u.endIndex=v[1]}else o<f&&r&&(u.startIndex-=t,u.endIndex-=t);l.push(u)}e.customDecorations=l}return a}var Ou=(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))(Ou||{}),Pt=(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))(Pt||{});const is={"a)":{glyphFormat:"%1)",glyphType:Te.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Te.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Te.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Te.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER}},bn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:Zn.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),An=e=>e.map((t,n)=>({...t,bulletAlignment:Zn.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),yu=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:Zn.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),rr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:bn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:bn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:bn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:bn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:bn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:bn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Te.DECIMAL},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.DECIMAL},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.DECIMAL},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1)",glyphType:Te.DECIMAL},{glyphFormat:"%2)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Te.DECIMAL},{glyphFormat:"%5)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Te.DECIMAL},{glyphFormat:"%8)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:An(["%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:Te.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Te.DECIMAL},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Te.DECIMAL},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Te.DECIMAL},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:yu("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:yu("☑",{st:{s:Ue.TRUE}})}},os=e=>{const{glyphFormat:t,glyphType:n}=e,r=he.deepClone(rr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},jp={ORDER_LIST_QUICK_2:os(is["a)"]),ORDER_LIST_QUICK_3:os(is["a."]),ORDER_LIST_QUICK_4:os(is["i."]),ORDER_LIST_QUICK_6:os(is["I."])};Object.assign(rr,jp);const Wp={"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 Yp(e,t,n,r,s){const i=zp(e,t,n,r,s),o=Vp(e,t,n,r,s),a=Gp(e,t,n,r,s),l=Kp(e,t,n,r,s),c=Xp(e,t,n,r,s),h=Qp(e,t,n,r),u=Jp(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function zp(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=vu(e,n,r);if(s!==Pe.REPLACE){const l=wu(o,a,s);t.textRuns=l}return hu(e,t,n,r),a}function wu(e,t,n){if(t.length===0)return e;e=he.deepClone(e),t=he.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:g,ed:v,ts:C}=e[o],{st:w,ed:N,ts:G,sId:z}=t[a];let oe;if(n===Pe.COVER?oe={...G,...C}:oe={...C},v<w)c()||r.push(e[o]),o++;else if(N<g)c()||r.push(t[a]),a++;else{const M={st:Math.min(g,w),ed:Math.max(g,w),ts:g<w?{...C}:{...G},sId:g<w?void 0:z};M.ed>M.st&&r.push(M),r.push({st:Math.max(g,w),ed:Math.min(v,N),ts:oe,sId:z}),v<N?(o++,t[a].st=v,t[a].st===t[a].ed&&a++):(a++,e[o].st=N,e[o].st===e[o].ed&&o++);const T={st:Math.min(v,N),ed:Math.max(v,N),ts:v<N?{...G}:{...C},sId:v<N?z:void 0};l=T.ed>T.st?T:null}}c();const h=r[r.length-1],u=e[s-1],f=t[i-1];return h&&h.ed!==Math.max(u.ed,f.ed)&&(u.ed>f.ed?r.push(u):r.push(f)),nr(r)}function Vp(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=Cu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:f}=c;let g=[];for(const v of a){const{startIndex:C,paragraphStyle:w,bullet:N}=v;let G,z;if(s===Pe.COVER?(G={...w,...u},z={listId:"",listType:Pt.BULLET_LIST,nestingLevel:0,textStyle:{},...N,...f}):(G={...u,...w},z={listId:"",listType:Pt.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...N}),h===C){g.push({startIndex:h,paragraphStyle:G,bullet:z});break}}l.push(...g),g=[]}t.paragraphs=l}return du(e,t,n,r),a}function Gp(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=Ru(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===Pe.COVER?u.push({...f,...c}):u.push({...c,...f});break}}l.push(...u),u=[]}t.sectionBreaks=l}return fu(e,t,n,r),a}function Kp(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=Iu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===Pe.COVER?u.push({...f,...c}):u.push({...c,...f});break}}l.push(...u),u=[]}t.customBlocks=l}return gu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function Xp(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Su(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let f=[];for(const g of a){const{startIndex:v,endIndex:C}=g;if(v>=h&&C<=u){s===Pe.COVER?f.push({...g,...c}):f.push({...c,...g});break}}l.push(...f),f=[]}t.tables=l}return mu(e,t,n,r),a}function Qp(e,t,n,r,s){e.customRanges||(e.customRanges=[]),Ei(e.customRanges,r),Ei(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:f,endIndex:g}=u;f>=i&&g<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:f,endIndex:g}=u;l.push({...u,startIndex:f+r,endIndex:g+r})}),e.customRanges=pi(l),h):[]}function Jp(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),vi(e.customDecorations,r),vi(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 c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+n-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:h}=l;o.push({...l,startIndex:c+r,endIndex:h+r})})}else for(const l of a){const{id:c}=l;if(l.type===hn.DELETED){const h=o.filter(u=>u.id===c);h.length&&i.push(...h)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,h=o.findIndex(u=>u.id===c);h!==-1&&o.splice(h,1)}return e.customDecorations=Eu(o),i}var Ci=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Ci||{});function Jt(e,t,n,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(t,n)};if(o){const N=[];for(const G of o){const z=he.deepClone(G),{st:oe,ed:M}=z;he.hasIntersectionBetweenTwoRanges(oe,M,t,n)&&(t>=oe&&t<=M?N.push({...z,st:t,ed:Math.min(n,M)}):n>=oe&&n<=M?N.push({...z,st:Math.max(t,oe),ed:n}):N.push(z))}u.textRuns=nr(N.map(G=>{const{st:z,ed:oe}=G;return{...G,st:z-t,ed:oe-t}}))}else r&&(u.textRuns=[{st:0,ed:n-t,ts:{}}]);const f=[];for(const N of c){const G=he.deepClone(N),{startIndex:z,endIndex:oe}=G;z>=t&&oe<=n&&f.push({...G,startIndex:z-t,endIndex:oe-t})}f.length&&(u.tables=f);const g=[];for(const N of a){const{startIndex:G}=N;G>=t&&G<n&&g.push(he.deepClone(N))}g.length&&(u.paragraphs=g.map(N=>({...N,startIndex:N.startIndex-t})));const v=[];for(const N of h){const{startIndex:G}=N;G>=t&&G<=n&&v.push(he.deepClone(N))}if(v.length&&(u.sectionBreaks=v.map(N=>({...N,startIndex:N.startIndex-t}))),s===1){const N=Au(e,t,n);N?u.customDecorations=N:r&&(u.customDecorations=[])}const{customRanges:C}=bu(e,t,n);C?u.customRanges=C:r&&(u.customRanges=[]);const w=[];for(const N of l){const{startIndex:G}=N;G>=t&&G<=n&&w.push(he.deepClone(N))}return w.length&&(u.customBlocks=w.map(N=>({...N,startIndex:N.startIndex-t}))),u}function qp(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 c=`${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:c,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function bu(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 Au(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=he.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function Zp(e,t,n){return e==null||t==null?e!=null?e:t:wu(e,t,n)}function e0(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 t0(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 Ri(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:c=[],customRanges:h,customDecorations:u=[]}=t;r.textRuns=Zp(l,s,n),r.customRanges=e0(h,o,n);const f=t0(u,a,n);f.length&&(r.customDecorations=f);const g=[];let v=0,C=0;for(;v<i.length&&C<c.length;){const w=i[v],N=c[C],{startIndex:G}=w,{startIndex:z}=N;G===z?(g.push(he.deepMerge(w,N)),v++,C++):G<z?(g.push(he.deepClone(w)),v++):(g.push(he.deepClone(N)),C++)}return v<i.length&&g.push(...i.slice(v)),C<c.length&&g.push(...c.slice(C)),g.length&&(r.paragraphs=g),r}function n0(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 Tn{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===ge.DELETE||n.t===ge.RETAIN&&n.body==null?he.deepClone({...n,len:t}):he.deepClone({...n,len:t,body:Jt(n.body,r,r+t,!1)})}else return{t:ge.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:ge.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[]}}function Tu(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=vu(e,t,n),a=Cu(e,t,n),l=Ru(e,t,n),c=Iu(e,t,n),h=Su(e,t,n),u=Bp(e,t,n),f=Hp(e,t,n);let g="";return r&&(e.dataStream=hl(r,s,i),g=r.slice(s,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:f}}function Nu(e,t,n,r){e.dataStream=cl(e.dataStream,r,t.dataStream),hu(e,t,n,r),du(e,t,n,r),fu(e,t,n,r),gu(e,t,n,r),mu(e,t,n,r),$p(e,t,n,r),xp(e,t,n,r)}function r0(e,t,n,r,s=Pe.COVER){return Yp(e,t,n,r,s)}function s0(e,t,n){return t<=0?{dataStream:""}:Tu(e,t,n)}function i0(e,t,n,r){n!==0&&Nu(e,t,n,r)}function o0(e,t){const n=new Sn;return n.reset(),t.forEach(r=>{const s=he.deepClone(r);switch(s.t){case ge.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&r0(e,o,a,n.cursor,i),n.moveCursor(a);break}case ge.INSERT:{const{body:i,len:o}=s;i0(e,i,o,n.cursor),n.moveCursor(o);break}case ge.DELETE:{const{len:i}=s;s0(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function a0(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=he.deepClone(t),e=he.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,c=0,h=null;function u(){return h?(i.push(h),h=null,!0):!1}for(;l<o&&c<a;){const{st:C,ed:w,ts:N}=t[l],{st:G,ed:z,ts:oe,sId:M}=e[c];let T={};if(s===0)T={...N},n===Pe.COVER&&r===Pe.REPLACE&&oe&&(T=Object.assign({},oe,T));else if(T={...N},n===Pe.REPLACE){if(r===Pe.REPLACE)T={...oe};else if(N&&oe){const W=Object.keys(N);for(const Z of W)oe[Z]&&delete T[Z]}}else if(r===Pe.REPLACE){if(oe){const W=Object.keys(oe);for(const Z of W)oe[Z]!==void 0&&(T[Z]=oe[Z])}}else if(oe){const W=Object.keys(oe);for(const Z of W)T[Z]!==void 0&&delete T[Z]}if(w<G)u()||i.push(t[l]),l++;else if(z<C)u()||i.push(e[c]),c++;else{const W={st:Math.min(C,G),ed:Math.max(C,G),ts:C<G?{...N}:{...oe},sId:C<G?void 0:M};W.ed>W.st&&i.push(),i.push({st:Math.max(C,G),ed:Math.min(w,z),ts:T,sId:M}),w<z?(l++,e[c].st=w,e[c].st===e[c].ed&&c++):(c++,t[l].st=z,t[l].st===t[l].ed&&l++);const Z={st:Math.min(w,z),ed:Math.max(w,z),ts:w<z?{...oe}:{...N},sId:w<z?M:void 0};h=Z.ed>Z.st?Z:null}}u();const f=i[i.length-1],g=t[o-1],v=e[a-1];return f.ed!==Math.max(g.ed,v.ed)&&(g.ed>v.ed?i.push(g):i.push(v)),nr(i,!0)}function l0(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?[he.deepClone(i)]:[he.deepClone(o)];if(r===Pe.REPLACE){const a=he.deepClone(o);return s===1&&Object.assign(a,he.deepClone(i)),[a]}else{const a=he.deepClone(o);return s===1&&Object.assign(a,he.deepClone(i)),[a]}}function Mu(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=he.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?he.deepClone(e.bullet):he.deepClone(t.bullet):e.bullet===void 0?i.bullet=he.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?he.deepClone(t.bullet):he.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=he.deepClone(t.bullet)),i}function u0(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return he.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===hn.DELETED||i===hn.DELETED)&&(o=!0,n.push({...r,type:hn.DELETED}));break}o||n.push(r)}return n}function c0(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:c,paragraphs:h=[],customRanges:u,customDecorations:f}=r,{textRuns:g,paragraphs:v=[],customRanges:C,customDecorations:w}=i,N=a0(c,g,s,o,n?1:0);N&&(a.textRuns=N);const G=l0(u,C,s,o,n?1:0);G&&(a.customRanges=G);const z=u0(f,w);z&&(a.customDecorations=z);const oe=[];let M=0,T=0;for(;M<h.length&&T<v.length;){const W=h[M],Z=v[T],{startIndex:fe}=W,{startIndex:le}=Z;if(fe===le){let p={startIndex:fe};n?p=Mu(W,Z,s,o,1):p=Mu(W,Z,s,o,0),oe.push(p),M++,T++}else fe<le?M++:(oe.push(he.deepClone(Z)),T++)}return T<v.length&&oe.push(...v.slice(T)),oe.length&&(a.paragraphs=oe),{coverType:l,body:a}}function Du(e){return Object.keys(e).length===1}const Un=class Un{constructor(){R(this,"_actions",[])}static apply(t,n){return o0(t,n)}static compose(t,n){const r=new Tn(t),s=new Tn(n),i=new Un;for(;r.hasNext()||s.hasNext();)if(s.peekType()===ge.INSERT)i.push(s.next());else if(r.peekType()===ge.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===ge.INSERT&&l.t===ge.RETAIN)l.body==null?i.push(a):i.push({...a,body:Ri(a.body,l.body,l.coverType)});else if(a.t===ge.RETAIN&&l.t===ge.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===Pe.REPLACE||l.coverType===Pe.REPLACE?Pe.REPLACE:Pe.COVER;i.push({...a,t:ge.RETAIN,coverType:c,body:Ri(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===ge.RETAIN&&l.t===ge.DELETE?i.push(l):a.t===ge.INSERT&&(l.t,ge.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 Tn(t),i=new Tn(n),o=new Un;for(;s.hasNext()||i.hasNext();)if(s.peekType()===ge.INSERT&&(r==="left"||i.peekType()!==ge.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===ge.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===ge.DELETE)continue;if(c.t===ge.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=c0(l,c,r==="left");o.push({...c,t:ge.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new Tn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===ge.DELETE){n-=Math.min(o,n-i);continue}else a===ge.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===ge.INSERT)n.push({t:ge.DELETE,len:r.len,body:r.body});else if(r.t===ge.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:ge.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:ge.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===ge.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=Jt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===ge.RETAIN&&i.body!=null){const o=Jt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==ge.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:ge.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:ge.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:ge.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=he.deepClone(t[0]);if(s.t===ge.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===ge.DELETE&&s.t===ge.DELETE)return r.len+=s.len,this;if(r.t===ge.DELETE&&s.t===ge.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===ge.RETAIN&&s.t===ge.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===ge.INSERT&&Du(r.body)&&s.t===ge.INSERT&&Du(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===ge.RETAIN&&n0(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};R(Un,"id","text-x"),R(Un,"uri","https://github.com/dream-num/univer#text-x");let nt=Un;Object.defineProperty(nt,"name",{value:"text-x"});const Pn=class Pn{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==nt.id||(this._subTypes.set(t.name,t),_t.type.registerSubtype(t))}static apply(t,n){if(!_t.type.isNoop(n))return _t.type.apply(t,n)}static compose(t,n){return _t.type.compose(t,n)}static transform(t,n,r){return _t.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===nt.name?nt.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return _t.type.invertWithDoc(t,n)}static isNoop(t){return _t.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Pn),this._instance}removeOp(t,n){return _t.removeOp(t,n)}moveOp(t,n){return _t.moveOp(t,n)}insertOp(t,n){return _t.insertOp(t,n)}replaceOp(t,n,r){return _t.replaceOp(t,n,r)}editOp(t,n=["body"]){return _t.editOp(n,nt.name,t)}};R(Pn,"uri","https://github.com/dream-num/univer#json-x"),R(Pn,"_subTypes",new Map),R(Pn,"_instance",null);let Ht=Pn;Ht.registerSubtype(nt);const Ii={id:"default_doc",documentStyle:{}};class h0 extends ts{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={...Ii,...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{...rr,...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,c=s==null?void 0:s[n];if(!c)return;const h=c.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 jt extends h0{constructor(n){var s,i;super(he.isEmptyObject(n)?Np():n);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:he.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={...Ii,...n},this._initializeHeaderFooterModel()}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(!Ht.isNoop(n))return this.snapshot=Ht.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.snapshot}sliceBody(n,r,s=Ci.copy){const i=this.getBody();if(i!=null)return Jt(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 jt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new jt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}const d0="0.5.2";function f0(e="",t=Kn.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:d0,locale:t,styles:{},sheets:{},resources:[]}}class Lu{constructor(t={}){R(this,"_styles");R(this,"_cacheMap",new Qn(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=he.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&&he.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(he.diffValue(n[r],t))return r;return null}}function g0(e){const{ranges:t,id:n,type:r}=e,s=new nt;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:ge.RETAIN,len:l-i}),s.push({t:ge.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function m0(e){var h,u,f;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(f=(u=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:f.find(g=>g.id===t);if(!i)return!1;const o=new nt,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:ge.RETAIN,len:a}),o.push({t:ge.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:hn.DELETED}]}}),o}function Uu(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function _0(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):Uu(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function p0(e){return{...he.deepClone(e),rangeId:un()}}function E0(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 Pu(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 v0(e,t){var i,o,a,l,c;const n=Pu(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,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}function C0(e,t){var f,g,v;const{rangeId:n,segmentId:r,documentDataModel:s,insert:i}=t,o=(g=(f=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:f.customRanges)==null?void 0:g.find(C=>C.rangeId===n);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new nt,h=l-a+1;c.push({t:ge.RETAIN,len:a}),c.push({t:ge.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:ge.INSERT,body:i,len:i.dataStream.length});const u=l+1+((v=i==null?void 0:i.dataStream.length)!=null?v:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function R0(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new nt;let c=!1;return t.forEach(h=>{var z,oe,M;const u=v0(h,o);if(!u||!o)return!1;const{startOffset:f,endOffset:g}=u,v=(z=o.customRanges)!=null?z:[],C=(T,W,Z)=>{var O,L,b,y;const fe=Pu(T,W,v,r),le=Math.min((L=(O=fe[0])==null?void 0:O.startIndex)!=null?L:1/0,T),p=Math.max((y=(b=fe[fe.length-1])==null?void 0:b.endIndex)!=null?y:-1/0,W),j={rangeId:Z?`${n}$${Z}`:n,rangeType:r,startIndex:0,endIndex:p-le,wholeEntity:s,properties:{...i}};l.push({t:ge.RETAIN,len:le-a}),l.push({t:ge.RETAIN,len:p-le+1,body:{dataStream:"",customRanges:[j]},coverType:Pe.COVER}),a=p+1},w=((oe=o.paragraphs)!=null?oe:[]).filter(T=>T.startIndex<g&&T.startIndex>f),N=((M=o.customBlocks)!=null?M:[]).filter(T=>T.startIndex<g&&T.startIndex>f);E0([f,g-1],[...w.map(T=>T.startIndex),...N.map(T=>T.startIndex)]).forEach(([T,W],Z)=>C(T,W,Z)),c=!0,l.selections=[{startOffset:u.endOffset,endOffset:u.endOffset,collapsed:!0}]}),c?l:!1}function Fu(e,t,n=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:ge.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:ge.DELETE,len:u-l}),l=u)}),r&&i.push({t:ge.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:ge.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}const I0=e=>{var u;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=t.collapsed?null:Jt(i,t.startOffset,t.endOffset),a=To(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([f,g])=>{switch(f){case 0:{const v={t:ge.RETAIN,body:{...Jt(n,l,l+g.length,!1),dataStream:""},len:g.length};return l+=g.length,v}case 1:{const v={t:ge.INSERT,body:Jt(n,l,l+g.length),len:g.length};return l+=g.length,v}default:return{t:ge.DELETE,len:g.length}}}),h=new nt;return h.push({t:ge.RETAIN,len:t.startOffset}),h.push(...c),h};function S0(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 O0(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 y0=e=>{var C,w,N,G;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new nt,l=Ht.getInstance(),c=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const u=(w=(C=n.getSnapshot().drawingsOrder)==null?void 0:C.length)!=null?w:0;let f=0;if(s)i>0&&a.push({t:ge.RETAIN,len:i});else{const z=Fu([t],h,0,null,!1);a.push(...z);const oe=S0(h,[t]),M=(N=n.getDrawings())!=null?N:{},T=(G=n.getDrawingsOrder())!=null?G:[],W=oe.sort((Z,fe)=>T.indexOf(Z)>T.indexOf(fe)?-1:T.indexOf(Z)<T.indexOf(fe)?1:0);if(W.length>0)for(const Z of W){const fe=M[Z],le=T.indexOf(Z);if(fe==null||le<0)continue;const p=l.removeOp(["drawings",Z],fe),j=l.removeOp(["drawingsOrder",le],Z);c.push(p),c.push(j),f++}}a.push({t:ge.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((z,oe)=>({startIndex:oe,blockId:z.drawingId}))},len:r.length});const g=O0(n,o),v=l.editOp(a.serialize(),g);c.push(v);for(const z of r){const{drawingId:oe}=z,M=l.insertOp(["drawings",oe],z),T=l.insertOp(["drawingsOrder",u-f],oe);c.push(M),c.push(T)}return c.reduce((z,oe)=>Ht.compose(z,oe),null)},w0=e=>{var u,f,g;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(f=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs)!=null?f:[],o=t.every(v=>{var C;return((C=v.bullet)==null?void 0:C.listType.indexOf(s))===0});let l=he.generateRandomId(6);if(t.length===1){const v=i.indexOf(t[0]),C=i[v-1],w=i[v+1];C&&C.bullet&&C.bullet.listType.indexOf(s)===0?(l=C.bullet.listId,s!==Pt.CHECK_LIST&&(s=C.bullet.listType)):w&&w.bullet&&w.bullet.listType.indexOf(s)===0&&(l=w.bullet.listId,s!==Pt.CHECK_LIST&&(s=w.bullet.listType))}const c=new Sn;c.reset();const h=new nt;for(const v of t){const{startIndex:C,paragraphStyle:w={},bullet:N}=v;h.push({t:ge.RETAIN,len:C-c.cursor}),h.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:w,startIndex:0}:{startIndex:0,paragraphStyle:{...w},bullet:{nestingLevel:(g=N==null?void 0:N.nestingLevel)!=null?g:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),c.moveCursorTo(C+1)}return h},b0=e=>{var u;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(f=>f.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Pt.CHECK_LIST)===-1)return!1;const o=new Sn;o.reset();const a=new nt,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===Pt.CHECK_LIST?Pt.CHECK_LIST_CHECKED:Pt.CHECK_LIST;return a.push({t:ge.RETAIN,len:l-o.cursor}),a.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},A0=e=>{var h,u;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=he.generateRandomId(6),l=new Sn;l.reset();const c=new nt;for(const f of t){const{startIndex:g,paragraphStyle:v={},bullet:C}=f;c.push({t:ge.RETAIN,len:g-l.cursor}),c.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:v,bullet:{nestingLevel:(u=C==null?void 0:C.nestingLevel)!=null?u:0,textStyle:(C==null?void 0:C.listType)===n?C.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(g+1)}return c};function T0(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const N0=e=>{var h,u,f;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Sn;i.reset();const o=new nt,a=(h=r.getSnapshot().lists)!=null?h:{},l=(f=(u=r.getBody())==null?void 0:u.tables)!=null?f:[],c={...rr,...a};for(const g of t){const{startIndex:v,paragraphStyle:C={},bullet:w}=g,N=T0(g,l);if(o.push({t:ge.RETAIN,len:v-i.cursor}),w){const G=w.listType;let z=c[G].nestingLevel.length-1;N&&(z=Math.min(z,2)),o.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...C},bullet:{...w,nestingLevel:Math.max(Math.min(w.nestingLevel+s,z),0)}}]},coverType:Pe.REPLACE})}else o.push({t:ge.RETAIN,len:1});i.moveCursorTo(v+1)}return o};var ku=(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))(ku||{}),qt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
|
|
9
|
-
`,e.TABLE_START="",e.TABLE_ROW_START="\x1B",e.TABLE_CELL_START="",e.TABLE_CELL_END="",e.TABLE_ROW_END="",e.TABLE_END="",e.CUSTOM_RANGE_START="",e.CUSTOM_RANGE_END="",e.COLUMN_BREAK="\v",e.PAGE_BREAK="\f",e.DOCS_END="\0",e.TAB=" ",e.CUSTOM_BLOCK="\b",e.LETTER="",e.SPACE=" ",e))(
|
|
10
|
-
`)?e.slice(0,-2):e;return D0.reduce((n,r)=>n.replaceAll(r,""),t)},L0=e=>e?$u(e).replaceAll("\r","")==="":!0,U0=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=t.slice(s,l);if(he.isLegalUrl(h)){const u=un(),f=`${h}`,g={startIndex:s,endIndex:s+f.length-1,rangeId:u,rangeType:er.HYPERLINK,properties:{url:e}};r.push(g),i+=f,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&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 P0(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 F0(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 k0(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class Tt{}R(Tt,"customRange",{add:R0,delete:C0,copyCustomRange:p0,getCustomRangesInterestsWithSelection:_0,isIntersecting:Uu}),R(Tt,"customDecoration",{add:g0,delete:m0}),R(Tt,"selection",{replace:I0,makeSelection:P0,normalizeSelection:F0,delete:Fu}),R(Tt,"range",{isIntersects:k0}),R(Tt,"transform",{getPlainText:$u,fromPlainText:U0,isEmptyDocument:L0}),R(Tt,"paragraph",{bullet:{set:A0,switch:w0,toggleChecklist:b0,changeNestLevel:N0}}),R(Tt,"drawing",{add:y0});const $0=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Qt.equals(r,n))),x0=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Qt.equals(n.range,s.range)}),Si={t:0,b:2,l:2,r:2},B0=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),xu=90;function sr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Vt.UNSPECIFIED,verticalAlign:a=an.UNSPECIFIED,wrapStrategy:l=ln.UNSPECIFIED,cellValueType:c}=n,{t:h,r:u,b:f,l:g}=i||Si,{vertexAngle:v,centerAngle:C}=Yu(s),w={id:"d",body:{dataStream:`${e}${Mo}`,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:u,marginLeft:g,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:C,vertexAngle:v,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new jt(w)}function H0(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 Bu(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function Hu(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===er.HYPERLINK))return;const s=Tt.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:er.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&nt.apply(r,s.serialize())}function ju(e){return e!=null}const j0='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Wu(e){const t=ut.ff,n=ut.fs;if(!e){const u=`${n}pt ${t}`;return{fontCache:u,fontString:u,fontSize:n,originFontSize:n,fontFamily:t}}let r=wn.ITALIC;(e.it===0||e.it===void 0)&&(r=wn.NORMAL);let s=wn.BOLD;(e.bl===0||e.bl===void 0)&&(s=wn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=t),o=u}const{va:a}=e;let l=i;if(a===xt.SUBSCRIPT||a===xt.SUPERSCRIPT){const u=W0(o,l),{sbr:f,spr:g}=u;l*=a===xt.SUBSCRIPT?f:g}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${j0} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function W0(e,t){return B0(t)}function Yu(e){const{a:t=0,v:n=Ue.FALSE}=e||{a:0,v:Ue.FALSE};let r=0,s=t;return n===Ue.TRUE&&(r=xu,s=xu),{centerAngle:r,vertexAngle:s}}class Y0{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!==Ue.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:De.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:De.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:De.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:De.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 Xt(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Ue.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}}class z0{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:Ue.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===Ue.TRUE)&&typeof c=="number"?c: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:De.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:De.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:De.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:De.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Ue.TRUE:!0}getSize(){return Xt(this._rowData)}}const V0="DEFAULT_WORKSHEET_ROW_COUNT",zu=1e3,G0="DEFAULT_WORKSHEET_COLUMN_COUNT",Vu=20,K0="DEFAULT_WORKSHEET_ROW_HEIGHT",Gu=24,X0="DEFAULT_WORKSHEET_COLUMN_WIDTH",Ku=88,Q0="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Xu=46,J0="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Qu=20;function Ju(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Ue.FALSE,rowCount:zu,columnCount:Vu,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Ku,defaultRowHeight:Gu,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Ue.TRUE,rowHeader:{width:Xu,hidden:Ue.FALSE},columnHeader:{height:Qu,hidden:Ue.FALSE},rightToLeft:Ue.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class q0 extends rt{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 Qn(5e4));R(this,"_skeletonCache",new Qn(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===De.ROW?this._createRowCache(s,r):i===De.COLUMN?this._createColumnCache(s,r):i===De.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||!he.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!he.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 c=[];for(const h of this._mergeData||[])Qt.intersects(h,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),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 c=[];for(let h=0;h<a.length;h++){const{startRow:u,endRow:f,startColumn:g,endColumn:v}=a[h];for(let C=n;C<=s;C++){let w=!1;for(let N=r;N<=i;N++)if(C>=u&&C<=f&&N>=g&&N<=v){o.push({startRow:u,endRow:f,startColumn:g,endColumn:v}),c.push(h),w=!0;break}if(w)break}}return this._skeletonCache.set(l,c),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 qu extends rt{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){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,In.Value|In.Style):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,In.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,In.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,Qe(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Qe(()=>this._rowFilteredInterceptor=null)}}const Zu={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class ir{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=Ju(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:he.generateRandomId(6),this._cellData=new Lt(o),this._viewModel=new qu((l,c)=>this.getCellRaw(l,c)),this._rowManager=new z0(this._snapshot,this._viewModel,i),this._columnManager=new Y0(this._snapshot,s),this._spanModel=new q0(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 c=s?Js(a,i,o,l):Js(a,o,i,l);r||(r={}),r.s=c}}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((c,h)=>{Object.keys(h).forEach(u=>{const f=+u,g=t.getValue(c,f),v=g!=null&&g.s?this._styles.get(g.s):null,C=(v==null?void 0:v.bd)&&(v.bd.b||v.bd.l||v.bd.r||v.bd.t||v.bd.bc_tr||v.bd.bl_tr||v.bd.ml_tr||v.bd.tl_bc||v.bd.tl_br||v.bd.tl_mr);(g&&(g.v||g.p)||v!=null&&v.bg||C)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,f):(l=!0,i=f),o=Math.max(o,f))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.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=he.deepClone(t);return new ir(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,c=n;if(r){const{startRow:h,endRow:u,startColumn:f,endColumn:g}=r;t===h&&n===f?(o=u,a=g,l=h,c=f,i=!0):t>=h&&t<=u&&n>=f&&n<=g&&(o=u,a=g,l=h,c=f,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}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)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getMatrixWithMergedCells(t,n,r,s,i=On.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new Lt;return li(t,r,n,s).forEach((c,h)=>{var f;let u;if(i===On.Raw)u=this.getCellRaw(c,h);else if(i===On.Intercepted)u=this.getCell(c,h);else if(i===On.Both){u=this.getCellRaw(c,h);const g=(f=this.getCell(c,h))==null?void 0:f.v;ju(g)&&u&&(u.displayV=String(g))}u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:f,endRow:g}=c;li(u,g,h,f).forEach((v,C)=>{v===u&&C===h&&l.setValue(v,C,{...o.getValue(v,C),rowSpan:g-u+1,colSpan:f-h+1}),(v!==u||C!==h)&&l.realDeleteValue(v,C)})}),l}getRange(t,n,r,s){return typeof t=="object"?new yn(this,t,{getStyles:()=>this._styles}):new yn(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,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const h=a.getCell(l,c),u=!h,f=a.getMergedCell(l,c);if(f){if(l!==f.startRow||c!==f.startColumn){c=f.endColumn+1;continue}if(u&&n){c=f.endColumn+1;continue}const v={row:l,col:c,value:h};return v.colSpan=f.endColumn-f.startColumn+1,v.rowSpan=f.endRow-f.startRow+1,c=f.endColumn+1,{done:!1,value:v}}if(u&&n)c+=1;else{const g={row:l,col:c,value:h};return c+=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 c=s,h=i;return{next(){for(;;){if(c>o&&(h+=1,c=s),h>a)return{done:!0,value:void 0};const u=l.getMergedCell(c,h);if(u){const v=c!==u.startRow,C=v||h!==u.startColumn;if(r&&C||!r&&v){c=u.endRow+1;continue}const w=l.getCell(u.startRow,u.startColumn);if(!w&&n){c=u.endRow+1;continue}const G={row:c,col:u.startColumn,value:w};return G.colSpan=u.endColumn-u.startColumn+1,G.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:G}}const f=l.getCell(c,h);if(!f&&n)c+=1;else{const v={row:c,col:h,value:f};return c+=1,{done:!1,value:v}}}}}}}}_getCellDocumentModel(t,n=Zu){var C;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Zu,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const c=H0(o),h=i?ut.tr:c.textRotation||ut.tr;let u=c.horizontalAlign||ut.ht;const f=c.verticalAlign||ut.vt,g=c.wrapStrategy||ut.tb,v=c.paddingData||Si;if(t.f&&s)a=sr(t.f.toString(),{},{verticalAlign:f}),u=ut.ht;else if(t.p){const{centerAngle:w,vertexAngle:N}=Yu(h);a=this._updateConfigAndGetDocumentModel(r?he.deepClone(t.p):t.p,u,v,{horizontalAlign:u,verticalAlign:f,centerAngle:w,vertexAngle:N,wrapStrategy:g,zeroWidthParagraphBreak:1})}else if(t.v!=null){const w=Bu(o);l=Wu(w).fontCache;let N=ec(t);t.t===Gt.FORCE_STRING&&s&&(N=`'${N}`),a=sr(N,w,{...c,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Hu(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:g,verticalAlign:f,horizontalAlign:u,paddingData:v,fill:(C=o==null?void 0:o.bg)==null?void 0:C.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,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=(c=r.l)!=null?c: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 u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=n;return new jt(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=Bu(r);if(n!=null)return n.documentModel==null&&(n.documentModel=sr("",s)),n;const i="";let o="document";const a=ut.tr,l=ut.ht,c=ut.vt,h=ut.tb,u=Si;return o=Wu({}).fontCache,{documentModel:sr(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function ec(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 Tt.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Gt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Gt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function Z0(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 Tt.transform.getPlainText(n)}return e==null?void 0:e.v}var eE=Object.defineProperty,tE=Object.getOwnPropertyDescriptor,nE=(e,t,n,r)=>{for(var s=r>1?void 0:r?tE(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&&eE(t,n,s),s},rE=(e,t)=>(n,r)=>t(n,r,e);function sE(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}d.Workbook=class extends ts{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=f0();he.isEmptyObject(n)?this._snapshot=s:this._snapshot=he.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=he.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Lu(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 he.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 ir(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()!==Ue.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===Ue.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Ue.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(he.isEmptyObject(s)){const o=he.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 c=new ir(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}},d.Workbook=nE([rE(1,wt)],d.Workbook);class Oi extends ts{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={...ml,...n},this._unitId=(r=this._snapshot.id)!=null?r:he.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:un(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=un(6);return{id:n,pageType:hi.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 or="FOCUSING_UNIT",Nn="FOCUSING_SHEET",ar="FOCUSING_DOC",lr="FOCUSING_SLIDE",iE="FOCUSING_EDITOR_BUT_HIDDEN",tc="EDITOR_ACTIVATED",oE="FOCUSING_EDITOR_INPUT_FORMULA",nc="FOCUSING_FX_BAR_EDITOR",aE="FOCUSING_UNIVER_EDITOR",lE="FOCUSING_EDITOR_INPUT_FORMULA",uE="FOCUSING_PANEL_EDITOR",cE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",hE="FOCUSING_COMMON_DRAWINGS",dE="FORMULA_EDITOR_ACTIVATED";var fE=Object.defineProperty,gE=Object.getOwnPropertyDescriptor,mE=(e,t,n,r)=>{for(var s=r>1?void 0:r?gE(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&&fE(t,n,s),s},rc=(e,t)=>(n,r)=>t(n,r,e);const gn=mt("univer.current");d.UniverInstanceService=class extends rt{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(or,!0),this._contextService.setContextValue(ar,!1),this._contextService.setContextValue(Nn,!0),this._contextService.setContextValue(lr,!1),this.setCurrentUnitForType(n)):this.focused instanceof jt?(this._contextService.setContextValue(or,!0),this._contextService.setContextValue(ar,!0),this._contextService.setContextValue(Nn,!1),this._contextService.setContextValue(lr,!1),this.setCurrentUnitForType(n)):this.focused instanceof Oi?(this._contextService.setContextValue(or,!0),this._contextService.setContextValue(ar,!1),this._contextService.setContextValue(Nn,!1),this._contextService.setContextValue(lr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(or,!1),this._contextService.setContextValue(ar,!1),this._contextService.setContextValue(Nn,!1),this._contextService.setContextValue(lr,!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=mE([rc(0,lt(Rt)),rc(1,zn)],d.UniverInstanceService);var ze=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(ze||{});const _E={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var pE=Object.defineProperty,EE=Object.getOwnPropertyDescriptor,vE=(e,t,n,r)=>{for(var s=r>1?void 0:r?EE(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&&pE(t,n,s),s},CE=(e,t)=>(n,r)=>t(n,r,e);d.LifecycleService=class extends rt{constructor(n){super();R(this,"_lifecycle$",new Ce.BehaviorSubject(ze.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(this,"_lock",!1);this._logService=n,this._reportProgress(ze.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(sc(this.stage),this._lifecycle$.pipe(Ce.skip(1))).pipe(Ia(n=>n===ze.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${_E[n]}".`)}},d.LifecycleService=vE([CE(0,wt)],d.LifecycleService);function sc(e){switch(e){case ze.Starting:return Ce.of(ze.Starting);case ze.Ready:return Ce.of(ze.Starting,ze.Ready);case ze.Rendered:return Ce.of(ze.Starting,ze.Ready,ze.Rendered);default:return Ce.of(ze.Starting,ze.Ready,ze.Rendered,ze.Steady)}}var RE=Object.defineProperty,IE=Object.getOwnPropertyDescriptor,SE=(e,t,n,r)=>{for(var s=r>1?void 0:r?IE(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&&RE(t,n,s),s},yi=(e,t)=>(n,r)=>t(n,r,e);const Zt=mt("univer.undo-redo.service"),OE=20;class ic{dispose(){}async dispatchToHandlers(){return!1}}const oc="univer.command.redo",ac="univer.command.undo",ur=new class extends ic{constructor(){super(...arguments);R(this,"type",Vn.COMMAND);R(this,"id",ac)}async handler(t){const n=t.get(Zt),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(Mt);return Xs(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},cr=new class extends ic{constructor(){super(...arguments);R(this,"type",Vn.COMMAND);R(this,"id",oc)}async handler(t){const n=t.get(Zt),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(Mt);return Xs(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};d.LocalUndoRedoService=class extends rt{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(ur)),this.disposeWithMe(this._commandService.registerCommand(cr)),this.disposeWithMe(Qe(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Qe(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>OE&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),Qe(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(Nn),s=this._contextService.getContextValue(nc),i=this._contextService.getContextValue(tc);return r?s?n=Ns:i?n=Ts:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}},d.LocalUndoRedoService=SE([yi(0,gn),yi(1,Mt),yi(2,zn)],d.LocalUndoRedoService);const as=mt("core.resource-manager.service"),wi={[Ut.Editor]:"Editor",[Ut.Owner]:"Owner",[Ut.Reader]:"Reader",[Ut.UNRECOGNIZED]:"UNRECOGNIZED"},ls=e=>e?{userID:`${wi[e]}_${he.generateRandomId(8)}`,name:wi[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},yE=(e,t)=>e.startsWith(wi[t]);class Mn{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new Ce.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new Ce.BehaviorSubject(ls()));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 wE=Object.defineProperty,bE=Object.getOwnPropertyDescriptor,AE=(e,t,n,r)=>{for(var s=r>1?void 0:r?bE(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&&wE(t,n,s),s},lc=(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(ls(Ut.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?yE(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 un(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:Ut.Owner,shareScope:-1,scope:{read:ui.AllCollaborator,edit:ui.AllCollaborator},creator:ls(Ut.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(Ut.Owner)||this._getRole(Ut.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=AE([lc(0,as),lc(1,lt(Mn))],d.AuthzIoLocalService);const uc=mt("IAuthzIoIoService"),cc=mt("univer.config-service");class hc{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=bs(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 dc extends rt{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 hr extends rt{constructor(){super();R(this,"_currentLocale$",new Ce.BehaviorSubject(Kn.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(Qe(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=bs((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 TE=Object.defineProperty,NE=Object.getOwnPropertyDescriptor,ME=(e,t,n,r)=>{for(var s=r>1?void 0:r?NE(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&&TE(t,n,s),s},DE=(e,t)=>(n,r)=>t(n,r,e);d.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:Dr.PERSON,mentions:[{objectType:Dr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}},d.MentionIOLocalService=ME([DE(0,lt(Mn))],d.MentionIOLocalService);const fc=mt("univer.service.mention-io");var bi=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(bi||{});const gc=mt("univer.permission-service");class mc extends rt{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=bi.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(kt.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 _c(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 pc=Symbol("DependentOn");class Ai extends rt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(Ai,"pluginName"),R(Ai,"type",Be.UNIVER_UNKNOWN);class LE{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 UE{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var PE=Object.defineProperty,FE=Object.getOwnPropertyDescriptor,Ec=(e,t,n,r)=>{for(var s=r>1?void 0:r?FE(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&&PE(t,n,s),s},us=(e,t)=>(n,r)=>t(n,r,e);const kE=4;function $E(...e){return function(t){t[pc]=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(cs,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(cs,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()},kE))}_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=Ec([us(0,lt(Rt))],d.PluginService);let cs=class extends rt{constructor(t,n,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new UE);R(this,"_pluginStore",new LE);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[pc];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){sc(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case ze.Starting:r.onStarting();break;case ze.Ready:r.onReady();break;case ze.Rendered:r.onRendered();break;case ze.Steady:r.onSteady();break}})}};cs=Ec([us(2,wt),us(3,lt(Rt)),us(4,lt(d.LifecycleService))],cs);var xE=Object.defineProperty,BE=Object.getOwnPropertyDescriptor,HE=(e,t,n,r)=>{for(var s=r>1?void 0:r?BE(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&&xE(t,n,s),s},vc=(e,t)=>(n,r)=>t(n,r,e);let Ti=class extends rt{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();Do(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=he.deepClone(t.getSnapshot());return r.resources=n,r}};Ti=HE([vc(0,lt(as)),vc(1,lt(gn))],Ti);const Ni=mt("resource-loader-service");class Cc extends rt{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),Qe(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch{console.error("LoadResources Error!")}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Mi extends rt{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new Ce.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Qe(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}class Rc{constructor(t={},n){R(this,"_startedTypes",new Set);R(this,"_injector");R(this,"_disposingCallbacks",new Mr);const r=this._injector=jE(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(Mi).setTheme(s),o&&this._injector.get(hr).load(o),i&&this._injector.get(hr).setLocale(i),a&&this._injector.get(wt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(gn)}get _pluginService(){return this._injector.get(d.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Qe(t));return Qe(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(hr).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,jt),this._univerInstanceService.registerCtorForType(Be.UNIVER_SLIDE,Oi);const n=t.get(gn);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<ze.Ready&&(this._injector.get(d.LifecycleService).stage=ze.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function jE(e,t){const n=_c([[dc],[hr],[Mi],[d.LifecycleService],[d.PluginService],[Mn],[gn,{useClass:d.UniverInstanceService}],[gc,{useClass:mc}],[wt,{useClass:Ea,lazy:!0}],[Mt,{useClass:d.CommandService}],[Zt,{useClass:d.LocalUndoRedoService,lazy:!0}],[cc,{useClass:hc}],[zn,{useClass:_a}],[as,{useClass:Cc,lazy:!0}],[Ni,{useClass:Ti,lazy:!0}],[uc,{useClass:d.AuthzIoLocalService,lazy:!0}],[fc,{useClass:d.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Rt(n);return ia(r,[[Mn],[Ni]]),r}var WE=Object.defineProperty,YE=Object.getOwnPropertyDescriptor,zE=(e,t,n,r)=>{for(var s=r>1?void 0:r?YE(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&&WE(t,n,s),s},VE=(e,t)=>(n,r)=>t(n,r,e);d.FBlob=class extends on{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=zE([VE(1,lt(Rt))],d.FBlob);var GE=Object.defineProperty,KE=Object.getOwnPropertyDescriptor,XE=(e,t,n,r)=>{for(var s=r>1?void 0:r?KE(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&&GE(t,n,s),s},Ic=(e,t)=>(n,r)=>t(n,r,e);d.FHooks=class extends on{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return Qe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===ze.Starting)).subscribe(t))}onReady(t){return Qe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===ze.Ready)).subscribe(t))}onRendered(t){return Qe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===ze.Rendered)).subscribe(t))}onSteady(t){return Qe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===ze.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(Mt).beforeCommandExecuted(r=>{if(r.id===ur.id){const i=this._injector.get(Zt).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(Mt).onCommandExecuted(r=>{if(r.id===ur.id){const i=this._injector.get(Zt).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(Mt).beforeCommandExecuted(r=>{if(r.id===cr.id){const i=this._injector.get(Zt).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(Mt).onCommandExecuted(r=>{if(r.id===cr.id){const i=this._injector.get(Zt).pitchTopRedoElement();i&&t(i)}})}},d.FHooks=XE([Ic(0,lt(Rt)),Ic(1,lt(d.LifecycleService))],d.FHooks);var QE=Object.defineProperty,JE=Object.getOwnPropertyDescriptor,qE=(e,t,n,r)=>{for(var s=r>1?void 0:r?JE(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&&QE(t,n,s),s},Sc=(e,t)=>(n,r)=>t(n,r,e);let Di=class extends on{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};Di=qE([Sc(0,lt(Rt)),Sc(1,lt(Mn))],Di);var ZE=Object.defineProperty,ev=Object.getOwnPropertyDescriptor,tv=(e,t,n,r)=>{for(var s=r>1?void 0:r?ev(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&&ZE(t,n,s),s},Li=(e,t)=>(n,r)=>t(n,r,e);d.FUniver=class extends on{constructor(t,n,r){super(),this._injector=t,this._commandService=n,this._univerInstanceService=r}static newAPI(t){return(t instanceof Rc?t.__getInjector():t).createInstance(d.FUniver)}disposeUnit(t){return this._univerInstanceService.disposeUnit(t)}getCurrentLifecycleStage(){return this._injector.get(d.LifecycleService).stage}undo(){return this._commandService.executeCommand(ur.id)}redo(){return this._commandService.executeCommand(cr.id)}onBeforeCommandExecute(t){return this._commandService.beforeCommandExecuted((n,r)=>{t(n,r)})}onCommandExecuted(t){return this._commandService.onCommandExecuted((n,r)=>{t(n,r)})}executeCommand(t,n,r){return this._commandService.executeCommand(t,n,r)}syncExecuteCommand(t,n,r){return this._commandService.syncExecuteCommand(t,n,r)}getHooks(){return this._injector.createInstance(d.FHooks)}newBlob(){return this._injector.createInstance(d.FBlob)}getUserManager(){return this._injector.createInstance(Di)}},d.FUniver=tv([Li(0,lt(Rt)),Li(1,Mt),Li(2,gn)],d.FUniver);function Oc(e){return/^-?\d+(\.\d+)?$/.test(e)}function nv(e){return Oc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}class Ui{constructor(){R(this,"_data",[])}static create(){return new Ui}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 Pi{constructor(){R(this,"_data",new Map)}static create(){return new Pi}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}function rv(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 sv(e,t){return t.forEach(n=>e.add(n)),e}function iv(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new jt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const h=new nt,u=Ht.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}]),(c=f==null?void 0:f.customRanges)!=null&&c.length){const v=f.customRanges[0];g.customRanges=[{...v,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,g)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const ov="__default_document_sub_component_id20231101__";class yc{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class av 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 yc;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 lv(e){return new Ce.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const uv=mt("ILocalStorageService");function cv(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function hv(e){return new Promise(t=>setTimeout(t,e))}function dv(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var Fi=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(Fi||{}),wc=(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))(wc||{});const ki=mt("core.image-io.service");class fv{constructor(t,n=100){R(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new Qn(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(ki)?this._injector.get(ki):null;if(t===Fi.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 gv=["script","style","meta","comment","link"];var bc=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(bc||{}),Ac=(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))(Ac||{}),Tc=(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))(Tc||{}),Nc=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Nc||{}),Mc=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(Mc||{}),Dc=(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))(Dc||{});const Lc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],$i=1,dr=8;class xi{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!==$i)throw new Error(`Got v${s} data when expected v${$i}.`);const i=Lc[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 xi(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=Lc.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,dr,t),this.coords=new this.ArrayType(this.data,dr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(dr+o+a+l),this.ids=new this.IndexArrayType(this.data,dr,t),this.coords=new this.ArrayType(this.data,dr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,($i<<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 Bi(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],c=[];for(;l.length;){const h=l.pop()||0,u=l.pop()||0,f=l.pop()||0;if(u-f<=a){for(let w=f;w<=u;w++){const N=o[2*w],G=o[2*w+1];N>=t&&N<=r&&G>=n&&G<=s&&c.push(i[w])}continue}const g=f+u>>1,v=o[2*g],C=o[2*g+1];v>=t&&v<=r&&C>=n&&C<=s&&c.push(i[g]),(h===0?t<=v:n<=C)&&(l.push(f),l.push(g-1),l.push(1-h)),(h===0?r>=v:s>=C)&&(l.push(g+1),l.push(u),l.push(1-h))}return c}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=[],c=r*r;for(;a.length;){const h=a.pop()||0,u=a.pop()||0,f=a.pop()||0;if(u-f<=o){for(let w=f;w<=u;w++)Pc(i[2*w],i[2*w+1],t,n)<=c&&l.push(s[w]);continue}const g=f+u>>1,v=i[2*g],C=i[2*g+1];Pc(v,C,t,n)<=c&&l.push(s[g]),(h===0?t-r<=v:n-r<=C)&&(a.push(f),a.push(g-1),a.push(1-h)),(h===0?t+r>=v:n+r>=C)&&(a.push(g+1),a.push(u),a.push(1-h))}return l}}function Bi(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;Uc(e,t,o,r,s,i),Bi(e,t,n,r,o-1,1-i),Bi(e,t,n,o+1,s,1-i)}function Uc(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=n-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),v=Math.max(r,Math.floor(n-h*f/c+g)),C=Math.min(s,Math.floor(n+(c-h)*f/c+g));Uc(e,t,n,v,C,i)}const o=t[2*n+i];let a=r,l=s;for(fr(e,t,r,n),t[2*s+i]>o&&fr(e,t,r,s);a<l;){for(fr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?fr(e,t,r,l):(l++,fr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function fr(e,t,n,r){Hi(e,n,r),Hi(t,2*n,2*r),Hi(t,2*n+1,2*r+1)}function Hi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Pc(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function Fc(e,t,n=0,r=e.length-1,s=mv){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,h=Math.log(l),u=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(n,Math.floor(t-c*u/l+f)),v=Math.min(r,Math.floor(t+(l-c)*u/l+f));Fc(e,t,g,v,s)}const i=e[t];let o=n,a=r;for(gr(e,n,t),s(e[r],i)>0&&gr(e,n,r);o<a;){for(gr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?gr(e,n,a):(a++,gr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function gr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mv(e,t){return e<t?-1:e>t?1:0}class ji{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(!ds(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;ds(t,l)&&(n.leaf?r.push(a):Yi(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!ds(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(ds(t,o)){if(n.leaf||Yi(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=Ln([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const h=_v(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Yi(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!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=Ln(t.slice(n,r+1)),Dn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=Ln([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));kc(t,n,r,c,this.compareMinX);for(let h=n;h<=r;h+=c){const u=Math.min(h+c-1,r);kc(t,h,u,l,this.compareMinY);for(let f=h;f<=u;f+=l){const g=Math.min(f+l-1,u);a.children.push(this._build(t,f,g,s-1))}}return Dn(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 c=n.children[l],h=Wi(c),u=vv(t,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}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),_r(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=Ln(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Dn(r,this.toBBox),Dn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=Ln([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Dn(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=mr(t,0,a,this.toBBox),c=mr(t,a,r,this.toBBox),h=Cv(l,c),u=Wi(l)+Wi(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:pv,i=t.leaf?this.compareMinY:Ev,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=mr(t,0,n,i),a=mr(t,r-n,r,i);let l=hs(o)+hs(a);for(let c=n;c<r-n;c++){const h=t.children[c];_r(o,t.leaf?i(h):h),l+=hs(o)}for(let c=r-n-1;c>=n;c--){const h=t.children[c];_r(a,t.leaf?i(h):h),l+=hs(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)_r(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():Dn(t[n],this.toBBox)}}function _v(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 Dn(e,t){mr(e,0,e.children.length,t,e)}function mr(e,t,n,r,s){s||(s=Ln(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];_r(s,e.leaf?r(o):o)}return s}function _r(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 pv(e,t){return e.minX-t.minX}function Ev(e,t){return e.minY-t.minY}function Wi(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function hs(e){return e.maxX-e.minX+(e.maxY-e.minY)}function vv(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 Cv(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 Yi(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function ds(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Ln(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function kc(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;Fc(e,o,t,n,s),i.push(t,o,o,n)}}class Rv{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 ji),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 c=l.get(s);c&&c.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:c,endRow:h,endColumn:u}=s;for(let f=l;f<=h;f++){const g=a.get(f);if(g)for(let v=c;v<=u;v++){const C=g.get(v);C&&C.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 v;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(v=this._kdTree.get(n))==null?void 0:v.get(r);if(!c)return[];const{tree:h,items:u}=c,f=h.range(o,i,l,a),g=[];for(const C of f){const w=u[C];g.push(...Array.from(w.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 xi(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:c}=s;if(this._enableOneCellCache&&o===a&&l===c){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(c)&&(c=Number.POSITIVE_INFINITY),h.insert({minX:l,minY:o,maxX:c,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 c of l)yield c}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:c}=s;this._enableOneCellCache?o===l&&a===c?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 ji;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}Wc(),d.ABCToNumber=Op,d.AbsoluteRefType=et,d.ActionIterator=Tn,d.AlignTypeH=zl,d.AlignTypeV=Vl,d.ArrangeTypeEnum=Xl,d.ArrowsAndMarkersShapes=ka,d.AsyncInterceptorManager=Qg,d.AutoFillSeries=wa,d.BaselineOffset=xt,d.BasicShapes=Fa,d.BlockType=Ol,d.BooleanNumber=Ue,d.BorderStyleTypes=Xe,d.BorderType=ba,d.BuildTextUtils=Tt,d.BulletAlignment=Zn,d.COLORS=Zs,d.CellModeEnum=On,d.CellValueType=Gt,d.Color=cn,d.ColorBuilder=kr,d.ColorKit=bt,d.ColorType=It,d.ColumnSeparatorType=bl,d.CommandType=Vn,d.CommonHideTypes=Aa,d.ConfigService=hc,d.ContextService=_a,d.CopyPasteType=Ta,d.CustomCommandExecutionError=Gs,d.CustomDecorationType=hn,d.CustomRangeType=er,d.DEFAULT_CELL=cp,d.DEFAULT_DOC=Ii,d.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=ov,d.DEFAULT_EMPTY_DOCUMENT_VALUE=Mo,d.DEFAULT_RANGE=lp,d.DEFAULT_RANGE_ARRAY=ap,d.DEFAULT_SELECTION=up,d.DEFAULT_SLIDE=ml,d.DEFAULT_STYLES=ut,d.DEFAULT_WORKSHEET_COLUMN_COUNT=Vu,d.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=G0,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Qu,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=J0,d.DEFAULT_WORKSHEET_COLUMN_WIDTH=Ku,d.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=X0,d.DEFAULT_WORKSHEET_ROW_COUNT=zu,d.DEFAULT_WORKSHEET_ROW_COUNT_KEY=V0,d.DEFAULT_WORKSHEET_ROW_HEIGHT=Gu,d.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=K0,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Xu,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=Q0,d.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Ns,d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Ts,d.DOCS_ZEN_EDITOR_UNIT_ID_KEY=No,d.DOC_RANGE_TYPE=Qa,d.DashStyleType=Ul,d.DataStreamTreeNodeType=ku,d.DataStreamTreeTokenType=qt,d.DataValidationErrorStyle=bc,d.DataValidationImeMode=Ac,d.DataValidationOperator=Tc,d.DataValidationRenderMode=Nc,d.DataValidationStatus=Mc,d.DataValidationType=Dc,d.DeleteDirection=Na,d.DependentOn=$E,d.DesktopLogService=Ea,d.DeveloperMetadataVisibility=Ma,d.Dimension=Da,d.Direction=La,d.Disposable=rt,d.DisposableCollection=Mr,d.DocStyleType=Il,d.DocumentDataModel=jt,d.DocumentFlavor=ci,d.DrawingTypeEnum=Ql,d.EDITOR_ACTIVATED=tc,d.EXTENSION_NAMES=_l,d.ErrorService=dc,d.EventState=yc,d.EventSubject=av,d.FBase=on,d.FOCUSING_COMMON_DRAWINGS=hE,d.FOCUSING_DOC=ar,d.FOCUSING_EDITOR_BUT_HIDDEN=iE,d.FOCUSING_EDITOR_INPUT_FORMULA=oE,d.FOCUSING_EDITOR_STANDALONE=lE,d.FOCUSING_FX_BAR_EDITOR=nc,d.FOCUSING_PANEL_EDITOR=uE,d.FOCUSING_SHEET=Nn,d.FOCUSING_SLIDE=lr,d.FOCUSING_UNIT=or,d.FOCUSING_UNIVER_EDITOR=aE,d.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=cE,d.FORMULA_EDITOR_ACTIVATED=dE,d.FollowNumberWithType=Sl,d.FontItalic=Lr,d.FontStyleType=wn,d.FontWeight=Ur,d.GridType=yl,d.HLSColor=Ga,d.HorizontalAlign=Vt,d.IAuthzIoService=uc,d.ICommandService=Mt,d.IConfigService=cc,d.IContextService=zn,d.IImageIoService=ki,d.ILocalStorageService=uv,d.ILogService=wt,d.IMentionIOService=fc,d.IPermissionService=gc,d.IResourceLoaderService=Ni,d.IResourceManagerService=as,d.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=tg,d.IUndoRedoService=Zt,d.IUniverInstanceService=gn,d.ImageCacheMap=fv,d.ImageSourceType=Fi,d.ImageUploadStatusType=wc,d.Inject=lt,d.Injector=Rt,d.InterceptorEffectEnum=In,d.InterceptorManager=Gg,d.InterpolationPointType=Ua,d.JSON1=kp,d.JSONX=Ht,d.LRUHelper=Jn,d.LRUMap=Qn,d.LifecycleStages=ze,d.ListGlyphType=Te,d.LocaleService=hr,d.LocaleType=Kn,d.LogLevel=pa,d.MOVE_BUFFER_VALUE=Gn,d.Many=xo,d.MemoryCursor=Sn,d.MentionType=Dr,d.NamedStyleType=Dl,d.NilCommand=Ca,d.NumberUnitType=Yl,d.ObjectMatrix=Lt,d.ObjectRelativeFromH=jl,d.ObjectRelativeFromV=Wl,d.Optional=Bo,d.OtherShapes=$a,d.PRESET_LIST_TYPE=rr,d.PageElementType=Jl,d.PageOrientType=Kl,d.PageType=hi,d.ParagraphElementType=Tl,d.PermissionService=mc,d.PermissionStatus=bi,d.Plugin=Ai,d.PositionedObjectLayoutType=Ml,d.PresetListType=Pt,d.ProtectionType=Pa,d.QuickListType=Ou,d.QuickListTypeMap=Wp,d.RANGE_DIRECTION=Xa,d.RANGE_TYPE=De,d.RBush=ji,d.RCDisposable=nm,d.RGBA_PAREN=Dm,d.RGB_PAREN=Mm,d.ROTATE_BUFFER_VALUE=ya,d.RTree=Rv,d.Range=yn,d.Rectangle=Qt,d.RediConsumer=ta,d.RediContext=Wn,d.RediError=it,d.RediProvider=zs,d.RedoCommand=cr,d.RedoCommandId=oc,d.RefAlias=Sp,d.Registry=Ui,d.RegistryAsMap=Pi,d.RelativeDate=Ba,d.RelativeSlideLink=ql,d.ResourceManagerService=Cc,d.RgbColor=$r,d.RxDisposable=tm,d.SHEET_EDITOR_UNITS=hp,d.SectionType=wl,d.Self=Go,d.SheetTypes=Ha,d.SheetViewModel=qu,d.SkipSelf=Vo,d.SliceBodyType=Ci,d.SlideDataModel=Oi,d.SpacingRule=Ll,d.SpecialShapes=xa,d.Styles=Lu,d.THEME_COLORS=Va,d.TabStopAlignment=Pl,d.TableAlignmentType=kl,d.TableLayoutType=$l,d.TableRowHeightRule=Bl,d.TableSizeType=Fl,d.TableTextWrapType=xl,d.TextDecoration=ja,d.TextDirection=Xn,d.TextDirectionType=Al,d.TextX=nt,d.TextXActionType=ge,d.ThemeColor=xr,d.ThemeColorType=ht,d.ThemeColors=Pr,d.ThemeService=Mi,d.Tools=he,d.UndoCommand=ur,d.UndoCommandId=ac,d.UnitModel=ts,d.Univer=Rc,d.UniverInstanceType=Be,d.UpdateDocsAttributeType=Pe,d.UserManagerService=Mn,d.VerticalAlign=an,d.VerticalAlignmentType=Hl,d.WithDependency=$g,d.WithNew=Ko,d.Worksheet=ir,d.WrapStrategy=ln,d.WrapTextType=Nl,d.addLinkToDocumentModel=Hu,d.afterInitApply=hm,d.afterTime=cm,d.awaitTime=hv,d.binSearchFirstGreaterThanTarget=Oa,d.binarySearchArray=dm,d.bufferDebounceTime=um,d.cellToRange=a_,d.characterSpacingControlType=Gl,d.checkForSubstrings=l_,d.checkIfMove=mm,d.checkParagraphHasBullet=Y_,d.checkParagraphHasIndent=z_,d.checkParagraphHasIndentByStyle=ul,d.codeToBlob=gm,d.composeBody=Ri,d.composeInterceptors=aa,d.composeStyles=Js,d.concatMatrixArray=rp,d.connectDependencies=Pg,d.connectInjector=Ug,d.convertBodyToHtml=Nm,d.convertCellToRange=Ja,d.covertTextRunToHtml=qs,d.createAsyncInterceptorKey=Kg,d.createDefaultUser=ls,d.createDocumentModelWithStyle=sr,d.createIdentifier=mt,d.createInterceptorKey=Vg,d.createInternalEditorID=ng,d.createRowColIter=li,d.dayjs=Bt,d.debounce=Bf,d.dedupe=Xf,d.deepCompare=ni,d.delayAnimationFrame=dv,d.deleteContent=hl,d.extractPureTextFromCell=ec,d.forwardRef=cg,d.fromCallback=Ra,d.fromEventSubject=lv,d.fromObservable=em,d.generateRandomId=un,d.get=pf,d.getArrayLength=Xt,d.getBodySlice=Jt,d.getBodySliceHtml=Fr,d.getBorderStyleType=s_,d.getCellInfoInMergeData=Jm,d.getCellValueType=Gm,d.getColorStyle=Dt,d.getCustomDecorationSlice=Au,d.getCustomRangeSlice=bu,d.getDocsUpdateBody=i_,d.getIntersectRange=pp,d.getOriginCellValue=Z0,d.getReverseDirection=_m,d.getWorksheetUID=sE,d.groupBy=qf,d.handleStyleToString=r_,d.hashAlgorithm=K_,d.horizontalLineSegmentsSubtraction=Jr,d.insertMatrixArray=si,d.insertTextToContent=cl,d.isAsyncDependencyItem=Fs,d.isAsyncHook=yr,d.isBlackColor=Ym,d.isBooleanString=eg,d.isCellCoverable=e_,d.isCellV=Xm,d.isClassDependencyItem=Ls,d.isCtor=Ds,d.isDisposable=Ws,d.isEmptyCell=qa,d.isFactoryDependencyItem=Us,d.isFormulaId=n_,d.isFormulaString=t_,d.isICellData=Vm,d.isInternalEditorID=Do,d.isNodeEnv=Tm,d.isNotNullOrUndefined=ju,d.isNullCell=Km,d.isNumeric=Oc,d.isRangesEqual=$0,d.isRealNum=G_,d.isSafeNumeric=nv,d.isSameStyleTextRun=Za,d.isUnitRangesEqual=x0,d.isValidRange=o_,d.isValueDependencyItem=Ps,d.isWhiteColor=zm,d.makeArray=Zf,d.makeCellRangeToRangeData=Zm,d.makeCellToSelection=qm,d.makeCustomRangeStream=M0,d.merge=bs,d.mergeOverrideWithDependencies=_c,d.mergeSets=sv,d.mergeWith=Yf,d.mergeWorksheetSnapshotWithDefault=Ju,d.mixinClass=Jg,d.moveMatrixArray=oi,d.moveRangeByOffset=dp,d.nameCharacterCheck=cv,d.normalizeBody=qp,d.normalizeTextRuns=nr,d.numberToABC=wp,d.numberToListABC=bp,d.numfmt=np,d.queryObjectMatrix=Ip,d.registerDependencies=Yg,d.remove=Hn,d.repeatStringNumTimes=Rl,d.replaceInDocumentBody=iv,d.requestImmediateMacroTask=rv,d.rotate=Jf,d.searchArray=fm,d.searchInOrderedArray=Sa,d.selectionToArray=Qm,d.sequence=ua,d.sequenceAsync=la,d.sequenceExecute=Xs,d.sequenceExecuteAsync=lm,d.set=Vf,d.setDependencies=bg,d.shallowEqual=oa,d.skipParseTagNames=gv,d.sliceMatrixArray=sp,d.sortRules=Ap,d.sortRulesByDesc=Tp,d.sortRulesFactory=qn,d.spliceArray=ii,d.splitIntoGrid=ai,d.takeAfter=Ia,d.textDiff=To,d.throttle=zg,d.toDisposable=Qe,d.touchDependencies=ia,d.updateAttributeByDelete=Tu,d.updateAttributeByInsert=Nu,d.useDependency=Dg,d.useDependencyContext=jg,d.useDependencyContextValue=Wg,d.useDependencyValue=ra,d.useInjector=na,d.useObservable=Bg,d.useUpdateBinder=Hg,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Ia(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Sa=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=va(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(C){t={error:C}}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(Yn(h))try{h()}catch(C){i=C instanceof Zs?C.errors:[C]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var f=va(u),g=f.next();!g.done;g=f.next()){var v=g.value;try{ya(v)}catch(C){i=i!=null?i:[],C instanceof Zs?i=Ra(Ra([],Ca(i)),Ca(C.errors)):i.push(C)}}}catch(C){r={error:C}}finally{try{g&&!g.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(i)throw new Zs(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ya(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)&&Ia(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ia(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();Sa.EMPTY;function sm(e){return e instanceof Sa||e&&"closed"in e&&Yn(e.remove)&&Yn(e.add)&&Yn(e.unsubscribe)}function ya(e){Yn(e)?e():e.unsubscribe()}function Xe(e){let t=!1;return e?sm(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Xe(()=>{})}function im(e){return Xe(()=>{e.unsubscribe()})}class Mr{constructor(){R(this,"_disposables",new Set)}add(t){const n=Xe(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 et{constructor(){R(this,"_disposed",!1);R(this,"_collection",new Mr)}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 om extends et{constructor(){super(...arguments);R(this,"dispose$",new Ce.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class am extends et{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 zn=mt("univer.context-service");class Oa extends et{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 wa=(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))(wa||{});const wt=mt("univer.log");class ba extends et{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 lm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,cm=(e,t,n,r)=>{for(var s=r>1?void 0:r?um(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&&lm(t,n,s),s},Aa=(e,t)=>(n,r)=>t(n,r,e),Vn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(Vn||{});const Nt=mt("anywhere.command-service");class hm{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),Xe(()=>{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 Ta={id:"nil",type:0,handler:()=>!0};d.CommandService=class extends et{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 hm,this._registerCommand(Ta)}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),Xe(()=>{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),Xe(()=>{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 c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(h=>h(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof qs)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 u=tg(this._commandExecutionStack,f=>f.type===0);u&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=u.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(u=>u(l,s));const h=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(u=>u(l,s)),c.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof qs)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Xe(()=>Hn(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 Mr;s=new dm(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Xe(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Xe(()=>{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([Aa(0,at(Rt)),Aa(1,wt)],d.CommandService);class dm{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(zn),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),Xe(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function ei(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Ea(r)}function fm(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return pa(r)}function Na(e){return new Ce.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Ma(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 gm(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 mm(e){const t=new Ce.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(Ce.take(1))}const _m=e=>new Promise(t=>{Ce.merge(Na(e.onCommandExecuted.bind(e)).pipe(Ft.filter(([n])=>n.type===Vn.MUTATION)),Ce.timer(300)).pipe(Ft.debounceTime(16),Ft.first()).subscribe(()=>{t()})});function Da(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 pm(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 La(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 Em(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=Da(e,t):r=La(e,t),n){const s=e[r];return e.indexOf(s)}return r}function vm(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const Gn=2,Ua=1;function Cm(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:c=0,width:h=0,angle:u=0}=e,f=h,g=c,v=i,C=s;return Math.abs(a-n)>Gn||Math.abs(l-r)>Gn||Math.abs(f-v)>Gn||Math.abs(g-C)>Gn||Math.abs(u-o)>Ua}var Pa=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Pa||{}),Qe=(e=>(e[e.NONE=0]="NONE",e[e.THIN=1]="THIN",e[e.HAIR=2]="HAIR",e[e.DOTTED=3]="DOTTED",e[e.DASHED=4]="DASHED",e[e.DASH_DOT=5]="DASH_DOT",e[e.DASH_DOT_DOT=6]="DASH_DOT_DOT",e[e.DOUBLE=7]="DOUBLE",e[e.MEDIUM=8]="MEDIUM",e[e.MEDIUM_DASHED=9]="MEDIUM_DASHED",e[e.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",e[e.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",e[e.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",e[e.THICK=13]="THICK",e))(Qe||{}),Fa=(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))(Fa||{}),It=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(It||{}),ka=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(ka||{}),$a=(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))($a||{}),xa=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(xa||{}),Ba=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Ba||{}),Ha=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Ha||{}),ja=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(ja||{});function Rm(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Wa=(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))(Wa||{}),Kn=(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))(Kn||{}),Dr=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(Dr||{}),Ya=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Ya||{}),za=(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))(za||{}),Va=(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))(Va||{}),Ga=(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))(Ga||{}),Ka=(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))(Ka||{}),Xa=(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))(Xa||{}),Qa=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(Qa||{}),Xn=(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))(Xn||{}),Ja=(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))(Ja||{}),zt=(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))(zt||{}),on=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(on||{}),an=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(an||{}),Lr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Lr||{}),Ur=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Ur||{}),$t=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))($t||{}),Ue=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Ue||{}),Vt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Vt||{}),ht=(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))(ht||{}),Pr=(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))(Pr||{});const Im="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Sm=e=>crypto.getRandomValues(new Uint8Array(e)),ym=(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}}},Om=(e,t=21)=>ym(e,t|0,Sm),wm=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Im[n[e]&63];return t};const qa=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"]),bm=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 Am(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(bm.test(e)){if(Za(e))return!0;try{const r=new URL(el(e)).hostname.split(".").pop();if(r&&qa.has(r))return!0}catch{return!1}}return!1}function Za(e){return/^[a-zA-Z]+:\/\//.test(e)}function Tm(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function el(e){return Za(e)?e:Tm(e)?`mailto://${e}`:`https://${e}`}const Nm=/^-ms-/,Mm=/-([a-z])/g,Gt=["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 ti(e,t){const n=he.getValueType(e),r=he.getValueType(t);return n!==r?!1:he.isArray(e)?Dm(e,t):he.isObject(e)?Lm(e,t):he.isDate(e)?e.getTime()===t.getTime():he.isRegExp(e)?e.toString()===t.toString():e===t}function Dm(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(!ti(s,i))return!1}return!0}function Lm(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(!ti(i,o))return!1}return!0}class he{static stringAt(t){let n="",r=t;for(;r>=Gt.length;)r/=Gt.length,r-=1,n+=Gt[r%Gt.length];const s=t%Gt.length;return n+=Gt[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+=Gt.length**i+Gt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return he.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 ln(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,c)=>{var h,u;if(he.isArray(l)){const f=(h=a[c])!=null?h:[];a[c]=f,r(l,f);return}if(he.isObject(l)){const f=(u=a[c])!=null?u:{};a[c]=f,s(l,f);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(he.isObject(c)){const f=(h=a[l])!=null?h:{};a[l]=f,s(c,f);return}if(he.isArray(c)){const f=(u=a[l])!=null?u:[];a[l]=f,r(c,f);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(he.isArray(l)){const u=(c=t[a])!=null?c:[];t[a]=u,r(l,u);return}if(he.isObject(l)){const u=(h=t[a])!=null?h:{};t[a]=u,s(l,u);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return ti(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]=he.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=he.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 Am(t)}static normalizeUrl(t){return el(t)}static topLevelDomainCombiningString(){return[...qa].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return he.isDefine(t)?he.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(Nm,"ms-").replace(Mm,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:he.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 ln(e=21,t){return t?Om(t,e)():wm(e)}function ni(...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 Um=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Fr(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;he.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(ri(r,{...a,ed:Math.min(c,n)}))):o.push(ri(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function Pm(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:c={}}=a,{spaceAbove:h,spaceBelow:u,lineSpacing:f}=c,g=[];h!=null&&(typeof h=="number"?g.push(`margin-top: ${h}px`):g.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?g.push(`margin-bottom: ${u}px`):g.push(`margin-bottom: ${u.v}px`)),f!=null&&g.push(`line-height: ${f}`),l>o+1?i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}>${Fr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Fr(e,o,r.length)),i}else return Fr(e,0,e.dataStream.length)}function ri(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:f,cl:g,va:v}=s;let C=e.slice(n,r);const w=[];return a===Ue.TRUE&&(C=`<i>${C}</i>`),v===$t.SUPERSCRIPT?C=`<sup>${C}</sup>`:v===$t.SUBSCRIPT&&(C=`<sub>${C}</sub>`),(c==null?void 0:c.s)===Ue.TRUE&&(C=`<u>${C}</u>`),(h==null?void 0:h.s)===Ue.TRUE&&(C=`<s>${C}</s>`),l===Ue.TRUE&&(C=`<strong>${C}</strong>`),i&&w.push(`font-family: ${i}`),g&&w.push(`color: ${g.rgb}`),o&&w.push(`font-size: ${o}pt`),u&&w.push("text-decoration: overline"),f&&w.push(`background: ${f.rgb}`),w.length?`<span style="${w.join("; ")};">${C}</span>`:C}const tl={[Pr.OFFICE]:{[ht.ACCENT1]:"#4472C4",[ht.ACCENT2]:"#ED7D31",[ht.ACCENT3]:"#A5A5A5",[ht.ACCENT4]:"#70AD47",[ht.ACCENT5]:"#5B9BD5",[ht.ACCENT6]:"#70AD47",[ht.DARK1]:"#000000",[ht.DARK2]:"#44546A",[ht.LIGHT1]:"#FFFFFF",[ht.LIGHT2]:"#E7E6E6",[ht.HYPERLINK]:"#0563C1",[ht.FOLLOWED_HYPERLINK]:"#954F72"}};class Qn{constructor(){R(this,"_themeValue",ht.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=It.UNSUPPORTED,this._themeColors=Pr.OFFICE,this._themeTint=0}asRgbColor(){return new kr(this._rgbValue,this)}asThemeColor(){return new $r(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 un{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 Qn().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 un(this._builder)}equals(t){return!1}}class nl{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 Qn;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,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*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 un{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 un.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 kr=St;const Zt=class Zt extends un{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=tl[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Zt._cacheThemeColor.has(this._themeColors)){if(s=Zt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Zt._cacheThemeColor.set(this._themeColors,s);const i=new nl(un.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new Zt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof Zt?n._themeColorType===this._themeColorType:!1}getColorType(){return It.THEME}getThemeColorType(){return this._themeColorType}};R(Zt,"_cacheThemeColor",new Map);let $r=Zt;const Fm="rgb(",km="rgba(",si={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class bt{constructor(t){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof bt){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=rl(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 c,h;r=Math.min(1,Math.max(0,r));const s=new bt(t).toRgb(),i=new bt(n).toRgb(),o=(c=s.a)!=null?c:1,a=(h=i.a)!=null?h:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new bt(l)}static getContrastRatio(t,n){const r=new bt(t).getLuminance(),s=new bt(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[xr(Math.round(n).toString(16)),xr(Math.round(r).toString(16)),xr(Math.round(s).toString(16)),xr(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 Vm(this.toRgb())}toHsl(){return zm(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}setAlpha(t){return new bt({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=ii(t),n=ii(n),r=ii(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 xr=e=>e.length===1?`0${e}`:e,ii=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),rl=e=>{if(Km(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(si[t]){const n=si[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 $m(t);if(t.startsWith("rgb"))return xm(t);if(t.startsWith("hsl"))return Bm(t);if(t.startsWith("hsv"))return Hm(t)},$m=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},xm=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},Bm=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},Hm=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=rl(e);if(t!=null)return"r"in t?t:"l"in t?Wm(t):Ym(t)},oi=(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),Wm=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,c=2*r-l;s=oi(c,l,t+1/3),i=oi(c,l,t),o=oi(c,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},Ym=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),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],f=[o,o,l,r,r,a][c],g={r:h*255,g:u*255,b:f*255};return e.a!==void 0&&(g.a=e.a),g},zm=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 c={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(c.a=e.a),c},Vm=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,c=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(c*100),v:Math.round(a*100)};return e.a!==void 0&&(h.a=e.a),h},Gm=e=>e==null,Km=e=>!Gm(e)&&typeof e=="object";function Xm(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 Qm(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 Jm(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 qm(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Vt.STRING;if(typeof e.v=="number")return Vt.NUMBER;if(typeof e.v=="boolean")return Vt.BOOLEAN}function Zm(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 e_(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var De=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(De||{}),tt=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(tt||{});function t_(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var sl=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(sl||{}),il=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(il||{});function n_(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 c=0;c<n.length;c++){const{startRow:h,endRow:u,startColumn:f,endColumn:g}=n[c];if(e===h&&t===f){i=u,o=g,a=h,l=f,s=!0;break}if(e>=h&&e<=u&&t>=f&&t<=g){i=u,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 In=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(In||{});function ol(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=t,u=n,f=t,g=n;if(r&&i){const{startRow:v,startColumn:C,endRow:w,endColumn:N,startY:G,endY:z,startX:oe,endX:M}=i;h=v,u=C,f=w,g=N,o=G,a=z,l=oe,c=M}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,f=i.endRow,g=i.endColumn),{startRow:h,startColumn:u,endRow:f,endColumn:g,startY:o,endY:a,startX:l,endX:c}}const r_=ol;function s_(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,h=n,u=t,f=n;return(r||s)&&(c=i,h=o,u=a,f=l),{startRow:c,startColumn:h,endRow:u,endColumn:f}}function al(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function i_(e){return al(e)&&(e==null?void 0:e.coverable)!==!1}function Mt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Qn().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function o_(e){return he.isString(e)&&e.substring(0,1)==="="&&e.length>1}function a_(e){return he.isString(e)&&e.length>0}function l_(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Mt(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Mt(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Mt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Mt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,f,g,v,C,w,N;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Br((a=e.bd)==null?void 0:a.b.s)} ${(l=Mt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Br((h=e.bd)==null?void 0:h.t.s)} ${(u=Mt(e.bd.t.cl))!=null?u:""}; `),(f=e.bd)!=null&&f.r&&(n+=`border-right: ${Br((g=e.bd)==null?void 0:g.r.s)} ${(v=Mt(e.bd.r.cl))!=null?v:""}; `),(C=e.bd)!=null&&C.l&&(n+=`border-left: ${Br((w=e.bd)==null?void 0:w.l.s)} ${(N=Mt(e.bd.l.cl))!=null?N:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Mt(e.cl)}; `)}],["va",()=>{e.va===$t.SUBSCRIPT?n+="vertical-align: sub; ":e.va===$t.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Xn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Xn.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===zt.LEFT?n+="text-align: left; ":e.ht===zt.RIGHT?n+="text-align: right; ":e.ht===zt.CENTER?n+="text-align: center; ":e.ht===zt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===on.BOTTOM?n+="vertical-align: bottom; ":e.vt===on.TOP?n+="vertical-align: top; ":e.vt===on.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===an.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===an.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,u,f,g,v,C,w,N;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(f=e.pd)==null?void 0:f.l}pt`,c=`${(g=e.pd)==null?void 0:g.r}pt`;(v=e.pd)!=null&&v.b&&(n+=`padding-bottom: ${o}; `),(C=e.pd)!=null&&C.t&&(n+=`padding-top: ${a}; `),(w=e.pd)!=null&&w.l&&(n+=`padding-left: ${l}; `),(N=e.pd)!=null&&N.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Br(e){let t="";return e===Qe.NONE?t="none":e===Qe.THIN?t="0.5pt solid":e===Qe.HAIR?t="0.5pt double":e===Qe.DOTTED?t="0.5pt dotted":e===Qe.DASHED||e===Qe.DASH_DOT?t="0.5pt dashed":e===Qe.DASH_DOT_DOT?t="0.5pt dotted":e===Qe.DOUBLE?t="0.5pt double":e===Qe.MEDIUM?t="1pt solid":e===Qe.MEDIUM_DASHED||e===Qe.MEDIUM_DASH_DOT?t="1pt dashed":e===Qe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Qe.SLANT_DASH_DOT?t="0.5pt dashed":e===Qe.THICK&&(t="1.5pt solid"),t}function u_(e){let t=0;if(e=e.trim(),e==="none")t=Qe.NONE;else if(e==="0.5pt solid")t=Qe.THIN;else if(e==="0.5pt double")t=Qe.HAIR;else if(e==="0.5pt dotted")t=Qe.DOTTED;else if(e==="0.5pt dashed")t=Qe.DASHED;else if(e==="1pt solid")t=Qe.MEDIUM;else if(e==="1pt dashed")t=Qe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Qe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Qe.THICK;else if(!e.includes("none"))t=Qe.THIN;else return Qe.NONE;return t}function 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 h_(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===De.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===De.ROW||o!==De.ROW&&o!==De.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 d_(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function ai(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=>ai(e[n],t[n])):e===t:!1}function ll(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:ai(n,r)}function f_(e,t){return t.some(n=>e.indexOf(n)>-1)}var Hr={exports:{}},g_=Hr.exports,ul;function m_(){return ul||(ul=1,function(e,t){(function(n,r){e.exports=r()})(g_,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",f="quarter",g="year",v="date",C="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|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,G={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(L){var b=["th","st","nd","rd"],O=L%100;return"["+L+(b[(O-20)%10]||b[O]||b[0])+"]"}},z=function(L,b,O){var $=String(L);return!$||$.length>=b?L:""+Array(b+1-$.length).join(O)+L},oe={s:z,z:function(L){var b=-L.utcOffset(),O=Math.abs(b),$=Math.floor(O/60),B=O%60;return(b<=0?"+":"-")+z($,2,"0")+":"+z(B,2,"0")},m:function L(b,O){if(b.date()<O.date())return-L(O,b);var $=12*(O.year()-b.year())+(O.month()-b.month()),B=b.clone().add($,u),K=O-B<0,se=b.clone().add($+(K?-1:1),u);return+(-($+(O-B)/(K?B-se:se-B))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:g,w:h,d:c,D:v,h:l,m:a,s:o,ms:i,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},M="en",T={};T[M]=G;var W="$isDayjsObject",Z=function(L){return L instanceof j||!(!L||!L[W])},fe=function L(b,O,$){var B;if(!b)return M;if(typeof b=="string"){var K=b.toLowerCase();T[K]&&(B=K),O&&(T[K]=O,B=K);var se=b.split("-");if(!B&&se.length>1)return L(se[0])}else{var de=b.name;T[de]=b,B=de}return!$&&B&&(M=B),B||!$&&M},le=function(L,b){if(Z(L))return L.clone();var O=typeof b=="object"?b:{};return O.date=L,O.args=arguments,new j(O)},p=oe;p.l=fe,p.i=Z,p.w=function(L,b){return le(L,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var j=function(){function L(O){this.$L=fe(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[W]=!0}var b=L.prototype;return b.parse=function(O){this.$d=function($){var B=$.date,K=$.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 se=B.match(w);if(se){var de=se[2]-1||0,me=(se[7]||"0").substring(0,3);return K?new Date(Date.UTC(se[1],de,se[3]||1,se[4]||0,se[5]||0,se[6]||0,me)):new Date(se[1],de,se[3]||1,se[4]||0,se[5]||0,se[6]||0,me)}}return new Date(B)}(O),this.init()},b.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()},b.$utils=function(){return p},b.isValid=function(){return this.$d.toString()!==C},b.isSame=function(O,$){var B=le(O);return this.startOf($)<=B&&B<=this.endOf($)},b.isAfter=function(O,$){return le(O)<this.startOf($)},b.isBefore=function(O,$){return this.endOf($)<le(O)},b.$g=function(O,$,B){return p.u(O)?this[$]:this.set(B,O)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(O,$){var B=this,K=!!p.u($)||$,se=p.p(O),de=function(V,Y){var ue=p.w(B.$u?Date.UTC(B.$y,Y,V):new Date(B.$y,Y,V),B);return K?ue:ue.endOf(c)},me=function(V,Y){return p.w(B.toDate()[V].apply(B.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(Y)),B)},Ne=this.$W,be=this.$M,S=this.$D,x="set"+(this.$u?"UTC":"");switch(se){case g:return K?de(1,0):de(31,11);case u:return K?de(1,be):de(0,be+1);case h:var X=this.$locale().weekStart||0,J=(Ne<X?Ne+7:Ne)-X;return de(K?S-J:S+(6-J),be);case c:case v: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()}},b.endOf=function(O){return this.startOf(O,!1)},b.$set=function(O,$){var B,K=p.p(O),se="set"+(this.$u?"UTC":""),de=(B={},B[c]=se+"Date",B[v]=se+"Date",B[u]=se+"Month",B[g]=se+"FullYear",B[l]=se+"Hours",B[a]=se+"Minutes",B[o]=se+"Seconds",B[i]=se+"Milliseconds",B)[K],me=K===c?this.$D+($-this.$W):$;if(K===u||K===g){var Ne=this.clone().set(v,1);Ne.$d[de](me),Ne.init(),this.$d=Ne.set(v,Math.min(this.$D,Ne.daysInMonth())).$d}else de&&this.$d[de](me);return this.init(),this},b.set=function(O,$){return this.clone().$set(O,$)},b.get=function(O){return this[p.p(O)]()},b.add=function(O,$){var B,K=this;O=Number(O);var se=p.p($),de=function(be){var S=le(K);return p.w(S.date(S.date()+Math.round(be*O)),K)};if(se===u)return this.set(u,this.$M+O);if(se===g)return this.set(g,this.$y+O);if(se===c)return de(1);if(se===h)return de(7);var me=(B={},B[a]=r,B[l]=s,B[o]=n,B)[se]||1,Ne=this.$d.getTime()+O*me;return p.w(Ne,this)},b.subtract=function(O,$){return this.add(-1*O,$)},b.format=function(O){var $=this,B=this.$locale();if(!this.isValid())return B.invalidDate||C;var K=O||"YYYY-MM-DDTHH:mm:ssZ",se=p.z(this),de=this.$H,me=this.$m,Ne=this.$M,be=B.weekdays,S=B.months,x=B.meridiem,X=function(Y,ue,ae,H){return Y&&(Y[ue]||Y($,K))||ae[ue].slice(0,H)},J=function(Y){return p.s(de%12||12,Y,"0")},V=x||function(Y,ue,ae){var H=Y<12?"AM":"PM";return ae?H.toLowerCase():H};return K.replace(N,function(Y,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 Ne+1;case"MM":return p.s(Ne+1,2,"0");case"MMM":return X(B.monthsShort,Ne,S,3);case"MMMM":return X(S,Ne);case"D":return $.$D;case"DD":return p.s($.$D,2,"0");case"d":return String($.$W);case"dd":return X(B.weekdaysMin,$.$W,be,2);case"ddd":return X(B.weekdaysShort,$.$W,be,3);case"dddd":return be[$.$W];case"H":return String(de);case"HH":return p.s(de,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return V(de,me,!0);case"A":return V(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 se}return null}(Y)||se.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(O,$,B){var K,se=this,de=p.p($),me=le(O),Ne=(me.utcOffset()-this.utcOffset())*r,be=this-me,S=function(){return p.m(se,me)};switch(de){case g:K=S()/12;break;case u:K=S();break;case f:K=S()/3;break;case h:K=(be-Ne)/6048e5;break;case c:K=(be-Ne)/864e5;break;case l:K=be/s;break;case a:K=be/r;break;case o:K=be/n;break;default:K=be}return B?K:p.a(K)},b.daysInMonth=function(){return this.endOf(u).$D},b.$locale=function(){return T[this.$L]},b.locale=function(O,$){if(!O)return this.$L;var B=this.clone(),K=fe(O,$,!0);return K&&(B.$L=K),B},b.clone=function(){return p.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},L}(),y=j.prototype;return le.prototype=y,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",g],["$D",v]].forEach(function(L){y[L[1]]=function(b){return this.$g(b,L[0],L[1])}}),le.extend=function(L,b){return L.$i||(L(b,j,le),L.$i=!0),le},le.locale=fe,le.isDayjs=Z,le.unix=function(L){return le(1e3*L)},le.en=T[M],le.Ls=T,le.p={},le})}(Hr)),Hr.exports}var __=m_();const xt=Ct(__);var jr={exports:{}},p_=jr.exports,cl;function E_(){return cl||(cl=1,function(e,t){(function(n,r){e.exports=r()})(p_,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 c=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(u){switch(u){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 c.s(a.week(),u==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),u==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),u==="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 u}});return i.bind(this)(h)}}})}(jr)),jr.exports}var v_=E_();const C_=Ct(v_);var Wr={exports:{}},R_=Wr.exports,hl;function I_(){return hl||(hl=1,function(e,t){(function(n,r){e.exports=r()})(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"},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={},c=function(w){return(w=+w)+(w>68?1900:2e3)},h=function(w){return function(N){this[w]=+N}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(w){(this.zone||(this.zone={})).offset=function(N){if(!N||N==="Z")return 0;var G=N.match(/([+-]|\d\d)/g),z=60*G[1]+(+G[2]||0);return z===0?0:G[0]==="+"?-z:z}(w)}],f=function(w){var N=l[w];return N&&(N.indexOf?N:N.s.concat(N.f))},g=function(w,N){var G,z=l.meridiem;if(z){for(var oe=1;oe<=24;oe+=1)if(w.indexOf(z(oe,0,N))>-1){G=oe>12;break}}else G=w===(N?"pm":"PM");return G},v={A:[a,function(w){this.afternoon=g(w,!1)}],a:[a,function(w){this.afternoon=g(w,!0)}],Q:[s,function(w){this.month=3*(w-1)+1}],S:[s,function(w){this.milliseconds=100*+w}],SS:[i,function(w){this.milliseconds=10*+w}],SSS:[/\d{3}/,function(w){this.milliseconds=+w}],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(w){var N=l.ordinal,G=w.match(/\d+/);if(this.day=G[0],N)for(var z=1;z<=31;z+=1)N(z).replace(/\[|\]/g,"")===w&&(this.day=z)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(w){var N=f("months"),G=(f("monthsShort")||N.map(function(z){return z.slice(0,3)})).indexOf(w)+1;if(G<1)throw new Error;this.month=G%12||G}],MMMM:[a,function(w){var N=f("months").indexOf(w)+1;if(N<1)throw new Error;this.month=N%12||N}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(w){this.year=c(w)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function C(w){var N,G;N=w,G=l&&l.formats;for(var z=(w=N.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(le,p,j){var y=j&&j.toUpperCase();return p||G[j]||n[j]||G[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(L,b,O){return b||O.slice(1)})})).match(r),oe=z.length,M=0;M<oe;M+=1){var T=z[M],W=v[T],Z=W&&W[0],fe=W&&W[1];z[M]=fe?{regex:Z,parser:fe}:T.replace(/^\[|\]$/g,"")}return function(le){for(var p={},j=0,y=0;j<oe;j+=1){var L=z[j];if(typeof L=="string")y+=L.length;else{var b=L.regex,O=L.parser,$=le.slice(y),B=b.exec($)[0];O.call(p,B),le=le.replace(B,"")}}return function(K){var se=K.afternoon;if(se!==void 0){var de=K.hours;se?de<12&&(K.hours+=12):de===12&&(K.hours=0),delete K.afternoon}}(p),p}}return function(w,N,G){G.p.customParseFormat=!0,w&&w.parseTwoDigitYear&&(c=w.parseTwoDigitYear);var z=N.prototype,oe=z.parse;z.parse=function(M){var T=M.date,W=M.utc,Z=M.args;this.$u=W;var fe=Z[1];if(typeof fe=="string"){var le=Z[2]===!0,p=Z[3]===!0,j=le||p,y=Z[2];p&&(y=Z[2]),l=this.$locale(),!le&&y&&(l=G.Ls[y]),this.$d=function($,B,K,se){try{if(["x","X"].indexOf(B)>-1)return new Date((B==="X"?1e3:1)*$);var de=C(B)($),me=de.year,Ne=de.month,be=de.day,S=de.hours,x=de.minutes,X=de.seconds,J=de.milliseconds,V=de.zone,Y=de.week,ue=new Date,ae=be||(me||Ne?1:ue.getDate()),H=me||ue.getFullYear(),ne=0;me&&!Ne||(ne=Ne>0?Ne-1:ue.getMonth());var ie,_e=S||0,we=x||0,Le=X||0,Q=J||0;return V?new Date(Date.UTC(H,ne,ae,_e,we,Le,Q+60*V.offset*1e3)):K?new Date(Date.UTC(H,ne,ae,_e,we,Le,Q)):(ie=new Date(H,ne,ae,_e,we,Le,Q),Y&&(ie=se(ie).week(Y).toDate()),ie)}catch{return new Date("")}}(T,fe,W,G),this.init(),y&&y!==!0&&(this.$L=this.locale(y).$L),j&&T!=this.format(fe)&&(this.$d=new Date("")),l={}}else if(fe instanceof Array)for(var L=fe.length,b=1;b<=L;b+=1){Z[1]=fe[b-1];var O=G.apply(this,Z);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}b===L&&(this.$d=new Date(""))}else oe.call(this,M)}}})}(Wr)),Wr.exports}var S_=I_();const y_=Ct(S_);var Yr={exports:{}},O_=Yr.exports,dl;function w_(){return dl||(dl=1,function(e,t){(function(n,r){e.exports=r()})(O_,function(){return function(n,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,f,g,v,C){var w=u.name?u:u.$locale(),N=o(w[f]),G=o(w[g]),z=N||G.map(function(M){return M.slice(0,v)});if(!C)return z;var oe=w.weekStart;return z.map(function(M,T){return z[(T+(oe||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,f){return u.formats[f]||function(g){return g.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,C,w){return C||w.slice(1)})}(u.formats[f.toUpperCase()])},h=function(){var u=this;return{months:function(f){return f?f.format("MMMM"):a(u,"months")},monthsShort:function(f){return f?f.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):a(u,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return c(u.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return h.bind(this)()},s.localeData=function(){var u=l();return{firstDayOfWeek:function(){return u.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 c(u,f)},meridiem:u.meridiem,ordinal:u.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(u){return a(l(),"weekdays",null,null,u)},s.weekdaysShort=function(u){return a(l(),"weekdaysShort","weekdays",3,u)},s.weekdaysMin=function(u){return a(l(),"weekdaysMin","weekdays",2,u)}}})}(Yr)),Yr.exports}var b_=w_();const A_=Ct(b_);var zr={exports:{}},T_=zr.exports,fl;function N_(){return fl||(fl=1,function(e,t){(function(n,r){e.exports=r()})(T_,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 c=this.$locale().formats,h=function(u,f){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(g,v,C){var w=C&&C.toUpperCase();return v||f[C]||n[C]||f[w].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(N,G,z){return G||z.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})}(zr)),zr.exports}var M_=N_();const D_=Ct(M_);var Vr={exports:{}},L_=Vr.exports,gl;function U_(){return gl||(gl=1,function(e,t){(function(n,r){e.exports=r()})(L_,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(C){var w={date:C,utc:!0,args:arguments};return new o(w)},l.utc=function(C){var w=a(this.toDate(),{locale:this.$L,utc:!0});return C?w.add(this.utcOffset(),n):w},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(C){C.utc&&(this.$u=!0),this.$utils().u(C.$offset)||(this.$offset=C.$offset),c.call(this,C)};var h=l.init;l.init=function(){if(this.$u){var C=this.$d;this.$y=C.getUTCFullYear(),this.$M=C.getUTCMonth(),this.$D=C.getUTCDate(),this.$W=C.getUTCDay(),this.$H=C.getUTCHours(),this.$m=C.getUTCMinutes(),this.$s=C.getUTCSeconds(),this.$ms=C.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(C,w){var N=this.$utils().u;if(N(C))return this.$u?0:N(this.$offset)?u.call(this):this.$offset;if(typeof C=="string"&&(C=function(M){M===void 0&&(M="");var T=M.match(r);if(!T)return null;var W=(""+T[0]).match(s)||["-",0,0],Z=W[0],fe=60*+W[1]+ +W[2];return fe===0?0:Z==="+"?fe:-fe}(C),C===null))return this;var G=Math.abs(C)<=16?60*C:C,z=this;if(w)return z.$offset=G,z.$u=C===0,z;if(C!==0){var oe=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(z=this.local().add(G+oe,n)).$offset=G,z.$x.$localOffset=oe}else z=this.utc();return z};var f=l.format;l.format=function(C){var w=C||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,w)},l.valueOf=function(){var C=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*C},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(C){return C==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var v=l.diff;l.diff=function(C,w,N){if(C&&this.$u===C.$u)return v.call(this,C,w,N);var G=this.local(),z=a(C).local();return v.call(G,z,w,N)}}})}(Vr)),Vr.exports}var P_=U_();const F_=Ct(P_);var Gr={exports:{}},k_=Gr.exports,ml;function $_(){return ml||(ml=1,function(e,t){(function(n,r){e.exports=r()})(k_,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")}}})}(Gr)),Gr.exports}var x_=$_();const B_=Ct(x_);var Kr={exports:{}},H_=Kr.exports,_l;function j_(){return _l||(_l=1,function(e,t){(function(n,r){e.exports=r()})(H_,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 c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(r).add(1,r).date(c),u=o(this).endOf(n);if(h.isBefore(u))return 1}var f=o(this).startOf(r).date(c).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)}}})}(Kr)),Kr.exports}var W_=j_();const Y_=Ct(W_);var Xr={exports:{}},z_=Xr.exports,pl;function V_(){return pl||(pl=1,function(e,t){(function(n,r){e.exports=r()})(z_,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}}})}(Xr)),Xr.exports}var G_=V_();const K_=Ct(G_);xt.extend(y_),xt.extend(C_),xt.extend(B_),xt.extend(A_),xt.extend(Y_),xt.extend(K_),xt.extend(F_),xt.extend(D_);function Qr(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 X_(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function Q_(e){if(e==null)return!1;const t=e.paragraphStyle;return El(t)}function El(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 vl(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Cl(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const J_=/\s/g;function q_(e){return e===null||e.toString().replace(J_,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function Z_(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 ze=Symbol("newer"),st=Symbol("older");class ep{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[ze],{done:!1,value:t.key}):{done:!0,value:void 0}}}class tp{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[ze],{done:!1,value:t.value}):{done:!0,value:void 0}}}class np{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[ze],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}Yc=ze,Wc=st;class Rl{constructor(t,n){R(this,"key");R(this,"value");R(this,Yc);R(this,Wc);this.key=t,this.value=n,this[ze]=void 0,this[st]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Jn{constructor(...t){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(qn.hasLength(t,1)){if(qn.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(qn.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(qn.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),Xe(()=>Hn(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[ze]&&(t===this.oldest&&(this.oldest=t[ze]),t[ze][st]=t[st]),t[st]&&(t[st][ze]=t[ze]),t[ze]=void 0,t[st]=this.newest,this.newest&&(this.newest[ze]=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 Rl(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[ze]=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 Rl(t,n)),this.newest?(this.newest[ze]=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[ze]?(this.oldest=this.oldest[ze],this.oldest[st]=void 0):(this.oldest=void 0,this.newest=void 0),t[ze]=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[ze]&&n[st]?(n[st][ze]=n[ze],n[ze][st]=n[st]):n[ze]?(n[ze][st]=void 0,this.oldest=n[ze]):n[st]?(n[st][ze]=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 ep(this.oldest)}values(){return new tp(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new np(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[ze]}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[ze];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[ze],n&&(t+=" < ");return t}}class qn{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 Jr={exports:{}},rp=Jr.exports,Il;function sp(){return Il||(Il=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:rp,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 ft}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(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 c(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=c(E);let _=null;if(m){const A=l(m);_=o[A.lang]||o[A.language]||null}return _}function u(E){return Object.assign({},a,E)}function f(E,m){const _=typeof m=="object"?m:l(m);return o[_.lang]=u(E),_.language===_.lang||o[_.language]||(o[_.language]=u(E)),o[_.lang]}const g=u({group:","});function v(E,m){if(typeof E!="number")return E;if(E<0)return-v(-E,m);if(m){const _=10**(m||0)||1;return v(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 C(E,m,_){const A=E<0?-1:1,D=10**(m||2),F=10**(_||2);let P,k,I=Math.abs(E),ee=0,Ee=0,q=0,pe=1;if((E=I)%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(I=1/(I-Math.floor(I)),P=pe,pe=pe*Math.floor(I)+ee,ee=P,Ee=q,q=Math.floor(E*pe+.5),q>=D||pe>=F)return[A*Ee,ee];while(Math.abs(E-q/pe)>=1e-10&&I!==Math.floor(I));k=[A*q,pe]}return k}const w={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},N=Object.assign({},w);function G(E){if(E===null&&(E=w),E){for(const m in E)if(m in w){const _=E[m];N[m]=_==null?w[m]:_}}return{...N}}const z={"#":"",0:"0","?":" "},oe={"@":"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 Z(E,m,_){return m[_+"_max"]=E.length,m[_+"_min"]=E.replace(/#/g,"").length,m}const fe={};function le(E){if(!(E in fe)){const m=[],_=E.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,A=>"?".repeat(A.length));for(let A=0;A<_.length;A++){const D=_.charAt(A);m[A]=D in z?z[D]:D}fe[E]=m.join("")}return fe[E]}function p(E,m){typeof E=="string"&&(E={type:"string",value:E=E.replace(/ /g,z["?"])}),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+"",D="int",F=!1,P=null;const k=[];let I,ee,Ee=!1;for(;A&&!F;){if(I=/^General/i.exec(A))_.general=!0,p({type:"general"},m);else if(D==="int"&&(I=/^[#?0]+(?:,[#?0]+)*/.exec(A))||D==="den"&&(I=/^[#?\d]+/.exec(A))||(I=/^[#?0]+/.exec(A)))_[D+"_pattern"].push(I[0]),P={type:D,num:I[0]},p(P,m);else if((I=/^\//.exec(A))&&_[D+"_pattern"].length){if(!P)throw new SyntaxError("Missing a numerator in pattern ".concat(E));_.fractions=!0,_.num_pattern.push(_[D+"_pattern"].pop()),P.type="num",D="den",p({type:"div"},m)}else if(I=/^,+/.exec(A)){const U=A.charAt(1)in z;ee.slice(-1)in z&&(I[0].length>1||!U)?_.scale=.001**I[0].length:_.dec_fractions||p(I[0],m)}else{if(I=/^;/.exec(A)){F=!0;break}if(I=/^[@+-]/.exec(A))I[0]==="@"&&(_.text=!0),p({type:oe[I[0]]},m);else if(I=/^(?:\[(h+|m+|s+)\])/i.exec(A)){const U=I[1].toLowerCase(),te=U[0],Re={type:"",size:0,date:1,raw:I[0],pad:U.length};te==="h"?(Re.size=16,Re.type="hour-elap"):te==="m"?(Re.size=32,Re.type="min-elap"):(Re.size=64,Re.type="sec-elap"),_.date=_.date|Re.size,k.push(Re),p(Re,m)}else if(I=/^(?:B2)/i.exec(A))Ee||(_.date_system=6);else if(I=/^(?:B1)/i.exec(A))Ee||(_.date_system=1);else if(I=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(A)){const U={type:"",size:0,date:1,raw:I[0]},te=I[0].toLowerCase(),Re=te[0];if(te==="y"||te==="yy")U.size=2,U.type="year-short";else if(Re==="y"||Re==="e")U.size=2,U.type="year";else if(te==="b"||te==="bb")U.size=2,U.type="b-year-short";else if(Re==="b")U.size=2,U.type="b-year";else if(te==="d"||te==="dd")U.size=8,U.type="day",U.pad=/dd/.test(te);else if(te==="ddd")U.size=8,U.type="weekday-short";else if(Re==="d")U.size=8,U.type="weekday";else if(Re==="h")U.size=16,U.type="hour",U.pad=/hh/i.test(te);else if(Re==="m"){te.length===3?(U.size=4,U.type="monthname-short"):te.length===5?(U.size=4,U.type="monthname-single"):te.length>=4&&(U.size=4,U.type="monthname");const Ae=k[k.length-1];!U.type&&Ae&&!Ae.used&&80&Ae.size&&(Ae.used=!0,U.size=32,U.type="min",U.pad=/mm/.test(te)),U.type||(U.size=4,U.type="month",U.pad=/mm/.test(te),U.indeterminate=!0)}else if(Re==="s"){U.size=64,U.type="sec",U.pad=/ss/.test(te);const Ae=k[k.length-1];Ae&&32&Ae.size?U.used=!0:Ae&&Ae.indeterminate&&(delete Ae.indeterminate,Ae.size=32,Ae.type="min",U.used=!0)}_.date=_.date|U.size,_.date_eval=!0,k.push(U),p(U,m)}else if(I=/^(?:AM\/PM|am\/pm|A\/P)/.exec(A))_.clock=12,_.date=16|_.date,_.date_eval=!0,p({type:"am",short:I[0]==="A/P"},m);else if(_.date&&(I=/^\.0{1,3}/i.exec(A))){const U=I[0].length-1,te=[64,128,256,512][U];_.date=_.date|te,_.date_eval=!0,_.sec_decimals=Math.max(_.sec_decimals,U),p({type:"subsec",size:te,decimals:U,date:1,raw:I[0]},m)}else if((I=/^\\(.)/.exec(A))||(I=/^"([^"]*?)"/.exec(A)))p(I[1],m);else if(I=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(A))_.condition=[I[1],parseFloat(I[2],10)];else if(I=/^\[\$([^\]]+)\]/.exec(A)){const U=I[1].split("-"),te=U.length<2?"":U[U.length-1],Re=U[0];Re&&p(Re,m);const Ae=c(te);Ae&&(_.locale=Ae);const ke=parseInt(te,16);isFinite(ke)&&16711680&ke&&(ke>>16&255)===6&&(_.date_system=6),Ee=!0}else if(I=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(A))_.color=I[2]?M[parseInt(I[2],10)]||"#000":I[1].toLowerCase();else if(!(I=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(A))){if(I=/^%/.exec(A))_.scale=100,_.percent=!0,p("%",m);else if(I=/^_(\\.|.)/.exec(A))p(" ",m);else if(I=/^\./.exec(A))p({type:"point",value:I[0]},m),_.dec_fractions=!0,D="frac";else if(I=/^[Ee]([+-]?|(?=[0#?]))/.exec(A))_.exponential=!0,_.exp_plus=I[1]==="+",D="man",p({type:"exp",plus:I[1]==="+"},m);else if(!(I=/^\*(\\.|.)/.exec(A))){if(I=/^[BENn[]/.exec(A))throw new SyntaxError("Unexpected char ".concat(A.charAt(0)," in pattern ").concat(E));A[0]==="("&&(_.parens=!0),I=[A[0]],p(I[0],m)}}}ee=I[0],A=A.slice(I?I[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 q=_.int_pattern.join("");if(_.grouping=q.indexOf(",")>=0,_.grouping){const U=q.split(","),te=U.length;te===2?(_.group_pri=U[1].length,_.group_sec=_.group_pri):te>2&&(_.group_pri=U[te-1].length,_.group_sec=U[te-2].length)}else _.group_pri=0,_.group_sec=0;Z(q.replace(/[,]/g,""),_,"int"),Z(_.frac_pattern.join(""),_,"frac"),Z(_.man_pattern.join(""),_,"man");let pe=_.num_pattern.join(""),Oe=_.den_pattern.join("");const ce=/\?/.test(Oe)||/\?/.test(pe);return Oe=Oe.replace(/\d/g,ce?"?":"#"),ce&&(Oe=Oe.replace(/#$/g,"?")),Z(pe,_,"num"),Z(Oe,_,"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(Oe),_.den_pattern.length&&(_.denominator=parseInt(_.den_pattern.join("").replace(/\D/g,""),10)),_.integer=!!_.int_pattern.join("").length,_.fractions&&m.forEach((U,te)=>{const Re=m[te+1];U.type==="string"&&Re&&(Re.type==="num"?U.rule="num+int":Re.type==="div"?U.rule="num":Re.type==="den"&&(U.rule="den"))}),_}const y=E=>{const m=E.condition;m&&m[1]<0&&(m[0]==="<"||m[0]==="<="||m[0]==="=")||E.tokens.unshift({type:"minus",volatile:!0})};function L(E){const m=[];let _,A=!1,D=null,F=E,P=0,k=!1,I=0,ee=0;do{if(k=j(F),(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&&(ee++,A=!0),k.text){if(D)throw new Error("Unexpected partition");D=k}k.locale&&(_=c(k.locale)),m.push(k),P=F.charAt(k.pattern.length)===";"?1:0,F=F.slice(k.pattern.length+P),I++}while(P&&I<4&&ee<3);if(P)throw new Error("Unexpected partition");if(ee>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 q=m.length;if(q===1&&(m[1]=j("General"),m[1].generated=!0),q<3){const pe=m[0],Oe=m[1];if(y(pe),Oe.condition)y(Oe);else{const ce=pe.condition;(ce[0]==="="||ce[1]>=0&&(ce[0]===">"||ce[0]===">="))&&Oe.tokens.unshift({type:"minus",volatile:!0})}}else m.forEach(y)}else{if(m.length<4&&D)for(let q=0,pe=m.length;q<pe;q++)m[q]===D&&m.splice(q,1);if(m.length<1&&D&&(m[0]=j("General"),m[0].generated=!0),m.length<2){const q=j(m[0].pattern);q.tokens.unshift({type:"minus",volatile:!0}),q.generated=!0,m.push(q)}if(m.length<3){const q=j(m[0].pattern);q.generated=!0,m.push(q)}if(m.length<4)if(D)m.push(D);else{const q=j("@");q.generated=!0,m.push(q)}m[0].condition=[">",0],m[1].condition=["<",0],m[2].condition=null}return{pattern:E,partitions:m,locale:_}}const b=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=b(4*_/146097);_-=b((146097*A+3)/4);const D=b(4e3*(_+1)/1461001);_=_-b(1461*D/4)+31;const F=b(80*_/2447),P=_-b(2447*F/80);_=b(F/11);const k=F+2-12*_;return[0|100*(A-49)+D+_,0|k,0|P]}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 D=b(A/10631);A-=10631*D;const F=b((A-_)/m);A-=b(F*m+_);const P=b((A+28.5001)/29.5);return P===13?[30*D+F,12,30]:[30*D+F,P,A-b(29.5001*P-29)]}function K(E){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const A=b(E);return m===6?B(A):m===-1?$(A):O(A,_)}const se=Math.floor,de=86400;function me(E,m){let _=null;if(Array.isArray(E)){const[A,D,F,P,k,I]=E;_=Date.UTC(A,D==null?0:D-1,F!=null?F:1,P||0,k||0,I||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 Ne(E,m){let _=0|E;const A=de*(E-_);let D=se(A);A-D>.9999&&(D+=1,D===de&&(D=0,_+=1));const F=D<0?de+D:D,[P,k,I]=K(E,0,m&&m.leap1900),ee=se(F/60/60)%60,Ee=se(F/60)%60,q=se(F)%60;if(m&&m.nativeDate){const pe=new Date(0);return pe.setUTCFullYear(P,k-1,I),pe.setUTCHours(ee,Ee,q),pe}return[P,k,I,ee,Ee,q]}function be(E){return!!(E[0]&&E[0].percent||E[1]&&E[1].percent||E[2]&&E[2].percent||E[3]&&E[3].percent)}function S(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,D]=E;return!(m&&!m.generated||_&&!_.generated||A&&!A.generated||!D||!D.text||D.generated)}const X={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},J=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],V={total:1,sign:0,period:0,int:1,frac:0},Y=(E,m)=>E.replace(/\./,m.decimal);function ue(E,m,_,A){const D=0|_;if(typeof _=="string")E.push(_);else if(_===D)E.push(Math.abs(D));else{const F=Math.abs(_);let P=F?Math.floor(Math.log10(F)):0,k=P<0?F*10**-P:F/10**P;k===10&&(k=1,P++);const I=function(Ee){let q=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const pe=Math.abs(Ee);if(!pe)return V;const Oe=q&&Ee<0?1:0,ce=Math.floor(pe),U=Math.floor(Math.log10(pe)+1);let te=0,Re=0;if(ce!==pe){te=1;const Ae=String(v(U<0?pe*10**-U:pe/10**U,15));let ke=Ae.length,$e=!0,We=0;for(;We<=Ae.length;){if(Ae[We]==="."){ke--;break}Ae[We]==="0"&&$e?ke--:$e=!1,We++}Re=ke-U,Re<0&&(Re=0,te=0)}return{total:Oe+Math.max(U,1)+te+Re,digits:Math.max(U,0)+Re,sign:Oe,period:te,int:Math.max(U,1),frac:Re}}(F),ee=()=>{const Ee=Math.abs(P);let q;q=k===1?k:v(k,5),E.push(Y(q+"",A),A.exponent,P<0?A.negative:A.positive,Ee<10?"0":"",Ee)};if(P>=-4&&P<=-1){const Ee=F.toPrecision(10+P).replace(/\.?0+$/,"");E.push(Y(Ee,A))}else if(P===10){const Ee=F.toFixed(10).slice(0,12).replace(/\.$/,"");E.push(Y(Ee,A))}else if(Math.abs(P)<=9)if(I.total<=11){const Ee=v(F,9).toFixed(I.frac);E.push(Y(Ee,A))}else P===9?E.push(Math.floor(F)):P>=0&&P<9?E.push(v(F,9-P)):ee();else I.total>=12?ee():Math.floor(F)===F?E.push(Math.floor(F)):E.push(Y(v(F,9).toFixed(I.frac),A))}return E}const ae=86400,H={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},ne=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 ie(E,m,_,A){let D="",F="",P="",k="",I="",ee=0,Ee=0|E,q=0,pe=0,Oe=1,ce=0,U=0,te=0,Re=0,Ae=0,ke=0;const $e=A||g;if(!m.text&&isFinite(m.scale)&&m.scale!==1&&(E=function(Se){if(Se===0)return Se;const Me=Math.ceil(Math.log10(Se<0?-Se:Se)),re=10**(16-Math.floor(Me));return Math.round(Se*re)/re}(E*m.scale)),m.exponential){let Se=Math.abs(E);if(Se){const Me=10**-ne(Se,m.int_max),re=v(Se*Me,m.frac_max)/Me;ee=ne(re,m.int_max)}Se/=10**ee,E=E<0?-Se:Se,D+=Math.abs(ee)}if(m.integer){const Se=Math.abs(v(E,m.fractions?1:m.frac_max));I+=Se<1?"":Math.floor(Se)}if(m.grouping){let Se="",Me=I.length;for(Me>m.group_pri&&(Me-=m.group_pri,Se=$e.group+I.slice(Me,Me+m.group_pri)+Se);Me>m.group_sec;)Me-=m.group_sec,Se=$e.group+I.slice(Me,Me+m.group_sec)+Se;I=Me?I.slice(0,Me)+Se:Se}m.dec_fractions&&(k=String(v(E,m.frac_max)).split(".")[1]||"");let We=!1;if(m.fractions){const Se=Math.abs(m.integer?E%1:E);if(Se)if(We=!0,isFinite(m.denominator))P+=m.denominator,F+=v(Se*m.denominator),F==="0"&&(F="",P="",We=!1,I||(I="0"));else{const Me=C(Se,m.integer?m.num_max:1/0,m.den_max);F+=Me[0],P+=Me[1],m.integer&&F==="0"&&(I||(I="0"),F="",P="",We=!1)}}if(m.date){Ee=Math.trunc(E);const Se=ae*(E-Ee);if(q=Math.floor(Se),ke=Se-q,Math.abs(ke)<1e-6?ke=0:ke>.9999&&(ke=0,q+=1,q===ae&&(q=0,Ee+=1)),ke){const Me=512&m.date||256&m.date||128&m.date;(Me===512&&ke>.9995||Me===256&&ke>.995||Me===128&&ke>.95||!Me&&ke>=.5)&&(q++,ke=0)}if(Ee||m.date_system){const Me=K(E,m.date_system,_.leap1900);pe=Me[0],Oe=Me[1],ce=Me[2]}if(q){const Me=q<0?ae+q:q;Ae=Math.floor(Me)%60,Re=Math.floor(Me/60)%60,te=Math.floor(Me/60/60)%60}if(U=(6+Ee)%7,m.date_eval&&(gt=E,pt=Ee+q/ae,_.dateSpanLarge?gt<-694324||pt>=35830291:gt<0||pt>=2958466)){if(_.dateErrorThrows)throw new Error("Date out of bounds");return _.dateErrorNumber?ue(E<0?[$e.negative]:[],0,E,$e).join(""):_.overflow}}var gt,pt;if(m.int_padding&&(I=m.int_padding.length===1?I||m.int_padding:m.int_padding.substring(0,m.int_padding.length-I.length)+I),m.num_padding&&(F=m.num_padding.length===1?F||m.num_padding:m.num_padding.substring(0,m.num_padding.length-F.length)+F),m.den_padding&&(P=m.den_padding.length===1?P||m.den_padding:P+m.den_padding.slice(P.length)),m.man_padding){const Se=m.exp_plus?"+":"";D=m.man_padding.length===1?(ee<0?"-":Se)+(D||m.man_padding):(ee<0?"-":Se)+m.man_padding.slice(0,m.man_padding.length-D.length)+D}const ve=[];let Ze=0;const ye={int:0,frac:0,man:0,num:0,den:0};for(let Se=0,Me=m.tokens.length;Se<Me;Se++){const re=m.tokens[Se],ct=re.num?re.num.length:0;if(re.type==="string")re.rule?re.rule==="num"?We?ve.push(re.value):(m.num_min>0||m.den_min>0)&&ve.push(re.value.replace(/./g,z["?"])):re.rule==="num+int"?We&&I?ve.push(re.value):m.den_min>0&&(I||m.num_min)&&ve.push(re.value.replace(/./g,z["?"])):re.rule==="den"&&(We?ve.push(re.value):(m.den_min>0||m.den_min>0)&&ve.push(re.value.replace(/./g,z["?"]))):ve.push(re.value);else if(re.type==="error")ve.push(_.invalid);else if(re.type==="point")ve.push(m.date?re.value:$e.decimal);else if(re.type==="general")ue(ve,0,E,$e);else if(re.type==="exp")ve.push($e.exponent);else if(re.type==="minus")re.volatile&&m.date||re.volatile&&(E>=0||typeof E!="number")||(re.volatile&&!m.fractions&&(m.integer||m.dec_fractions)?(E<0&&I&&I!=="0"||k)&&ve.push($e.negative):ve.push($e.negative));else if(re.type==="plus")ve.push($e.positive);else if(re.type==="text")ve.push(E);else if(re.type==="div")We?ve.push("/"):m.num_min>0||m.den_min>0?ve.push(z["?"]):ve.push(z["#"]);else if(re.type==="int")if(m.int_pattern.length===1)ve.push(I);else{const He=Ze?m.int_pattern.join("").length-ye.int:1/0,Pt=Ze===m.int_pattern.length-1?0:m.int_pattern.join("").length-(ye.int+re.num.length);ve.push(I.substring(I.length-He,I.length-Pt)),Ze++,ye.int+=re.num.length}else if(re.type==="frac"){const He=ye.frac;for(let Pt=0;Pt<ct;Pt++)ve.push(k[Pt+He]||z[re.num[Pt]]);ye.frac+=ct}else if(re.type in H)m[re.type+"_pattern"].length===1?(re.type==="int"&&ve.push(I),re.type==="frac"&&ve.push(k),re.type==="man"&&ve.push(D),re.type==="num"&&ve.push(F),re.type==="den"&&ve.push(P)):(ve.push(H[re.type].slice(ye[re.type],ye[re.type]+ct)),ye[re.type]+=ct);else if(re.type==="year")pe<0&&ve.push($e.negative),ve.push(String(Math.abs(pe)).padStart(4,"0"));else if(re.type==="year-short"){const He=pe%100;ve.push(He<10?"0":"",He)}else if(re.type==="month")ve.push(re.pad&&Oe<10?"0":"",Oe);else if(re.type==="monthname-single")m.date_system===6?ve.push($e.mmmm6[Oe-1].charAt(0)):ve.push($e.mmmm[Oe-1].charAt(0));else if(re.type==="monthname-short")m.date_system===6?ve.push($e.mmm6[Oe-1]):ve.push($e.mmm[Oe-1]);else if(re.type==="monthname")m.date_system===6?ve.push($e.mmmm6[Oe-1]):ve.push($e.mmmm[Oe-1]);else if(re.type==="weekday-short")ve.push($e.ddd[U]);else if(re.type==="weekday")ve.push($e.dddd[U]);else if(re.type==="day")ve.push(re.pad&&ce<10?"0":"",ce);else if(re.type==="hour"){const He=te%m.clock||(m.clock<24?m.clock:0);ve.push(re.pad&&He<10?"0":"",He)}else if(re.type==="min")ve.push(re.pad&&Re<10?"0":"",Re);else if(re.type==="sec")ve.push(re.pad&&Ae<10?"0":"",Ae);else if(re.type==="subsec"){ve.push($e.decimal);const He=ke.toFixed(m.sec_decimals);ve.push(He.slice(2,2+re.decimals))}else if(re.type==="am"){const He=te<12?0:1;re.short&&!A?ve.push("AP"[He]):ve.push($e.ampm[He])}else if(re.type==="hour-elap"){E<0&&ve.push($e.negative);const He=24*Ee+Math.floor(Math.abs(q)/3600);ve.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="min-elap"){E<0&&ve.push($e.negative);const He=1440*Ee+Math.floor(Math.abs(q)/60);ve.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="sec-elap"){E<0&&ve.push($e.negative);const He=Ee*ae+Math.abs(q);ve.push(String(Math.abs(He)).padStart(re.pad,"0"))}else if(re.type==="b-year")ve.push(pe+543);else if(re.type==="b-year-short"){const He=(pe+543)%100;ve.push(He<10?"0":"",He)}}return _.nbsp?ve.join(""):ve.join("").replace(/\u00a0/g," ")}function _e(E,m){for(let _=0;_<3;_++){const A=m[_];if(A){let D;if(A.condition){const F=A.condition[0],P=A.condition[1];F==="="?D=E===P:F===">"?D=E>P:F==="<"?D=E<P:F===">="?D=E>=P:F==="<="?D=E<=P:F==="<>"&&(D=E!==P)}else D=!0;if(D)return A}}}const we=j("@"),Le="black",Q={};function Ie(E,m){if(E){const _=E[0];m[_]=m[_]||{},Ie(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=>{Ie(E,Q),Ie(E+" x",Q),Ie(E+" l",Q),Ie(E+" l x",Q),Ie("l "+E,Q),Ie("l "+E+" x",Q),Ie(E+" D",Q),Ie(E+" D x",Q),Ie("D "+E,Q),Ie("D "+E+" x",Q)});const Ve={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},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"},Je=new Date().getUTCFullYear();function yt(E){const m=new RegExp("^([\\s+%"+T.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+T.join("")+")]*)$").exec(E);if(m){const[,_,A,D,F,P]=m;let k=1,I="",ee=!1,Ee=!1,q=!1,pe=!1,Oe=!1,ce=null,U=!1,te=parseFloat(A.replace(/,/g,""));if(!isFinite(te))return null;for(let Ae=0;Ae<_.length;Ae++){const ke=_[Ae];if(ke==="-"){if(ee||Ee)return null;ee=!0,k=-1}else if(W.test(ke)){if(Oe)return null;Oe=!0,ce=ke}else if(ke==="("){if(Ee||ee)return null;Ee=!0,k=-1}else if(ke==="%"){if(pe)return null;pe=!0}}for(let Ae=0;Ae<P.length;Ae++){const ke=P[Ae];if(W.test(ke)){if(Oe)return null;Oe=!0,ce=ke,U=!0}else if(ke===")"){if(q||!Ee)return null;q=!0}else if(ke==="%"){if(pe)return null;pe=!0}}if(F){if(pe||Oe)return null;I="0.00E+00"}else if(pe){if(Oe)return null;I=D.includes(".")?"0.00%":"0%",te*=.01}else if(Oe){const Ae=D.includes(".")?"#,##0.00":"#,##0";I=U?Ae+ce:ce+Ae}else D.includes(",")&&(I=D.includes(".")?"#,##0.00":"#,##0");const Re={v:te*k};return I&&(Re.z=I),Re}}const Ge=(E,m,_)=>{const A=_.path||"",D=Object.keys(m);for(let F=0;F<D.length;F++){let P;const k=D[F];if(m[k]){if(k==="$"||k==="€")E||(P=_);else if(k==="-"){const I=/^(\s*([./-]|,\s)\s*|\s+)/.exec(E);if(I){const ee=I[1]==="-"||I[1]==="/"||I[1]==="."?I[1]:" ";if(!_.sep||_.sep===ee){const Ee=I[0].replace(/\s+/g," ");P=Ge(E.slice(I[0].length),m[k],{..._,sep:ee,path:A+Ee})}}}else if(k===" "){const I=/^[,.]?\s+/.exec(E);if(I){const ee=I[0].replace(/\s+/g," ");P=Ge(E.slice(I[0].length),m[k],{..._,path:A+ee})}}else if(k==="j"||k==="d"){const I=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(E);I&&(P=Ge(E.slice(I[0].length),m[k],{..._,day:I[0],path:A+k}))}else if(k==="n"||k==="m"){const I=/^(0?[1-9]|1[012])\b/.exec(E);I&&(P=Ge(E.slice(I[0].length),m[k],{..._,month:+I[0],_mon:I[0],path:A+k}))}else if(k==="F"||k==="M"){const I=/^([a-z]{3,9})\b/i.exec(E),ee=I&&(k==="F"?je:Ve)[I[0].toLowerCase()];ee&&(P=Ge(E.slice(I[0].length),m[k],{..._,month:ee,_mon:I[0],path:A+k}))}else if(k==="l"||k==="D"){const I=/^([a-z]{3,9})\b/i.exec(E);(I&&Fe[I[0].toLowerCase()])===k&&(P=Ge(E.slice(I[0].length),m[k],{..._,path:A+k}))}else if(k==="y"){const I=/^\d\d\b/.exec(E);if(I){const ee=+I[0]>=30?+I[0]+1900:+I[0]+2e3;P=Ge(E.slice(I[0].length),m[k],{..._,year:ee,path:A+k})}}else if(k==="Y"){const I=/^\d\d\d\d\b/.exec(E);I&&(P=Ge(E.slice(I[0].length),m[k],{..._,year:+I[0],path:A+k}))}else{if(k!=="x")throw new Error('Unknown date token "'.concat(k,'"'));{const I=Ke(E);I&&(P=Ge("",m[k],{..._,time:I.v,tf:I.z,path:A+k}))}}if(P)return P}}};function nt(E,m){const _=Ge(E.trim(),Q,{path:""});if(_){var A;if(_.sep==="."&&_.path.length===3)return null;const D=+((A=_.year)!==null&&A!==void 0?A:Je);if(_.day||(_.day=1),!function(k,I,ee){if(ee<1||I<1||I>12)return!1;if(I===2){if(ee>(k%4==0&&k%100!=0||k%400==0||k===1900?29:28))return!1}else if((I===4||I===6||I===9||I===11)&&ee>30||(I===1||I===3||I===5||I===7||I===8||I===10||I===12)&&ee>31)return!1;return!0}(D,_.month,_.day))return null;let F=-1/0;if(D<1900)return null;D<=1900&&_.month<=2?F=25568:D<1e4&&(F=25569);const P=Date.UTC(D,_.month-1,_.day)/864e5+F+(_.time||0);if(P>=0&&P<=2958465){const k=_._mon[0]==="0"||_.day[0]==="0"||_._mon.length===2&&_.day.length===2,I=_.path.replace(/[jdlDnmMFyYx-]/g,ee=>ee==="j"||ee==="d"?k?"dd":"d":ee==="D"?"ddd":ee==="l"?"dddd":ee==="n"||ee==="m"?k?"mm":"m":ee==="M"?"mmm":ee==="F"?"mmmm":ee==="y"?"yy":ee==="x"?_.tf||"":ee==="Y"?"yyyy":ee);return m&&m.nativeDate?{v:Ne(P,m),z:I}:{v:P,z:I}}}return null}function Ke(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,D,F,P]=m;if(F&&!D||!P&&!A&&!D)return null;let k=1*(_||0);if(P){if(k>=13)return null;P[0]!=="p"&&P[0]!=="P"||(k+=12)}return{v:(60*k*60+60*(1*(A||0))+1*(D||0)+1*(F||0))/86400,z:(_.length===2?"hh":"h")+":mm"+(D?":ss":"")+(P?" AM/PM":"")}}return null}function dt(E){return/^\s*true\s*$/i.test(E)?{v:!0}:/^\s*false\s*$/i.test(E)?{v:!1}:null}const lt={};function Wt(E,m){const{pattern:_,partitions:A,locale:D}=E,F=I=>{const ee=Object.assign({},G(),m,I);return D&&(ee.locale=D),ee},P=(I,ee)=>{const Ee=F(ee);return function(q,pe,Oe){const ce=h(Oe.locale),U=pe[3]?pe[3]:we;if(typeof q=="boolean"&&(q=q?"TRUE":"FALSE"),q==null)return"";if(typeof q!="number")return ie(q,U,Oe,ce);if(!isFinite(q)){const Re=ce||g;return isNaN(q)?Re.nan:(q<0?Re.negative:"")+Re.infinity}const te=_e(q,pe);return te?ie(q,te,Oe,ce):Oe.overflow}(me(I,Ee),A,Ee)};P.color=(I,ee)=>function(Ee,q){if(typeof Ee!="number"||!isFinite(Ee))return(q[3]?q[3].color:we.color)||Le;const pe=_e(Ee,q);return pe&&pe.color||Le}(me(I,F(ee)),A);const k=function(I){var ee;let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[q,pe]=I,Oe=q.frac_max,ce={type:"general",isDate:S(I),isText:x(I),isPercent:be(I),maxDecimals:q.general?9:Oe,scale:(ee=q.scale)!==null&&ee!==void 0?ee:1,color:0,parentheses:0,grouped:q.grouping?1:0,_partitions:I},U=!ce.isDate&&!ce.isText&&!q.error&&q.tokens.some($e=>$e.type==="string"&&(Ee?$e.value===Ee:W.test($e.value)));let te="G",Re=Oe>=0?Math.min(15,Oe):"",Ae="",ke="";if(pe&&pe.color&&(ke="-",ce.color=1),q.parens&&(Ae="()",ce.parentheses=1),U)te="C",ce.type="currency";else if(q.error)ce.type="error",ce.maxDecimals=0;else if(ce.isDate){let $e=0,We=0,gt="";q.tokens.forEach(ve=>{const Ze=ve.type;/^(b-)?year/.test(Ze)?(gt+="Y",We++):Ze.startsWith("month")?(gt+="M",We++):/^(week)?day/.test(Ze)?(gt+="D",We++):Ze!=="hour"&&Ze!=="min"&&Ze!=="sec"&&Ze!=="am"||(gt+=Ze[0],$e++)}),ce.type="date",We&&$e?ce.type="datetime":!We&&$e&&(ce.type="time");const pt=J.find(ve=>gt.startsWith(ve[0]));te=pt?"D":"G",Re=pt?pt[1]:""}else ce.isText?(te="G",ce.type="text",Re="",ce.maxDecimals=0):q.general?(te="G",ce.type="general",Re=""):q.fractions?(te="G",ce.type="fraction",Re=""):q.exponential?(te="S",ce.type="scientific"):ce.isPercent?(te="P",ce.type="percent"):q.grouping?(te=",",ce.type="grouped"):(q.int_max||Oe)&&(te="F",ce.type="number");return ce.code=te+Re+ke+Ae,ce.level=X[ce.type],Object.freeze(ce)}(A,(m||{}).currency)||new SyntaxError;return P.info=k,P.dateInfo=function(I){const[ee]=I;return{year:!!(2&ee.date),month:!!(4&ee.date),day:!!(8&ee.date),hours:!!(16&ee.date),minutes:!!(32&ee.date),seconds:!!(64&ee.date),clockType:ee.clock===12?12:24}}(A),P.isPercent=()=>!!k.isPercent,P.isDate=()=>!!k.isDate,P.isText=()=>!!k.isText,P.pattern=_,E.error&&(P.error=E.error),P.options=F,P.locale=D||m&&m.locale||"",Object.freeze(P)}function xe(E,m){E||(E="General");let _=null;return lt[E]?_=lt[E]:(_=Object.assign({},G(),m).throws?L(E):function(A){try{return L(A)}catch(D){const F={tokens:[{type:"error"}],error:D.message};return{pattern:A,partitions:[F,F,F,F],error:D.message,locale:null}}}(E),_.error||(lt[E]=_)),Wt(_,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=Ne,xe.options=G,xe.dec2frac=C,xe.round=v,xe.codeToLocale=s,xe.parseLocale=l,xe.getLocale=h,xe.addLocale=(E,m)=>{const _=l(m);return delete lt[_.lang],delete lt[_.language],f(E,_)},xe.format=function(E,m,_){let A=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const D=_&&typeof _=="object"?_:{locale:_,throws:!A};return xe(E,D)(me(m,D),D)},xe.is_date=xe.isDate,xe.parseNumber=yt,xe.parseDate=nt,xe.parseTime=Ke,xe.parseBool=dt,xe.parseValue=function(E,m){var _,A,D;return(_=(A=(D=yt(E))!==null&&D!==void 0?D:nt(E,m))!==null&&A!==void 0?A:Ke(E))!==null&&_!==void 0?_:dt(E)};var ft=xe;return r=r.default}()})}(Jr)),Jr.exports}var li,Sl;function ip(){return Sl||(Sl=1,li=sp()),li}var op=ip();const ap=Ct(op);function Kt(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 ui(e,t,n){const r=Kt(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function ci(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 lp(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let h=0;h<s;h++,c++){const u=r[h];l[c]=n[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function up(e,t,n){const r=n;if(Kt(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 hi(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?cp(e,t,n,r):hp(e,t,n,r)}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-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 hp(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 Dt{constructor(t={}){R(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new Dt({[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){hi(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{hi(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)ui(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&ui(r,void 0,i)})}removeRows(t,n){ci(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&ci(t,n,s)})}getFragment(t,n,r,s){const i=new Dt;let o=0;for(let a=t;a<=n;a++){const l={};let c=0;for(let h=r;h<=s;h++){const u=this.getValue(a,h);l[c]=u,c++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new Dt;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,he.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Kt(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=Kt(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 Dt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const h=this.getValue(o,c);i.setValue(o-t,c-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 c=Kt(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<n&&(n=u):(o=!0,n=u)}),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 dp={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},fp={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},gp={startRow:0,startColumn:0,endRow:0,endColumn:0},mp={row:0,column:0},ut={ff:"Arial",fs:11,it:Ue.FALSE,bl:Ue.FALSE,ul:{s:Ue.FALSE},st:{s:Ue.FALSE},ol:{s:Ue.FALSE},tr:{a:0,v:Ue.FALSE},td:Xn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:zt.UNSPECIFIED,vt:on.UNSPECIFIED,tb:an.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},yl={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},_p=[Us,xo,Ps];var Ol=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(Ol||{});function qr(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 Ue.FALSE;switch(e){case"bl":case"it":{if(o[e]===Ue.FALSE)return Ue.FALSE;break}case"ul":case"st":{if(o[e].s===Ue.FALSE)return Ue.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
|
|
7
|
+
`)===r?Ue.TRUE:Ue.FALSE}const Er=class Er{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 Dt;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 Dt;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=he.numToWord(r+1)+(t+1),o=he.numToWord(s+1)+(n+1)):(i=he.numToWord(s+1)+(n+1),o=he.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ut.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new Er(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 c=0;c<=r-n;c++)for(let h=0;h<=i-s;h++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[h])==null)continue;const u=o[c][h].s;u&&(o[c][h].s=l.get(u))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ut.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?qr("ul",t.body)===Ue.TRUE?{s:Ue.TRUE}:{s:Ue.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?qr("st",t.body)===Ue.TRUE?{s:Ue.TRUE}:{s:Ue.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?qr("it",t.body)===Ue.TRUE?Lr.ITALIC:Lr.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?qr("bl",t.body)===Ue.TRUE?Ur.BOLD:Ur.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()===an.WRAP?Ue.TRUE:Ue.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Er.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||ut[t]}))}};R(Er,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===De.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===De.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===De.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 Sn=Er;function pp(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||tt.NONE,o=s.endAbsoluteRefType||tt.NONE,a=s.rangeType||De.NORMAL;if(!r&&i===tt.ALL&&o===tt.ALL)return s;const l=wl(s.startRow,n,s.startColumn,t,a),c=wl(s.endRow,n,s.endColumn,t,a);return r||i===tt.NONE&&o===tt.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===tt.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===tt.COLUMN?s={...s,startRow:l.row}:i===tt.ROW&&(s={...s,startColumn:l.column}),o===tt.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===tt.COLUMN?s={...s,endRow:c.row}:o===tt.ROW&&(s={...s,endColumn:c.column}),s)}function wl(e,t,n,r,s){return s===De.NORMAL?{row:e+t,column:n+r}:s===De.ROW?{row:e+t,column:n}:s===De.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function di(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],c=r[a+1]-1,h=s[o],u=s[o+1]-1;for(const f of e){if(f.startRow>u)break;if(f.startRow<=h&&f.endRow>=u&&f.startColumn<=l&&f.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function Ep(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 vp(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 Cp(e){const t=di(e),n=Ep(t);return vp(n)}function Rp(e,t){const n=[];return e.forEach(r=>{n.push(...Xt.subtract(r,t))}),Xt.mergeRanges(n)}function Ip(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=Sp(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),c=Math.min(i,a);if(l<=c){const h=l===-1/0?Number.NaN:l,u=c===1/0?Number.NaN:c;return[h,u]}else return null}function Sp(e,t,n,r,s,i){const o=e!==void 0?e:Al(n,r,s,i),a=t!==void 0?t:Al(n,r,s,i);return o===De.ALL||a===De.ALL?o===a?o:o===De.ALL?a:o:o===a?o:(o===De.NORMAL||a===De.NORMAL,De.NORMAL)}function Al(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?De.NORMAL:s?De.ROW:i?De.COLUMN:De.ALL}const jt=class jt{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===De.NORMAL||n.rangeType===void 0&&t.rangeType===De.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:h}=n,u=r<=l&&s>=a,f=i<=h&&o>=c;return u&&f}static intersects(t,n){if(t.rangeType===De.ROW&&n.rangeType===De.COLUMN||t.rangeType===De.COLUMN&&n.rangeType===De.ROW)return!0;if(t.rangeType===De.ROW&&n.rangeType===De.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===De.COLUMN&&n.rangeType===De.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,c=Number.isNaN(n.endRow)?r:n.endRow,h=Number.isNaN(n.startColumn)?0:n.startColumn,u=Number.isNaN(n.endColumn)?r:n.endColumn,f=Math.abs(o+a-h-u),g=Math.abs(o-a)+Math.abs(h-u),v=Math.abs(s+i-l-c),C=Math.abs(s-i)+Math.abs(l-c);return f<=g&&v<=C}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,h=n.endColumn;let u,f,g,v;if(a<=s)a>=r?f=a:f=r;else return null;if(l>=r)l>=s?v=s:v=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?g=o:g=h;else return null;return{startRow:f,endRow:v,startColumn:u,endColumn:g,rangeType:De.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 jt.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:De.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===De.COLUMN),r=t.some(i=>i.rangeType===De.ROW),s=jt.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?De.ROW:n?De.COLUMN:De.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 Cp(t)}static splitIntoGrid(t){return di(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=Rp(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(jt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),R(jt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[tt.ROW,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[tt.ROW,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[tt.COLUMN,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[tt.COLUMN,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),R(jt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),R(jt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),R(jt,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let Xt=jt;function yp(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=Op(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function Op(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 wp(e,t){Sn.foreach(t,(n,r)=>{e[n][r]=void 0})}function bp(e,t){const n=e.toFullArray(),r=[];for(;;){const s=yp(n,t);if(!s)break;r.push(s),wp(n,s)}return r}class Ap{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 fi(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 Tp(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 Zr=65,Tl=90,Np=97;function Mp(e){const t=Tl-Zr+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+Zr)+n,e=Math.floor(e/t)-1;return n}function Nl(e,t){let n="";for(;t>0;)n+=e,t--;return n}function Dp(e,t=!1){const n=Tl-Zr+1;let r=Np;t&&(r=Zr);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Nl(s,i)}function Lp(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function Up(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Zn(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}class es extends et{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 gi=Symbol("initializers");class Ml extends et{constructor(t){super(),this._injector=t;const n=this,r=Object.getPrototypeOf(this)[gi];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[gi];r||(r=[],this.prototype[gi]=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 ts{constructor(){R(this,"_data",[])}static create(){return new ts}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 mi{constructor(){R(this,"_data",new Map)}static create(){return new mi}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}var 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||{}),Lt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Lt||{}),_i=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(_i||{});class ns extends et{}var Dl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Dl||{}),Ll=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Ll||{}),Te=(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))(Te||{}),er=(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))(er||{}),tr=(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))(tr||{}),cn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(cn||{}),Ul=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Ul||{}),pi=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(pi||{}),Pl=(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))(Pl||{}),Fl=(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))(Fl||{}),kl=(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))(kl||{}),$l=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))($l||{}),xl=(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))(xl||{}),Bl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Bl||{}),Hl=(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))(Hl||{}),jl=(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))(jl||{}),Wl=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Wl||{}),Yl=(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))(Yl||{}),zl=(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))(zl||{}),Vl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Vl||{}),Gl=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Gl||{}),Kl=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Kl||{}),Xl=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Xl||{}),Ql=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Ql||{}),Jl=(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))(Jl||{}),yn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(yn||{}),ql=(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))(ql||{}),Zl=(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))(Zl||{}),eu=(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))(eu||{}),tu=(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))(tu||{}),nu=(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))(nu||{}),ru=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(ru||{}),su=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(su||{}),iu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(iu||{}),ou=(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))(ou||{}),Ei=(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))(Ei||{}),au=(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))(au||{}),lu=(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))(lu||{});function Pp(e=he.generateRandomId(6),t=Kn.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:pi.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:Ue.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:Ue.TRUE,doNotHyphenateCaps:Ue.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:Ue.FALSE,useFirstPageHeaderFooter:Ue.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var nr={},rs={},ss={},uu;function Fp(){if(uu)return ss;uu=1,Object.defineProperty(ss,"__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 ss.default=n,ss}var is={},cu;function kp(){if(cu)return is;cu=1,Object.defineProperty(is,"__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 is.default=e,is}var vi={},hu;function du(){return hu||(hu=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,u){if(!h)throw new Error(u)}const n=h=>h!=null&&typeof h=="object"&&!Array.isArray(h),r=(h,u)=>typeof h==typeof u?h>u:typeof h=="string"&&typeof u=="number";function s(h,u){for(let f in h){const g=f;u.write(g,h[g])}}e.isValidPathItem=h=>typeof h=="number"||typeof h=="string"&&h!=="__proto__";class i{constructor(u=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=u}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 u=[];let f=this.container,g=this.parents.length-1,v=this.idx;for(;v>=0;)u.unshift(f[v]),v===0?(v=this.indexes[g*2],f=this.parents[g--]):v-=n(f[v-1])?2:1;return u}}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 u;return this.container&&this.container.length>this.idx+1&&n(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||n(this.container[u])&&u+1>=this.container.length)return!1;n(this.container[u])&&u++;const f=this.container[u];return Array.isArray(f)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=f):this.idx=u,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const u=this.indexes[this.indexes.length-1]+1,f=this.parents[this.parents.length-1];return u>=f.length?!1:(t(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=f[u],!0)}_init(u,f,g,v){this.container=u,this.idx=f,this.parents=g.slice(),this.indexes=v.slice()}clone(){const u=new o;return u._init(this.container,this.idx,this.parents,this.indexes),u}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(u,f){const g=this.getComponent();g&&f(g,u);for(const v of this)u&&u.descend(v),this.traverse(u,f),u&&u.ascend()}eachPick(u,f){this.traverse(u,(g,v)=>{g.p!=null&&f(g.p,v)})}eachDrop(u,f){this.traverse(u,(g,v)=>{g.d!=null&&f(g.d,v)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const f=this.pendingDescent[u];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 v=this.container.splice(g,this.container.length-g);this.container.push(v),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 v=[f];this.container.splice(g,0,v),this.container=v}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&n(this.container[u]))return this.container[u];{const f={};return this.container.splice(u,0,f),f}}write(u,f){const g=this.getComponent();t(g[u]==null||g[u]===f,"Internal consistency error: Overwritten component. File a bug"),g[u]=f}get(){return this._op}descend(u){if(!e.isValidPathItem(u))throw Error("Invalid JSON key");this.pendingDescent.push(u)}descendPath(u){return this.pendingDescent.push(...u),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(u,f=s){if(u===null)return;if(t(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const g=this.lcIdx,v=this.parents.length;let C=0;for(let w=0;w<u.length;w++){const N=u[w];typeof N=="string"||typeof N=="number"?(C++,this.descend(N)):Array.isArray(N)?this.mergeTree(N,f):typeof N=="object"&&f(N,this)}for(;C--;)this.ascend();this.lcIdx=this.parents.length===v?g:-1}at(u,f){this.descendPath(u),f(this);for(let g=0;g<u.length;g++)this.ascend();return this}writeAtPath(u,f,g){return this.at(u,()=>this.write(f,g)),this.reset(),this}writeMove(u,f,g=0){return this.writeAtPath(u,"p",g).writeAtPath(f,"d",g)}getPath(){const u=super.getPath();return u.push(...this.pendingDescent),u}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=h=>new o(h);function l(h,u,f){let g,v;v=g=h?h.descendFirst():!1;function C(w){let N;for(;v;){const G=N=h.getKey();if(w!=null){let z=!1;if(u&&typeof G=="number"&&(N=u(G,h.getComponent()),N<0&&(N=~N,z=!0)),r(N,w))return null;if(N===w&&!z)return h}f&&typeof N=="number"&&f(N,h.getComponent()),v=h.nextSibling()}return null}return C.end=()=>{g&&h.ascend()},C}e.advancer=l;function c(h,u,f){let g,v,C,w;for(g=v=h&&h.descendFirst(),C=w=u&&u.descendFirst();g||C;){let N=g?h.getKey():null,G=C?u.getKey():null;N!==null&&G!==null&&(r(G,N)?G=null:N!==G&&(N=null)),f(N==null?G:N,N!=null?h:null,G!=null?u:null),N!=null&&g&&(g=h.nextSibling()),G!=null&&C&&(C=u.nextSibling())}v&&h.ascend(),w&&u.ascend()}e.eachChildOf=c}(vi)),vi}var Ci={},fu;function gu(){return fu||(fu=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={}))}(Ci)),Ci}var hn={},dn={},mu;function Ri(){return mu||(mu=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.uniToStrPos=dn.strPosToUni=void 0,dn.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},dn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),dn}var Ii={},_u;function Si(){return _u||(_u=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Ri(),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 Z=M[W];switch(typeof Z){case"object":if(typeof Z.d!="number"&&typeof Z.d!="string")throw Error("Delete must be number or string");if(e.dlen(Z.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(Z.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(Z>0))throw Error("Skip components must be >0");if(typeof T=="number")throw Error("Adjacent skip components should be combined");break}T=Z}if(typeof T=="number")throw Error("Op has a trailing skip")};function r(M,T){let W=0,Z=0;for(let fe=0;fe<M.length;fe++){const le=M[fe];switch(T(le,W,Z),typeof le){case"object":W+=e.dlen(le.d);break;case"string":Z+=t.strPosToUni(le);break;case"number":W+=le,Z+=le;break}}}e.eachOp=r;function s(M,T){const W=[],Z=a(W);return r(M,(fe,le,p)=>{Z(T(fe,le,p))}),u(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 Z=t.uniToStrPos(M,T),fe=W==null?1/0:t.uniToStrPos(M,W);return M.slice(Z,fe)};const c=(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 y;if(typeof j=="number")return le===-1||j-W<=le?(y=j-W,++T,W=0,y):(W+=le,le);if(typeof j=="string"){if(le===-1||p==="i"||t.strPosToUni(j.slice(W))<=le)return y=j.slice(W),++T,W=0,y;{const L=W+t.uniToStrPos(j.slice(W),le);return y=j.slice(W,L),W=L,y}}else{if(le===-1||p==="d"||e.dlen(j.d)-W<=le)return y={d:c(j.d,W)},++T,W=0,y;{let L=c(j.d,W,W+le);return W+=le,{d:L}}}},peek:()=>M[T]}},u=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 Z=[],fe=a(Z),{take:le,peek:p}=h(M);for(let y=0;y<T.length;y++){const L=T[y];let b,O;switch(typeof L){case"number":for(b=L;b>0;)O=le(b,"i"),fe(O),typeof O!="string"&&(b-=l(O));break;case"string":W==="left"&&typeof p()=="string"&&fe(le(-1)),fe(t.strPosToUni(L));break;case"object":for(b=e.dlen(L.d);b>0;)switch(O=le(b,"i"),typeof O){case"number":b-=O;break;case"string":fe(O);break;case"object":b-=e.dlen(O.d)}break}}let j;for(;j=le(-1);)fe(j);return u(Z)}function g(M,T){n(M),n(T);const W=[],Z=a(W),{take:fe}=h(M);for(let p=0;p<T.length;p++){const j=T[p];let y,L;switch(typeof j){case"number":for(y=j;y>0;)L=fe(y,"d"),Z(L),typeof L!="object"&&(y-=l(L));break;case"string":Z(j);break;case"object":y=e.dlen(j.d);let b=0;for(;b<y;)switch(L=fe(y-b,"d"),typeof L){case"number":Z({d:c(j.d,b,b+L)}),b+=L;break;case"string":b+=t.strPosToUni(L);break;case"object":Z(L)}break}}let le;for(;le=fe(-1);)Z(le);return u(W)}const v=(M,T)=>{let W=0;for(let Z=0;Z<T.length&&M>W;Z++){const fe=T[Z];switch(typeof fe){case"number":{W+=fe;break}case"string":const le=t.strPosToUni(fe);W+=le,M+=le;break;case"object":M-=Math.min(e.dlen(fe.d),M-W);break}}return M},C=(M,T)=>typeof M=="number"?v(M,T):M.map(W=>v(W,T));function w(M,T,W){return s(M,(Z,fe)=>typeof Z=="object"&&typeof Z.d=="number"?{d:W.slice(T,fe,fe+Z.d)}:Z)}function N(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 G(M){return s(M,T=>typeof T=="object"&&typeof T.d=="string"?{d:t.strPosToUni(T.d)}:T)}function z(M){let T=!0;return r(M,W=>{typeof W=="object"&&typeof W.d=="number"&&(T=!1)}),T}function oe(M){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,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 Z=M.builder(T);for(let fe=0;fe<W.length;fe++){const le=W[fe];switch(typeof le){case"number":Z.skip(le);break;case"string":Z.append(le);break;case"object":Z.del(e.dlen(le.d));break}}return Z.build()},transform:f,compose:g,transformPosition:v,transformSelection:C,isInvertible:z,makeInvertible(T,W){return w(T,W,M)},stripInvertible:G,invert:N,invertWithDoc(T,W){return N(w(T,W,M))},isNoop:T=>T.length===0}}e.default=oe}(Ii)),Ii}var os={},pu;function $p(){if(pu)return os;pu=1,Object.defineProperty(os,"__esModule",{value:!0});const e=Si(),t=Ri();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 c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return os.default=n,n.provides={text:!0},os}var Eu;function xp(){return Eu||(Eu=1,function(e){var t=hn.__createBinding||(Object.create?function(f,g,v,C){C===void 0&&(C=v),Object.defineProperty(f,C,{enumerable:!0,get:function(){return g[v]}})}:function(f,g,v,C){C===void 0&&(C=v),f[C]=g[v]}),n=hn.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g}),r=hn.__importStar||function(f){if(f&&f.__esModule)return f;var g={};if(f!=null)for(var v in f)Object.hasOwnProperty.call(f,v)&&t(g,f,v);return n(g,f),g},s=hn.__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=Ri(),o=r(Si()),a=s($p()),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(v){let C=i.uniToStrPos(f,v);if(C>f.length)throw Error("The op is too long for this document");g.push(f.slice(0,C)),f=f.slice(C)},append(v){g.push(v)},del(v){f=f.slice(i.uniToStrPos(f,v))},build(){return g.join("")+f}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{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 u=Si();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(hn)),hn}var vu;function Bp(){return vu||(vu=1,function(e){var t=rs.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(Fp()),r=t(kp()),s=du(),i=gu();function o(S,x){if(!S)throw new Error(x)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:S=>S,isNoop:S=>S==null,setDebug(S){},registerSubtype:N,checkValidOp:fe,normalize:le,apply:p,transformPosition:j,compose:y,tryTransform:K,transform:de,makeInvertible:O,invert:L,invertWithDoc:$,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,x,X)=>be(()=>!0,S,x,X),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(x,X,J)=>be(S,x,X,J)})};const a=S=>S?S.getComponent():null;function l(S){return S&&typeof S=="object"&&!Array.isArray(S)}const c=S=>Array.isArray(S)?S.slice():S!==null&&typeof S=="object"?Object.assign({},S):S,h=S=>S&&(S.p!=null||S.r!==void 0),u=S=>S&&(S.d!=null||S.i!==void 0);function f(S,x){return o(S!=null),typeof x=="number"?(o(Array.isArray(S),"Invalid key - child is not an array"),(S=S.slice()).splice(x,1)):(o(l(S),"Invalid key - child is not an object"),delete(S=Object.assign({},S))[x]),S}function g(S,x,X){return typeof x=="number"?(o(S!=null,"Container is missing for key"),o(Array.isArray(S),"Cannot use numerical key for object container"),o(S.length>=x,"Cannot insert into out of bounds index"),S.splice(x,0,X)):(o(l(S),"Cannot insert into missing item"),o(S[x]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),S[x]=X),X}e.removeOp=(S,x=!0)=>s.writeCursor().writeAtPath(S,"r",x).get(),e.moveOp=(S,x)=>s.writeCursor().writeMove(S,x).get(),e.insertOp=(S,x)=>s.writeCursor().writeAtPath(S,"i",x).get(),e.replaceOp=(S,x,X)=>s.writeCursor().at(S,J=>{J.write("r",x),J.write("i",X)}).get(),e.editOp=(S,x,X,J=!1)=>s.writeCursor().at(S,V=>T(V,x,X,J)).get();const v=(S,x)=>S!=null&&(typeof x=="number"?Array.isArray(S):typeof S=="object"),C=(S,x)=>v(S,x)?S[x]:void 0,w={};function N(S){let x=S.type?S.type:S;x.name&&(w[x.name]=x),x.uri&&(w[x.uri]=x)}const G=S=>{const x=w[S];if(x)return x;throw Error("Missing type: "+S)};N(xp());const z=(S,x)=>S+x;N({name:"number",apply:z,compose:z,invert:S=>-S,transform:S=>S});const oe=S=>S==null?null:S.et?G(S.et):S.es?w["text-unicode"]:S.ena!=null?w.number:null,M=S=>S.es?S.es:S.ena!=null?S.ena:S.e,T=(S,x,X,J=!1)=>{const[V,Y]=typeof x=="string"?[G(x),x]:[x,x.name];!J&&V.isNoop&&V.isNoop(X)||(Y==="number"?S.write("ena",X):Y==="text-unicode"?S.write("es",X):(S.write("et",Y),S.write("e",X)))};function W(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function Z(S){typeof S=="number"?W(S):o(typeof S=="string")}function fe(S){if(S===null)return;const x=new Set,X=new Set,J=Y=>{let ue=!0,ae=!1;for(let H in Y){const ne=Y[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(ne),o(!x.has(ne)),x.add(ne),o(Y.r===void 0);else if(H==="d")W(ne),o(!X.has(ne)),X.add(ne),o(Y.i===void 0);else if(H==="e"||H==="es"||H==="ena"){o(!ae),ae=!0;const ie=oe(Y);o(ie,"Missing type in edit"),ie.checkValidOp&&ie.checkValidOp(M(Y))}}o(!ue)},V=(Y,ue,ae)=>{if(!Array.isArray(Y))throw Error("Op must be null or a list");if(Y.length===0)throw Error("Empty descent");ue||Z(Y[0]);let H=1,ne=0,ie=0;for(let _e=0;_e<Y.length;_e++){const we=Y[_e];if(o(we!=null),Array.isArray(we)){const Le=V(we,!1);if(ne){const Q=typeof ie,Ie=typeof Le;Q===Ie?o(ie<Le,"descent keys are not in order"):o(Q==="number"&&Ie==="string")}ie=Le,ne++,H=3}else typeof we=="object"?(o(H===1,`Prev not scalar - instead ${H}`),J(we),H=2):(o(H!==3),Z(we),o(s.isValidPathItem(we),"Invalid path key"),H=1)}return o(ne!==1,"Operation makes multiple descents. Remove some []"),o(H===2||H===3),Y[0]};V(S,!0),o(x.size===X.size,"Mismatched picks and drops in op");for(let Y=0;Y<x.size;Y++)o(x.has(Y)),o(X.has(Y))}function le(S){let x=0,X=[];const J=s.writeCursor();return J.mergeTree(S,(V,Y)=>{const ue=oe(V);if(ue){const H=M(V);T(Y,ue,ue.normalize?ue.normalize(H):H)}for(const H of["r","p","i","d"])if(V[H]!==void 0){const ne=H==="p"||H==="d"?(ae=V[H],X[ae]==null&&(X[ae]=x++),X[ae]):V[H];Y.write(H,ne)}var ae}),J.get()}function p(S,x){if(fe(x),x===null)return S;const X=[];return function J(V,Y){let ue=V,ae=0,H={root:V},ne=0,ie=H,_e="root";function we(){for(;ne<ae;ne++){let Le=Y[ne];typeof Le!="object"&&(o(v(ie,_e)),ie=ie[_e]=c(ie[_e]),_e=Le)}}for(;ae<Y.length;ae++){const Le=Y[ae];if(Array.isArray(Le)){const Q=J(ue,Le);Q!==ue&&Q!==void 0&&(we(),ue=ie[_e]=Q)}else if(typeof Le=="object"){Le.d!=null?(we(),ue=g(ie,_e,X[Le.d])):Le.i!==void 0&&(we(),ue=g(ie,_e,Le.i));const Q=oe(Le);if(Q)we(),ue=ie[_e]=Q.apply(ue,M(Le));else if(Le.e!==void 0)throw Error("Subtype "+Le.et+" undefined")}else ue=C(ue,Le)}return H.root}(S=function J(V,Y){const ue=[];let ae=0;for(;ae<Y.length;ae++){const _e=Y[ae];if(Array.isArray(_e))break;typeof _e!="object"&&(ue.push(V),V=C(V,_e))}for(let _e=Y.length-1;_e>=ae;_e--)V=J(V,Y[_e]);for(--ae;ae>=0;ae--){const _e=Y[ae];if(typeof _e!="object"){const we=ue.pop();V=V===C(we,_e)?we:V===void 0?f(we,_e):(ne=_e,ie=V,(H=c(H=we))[ne]=ie,H)}else h(_e)&&(o(V!==void 0,"Cannot pick up or remove undefined"),_e.p!=null&&(X[_e.p]=V),V=void 0)}var H,ne,ie;return V}(S,x),x)}function j(S,x){S=S.slice(),fe(x);const X=s.readCursor(x);let J,V,Y=!1;const ue=[];for(let H=0;;H++){const ne=S[H],ie=X.getComponent();if(ie&&(ie.r!==void 0?Y=!0:ie.p!=null&&(Y=!1,J=ie.p,V=H)),H>=S.length)break;let _e=0;const we=s.advancer(X,void 0,(Q,Ie)=>{h(Ie)&&_e++});ue.unshift(we);const Le=we(ne);if(typeof ne=="number"&&(S[H]-=_e),!Le)break}if(ue.forEach(H=>H.end()),Y)return null;const ae=()=>{let H=0;if(J!=null){const ne=X.getPath();H=ne.length,S=ne.concat(S.slice(V))}for(;H<S.length;H++){const ne=S[H],ie=a(X),_e=oe(ie);if(_e){const Q=M(ie);_e.transformPosition&&(S[H]=_e.transformPosition(S[H],Q));break}let we=0;const Le=s.advancer(X,(Q,Ie)=>u(Ie)?~(Q-we):Q-we,(Q,Ie)=>{u(Ie)&&we++})(ne);if(typeof ne=="number"&&(S[H]+=we),!Le)break}};return J!=null?X.eachDrop(null,H=>{H===J&&ae()}):ae(),S}function y(S,x){if(fe(S),fe(x),S==null)return x;if(x==null)return S;let X=0;const J=s.readCursor(S),V=s.readCursor(x),Y=s.writeCursor(),ue=[],ae=[],H=[],ne=[],ie=[],_e=[],we=new Set;J.traverse(null,Q=>{Q.p!=null&&(H[Q.p]=J.clone())}),V.traverse(null,Q=>{Q.d!=null&&(ne[Q.d]=V.clone())});const Le=s.writeCursor();return function Q(Ie,Ve,je,Fe,Je,yt,Ge,nt){o(Ve||je);const Ke=a(Ve),dt=a(je),lt=!!dt&&dt.r!==void 0,Wt=!!Ke&&Ke.i!==void 0,xe=Ke?Ke.d:null,ft=dt?dt.p:null,E=(yt||lt)&&ft==null;if(ft!=null)Fe=ne[ft],Ge=ae[ft]=new s.WriteCursor;else if(dt&&dt.r!==void 0)Fe=null;else{const U=a(Fe);U&&U.d!=null&&(Fe=null)}const m=a(Fe);if(xe!=null)if(Ie=H[xe],nt=ue[xe]=new s.WriteCursor,E)yt&&!lt&&nt.write("r",!0);else{const U=ie[xe]=X++;Ge.write("d",U)}else if(Ke&&Ke.i!==void 0)Ie=null;else{const U=a(Ie);U&&U.p!=null&&(Ie=null)}let _;Wt?(o(Je===void 0),_=Ke.i):_=Je;const A=(ft==null?!Wt||yt||lt:_===void 0)?null:Ge.getComponent();if(ft!=null){if(!(Je!==void 0||Wt)){const U=xe!=null?ie[xe]:X++;_e[ft]=U,nt.write("p",U)}}else lt&&(Wt||Je!==void 0||(dt.r,nt.write("r",dt.r)));const D=E?null:oe(Ke),F=oe(m);if((D||F)&&(D&&D.name,F&&F.name),D&&F){o(D===F);const U=M(Ke),te=M(m),Re=D.compose(U,te);T(Ge,D,Re),we.add(m)}else D?T(Ge,D,M(Ke)):F&&(T(Ge,F,M(m)),we.add(m));const P=typeof _=="object"&&_!=null;let k=!1,I=0,ee=0,Ee=0,q=0,pe=0;const Oe=s.advancer(Fe,(U,te)=>u(te)?q-U-1:U-q,(U,te)=>{u(te)&&q++}),ce=s.advancer(Ie,(U,te)=>h(te)?I-U-1:U-I,(U,te)=>{h(te)&&I++});if(s.eachChildOf(Ve,je,(U,te,Re)=>{let Ae,ke,$e=U,We=U,gt=U;if(typeof U=="number"){let Me=U+Ee;ke=Oe(Me),We=Me+q;let re=U+ee;Ae=ce(re),u(a(ke))&&(Ae=null),$e=re+I,gt=U+pe,o($e>=0,"p1PickKey is negative"),o(We>=0,"p2DropKey is negative");const ct=u(a(te)),He=h(a(Re));(ct||He&&!E)&&pe--,ct&&ee--,He&&Ee--}else Ae=ce(U),ke=Oe(U);nt.descend($e),Ge.descend(We);const pt=P&&!u(a(te))?_[gt]:void 0,ve=Q(Ae,te,Re,ke,pt,E,Ge,nt);var Ze,ye,Se;P&&!E?pt!==ve&&(k||(_=Array.isArray(_)?_.slice():Object.assign({},_),k=!0),Ze=_,Se=ve,typeof(ye=gt)=="number"?(o(Array.isArray(Ze)),o(ye<Ze.length)):(o(!Array.isArray(Ze)),o(Ze[ye]!==void 0)),Se===void 0?typeof ye=="number"?Ze.splice(ye,1):delete Ze[ye]:Ze[ye]=Se):o(ve===void 0),Ge.ascend(),nt.ascend()}),ce.end(),Oe.end(),A!=null)A.i=_;else if(!yt&&!lt&&ft==null)return _}(J,J.clone(),V,V.clone(),void 0,!1,Y,Le),Y.reset(),Y.mergeTree(Le.get()),Y.reset(),Y.get(),ue.map(Q=>Q.get()),ae.map(Q=>Q.get()),J.traverse(Y,(Q,Ie)=>{const Ve=Q.p;if(Ve!=null){const je=ie[Ve];je!=null&&Ie.write("p",je);const Fe=ue[Ve];Fe&&Fe.get(),Fe&&Ie.mergeTree(Fe.get())}else Q.r!==void 0&&Ie.write("r",Q.r)}),Y.reset(),Y.get(),V.traverse(Y,(Q,Ie)=>{const Ve=Q.d;if(Ve!=null){const Fe=_e[Ve];Fe!=null&&Ie.write("d",Fe);const Je=ae[Ve];Je&&Ie.mergeTree(Je.get())}else Q.i!==void 0&&Ie.write("i",Q.i);const je=oe(Q);je&&!we.has(Q)&&T(Ie,je,M(Q))}),Y.get()}function L(S){if(S==null)return null;const x=new s.ReadCursor(S),X=new s.WriteCursor;let J;const V=[],Y=[];return function ue(ae,H,ne){const ie=ae.getComponent();let _e,we=!1;if(ie){ie.p!=null&&(H.write("d",ie.p),V[ie.p]=ae.clone()),ie.r!==void 0&&H.write("i",ie.r),ie.d!=null&&(H.write("p",ie.d),ne=void 0),ie.i!==void 0&&(ne=_e=ie.i);const Q=oe(ie);Q&&(ne===void 0?(J||(J=new Set),J.add(ie)):(M(ie),ne=Q.apply(ne,M(ie)),we=!0))}let Le=0;for(const Q of ae){H.descend(Q);const Ie=typeof Q=="number"?Q-Le:Q,Ve=C(ne,Ie);u(ae.getComponent())&&Le++;const je=ue(ae,H,Ve);if(ne!==void 0&&je!==void 0){if(we||(we=!0,ne=c(ne)),!v(ne,Ie))throw Error("Cannot modify child - invalid operation");ne[Ie]=je}H.ascend()}if(_e===void 0)return we?ne:void 0;H.write("r",ne)}(x,X,void 0),J&&(X.reset(),function ue(ae,H,ne){const ie=H.getComponent();if(ie){const Q=ie.d;if(Q!=null&&(ae=V[Q],ne=Y[Q]=s.writeCursor()),J.has(ie)){const Ie=oe(ie);if(!Ie.invert)throw Error(`Cannot invert subtype ${Ie.name}`);T(ne,Ie,Ie.invert(M(ie)))}}let _e=0,we=0;const Le=s.advancer(ae,(Q,Ie)=>h(Ie)?_e-Q-1:Q-_e,(Q,Ie)=>{h(Ie)&&_e++});for(const Q of H)if(typeof Q=="number"){const Ie=Q-we,Ve=Le(Ie),je=Ie+_e;ne.descend(je),ue(Ve,H,ne),u(H.getComponent())&&we++,ne.ascend()}else ne.descend(Q),ue(Le(Q),H,ne),ne.ascend();Le.end()}(x.clone(),x,X),Y.length&&(X.reset(),x.traverse(X,(ue,ae)=>{const H=ue.p;if(H!=null){const ne=Y[H];ne&&ne.get(),ne&&ae.mergeTree(ne.get())}}))),X.get()}const b=(S,x)=>S.some(X=>typeof X=="object"&&(Array.isArray(X)?b(X,x):x(X)));function O(S,x){if(S==null||!b(S,H=>{var ne;return H.r!==void 0||((ne=oe(H))===null||ne===void 0?void 0:ne.makeInvertible)!=null}))return S;const X=new s.ReadCursor(S),J=new s.WriteCursor;let V=!1;const Y=[],ue=[],ae=(H,ne,ie)=>{const _e=H.getComponent();let we=!1;if(_e){_e.d!=null&&ne.write("d",_e.d),_e.i!==void 0&&ne.write("i",_e.i);const Q=_e.p;if(Q!=null&&(Y[Q]=H.clone(),o(ie!==void 0,"Operation picks up at an invalid key"),ue[Q]=ie,ne.write("p",_e.p)),_e.r!==void 0&&ie===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Ie=oe(_e);Ie&&(Ie.makeInvertible?V=!0:T(ne,Ie,M(_e),!0))}let Le=0;for(const Q of H){ne.descend(Q);const Ie=typeof Q=="number"?Q-Le:Q,Ve=C(ie,Ie),je=ae(H,ne,Ve);Ve!==je&&(we||(we=!0,ie=c(ie)),je===void 0?(ie=f(ie,Ie),typeof Q=="number"&&Le++):ie[Ie]=je),ne.ascend()}return _e&&(_e.r!==void 0?(ne.write("r",r.default(ie)),ie=void 0):_e.p!=null&&(ie=void 0)),ie};return ae(X,J,x),J.get(),V&&(J.reset(),function H(ne,ie,_e,we,Le){const Q=ie.getComponent();if(Q){Q.i!==void 0?(we=Q.i,Le=!0):Q.d!=null&&(we=ue[Q.d],ne=Y[Q.d],Le=!1,Q.d);let Fe=oe(Q);if(Fe&&Fe.makeInvertible){const Je=M(Q);T(_e,Fe,Fe.makeInvertible(Je,we),!0)}}let Ie=0,Ve=0;const je=s.advancer(ne,(Fe,Je)=>h(Je)?Ie-Fe-1:Fe-Ie,(Fe,Je)=>{h(Je)&&Ie++});for(const Fe of ie)if(typeof Fe=="number"){const Je=Fe-Ve,yt=je(Je),Ge=Je+Ie,nt=C(we,Le?Je:Ge);_e.descend(Fe),H(yt,ie,_e,nt,Le),u(ie.getComponent())&&Ve++,_e.ascend()}else{const Je=C(we,Fe);_e.descend(Fe),H(je(Fe),ie,_e,Je,Le),_e.ascend()}je.end()}(X.clone(),X,J,x,!1)),J.get()}function $(S,x){return L(O(S,x))}const B=S=>{if(S==null)return null;const x=S.slice();for(let X=0;X<S.length;X++){const J=x[X];Array.isArray(J)&&(x[X]=B(J))}return x};function K(S,x,X){o(X==="left"||X==="right","Direction must be left or right");const J=X==="left"?0:1;if(x==null)return{ok:!0,result:S};fe(S),fe(x);let V=null;const Y=[],ue=[],ae=[],H=[],ne=[],ie=[],_e=[],we=[],Le=[],Q=[],Ie=[],Ve=[],je=[],Fe=[],Je=[];let yt=0;const Ge=s.readCursor(S),nt=s.readCursor(x),Ke=s.writeCursor();if(function m(_,A=null,D){const F=a(A);F&&(F.r!==void 0?D=A.clone():F.p!=null&&(D=null,ie[F.p]=_.clone()));const P=_.getComponent();let k;P&&(k=P.p)!=null&&(ne[k]=A?A.clone():null,ae[k]=_.clone(),D&&(Q[k]=!0,Le[k]=D),F&&F.p!=null&&(Fe[k]=F.p));const I=s.advancer(A);for(const ee of _)m(_,I(ee),D);I.end()}(nt,Ge,null),function m(_,A,D,F,P){const k=D.getComponent();let I,ee=!1;k&&((I=k.d)!=null?(H[I]=D.clone(),F!=null&&(Je[F]==null&&(Je[F]=[]),Je[F].push(I)),Q[I],_=ne[I]||null,A=ae[I]||null,Q[I]?(P&&(Ie[I]=!0),P=Le[I]||null):!P||J!==1&&Fe[I]!=null||V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(P.getPath()),op2:e.moveOp(A.getPath(),D.getPath())}),ee=!0):k.i!==void 0&&(_=A=null,ee=!0,P&&V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(P.getPath()),op2:e.insertOp(D.getPath(),k.i)})));const Ee=a(_);Ee&&(Ee.r!==void 0?P=_.clone():Ee.p!=null&&(Ee.p,F=Ee.p,P=null));const q=oe(k);q&&P&&V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(P.getPath()),op2:e.editOp(D.getPath(),q,M(k),!0)});let pe=0,Oe=0;const ce=s.advancer(A,(te,Re)=>h(Re)?pe-te-1:te-pe,(te,Re)=>{h(Re)&&pe++}),U=s.advancer(_);for(const te of D)if(typeof te=="number"){const Re=te-Oe,Ae=ce(Re);Oe+=+m(U(Re+pe),Ae,D,F,P)}else{const Re=ce(te);m(U(te),Re,D,F,P)}return ce.end(),U.end(),ee}(Ge,nt,nt.clone(),null,null),H.map(m=>m&&m.get()),V)return{ok:!1,conflict:V};Ie.map(m=>!!m);const dt=[];let lt=null;(function m(_,A,D,F,P){let k=!1;const I=a(A);if(h(I)){const ce=I.p;ce!=null?(D=H[ce],F=Ve[ce]=s.writeCursor(),k=!0,P=null):(D=null,P=A.clone())}else u(a(D))&&(D=null);const ee=_.getComponent();if(ee){const ce=ee.p;ce!=null?(P&&(we[ce]=P),dt[ce]=P||J===1&&k?null:F.getComponent(),Y[ce]=_.clone(),D&&(_e[ce]=D.clone())):ee.r!==void 0&&(P||F.write("r",!0),(P||k)&&(lt==null&&(lt=new Set),lt.add(ee)))}let Ee=0,q=0;const pe=s.advancer(A,void 0,(ce,U)=>{h(U)&&Ee++}),Oe=s.advancer(D,(ce,U)=>u(U)?~(ce-q):ce-q,(ce,U)=>{u(U)&&q++});if(_)for(const ce of _)if(typeof ce=="string"){const U=pe(ce),te=Oe(ce);F.descend(ce),m(_,U,te,F,P),F.ascend()}else{const U=pe(ce),te=ce-Ee,Re=h(a(U))?null:Oe(te),Ae=te+q;o(Ae>=0),F.descend(Ae),m(_,U,Re,F,P),F.ascend()}pe.end(),Oe.end()})(Ge,nt,nt.clone(),Ke,null),Ke.reset();let Wt=[];if(function m(_,A,D,F,P,k){o(A);const I=A.getComponent();let ee=a(F),Ee=!1;const q=(ye,Se,Me)=>ye?e.moveOp(ye.getPath(),Se.getPath()):e.insertOp(Se.getPath(),Me.i);if(u(I)){const ye=I.d;ye!=null&&(ue[ye]=A.clone());const Se=ye!=null?dt[ye]:null;let Me=!1;if(I.i!==void 0||ye!=null&&Se){let re;ee&&(ee.i!==void 0||(re=ee.d)!=null&&!Q[re])&&(Me=re!=null?ye!=null&&ye===Fe[re]:n.default(ee.i,I.i),Me||re!=null&&J!==1&&Fe[re]!=null||V==null&&(V={type:i.ConflictType.DROP_COLLISION,op1:q(ye!=null?Y[ye]:null,A,I),op2:q(re!=null?ae[re]:null,F,ee)})),Me||(k?V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:q(ye!=null?Y[ye]:null,A,I),op2:e.removeOp(k.getPath())}):(ye!=null?(Wt[yt]=ye,P.write("d",Se.p=yt++)):P.write("i",r.default(I.i)),Ee=!0))}else if(ye!=null&&!Se){const re=we[ye];re&&(k=re.clone())}ye!=null?(_=Y[ye],D=ie[ye],F=_e[ye]):I.i!==void 0&&(_=D=null,Me||(F=null))}else h(a(_))&&(_=D=F=null);const pe=a(_),Oe=a(D);if(h(Oe)){const ye=Oe.p;Oe.r!==void 0&&(!pe||pe.r===void 0)||Q[ye]?(F=null,k=D.clone()):ye!=null&&(F=H[ye],J!==1&&Fe[ye]!=null||((P=je[ye])||(P=je[ye]=s.writeCursor()),P.reset(),k=null))}else!u(I)&&u(ee)&&(F=null);ee=F!=null?F.getComponent():null;const ce=oe(I);if(ce){const ye=M(I);if(k)V==null&&(V={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(A.getPath(),ce,ye,!0),op2:e.removeOp(k.getPath())});else{const Se=oe(ee);let Me;if(Se){if(ce!==Se)throw Error("Transforming incompatible types");const re=M(ee);Me=ce.transform(ye,re,X)}else Me=r.default(ye);T(P,ce,Me)}}let U=0,te=0,Re=0,Ae=0,ke=0,$e=0,We=_!=null&&_.descendFirst(),gt=We;const pt=s.advancer(D,void 0,(ye,Se)=>{h(Se)&&Re++});let ve=F!=null&&F.descendFirst(),Ze=ve;for(const ye of A)if(typeof ye=="number"){let Se;const Me=u(A.getComponent()),re=ye-te;{let en;for(;We&&typeof(en=_.getKey())=="number";){en+=U;const Tt=_.getComponent(),Fn=h(Tt);if(en>re||en===re&&(!Fn||J===0&&Me))break;if(Fn){U--;const gn=Tt.p;Fe.includes(gn),Tt.d,a(je[Tt.d]),h(a(je[Tt.d])),(Tt.r===void 0||lt&<.has(Tt))&&(gn==null||!dt[gn]||J!==1&&Fe.includes(gn))||ke--}We=_.nextSibling()}Se=We&&en===re?_:null}const ct=re-U;let He=pt(ct);const Pt=ct-Re;let Es=null;{let en,Tt;for(;ve&&typeof(en=F.getKey())=="number";){Tt=en-Ae;const Fn=F.getComponent(),gn=u(Fn);if(Tt>Pt)break;if(Tt===Pt){if(!gn){Es=F;break}{if(J===0&&Me){Es=F;break}const tn=He&&h(He.getComponent());if(J===0&&tn)break}}if(gn){const tn=Fn.d;Q[tn],Fe[tn],Fn.i===void 0&&(Q[tn]||Fe[tn]!=null&&J!==1)?(Q[tn]||Fe[tn]!=null&&J===0)&&(Ae++,$e--):Ae++}ve=F.nextSibling()}}const zc=Pt+Ae+ke+$e;o(zc>=0,"trying to descend to a negative index"),P.descend(zc),Me&&(Se=He=Es=null,te++),m(Se,A,He,Es,P,k)&&$e++,P.ascend()}else{let Se;for(;We&&(Se=_.getKey(),typeof Se!="string"||!(Se>ye||Se===ye));)We=_.nextSibling();const Me=We&&Se===ye?_:null,re=pt(ye);let ct;for(;ve&&(ct=F.getKey(),typeof ct!="string"||!(ct>ye||ct===ye));)ve=F.nextSibling();const He=ve&&ct===ye?F:null;P.descend(ye),m(Me,A,re,He,P,k),P.ascend()}return pt.end(),gt&&_.ascend(),Ze&&F.ascend(),Ee}(Ge,Ge.clone(),nt,nt.clone(),Ke,null),V)return{ok:!1,conflict:V};Ke.reset();const xe=(m,_,A)=>m.traverse(_,(D,F)=>{D.d!=null&&A(D.d,m,F)});(Q.length||Ve.length)&&(xe(nt,Ke,(m,_,A)=>{Q[m]&&!Ie[m]&&A.write("r",!0),Ve[m]&&A.mergeTree(Ve[m].get())}),Ke.reset());const ft=[],E=[];if((je.length||Q.length)&&!V){const m=s.readCursor(B(Ke.get()));if(xe(m,null,(_,A)=>{ft[_]=A.clone()}),je.forEach(_=>{_&&xe(s.readCursor(_.get()),null,(A,D)=>{ft[A]=D.clone()})}),function _(A,D,F,P,k,I){const ee=a(D);if(ee&&h(ee))if(ee.p!=null){const U=ee.p;ft[U].getPath(),F=ft[U],P=E[U]=s.writeCursor()}else ee.r!==void 0&&(F=null);else u(a(F))&&(F=null);const Ee=A.getComponent();if(Ee){let U;if((U=Ee.d)!=null){const te=je[U];te&&(te.get(),P.mergeTree(te.get()),F=s.readCursor(te.get()))}}let q=0,pe=0;const Oe=s.advancer(D,void 0,(U,te)=>{h(te)&&q--}),ce=s.advancer(F,(U,te)=>u(te)?-(U-pe)-1:U-pe,(U,te)=>{u(te)&&pe++});for(const U of A)if(typeof U=="number"){const te=Oe(U),Re=U+q,Ae=ce(Re),ke=Re+pe;P.descend(ke),_(A,te,Ae,P),P.ascend()}else P.descend(U),_(A,Oe(U),ce(U),P),P.ascend();Oe.end(),ce.end()}(nt,m,m.clone(),Ke),Ke.reset(),V)return{ok:!1,conflict:V};if(Ke.get(),E.length){const _=E.map(D=>D?D.get():null),A=s.readCursor(B(Ke.get()));if(xe(A,Ke,(D,F,P)=>{const k=_[D];k&&(P.mergeTree(k),_[D]=null)}),_.find(D=>D)){const D=s.writeCursor(),F=s.writeCursor();let P=0,k=0;_.forEach(I=>{I!=null&&xe(s.readCursor(I),null,ee=>{const Ee=Wt[ee];D.writeMove(Y[Ee].getPath(),ue[Ee].getPath(),P++);const q=Je[Ee];q&&q.forEach(pe=>{Q[pe]||J!==1&&Fe[pe]!=null||F.writeMove(ae[pe].getPath(),H[pe].getPath(),k++)})})}),V={type:i.ConflictType.BLACKHOLE,op1:D.get(),op2:F.get()}}}}return V?{ok:!1,conflict:V}:{ok:!0,result:Ke.get()}}const se=S=>{const x=new Error("Transform detected write conflict");throw x.conflict=S,x.type=x.name="writeConflict",x};function de(S,x,X){const J=K(S,x,X);if(J.ok)return J.result;se(J.conflict)}const me=S=>{const x=s.writeCursor();return s.readCursor(S).traverse(x,(X,J)=>{(u(X)||oe(X))&&J.write("r",!0)}),x.get()},Ne=(S,x)=>{const{type:X,op1:J,op2:V}=S;switch(X){case i.ConflictType.DROP_COLLISION:return x==="left"?[null,me(V)]:[me(J),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let Y=!1;return s.readCursor(J).traverse(null,ue=>{ue.r!==void 0&&(Y=!0)}),Y?[null,me(V)]:[me(J),null];case i.ConflictType.BLACKHOLE:return[me(J),me(V)];default:throw Error("Unrecognised conflict: "+X)}};function be(S,x,X,J){let V=null;for(;;){const Y=K(x,X,J);if(Y.ok)return y(V,Y.result);{const{conflict:ue}=Y;S(ue)||se(ue);const[ae,H]=Ne(ue,J);x=y(le(x),ae),X=y(le(X),H),V=y(V,H)}}}}(rs)),rs}var Cu;function Hp(){return Cu||(Cu=1,function(e){var t=nr.__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=nr.__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(Bp(),e);var r=du();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=gu();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(nr)),nr}var _t=Hp();const jp=Gc({__proto__:null,default:Ct(_t)},[_t]);var ge=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(ge||{});function rr(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&&he.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();ll(r,a)&&he.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Ru(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const h of l)h.st+=r,h.ed+=r;for(let h=0;h<o;h++){const u=s[h],{st:f,ed:g}=u;if(g<=r)i.push(u);else if(r>f&&r<g){a=!0;const v={...u,ed:r};i.push(v),l.length&&i.push(...l);const C={...u,st:r+n,ed:g+n};i.push(C)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=rr(i)}function Iu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=n),o.push(h.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const h=i[l];h.startIndex+=r;const u=h.startIndex;a=o.indexOf(u)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(Zn("startIndex"))}}function Su(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:c}=l;c>=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(Zn("startIndex"))}}function yu(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=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(Zn("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function Ou(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:c,endIndex:h}=l;c>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(Zn("startIndex"))}}const wu="$",bu=e=>e.split(wu)[0];function yi(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=bu(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=bu(i.rangeId),i.rangeId===n.rangeId&&ma(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}${wu}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function Oi(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 Au(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 wi(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 Wp(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;Oi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=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=yi(s)}function Yp(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;wi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=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=Au(s)}function Tu(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:f}=h;if(s<=u&&i>=f){o.push({...h,st:u-s,ed:f-s});continue}else u<=s&&f>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=u&&s<f?(o.push({...h,st:s-s,ed:f-s}),h.ed=s):i>u&&i<=f?(o.push({...h,st:u-s,ed:i-s}),h.st=i-t,h.ed-=t):u>=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 Nu(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<i){o.push({...h,startIndex:u-n});continue}else u>=i&&(h.startIndex-=t);a.push(h)}e.paragraphs=a}return o}function Mu(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.sectionBreaks=a}return o}function Du(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function Lu(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:f}=h;if(s<=u&&i>=f){o.push({...h,startIndex:u-n,endIndex:f-n});continue}else if(u<=s&&f>=i){const g=Qr(u,f,s,i);if(g.length===0||(h.startIndex=g[0],h.endIndex=g[1],h.startIndex===h.endIndex))continue}else i<u&&(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,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:f}=h;if(u>=s&&f<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,f)){const g=Qr(u,f,s,i);if(g.length===0)continue;h.startIndex=g[0],h.endIndex=g[1]}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=yi(a)}return o}function Vp(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:f,endIndex:g}=u;if(f>=i&&g<=o){a.push(u);continue}else if(Math.max(i,f)<=Math.min(o,g)){const v=Qr(f,g,i,o);if(v.length===0)continue;u.startIndex=v[0],u.endIndex=v[1]}else o<f&&r&&(u.startIndex-=t,u.endIndex-=t);l.push(u)}e.customDecorations=l}return a}var Uu=(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))(Uu||{}),Ut=(e=>(e.BULLET_LIST="BULLET_LIST",e.BULLET_LIST_1="BULLET_LIST_1",e.BULLET_LIST_2="BULLET_LIST_2",e.BULLET_LIST_3="BULLET_LIST_3",e.BULLET_LIST_4="BULLET_LIST_4",e.BULLET_LIST_5="BULLET_LIST_5",e.ORDER_LIST="ORDER_LIST",e.ORDER_LIST_1="ORDER_LIST_1",e.ORDER_LIST_2="ORDER_LIST_2",e.ORDER_LIST_3="ORDER_LIST_3",e.ORDER_LIST_4="ORDER_LIST_4",e.ORDER_LIST_5="ORDER_LIST_5",e.ORDER_LIST_QUICK_2="ORDER_LIST_QUICK_2",e.ORDER_LIST_QUICK_3="ORDER_LIST_QUICK_3",e.ORDER_LIST_QUICK_4="ORDER_LIST_QUICK_4",e.ORDER_LIST_QUICK_5="ORDER_LIST_QUICK_5",e.ORDER_LIST_QUICK_6="ORDER_LIST_QUICK_6",e.CHECK_LIST="CHECK_LIST",e.CHECK_LIST_CHECKED="CHECK_LIST_CHECKED",e))(Ut||{});const as={"a)":{glyphFormat:"%1)",glyphType:Te.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Te.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Te.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Te.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER}},On=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:er.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),wn=e=>e.map((t,n)=>({...t,bulletAlignment:er.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Pu=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:er.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),sr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:On(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:On(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:On(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:On(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:On(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:On(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:wn([{glyphFormat:"%1.",glyphType:Te.DECIMAL},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.DECIMAL},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.DECIMAL},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:wn([{glyphFormat:"%1)",glyphType:Te.DECIMAL},{glyphFormat:"%2)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Te.DECIMAL},{glyphFormat:"%5)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Te.DECIMAL},{glyphFormat:"%8)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:wn(["%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:Te.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:wn([{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:wn([{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Te.DECIMAL},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Te.DECIMAL},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Te.DECIMAL},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:wn([{glyphFormat:"%1.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:Pu("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Pu("☑",{st:{s:Ue.TRUE}})}},ls=e=>{const{glyphFormat:t,glyphType:n}=e,r=he.deepClone(sr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},Gp={ORDER_LIST_QUICK_2:ls(as["a)"]),ORDER_LIST_QUICK_3:ls(as["a."]),ORDER_LIST_QUICK_4:ls(as["i."]),ORDER_LIST_QUICK_6:ls(as["I."])};Object.assign(sr,Gp);const Kp={"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 Xp(e,t,n,r,s){const i=Qp(e,t,n,r,s),o=Jp(e,t,n,r,s),a=qp(e,t,n,r,s),l=Zp(e,t,n,r,s),c=eE(e,t,n,r,s),h=tE(e,t,n,r),u=nE(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function Qp(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=Tu(e,n,r);if(s!==Pe.REPLACE){const l=Fu(o,a,s);t.textRuns=l}return Ru(e,t,n,r),a}function Fu(e,t,n){if(t.length===0)return e;e=he.deepClone(e),t=he.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:g,ed:v,ts:C}=e[o],{st:w,ed:N,ts:G,sId:z}=t[a];let oe;if(n===Pe.COVER?oe={...G,...C}:oe={...C},v<w)c()||r.push(e[o]),o++;else if(N<g)c()||r.push(t[a]),a++;else{const M={st:Math.min(g,w),ed:Math.max(g,w),ts:g<w?{...C}:{...G},sId:g<w?void 0:z};M.ed>M.st&&r.push(M),r.push({st:Math.max(g,w),ed:Math.min(v,N),ts:oe,sId:z}),v<N?(o++,t[a].st=v,t[a].st===t[a].ed&&a++):(a++,e[o].st=N,e[o].st===e[o].ed&&o++);const T={st:Math.min(v,N),ed:Math.max(v,N),ts:v<N?{...G}:{...C},sId:v<N?z:void 0};l=T.ed>T.st?T:null}}c();const h=r[r.length-1],u=e[s-1],f=t[i-1];return h&&h.ed!==Math.max(u.ed,f.ed)&&(u.ed>f.ed?r.push(u):r.push(f)),rr(r)}function Jp(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=Nu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:f}=c;let g=[];for(const v of a){const{startIndex:C,paragraphStyle:w,bullet:N}=v;let G,z;if(s===Pe.COVER?(G={...w,...u},z={listId:"",listType:Ut.BULLET_LIST,nestingLevel:0,textStyle:{},...N,...f}):(G={...u,...w},z={listId:"",listType:Ut.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...N}),h===C){g.push({startIndex:h,paragraphStyle:G,bullet:z});break}}l.push(...g),g=[]}t.paragraphs=l}return Iu(e,t,n,r),a}function qp(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=Mu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===Pe.COVER?u.push({...f,...c}):u.push({...c,...f});break}}l.push(...u),u=[]}t.sectionBreaks=l}return Su(e,t,n,r),a}function Zp(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=Du(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===Pe.COVER?u.push({...f,...c}):u.push({...c,...f});break}}l.push(...u),u=[]}t.customBlocks=l}return yu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function eE(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Lu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let f=[];for(const g of a){const{startIndex:v,endIndex:C}=g;if(v>=h&&C<=u){s===Pe.COVER?f.push({...g,...c}):f.push({...c,...g});break}}l.push(...f),f=[]}t.tables=l}return Ou(e,t,n,r),a}function tE(e,t,n,r,s){e.customRanges||(e.customRanges=[]),Oi(e.customRanges,r),Oi(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:f,endIndex:g}=u;f>=i&&g<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:f,endIndex:g}=u;l.push({...u,startIndex:f+r,endIndex:g+r})}),e.customRanges=yi(l),h):[]}function nE(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),wi(e.customDecorations,r),wi(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 c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+n-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:h}=l;o.push({...l,startIndex:c+r,endIndex:h+r})})}else for(const l of a){const{id:c}=l;if(l.type===cn.DELETED){const h=o.filter(u=>u.id===c);h.length&&i.push(...h)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,h=o.findIndex(u=>u.id===c);h!==-1&&o.splice(h,1)}return e.customDecorations=Au(o),i}var bi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(bi||{});function Qt(e,t,n,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(t,n)};if(o){const N=[];for(const G of o){const z=he.deepClone(G),{st:oe,ed:M}=z;he.hasIntersectionBetweenTwoRanges(oe,M,t,n)&&(t>=oe&&t<=M?N.push({...z,st:t,ed:Math.min(n,M)}):n>=oe&&n<=M?N.push({...z,st:Math.max(t,oe),ed:n}):N.push(z))}u.textRuns=rr(N.map(G=>{const{st:z,ed:oe}=G;return{...G,st:z-t,ed:oe-t}}))}else r&&(u.textRuns=[{st:0,ed:n-t,ts:{}}]);const f=[];for(const N of c){const G=he.deepClone(N),{startIndex:z,endIndex:oe}=G;z>=t&&oe<=n&&f.push({...G,startIndex:z-t,endIndex:oe-t})}f.length&&(u.tables=f);const g=[];for(const N of a){const{startIndex:G}=N;G>=t&&G<n&&g.push(he.deepClone(N))}g.length&&(u.paragraphs=g.map(N=>({...N,startIndex:N.startIndex-t})));const v=[];for(const N of h){const{startIndex:G}=N;G>=t&&G<=n&&v.push(he.deepClone(N))}if(v.length&&(u.sectionBreaks=v.map(N=>({...N,startIndex:N.startIndex-t}))),s===1){const N=$u(e,t,n);N?u.customDecorations=N:r&&(u.customDecorations=[])}const{customRanges:C}=ku(e,t,n);C?u.customRanges=C:r&&(u.customRanges=[]);const w=[];for(const N of l){const{startIndex:G}=N;G>=t&&G<=n&&w.push(he.deepClone(N))}return w.length&&(u.customBlocks=w.map(N=>({...N,startIndex:N.startIndex-t}))),u}function rE(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 c=`${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:c,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function ku(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 $u(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=he.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function sE(e,t,n){return e==null||t==null?e!=null?e:t:Fu(e,t,n)}function iE(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 oE(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 Ai(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:c=[],customRanges:h,customDecorations:u=[]}=t;r.textRuns=sE(l,s,n),r.customRanges=iE(h,o,n);const f=oE(u,a,n);f.length&&(r.customDecorations=f);const g=[];let v=0,C=0;for(;v<i.length&&C<c.length;){const w=i[v],N=c[C],{startIndex:G}=w,{startIndex:z}=N;G===z?(g.push(he.deepMerge(w,N)),v++,C++):G<z?(g.push(he.deepClone(w)),v++):(g.push(he.deepClone(N)),C++)}return v<i.length&&g.push(...i.slice(v)),C<c.length&&g.push(...c.slice(C)),g.length&&(r.paragraphs=g),r}function aE(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 bn{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===ge.DELETE||n.t===ge.RETAIN&&n.body==null?he.deepClone({...n,len:t}):he.deepClone({...n,len:t,body:Qt(n.body,r,r+t,!1)})}else return{t:ge.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:ge.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[]}}function xu(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=Tu(e,t,n),a=Nu(e,t,n),l=Mu(e,t,n),c=Du(e,t,n),h=Lu(e,t,n),u=zp(e,t,n),f=Vp(e,t,n);let g="";return r&&(e.dataStream=Cl(r,s,i),g=r.slice(s,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:f}}function Bu(e,t,n,r){e.dataStream=vl(e.dataStream,r,t.dataStream),Ru(e,t,n,r),Iu(e,t,n,r),Su(e,t,n,r),yu(e,t,n,r),Ou(e,t,n,r),Wp(e,t,n,r),Yp(e,t,n,r)}function lE(e,t,n,r,s=Pe.COVER){return Xp(e,t,n,r,s)}function uE(e,t,n){return t<=0?{dataStream:""}:xu(e,t,n)}function cE(e,t,n,r){n!==0&&Bu(e,t,n,r)}function hE(e,t){const n=new Rn;return n.reset(),t.forEach(r=>{const s=he.deepClone(r);switch(s.t){case ge.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&lE(e,o,a,n.cursor,i),n.moveCursor(a);break}case ge.INSERT:{const{body:i,len:o}=s;cE(e,i,o,n.cursor),n.moveCursor(o);break}case ge.DELETE:{const{len:i}=s;uE(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function dE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=he.deepClone(t),e=he.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,c=0,h=null;function u(){return h?(i.push(h),h=null,!0):!1}for(;l<o&&c<a;){const{st:C,ed:w,ts:N}=t[l],{st:G,ed:z,ts:oe,sId:M}=e[c];let T={};if(s===0)T={...N},n===Pe.COVER&&r===Pe.REPLACE&&oe&&(T=Object.assign({},oe,T));else if(T={...N},n===Pe.REPLACE){if(r===Pe.REPLACE)T={...oe};else if(N&&oe){const W=Object.keys(N);for(const Z of W)oe[Z]&&delete T[Z]}}else if(r===Pe.REPLACE){if(oe){const W=Object.keys(oe);for(const Z of W)oe[Z]!==void 0&&(T[Z]=oe[Z])}}else if(oe){const W=Object.keys(oe);for(const Z of W)T[Z]!==void 0&&delete T[Z]}if(w<G)u()||i.push(t[l]),l++;else if(z<C)u()||i.push(e[c]),c++;else{const W={st:Math.min(C,G),ed:Math.max(C,G),ts:C<G?{...N}:{...oe},sId:C<G?void 0:M};W.ed>W.st&&i.push(),i.push({st:Math.max(C,G),ed:Math.min(w,z),ts:T,sId:M}),w<z?(l++,e[c].st=w,e[c].st===e[c].ed&&c++):(c++,t[l].st=z,t[l].st===t[l].ed&&l++);const Z={st:Math.min(w,z),ed:Math.max(w,z),ts:w<z?{...oe}:{...N},sId:w<z?M:void 0};h=Z.ed>Z.st?Z:null}}u();const f=i[i.length-1],g=t[o-1],v=e[a-1];return f.ed!==Math.max(g.ed,v.ed)&&(g.ed>v.ed?i.push(g):i.push(v)),rr(i,!0)}function fE(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?[he.deepClone(i)]:[he.deepClone(o)];if(r===Pe.REPLACE){const a=he.deepClone(o);return s===1&&Object.assign(a,he.deepClone(i)),[a]}else{const a=he.deepClone(o);return s===1&&Object.assign(a,he.deepClone(i)),[a]}}function Hu(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=he.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?he.deepClone(e.bullet):he.deepClone(t.bullet):e.bullet===void 0?i.bullet=he.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?he.deepClone(t.bullet):he.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=he.deepClone(t.bullet)),i}function gE(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return he.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===cn.DELETED||i===cn.DELETED)&&(o=!0,n.push({...r,type:cn.DELETED}));break}o||n.push(r)}return n}function mE(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:c,paragraphs:h=[],customRanges:u,customDecorations:f}=r,{textRuns:g,paragraphs:v=[],customRanges:C,customDecorations:w}=i,N=dE(c,g,s,o,n?1:0);N&&(a.textRuns=N);const G=fE(u,C,s,o,n?1:0);G&&(a.customRanges=G);const z=gE(f,w);z&&(a.customDecorations=z);const oe=[];let M=0,T=0;for(;M<h.length&&T<v.length;){const W=h[M],Z=v[T],{startIndex:fe}=W,{startIndex:le}=Z;if(fe===le){let p={startIndex:fe};n?p=Hu(W,Z,s,o,1):p=Hu(W,Z,s,o,0),oe.push(p),M++,T++}else fe<le?M++:(oe.push(he.deepClone(Z)),T++)}return T<v.length&&oe.push(...v.slice(T)),oe.length&&(a.paragraphs=oe),{coverType:l,body:a}}function ju(e){return Object.keys(e).length===1}const Dn=class Dn{constructor(){R(this,"_actions",[])}static apply(t,n){return hE(t,n)}static compose(t,n){const r=new bn(t),s=new bn(n),i=new Dn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===ge.INSERT)i.push(s.next());else if(r.peekType()===ge.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===ge.INSERT&&l.t===ge.RETAIN)l.body==null?i.push(a):i.push({...a,body:Ai(a.body,l.body,l.coverType)});else if(a.t===ge.RETAIN&&l.t===ge.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===Pe.REPLACE||l.coverType===Pe.REPLACE?Pe.REPLACE:Pe.COVER;i.push({...a,t:ge.RETAIN,coverType:c,body:Ai(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===ge.RETAIN&&l.t===ge.DELETE?i.push(l):a.t===ge.INSERT&&(l.t,ge.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 bn(t),i=new bn(n),o=new Dn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===ge.INSERT&&(r==="left"||i.peekType()!==ge.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===ge.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===ge.DELETE)continue;if(c.t===ge.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=mE(l,c,r==="left");o.push({...c,t:ge.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new bn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===ge.DELETE){n-=Math.min(o,n-i);continue}else a===ge.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===ge.INSERT)n.push({t:ge.DELETE,len:r.len,body:r.body});else if(r.t===ge.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:ge.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:ge.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===ge.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=Qt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===ge.RETAIN&&i.body!=null){const o=Qt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==ge.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:ge.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:ge.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:ge.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=he.deepClone(t[0]);if(s.t===ge.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===ge.DELETE&&s.t===ge.DELETE)return r.len+=s.len,this;if(r.t===ge.DELETE&&s.t===ge.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===ge.RETAIN&&s.t===ge.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===ge.INSERT&&ju(r.body)&&s.t===ge.INSERT&&ju(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===ge.RETAIN&&aE(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};R(Dn,"id","text-x"),R(Dn,"uri","https://github.com/dream-num/univer#text-x");let rt=Dn;Object.defineProperty(rt,"name",{value:"text-x"});const Ln=class Ln{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==rt.id||(this._subTypes.set(t.name,t),_t.type.registerSubtype(t))}static apply(t,n){if(!_t.type.isNoop(n))return _t.type.apply(t,n)}static compose(t,n){return _t.type.compose(t,n)}static transform(t,n,r){return _t.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===rt.name?rt.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return _t.type.invertWithDoc(t,n)}static isNoop(t){return _t.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Ln),this._instance}removeOp(t,n){return _t.removeOp(t,n)}moveOp(t,n){return _t.moveOp(t,n)}insertOp(t,n){return _t.insertOp(t,n)}replaceOp(t,n,r){return _t.replaceOp(t,n,r)}editOp(t,n=["body"]){return _t.editOp(n,rt.name,t)}};R(Ln,"uri","https://github.com/dream-num/univer#json-x"),R(Ln,"_subTypes",new Map),R(Ln,"_instance",null);let Bt=Ln;Bt.registerSubtype(rt);const Ti={id:"default_doc",documentStyle:{}};class _E extends ns{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={...Ti,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...sr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const h=c.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 Ht extends _E{constructor(n){var s,i;super(he.isEmptyObject(n)?Pp():n);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:he.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={...Ti,...n},this._initializeHeaderFooterModel()}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(!Bt.isNoop(n))return this.snapshot=Bt.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.snapshot}sliceBody(n,r,s=bi.copy){const i=this.getBody();if(i!=null)return Qt(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 Ht(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Ht(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}const pE="0.5.3";function EE(e="",t=Kn.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:pE,locale:t,styles:{},sheets:{},resources:[]}}class Wu{constructor(t={}){R(this,"_styles");R(this,"_cacheMap",new Jn(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=he.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&&he.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(he.diffValue(n[r],t))return r;return null}}function vE(e){const{ranges:t,id:n,type:r}=e,s=new rt;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:ge.RETAIN,len:l-i}),s.push({t:ge.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function CE(e){var h,u,f;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(f=(u=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:f.find(g=>g.id===t);if(!i)return!1;const o=new rt,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:ge.RETAIN,len:a}),o.push({t:ge.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:cn.DELETED}]}}),o}function Yu(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function RE(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):Yu(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function IE(e){return{...he.deepClone(e),rangeId:ln()}}function SE(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 zu(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 yE(e,t){var i,o,a,l,c;const n=zu(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,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}function OE(e,t){var f,g,v;const{rangeId:n,segmentId:r,documentDataModel:s,insert:i}=t,o=(g=(f=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:f.customRanges)==null?void 0:g.find(C=>C.rangeId===n);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new rt,h=l-a+1;c.push({t:ge.RETAIN,len:a}),c.push({t:ge.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:ge.INSERT,body:i,len:i.dataStream.length});const u=l+1+((v=i==null?void 0:i.dataStream.length)!=null?v:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function wE(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new rt;let c=!1;return t.forEach(h=>{var z,oe,M;const u=yE(h,o);if(!u||!o)return!1;const{startOffset:f,endOffset:g}=u,v=(z=o.customRanges)!=null?z:[],C=(T,W,Z)=>{var y,L,b,O;const fe=zu(T,W,v,r),le=Math.min((L=(y=fe[0])==null?void 0:y.startIndex)!=null?L:1/0,T),p=Math.max((O=(b=fe[fe.length-1])==null?void 0:b.endIndex)!=null?O:-1/0,W),j={rangeId:Z?`${n}$${Z}`:n,rangeType:r,startIndex:0,endIndex:p-le,wholeEntity:s,properties:{...i}};l.push({t:ge.RETAIN,len:le-a}),l.push({t:ge.RETAIN,len:p-le+1,body:{dataStream:"",customRanges:[j]},coverType:Pe.COVER}),a=p+1},w=((oe=o.paragraphs)!=null?oe:[]).filter(T=>T.startIndex<g&&T.startIndex>f),N=((M=o.customBlocks)!=null?M:[]).filter(T=>T.startIndex<g&&T.startIndex>f);SE([f,g-1],[...w.map(T=>T.startIndex),...N.map(T=>T.startIndex)]).forEach(([T,W],Z)=>C(T,W,Z)),c=!0,l.selections=[{startOffset:u.endOffset,endOffset:u.endOffset,collapsed:!0}]}),c?l:!1}function Vu(e,t,n=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:ge.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:ge.DELETE,len:u-l}),l=u)}),r&&i.push({t:ge.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:ge.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}const bE=e=>{var u;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=t.collapsed?null:Qt(i,t.startOffset,t.endOffset),a=$o(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([f,g])=>{switch(f){case 0:{const v={t:ge.RETAIN,body:{...Qt(n,l,l+g.length,!1),dataStream:""},len:g.length};return l+=g.length,v}case 1:{const v={t:ge.INSERT,body:Qt(n,l,l+g.length),len:g.length};return l+=g.length,v}default:return{t:ge.DELETE,len:g.length}}}),h=new rt;return h.push({t:ge.RETAIN,len:t.startOffset}),h.push(...c),h};function AE(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 TE(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 NE=e=>{var C,w,N,G;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new rt,l=Bt.getInstance(),c=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const u=(w=(C=n.getSnapshot().drawingsOrder)==null?void 0:C.length)!=null?w:0;let f=0;if(s)i>0&&a.push({t:ge.RETAIN,len:i});else{const z=Vu([t],h,0,null,!1);a.push(...z);const oe=AE(h,[t]),M=(N=n.getDrawings())!=null?N:{},T=(G=n.getDrawingsOrder())!=null?G:[],W=oe.sort((Z,fe)=>T.indexOf(Z)>T.indexOf(fe)?-1:T.indexOf(Z)<T.indexOf(fe)?1:0);if(W.length>0)for(const Z of W){const fe=M[Z],le=T.indexOf(Z);if(fe==null||le<0)continue;const p=l.removeOp(["drawings",Z],fe),j=l.removeOp(["drawingsOrder",le],Z);c.push(p),c.push(j),f++}}a.push({t:ge.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((z,oe)=>({startIndex:oe,blockId:z.drawingId}))},len:r.length});const g=TE(n,o),v=l.editOp(a.serialize(),g);c.push(v);for(const z of r){const{drawingId:oe}=z,M=l.insertOp(["drawings",oe],z),T=l.insertOp(["drawingsOrder",u-f],oe);c.push(M),c.push(T)}return c.reduce((z,oe)=>Bt.compose(z,oe),null)},ME=e=>{var u,f,g;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(f=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs)!=null?f:[],o=t.every(v=>{var C;return((C=v.bullet)==null?void 0:C.listType.indexOf(s))===0});let l=he.generateRandomId(6);if(t.length===1){const v=i.indexOf(t[0]),C=i[v-1],w=i[v+1];C&&C.bullet&&C.bullet.listType.indexOf(s)===0?(l=C.bullet.listId,s!==Ut.CHECK_LIST&&(s=C.bullet.listType)):w&&w.bullet&&w.bullet.listType.indexOf(s)===0&&(l=w.bullet.listId,s!==Ut.CHECK_LIST&&(s=w.bullet.listType))}const c=new Rn;c.reset();const h=new rt;for(const v of t){const{startIndex:C,paragraphStyle:w={},bullet:N}=v;h.push({t:ge.RETAIN,len:C-c.cursor}),h.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:w,startIndex:0}:{startIndex:0,paragraphStyle:{...w},bullet:{nestingLevel:(g=N==null?void 0:N.nestingLevel)!=null?g:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),c.moveCursorTo(C+1)}return h},DE=e=>{var u;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(f=>f.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ut.CHECK_LIST)===-1)return!1;const o=new Rn;o.reset();const a=new rt,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===Ut.CHECK_LIST?Ut.CHECK_LIST_CHECKED:Ut.CHECK_LIST;return a.push({t:ge.RETAIN,len:l-o.cursor}),a.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},LE=e=>{var h,u;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=he.generateRandomId(6),l=new Rn;l.reset();const c=new rt;for(const f of t){const{startIndex:g,paragraphStyle:v={},bullet:C}=f;c.push({t:ge.RETAIN,len:g-l.cursor}),c.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:v,bullet:{nestingLevel:(u=C==null?void 0:C.nestingLevel)!=null?u:0,textStyle:(C==null?void 0:C.listType)===n?C.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(g+1)}return c};function UE(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const PE=e=>{var h,u,f;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Rn;i.reset();const o=new rt,a=(h=r.getSnapshot().lists)!=null?h:{},l=(f=(u=r.getBody())==null?void 0:u.tables)!=null?f:[],c={...sr,...a};for(const g of t){const{startIndex:v,paragraphStyle:C={},bullet:w}=g,N=UE(g,l);if(o.push({t:ge.RETAIN,len:v-i.cursor}),w){const G=w.listType;let z=c[G].nestingLevel.length-1;N&&(z=Math.min(z,2)),o.push({t:ge.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...C},bullet:{...w,nestingLevel:Math.max(Math.min(w.nestingLevel+s,z),0)}}]},coverType:Pe.REPLACE})}else o.push({t:ge.RETAIN,len:1});i.moveCursorTo(v+1)}return o};var Gu=(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))(Gu||{}),Jt=(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))(Jt||{});function FE(e){return`${e}`}const kE=[Jt.TABLE_START,Jt.TABLE_ROW_START,Jt.TABLE_CELL_START,Jt.TABLE_CELL_END,Jt.TABLE_ROW_END,Jt.TABLE_END],Ku=e=>{const t=e.endsWith(`\r
|
|
10
|
+
`)?e.slice(0,-2):e;return kE.reduce((n,r)=>n.replaceAll(r,""),t)},$E=e=>e?Ku(e).replaceAll("\r","")==="":!0,xE=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=t.slice(s,l);if(he.isLegalUrl(h)){const u=ln(),f=`${h}`,g={startIndex:s,endIndex:s+f.length-1,rangeId:u,rangeType:tr.HYPERLINK,properties:{url:e}};r.push(g),i+=f,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&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 BE(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 HE(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 jE(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class At{}R(At,"customRange",{add:wE,delete:OE,copyCustomRange:IE,getCustomRangesInterestsWithSelection:RE,isIntersecting:Yu}),R(At,"customDecoration",{add:vE,delete:CE}),R(At,"selection",{replace:bE,makeSelection:BE,normalizeSelection:HE,delete:Vu}),R(At,"range",{isIntersects:jE}),R(At,"transform",{getPlainText:Ku,fromPlainText:xE,isEmptyDocument:$E}),R(At,"paragraph",{bullet:{set:LE,switch:ME,toggleChecklist:DE,changeNestLevel:PE}}),R(At,"drawing",{add:NE});const WE=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Xt.equals(r,n))),YE=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Xt.equals(n.range,s.range)}),Ni={t:0,b:2,l:2,r:2},zE=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Xu=90;function ir(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=zt.UNSPECIFIED,verticalAlign:a=on.UNSPECIFIED,wrapStrategy:l=an.UNSPECIFIED,cellValueType:c}=n,{t:h,r:u,b:f,l:g}=i||Ni,{vertexAngle:v,centerAngle:C}=ec(s),w={id:"d",body:{dataStream:`${e}${Bo}`,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:u,marginLeft:g,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:C,vertexAngle:v,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new Ht(w)}function VE(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 Qu(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function Ju(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===tr.HYPERLINK))return;const s=At.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:tr.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&rt.apply(r,s.serialize())}function qu(e){return e!=null}const GE='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Zu(e){const t=ut.ff,n=ut.fs;if(!e){const u=`${n}pt ${t}`;return{fontCache:u,fontString:u,fontSize:n,originFontSize:n,fontFamily:t}}let r=yn.ITALIC;(e.it===0||e.it===void 0)&&(r=yn.NORMAL);let s=yn.BOLD;(e.bl===0||e.bl===void 0)&&(s=yn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=t),o=u}const{va:a}=e;let l=i;if(a===$t.SUBSCRIPT||a===$t.SUPERSCRIPT){const u=KE(o,l),{sbr:f,spr:g}=u;l*=a===$t.SUBSCRIPT?f:g}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${GE} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function KE(e,t){return zE(t)}function ec(e){const{a:t=0,v:n=Ue.FALSE}=e||{a:0,v:Ue.FALSE};let r=0,s=t;return n===Ue.TRUE&&(r=Xu,s=Xu),{centerAngle:r,vertexAngle:s}}class XE{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!==Ue.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:De.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:De.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:De.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:De.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 Kt(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Ue.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}}class QE{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:Ue.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===Ue.TRUE)&&typeof c=="number"?c: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:De.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:De.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:De.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:De.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Ue.TRUE:!0}getSize(){return Kt(this._rowData)}}const JE="DEFAULT_WORKSHEET_ROW_COUNT",tc=1e3,qE="DEFAULT_WORKSHEET_COLUMN_COUNT",nc=20,ZE="DEFAULT_WORKSHEET_ROW_HEIGHT",rc=24,e0="DEFAULT_WORKSHEET_COLUMN_WIDTH",sc=88,t0="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",ic=46,n0="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",oc=20;function ac(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Ue.FALSE,rowCount:tc,columnCount:nc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:sc,defaultRowHeight:rc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Ue.TRUE,rowHeader:{width:ic,hidden:Ue.FALSE},columnHeader:{height:oc,hidden:Ue.FALSE},rightToLeft:Ue.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class r0 extends et{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 Jn(5e4));R(this,"_skeletonCache",new Jn(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===De.ROW?this._createRowCache(s,r):i===De.COLUMN?this._createColumnCache(s,r):i===De.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||!he.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!he.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 c=[];for(const h of this._mergeData||[])Xt.intersects(h,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),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 c=[];for(let h=0;h<a.length;h++){const{startRow:u,endRow:f,startColumn:g,endColumn:v}=a[h];for(let C=n;C<=s;C++){let w=!1;for(let N=r;N<=i;N++)if(C>=u&&C<=f&&N>=g&&N<=v){o.push({startRow:u,endRow:f,startColumn:g,endColumn:v}),c.push(h),w=!0;break}if(w)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class lc extends et{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,Cn.Value|Cn.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,Cn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,Cn.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,Xe(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Xe(()=>this._rowFilteredInterceptor=null)}}const uc={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class or{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=ac(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:he.generateRandomId(6),this._cellData=new Dt(o),this._viewModel=new lc((l,c)=>this.getCellRaw(l,c)),this._rowManager=new QE(this._snapshot,this._viewModel,i),this._columnManager=new XE(this._snapshot,s),this._spanModel=new r0(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 c=s?ni(a,i,o,l):ni(a,o,i,l);r||(r={}),r.s=c}}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((c,h)=>{Object.keys(h).forEach(u=>{const f=+u,g=t.getValue(c,f),v=g!=null&&g.s?this._styles.get(g.s):null,C=(v==null?void 0:v.bd)&&(v.bd.b||v.bd.l||v.bd.r||v.bd.t||v.bd.bc_tr||v.bd.bl_tr||v.bd.ml_tr||v.bd.tl_bc||v.bd.tl_br||v.bd.tl_mr);(g&&(g.v||g.p)||v!=null&&v.bg||C)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,f):(l=!0,i=f),o=Math.max(o,f))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.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=he.deepClone(t);return new or(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,c=n;if(r){const{startRow:h,endRow:u,startColumn:f,endColumn:g}=r;t===h&&n===f?(o=u,a=g,l=h,c=f,i=!0):t>=h&&t<=u&&n>=f&&n<=g&&(o=u,a=g,l=h,c=f,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}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=In.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new Dt;return fi(t,r,n,s).forEach((c,h)=>{var f;let u;if(i===In.Raw)u=this.getCellRaw(c,h);else if(i===In.Intercepted)u=this.getCell(c,h);else if(i===In.Both){const g=this.getCellRaw(c,h);if(g){u={...g};const v=(f=this.getCell(c,h))==null?void 0:f.v;qu(v)&&u&&(u.displayV=String(v))}}u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:f,endRow:g}=c;fi(u,g,h,f).forEach((v,C)=>{v===u&&C===h&&l.setValue(v,C,{...o.getValue(v,C),rowSpan:g-u+1,colSpan:f-h+1}),(v!==u||C!==h)&&l.realDeleteValue(v,C)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Sn(this,t,{getStyles:()=>this._styles}):new Sn(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,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const h=a.getCell(l,c),u=!h,f=a.getMergedCell(l,c);if(f){if(l!==f.startRow||c!==f.startColumn){c=f.endColumn+1;continue}if(u&&n){c=f.endColumn+1;continue}const v={row:l,col:c,value:h};return v.colSpan=f.endColumn-f.startColumn+1,v.rowSpan=f.endRow-f.startRow+1,c=f.endColumn+1,{done:!1,value:v}}if(u&&n)c+=1;else{const g={row:l,col:c,value:h};return c+=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 c=s,h=i;return{next(){for(;;){if(c>o&&(h+=1,c=s),h>a)return{done:!0,value:void 0};const u=l.getMergedCell(c,h);if(u){const v=c!==u.startRow,C=v||h!==u.startColumn;if(r&&C||!r&&v){c=u.endRow+1;continue}const w=l.getCell(u.startRow,u.startColumn);if(!w&&n){c=u.endRow+1;continue}const G={row:c,col:u.startColumn,value:w};return G.colSpan=u.endColumn-u.startColumn+1,G.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:G}}const f=l.getCell(c,h);if(!f&&n)c+=1;else{const v={row:c,col:h,value:f};return c+=1,{done:!1,value:v}}}}}}}}_getCellDocumentModel(t,n=uc){var C;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...uc,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const c=VE(o),h=i?ut.tr:c.textRotation||ut.tr;let u=c.horizontalAlign||ut.ht;const f=c.verticalAlign||ut.vt,g=c.wrapStrategy||ut.tb,v=c.paddingData||Ni;if(t.f&&s)a=ir(t.f.toString(),{},{verticalAlign:f}),u=ut.ht;else if(t.p){const{centerAngle:w,vertexAngle:N}=ec(h);a=this._updateConfigAndGetDocumentModel(r?he.deepClone(t.p):t.p,u,v,{horizontalAlign:u,verticalAlign:f,centerAngle:w,vertexAngle:N,wrapStrategy:g,zeroWidthParagraphBreak:1})}else if(t.v!=null){const w=Qu(o);l=Zu(w).fontCache;let N=cc(t);t.t===Vt.FORCE_STRING&&s&&(N=`'${N}`),a=ir(N,w,{...c,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Ju(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:g,verticalAlign:f,horizontalAlign:u,paddingData:v,fill:(C=o==null?void 0:o.bg)==null?void 0:C.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,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=(c=r.l)!=null?c: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 u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=n;return new Ht(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=Qu(r);if(n!=null)return n.documentModel==null&&(n.documentModel=ir("",s)),n;const i="";let o="document";const a=ut.tr,l=ut.ht,c=ut.vt,h=ut.tb,u=Ni;return o=Zu({}).fontCache,{documentModel:ir(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function cc(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 At.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Vt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Vt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function s0(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 At.transform.getPlainText(n)}return e==null?void 0:e.v}var i0=Object.defineProperty,o0=Object.getOwnPropertyDescriptor,a0=(e,t,n,r)=>{for(var s=r>1?void 0:r?o0(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&&i0(t,n,s),s},l0=(e,t)=>(n,r)=>t(n,r,e);function u0(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}d.Workbook=class extends ns{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=EE();he.isEmptyObject(n)?this._snapshot=s:this._snapshot=he.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=he.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Wu(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 he.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 or(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()!==Ue.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===Ue.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Ue.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(he.isEmptyObject(s)){const o=he.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 c=new or(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}},d.Workbook=a0([l0(1,wt)],d.Workbook);class Mi extends ns{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={...yl,...n},this._unitId=(r=this._snapshot.id)!=null?r:he.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:ln(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=ln(6);return{id:n,pageType:Ei.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 ar="FOCUSING_UNIT",An="FOCUSING_SHEET",lr="FOCUSING_DOC",ur="FOCUSING_SLIDE",c0="FOCUSING_EDITOR_BUT_HIDDEN",hc="EDITOR_ACTIVATED",h0="FOCUSING_EDITOR_INPUT_FORMULA",dc="FOCUSING_FX_BAR_EDITOR",d0="FOCUSING_UNIVER_EDITOR",f0="FOCUSING_EDITOR_INPUT_FORMULA",g0="FOCUSING_PANEL_EDITOR",m0="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",_0="FOCUSING_COMMON_DRAWINGS",p0="FORMULA_EDITOR_ACTIVATED";var E0=Object.defineProperty,v0=Object.getOwnPropertyDescriptor,C0=(e,t,n,r)=>{for(var s=r>1?void 0:r?v0(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&&E0(t,n,s),s},fc=(e,t)=>(n,r)=>t(n,r,e);const fn=mt("univer.current");d.UniverInstanceService=class extends et{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(ar,!0),this._contextService.setContextValue(lr,!1),this._contextService.setContextValue(An,!0),this._contextService.setContextValue(ur,!1),this.setCurrentUnitForType(n)):this.focused instanceof Ht?(this._contextService.setContextValue(ar,!0),this._contextService.setContextValue(lr,!0),this._contextService.setContextValue(An,!1),this._contextService.setContextValue(ur,!1),this.setCurrentUnitForType(n)):this.focused instanceof Mi?(this._contextService.setContextValue(ar,!0),this._contextService.setContextValue(lr,!1),this._contextService.setContextValue(An,!1),this._contextService.setContextValue(ur,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(ar,!1),this._contextService.setContextValue(lr,!1),this._contextService.setContextValue(An,!1),this._contextService.setContextValue(ur,!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=C0([fc(0,at(Rt)),fc(1,zn)],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 R0={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var I0=Object.defineProperty,S0=Object.getOwnPropertyDescriptor,y0=(e,t,n,r)=>{for(var s=r>1?void 0:r?S0(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&&I0(t,n,s),s},O0=(e,t)=>(n,r)=>t(n,r,e);d.LifecycleService=class extends et{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(gc(this.stage),this._lifecycle$.pipe(Ce.skip(1))).pipe(Ma(n=>n===Ye.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${R0[n]}".`)}},d.LifecycleService=y0([O0(0,wt)],d.LifecycleService);function gc(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 w0=Object.defineProperty,b0=Object.getOwnPropertyDescriptor,A0=(e,t,n,r)=>{for(var s=r>1?void 0:r?b0(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&&w0(t,n,s),s},Di=(e,t)=>(n,r)=>t(n,r,e);const qt=mt("univer.undo-redo.service"),T0=20;class mc{dispose(){}async dispatchToHandlers(){return!1}}const _c="univer.command.redo",pc="univer.command.undo",cr=new class extends mc{constructor(){super(...arguments);R(this,"type",Vn.COMMAND);R(this,"id",pc)}handler(t){const n=t.get(qt),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(Nt);return ei(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},hr=new class extends mc{constructor(){super(...arguments);R(this,"type",Vn.COMMAND);R(this,"id",_c)}handler(t){const n=t.get(qt),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(Nt);return ei(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};d.LocalUndoRedoService=class extends et{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(cr)),this.disposeWithMe(this._commandService.registerCommand(hr)),this.disposeWithMe(Xe(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Xe(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>T0&&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),Xe(()=>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,c;let n="";const r=this._contextService.getContextValue(An),s=this._contextService.getContextValue(dc),i=this._contextService.getContextValue(hc);return r?s?n=Ps:i?n=Us:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}},d.LocalUndoRedoService=A0([Di(0,fn),Di(1,Nt),Di(2,zn)],d.LocalUndoRedoService);const us=mt("core.resource-manager.service"),Li={[Lt.Editor]:"Editor",[Lt.Owner]:"Owner",[Lt.Reader]:"Reader",[Lt.UNRECOGNIZED]:"UNRECOGNIZED"},cs=e=>e?{userID:`${Li[e]}_${he.generateRandomId(8)}`,name:Li[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},N0=(e,t)=>e.startsWith(Li[t]);class Tn{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new Ce.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new Ce.BehaviorSubject(cs()));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 M0=Object.defineProperty,D0=Object.getOwnPropertyDescriptor,L0=(e,t,n,r)=>{for(var s=r>1?void 0:r?D0(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&&M0(t,n,s),s},Ec=(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(cs(Lt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?N0(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 ln(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:Lt.Owner,shareScope:-1,scope:{read:_i.AllCollaborator,edit:_i.AllCollaborator},creator:cs(Lt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(Lt.Owner)||this._getRole(Lt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}},d.AuthzIoLocalService=L0([Ec(0,us),Ec(1,at(Tn))],d.AuthzIoLocalService);const vc=mt("IAuthzIoIoService"),Cc=mt("univer.config-service");class Rc{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=Ds(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 Ic extends et{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 dr extends et{constructor(){super();R(this,"_currentLocale$",new Ce.BehaviorSubject(Kn.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(Xe(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=Ds((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 U0=Object.defineProperty,P0=Object.getOwnPropertyDescriptor,F0=(e,t,n,r)=>{for(var s=r>1?void 0:r?P0(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&&U0(t,n,s),s},k0=(e,t)=>(n,r)=>t(n,r,e);d.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:Dr.PERSON,mentions:[{objectType:Dr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}},d.MentionIOLocalService=F0([k0(0,at(Tn))],d.MentionIOLocalService);const Sc=mt("univer.service.mention-io");var Ui=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(Ui||{});const yc=mt("univer.permission-service");class Oc extends et{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=Ui.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(Ft.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 bc=Symbol("DependentOn");class Pi extends et{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(Pi,"pluginName"),R(Pi,"type",Be.UNIVER_UNKNOWN);class $0{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 x0{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var B0=Object.defineProperty,H0=Object.getOwnPropertyDescriptor,Ac=(e,t,n,r)=>{for(var s=r>1?void 0:r?H0(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&&B0(t,n,s),s},hs=(e,t)=>(n,r)=>t(n,r,e);const j0=4;function W0(...e){return function(t){t[bc]=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(ds,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(ds,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()},j0))}_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=Ac([hs(0,at(Rt))],d.PluginService);let ds=class extends et{constructor(t,n,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new x0);R(this,"_pluginStore",new $0);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[bc];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){gc(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}})}};ds=Ac([hs(2,wt),hs(3,at(Rt)),hs(4,at(d.LifecycleService))],ds);var Y0=Object.defineProperty,z0=Object.getOwnPropertyDescriptor,V0=(e,t,n,r)=>{for(var s=r>1?void 0:r?z0(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&&Y0(t,n,s),s},Tc=(e,t)=>(n,r)=>t(n,r,e);let Fi=class extends et{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();Ho(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=he.deepClone(t.getSnapshot());return r.resources=n,r}};Fi=V0([Tc(0,at(us)),Tc(1,at(fn))],Fi);const ki=mt("resource-loader-service");class Nc extends et{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),Xe(()=>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 $i extends et{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new Ce.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Xe(()=>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 Mc{constructor(t={},n){R(this,"_startedTypes",new Set);R(this,"_injector");R(this,"_disposingCallbacks",new Mr);const r=this._injector=G0(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get($i).setTheme(s),o&&this._injector.get(dr).load(o),i&&this._injector.get(dr).setLocale(i),a&&this._injector.get(wt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(fn)}get _pluginService(){return this._injector.get(d.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Xe(t));return Xe(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(dr).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,Ht),this._univerInstanceService.registerCtorForType(Be.UNIVER_SLIDE,Mi);const n=t.get(fn);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 G0(e,t){const n=wc([[Ic],[dr],[$i],[d.LifecycleService],[d.PluginService],[Tn],[fn,{useClass:d.UniverInstanceService}],[yc,{useClass:Oc}],[wt,{useClass:ba,lazy:!0}],[Nt,{useClass:d.CommandService}],[qt,{useClass:d.LocalUndoRedoService,lazy:!0}],[Cc,{useClass:Rc}],[zn,{useClass:Oa}],[us,{useClass:Nc,lazy:!0}],[ki,{useClass:Fi,lazy:!0}],[vc,{useClass:d.AuthzIoLocalService,lazy:!0}],[Sc,{useClass:d.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Rt(n);return ga(r,[[Tn],[ki]]),r}var K0=Object.defineProperty,X0=Object.getOwnPropertyDescriptor,Q0=(e,t,n,r)=>{for(var s=r>1?void 0:r?X0(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&&K0(t,n,s),s},J0=(e,t)=>(n,r)=>t(n,r,e);d.FBlob=class extends es{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=Q0([J0(1,at(Rt))],d.FBlob);var xi=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(xi||{}),Bi=(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))(Bi||{}),Hi=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Hi||{}),ji=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(ji||{}),Wi=(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))(Wi||{});const Un=class Un{static get(){if(this._instance)return this._instance;const t=new Un;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 Un.prototype)this[t]=Un.prototype[t]}get UniverInstanceType(){return Be}get LifecycleStages(){return Ye}get DataValidationType(){return Wi}get DataValidationErrorStyle(){return xi}get DataValidationRenderMode(){return Hi}get DataValidationOperator(){return Bi}get DataValidationStatus(){return ji}};R(Un,"_instance");let fs=Un;const Pn=class Pn{static get(){if(this._instance)return this._instance;const t=new Pn;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 Pn.prototype)this[t]=Pn.prototype[t]}get UnitCreated(){return"UnitCreated"}get LifeCycleChanged(){return"LifeCycleChanged"}};R(Pn,"_instance");let gs=Pn;var q0=Object.defineProperty,Z0=Object.getOwnPropertyDescriptor,ev=(e,t,n,r)=>{for(var s=r>1?void 0:r?Z0(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&&q0(t,n,s),s},Dc=(e,t)=>(n,r)=>t(n,r,e);d.FHooks=class extends es{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return Xe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Starting)).subscribe(t))}onReady(t){return Xe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Ready)).subscribe(t))}onRendered(t){return Xe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Rendered)).subscribe(t))}onSteady(t){return Xe(this._lifecycleService.lifecycle$.pipe(Ce.filter(n=>n===Ye.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(Nt).beforeCommandExecuted(r=>{if(r.id===cr.id){const i=this._injector.get(qt).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(Nt).onCommandExecuted(r=>{if(r.id===cr.id){const i=this._injector.get(qt).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(Nt).beforeCommandExecuted(r=>{if(r.id===hr.id){const i=this._injector.get(qt).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(Nt).onCommandExecuted(r=>{if(r.id===hr.id){const i=this._injector.get(qt).pitchTopRedoElement();i&&t(i)}})}},d.FHooks=ev([Dc(0,at(Rt)),Dc(1,at(d.LifecycleService))],d.FHooks);var tv=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,rv=(e,t,n,r)=>{for(var s=r>1?void 0:r?nv(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&&tv(t,n,s),s},Lc=(e,t)=>(n,r)=>t(n,r,e);let Yi=class extends es{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};Yi=rv([Lc(0,at(Rt)),Lc(1,at(Tn))],Yi);var sv=Object.defineProperty,iv=Object.getOwnPropertyDescriptor,ov=(e,t,n,r)=>{for(var s=r>1?void 0:r?iv(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&&sv(t,n,s),s},ms=(e,t)=>(n,r)=>t(n,r,e);d.FUniver=class extends Ml{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._injector.onDispose(()=>{this.dispose()})}static newAPI(n){return(n instanceof Mc?n.__getInjector():n).createInstance(d.FUniver)}_ensureEventRegistry(n){return this._eventRegistry.has(n)||this._eventRegistry.set(n,new ts),this._eventRegistry.get(n)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(d.LifecycleService).stage}undo(){return this._commandService.executeCommand(cr.id)}redo(){return this._commandService.executeCommand(hr.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)}newBlob(){return this._injector.createInstance(d.FBlob)}newColor(){return new Qn}get Enum(){return fs.get()}get Event(){return gs.get()}addEvent(n,r){return this._ensureEventRegistry(n).add(r),Xe(()=>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}getUserManager(){return this._injector.createInstance(Yi)}},d.FUniver=ov([ms(0,at(Rt)),ms(1,Nt),ms(2,fn),ms(3,at(d.LifecycleService))],d.FUniver);function Uc(e){return/^-?\d+(\.\d+)?$/.test(e)}function av(e){return Uc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function lv(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 uv(e,t){return t.forEach(n=>e.add(n)),e}function cv(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Ht(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const h=new rt,u=Bt.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}]),(c=f==null?void 0:f.customRanges)!=null&&c.length){const v=f.customRanges[0];g.customRanges=[{...v,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,g)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const hv="__default_document_sub_component_id20231101__";class Pc{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class dv 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 Pc;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 fv(e){return new Ce.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const gv=mt("ILocalStorageService");function mv(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function _v(e){return new Promise(t=>setTimeout(t,e))}function pv(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var zi=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(zi||{}),Fc=(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))(Fc||{});const Vi=mt("core.image-io.service");class Ev{constructor(t,n=100){R(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new Jn(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(Vi)?this._injector.get(Vi):null;if(t===zi.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 vv=["script","style","meta","comment","link"];var kc=(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))(kc||{});const $c=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Gi=1,fr=8;class Ki{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!==Gi)throw new Error(`Got v${s} data when expected v${Gi}.`);const i=$c[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 Ki(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=$c.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,fr,t),this.coords=new this.ArrayType(this.data,fr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(fr+o+a+l),this.ids=new this.IndexArrayType(this.data,fr,t),this.coords=new this.ArrayType(this.data,fr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Gi<<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 Xi(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],c=[];for(;l.length;){const h=l.pop()||0,u=l.pop()||0,f=l.pop()||0;if(u-f<=a){for(let w=f;w<=u;w++){const N=o[2*w],G=o[2*w+1];N>=t&&N<=r&&G>=n&&G<=s&&c.push(i[w])}continue}const g=f+u>>1,v=o[2*g],C=o[2*g+1];v>=t&&v<=r&&C>=n&&C<=s&&c.push(i[g]),(h===0?t<=v:n<=C)&&(l.push(f),l.push(g-1),l.push(1-h)),(h===0?r>=v:s>=C)&&(l.push(g+1),l.push(u),l.push(1-h))}return c}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=[],c=r*r;for(;a.length;){const h=a.pop()||0,u=a.pop()||0,f=a.pop()||0;if(u-f<=o){for(let w=f;w<=u;w++)Bc(i[2*w],i[2*w+1],t,n)<=c&&l.push(s[w]);continue}const g=f+u>>1,v=i[2*g],C=i[2*g+1];Bc(v,C,t,n)<=c&&l.push(s[g]),(h===0?t-r<=v:n-r<=C)&&(a.push(f),a.push(g-1),a.push(1-h)),(h===0?t+r>=v:n+r>=C)&&(a.push(g+1),a.push(u),a.push(1-h))}return l}}function Xi(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;xc(e,t,o,r,s,i),Xi(e,t,n,r,o-1,1-i),Xi(e,t,n,o+1,s,1-i)}function xc(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=n-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),v=Math.max(r,Math.floor(n-h*f/c+g)),C=Math.min(s,Math.floor(n+(c-h)*f/c+g));xc(e,t,n,v,C,i)}const o=t[2*n+i];let a=r,l=s;for(gr(e,t,r,n),t[2*s+i]>o&&gr(e,t,r,s);a<l;){for(gr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?gr(e,t,r,l):(l++,gr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function gr(e,t,n,r){Qi(e,n,r),Qi(t,2*n,2*r),Qi(t,2*n+1,2*r+1)}function Qi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Bc(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function Hc(e,t,n=0,r=e.length-1,s=Cv){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,h=Math.log(l),u=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(n,Math.floor(t-c*u/l+f)),v=Math.min(r,Math.floor(t+(l-c)*u/l+f));Hc(e,t,g,v,s)}const i=e[t];let o=n,a=r;for(mr(e,n,t),s(e[r],i)>0&&mr(e,n,r);o<a;){for(mr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?mr(e,n,a):(a++,mr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function mr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Cv(e,t){return e<t?-1:e>t?1:0}class Ji{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(!ps(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;ps(t,l)&&(n.leaf?r.push(a):Zi(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!ps(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(ps(t,o)){if(n.leaf||Zi(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=Mn([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const h=Rv(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Zi(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!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=Mn(t.slice(n,r+1)),Nn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=Mn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));jc(t,n,r,c,this.compareMinX);for(let h=n;h<=r;h+=c){const u=Math.min(h+c-1,r);jc(t,h,u,l,this.compareMinY);for(let f=h;f<=u;f+=l){const g=Math.min(f+l-1,u);a.children.push(this._build(t,f,g,s-1))}}return Nn(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 c=n.children[l],h=qi(c),u=yv(t,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}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),pr(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=Mn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Nn(r,this.toBBox),Nn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=Mn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Nn(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=_r(t,0,a,this.toBBox),c=_r(t,a,r,this.toBBox),h=Ov(l,c),u=qi(l)+qi(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:Iv,i=t.leaf?this.compareMinY:Sv,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=_r(t,0,n,i),a=_r(t,r-n,r,i);let l=_s(o)+_s(a);for(let c=n;c<r-n;c++){const h=t.children[c];pr(o,t.leaf?i(h):h),l+=_s(o)}for(let c=r-n-1;c>=n;c--){const h=t.children[c];pr(a,t.leaf?i(h):h),l+=_s(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)pr(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():Nn(t[n],this.toBBox)}}function Rv(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 Nn(e,t){_r(e,0,e.children.length,t,e)}function _r(e,t,n,r,s){s||(s=Mn(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];pr(s,e.leaf?r(o):o)}return s}function pr(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 Iv(e,t){return e.minX-t.minX}function Sv(e,t){return e.minY-t.minY}function qi(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function _s(e){return e.maxX-e.minX+(e.maxY-e.minY)}function yv(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 Ov(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 Zi(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function ps(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Mn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jc(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;Hc(e,o,t,n,s),i.push(t,o,o,n)}}class wv{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 Ji),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 c=l.get(s);c&&c.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:c,endRow:h,endColumn:u}=s;for(let f=l;f<=h;f++){const g=a.get(f);if(g)for(let v=c;v<=u;v++){const C=g.get(v);C&&C.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 v;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(v=this._kdTree.get(n))==null?void 0:v.get(r);if(!c)return[];const{tree:h,items:u}=c,f=h.range(o,i,l,a),g=[];for(const C of f){const w=u[C];g.push(...Array.from(w.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 Ki(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:c}=s;if(this._enableOneCellCache&&o===a&&l===c){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(c)&&(c=Number.POSITIVE_INFINITY),h.insert({minX:l,minY:o,maxX:c,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 c of l)yield c}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:c}=s;this._enableOneCellCache?o===l&&a===c?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 Ji;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}Kc(),d.ABCToNumber=Tp,d.AbsoluteRefType=tt,d.ActionIterator=bn,d.AlignTypeH=tu,d.AlignTypeV=nu,d.ArrangeTypeEnum=iu,d.ArrowsAndMarkersShapes=Va,d.AsyncInterceptorManager=tm,d.AutoFillSeries=Pa,d.BaselineOffset=$t,d.BasicShapes=za,d.BlockType=Ul,d.BooleanNumber=Ue,d.BorderStyleTypes=Qe,d.BorderType=Fa,d.BuildTextUtils=At,d.BulletAlignment=er,d.COLORS=si,d.CellModeEnum=In,d.CellValueType=Vt,d.Color=un,d.ColorBuilder=Qn,d.ColorKit=bt,d.ColorType=It,d.ColumnSeparatorType=kl,d.CommandType=Vn,d.CommonHideTypes=ka,d.ConfigService=Rc,d.ContextService=Oa,d.CopyPasteType=$a,d.CustomCommandExecutionError=qs,d.CustomDecorationType=cn,d.CustomRangeType=tr,d.DEFAULT_CELL=mp,d.DEFAULT_DOC=Ti,d.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=hv,d.DEFAULT_EMPTY_DOCUMENT_VALUE=Bo,d.DEFAULT_RANGE=fp,d.DEFAULT_RANGE_ARRAY=dp,d.DEFAULT_SELECTION=gp,d.DEFAULT_SLIDE=yl,d.DEFAULT_STYLES=ut,d.DEFAULT_WORKSHEET_COLUMN_COUNT=nc,d.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=qE,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=oc,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=n0,d.DEFAULT_WORKSHEET_COLUMN_WIDTH=sc,d.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=e0,d.DEFAULT_WORKSHEET_ROW_COUNT=tc,d.DEFAULT_WORKSHEET_ROW_COUNT_KEY=JE,d.DEFAULT_WORKSHEET_ROW_HEIGHT=rc,d.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=ZE,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=ic,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=t0,d.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Ps,d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Us,d.DOCS_ZEN_EDITOR_UNIT_ID_KEY=xo,d.DOC_RANGE_TYPE=il,d.DashStyleType=Yl,d.DataStreamTreeNodeType=Gu,d.DataStreamTreeTokenType=Jt,d.DataValidationErrorStyle=xi,d.DataValidationImeMode=kc,d.DataValidationOperator=Bi,d.DataValidationRenderMode=Hi,d.DataValidationStatus=ji,d.DataValidationType=Wi,d.DeleteDirection=xa,d.DependentOn=W0,d.DesktopLogService=ba,d.DeveloperMetadataVisibility=Ba,d.Dimension=Ha,d.Direction=ja,d.Disposable=et,d.DisposableCollection=Mr,d.DocStyleType=Dl,d.DocumentDataModel=Ht,d.DocumentFlavor=pi,d.DrawingTypeEnum=ou,d.EDITOR_ACTIVATED=hc,d.EXTENSION_NAMES=Ol,d.ErrorService=Ic,d.EventState=Pc,d.EventSubject=dv,d.FBase=es,d.FBaseInitialable=Ml,d.FEnum=fs,d.FEventName=gs,d.FOCUSING_COMMON_DRAWINGS=_0,d.FOCUSING_DOC=lr,d.FOCUSING_EDITOR_BUT_HIDDEN=c0,d.FOCUSING_EDITOR_INPUT_FORMULA=h0,d.FOCUSING_EDITOR_STANDALONE=f0,d.FOCUSING_FX_BAR_EDITOR=dc,d.FOCUSING_PANEL_EDITOR=g0,d.FOCUSING_SHEET=An,d.FOCUSING_SLIDE=ur,d.FOCUSING_UNIT=ar,d.FOCUSING_UNIVER_EDITOR=d0,d.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=m0,d.FORMULA_EDITOR_ACTIVATED=p0,d.FollowNumberWithType=Ll,d.FontItalic=Lr,d.FontStyleType=yn,d.FontWeight=Ur,d.GridType=Pl,d.HLSColor=nl,d.HorizontalAlign=zt,d.IAuthzIoService=vc,d.ICommandService=Nt,d.IConfigService=Cc,d.IContextService=zn,d.IImageIoService=Vi,d.ILocalStorageService=gv,d.ILogService=wt,d.IMentionIOService=Sc,d.IPermissionService=yc,d.IResourceLoaderService=ki,d.IResourceManagerService=us,d.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=og,d.IUndoRedoService=qt,d.IUniverInstanceService=fn,d.ImageCacheMap=Ev,d.ImageSourceType=zi,d.ImageUploadStatusType=Fc,d.Inject=at,d.Injector=Rt,d.InterceptorEffectEnum=Cn,d.InterceptorManager=qg,d.InterpolationPointType=Wa,d.JSON1=jp,d.JSONX=Bt,d.LRUHelper=qn,d.LRUMap=Jn,d.LifecycleStages=Ye,d.ListGlyphType=Te,d.LocaleService=dr,d.LocaleType=Kn,d.LogLevel=wa,d.MOVE_BUFFER_VALUE=Gn,d.Many=Jo,d.MemoryCursor=Rn,d.MentionType=Dr,d.NamedStyleType=jl,d.NilCommand=Ta,d.NumberUnitType=eu,d.ObjectMatrix=Dt,d.ObjectRelativeFromH=ql,d.ObjectRelativeFromV=Zl,d.Optional=qo,d.OtherShapes=Ga,d.PRESET_LIST_TYPE=sr,d.PageElementType=au,d.PageOrientType=su,d.PageType=Ei,d.ParagraphElementType=xl,d.PermissionService=Oc,d.PermissionStatus=Ui,d.Plugin=Pi,d.PositionedObjectLayoutType=Hl,d.PresetListType=Ut,d.ProtectionType=Ya,d.QuickListType=Uu,d.QuickListTypeMap=Kp,d.RANGE_DIRECTION=sl,d.RANGE_TYPE=De,d.RBush=Ji,d.RCDisposable=am,d.RGBA_PAREN=km,d.RGB_PAREN=Fm,d.ROTATE_BUFFER_VALUE=Ua,d.RTree=wv,d.Range=Sn,d.Rectangle=Xt,d.RediConsumer=ca,d.RediContext=Wn,d.RediError=it,d.RediProvider=Qs,d.RedoCommand=hr,d.RedoCommandId=_c,d.RefAlias=Ap,d.Registry=ts,d.RegistryAsMap=mi,d.RelativeDate=Xa,d.RelativeSlideLink=lu,d.ResourceManagerService=Nc,d.RgbColor=kr,d.RxDisposable=om,d.SHEET_EDITOR_UNITS=_p,d.SectionType=Fl,d.Self=Qo,d.SheetTypes=Qa,d.SheetViewModel=lc,d.SkipSelf=Xo,d.SliceBodyType=bi,d.SlideDataModel=Mi,d.SpacingRule=Wl,d.SpecialShapes=Ka,d.Styles=Wu,d.THEME_COLORS=tl,d.TabStopAlignment=zl,d.TableAlignmentType=Gl,d.TableLayoutType=Kl,d.TableRowHeightRule=Ql,d.TableSizeType=Vl,d.TableTextWrapType=Xl,d.TextDecoration=Ja,d.TextDirection=Xn,d.TextDirectionType=$l,d.TextX=rt,d.TextXActionType=ge,d.ThemeColor=$r,d.ThemeColorType=ht,d.ThemeColors=Pr,d.ThemeService=$i,d.Tools=he,d.UndoCommand=cr,d.UndoCommandId=pc,d.UnitModel=ns,d.Univer=Mc,d.UniverInstanceType=Be,d.UpdateDocsAttributeType=Pe,d.UserManagerService=Tn,d.VerticalAlign=on,d.VerticalAlignmentType=Jl,d.WithDependency=Bg,d.WithNew=Zo,d.Worksheet=or,d.WrapStrategy=an,d.WrapTextType=Bl,d.addLinkToDocumentModel=Ju,d.afterInitApply=_m,d.afterTime=mm,d.awaitTime=_v,d.binSearchFirstGreaterThanTarget=La,d.binarySearchArray=pm,d.bufferDebounceTime=gm,d.cellToRange=d_,d.characterSpacingControlType=ru,d.checkForSubstrings=f_,d.checkIfMove=Cm,d.checkParagraphHasBullet=X_,d.checkParagraphHasIndent=Q_,d.checkParagraphHasIndentByStyle=El,d.codeToBlob=vm,d.composeBody=Ai,d.composeInterceptors=_a,d.composeStyles=ni,d.concatMatrixArray=lp,d.connectDependencies=kg,d.connectInjector=Fg,d.convertBodyToHtml=Pm,d.convertCellToRange=ol,d.covertTextRunToHtml=ri,d.createAsyncInterceptorKey=Zg,d.createDefaultUser=cs,d.createDocumentModelWithStyle=ir,d.createIdentifier=mt,d.createInterceptorKey=Jg,d.createInternalEditorID=ag,d.createRowColIter=fi,d.dayjs=xt,d.debounce=zf,d.dedupe=eg,d.deepCompare=ai,d.delayAnimationFrame=pv,d.deleteContent=Cl,d.extractPureTextFromCell=cc,d.forwardRef=vg,d.fromCallback=Na,d.fromEventSubject=fv,d.fromObservable=im,d.generateRandomId=ln,d.get=If,d.getArrayLength=Kt,d.getBodySlice=Qt,d.getBodySliceHtml=Fr,d.getBorderStyleType=u_,d.getCellInfoInMergeData=n_,d.getCellValueType=qm,d.getColorStyle=Mt,d.getCustomDecorationSlice=$u,d.getCustomRangeSlice=ku,d.getDocsUpdateBody=c_,d.getIntersectRange=Ip,d.getOriginCellValue=s0,d.getReverseDirection=Rm,d.getWorksheetUID=u0,d.groupBy=rg,d.handleStyleToString=l_,d.hashAlgorithm=Z_,d.horizontalLineSegmentsSubtraction=Qr,d.insertMatrixArray=ui,d.insertTextToContent=vl,d.isAsyncDependencyItem=Hs,d.isAsyncHook=Or,d.isBlackColor=Xm,d.isBooleanString=ig,d.isCellCoverable=i_,d.isCellV=e_,d.isClassDependencyItem=$s,d.isCtor=ks,d.isDisposable=Ks,d.isEmptyCell=al,d.isFactoryDependencyItem=xs,d.isFormulaId=a_,d.isFormulaString=o_,d.isICellData=Jm,d.isInternalEditorID=Ho,d.isNodeEnv=Um,d.isNotNullOrUndefined=qu,d.isNullCell=Zm,d.isNumeric=Uc,d.isRangesEqual=WE,d.isRealNum=q_,d.isSafeNumeric=av,d.isSameStyleTextRun=ll,d.isUnitRangesEqual=YE,d.isValidRange=h_,d.isValueDependencyItem=Bs,d.isWhiteColor=Qm,d.makeArray=sg,d.makeCellRangeToRangeData=s_,d.makeCellToSelection=r_,d.makeCustomRangeStream=FE,d.merge=Ds,d.mergeOverrideWithDependencies=wc,d.mergeSets=uv,d.mergeWith=Xf,d.mergeWorksheetSnapshotWithDefault=ac,d.mixinClass=nm,d.moveMatrixArray=hi,d.moveRangeByOffset=pp,d.nameCharacterCheck=mv,d.normalizeBody=rE,d.normalizeTextRuns=rr,d.numberToABC=Mp,d.numberToListABC=Dp,d.numfmt=ap,d.queryObjectMatrix=bp,d.registerDependencies=Xg,d.remove=Hn,d.repeatStringNumTimes=Nl,d.replaceInDocumentBody=cv,d.requestImmediateMacroTask=lv,d.rotate=ng,d.searchArray=Em,d.searchInOrderedArray=Da,d.selectionToArray=t_,d.sequence=Ea,d.sequenceAsync=pa,d.sequenceExecute=ei,d.sequenceExecuteAsync=fm,d.set=Jf,d.setDependencies=Eg,d.shallowEqual=ma,d.skipParseTagNames=vv,d.sliceMatrixArray=up,d.sortRules=Lp,d.sortRulesByDesc=Up,d.sortRulesFactory=Zn,d.spliceArray=ci,d.splitIntoGrid=di,d.takeAfter=Ma,d.textDiff=$o,d.throttle=Qg,d.toDisposable=Xe,d.touchDependencies=ga,d.updateAttributeByDelete=xu,d.updateAttributeByInsert=Bu,d.useDependency=Wg,d.useDependencyContext=Gg,d.useDependencyContextValue=Kg,d.useDependencyValue=da,d.useInjector=ha,d.useObservable=zg,d.useUpdateBinder=Vg,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|