@univerjs/core 0.5.0 → 0.5.1

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 CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";var Tc=Object.defineProperty;var Nc=(e,n,t)=>n in e?Tc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var v=(e,n,t)=>Nc(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("rxjs"),Ar=require("rxjs/operators"),lt=require("react");function Mc(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}function Dc(e,n){for(var t=0;t<n.length;t++){const r=n[t];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 Tt=Mc(lt);function Lc(){xc()}const Er=typeof global<"u"?global:typeof self<"u"?self:window;function xc(){typeof Er.requestIdleCallback!="function"&&(Er.requestIdleCallback=function(t){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));t({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof Er.cancelIdleCallback!="function"&&(Er.cancelIdleCallback=function(t){clearTimeout(t)})}var zo=typeof global=="object"&&global&&global.Object===Object&&global,Uc=typeof self=="object"&&self&&self.Object===Object&&self,mn=zo||Uc||Function("return this")(),bn=mn.Symbol,Vo=Object.prototype,Pc=Vo.hasOwnProperty,kc=Vo.toString,xn=bn?bn.toStringTag:void 0;function Fc(e){var n=Pc.call(e,xn),t=e[xn];try{e[xn]=void 0;var r=!0}catch{}var s=kc.call(e);return r&&(n?e[xn]=t:delete e[xn]),s}var $c=Object.prototype,jc=$c.toString;function Hc(e){return jc.call(e)}var Bc="[object Null]",Wc="[object Undefined]",xi=bn?bn.toStringTag:void 0;function or(e){return e==null?e===void 0?Wc:Bc:xi&&xi in Object(e)?Fc(e):Hc(e)}function Nn(e){return e!=null&&typeof e=="object"}var Yc="[object Symbol]";function zr(e){return typeof e=="symbol"||Nn(e)&&or(e)==Yc}function zc(e,n){for(var t=-1,r=e==null?0:e.length,s=Array(r);++t<r;)s[t]=n(e[t],t,e);return s}var An=Array.isArray,Vc=1/0,Ui=bn?bn.prototype:void 0,Pi=Ui?Ui.toString:void 0;function Go(e){if(typeof e=="string")return e;if(An(e))return zc(e,Go)+"";if(zr(e))return Pi?Pi.call(e):"";var n=e+"";return n=="0"&&1/e==-Vc?"-0":n}var Gc=/\s/;function Kc(e){for(var n=e.length;n--&&Gc.test(e.charAt(n)););return n}var Xc=/^\s+/;function Qc(e){return e&&e.slice(0,Kc(e)+1).replace(Xc,"")}function yt(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var ki=NaN,Jc=/^[-+]0x[0-9a-f]+$/i,Zc=/^0b[01]+$/i,qc=/^0o[0-7]+$/i,eh=parseInt;function Fi(e){if(typeof e=="number")return e;if(zr(e))return ki;if(yt(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=yt(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Qc(e);var t=Zc.test(e);return t||qc.test(e)?eh(e.slice(2),t?2:8):Jc.test(e)?ki:+e}function Ko(e){return e}var th="[object AsyncFunction]",nh="[object Function]",rh="[object GeneratorFunction]",sh="[object Proxy]";function Xs(e){if(!yt(e))return!1;var n=or(e);return n==nh||n==rh||n==th||n==sh}var rs=mn["__core-js_shared__"],$i=function(){var e=/[^.]+$/.exec(rs&&rs.keys&&rs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ih(e){return!!$i&&$i in e}var oh=Function.prototype,ah=oh.toString;function lh(e){if(e!=null){try{return ah.call(e)}catch{}try{return e+""}catch{}}return""}var uh=/[\\^$.*+?()[\]{}|]/g,ch=/^\[object .+?Constructor\]$/,hh=Function.prototype,dh=Object.prototype,fh=hh.toString,gh=dh.hasOwnProperty,mh=RegExp("^"+fh.call(gh).replace(uh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ph(e){if(!yt(e)||ih(e))return!1;var n=Xs(e)?mh:ch;return n.test(lh(e))}function _h(e,n){return e==null?void 0:e[n]}function Qs(e,n){var t=_h(e,n);return ph(t)?t:void 0}var ji=Object.create,Eh=function(){function e(){}return function(n){if(!yt(n))return{};if(ji)return ji(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function Ch(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function vh(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}var Rh=800,Ih=16,Sh=Date.now;function Oh(e){var n=0,t=0;return function(){var r=Sh(),s=Ih-(r-t);if(t=r,s>0){if(++n>=Rh)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function yh(e){return function(){return e}}var Lr=function(){try{var e=Qs(Object,"defineProperty");return e({},"",{}),e}catch{}}(),wh=Lr?function(e,n){return Lr(e,"toString",{configurable:!0,enumerable:!1,value:yh(n),writable:!0})}:Ko,bh=Oh(wh),Ah=9007199254740991,Th=/^(?:0|[1-9]\d*)$/;function Js(e,n){var t=typeof e;return n=n==null?Ah:n,!!n&&(t=="number"||t!="symbol"&&Th.test(e))&&e>-1&&e%1==0&&e<n}function Zs(e,n,t){n=="__proto__"&&Lr?Lr(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function Vr(e,n){return e===n||e!==e&&n!==n}var Nh=Object.prototype,Mh=Nh.hasOwnProperty;function Xo(e,n,t){var r=e[n];(!(Mh.call(e,n)&&Vr(r,t))||t===void 0&&!(n in e))&&Zs(e,n,t)}function Dh(e,n,t,r){var s=!t;t||(t={});for(var i=-1,o=n.length;++i<o;){var a=n[i],l=void 0;l===void 0&&(l=e[a]),s?Zs(t,a,l):Xo(t,a,l)}return t}var Hi=Math.max;function Lh(e,n,t){return n=Hi(n===void 0?e.length-1:n,0),function(){for(var r=arguments,s=-1,i=Hi(r.length-n,0),o=Array(i);++s<i;)o[s]=r[n+s];s=-1;for(var a=Array(n+1);++s<n;)a[s]=r[s];return a[n]=t(o),Ch(e,this,a)}}function xh(e,n){return bh(Lh(e,n,Ko),e+"")}var Uh=9007199254740991;function Qo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Uh}function qs(e){return e!=null&&Qo(e.length)&&!Xs(e)}function Ph(e,n,t){if(!yt(t))return!1;var r=typeof n;return(r=="number"?qs(t)&&Js(n,t.length):r=="string"&&n in t)?Vr(t[n],e):!1}function Jo(e){return xh(function(n,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&Ph(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),n=Object(n);++r<s;){var a=t[r];a&&e(n,a,r,i)}return n})}var kh=Object.prototype;function Zo(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||kh;return e===t}function Fh(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}var $h="[object Arguments]";function Bi(e){return Nn(e)&&or(e)==$h}var qo=Object.prototype,jh=qo.hasOwnProperty,Hh=qo.propertyIsEnumerable,Es=Bi(function(){return arguments}())?Bi:function(e){return Nn(e)&&jh.call(e,"callee")&&!Hh.call(e,"callee")};function Bh(){return!1}var ea=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wi=ea&&typeof module=="object"&&module&&!module.nodeType&&module,Wh=Wi&&Wi.exports===ea,Yi=Wh?mn.Buffer:void 0,Yh=Yi?Yi.isBuffer:void 0,ta=Yh||Bh,zh="[object Arguments]",Vh="[object Array]",Gh="[object Boolean]",Kh="[object Date]",Xh="[object Error]",Qh="[object Function]",Jh="[object Map]",Zh="[object Number]",qh="[object Object]",ed="[object RegExp]",td="[object Set]",nd="[object String]",rd="[object WeakMap]",sd="[object ArrayBuffer]",id="[object DataView]",od="[object Float32Array]",ad="[object Float64Array]",ld="[object Int8Array]",ud="[object Int16Array]",cd="[object Int32Array]",hd="[object Uint8Array]",dd="[object Uint8ClampedArray]",fd="[object Uint16Array]",gd="[object Uint32Array]",Xe={};Xe[od]=Xe[ad]=Xe[ld]=Xe[ud]=Xe[cd]=Xe[hd]=Xe[dd]=Xe[fd]=Xe[gd]=!0;Xe[zh]=Xe[Vh]=Xe[sd]=Xe[Gh]=Xe[id]=Xe[Kh]=Xe[Xh]=Xe[Qh]=Xe[Jh]=Xe[Zh]=Xe[qh]=Xe[ed]=Xe[td]=Xe[nd]=Xe[rd]=!1;function md(e){return Nn(e)&&Qo(e.length)&&!!Xe[or(e)]}function pd(e){return function(n){return e(n)}}var na=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=na&&typeof module=="object"&&module&&!module.nodeType&&module,_d=Vn&&Vn.exports===na,ss=_d&&zo.process,zi=function(){try{var e=Vn&&Vn.require&&Vn.require("util").types;return e||ss&&ss.binding&&ss.binding("util")}catch{}}(),Vi=zi&&zi.isTypedArray,ra=Vi?pd(Vi):md;function Ed(e,n){var t=An(e),r=!t&&Es(e),s=!t&&!r&&ta(e),i=!t&&!r&&!s&&ra(e),o=t||r||s||i,a=o?Fh(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")||Js(c,l))||a.push(c);return a}function Cd(e,n){return function(t){return e(n(t))}}function vd(e){var n=[];if(e!=null)for(var t in Object(e))n.push(t);return n}var Rd=Object.prototype,Id=Rd.hasOwnProperty;function Sd(e){if(!yt(e))return vd(e);var n=Zo(e),t=[];for(var r in e)r=="constructor"&&(n||!Id.call(e,r))||t.push(r);return t}function sa(e){return qs(e)?Ed(e):Sd(e)}var Od=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yd=/^\w*$/;function wd(e,n){if(An(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||zr(e)?!0:yd.test(e)||!Od.test(e)||n!=null&&e in Object(n)}var Jn=Qs(Object,"create");function bd(){this.__data__=Jn?Jn(null):{},this.size=0}function Ad(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Td="__lodash_hash_undefined__",Nd=Object.prototype,Md=Nd.hasOwnProperty;function Dd(e){var n=this.__data__;if(Jn){var t=n[e];return t===Td?void 0:t}return Md.call(n,e)?n[e]:void 0}var Ld=Object.prototype,xd=Ld.hasOwnProperty;function Ud(e){var n=this.__data__;return Jn?n[e]!==void 0:xd.call(n,e)}var Pd="__lodash_hash_undefined__";function kd(e,n){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Jn&&n===void 0?Pd:n,this}function un(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}un.prototype.clear=bd;un.prototype.delete=Ad;un.prototype.get=Dd;un.prototype.has=Ud;un.prototype.set=kd;function Fd(){this.__data__=[],this.size=0}function Gr(e,n){for(var t=e.length;t--;)if(Vr(e[t][0],n))return t;return-1}var $d=Array.prototype,jd=$d.splice;function Hd(e){var n=this.__data__,t=Gr(n,e);if(t<0)return!1;var r=n.length-1;return t==r?n.pop():jd.call(n,t,1),--this.size,!0}function Bd(e){var n=this.__data__,t=Gr(n,e);return t<0?void 0:n[t][1]}function Wd(e){return Gr(this.__data__,e)>-1}function Yd(e,n){var t=this.__data__,r=Gr(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}function Yt(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Yt.prototype.clear=Fd;Yt.prototype.delete=Hd;Yt.prototype.get=Bd;Yt.prototype.has=Wd;Yt.prototype.set=Yd;var ia=Qs(mn,"Map");function zd(){this.size=0,this.__data__={hash:new un,map:new(ia||Yt),string:new un}}function Vd(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Kr(e,n){var t=e.__data__;return Vd(n)?t[typeof n=="string"?"string":"hash"]:t.map}function Gd(e){var n=Kr(this,e).delete(e);return this.size-=n?1:0,n}function Kd(e){return Kr(this,e).get(e)}function Xd(e){return Kr(this,e).has(e)}function Qd(e,n){var t=Kr(this,e),r=t.size;return t.set(e,n),this.size+=t.size==r?0:1,this}function tn(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}tn.prototype.clear=zd;tn.prototype.delete=Gd;tn.prototype.get=Kd;tn.prototype.has=Xd;tn.prototype.set=Qd;var Jd="Expected a function";function ei(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Jd);var t=function(){var r=arguments,s=n?n.apply(this,r):r[0],i=t.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return t.cache=i.set(s,o)||i,o};return t.cache=new(ei.Cache||tn),t}ei.Cache=tn;var Zd=500;function qd(e){var n=ei(e,function(r){return t.size===Zd&&t.clear(),r}),t=n.cache;return n}var ef=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tf=/\\(\\)?/g,nf=qd(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(ef,function(t,r,s,i){n.push(s?i.replace(tf,"$1"):r||t)}),n});function rf(e){return e==null?"":Go(e)}function oa(e,n){return An(e)?e:wd(e,n)?[e]:nf(rf(e))}var sf=1/0;function aa(e){if(typeof e=="string"||zr(e))return e;var n=e+"";return n=="0"&&1/e==-sf?"-0":n}function of(e,n){n=oa(n,e);for(var t=0,r=n.length;e!=null&&t<r;)e=e[aa(n[t++])];return t&&t==r?e:void 0}function af(e,n,t){var r=e==null?void 0:of(e,n);return r===void 0?t:r}var la=Cd(Object.getPrototypeOf,Object),lf="[object Object]",uf=Function.prototype,cf=Object.prototype,ua=uf.toString,hf=cf.hasOwnProperty,df=ua.call(Object);function ff(e){if(!Nn(e)||or(e)!=lf)return!1;var n=la(e);if(n===null)return!0;var t=hf.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&ua.call(t)==df}function gf(){this.__data__=new Yt,this.size=0}function mf(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t}function pf(e){return this.__data__.get(e)}function _f(e){return this.__data__.has(e)}var Ef=200;function Cf(e,n){var t=this.__data__;if(t instanceof Yt){var r=t.__data__;if(!ia||r.length<Ef-1)return r.push([e,n]),this.size=++t.size,this;t=this.__data__=new tn(r)}return t.set(e,n),this.size=t.size,this}function Mn(e){var n=this.__data__=new Yt(e);this.size=n.size}Mn.prototype.clear=gf;Mn.prototype.delete=mf;Mn.prototype.get=pf;Mn.prototype.has=_f;Mn.prototype.set=Cf;var ca=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gi=ca&&typeof module=="object"&&module&&!module.nodeType&&module,vf=Gi&&Gi.exports===ca,Ki=vf?mn.Buffer:void 0;Ki&&Ki.allocUnsafe;function Rf(e,n){return e.slice()}var Xi=mn.Uint8Array;function If(e){var n=new e.constructor(e.byteLength);return new Xi(n).set(new Xi(e)),n}function Sf(e,n){var t=If(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}function Of(e){return typeof e.constructor=="function"&&!Zo(e)?Eh(la(e)):{}}function yf(e){return function(n,t,r){for(var s=-1,i=Object(n),o=r(n),a=o.length;a--;){var l=o[++s];if(t(i[l],l,i)===!1)break}return n}}var wf=yf(),is=function(){return mn.Date.now()},bf="Expected a function",Af=Math.max,Tf=Math.min;function Nf(e,n,t){var r,s,i,o,a,l,c=0,h=!1,u=!1,d=!0;if(typeof e!="function")throw new TypeError(bf);n=Fi(n)||0,yt(t)&&(h=!!t.leading,u="maxWait"in t,i=u?Af(Fi(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d);function f(S){var L=r,j=s;return r=s=void 0,c=S,o=e.apply(j,L),o}function p(S){return c=S,a=setTimeout(I,n),h?f(S):o}function E(S){var L=S-l,j=S-c,le=n-L;return u?Tf(le,i-j):le}function R(S){var L=S-l,j=S-c;return l===void 0||L>=n||L<0||u&&j>=i}function I(){var S=is();if(R(S))return D(S);a=setTimeout(I,E(S))}function D(S){return a=void 0,d&&r?f(S):(r=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function B(){return a===void 0?o:D(is())}function w(){var S=is(),L=R(S);if(r=arguments,s=this,l=S,L){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(I,n),f(l)}return a===void 0&&(a=setTimeout(I,n)),o}return w.cancel=x,w.flush=B,w}function Cs(e,n,t){(t!==void 0&&!Vr(e[n],t)||t===void 0&&!(n in e))&&Zs(e,n,t)}function Mf(e){return Nn(e)&&qs(e)}function vs(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function Df(e){return Dh(e,sa(e))}function Lf(e,n,t,r,s,i,o){var a=vs(e,t),l=vs(n,t),c=o.get(l);if(c){Cs(e,t,c);return}var h=i?i(a,l,t+"",e,n,o):void 0,u=h===void 0;if(u){var d=An(l),f=!d&&ta(l),p=!d&&!f&&ra(l);h=l,d||f||p?An(a)?h=a:Mf(a)?h=vh(a):f?(u=!1,h=Rf(l)):p?(u=!1,h=Sf(l)):h=[]:ff(l)||Es(l)?(h=a,Es(a)?h=Df(a):(!yt(a)||Xs(a))&&(h=Of(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Cs(e,t,h)}function ti(e,n,t,r,s){e!==n&&wf(n,function(i,o){if(s||(s=new Mn),yt(i))Lf(e,n,o,t,ti,r,s);else{var a=r?r(vs(e,o),i,o+"",e,n,s):void 0;a===void 0&&(a=i),Cs(e,o,a)}},sa)}var xf=Jo(function(e,n,t,r){ti(e,n,t,r)}),Uf=Jo(function(e,n,t){ti(e,n,t)});function Pf(e,n,t,r){if(!yt(e))return e;n=oa(n,e);for(var s=-1,i=n.length,o=i-1,a=e;a!=null&&++s<i;){var l=aa(n[s]),c=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];c=void 0,c===void 0&&(c=yt(h)?h:Js(n[s+1])?[]:{})}Xo(a,l,c),a=a[l]}return e}function kf(e,n,t){return e==null?e:Pf(e,n,t)}var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et=-1,pt=1,it=0;function Zn(e,n,t,r,s){if(e===n)return e?[[it,e]]:[];if(t!=null){var i=Vf(e,n,t);if(i)return i}var o=ni(e,n),a=e.substring(0,o);e=e.substring(o),n=n.substring(o),o=Xr(e,n);var l=e.substring(e.length-o);e=e.substring(0,e.length-o),n=n.substring(0,n.length-o);var c=Ff(e,n);return a&&c.unshift([it,a]),l&&c.push([it,l]),ri(c,s),r&&Hf(c),c}function Ff(e,n){var t;if(!e)return[[pt,n]];if(!n)return[[Et,e]];var r=e.length>n.length?e:n,s=e.length>n.length?n:e,i=r.indexOf(s);if(i!==-1)return t=[[pt,r.substring(0,i)],[it,s],[pt,r.substring(i+s.length)]],e.length>n.length&&(t[0][0]=t[2][0]=Et),t;if(s.length===1)return[[Et,e],[pt,n]];var o=jf(e,n);if(o){var a=o[0],l=o[1],c=o[2],h=o[3],u=o[4],d=Zn(a,c),f=Zn(l,h);return d.concat([[it,u]],f)}return $f(e,n)}function $f(e,n){for(var t=e.length,r=n.length,s=Math.ceil((t+r)/2),i=s,o=2*s,a=new Array(o),l=new Array(o),c=0;c<o;c++)a[c]=-1,l[c]=-1;a[i+1]=0,l[i+1]=0;for(var h=t-r,u=h%2!==0,d=0,f=0,p=0,E=0,R=0;R<s;R++){for(var I=-R+d;I<=R-f;I+=2){var D=i+I,x;I===-R||I!==R&&a[D-1]<a[D+1]?x=a[D+1]:x=a[D-1]+1;for(var B=x-I;x<t&&B<r&&e.charAt(x)===n.charAt(B);)x++,B++;if(a[D]=x,x>t)f+=2;else if(B>r)d+=2;else if(u){var w=i+h-I;if(w>=0&&w<o&&l[w]!==-1){var S=t-l[w];if(x>=S)return Qi(e,n,x,B)}}}for(var L=-R+p;L<=R-E;L+=2){var w=i+L,S;L===-R||L!==R&&l[w-1]<l[w+1]?S=l[w+1]:S=l[w-1]+1;for(var j=S-L;S<t&&j<r&&e.charAt(t-S-1)===n.charAt(r-j-1);)S++,j++;if(l[w]=S,S>t)E+=2;else if(j>r)p+=2;else if(!u){var D=i+h-L;if(D>=0&&D<o&&a[D]!==-1){var x=a[D],B=i+x-D;if(S=t-S,x>=S)return Qi(e,n,x,B)}}}}return[[Et,e],[pt,n]]}function Qi(e,n,t,r){var s=e.substring(0,t),i=n.substring(0,r),o=e.substring(t),a=n.substring(r),l=Zn(s,i),c=Zn(o,a);return l.concat(c)}function ni(e,n){if(!e||!n||e.charAt(0)!==n.charAt(0))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(i,s)==n.substring(i,s)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return ha(e.charCodeAt(s-1))&&s--,s}function Ji(e,n){var t=e.length,r=n.length;if(t==0||r==0)return 0;t>r?e=e.substring(t-r):t<r&&(n=n.substring(0,t));var s=Math.min(t,r);if(e==n)return s;for(var i=0,o=1;;){var a=e.substring(s-o),l=n.indexOf(a);if(l==-1)return i;o+=l,(l==0||e.substring(s-o)==n.substring(0,o))&&(i=o,o++)}}function Xr(e,n){if(!e||!n||e.slice(-1)!==n.slice(-1))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(e.length-s,e.length-i)==n.substring(n.length-s,n.length-i)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return da(e.charCodeAt(e.length-s))&&s--,s}function jf(e,n){var t=e.length>n.length?e:n,r=e.length>n.length?n:e;if(t.length<4||r.length*2<t.length)return null;function s(f,p,E){for(var R=f.substring(E,E+Math.floor(f.length/4)),I=-1,D="",x,B,w,S;(I=p.indexOf(R,I+1))!==-1;){var L=ni(f.substring(E),p.substring(I)),j=Xr(f.substring(0,E),p.substring(0,I));D.length<j+L&&(D=p.substring(I-j,I)+p.substring(I,I+L),x=f.substring(0,E-j),B=f.substring(E+L),w=p.substring(0,I-j),S=p.substring(I+L))}return D.length*2>=f.length?[x,B,w,S,D]:null}var i=s(t,r,Math.ceil(t.length/4)),o=s(t,r,Math.ceil(t.length/2)),a;if(!i&&!o)return null;o?i?a=i[4].length>o[4].length?i:o:a=o:a=i;var l,c,h,u;e.length>n.length?(l=a[0],c=a[1],h=a[2],u=a[3]):(h=a[0],u=a[1],l=a[2],c=a[3]);var d=a[4];return[l,c,h,u,d]}function Hf(e){for(var n=!1,t=[],r=0,s=null,i=0,o=0,a=0,l=0,c=0;i<e.length;)e[i][0]==it?(t[r++]=i,o=l,a=c,l=0,c=0,s=e[i][1]):(e[i][0]==pt?l+=e[i][1].length:c+=e[i][1].length,s&&s.length<=Math.max(o,a)&&s.length<=Math.max(l,c)&&(e.splice(t[r-1],0,[Et,s]),e[t[r-1]+1][0]=pt,r--,r--,i=r>0?t[r-1]:-1,o=0,a=0,l=0,c=0,s=null,n=!0)),i++;for(n&&ri(e),Yf(e),i=1;i<e.length;){if(e[i-1][0]==Et&&e[i][0]==pt){var h=e[i-1][1],u=e[i][1],d=Ji(h,u),f=Ji(u,h);d>=f?(d>=h.length/2||d>=u.length/2)&&(e.splice(i,0,[it,u.substring(0,d)]),e[i-1][1]=h.substring(0,h.length-d),e[i+1][1]=u.substring(d),i++):(f>=h.length/2||f>=u.length/2)&&(e.splice(i,0,[it,h.substring(0,f)]),e[i-1][0]=pt,e[i-1][1]=u.substring(0,u.length-f),e[i+1][0]=Et,e[i+1][1]=h.substring(f),i++),i++}i++}}var Zi=/[^a-zA-Z0-9]/,qi=/\s/,eo=/[\r\n]/,Bf=/\n\r?\n$/,Wf=/^\r?\n\r?\n/;function Yf(e){function n(f,p){if(!f||!p)return 6;var E=f.charAt(f.length-1),R=p.charAt(0),I=E.match(Zi),D=R.match(Zi),x=I&&E.match(qi),B=D&&R.match(qi),w=x&&E.match(eo),S=B&&R.match(eo),L=w&&f.match(Bf),j=S&&p.match(Wf);return L||j?5:w||S?4:I&&!x&&B?3:x||B?2:I||D?1:0}for(var t=1;t<e.length-1;){if(e[t-1][0]==it&&e[t+1][0]==it){var r=e[t-1][1],s=e[t][1],i=e[t+1][1],o=Xr(r,s);if(o){var a=s.substring(s.length-o);r=r.substring(0,r.length-o),s=a+s.substring(0,s.length-o),i=a+i}for(var l=r,c=s,h=i,u=n(r,s)+n(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var d=n(r,s)+n(s,i);d>=u&&(u=d,l=r,c=s,h=i)}e[t-1][1]!=l&&(l?e[t-1][1]=l:(e.splice(t-1,1),t--),e[t][1]=c,h?e[t+1][1]=h:(e.splice(t+1,1),t--))}t++}}function ri(e,n){e.push([it,""]);for(var t=0,r=0,s=0,i="",o="",a;t<e.length;){if(t<e.length-1&&!e[t][1]){e.splice(t,1);continue}switch(e[t][0]){case pt:s++,o+=e[t][1],t++;break;case Et:r++,i+=e[t][1],t++;break;case it:var l=t-s-r-1;if(n){if(l>=0&&ga(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,o=c+o,!e[l][1]){e.splice(l,1),t--;var h=l-1;e[h]&&e[h][0]===pt&&(s++,o=e[h][1]+o,h--),e[h]&&e[h][0]===Et&&(r++,i=e[h][1]+i,h--),l=h}}if(fa(e[t][1])){var c=e[t][1].charAt(0);e[t][1]=e[t][1].slice(1),i+=c,o+=c}}if(t<e.length-1&&!e[t][1]){e.splice(t,1);break}if(i.length>0||o.length>0){i.length>0&&o.length>0&&(a=ni(o,i),a!==0&&(l>=0?e[l][1]+=o.substring(0,a):(e.splice(0,0,[it,o.substring(0,a)]),t++),o=o.substring(a),i=i.substring(a)),a=Xr(o,i),a!==0&&(e[t][1]=o.substring(o.length-a)+e[t][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a)));var u=s+r;i.length===0&&o.length===0?(e.splice(t-u,u),t=t-u):i.length===0?(e.splice(t-u,u,[pt,o]),t=t-u+1):o.length===0?(e.splice(t-u,u,[Et,i]),t=t-u+1):(e.splice(t-u,u,[Et,i],[pt,o]),t=t-u+2)}t!==0&&e[t-1][0]===it?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,r=0,i="",o="";break}}e[e.length-1][1]===""&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]===it&&e[t+1][0]===it&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)===e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&ri(e,n)}function ha(e){return e>=55296&&e<=56319}function da(e){return e>=56320&&e<=57343}function fa(e){return da(e.charCodeAt(0))}function ga(e){return ha(e.charCodeAt(e.length-1))}function zf(e){for(var n=[],t=0;t<e.length;t++)e[t][1].length>0&&n.push(e[t]);return n}function os(e,n,t,r){return ga(e)||fa(r)?null:zf([[it,e],[Et,n],[pt,t],[it,r]])}function Vf(e,n,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,s=typeof t=="number"?null:t.newRange,i=e.length,o=n.length;if(r.length===0&&(s===null||s.length===0)){var a=r.index,l=e.slice(0,a),c=e.slice(a),h=s?s.index:null;e:{var u=a+o-i;if(h!==null&&h!==u||u<0||u>o)break e;var d=n.slice(0,u),f=n.slice(u);if(f!==c)break e;var p=Math.min(a,u),E=l.slice(0,p),R=d.slice(0,p);if(E!==R)break e;var I=l.slice(p),D=d.slice(p);return os(E,I,D,c)}e:{if(h!==null&&h!==a)break e;var x=a,d=n.slice(0,x),f=n.slice(x);if(d!==l)break e;var B=Math.min(i-x,o-x),w=c.slice(c.length-B),S=f.slice(f.length-B);if(w!==S)break e;var I=c.slice(0,c.length-B),D=f.slice(0,f.length-B);return os(l,I,D,w)}}if(r.length>0&&s&&s.length===0)e:{var E=e.slice(0,r.index),w=e.slice(r.index+r.length),p=E.length,B=w.length;if(o<p+B)break e;var R=n.slice(0,p),S=n.slice(o-B);if(E!==R||w!==S)break e;var I=e.slice(p,i-B),D=n.slice(p,o-B);return os(E,I,D,w)}return null}function Qr(e,n,t,r){return Zn(e,n,t,r,!0)}Qr.INSERT=pt;Qr.DELETE=Et;Qr.EQUAL=it;var Gf=Qr;const ma=wt(Gf);function ar(e,n){const t=e.indexOf(n);return t>-1?(e.splice(t,1),!0):!1}function Kf(e){const n=new Set,t=[];for(const r of e)n.has(r)||(n.add(r),t.push(r));return t}function Xf(e,n){for(let t=e.length-1;t>-1;t--){const r=e[t];if(n(r,t))return r}return null}function Qf(e,n){if(e.length===0)return e;const t=n%e.length;return e.slice(t).concat(e.slice(0,t))}function Jf(e,n){const t=new Map;return e.forEach(r=>{const s=n(r);let i=t.get(s);t.has(s)||(i=[],t.set(s,i)),i.push(r)}),t}function Zf(e){return Array.isArray(e)?e:[e]}function qf(e){return["true","false"].includes(e.toLowerCase())}const lr="__INTERNAL_EDITOR__",si=`${lr}DOCS_NORMAL`,ii=`${lr}DOCS_FORMULA_BAR`,pa=`${lr}ZEN_EDITOR`,_a=`\r
2
- `,eg="isRowStylePrecedeColumnStyle";function tg(e){return`${lr}${e}`}function Ea(e){return e.startsWith(lr)}var oi=Symbol("$$IDENTIFIER_DECORATOR");function ng(e){return e&&e[oi]===!0}function ai(e){return typeof e=="function"}function Rs(e){return!!(e&&typeof e.useClass<"u")}function Is(e){return!!(e&&typeof e.useFactory<"u")}function Ss(e){return!!(e&&typeof e.useValue<"u")}function rg(e){return!!(e&&typeof e.useExisting<"u")}function Os(e){return!!(e&&typeof e.useAsync<"u")}var Ca=Symbol("AsyncHook");function Tr(e){return!!(e&&e.__symbol===Ca)}function Ct(e){return typeof e>"u"?"undefined":ai(e)&&!e[oi]?e.name:e.toString()}exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var sg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ot=function(e){sg(n,e);function n(t){return e.call(this,"[redi]: ".concat(t))||this}return n}(Error),va=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),to=Symbol("$$TARGET"),ys=Symbol("$$DEPENDENCIES"),ig=function(e){va(n,e);function n(t,r){var s="Could not find dependency registered on the ".concat(t,' (indexed) parameter of the constructor of "').concat(Ct(r),'".');return e.call(this,s)||this}return n}(ot),Ra=function(e){va(n,e);function n(t,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Ct(t),'". 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 n}(ot);function Ia(e){var n=e;return n[ys]||[]}function li(e,n){var t=Ia(e),r=t.find(function(s){return s.paramIndex===n});if(!r)throw new ig(n,e);return r}function ui(e,n,t,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:t,identifier:n,quantity:r,lookUp:s,withNew:!1};if(typeof n>"u")throw new Ra(e,t);var o=e;o[to]===o?o[ys].push(i):(o[ys]=[i],o[to]=o)}var no=new Set;function Rt(e){if(no.has(e))throw new ot('Identifier "'.concat(e,'" already exists.'));no.add(e);var n=function(t,r,s){ui(t,n,s)};return n.toString=function(){return e},n[oi]=!0,n}var og=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ag=function(e){og(n,e);function n(t,r,s){var i='Expect "'.concat(r,'" dependency items for id "').concat(Ct(t),'" but get ').concat(s,".");return e.call(this,i)||this}return n}(ot);function Sa(e,n,t){if(n===exports.Quantity.OPTIONAL&&t>1||n===exports.Quantity.REQUIRED&&t!==1)throw new ag(e,n,t)}function lg(e,n){return e===exports.Quantity.MANY?n:n[0]}function ug(e,n,t){var r=li(e,n);r.quantity=t}function ci(e){return function n(t){return this instanceof n?this:function(r,s,i){if(t)ui(r,t,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Ra(r,i);ug(r,i,e)}}}}var Oa=ci(exports.Quantity.MANY),ya=ci(exports.Quantity.OPTIONAL),vt=ci(exports.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 wa=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function fg(e){return e.length===1}var Jr=[];function ro(e){Jr.push(e)}function so(){Jr.pop()}function gg(){Jr.length=0}var io=function(e){wa(n,e);function n(t,r,s){var i='Cannot find "'.concat(Ct(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(ng(t)?Ct(t):t.name,'".');return e.call(this,i)||this}return n}(ot),Nr=function(e){wa(n,e);function n(t){var r=this,s='Cannot find "'.concat(Ct(t),'" registered by any injector. The stack of dependencies is: "').concat(Jr.map(function(i){return Ct(i)}).join(" -> "),'".');return r=e.call(this,s)||this,gg(),r}return n}(ot),mg=function(){function e(n){var t=this;this.dependencyMap=new Map,this.normalizeDependencies(n).map(function(r){return t.add(r[0],r[1])})}return e.prototype.add=function(n,t){typeof t>"u"&&(t={useClass:n,lazy:!1});var r=this.dependencyMap.get(n);typeof r>"u"&&(r=[],this.dependencyMap.set(n,r)),r.push(t)},e.prototype.delete=function(n){this.dependencyMap.delete(n)},e.prototype.get=function(n,t){t===void 0&&(t=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(n);return Sa(n,t,r.length),lg(t,r)},e.prototype.has=function(n){return this.dependencyMap.has(n)},e.prototype.append=function(n){var t=this;this.normalizeDependencies(n).forEach(function(r){return t.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(n){return n.map(function(t){var r=t[0],s;return fg(t)?s={useClass:t[0],lazy:!1}:s=t[1],[r,s]})},e}(),pg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(n,t){var r=this.resolvedDependencies.get(n);typeof r>"u"&&(r=[],this.resolvedDependencies.set(n,r)),r.push(t)},e.prototype.has=function(n){return this.resolvedDependencies.has(n)},e.prototype.delete=function(n){if(this.resolvedDependencies.has(n)){var t=this.resolvedDependencies.get(n);t.forEach(function(r){return ws(r)?r.dispose():void 0}),this.resolvedDependencies.delete(n)}},e.prototype.get=function(n,t){t===void 0&&(t=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(n);if(!r)throw new Nr(n);return Sa(n,t,r.length),t===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(n){n.forEach(function(t){return ws(t)?t.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function _g(e,n,t){var r=li(e,n);r.lookUp=t}function ba(e){return function n(){return this instanceof n?this:function(t,r,s){_g(t,s,e)}}}var Aa=ba(exports.LookUp.SKIP_SELF),Ta=ba(exports.LookUp.SELF);function Eg(e,n,t){var r=li(e,n);r.withNew=t}function Cg(e){return function n(){return this instanceof n?this:function(t,r,s){Eg(t,s,e)}}}var Na=Cg(!0);function Ma(e,n){return n===void 0&&(n=0),e?e.map(function(t,r){if(r+=n,!Array.isArray(t))return{paramIndex:r,identifier:t,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=t.slice(0,t.length-1),i=t[t.length-1],o=void 0,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof Ta)o=exports.LookUp.SELF;else if(c instanceof Aa)o=exports.LookUp.SKIP_SELF;else if(c instanceof ya)a=exports.Quantity.OPTIONAL;else if(c instanceof Oa)a=exports.Quantity.MANY;else if(c instanceof Na)l=!0;else throw new ot("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var bs;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")bs=function(n,t){var r=requestIdleCallback(n,typeof t=="number"?{timeout:t}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});bs=function(n){var t=setTimeout(function(){return n(e)}),r=!1;return function(){r||(r=!0,clearTimeout(t))}}}})();var vg=function(){function e(n){var t=this;this.didRun=!1,this.selfExecutor=function(){try{t.value=n()}catch(r){t.error=r}finally{t.didRun=!0}},this.disposeCallback=bs(function(){return t.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}(),Dn=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),xr=function(){return xr=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},xr.apply(this,arguments)},sn=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))},Rg=300,Un=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Ig=function(e){Dn(n,e);function n(t){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Ct(t),'".'))||this}return n}(ot),Sg=function(e){Dn(n,e);function n(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return n}(ot),Og=function(e){Dn(n,e);function n(t){return e.call(this,'Async item "'.concat(Ct(t),'" returns another async item.'))||this}return n}(ot),yg=function(e){Dn(n,e);function n(t){return e.call(this,'Cannot get async item "'.concat(Ct(t),'" from sync api.'))||this}return n}(ot),oo=function(e){Dn(n,e);function n(t){return e.call(this,'Cannot add dependency "'.concat(Ct(t),'" after it is already resolved.'))||this}return n}(ot),wg=function(e){Dn(n,e);function n(t){return e.call(this,'Cannot dependency dependency "'.concat(Ct(t),'" after it is already resolved.'))||this}return n}(ot),Ft=function(){function e(n,t){t===void 0&&(t=null),this.parent=t,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new mg(n||[]),this.resolvedDependencyCollection=new pg,t&&t.children.push(this)}return e.prototype.createChild=function(n){return this._ensureInjectorNotDisposed(),new e(n,this)},e.prototype.dispose=function(){this.children.forEach(function(n){return n.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0},e.prototype.deleteSelfFromParent=function(){if(this.parent){var n=this.parent.children.indexOf(this);n>-1&&this.parent.children.splice(n,1)}},e.prototype.add=function(n){this._ensureInjectorNotDisposed();var t=n[0],r=n[1];if(this.resolvedDependencyCollection.has(t))throw new oo(t);typeof r>"u"?this.dependencyCollection.add(t):Os(r)||Rs(r)||Ss(r)||Is(r)?this.dependencyCollection.add(t,r):this.resolvedDependencyCollection.add(t,r)},e.prototype.replace=function(n){this._ensureInjectorNotDisposed();var t=n[0];if(this.resolvedDependencyCollection.has(t))throw new oo(t);this.dependencyCollection.delete(t),n.length===1?this.dependencyCollection.add(t):this.dependencyCollection.add(t,n[1])},e.prototype.delete=function(n){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(n))throw new wg(n);this.dependencyCollection.delete(n)},e.prototype.invoke=function(n){for(var t=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return t._get(o,a,l)},has:function(o){return t.has(o)}};return n.apply(void 0,sn([i],r,!1))},e.prototype.has=function(n){var t;return this.dependencyCollection.has(n)||((t=this.parent)===null||t===void 0?void 0:t.has(n))||!1},e.prototype.get=function(n,t,r){this._ensureInjectorNotDisposed();var s=this._get(n,t,r);if(Array.isArray(s)&&s.some(function(i){return Tr(i)})||Tr(s))throw new yg(n);return s},e.prototype._get=function(n,t,r,s){var i=exports.Quantity.REQUIRED;if(t===exports.Quantity.REQUIRED||t===exports.Quantity.OPTIONAL||t===exports.Quantity.MANY?i=t:r=t,!s){var o=this.getValue(n,i,r);if(o!==Un)return o}return this.createDependency(n,i,r,!s)},e.prototype.getAsync=function(n){this._ensureInjectorNotDisposed();var t=this.getValue(n,exports.Quantity.REQUIRED);if(t!==Un)return Promise.resolve(t);var r=this.createDependency(n,exports.Quantity.REQUIRED);return Tr(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,sn([{useClass:n}],t,!1))},e.prototype._resolveDependency=function(n,t,r){r===void 0&&(r=!0);var s;ro(n);try{Ss(t)?s=this._resolveValueDependency(n,t):Is(t)?s=this._resolveFactory(n,t,r):Rs(t)?s=this._resolveClass(n,t,r):rg(t)?s=this._resolveExisting(n,t):s=this._resolveAsync(n,t),so()}catch(i){throw so(),i}return s},e.prototype._resolveExisting=function(n,t){var r=this.get(t.useExisting);return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveValueDependency=function(n,t){var r=t.useValue;return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveClass=function(n,t,r){var s=this;r===void 0&&(r=!0);var i;if(t.lazy){var o=new vg(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(t)});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(t);return n&&r&&this.resolvedDependencyCollection.add(n,i),i},e.prototype._resolveClassImpl=function(n){for(var t,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=n.useClass;this.markNewResolution(i);for(var o=Ia(i).sort(function(R,I){return R.paramIndex-I.paramIndex}).map(function(R){return xr(xr({},R),{identifier:dg(R.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(R){throw R instanceof Nr?new io(i,h.identifier,h.paramIndex):R}}var d=sn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(Ct(i)," but get ").concat(d.length,"."));var p=f-d.length;p>0?d=sn(sn([],d,!0),new Array(p).fill(void 0),!0):d=d.slice(0,f)}var E=new(i.bind.apply(i,sn(sn([void 0],d,!1),a,!1)));return(t=n==null?void 0:n.onInstantiation)===null||t===void 0||t.call(n,E),this.markResolutionCompleted(),E},e.prototype._resolveFactory=function(n,t,r){var s;this.markNewResolution(n);for(var i=Ma(t.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(d){throw d instanceof Nr?new io(n,c.identifier,c.paramIndex):d}}var u=t.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(n,u),this.markResolutionCompleted(),(s=t==null?void 0:t.onInstantiation)===null||s===void 0||s.call(t,u),u},e.prototype._resolveAsync=function(n,t){var r=this,s={__symbol:Ca,whenReady:function(){return r._resolveAsyncImpl(n,t)}};return s},e.prototype._resolveAsyncImpl=function(n,t){var r=this;return t.useAsync().then(function(s){var i=r.getValue(n);if(i!==Un)return i;var o;if(Array.isArray(s)){var a=s[1];if(Os(a))throw new Og(n);o=r._resolveDependency(n,a)}else ai(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:t.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(n,o),o})},e.prototype.getValue=function(n,t,r){var s=this;t===void 0&&(t=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(n)&&!s.resolvedDependencyCollection.has(n)?Un:s.resolvedDependencyCollection.get(n,t)},o=function(){return s.parent?s.parent.getValue(n,t):Un};return r===exports.LookUp.SKIP_SELF?o():r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(n)||this.dependencyCollection.has(n)?i():o()},e.prototype.createDependency=function(n,t,r,s){var i=this;t===void 0&&(t=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(n,t),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(n,h,s)}):l&&(c=i._resolveDependency(n,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(n,t,void 0,s);if(t===exports.Quantity.OPTIONAL)return null;throw ro(n),new Nr(n)};return r===exports.LookUp.SKIP_SELF?a():n===e?this:this.dependencyCollection.has(n)?o():a()},e.prototype.markNewResolution=function(n){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Rg)throw new Ig(n)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Sg},e}();function bg(e,n,t){t===void 0&&(t=0);var r=Ma(n,t);r.forEach(function(s){ui(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var ao=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,lo="REDI_GLOBAL_LOCK",Ag=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;ao[lo]?Ag||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
1
+ "use strict";var Lc=Object.defineProperty;var Uc=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>Uc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("rxjs"),Tr=require("rxjs/operators"),ot=require("react");function Pc(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 Fc(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const bt=Pc(ot);function kc(){$c()}const Er=typeof global<"u"?global:typeof self<"u"?self:window;function $c(){typeof Er.requestIdleCallback!="function"&&(Er.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 Er.cancelIdleCallback!="function"&&(Er.cancelIdleCallback=function(n){clearTimeout(n)})}var ua=typeof global=="object"&&global&&global.Object===Object&&global,jc=typeof self=="object"&&self&&self.Object===Object&&self,fn=ua||jc||Function("return this")(),yn=fn.Symbol,ca=Object.prototype,Hc=ca.hasOwnProperty,Bc=ca.toString,Dn=yn?yn.toStringTag:void 0;function Wc(e){var t=Hc.call(e,Dn),n=e[Dn];try{e[Dn]=void 0;var r=!0}catch{}var s=Bc.call(e);return r&&(t?e[Dn]=n:delete e[Dn]),s}var Yc=Object.prototype,zc=Yc.toString;function Vc(e){return zc.call(e)}var Gc="[object Null]",Kc="[object Undefined]",ji=yn?yn.toStringTag:void 0;function or(e){return e==null?e===void 0?Kc:Gc:ji&&ji in Object(e)?Wc(e):Vc(e)}function An(e){return e!=null&&typeof e=="object"}var Xc="[object Symbol]";function ts(e){return typeof e=="symbol"||An(e)&&or(e)==Xc}function Qc(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 wn=Array.isArray,qc=1/0,Hi=yn?yn.prototype:void 0,Bi=Hi?Hi.toString:void 0;function ha(e){if(typeof e=="string")return e;if(wn(e))return Qc(e,ha)+"";if(ts(e))return Bi?Bi.call(e):"";var t=e+"";return t=="0"&&1/e==-qc?"-0":t}var Jc=/\s/;function Zc(e){for(var t=e.length;t--&&Jc.test(e.charAt(t)););return t}var eh=/^\s+/;function th(e){return e&&e.slice(0,Zc(e)+1).replace(eh,"")}function Rt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wi=NaN,nh=/^[-+]0x[0-9a-f]+$/i,rh=/^0b[01]+$/i,sh=/^0o[0-7]+$/i,ih=parseInt;function Yi(e){if(typeof e=="number")return e;if(ts(e))return Wi;if(Rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=th(e);var n=rh.test(e);return n||sh.test(e)?ih(e.slice(2),n?2:8):nh.test(e)?Wi:+e}function da(e){return e}var oh="[object AsyncFunction]",ah="[object Function]",lh="[object GeneratorFunction]",uh="[object Proxy]";function oi(e){if(!Rt(e))return!1;var t=or(e);return t==ah||t==lh||t==oh||t==uh}var hs=fn["__core-js_shared__"],zi=function(){var e=/[^.]+$/.exec(hs&&hs.keys&&hs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ch(e){return!!zi&&zi in e}var hh=Function.prototype,dh=hh.toString;function fh(e){if(e!=null){try{return dh.call(e)}catch{}try{return e+""}catch{}}return""}var gh=/[\\^$.*+?()[\]{}|]/g,mh=/^\[object .+?Constructor\]$/,ph=Function.prototype,_h=Object.prototype,Eh=ph.toString,vh=_h.hasOwnProperty,Ch=RegExp("^"+Eh.call(vh).replace(gh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rh(e){if(!Rt(e)||ch(e))return!1;var t=oi(e)?Ch:mh;return t.test(fh(e))}function Ih(e,t){return e==null?void 0:e[t]}function ai(e,t){var n=Ih(e,t);return Rh(n)?n:void 0}var Vi=Object.create,Sh=function(){function e(){}return function(t){if(!Rt(t))return{};if(Vi)return Vi(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Oh(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 yh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var wh=800,bh=16,Ah=Date.now;function Th(e){var t=0,n=0;return function(){var r=Ah(),s=bh-(r-n);if(n=r,s>0){if(++t>=wh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Nh(e){return function(){return e}}var Yr=function(){try{var e=ai(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Mh=Yr?function(e,t){return Yr(e,"toString",{configurable:!0,enumerable:!1,value:Nh(t),writable:!0})}:da,Dh=Th(Mh),xh=9007199254740991,Lh=/^(?:0|[1-9]\d*)$/;function li(e,t){var n=typeof e;return t=t==null?xh:t,!!t&&(n=="number"||n!="symbol"&&Lh.test(e))&&e>-1&&e%1==0&&e<t}function ui(e,t,n){t=="__proto__"&&Yr?Yr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ns(e,t){return e===t||e!==e&&t!==t}var Uh=Object.prototype,Ph=Uh.hasOwnProperty;function fa(e,t,n){var r=e[t];(!(Ph.call(e,t)&&ns(r,n))||n===void 0&&!(t in e))&&ui(e,t,n)}function Fh(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?ui(n,a,l):fa(n,a,l)}return n}var Gi=Math.max;function kh(e,t,n){return t=Gi(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Gi(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),Oh(e,this,a)}}function $h(e,t){return Dh(kh(e,t,da),e+"")}var jh=9007199254740991;function ga(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jh}function ci(e){return e!=null&&ga(e.length)&&!oi(e)}function Hh(e,t,n){if(!Rt(n))return!1;var r=typeof t;return(r=="number"?ci(n)&&li(t,n.length):r=="string"&&t in n)?ns(n[t],e):!1}function ma(e){return $h(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&&Hh(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 Bh=Object.prototype;function pa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Bh;return e===n}function Wh(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Yh="[object Arguments]";function Ki(e){return An(e)&&or(e)==Yh}var _a=Object.prototype,zh=_a.hasOwnProperty,Vh=_a.propertyIsEnumerable,As=Ki(function(){return arguments}())?Ki:function(e){return An(e)&&zh.call(e,"callee")&&!Vh.call(e,"callee")};function Gh(){return!1}var Ea=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xi=Ea&&typeof module=="object"&&module&&!module.nodeType&&module,Kh=Xi&&Xi.exports===Ea,Qi=Kh?fn.Buffer:void 0,Xh=Qi?Qi.isBuffer:void 0,va=Xh||Gh,Qh="[object Arguments]",qh="[object Array]",Jh="[object Boolean]",Zh="[object Date]",ed="[object Error]",td="[object Function]",nd="[object Map]",rd="[object Number]",sd="[object Object]",id="[object RegExp]",od="[object Set]",ad="[object String]",ld="[object WeakMap]",ud="[object ArrayBuffer]",cd="[object DataView]",hd="[object Float32Array]",dd="[object Float64Array]",fd="[object Int8Array]",gd="[object Int16Array]",md="[object Int32Array]",pd="[object Uint8Array]",_d="[object Uint8ClampedArray]",Ed="[object Uint16Array]",vd="[object Uint32Array]",Qe={};Qe[hd]=Qe[dd]=Qe[fd]=Qe[gd]=Qe[md]=Qe[pd]=Qe[_d]=Qe[Ed]=Qe[vd]=!0;Qe[Qh]=Qe[qh]=Qe[ud]=Qe[Jh]=Qe[cd]=Qe[Zh]=Qe[ed]=Qe[td]=Qe[nd]=Qe[rd]=Qe[sd]=Qe[id]=Qe[od]=Qe[ad]=Qe[ld]=!1;function Cd(e){return An(e)&&ga(e.length)&&!!Qe[or(e)]}function Rd(e){return function(t){return e(t)}}var Ca=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=Ca&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Vn&&Vn.exports===Ca,ds=Id&&ua.process,qi=function(){try{var e=Vn&&Vn.require&&Vn.require("util").types;return e||ds&&ds.binding&&ds.binding("util")}catch{}}(),Ji=qi&&qi.isTypedArray,Ra=Ji?Rd(Ji):Cd;function Sd(e,t){var n=wn(e),r=!n&&As(e),s=!n&&!r&&va(e),i=!n&&!r&&!s&&Ra(e),o=n||r||s||i,a=o?Wh(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")||li(c,l))||a.push(c);return a}function Od(e,t){return function(n){return e(t(n))}}function yd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var wd=Object.prototype,bd=wd.hasOwnProperty;function Ad(e){if(!Rt(e))return yd(e);var t=pa(e),n=[];for(var r in e)r=="constructor"&&(t||!bd.call(e,r))||n.push(r);return n}function Ia(e){return ci(e)?Sd(e):Ad(e)}var Td=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nd=/^\w*$/;function Md(e,t){if(wn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ts(e)?!0:Nd.test(e)||!Td.test(e)||t!=null&&e in Object(t)}var qn=ai(Object,"create");function Dd(){this.__data__=qn?qn(null):{},this.size=0}function xd(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ld="__lodash_hash_undefined__",Ud=Object.prototype,Pd=Ud.hasOwnProperty;function Fd(e){var t=this.__data__;if(qn){var n=t[e];return n===Ld?void 0:n}return Pd.call(t,e)?t[e]:void 0}var kd=Object.prototype,$d=kd.hasOwnProperty;function jd(e){var t=this.__data__;return qn?t[e]!==void 0:$d.call(t,e)}var Hd="__lodash_hash_undefined__";function Bd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qn&&t===void 0?Hd:t,this}function ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=Dd;ln.prototype.delete=xd;ln.prototype.get=Fd;ln.prototype.has=jd;ln.prototype.set=Bd;function Wd(){this.__data__=[],this.size=0}function rs(e,t){for(var n=e.length;n--;)if(ns(e[n][0],t))return n;return-1}var Yd=Array.prototype,zd=Yd.splice;function Vd(e){var t=this.__data__,n=rs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():zd.call(t,n,1),--this.size,!0}function Gd(e){var t=this.__data__,n=rs(t,e);return n<0?void 0:t[n][1]}function Kd(e){return rs(this.__data__,e)>-1}function Xd(e,t){var n=this.__data__,r=rs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ht(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])}}Ht.prototype.clear=Wd;Ht.prototype.delete=Vd;Ht.prototype.get=Gd;Ht.prototype.has=Kd;Ht.prototype.set=Xd;var Sa=ai(fn,"Map");function Qd(){this.size=0,this.__data__={hash:new ln,map:new(Sa||Ht),string:new ln}}function qd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ss(e,t){var n=e.__data__;return qd(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Jd(e){var t=ss(this,e).delete(e);return this.size-=t?1:0,t}function Zd(e){return ss(this,e).get(e)}function ef(e){return ss(this,e).has(e)}function tf(e,t){var n=ss(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=Qd;Zt.prototype.delete=Jd;Zt.prototype.get=Zd;Zt.prototype.has=ef;Zt.prototype.set=tf;var nf="Expected a function";function hi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nf);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(hi.Cache||Zt),n}hi.Cache=Zt;var rf=500;function sf(e){var t=hi(e,function(r){return n.size===rf&&n.clear(),r}),n=t.cache;return t}var of=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,af=/\\(\\)?/g,lf=sf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(of,function(n,r,s,i){t.push(s?i.replace(af,"$1"):r||n)}),t});function uf(e){return e==null?"":ha(e)}function Oa(e,t){return wn(e)?e:Md(e,t)?[e]:lf(uf(e))}var cf=1/0;function ya(e){if(typeof e=="string"||ts(e))return e;var t=e+"";return t=="0"&&1/e==-cf?"-0":t}function hf(e,t){t=Oa(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ya(t[n++])];return n&&n==r?e:void 0}function df(e,t,n){var r=e==null?void 0:hf(e,t);return r===void 0?n:r}var wa=Od(Object.getPrototypeOf,Object),ff="[object Object]",gf=Function.prototype,mf=Object.prototype,ba=gf.toString,pf=mf.hasOwnProperty,_f=ba.call(Object);function Ef(e){if(!An(e)||or(e)!=ff)return!1;var t=wa(e);if(t===null)return!0;var n=pf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ba.call(n)==_f}function vf(){this.__data__=new Ht,this.size=0}function Cf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Rf(e){return this.__data__.get(e)}function If(e){return this.__data__.has(e)}var Sf=200;function Of(e,t){var n=this.__data__;if(n instanceof Ht){var r=n.__data__;if(!Sa||r.length<Sf-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 Tn(e){var t=this.__data__=new Ht(e);this.size=t.size}Tn.prototype.clear=vf;Tn.prototype.delete=Cf;Tn.prototype.get=Rf;Tn.prototype.has=If;Tn.prototype.set=Of;var Aa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=Aa&&typeof module=="object"&&module&&!module.nodeType&&module,yf=Zi&&Zi.exports===Aa,eo=yf?fn.Buffer:void 0;eo&&eo.allocUnsafe;function wf(e,t){return e.slice()}var to=fn.Uint8Array;function bf(e){var t=new e.constructor(e.byteLength);return new to(t).set(new to(e)),t}function Af(e,t){var n=bf(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function Tf(e){return typeof e.constructor=="function"&&!pa(e)?Sh(wa(e)):{}}function Nf(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 Mf=Nf(),fs=function(){return fn.Date.now()},Df="Expected a function",xf=Math.max,Lf=Math.min;function Uf(e,t,n){var r,s,i,o,a,l,c=0,h=!1,u=!1,d=!0;if(typeof e!="function")throw new TypeError(Df);t=Yi(t)||0,Rt(n)&&(h=!!n.leading,u="maxWait"in n,i=u?xf(Yi(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(A){var B=r,J=s;return r=s=void 0,c=A,o=e.apply(J,B),o}function E(A){return c=A,a=setTimeout(T,t),h?f(A):o}function v(A){var B=A-l,J=A-c,de=t-B;return u?Lf(de,i-J):de}function y(A){var B=A-l,J=A-c;return l===void 0||B>=t||B<0||u&&J>=i}function T(){var A=fs();if(y(A))return V(A);a=setTimeout(T,v(A))}function V(A){return a=void 0,d&&r?f(A):(r=s=void 0,o)}function Y(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function ie(){return a===void 0?o:V(fs())}function N(){var A=fs(),B=y(A);if(r=arguments,s=this,l=A,B){if(a===void 0)return E(l);if(u)return clearTimeout(a),a=setTimeout(T,t),f(l)}return a===void 0&&(a=setTimeout(T,t)),o}return N.cancel=Y,N.flush=ie,N}function Ts(e,t,n){(n!==void 0&&!ns(e[t],n)||n===void 0&&!(t in e))&&ui(e,t,n)}function Pf(e){return An(e)&&ci(e)}function Ns(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Ff(e){return Fh(e,Ia(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 d=wn(l),f=!d&&va(l),E=!d&&!f&&Ra(l);h=l,d||f||E?wn(a)?h=a:Pf(a)?h=yh(a):f?(u=!1,h=wf(l)):E?(u=!1,h=Af(l)):h=[]:Ef(l)||As(l)?(h=a,As(a)?h=Ff(a):(!Rt(a)||oi(a))&&(h=Tf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Ts(e,n,h)}function di(e,t,n,r,s){e!==t&&Mf(t,function(i,o){if(s||(s=new Tn),Rt(i))kf(e,t,o,n,di,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)}},Ia)}var $f=ma(function(e,t,n,r){di(e,t,n,r)}),jf=ma(function(e,t,n){di(e,t,n)});function Hf(e,t,n,r){if(!Rt(e))return e;t=Oa(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=ya(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=Rt(h)?h:li(t[s+1])?[]:{})}fa(a,l,c),a=a[l]}return e}function Bf(e,t,n){return e==null?e:Hf(e,t,n)}function It(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gs,no;function Wf(){if(no)return gs;no=1;var e=-1,t=1,n=0;function r(p,H,S,D,w){if(p===H)return p?[[n,p]]:[];if(S!=null){var O=de(p,H,S);if(O)return O}var F=a(p,H),$=p.substring(0,F);p=p.substring(F),H=H.substring(F),F=c(p,H);var G=p.substring(p.length-F);p=p.substring(0,p.length-F),H=H.substring(0,H.length-F);var re=s(p,H);return $&&re.unshift([n,$]),G&&re.push([n,G]),V(re,w),D&&u(re),re}function s(p,H){var S;if(!p)return[[t,H]];if(!H)return[[e,p]];var D=p.length>H.length?p:H,w=p.length>H.length?H:p,O=D.indexOf(w);if(O!==-1)return S=[[t,D.substring(0,O)],[n,w],[t,D.substring(O+w.length)]],p.length>H.length&&(S[0][0]=S[2][0]=e),S;if(w.length===1)return[[e,p],[t,H]];var F=h(p,H);if(F){var $=F[0],G=F[1],re=F[2],he=F[3],fe=F[4],Ae=r($,re),we=r(G,he);return Ae.concat([[n,fe]],we)}return i(p,H)}function i(p,H){for(var S=p.length,D=H.length,w=Math.ceil((S+D)/2),O=w,F=2*w,$=new Array(F),G=new Array(F),re=0;re<F;re++)$[re]=-1,G[re]=-1;$[O+1]=0,G[O+1]=0;for(var he=S-D,fe=he%2!==0,Ae=0,we=0,I=0,k=0,K=0;K<w;K++){for(var X=-K+Ae;X<=K-we;X+=2){var z=O+X,W;X===-K||X!==K&&$[z-1]<$[z+1]?W=$[z+1]:W=$[z-1]+1;for(var ue=W-X;W<S&&ue<D&&p.charAt(W)===H.charAt(ue);)W++,ue++;if($[z]=W,W>S)we+=2;else if(ue>D)Ae+=2;else if(fe){var oe=O+he-X;if(oe>=0&&oe<F&&G[oe]!==-1){var j=S-G[oe];if(W>=j)return o(p,H,W,ue)}}}for(var te=-K+I;te<=K-k;te+=2){var oe=O+te,j;te===-K||te!==K&&G[oe-1]<G[oe+1]?j=G[oe+1]:j=G[oe-1]+1;for(var se=j-te;j<S&&se<D&&p.charAt(S-j-1)===H.charAt(D-se-1);)j++,se++;if(G[oe]=j,j>S)k+=2;else if(se>D)I+=2;else if(!fe){var z=O+he-te;if(z>=0&&z<F&&$[z]!==-1){var W=$[z],ue=O+W-z;if(j=S-j,W>=j)return o(p,H,W,ue)}}}}return[[e,p],[t,H]]}function o(p,H,S,D){var w=p.substring(0,S),O=H.substring(0,D),F=p.substring(S),$=H.substring(D),G=r(w,O),re=r(F,$);return G.concat(re)}function a(p,H){if(!p||!H||p.charAt(0)!==H.charAt(0))return 0;for(var S=0,D=Math.min(p.length,H.length),w=D,O=0;S<w;)p.substring(O,w)==H.substring(O,w)?(S=w,O=S):D=w,w=Math.floor((D-S)/2+S);return Y(p.charCodeAt(w-1))&&w--,w}function l(p,H){var S=p.length,D=H.length;if(S==0||D==0)return 0;S>D?p=p.substring(S-D):S<D&&(H=H.substring(0,S));var w=Math.min(S,D);if(p==H)return w;for(var O=0,F=1;;){var $=p.substring(w-F),G=H.indexOf($);if(G==-1)return O;F+=G,(G==0||p.substring(w-F)==H.substring(0,F))&&(O=F,F++)}}function c(p,H){if(!p||!H||p.slice(-1)!==H.slice(-1))return 0;for(var S=0,D=Math.min(p.length,H.length),w=D,O=0;S<w;)p.substring(p.length-w,p.length-O)==H.substring(H.length-w,H.length-O)?(S=w,O=S):D=w,w=Math.floor((D-S)/2+S);return ie(p.charCodeAt(p.length-w))&&w--,w}function h(p,H){var S=p.length>H.length?p:H,D=p.length>H.length?H:p;if(S.length<4||D.length*2<S.length)return null;function w(we,I,k){for(var K=we.substring(k,k+Math.floor(we.length/4)),X=-1,z="",W,ue,oe,j;(X=I.indexOf(K,X+1))!==-1;){var te=a(we.substring(k),I.substring(X)),se=c(we.substring(0,k),I.substring(0,X));z.length<se+te&&(z=I.substring(X-se,X)+I.substring(X,X+te),W=we.substring(0,k-se),ue=we.substring(k+te),oe=I.substring(0,X-se),j=I.substring(X+te))}return z.length*2>=we.length?[W,ue,oe,j,z]:null}var O=w(S,D,Math.ceil(S.length/4)),F=w(S,D,Math.ceil(S.length/2)),$;if(!O&&!F)return null;F?O?$=O[4].length>F[4].length?O:F:$=F:$=O;var G,re,he,fe;p.length>H.length?(G=$[0],re=$[1],he=$[2],fe=$[3]):(he=$[0],fe=$[1],G=$[2],re=$[3]);var Ae=$[4];return[G,re,he,fe,Ae]}function u(p){for(var H=!1,S=[],D=0,w=null,O=0,F=0,$=0,G=0,re=0;O<p.length;)p[O][0]==n?(S[D++]=O,F=G,$=re,G=0,re=0,w=p[O][1]):(p[O][0]==t?G+=p[O][1].length:re+=p[O][1].length,w&&w.length<=Math.max(F,$)&&w.length<=Math.max(G,re)&&(p.splice(S[D-1],0,[e,w]),p[S[D-1]+1][0]=t,D--,D--,O=D>0?S[D-1]:-1,F=0,$=0,G=0,re=0,w=null,H=!0)),O++;for(H&&V(p),T(p),O=1;O<p.length;){if(p[O-1][0]==e&&p[O][0]==t){var he=p[O-1][1],fe=p[O][1],Ae=l(he,fe),we=l(fe,he);Ae>=we?(Ae>=he.length/2||Ae>=fe.length/2)&&(p.splice(O,0,[n,fe.substring(0,Ae)]),p[O-1][1]=he.substring(0,he.length-Ae),p[O+1][1]=fe.substring(Ae),O++):(we>=he.length/2||we>=fe.length/2)&&(p.splice(O,0,[n,he.substring(0,we)]),p[O-1][0]=t,p[O-1][1]=fe.substring(0,fe.length-we),p[O+1][0]=e,p[O+1][1]=he.substring(we),O++),O++}O++}}var d=/[^a-zA-Z0-9]/,f=/\s/,E=/[\r\n]/,v=/\n\r?\n$/,y=/^\r?\n\r?\n/;function T(p){function H(we,I){if(!we||!I)return 6;var k=we.charAt(we.length-1),K=I.charAt(0),X=k.match(d),z=K.match(d),W=X&&k.match(f),ue=z&&K.match(f),oe=W&&k.match(E),j=ue&&K.match(E),te=oe&&we.match(v),se=j&&I.match(y);return te||se?5:oe||j?4:X&&!W&&ue?3:W||ue?2:X||z?1:0}for(var S=1;S<p.length-1;){if(p[S-1][0]==n&&p[S+1][0]==n){var D=p[S-1][1],w=p[S][1],O=p[S+1][1],F=c(D,w);if(F){var $=w.substring(w.length-F);D=D.substring(0,D.length-F),w=$+w.substring(0,w.length-F),O=$+O}for(var G=D,re=w,he=O,fe=H(D,w)+H(w,O);w.charAt(0)===O.charAt(0);){D+=w.charAt(0),w=w.substring(1)+O.charAt(0),O=O.substring(1);var Ae=H(D,w)+H(w,O);Ae>=fe&&(fe=Ae,G=D,re=w,he=O)}p[S-1][1]!=G&&(G?p[S-1][1]=G:(p.splice(S-1,1),S--),p[S][1]=re,he?p[S+1][1]=he:(p.splice(S+1,1),S--))}S++}}function V(p,H){p.push([n,""]);for(var S=0,D=0,w=0,O="",F="",$;S<p.length;){if(S<p.length-1&&!p[S][1]){p.splice(S,1);continue}switch(p[S][0]){case t:w++,F+=p[S][1],S++;break;case e:D++,O+=p[S][1],S++;break;case n:var G=S-w-D-1;if(H){if(G>=0&&A(p[G][1])){var re=p[G][1].slice(-1);if(p[G][1]=p[G][1].slice(0,-1),O=re+O,F=re+F,!p[G][1]){p.splice(G,1),S--;var he=G-1;p[he]&&p[he][0]===t&&(w++,F=p[he][1]+F,he--),p[he]&&p[he][0]===e&&(D++,O=p[he][1]+O,he--),G=he}}if(N(p[S][1])){var re=p[S][1].charAt(0);p[S][1]=p[S][1].slice(1),O+=re,F+=re}}if(S<p.length-1&&!p[S][1]){p.splice(S,1);break}if(O.length>0||F.length>0){O.length>0&&F.length>0&&($=a(F,O),$!==0&&(G>=0?p[G][1]+=F.substring(0,$):(p.splice(0,0,[n,F.substring(0,$)]),S++),F=F.substring($),O=O.substring($)),$=c(F,O),$!==0&&(p[S][1]=F.substring(F.length-$)+p[S][1],F=F.substring(0,F.length-$),O=O.substring(0,O.length-$)));var fe=w+D;O.length===0&&F.length===0?(p.splice(S-fe,fe),S=S-fe):O.length===0?(p.splice(S-fe,fe,[t,F]),S=S-fe+1):F.length===0?(p.splice(S-fe,fe,[e,O]),S=S-fe+1):(p.splice(S-fe,fe,[e,O],[t,F]),S=S-fe+2)}S!==0&&p[S-1][0]===n?(p[S-1][1]+=p[S][1],p.splice(S,1)):S++,w=0,D=0,O="",F="";break}}p[p.length-1][1]===""&&p.pop();var Ae=!1;for(S=1;S<p.length-1;)p[S-1][0]===n&&p[S+1][0]===n&&(p[S][1].substring(p[S][1].length-p[S-1][1].length)===p[S-1][1]?(p[S][1]=p[S-1][1]+p[S][1].substring(0,p[S][1].length-p[S-1][1].length),p[S+1][1]=p[S-1][1]+p[S+1][1],p.splice(S-1,1),Ae=!0):p[S][1].substring(0,p[S+1][1].length)==p[S+1][1]&&(p[S-1][1]+=p[S+1][1],p[S][1]=p[S][1].substring(p[S+1][1].length)+p[S+1][1],p.splice(S+1,1),Ae=!0)),S++;Ae&&V(p,H)}function Y(p){return p>=55296&&p<=56319}function ie(p){return p>=56320&&p<=57343}function N(p){return ie(p.charCodeAt(0))}function A(p){return Y(p.charCodeAt(p.length-1))}function B(p){for(var H=[],S=0;S<p.length;S++)p[S][1].length>0&&H.push(p[S]);return H}function J(p,H,S,D){return A(p)||N(D)?null:B([[n,p],[e,H],[t,S],[n,D]])}function de(p,H,S){var D=typeof S=="number"?{index:S,length:0}:S.oldRange,w=typeof S=="number"?null:S.newRange,O=p.length,F=H.length;if(D.length===0&&(w===null||w.length===0)){var $=D.index,G=p.slice(0,$),re=p.slice($),he=w?w.index:null;e:{var fe=$+F-O;if(he!==null&&he!==fe||fe<0||fe>F)break e;var Ae=H.slice(0,fe),we=H.slice(fe);if(we!==re)break e;var I=Math.min($,fe),k=G.slice(0,I),K=Ae.slice(0,I);if(k!==K)break e;var X=G.slice(I),z=Ae.slice(I);return J(k,X,z,re)}e:{if(he!==null&&he!==$)break e;var W=$,Ae=H.slice(0,W),we=H.slice(W);if(Ae!==G)break e;var ue=Math.min(O-W,F-W),oe=re.slice(re.length-ue),j=we.slice(we.length-ue);if(oe!==j)break e;var X=re.slice(0,re.length-ue),z=we.slice(0,we.length-ue);return J(G,X,z,oe)}}if(D.length>0&&w&&w.length===0)e:{var k=p.slice(0,D.index),oe=p.slice(D.index+D.length),I=k.length,ue=oe.length;if(F<I+ue)break e;var K=H.slice(0,I),j=H.slice(F-ue);if(k!==K||oe!==j)break e;var X=p.slice(I,O-ue),z=H.slice(I,F-ue);return J(k,X,z,oe)}return null}function le(p,H,S,D){return r(p,H,S,D,!0)}return le.INSERT=t,le.DELETE=e,le.EQUAL=n,gs=le,gs}var Yf=Wf();const Ta=It(Yf);function ar(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function zf(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Vf(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Gf(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Kf(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 Xf(e){return Array.isArray(e)?e:[e]}function Qf(e){return["true","false"].includes(e.toLowerCase())}const lr="__INTERNAL_EDITOR__",fi=`${lr}DOCS_NORMAL`,gi=`${lr}DOCS_FORMULA_BAR`,Na=`${lr}ZEN_EDITOR`,Ma=`\r
2
+ `,qf="isRowStylePrecedeColumnStyle";function Jf(e){return`${lr}${e}`}function Da(e){return e.startsWith(lr)}var mi=Symbol("$$IDENTIFIER_DECORATOR");function Zf(e){return e&&e[mi]===!0}function pi(e){return typeof e=="function"}function Ms(e){return!!(e&&typeof e.useClass<"u")}function Ds(e){return!!(e&&typeof e.useFactory<"u")}function xs(e){return!!(e&&typeof e.useValue<"u")}function eg(e){return!!(e&&typeof e.useExisting<"u")}function Ls(e){return!!(e&&typeof e.useAsync<"u")}var xa=Symbol("AsyncHook");function Nr(e){return!!(e&&e.__symbol===xa)}function pt(e){return typeof e>"u"?"undefined":pi(e)&&!e[mi]?e.name:e.toString()}exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var tg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(e){tg(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error),La=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)}}(),ro=Symbol("$$TARGET"),Us=Symbol("$$DEPENDENCIES"),ng=function(e){La(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(pt(r),'".');return e.call(this,s)||this}return t}(st),Ua=function(e){La(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(pt(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}(st);function Pa(e){var t=e;return t[Us]||[]}function _i(e,t){var n=Pa(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new ng(t,e);return r}function Ei(e,t,n,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new Ua(e,n);var o=e;o[ro]===o?o[Us].push(i):(o[Us]=[i],o[ro]=o)}var so=new Set;function mt(e){if(so.has(e))throw new st('Identifier "'.concat(e,'" already exists.'));so.add(e);var t=function(n,r,s){Ei(n,t,s)};return t.toString=function(){return e},t[mi]=!0,t}var rg=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)}}(),sg=function(e){rg(t,e);function t(n,r,s){var i='Expect "'.concat(r,'" dependency items for id "').concat(pt(n),'" but get ').concat(s,".");return e.call(this,i)||this}return t}(st);function Fa(e,t,n){if(t===exports.Quantity.OPTIONAL&&n>1||t===exports.Quantity.REQUIRED&&n!==1)throw new sg(e,t,n)}function ig(e,t){return e===exports.Quantity.MANY?t:t[0]}function og(e,t,n){var r=_i(e,t);r.quantity=n}function vi(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)Ei(r,n,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Ua(r,i);og(r,i,e)}}}}var ka=vi(exports.Quantity.MANY),$a=vi(exports.Quantity.OPTIONAL),_t=vi(exports.Quantity.REQUIRED);function ag(e){return{unwrap:e}}function lg(e){return!!e&&typeof e.unwrap=="function"}function ug(e){return lg(e)?e.unwrap():e}function Ps(e){return!!e&&typeof e.dispose=="function"}var ja=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 cg(e){return e.length===1}var is=[];function io(e){is.push(e)}function oo(){is.pop()}function hg(){is.length=0}var ao=function(e){ja(t,e);function t(n,r,s){var i='Cannot find "'.concat(pt(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(Zf(n)?pt(n):n.name,'".');return e.call(this,i)||this}return t}(st),Mr=function(e){ja(t,e);function t(n){var r=this,s='Cannot find "'.concat(pt(n),'" registered by any injector. The stack of dependencies is: "').concat(is.map(function(i){return pt(i)}).join(" -> "),'".');return r=e.call(this,s)||this,hg(),r}return t}(st),dg=function(){function e(t){var n=this;this.dependencyMap=new Map,this.normalizeDependencies(t).map(function(r){return n.add(r[0],r[1])})}return e.prototype.add=function(t,n){typeof n>"u"&&(n={useClass:t,lazy:!1});var r=this.dependencyMap.get(t);typeof r>"u"&&(r=[],this.dependencyMap.set(t,r)),r.push(n)},e.prototype.delete=function(t){this.dependencyMap.delete(t)},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return Fa(t,n,r.length),ig(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 cg(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),fg=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 Ps(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new Mr(t);return Fa(t,n,r.length),n===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return Ps(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function gg(e,t,n){var r=_i(e,t);r.lookUp=n}function Ha(e){return function t(){return this instanceof t?this:function(n,r,s){gg(n,s,e)}}}var Ba=Ha(exports.LookUp.SKIP_SELF),Wa=Ha(exports.LookUp.SELF);function mg(e,t,n){var r=_i(e,t);r.withNew=n}function pg(e){return function t(){return this instanceof t?this:function(n,r,s){mg(n,s,e)}}}var Ya=pg(!0);function za(e,t){return t===void 0&&(t=0),e?e.map(function(n,r){if(r+=t,!Array.isArray(n))return{paramIndex:r,identifier:n,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o=void 0,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof Wa)o=exports.LookUp.SELF;else if(c instanceof Ba)o=exports.LookUp.SKIP_SELF;else if(c instanceof $a)a=exports.Quantity.OPTIONAL;else if(c instanceof ka)a=exports.Quantity.MANY;else if(c instanceof Ya)l=!0;else throw new st("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var Fs;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")Fs=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}});Fs=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var _g=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=Fs(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}(),Nn=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)}}(),zr=function(){return zr=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},zr.apply(this,arguments)},nn=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))},Eg=300,xn=Symbol("$$NOT_INSTANTIATED_SYMBOL"),vg=function(e){Nn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(pt(n),'".'))||this}return t}(st),Cg=function(e){Nn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(st),Rg=function(e){Nn(t,e);function t(n){return e.call(this,'Async item "'.concat(pt(n),'" returns another async item.'))||this}return t}(st),Ig=function(e){Nn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(pt(n),'" from sync api.'))||this}return t}(st),lo=function(e){Nn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(pt(n),'" after it is already resolved.'))||this}return t}(st),Sg=function(e){Nn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(pt(n),'" after it is already resolved.'))||this}return t}(st),Ut=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new dg(t||[]),this.resolvedDependencyCollection=new fg,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 lo(n);typeof r>"u"?this.dependencyCollection.add(n):Ls(r)||Ms(r)||xs(r)||Ds(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 lo(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 Sg(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,nn([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 Nr(i)})||Nr(s))throw new Ig(t);return s},e.prototype._get=function(t,n,r,s){var i=exports.Quantity.REQUIRED;if(n===exports.Quantity.REQUIRED||n===exports.Quantity.OPTIONAL||n===exports.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==xn)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,exports.Quantity.REQUIRED);if(n!==xn)return Promise.resolve(n);var r=this.createDependency(t,exports.Quantity.REQUIRED);return Nr(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,nn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;io(t);try{xs(n)?s=this._resolveValueDependency(t,n):Ds(n)?s=this._resolveFactory(t,n,r):Ms(n)?s=this._resolveClass(t,n,r):eg(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),oo()}catch(i){throw oo(),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 _g(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=Pa(i).sort(function(y,T){return y.paramIndex-T.paramIndex}).map(function(y){return zr(zr({},y),{identifier:ug(y.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(y){throw y instanceof Mr?new ao(i,h.identifier,h.paramIndex):y}}var d=nn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(pt(i)," but get ").concat(d.length,"."));var E=f-d.length;E>0?d=nn(nn([],d,!0),new Array(E).fill(void 0),!0):d=d.slice(0,f)}var v=new(i.bind.apply(i,nn(nn([void 0],d,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,v),this.markResolutionCompleted(),v},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=za(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(d){throw d instanceof Mr?new ao(t,c.identifier,c.paramIndex):d}}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:xa,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!==xn)return i;var o;if(Array.isArray(s)){var a=s[1];if(Ls(a))throw new Rg(t);o=r._resolveDependency(t,a)}else pi(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:n.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(t,o),o})},e.prototype.getValue=function(t,n,r){var s=this;n===void 0&&(n=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?xn:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):xn};return r===exports.LookUp.SKIP_SELF?o():r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():o()},e.prototype.createDependency=function(t,n,r,s){var i=this;n===void 0&&(n=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(t,n),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===exports.Quantity.OPTIONAL)return null;throw io(t),new Mr(t)};return r===exports.LookUp.SKIP_SELF?a():t===e?this:this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Eg)throw new vg(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Cg},e}();function Og(e,t,n){n===void 0&&(n=0);var r=za(t,n);r.forEach(function(s){Ei(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var uo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,co="REDI_GLOBAL_LOCK",yg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;uo[co]?yg||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`):ao[lo]=!0;var uo="REDI_CONTEXT_LOCK",Tg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,co=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;co[uo]?Tg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):co[uo]=!0;var ur=Tt.createContext({injector:null});ur.displayName="RediContext";var hi=ur.Provider,Da=ur.Consumer,Ng=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Mg=function(e){Ng(n,e);function n(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return n}(ot);function La(){var e=Tt.useContext(ur);if(!e.injector)throw new Mg;return e.injector}function Dg(e,n,t){var r=La();return Tt.useMemo(function(){return r.get(e,n,t)},[e,n,t])}var Ur=function(){return Ur=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ur.apply(this,arguments)};function Lg(e){var n=e.children,t=e.dependencies,r=Tt.useRef(null);return Tt.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),Tt.createElement(Da,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(t):new Ft(t),r.current=i),Tt.createElement(hi,{value:{injector:i}},n)})}function xg(e,n){return function(r){return Tt.createElement(hi,{value:{injector:n}},Tt.createElement(e,Ur({},r)))}}function Ug(e,n){return function(r){return Tt.createElement(Lg,{dependencies:n},Tt.createElement(e,Ur({},r)))}}var Pg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kg=function(e){Pg(n,e);function n(t){return e.call(this,'You should make "RediContext" as '.concat(t.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 n}(ot);function Fg(e,n,t){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new kg(r);var i=s.injector,o=i.get(e,n||exports.Quantity.REQUIRED,t);return o}}}}var $g=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))};function xa(e,n){var t=e instanceof Ee.BehaviorSubject&&typeof n>"u"?e.getValue():n,r=lt.useState(t),s=r[0],i=r[1];return lt.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function ho(e){return typeof e=="function"?e():e}function jg(e,n,t,r){if(typeof e=="function"&&!r)throw new ot("Expected deps to be provided when observable is a function!");var s=lt.useRef(null),i=lt.useRef(!1),o=lt.useMemo(function(){return e},$g([],typeof r<"u"?r:[e],!0)),a=lt.useState(0);a[0];var l=a[1],c=lt.useRef(function(){var h;if(o){var u=ho(o).subscribe(function(d){i.current=!0,h=d});u.unsubscribe()}return h!=null?h:n}());if(lt.useEffect(function(){var h=null;return o&&(s.current=ho(o),h=s.current.subscribe(function(u){c.current=u,l(function(d){return d+1})})),function(){return h==null?void 0:h.unsubscribe()}},[o]),t&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function Hg(e){var n=lt.useState(0),t=n[1];lt.useEffect(function(){var r=e.subscribe(function(){return t(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var As=new WeakMap;function Bg(e,n){var t=lt.useRef(void 0),r=xa(e,n),s=lt.useMemo(function(){return lt.createContext(r)},[e]),i=lt.useCallback(function(o){return lt.createElement(s.Provider,{value:r},o.children)},[e,r]);return t.current!==e&&(t.current&&As.delete(t.current),t.current=e,As.set(e,s)),{Provider:i,value:r}}function Wg(e){var n=As.get(e);if(!n)throw new ot("try to read context value but no ancestor component subscribed it.");return lt.useContext(n)}function Yg(e,n){n.forEach(t=>e.add(t))}function Ua(e,n){n.forEach(([t])=>{e.has(t)&&e.get(t)})}function Pa(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(n);for(let i=0;i<t.length;i++){const o=t[i];if(!s(o))return!1;const a=e[o],l=n[o];if(a!==l)return!1}return!0}class Ts extends Error{constructor(n){super(n),this.name="CustomCommandExecutionError"}}function zg(e,n=16){let t=0,r=null;return function(...i){const o=Date.now();o-t<n?(r&&clearTimeout(r),r=setTimeout(()=>{t=o,e.apply(this,i)},n)):(t=o,e.apply(this,i))}}var In=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(In||{});function Vg(e){return`sheet_interceptor_${e}`}const ka=e=>function(n,t){let r=-1,s=n;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,t,l=>(a=!0,l)),!a)break}return s};class Gg{constructor(n){v(this,"_interceptorsByName",new Map);v(this,"_interceptorPoints");this._interceptorPoints=n}fetchThroughInterceptors(n){const t=n,r=this._interceptorsByName.get(t);return ka(r||[])}intercept(n,t){const r=n;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(t),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>ar(this._interceptorsByName.get(r),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function Kg(e){return`sheet_async_interceptor_${e}`}const Xg=e=>async function(n,t){let r=-1,s=n;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,t,async l=>(a=!0,l)),!a)break}return s};class Qg{constructor(n){v(this,"_asyncInterceptorsByName",new Map);v(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=n}fetchThroughAsyncInterceptors(n){const t=n,r=this._asyncInterceptorsByName.get(t);return Xg(r||[])}async interceptAsync(n,t){const r=n;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(t),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>ar(this._asyncInterceptorsByName.get(r),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class Ln{constructor(){v(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(n){this.cursor+=n}moveCursorTo(n){this.cursor=n}}function Jg(e,n){for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t])}const Xn=class Xn{constructor(){const n=this;Xn._constructorQueue.forEach(function(t){t.apply(n)})}_initialize(){}static extend(n){Object.getOwnPropertyNames(n.prototype).forEach(t=>{t==="_initialize"?Xn._constructorQueue.push(n.prototype._initialize):t!=="constructor"&&(this.prototype[t]=n.prototype[t])}),Object.getOwnPropertyNames(n).forEach(t=>{t!=="prototype"&&t!=="name"&&t!=="length"&&(this[t]=n[t])})}};v(Xn,"_constructorQueue",[]);let qn=Xn;async function Fa(e){for(const[n,t]of e.entries())try{if(!await t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function $a(e){for(const[n,t]of e.entries())try{if(!t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function fo(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.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(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function go(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),s,i=[],o;try{for(;(n===void 0||n-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return i}function mo(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}function Gn(e){return typeof e=="function"}function Zg(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var as=Zg(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
5
- `+t.map(function(r,s){return s+1+") "+r.toString()}).join(`
6
- `):"",this.name="UnsubscriptionError",this.errors=t}});function po(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var ja=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,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=fo(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(E){n={error:E}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}else o.remove(this);var h=this.initialTeardown;if(Gn(h))try{h()}catch(E){i=E instanceof as?E.errors:[E]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=fo(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{_o(p)}catch(E){i=i!=null?i:[],E instanceof as?i=mo(mo([],go(i)),go(E.errors)):i.push(E)}}}catch(E){r={error:E}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new as(i)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)_o(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&po(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&po(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();ja.EMPTY;function qg(e){return e instanceof ja||e&&"closed"in e&&Gn(e.remove)&&Gn(e.add)&&Gn(e.unsubscribe)}function _o(e){Gn(e)?e():e.unsubscribe()}function Je(e){let n=!1;return e?qg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{n||(n=!0,e())}}:e:Je(()=>{})}function em(e){return Je(()=>{e.unsubscribe()})}class di{constructor(){v(this,"_disposables",new Set)}add(n){const t=Je(n);return this._disposables.add(t),{dispose:()=>{t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(n=>{n.dispose()}),this._disposables.clear()}}class rt{constructor(){v(this,"_disposed",!1);v(this,"_collection",new di)}disposeWithMe(n){return this._collection.add(n)}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);v(this,"dispose$",new Ee.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class nm extends rt{constructor(t){super();v(this,"_ref",0);this._rootDisposable=t}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const cr=Rt("univer.context-service");class Ha extends rt{constructor(){super(...arguments);v(this,"_contextChanged$",new Ee.Subject);v(this,"contextChanged$",this._contextChanged$.asObservable());v(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(t){var r;return(r=this._contextMap.get(t))!=null?r:!1}setContextValue(t,r){this._contextMap.set(t,r),this._contextChanged$.next({[t]:r})}subscribeContextValue$(t){return new Ee.Observable(r=>{const s=this._contextChanged$.pipe(Ee.filter(i=>typeof i[t]<"u")).subscribe(i=>r.next(i[t]));return this._contextMap.has(t)&&r.next(this._contextMap.get(t)),()=>s.unsubscribe()})}}var Ba=(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))(Ba||{});const Nt=Rt("univer.log");class Wa extends rt{constructor(){super(...arguments);v(this,"_logLevel",3)}debug(...t){this._logLevel>=4&&this._log(console.debug,...t)}log(...t){this._logLevel>=3&&this._log(console.log,...t)}warn(...t){this._logLevel>=2&&this._log(console.warn,...t)}error(...t){this._logLevel>=1&&this._log(console.error,...t)}setLogLevel(t){this._logLevel=t}_log(t,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?t(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):t(...r)}}var rm=Object.defineProperty,sm=Object.getOwnPropertyDescriptor,im=(e,n,t,r)=>{for(var s=r>1?void 0:r?sm(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&rm(n,t,s),s},Eo=(e,n)=>(t,r)=>n(t,r,e),hr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(hr||{});const Ut=Rt("anywhere.command-service");class om{constructor(){v(this,"_commands",new Map);v(this,"_commandTypes",new Map)}registerCommand(n){if(this._commands.has(n.id))throw new Error(`[CommandRegistry]: command "${n.id}" has been registered before.`);return this._commands.set(n.id,n),this._commandTypes.set(n.id,n.type),Je(()=>{this._commands.delete(n.id),this._commandTypes.delete(n.id)})}hasCommand(n){return this._commands.has(n)}getCommand(n){return this._commands.has(n)?[this._commands.get(n)]:null}getCommandType(n){return this._commandTypes.get(n)}}const Ya={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends rt{constructor(t,r){super();v(this,"_commandRegistry");v(this,"_beforeCommandExecutionListeners",[]);v(this,"_commandExecutedListeners",[]);v(this,"_multiCommandDisposables",new Map);v(this,"_commandExecutingLevel",0);v(this,"_commandExecutionStack",[]);this._injector=t,this._logService=r,this._commandRegistry=new om,this._registerCommand(Ya)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(t){return this._commandRegistry.hasCommand(t)}registerCommand(t){return this._registerCommand(t)}registerMultipleCommand(t){return this._registerMultiCommand(t)}beforeCommandExecuted(t){if(this._beforeCommandExecutionListeners.indexOf(t)===-1)return this._beforeCommandExecutionListeners.push(t),Je(()=>{const r=this._beforeCommandExecutionListeners.indexOf(t);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(t){if(this._commandExecutedListeners.indexOf(t)===-1)return this._commandExecutedListeners.push(t),Je(()=>{const r=this._commandExecutedListeners.indexOf(t);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(t,r,s){try{const i=this._commandRegistry.getCommand(t);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 "${t}" is not registered.`)}catch(i){if(i instanceof Ts)return!1;throw i}}syncExecuteCommand(t,r,s){var i;try{const o=this._commandRegistry.getCommand(t);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const u=Xf(this._commandExecutionStack,d=>d.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 "${t}" is not registered.`)}catch(o){if(o instanceof Ts)return!1;throw o}}_pushCommandExecutionStack(t){return this._commandExecutionStack.push(t),Je(()=>ar(this._commandExecutionStack,t))}_registerCommand(t){return this._commandRegistry.registerCommand(t)}_registerMultiCommand(t){const r=this._commandRegistry.getCommand(t.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 di;s=new am(t.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Je(()=>{this._multiCommandDisposables.delete(t.id)})),this._multiCommandDisposables.set(t.id,o)}const i=s.registerImplementation(t);return Je(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(t.id))==null||o.dispose()})}async _execute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${t.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(t.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${t.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(t.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=im([Eo(0,vt(Ft)),Eo(1,Nt)],exports.CommandService);class am{constructor(n){v(this,"name");v(this,"multi",!0);v(this,"type",0);v(this,"priority",0);v(this,"_implementations",[]);v(this,"handler",async(n,t)=>{if(!this._implementations.length)return!1;const r=n.get(Nt),s=n.get(cr),i=n.get(Ft);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,t)))return!0}return!1});this.id=n,this.name=n}registerImplementation(n){const t={command:n};return this._implementations.push(t),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Je(()=>{const r=this._implementations.indexOf(t);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function fi(e,n,t){const r=e.map(s=>()=>n.syncExecuteCommand(s.id,s.params,t));return $a(r)}function lm(e,n,t){const r=e.map(s=>()=>n.executeCommand(s.id,s.params,t));return Fa(r)}function za(e){return new Ee.Observable(n=>{const t=e((...r)=>n.next(r));return()=>t==null?void 0:t.dispose()})}function Va(e){return function(t){return new Ee.Observable(r=>(t.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 n=>{let t=[];return n.pipe(Ee.tap(r=>t.push(r)),Ee.debounceTime(e),Ee.map(()=>t),Ee.tap(()=>t=[]))}}function cm(e){const n=new Ee.ReplaySubject(1);return setTimeout(()=>n.next(),e),n.pipe(Ee.take(1))}const hm=e=>new Promise(n=>{Ee.merge(za(e.onCommandExecuted.bind(e)).pipe(Ar.filter(([t])=>t.type===hr.MUTATION)),Ee.timer(300)).pipe(Ar.debounceTime(16),Ar.first()).subscribe(()=>{n()})});function Ga(e,n){let t=0,r=e.length-1;if(n<e[0])return 0;if(n>=e[e.length-1])return e.length-1;for(;t<=r;){if(e[t]===n){for(;t<e.length&&e[t]===n;)t++;return t}if(n>e[t]&&n<e[t+1])return t+1;if(e[r]===n){for(;r<e.length&&e[r]===n;)r++;return r}if(n>e[r-1]&&n<e[r])return r;t++,r--}return-1}function dm(e,n){let t=0,r=e.length-1;for(;t<=r;){const s=Math.floor((r+t)/2);if(n<e[s]&&(s===0||n>=e[s-1]))return s;if(n>=e[s])t=s+1;else if(n<e[s])r=s-1;else return-1}return-1}function Ka(e,n){let t=0,r=e.length;for(;t<r;){const s=Math.floor((t+r)/2);e[s]<=n?t=s+1:r=s}return t<e.length?t:e.length-1}function fm(e,n,t=!1){let r=e.length-1;if(n<0||n<e[0])return 0;if(e.length<40||n<=e[20]||n>=e[r-20]?r=Ga(e,n):r=Ka(e,n),t){const s=e[r];return e.indexOf(s)}return r}function gm(e){const n=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(n)}const $n=2,Xa=1;function mm(e,n){if(n==null||e==null)return!0;const{left:t=0,top:r=0,height:s=0,width:i=0,angle:o=0}=n,{left:a=0,top:l=0,height:c=0,width:h=0,angle:u=0}=e,d=h,f=c,p=i,E=s;return Math.abs(a-t)>$n||Math.abs(l-r)>$n||Math.abs(d-p)>$n||Math.abs(f-E)>$n||Math.abs(u-o)>Xa}var Qa=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Qa||{}),Ge=(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))(Ge||{}),Ja=(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))(Ja||{}),Ot=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Ot||{}),Za=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Za||{}),qa=(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))(qa||{}),el=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(el||{}),tl=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(tl||{}),nl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(nl||{}),rl=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(rl||{});function pm(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var sl=(e=>(e[e.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",e[e.TEXT=1]="TEXT",e[e.NUMBER=2]="NUMBER",e[e.PERCENT=3]="PERCENT",e[e.CURRENCY=4]="CURRENCY",e[e.DATE=5]="DATE",e[e.TIME=6]="TIME",e[e.DATE_TIME=7]="DATE_TIME",e[e.SCIENTIFIC=8]="SCIENTIFIC",e))(sl||{}),il=(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))(il||{}),dr=(e=>(e.EN_US="enUS",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(dr||{}),Pr=(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))(Pr||{}),ol=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(ol||{}),al=(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))(al||{}),ll=(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))(ll||{}),ul=(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))(ul||{}),cl=(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))(cl||{}),hl=(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))(hl||{}),dl=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(dl||{}),er=(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))(er||{}),fl=(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))(fl||{}),Xt=(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))(Xt||{}),an=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(an||{}),cn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(cn||{}),kr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(kr||{}),Fr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Fr||{}),Bt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Bt||{}),Te=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Te||{}),Jt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Jt||{}),gt=(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))(gt||{}),Zr=(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))(Zr||{});const _m="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Em=e=>crypto.getRandomValues(new Uint8Array(e)),Cm=(e,n,t)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*n/e.length);return(i=n)=>{let o="";for(;;){let a=t(s),l=s;for(;l--;)if(o+=e[a[l]&r]||"",o.length===i)return o}}},vm=(e,n=21)=>Cm(e,n,Em),Rm=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e));for(;e--;)n+=_m[t[e]&63];return n};const gl=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*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[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(ml(e))return!0;try{const r=new URL(pl(e)).hostname.split(".").pop();if(r&&gl.has(r))return!0}catch{return!1}}return!1}function ml(e){return/^[a-zA-Z]+:\/\//.test(e)}function Om(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function pl(e){return ml(e)?e:Om(e)?`mailto://${e}`:`https://${e}`}const ym=/^-ms-/,wm=/-([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 gi(e,n){const t=G.getValueType(e),r=G.getValueType(n);return t!==r?!1:G.isArray(e)?bm(e,n):G.isObject(e)?Am(e,n):G.isDate(e)?e.getTime()===n.getTime():G.isRegExp(e)?e.toString()===n.toString():e===n}function bm(e,n){if(e.length!==n.length)return!1;for(let t=0,r=e.length;t<r;t++){const s=e[t],i=n[t];if(!gi(s,i))return!1}return!0}function Am(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(const s of t){if(!r.includes(s))return!1;const i=e[s],o=n[s];if(!gi(i,o))return!1}return!0}class G{static stringAt(n){let t="",r=n;for(;r>=Gt.length;)r/=Gt.length,r-=1,t+=Gt[r%Gt.length];const s=n%Gt.length;return t+=Gt[s],t}static indexAt(n){let t=0;for(let r=0;r<n.length-1;r+=1){const s=n.charCodeAt(r)-65,i=n.length-1-r;t+=Gt.length**i+Gt.length*s}return t+=n.charCodeAt(n.length-1)-65,t}static deleteBlank(n){return G.isString(n)?n.replace(/\s/g,""):n}static getSystemType(){const n=navigator.userAgent,t=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"&&!t&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(t){if(n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1)return"Windows 2000";if(n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1)return"Windows XP";if(n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1)return"Windows 2003";if(n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1)return"Windows Vista";if(n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1)return"Windows 7";if(n.indexOf("Windows NT 10")>-1||n.indexOf("Windows 10")>-1)return"Windows 10";if(n.indexOf("Windows NT 11")>-1||n.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const n=navigator.userAgent,t=n.indexOf("Opera")>-1,r=n.indexOf("compatible")>-1&&n.indexOf("MSIE")>-1&&!t,s=n.indexOf("Trident")>-1&&n.indexOf("rv:11.0")>-1,i=n.indexOf("Edge")>-1,o=n.indexOf("Firefox")>-1,a=n.indexOf("Safari")>-1&&n.indexOf("Chrome")===-1,l=n.indexOf("Chrome")>-1&&n.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(n);const h=Number.parseFloat(RegExp.$1);return h===7?"IE7":h===8?"IE8":h===9?"IE9":h===10?"IE10":"0"}return o?"FF":t?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(n=21,t){return hn(n,t)}static getClassName(n){return n.constructor.name}static deepMerge(n,...t){t.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var h,u;if(G.isArray(l)){const d=(h=a[c])!=null?h:[];a[c]=d,r(l,d);return}if(G.isObject(l)){const d=(u=a[c])!=null?u:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(G.isObject(c)){const d=(h=a[l])!=null?h:{};a[l]=d,s(c,d);return}if(G.isArray(c)){const d=(u=a[l])!=null?u:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(G.isArray(l)){const u=(c=n[a])!=null?c:[];n[a]=u,r(l,u);return}if(G.isObject(l)){const u=(h=n[a])!=null?h:{};n[a]=u,s(l,u);return}n[a]=l})}return n}static numberFixed(n,t){return Number(Number(n).toFixed(t))}static diffValue(n,t){return gi(n,t)}static deepClone(n){if(!this.isDefine(n))return n;if(this.isRegExp(n))return new RegExp(n);if(this.isDate(n))return new Date(n);if(this.isArray(n)){const t=[];return n.forEach((r,s)=>{t[s]=G.deepClone(r)}),t}if(this.isObject(n)){const t={};return Object.keys(n).forEach(r=>{const s=n[r];t[r]=G.deepClone(s)}),Object.setPrototypeOf(t,Object.getPrototypeOf(n)),t}return n}static getLanguage(){const n="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||n}static getValueType(n){return Object.prototype.toString.apply(n)}static isDefine(n){return n!=null}static isBlank(n){return this.isDefine(n)?this.isString(n)?n.trim()==="":!1:!0}static isBoolean(n){return this.getValueType(n)==="[object Boolean]"}static isPlainObject(n){return this.isDefine(n)?Object.getPrototypeOf(n)===Object.getPrototypeOf({}):!1}static isFunction(n){return this.getValueType(n)==="[object Function]"}static isDate(n){return this.getValueType(n)==="[object Date]"}static isRegExp(n){return this.getValueType(n)==="[object RegExp]"}static isArray(n){return this.getValueType(n)==="[object Array]"}static isString(n){return this.getValueType(n)==="[object String]"}static isNumber(n){return this.getValueType(n)==="[object Number]"}static isStringNumber(n){return!isNaN(Number.parseFloat(n))&&isFinite(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isEmptyObject(n){for(const t in n)return!1;return!0}static isMobile(){let n=0,t=0;return document.body.clientWidth&&(n=document.body.clientWidth),document.body.clientHeight&&(t=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||n<350&&t<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const n=navigator.userAgent.toLowerCase();return String(n.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const n=navigator.userAgent;return n.indexOf("Android")>-1||n.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(n){return Sm(n)}static normalizeUrl(n){return pl(n)}static topLevelDomainCombiningString(){return[...gl].join("|")}static itCount(n){return t=>{for(let r=0;r<n;r++)t&&t()}}static hasLength(n,t){return G.isDefine(n)?G.isDefine(t)?n.length===t:n.length>0:!1}static capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)}static fCamelCase(n,t){return t.toUpperCase()}static camelCase(n){return n.replace(ym,"ms-").replace(wm,this.fCamelCase)}static removeNull(n){return this.isObject(n)&&Object.keys(n).forEach(t=>{const r=n[t];r==null?delete n[t]:G.removeNull(r)}),n}static fillTwoDimensionalArray(n,t,r){return new Array(n).fill(r).map(s=>new Array(t).fill(r))}static numToWord(n){let t="";for(;n>0;){let r=n%26;r=r===0?r=26:r,t=String.fromCharCode(96+r)+t,n=(n-r)/26}return t.toLocaleUpperCase()}static ABCatNum(n){if(n==null||n.length===0)return Number.NaN;const t=n.toLowerCase().split(""),r=t.length;let s=0,i=0;for(let o=0;o<r;o++)i=t[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(n){let i="";for(;n>=0;)i=String.fromCharCode(n%26+97)+i,n=Math.floor(n/26)-1;return i.toUpperCase()}static randSort(n){for(let t=0,r=n.length;t<r;t++){const s=Number.parseInt((Math.random()*r).toString()),i=n[s];n[s]=n[t],n[t]=i}return n}static commonExtend(n,t){const r={};for(const s in n)r[s]=n[s];for(const s in t)t[s]!=null&&(r[s]=t[s]);return r}static commonExtend1(n,t){for(const r in n)t[r]==null&&(t[r]=n[r]);return t}static arrayToObject(n){const t={};return n.forEach((r,s)=>{t[s]={},r.forEach((i,o)=>{t[s][o]=i})}),t}static hasIntersectionBetweenTwoRanges(n,t,r,s){return t>=r&&s>=n}static isStartValidPosition(n){return/^[A-Za-z_]/.test(n)}static isValidParameter(n){const t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(n),r=n.length<=255;return!t&&r}static clamp(n,t,r){return Math.max(t,Math.min(r,n))}static now(){return performance&&performance.now?performance.now():Date.now()}}function hn(e=21,n){return n?vm(n,e)():Rm(e)}function Ns(...e){const n={},t=e.length;for(let r=t-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)n[o]===void 0&&(n[o]=s[o])}}return n}const Tm=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Mr(e,n,t){const{dataStream:r,textRuns:s=[]}=e;let i=n;const o=[];for(const a of s){const{st:l,ed:c}=a;G.hasIntersectionBetweenTwoRanges(n,t,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(Ms(r,{...a,ed:Math.min(c,t)}))):o.push(Ms(r,{...a,st:i,ed:Math.min(c,t)}))),i=Math.max(n,Math.min(c,t))}return i!==t&&o.push(r.slice(i,t)),o.join("")}function Nm(e,n=!0){var t;if(n&&((t=e.paragraphs)!=null&&t.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:d}=c,f=[];h!=null&&(typeof h=="number"?f.push(`margin-top: ${h}px`):f.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?f.push(`margin-bottom: ${u}px`):f.push(`margin-bottom: ${u.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Mr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Mr(e,o,r.length)),i}else return Mr(e,0,e.dataStream.length)}function Ms(e,n){const{st:t,ed:r,ts:s={}}=n,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:d,cl:f,va:p}=s;let E=e.slice(t,r);const R=[];return a===Te.TRUE&&(E=`<i>${E}</i>`),p===Bt.SUPERSCRIPT?E=`<sup>${E}</sup>`:p===Bt.SUBSCRIPT&&(E=`<sub>${E}</sub>`),(c==null?void 0:c.s)===Te.TRUE&&(E=`<u>${E}</u>`),(h==null?void 0:h.s)===Te.TRUE&&(E=`<s>${E}</s>`),l===Te.TRUE&&(E=`<strong>${E}</strong>`),i&&R.push(`font-family: ${i}`),f&&R.push(`color: ${f.rgb}`),o&&R.push(`font-size: ${o}pt`),u&&R.push("text-decoration: overline"),d&&R.push(`background: ${d.rgb}`),R.length?`<span style="${R.join("; ")};">${E}</span>`:E}const _l={[Zr.OFFICE]:{[gt.ACCENT1]:"#4472C4",[gt.ACCENT2]:"#ED7D31",[gt.ACCENT3]:"#A5A5A5",[gt.ACCENT4]:"#70AD47",[gt.ACCENT5]:"#5B9BD5",[gt.ACCENT6]:"#70AD47",[gt.DARK1]:"#000000",[gt.DARK2]:"#44546A",[gt.LIGHT1]:"#FFFFFF",[gt.LIGHT2]:"#E7E6E6",[gt.HYPERLINK]:"#0563C1",[gt.FOLLOWED_HYPERLINK]:"#954F72"}};class qr{constructor(){v(this,"_themeValue",gt.LIGHT1);v(this,"_themeColors");v(this,"_themeTint");v(this,"_rgbValue","");v(this,"_colorType");this._colorType=Ot.UNSUPPORTED,this._themeColors=Zr.OFFICE,this._themeTint=0}asRgbColor(){return new $r(this._rgbValue,this)}asThemeColor(){return new jr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case Ot.THEME:return this.asThemeColor();case Ot.RGB:return this.asRgbColor();case Ot.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(n){return this._colorType=Ot.RGB,this._rgbValue=n,this}setThemeColors(n){this._colorType=Ot.THEME,this._themeColors=n}setThemeTint(n){this._colorType=Ot.THEME,this._themeTint=n}setThemeColor(n){return this._colorType=Ot.THEME,this._themeValue=n,this}getColorType(){return this._colorType}}class dn{constructor(n){v(this,"_builder");this._builder=n}static rgbColorToHexValue(n){return`#${((1<<24)+(n.getRed()<<16)+(n.getGreen()<<8)+n.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(n){n?n.indexOf("#")>-1&&(n=n.substring(1)):n="#000000";const t=+`0x${n[0]}${n[1]}`,r=+`0x${n[2]}${n[3]}`,s=+`0x${n[4]}${n[5]}`;return new qr().setRgbColor(`rgb(${t},${r},${s})`).asRgbColor()}static hexToRgbString(n){const t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(t,(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(n);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 dn(this._builder)}equals(n){return!1}}class El{constructor(n){v(this,"_saturation",0);v(this,"_hue",0);v(this,"_lightness",0);v(this,"_alpha",0);const t=n.getRed()/255,r=n.getGreen()/255,s=n.getBlue()/255,i=n.getAlpha()/255,o=Math.min(t,Math.min(r,s)),a=Math.max(t,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),t===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-t)/l),s===a&&(this._hue=4+(t-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const n=new qr;if(this._saturation===0)return n.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),n.asRgbColor();let t;this._lightness<.5?t=this._lightness*(1+this._saturation):t=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-t,s=this._hue/360,i=s+1/3,o=this.setColor(t,r,i),a=this.setColor(t,r,s),l=s-1/3,c=this.setColor(t,r,l);return n.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),n.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(n,t,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=t+(n-t)*6*r:2*r<1?s=n:3*r<2?s=t+(n-t)*(2/3-r)*6:s=t,s}setLightness(n){this._lightness=n}}const St=class St extends dn{constructor(t,r){super(r);v(this,"_cssString");v(this,"_red");v(this,"_green");v(this,"_blue");v(this,"_alpha");let s=t.match(St.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=t.match(St.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return dn.rgbColorToHexValue(this)}getRed(){let t=this._red+St.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getGreen(){let t=this._green+St.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getBlue(){let t=this._blue+St.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getAlpha(){return this._alpha}getColorType(){return Ot.RGB}clone(){return new St(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(t){return t instanceof St?t._red===this._red&&t._blue===this._blue&&t._green===this._green&&t._alpha===this._alpha:!1}getCssString(){return this._cssString}};v(St,"RGB_COLOR_AMT",0),v(St,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),v(St,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let $r=St;const Kt=class Kt extends dn{constructor(t,r,s,i){super(i);v(this,"_themeColorType");v(this,"_themeTint");v(this,"_themeColors");this._themeColorType=t,this._themeTint=r,this._themeColors=s}lumValue(t,r){if(t==null)return r;let s;return t<0?s=r*(1+t):s=r*(1-t)+(255-255*(1-t)),s}asRgbColor(){const t=_l[this._themeColors];if(t==null)throw new Error("not find themeColors type");const r=t[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Kt._cacheThemeColor.has(this._themeColors)){if(s=Kt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Kt._cacheThemeColor.set(this._themeColors,s);const i=new El(dn.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 Kt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(t){return t instanceof Kt?t._themeColorType===this._themeColorType:!1}getColorType(){return Ot.THEME}getThemeColorType(){return this._themeColorType}};v(Kt,"_cacheThemeColor",new Map);let jr=Kt;const Mm="rgb(",Dm="rgba(",Ds={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class At{constructor(n){v(this,"_color");v(this,"_rgbColor");v(this,"_isValid",!1);if(n==null){this._setNullColor();return}if(n instanceof At){this._color={...n._color},this._rgbColor={...n._rgbColor};return}const t=Cl(n);if(t==null){this._setNullColor();return}this._color=t;const r=km(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(n,t,r){var c,h;r=Math.min(1,Math.max(0,r));const s=new At(n).toRgb(),i=new At(t).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 At(l)}static getContrastRatio(n,t){const r=new At(n).getLuminance(),s=new At(t).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:n,g:t,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${n},${t},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(n){const{r:t,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Cr(Math.round(t).toString(16)),Cr(Math.round(r).toString(16)),Cr(Math.round(s).toString(16)),Cr(Math.round(i*255).toString(16))];return n&&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 jm(this.toRgb())}lighten(n=10){const t=this.toHsl();return t.l+=n,t.l=Math.min(Math.max(t.l,0),100),new At(t)}darken(n=10){const t=this.toHsl();return t.l-=n,t.l=Math.min(Math.max(t.l,0),100),new At(t)}setAlpha(n){return new At({...this._rgbColor,a:n})}getLuminance(){let{r:n,g:t,b:r}=this.toRgb();return n=ls(n),t=ls(t),r=ls(r),Number((.2126*n+.7152*t+.0722*r).toFixed(3))}getBrightness(){const{r:n,g:t,b:r}=this.toRgb();return(n*299+t*587+r*114)/1e3}getAlpha(){var n;return(n=this._color.a)!=null?n: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 Cr=e=>e.length===1?`0${e}`:e,ls=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Cl=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 t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}const n=e.trim();if(Ds[n]){const t=Ds[n],r={r:Math.round(t[0]),g:Math.round(t[1]),b:Math.round(t[2])};return r.a=t[3]||1,r}if(n.startsWith("#"))return Lm(n);if(n.startsWith("rgb"))return xm(n);if(n.startsWith("hsl"))return Um(n);if(n.startsWith("hsv"))return Pm(n)},Lm=e=>{const n=e.substring(1),t=new RegExp(`.{1,${n.length>=6?2:1}}`,"g");let r=n.match(t);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 n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal rgb color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(t[0],10),g:Number.parseInt(t[1],10),b:Number.parseInt(t[2],10)};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Um=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsl color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),l:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Pm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsv color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),v:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},km=e=>{const n=Cl(e);if(n!=null)return"r"in n?n:"l"in n?Fm(n):$m(n)},us=(e,n,t)=>(t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(n-e)*6*t:t<1/2?n:t<2/3?e+(n-e)*(2/3-t)*6:e),Fm=e=>{let{h:n,s:t,l:r}=e;n/=360,t/=100,r/=100;let s=0,i=0,o=0;if(t===0)s=i=o=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;s=us(c,l,n+1/3),i=us(c,l,n),o=us(c,l,n-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},$m=e=>{let{h:n,s:t,v:r}=e;n=n/360*6,t/=100,r/=100;const s=Math.floor(n),i=n-s,o=r*(1-t),a=r*(1-i*t),l=r*(1-(1-i)*t),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],f={r:h*255,g:u*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},jm=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,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 n:a=(t-r)/h+(t<r?6:0);break;case t:a=(r-n)/h+2;break;default:a=(n-t)/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:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case n:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-n)/l+2;break;default:o=(n-t)/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},Bm=e=>e==null,Wm=e=>!Bm(e)&&typeof e=="object";function Ym(e){const n=/^#(?:[0]{3}|[0]{6})\b/,t=/^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!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}function zm(e){const n=/^#(?:[Ff]{3}|[Ff]{6})\b/,t=/^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!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}var Le=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Le||{});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 Jt.STRING;if(typeof e.v=="number")return Jt.NUMBER;if(typeof e.v=="boolean")return Jt.BOOLEAN}function Km(e){if(e==null)return!0;const{v:n,f:t,si:r,p:s,s:i,custom:o}=e;return!(!(n==null||typeof n=="string"&&n.length===0)||t!=null&&t.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 we=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(we||{}),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 Qm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var vl=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(vl||{}),Rl=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Rl||{});function Jm(e,n,t){let r=!1,s=!1,i=e,o=n,a=e,l=n;if(t==null)return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<t.length;c++){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=t[c];if(e===h&&n===d){i=u,o=f,a=h,l=d,s=!0;break}if(e>=h&&e<=u&&n>=d&&n<=f){i=u,o=f,a=h,l=d,r=!0;break}}return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}function Il(e){const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=n,u=t,d=n,f=t;if(r&&i){const{startRow:p,startColumn:E,endRow:R,endColumn:I,startY:D,endY:x,startX:B,endX:w}=i;h=p,u=E,d=R,f=I,o=D,a=x,l=B,c=w}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,f=i.endColumn),{startRow:h,startColumn:u,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:c}}const Zm=Il;function qm(e){if(!e)return;const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=n,h=t,u=n,d=t;return(r||s)&&(c=i,h=o,u=a,d=l),{startRow:c,startColumn:h,endRow:u,endColumn:d}}function Sl(e){var t;return!e||(((t=e==null?void 0:e.v)==null?void 0:t.toString())||"").length===0&&!e.p}function ep(e){return Sl(e)&&(e==null?void 0:e.coverable)!==!1}function Dt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new qr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function tp(e){return G.isString(e)&&e.substring(0,1)==="="&&e.length>1}function np(e){return G.isString(e)&&e.length>0}function rp(e,n=!1){var i;let t="";const r=new Map([["ff",()=>{e.ff&&(t+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),t+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(t+="font-style: italic; ")}],["bl",()=>{e.bl&&(t+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):t+="text-decoration: underline; ",e.ul.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Dt(e.ul.cl)}; `),e.ul.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):t+="text-decoration-line: line-through; ",e.st.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Dt(e.st.cl)}; `),e.st.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):t+="text-decoration-line: overline; ",e.ol.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Dt(e.ol.cl)}; `),e.ol.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(t+=`background: ${Dt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,d,f,p,E,R,I;(o=e.bd)!=null&&o.b&&(t+=`border-bottom: ${vr((a=e.bd)==null?void 0:a.b.s)} ${(l=Dt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(t+=`border-top: ${vr((h=e.bd)==null?void 0:h.t.s)} ${(u=Dt(e.bd.t.cl))!=null?u:""}; `),(d=e.bd)!=null&&d.r&&(t+=`border-right: ${vr((f=e.bd)==null?void 0:f.r.s)} ${(p=Dt(e.bd.r.cl))!=null?p:""}; `),(E=e.bd)!=null&&E.l&&(t+=`border-left: ${vr((R=e.bd)==null?void 0:R.l.s)} ${(I=Dt(e.bd.l.cl))!=null?I:""}; `)}],["cl",()=>{e.cl&&(t+=`color: ${Dt(e.cl)}; `)}],["va",()=>{e.va===Bt.SUBSCRIPT?t+="vertical-align: sub; ":e.va===Bt.SUPERSCRIPT&&(t+="vertical-align: super; ")}],["td",()=>{e.td===er.LEFT_TO_RIGHT?t+="direction: ltr; ":e.td===er.RIGHT_TO_LEFT&&(t+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(t+=`--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===Xt.LEFT?t+="text-align: left; ":e.ht===Xt.RIGHT?t+="text-align: right; ":e.ht===Xt.CENTER?t+="text-align: center; ":e.ht===Xt.JUSTIFIED&&(t+="text-align: justify; ")}],["vt",()=>{e.vt===an.BOTTOM?t+="vertical-align: bottom; ":e.vt===an.TOP?t+="vertical-align: top; ":e.vt===an.MIDDLE&&(t+="vertical-align: middle; ")}],["tb",()=>{e.tb===cn.CLIP?t+="white-space: nowrap; overflow-x: hidden; ":e.tb===cn.WRAP&&(t+="white-space: normal;")}],["pd",()=>{var h,u,d,f,p,E,R,I;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(f=e.pd)==null?void 0:f.r}pt`;(p=e.pd)!=null&&p.b&&(t+=`padding-bottom: ${o}; `),(E=e.pd)!=null&&E.t&&(t+=`padding-top: ${a}; `),(R=e.pd)!=null&&R.l&&(t+=`padding-left: ${l}; `),(I=e.pd)!=null&&I.r&&(t+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)n&&s.includes(o)||(i=r.get(o))==null||i();return t}function vr(e){let n="";return e===Ge.NONE?n="none":e===Ge.THIN?n="0.5pt solid":e===Ge.HAIR?n="0.5pt double":e===Ge.DOTTED?n="0.5pt dotted":e===Ge.DASHED||e===Ge.DASH_DOT?n="0.5pt dashed":e===Ge.DASH_DOT_DOT?n="0.5pt dotted":e===Ge.DOUBLE?n="0.5pt double":e===Ge.MEDIUM?n="1pt solid":e===Ge.MEDIUM_DASHED||e===Ge.MEDIUM_DASH_DOT?n="1pt dashed":e===Ge.MEDIUM_DASH_DOT_DOT?n="1pt dotted":e===Ge.SLANT_DASH_DOT?n="0.5pt dashed":e===Ge.THICK&&(n="1.5pt solid"),n}function sp(e){let n=0;if(e=e.trim(),e==="none")n=Ge.NONE;else if(e==="0.5pt solid")n=Ge.THIN;else if(e==="0.5pt double")n=Ge.HAIR;else if(e==="0.5pt dotted")n=Ge.DOTTED;else if(e==="0.5pt dashed")n=Ge.DASHED;else if(e==="1pt solid")n=Ge.MEDIUM;else if(e==="1pt dashed")n=Ge.MEDIUM_DASHED;else if(e==="1pt dotted")n=Ge.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")n=Ge.THICK;else if(!e.includes("none"))n=Ge.THIN;else return Ge.NONE;return n}function ip(e,n){let t=e.body;if(n){const{headers:r,footers:s}=e;r!=null&&r[n]?t=r[n].body:s!=null&&s[n]&&(t=s[n].body)}return t}function op(e,n){const{startRow:t,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(t<0||s<0||r<0||i<0||!(Number.isNaN(t)&&Number.isNaN(r))&&o===we.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===we.ROW||o!==we.ROW&&o!==we.COLUMN&&(Number.isNaN(s)||Number.isNaN(t)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(n){const a=n.getRowCount(),l=n.getColumnCount();if(r>=a||i>=l)return!1}return!0}function ap(e,n){return{startRow:e,endRow:e,startColumn:n,endColumn:n}}function mi(e,n){return Object.prototype.toString.call(e)===Object.prototype.toString.call(n)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(n).length?!1:Object.keys(e).every(t=>mi(e[t],n[t])):e===n:!1}function Ol(e,n){const t=e.ts||{},r=n.ts||{};return e.sId!==n.sId?!1:mi(t,r)}function lp(e,n){return n.some(t=>e.indexOf(t)>-1)}var yl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",p="date",E="Invalid Date",R=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|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,D={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(Z){var k=["th","st","nd","rd"],z=Z%100;return"["+Z+(k[(z-20)%10]||k[z]||k[0])+"]"}},x=function(Z,k,z){var me=String(Z);return!me||me.length>=k?Z:""+Array(k+1-me.length).join(z)+Z},B={s:x,z:function(Z){var k=-Z.utcOffset(),z=Math.abs(k),me=Math.floor(z/60),te=z%60;return(k<=0?"+":"-")+x(me,2,"0")+":"+x(te,2,"0")},m:function Z(k,z){if(k.date()<z.date())return-Z(z,k);var me=12*(z.year()-k.year())+(z.month()-k.month()),te=k.clone().add(me,u),Ce=z-te<0,Ie=k.clone().add(me+(Ce?-1:1),u);return+(-(me+(z-te)/(Ce?te-Ie:Ie-te))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:u,y:f,w:h,d:c,D:p,h:l,m:a,s:o,ms:i,Q:d}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},w="en",S={};S[w]=D;var L="$isDayjsObject",j=function(Z){return Z instanceof be||!(!Z||!Z[L])},le=function Z(k,z,me){var te;if(!k)return w;if(typeof k=="string"){var Ce=k.toLowerCase();S[Ce]&&(te=Ce),z&&(S[Ce]=z,te=Ce);var Ie=k.split("-");if(!te&&Ie.length>1)return Z(Ie[0])}else{var Ne=k.name;S[Ne]=k,te=Ne}return!me&&te&&(w=te),te||!me&&w},ee=function(Z,k){if(j(Z))return Z.clone();var z=typeof k=="object"?k:{};return z.date=Z,z.args=arguments,new be(z)},ie=B;ie.l=le,ie.i=j,ie.w=function(Z,k){return ee(Z,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var be=function(){function Z(z){this.$L=le(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[L]=!0}var k=Z.prototype;return k.parse=function(z){this.$d=function(me){var te=me.date,Ce=me.utc;if(te===null)return new Date(NaN);if(ie.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var Ie=te.match(R);if(Ie){var Ne=Ie[2]-1||0,Pe=(Ie[7]||"0").substring(0,3);return Ce?new Date(Date.UTC(Ie[1],Ne,Ie[3]||1,Ie[4]||0,Ie[5]||0,Ie[6]||0,Pe)):new Date(Ie[1],Ne,Ie[3]||1,Ie[4]||0,Ie[5]||0,Ie[6]||0,Pe)}}return new Date(te)}(z),this.init()},k.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},k.$utils=function(){return ie},k.isValid=function(){return this.$d.toString()!==E},k.isSame=function(z,me){var te=ee(z);return this.startOf(me)<=te&&te<=this.endOf(me)},k.isAfter=function(z,me){return ee(z)<this.startOf(me)},k.isBefore=function(z,me){return this.endOf(me)<ee(z)},k.$g=function(z,me,te){return ie.u(z)?this[me]:this.set(te,z)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(z,me){var te=this,Ce=!!ie.u(me)||me,Ie=ie.p(z),Ne=function(K,V){var fe=ie.w(te.$u?Date.UTC(te.$y,V,K):new Date(te.$y,V,K),te);return Ce?fe:fe.endOf(c)},Pe=function(K,V){return ie.w(te.toDate()[K].apply(te.toDate("s"),(Ce?[0,0,0,0]:[23,59,59,999]).slice(V)),te)},He=this.$W,Ze=this.$M,O=this.$D,U="set"+(this.$u?"UTC":"");switch(Ie){case f:return Ce?Ne(1,0):Ne(31,11);case u:return Ce?Ne(1,Ze):Ne(0,Ze+1);case h:var Q=this.$locale().weekStart||0,ne=(He<Q?He+7:He)-Q;return Ne(Ce?O-ne:O+(6-ne),Ze);case c:case p:return Pe(U+"Hours",0);case l:return Pe(U+"Minutes",1);case a:return Pe(U+"Seconds",2);case o:return Pe(U+"Milliseconds",3);default:return this.clone()}},k.endOf=function(z){return this.startOf(z,!1)},k.$set=function(z,me){var te,Ce=ie.p(z),Ie="set"+(this.$u?"UTC":""),Ne=(te={},te[c]=Ie+"Date",te[p]=Ie+"Date",te[u]=Ie+"Month",te[f]=Ie+"FullYear",te[l]=Ie+"Hours",te[a]=Ie+"Minutes",te[o]=Ie+"Seconds",te[i]=Ie+"Milliseconds",te)[Ce],Pe=Ce===c?this.$D+(me-this.$W):me;if(Ce===u||Ce===f){var He=this.clone().set(p,1);He.$d[Ne](Pe),He.init(),this.$d=He.set(p,Math.min(this.$D,He.daysInMonth())).$d}else Ne&&this.$d[Ne](Pe);return this.init(),this},k.set=function(z,me){return this.clone().$set(z,me)},k.get=function(z){return this[ie.p(z)]()},k.add=function(z,me){var te,Ce=this;z=Number(z);var Ie=ie.p(me),Ne=function(Ze){var O=ee(Ce);return ie.w(O.date(O.date()+Math.round(Ze*z)),Ce)};if(Ie===u)return this.set(u,this.$M+z);if(Ie===f)return this.set(f,this.$y+z);if(Ie===c)return Ne(1);if(Ie===h)return Ne(7);var Pe=(te={},te[a]=r,te[l]=s,te[o]=t,te)[Ie]||1,He=this.$d.getTime()+z*Pe;return ie.w(He,this)},k.subtract=function(z,me){return this.add(-1*z,me)},k.format=function(z){var me=this,te=this.$locale();if(!this.isValid())return te.invalidDate||E;var Ce=z||"YYYY-MM-DDTHH:mm:ssZ",Ie=ie.z(this),Ne=this.$H,Pe=this.$m,He=this.$M,Ze=te.weekdays,O=te.months,U=te.meridiem,Q=function(V,fe,de,P){return V&&(V[fe]||V(me,Ce))||de[fe].slice(0,P)},ne=function(V){return ie.s(Ne%12||12,V,"0")},K=U||function(V,fe,de){var P=V<12?"AM":"PM";return de?P.toLowerCase():P};return Ce.replace(I,function(V,fe){return fe||function(de){switch(de){case"YY":return String(me.$y).slice(-2);case"YYYY":return ie.s(me.$y,4,"0");case"M":return He+1;case"MM":return ie.s(He+1,2,"0");case"MMM":return Q(te.monthsShort,He,O,3);case"MMMM":return Q(O,He);case"D":return me.$D;case"DD":return ie.s(me.$D,2,"0");case"d":return String(me.$W);case"dd":return Q(te.weekdaysMin,me.$W,Ze,2);case"ddd":return Q(te.weekdaysShort,me.$W,Ze,3);case"dddd":return Ze[me.$W];case"H":return String(Ne);case"HH":return ie.s(Ne,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return K(Ne,Pe,!0);case"A":return K(Ne,Pe,!1);case"m":return String(Pe);case"mm":return ie.s(Pe,2,"0");case"s":return String(me.$s);case"ss":return ie.s(me.$s,2,"0");case"SSS":return ie.s(me.$ms,3,"0");case"Z":return Ie}return null}(V)||Ie.replace(":","")})},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(z,me,te){var Ce,Ie=this,Ne=ie.p(me),Pe=ee(z),He=(Pe.utcOffset()-this.utcOffset())*r,Ze=this-Pe,O=function(){return ie.m(Ie,Pe)};switch(Ne){case f:Ce=O()/12;break;case u:Ce=O();break;case d:Ce=O()/3;break;case h:Ce=(Ze-He)/6048e5;break;case c:Ce=(Ze-He)/864e5;break;case l:Ce=Ze/s;break;case a:Ce=Ze/r;break;case o:Ce=Ze/t;break;default:Ce=Ze}return te?Ce:ie.a(Ce)},k.daysInMonth=function(){return this.endOf(u).$D},k.$locale=function(){return S[this.$L]},k.locale=function(z,me){if(!z)return this.$L;var te=this.clone(),Ce=le(z,me,!0);return Ce&&(te.$L=Ce),te},k.clone=function(){return ie.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},Z}(),Ae=be.prototype;return ee.prototype=Ae,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",f],["$D",p]].forEach(function(Z){Ae[Z[1]]=function(k){return this.$g(k,Z[0],Z[1])}}),ee.extend=function(Z,k){return Z.$i||(Z(k,be,ee),Z.$i=!0),ee},ee.locale=le,ee.isDayjs=j,ee.unix=function(Z){return ee(1e3*Z)},ee.en=S[w],ee.Ls=S,ee.p={},ee})})(yl);var up=yl.exports;const zt=wt(up);var wl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,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)}}})})(wl);var cp=wl.exports;const hp=wt(cp);var bl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t={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(R){return(R=+R)+(R>68?1900:2e3)},h=function(R){return function(I){this[R]=+I}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(R){(this.zone||(this.zone={})).offset=function(I){if(!I||I==="Z")return 0;var D=I.match(/([+-]|\d\d)/g),x=60*D[1]+(+D[2]||0);return x===0?0:D[0]==="+"?-x:x}(R)}],d=function(R){var I=l[R];return I&&(I.indexOf?I:I.s.concat(I.f))},f=function(R,I){var D,x=l.meridiem;if(x){for(var B=1;B<=24;B+=1)if(R.indexOf(x(B,0,I))>-1){D=B>12;break}}else D=R===(I?"pm":"PM");return D},p={A:[a,function(R){this.afternoon=f(R,!1)}],a:[a,function(R){this.afternoon=f(R,!0)}],Q:[s,function(R){this.month=3*(R-1)+1}],S:[s,function(R){this.milliseconds=100*+R}],SS:[i,function(R){this.milliseconds=10*+R}],SSS:[/\d{3}/,function(R){this.milliseconds=+R}],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(R){var I=l.ordinal,D=R.match(/\d+/);if(this.day=D[0],I)for(var x=1;x<=31;x+=1)I(x).replace(/\[|\]/g,"")===R&&(this.day=x)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(R){var I=d("months"),D=(d("monthsShort")||I.map(function(x){return x.slice(0,3)})).indexOf(R)+1;if(D<1)throw new Error;this.month=D%12||D}],MMMM:[a,function(R){var I=d("months").indexOf(R)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(R){this.year=c(R)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function E(R){var I,D;I=R,D=l&&l.formats;for(var x=(R=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(ee,ie,be){var Ae=be&&be.toUpperCase();return ie||D[be]||t[be]||D[Ae].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Z,k,z){return k||z.slice(1)})})).match(r),B=x.length,w=0;w<B;w+=1){var S=x[w],L=p[S],j=L&&L[0],le=L&&L[1];x[w]=le?{regex:j,parser:le}:S.replace(/^\[|\]$/g,"")}return function(ee){for(var ie={},be=0,Ae=0;be<B;be+=1){var Z=x[be];if(typeof Z=="string")Ae+=Z.length;else{var k=Z.regex,z=Z.parser,me=ee.slice(Ae),te=k.exec(me)[0];z.call(ie,te),ee=ee.replace(te,"")}}return function(Ce){var Ie=Ce.afternoon;if(Ie!==void 0){var Ne=Ce.hours;Ie?Ne<12&&(Ce.hours+=12):Ne===12&&(Ce.hours=0),delete Ce.afternoon}}(ie),ie}}return function(R,I,D){D.p.customParseFormat=!0,R&&R.parseTwoDigitYear&&(c=R.parseTwoDigitYear);var x=I.prototype,B=x.parse;x.parse=function(w){var S=w.date,L=w.utc,j=w.args;this.$u=L;var le=j[1];if(typeof le=="string"){var ee=j[2]===!0,ie=j[3]===!0,be=ee||ie,Ae=j[2];ie&&(Ae=j[2]),l=this.$locale(),!ee&&Ae&&(l=D.Ls[Ae]),this.$d=function(me,te,Ce,Ie){try{if(["x","X"].indexOf(te)>-1)return new Date((te==="X"?1e3:1)*me);var Ne=E(te)(me),Pe=Ne.year,He=Ne.month,Ze=Ne.day,O=Ne.hours,U=Ne.minutes,Q=Ne.seconds,ne=Ne.milliseconds,K=Ne.zone,V=Ne.week,fe=new Date,de=Ze||(Pe||He?1:fe.getDate()),P=Pe||fe.getFullYear(),J=0;Pe&&!He||(J=He>0?He-1:fe.getMonth());var q,re=O||0,ve=U||0,ye=Q||0,F=ne||0;return K?new Date(Date.UTC(P,J,de,re,ve,ye,F+60*K.offset*1e3)):Ce?new Date(Date.UTC(P,J,de,re,ve,ye,F)):(q=new Date(P,J,de,re,ve,ye,F),V&&(q=Ie(q).week(V).toDate()),q)}catch{return new Date("")}}(S,le,L,D),this.init(),Ae&&Ae!==!0&&(this.$L=this.locale(Ae).$L),be&&S!=this.format(le)&&(this.$d=new Date("")),l={}}else if(le instanceof Array)for(var Z=le.length,k=1;k<=Z;k+=1){j[1]=le[k-1];var z=D.apply(this,j);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}k===Z&&(this.$d=new Date(""))}else B.call(this,w)}}})})(bl);var dp=bl.exports;const fp=wt(dp);var Al={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,d,f,p,E){var R=u.name?u:u.$locale(),I=o(R[d]),D=o(R[f]),x=I||D.map(function(w){return w.slice(0,p)});if(!E)return x;var B=R.weekStart;return x.map(function(w,S){return x[(S+(B||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,d){return u.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,E,R){return E||R.slice(1)})}(u.formats[d.toUpperCase()])},h=function(){var u=this;return{months:function(d){return d?d.format("MMMM"):a(u,"months")},monthsShort:function(d){return d?d.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(u,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(u.$locale(),d)},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(d){return c(u,d)},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)}}})})(Al);var gp=Al.exports;const mp=wt(gp);var Tl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t={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=t,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,h=function(u,d){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,p,E){var R=E&&E.toUpperCase();return p||d[E]||t[E]||d[R].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(I,D,x){return D||x.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})})(Tl);var pp=Tl.exports;const _p=wt(pp);var Nl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(E){var R={date:E,utc:!0,args:arguments};return new o(R)},l.utc=function(E){var R=a(this.toDate(),{locale:this.$L,utc:!0});return E?R.add(this.utcOffset(),t):R},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(E){E.utc&&(this.$u=!0),this.$utils().u(E.$offset)||(this.$offset=E.$offset),c.call(this,E)};var h=l.init;l.init=function(){if(this.$u){var E=this.$d;this.$y=E.getUTCFullYear(),this.$M=E.getUTCMonth(),this.$D=E.getUTCDate(),this.$W=E.getUTCDay(),this.$H=E.getUTCHours(),this.$m=E.getUTCMinutes(),this.$s=E.getUTCSeconds(),this.$ms=E.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(E,R){var I=this.$utils().u;if(I(E))return this.$u?0:I(this.$offset)?u.call(this):this.$offset;if(typeof E=="string"&&(E=function(w){w===void 0&&(w="");var S=w.match(r);if(!S)return null;var L=(""+S[0]).match(s)||["-",0,0],j=L[0],le=60*+L[1]+ +L[2];return le===0?0:j==="+"?le:-le}(E),E===null))return this;var D=Math.abs(E)<=16?60*E:E,x=this;if(R)return x.$offset=D,x.$u=E===0,x;if(E!==0){var B=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(D+B,t)).$offset=D,x.$x.$localOffset=B}else x=this.utc();return x};var d=l.format;l.format=function(E){var R=E||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,R)},l.valueOf=function(){var E=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*E},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(E){return E==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var p=l.diff;l.diff=function(E,R,I){if(E&&this.$u===E.$u)return p.call(this,E,R,I);var D=this.local(),x=a(E).local();return p.call(D,x,R,I)}}})})(Nl);var Ep=Nl.exports;const Cp=wt(Ep);var Ml={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,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")}}})})(Ml);var vp=Ml.exports;const Rp=wt(vp);var Dl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t="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(t);if(h.isBefore(u))return 1}var d=o(this).startOf(r).date(c).startOf(t).subtract(1,"millisecond"),f=this.diff(d,t,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(Dl);var Ip=Dl.exports;const Sp=wt(Ip);var Ll={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,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}}})})(Ll);var Op=Ll.exports;const yp=wt(Op);zt.extend(fp);zt.extend(hp);zt.extend(Rp);zt.extend(mp);zt.extend(Sp);zt.extend(yp);zt.extend(Cp);zt.extend(_p);function es(e,n,t,r){if(e>n)throw new Error("a1 should be less than a2");if(t>r)throw new Error("b1 should be less than b2");if(n<t||r<e)return[e,n];if(t<=e&&r>=n)return[];const s=r-t+1;return e<t&&n>r?[e,n-s]:t<=e&&r<n?[r+1-s,n-s]:t>e&&r>=n?[e,t-1]:[e,n]}function wp(e){if(e==null)return!1;const n=e.bullet;return(n==null?void 0:n.listId)!=null}function bp(e){if(e==null)return!1;const n=e.paragraphStyle;return xl(n)}function xl(e){var n;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((n=e.hanging)==null?void 0:n.v)===0)}function Ul(e,n,t){return e.slice(0,n)+t+e.slice(n)}function Pl(e,n,t){return n>t?e:e.slice(0,n)+e.slice(t)}const Ap=/\s/g;function Tp(e){return e===null||e.toString().replace(Ap,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function Np(e){let n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+(n<<6)+(n<<16)-n;return n>>>0}const ze=Symbol("newer"),st=Symbol("older");class Mp{constructor(n){v(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[ze],{done:!1,value:n.key}):{done:!0,value:void 0}}}class Dp{constructor(n){v(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[ze],{done:!1,value:n.value}):{done:!0,value:void 0}}}class Lp{constructor(n){v(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[ze],{done:!1,value:[n.key,n.value]}):{done:!0,value:void 0}}}var Wo,Yo;Yo=ze,Wo=st;class Co{constructor(n,t){v(this,"key");v(this,"value");v(this,Yo);v(this,Wo);this.key=n,this.value=t,this[ze]=void 0,this[st]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Hr{constructor(...n){v(this,"_keymap");v(this,"size",0);v(this,"limit");v(this,"oldest");v(this,"newest");v(this,"_onShiftListeners",[]);if(jn.hasLength(n,1)){if(jn.isNumber(n[0])){const t=n[0];this._initialize(t,void 0);return}if(jn.isIterable(n[0])){const t=n[0];this._initialize(0,t);return}return}if(jn.hasLength(n,2)){const t=n[0],r=n[1];this._initialize(t,r)}}onShift(n){if(this._onShiftListeners.indexOf(n)===-1)return this._onShiftListeners.push(n),Je(()=>ar(this._onShiftListeners,n));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(n,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=n,this._keymap=new Map,t&&(this.assign(t),n<1&&(this.limit=this.size))}_markEntryAsUsed(n){n!==this.newest&&(n[ze]&&(n===this.oldest&&(this.oldest=n[ze]),n[ze][st]=n[st]),n[st]&&(n[st][ze]=n[ze]),n[ze]=void 0,n[st]=this.newest,this.newest&&(this.newest[ze]=n),this.newest=n)}assign(n){let t,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=n[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new Co(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),t?(t[ze]=o,o[st]=t):this.oldest=o,t=o,r--===0)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}set(n,t){let r=this._keymap.get(n);return r?(r.value=t,this._markEntryAsUsed(r),this):(this._keymap.set(n,r=new Co(n,t)),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 n=this.oldest;if(n)return this.oldest&&this.oldest[ze]?(this.oldest=this.oldest[ze],this.oldest[st]=void 0):(this.oldest=void 0,this.newest=void 0),n[ze]=n[st]=void 0,this._keymap.delete(n.key),--this.size,this._onShiftListeners.forEach(t=>t(n)),[n.key,n.value]}get(n){const t=this._keymap.get(n);if(t)return this._markEntryAsUsed(t),t.value}has(n){return this._keymap.has(n)}find(n){const t=this._keymap.get(n);return t?t.value:void 0}delete(n){const t=this._keymap.get(n);if(t)return this._keymap.delete(t.key),t[ze]&&t[st]?(t[st][ze]=t[ze],t[ze][st]=t[st]):t[ze]?(t[ze][st]=void 0,this.oldest=t[ze]):t[st]?(t[st][ze]=void 0,this.newest=t[st]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new Mp(this.oldest)}values(){return new Dp(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Lp(this.oldest)}forEach(n,t){typeof t!="object"&&(t=this);let r=this.oldest;for(;r;)n.call(t,r.value,r.key,this),r=r[ze]}toJSON(){const n=new Array(this.size);let t=0,r=this.oldest;for(;r;)n[t++]={key:r.key,value:r.value},r=r[ze];return n}toString(){let n="",t=this.oldest;for(;t;)n+=`${String(t.key)}:${t.value}`,t=t[ze],t&&(n+=" < ");return n}}class jn{static hasLength(n,t){return n.length===t}static getValueType(n){return Object.prototype.toString.apply(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isIterable(n){return n[Symbol.iterator]!=null}static isNumber(n){return this.getValueType(n)==="[object Number]"}}var kl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(typeof self<"u"?self:Qe,function(){return function(){var t={d:function(_,g){for(var m in g)t.o(g,m)&&!t.o(_,m)&&Object.defineProperty(_,m,{enumerable:!0,get:g[m]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};t.d(r,{default:function(){return dt}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function c(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function h(_){const g=c(_);let m=null;if(g){const y=l(g);m=o[y.lang]||o[y.language]||null}return m}function u(_){return Object.assign({},a,_)}function d(_,g){const m=typeof g=="object"?g:l(g);return o[m.lang]=u(_),m.language===m.lang||o[m.language]||(o[m.language]=u(_)),o[m.lang]}const f=u({group:","});function p(_,g){if(typeof _!="number")return _;if(_<0)return-p(-_,g);if(g){const m=10**(g||0)||1;return p(_*m,0)/m}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function E(_,g,m){const y=_<0?-1:1,b=10**(g||2),N=10**(m||2);let T,M,C=Math.abs(_),H=0,ae=0,$=0,se=1;if((_=C)%1==0)M=[_*y,1];else if(_<1e-19)M=[y,1e19];else if(_>1e19)M=[1e19*y,1];else{do if(C=1/(C-Math.floor(C)),T=se,se=se*Math.floor(C)+H,H=T,ae=$,$=Math.floor(_*se+.5),$>=b||se>=N)return[y*ae,H];while(Math.abs(_-$/se)>=1e-10&&C!==Math.floor(C));M=[y*$,se]}return M}const R={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},I=Object.assign({},R);function D(_){if(_===null&&(_=R),_){for(const g in _)if(g in R){const m=_[g];I[g]=m==null?R[g]:m}}return{...I}}const x={"#":"",0:"0","?":" "},B={"@":"text","-":"minus","+":"plus"},w=["#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"],S=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],L=new RegExp("["+S.join("")+"]");function j(_,g,m){return g[m+"_max"]=_.length,g[m+"_min"]=_.replace(/#/g,"").length,g}const le={};function ee(_){if(!(_ in le)){const g=[],m=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,y=>"?".repeat(y.length));for(let y=0;y<m.length;y++){const b=m.charAt(y);g[y]=b in x?x[b]:b}le[_]=g.join("")}return le[_]}function ie(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,x["?"])}),g.push(_)}function be(_){const g=[],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:g};let y=_+"",b="int",N=!1,T=null;const M=[];let C,H,ae=!1;for(;y&&!N;){if(C=/^General/i.exec(y))m.general=!0,ie({type:"general"},g);else if(b==="int"&&(C=/^[#?0]+(?:,[#?0]+)*/.exec(y))||b==="den"&&(C=/^[#?\d]+/.exec(y))||(C=/^[#?0]+/.exec(y)))m[b+"_pattern"].push(C[0]),T={type:b,num:C[0]},ie(T,g);else if((C=/^\//.exec(y))&&m[b+"_pattern"].length){if(!T)throw new SyntaxError("Missing a numerator in pattern ".concat(_));m.fractions=!0,m.num_pattern.push(m[b+"_pattern"].pop()),T.type="num",b="den",ie({type:"div"},g)}else if(C=/^,+/.exec(y)){const A=y.charAt(1)in x;H.slice(-1)in x&&(C[0].length>1||!A)?m.scale=.001**C[0].length:m.dec_fractions||ie(C[0],g)}else{if(C=/^;/.exec(y)){N=!0;break}if(C=/^[@+-]/.exec(y))C[0]==="@"&&(m.text=!0),ie({type:B[C[0]]},g);else if(C=/^(?:\[(h+|m+|s+)\])/i.exec(y)){const A=C[1].toLowerCase(),W=A[0],ce={type:"",size:0,date:1,raw:C[0],pad:A.length};W==="h"?(ce.size=16,ce.type="hour-elap"):W==="m"?(ce.size=32,ce.type="min-elap"):(ce.size=64,ce.type="sec-elap"),m.date=m.date|ce.size,M.push(ce),ie(ce,g)}else if(C=/^(?:B2)/i.exec(y))ae||(m.date_system=6);else if(C=/^(?:B1)/i.exec(y))ae||(m.date_system=1);else if(C=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(y)){const A={type:"",size:0,date:1,raw:C[0]},W=C[0].toLowerCase(),ce=W[0];if(W==="y"||W==="yy")A.size=2,A.type="year-short";else if(ce==="y"||ce==="e")A.size=2,A.type="year";else if(W==="b"||W==="bb")A.size=2,A.type="b-year-short";else if(ce==="b")A.size=2,A.type="b-year";else if(W==="d"||W==="dd")A.size=8,A.type="day",A.pad=/dd/.test(W);else if(W==="ddd")A.size=8,A.type="weekday-short";else if(ce==="d")A.size=8,A.type="weekday";else if(ce==="h")A.size=16,A.type="hour",A.pad=/hh/i.test(W);else if(ce==="m"){W.length===3?(A.size=4,A.type="monthname-short"):W.length===5?(A.size=4,A.type="monthname-single"):W.length>=4&&(A.size=4,A.type="monthname");const Re=M[M.length-1];!A.type&&Re&&!Re.used&&80&Re.size&&(Re.used=!0,A.size=32,A.type="min",A.pad=/mm/.test(W)),A.type||(A.size=4,A.type="month",A.pad=/mm/.test(W),A.indeterminate=!0)}else if(ce==="s"){A.size=64,A.type="sec",A.pad=/ss/.test(W);const Re=M[M.length-1];Re&&32&Re.size?A.used=!0:Re&&Re.indeterminate&&(delete Re.indeterminate,Re.size=32,Re.type="min",A.used=!0)}m.date=m.date|A.size,m.date_eval=!0,M.push(A),ie(A,g)}else if(C=/^(?:AM\/PM|am\/pm|A\/P)/.exec(y))m.clock=12,m.date=16|m.date,m.date_eval=!0,ie({type:"am",short:C[0]==="A/P"},g);else if(m.date&&(C=/^\.0{1,3}/i.exec(y))){const A=C[0].length-1,W=[64,128,256,512][A];m.date=m.date|W,m.date_eval=!0,m.sec_decimals=Math.max(m.sec_decimals,A),ie({type:"subsec",size:W,decimals:A,date:1,raw:C[0]},g)}else if((C=/^\\(.)/.exec(y))||(C=/^"([^"]*?)"/.exec(y)))ie(C[1],g);else if(C=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(y))m.condition=[C[1],parseFloat(C[2],10)];else if(C=/^\[\$([^\]]+)\]/.exec(y)){const A=C[1].split("-"),W=A.length<2?"":A[A.length-1],ce=A[0];ce&&ie(ce,g);const Re=c(W);Re&&(m.locale=Re);const De=parseInt(W,16);isFinite(De)&&16711680&De&&(De>>16&255)===6&&(m.date_system=6),ae=!0}else if(C=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(y))m.color=C[2]?w[parseInt(C[2],10)]||"#000":C[1].toLowerCase();else if(!(C=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(y))){if(C=/^%/.exec(y))m.scale=100,m.percent=!0,ie("%",g);else if(C=/^_(\\.|.)/.exec(y))ie(" ",g);else if(C=/^\./.exec(y))ie({type:"point",value:C[0]},g),m.dec_fractions=!0,b="frac";else if(C=/^[Ee]([+-]?|(?=[0#?]))/.exec(y))m.exponential=!0,m.exp_plus=C[1]==="+",b="man",ie({type:"exp",plus:C[1]==="+"},g);else if(!(C=/^\*(\\.|.)/.exec(y))){if(C=/^[BENn[]/.exec(y))throw new SyntaxError("Unexpected char ".concat(y.charAt(0)," in pattern ").concat(_));y[0]==="("&&(m.parens=!0),C=[y[0]],ie(C[0],g)}}}H=C[0],y=y.slice(C?C[0].length:1)}if(m.pattern=_.slice(0,_.length-y.length),/^((?:\[[^\]]+\])+)(;|$)/.test(m.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(m.pattern)&&ie({type:"text"},g),m.fractions&&m.dec_fractions||m.fractions&&m.exponential)throw new SyntaxError("Invalid pattern: ".concat(m.pattern));const $=m.int_pattern.join("");if(m.grouping=$.indexOf(",")>=0,m.grouping){const A=$.split(","),W=A.length;W===2?(m.group_pri=A[1].length,m.group_sec=m.group_pri):W>2&&(m.group_pri=A[W-1].length,m.group_sec=A[W-2].length)}else m.group_pri=0,m.group_sec=0;j($.replace(/[,]/g,""),m,"int"),j(m.frac_pattern.join(""),m,"frac"),j(m.man_pattern.join(""),m,"man");let se=m.num_pattern.join(""),_e=m.den_pattern.join("");const X=/\?/.test(_e)||/\?/.test(se);return _e=_e.replace(/\d/g,X?"?":"#"),X&&(_e=_e.replace(/#$/g,"?")),j(se,m,"num"),j(_e,m,"den"),X&&(se=se.replace(/#$/g,"?")),m.int_padding=ee(m.int_pattern.join("")),m.man_padding=ee(m.man_pattern.join("")),m.num_padding=ee(se),m.den_padding=ee(_e),m.den_pattern.length&&(m.denominator=parseInt(m.den_pattern.join("").replace(/\D/g,""),10)),m.integer=!!m.int_pattern.join("").length,m.fractions&&g.forEach((A,W)=>{const ce=g[W+1];A.type==="string"&&ce&&(ce.type==="num"?A.rule="num+int":ce.type==="div"?A.rule="num":ce.type==="den"&&(A.rule="den"))}),m}const Ae=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function Z(_){const g=[];let m,y=!1,b=null,N=_,T=0,M=!1,C=0,H=0;do{if(M=be(N),(M.date||M.general)&&(M.int_pattern.length||M.frac_pattern.length||M.scale!==1||M.text))throw new Error("Illegal format");if(M.condition&&(H++,y=!0),M.text){if(b)throw new Error("Unexpected partition");b=M}M.locale&&(m=c(M.locale)),g.push(M),T=N.charAt(M.pattern.length)===";"?1:0,N=N.slice(M.pattern.length+T),C++}while(T&&C<4&&H<3);if(T)throw new Error("Unexpected partition");if(H>2)throw new Error("Unexpected condition");const ae=g[3];if(ae&&(ae.int_pattern.length||ae.frac_pattern.length||ae.date))throw new Error("Unexpected partition");if(y){const $=g.length;if($===1&&(g[1]=be("General"),g[1].generated=!0),$<3){const se=g[0],_e=g[1];if(Ae(se),_e.condition)Ae(_e);else{const X=se.condition;(X[0]==="="||X[1]>=0&&(X[0]===">"||X[0]===">="))&&_e.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(Ae)}else{if(g.length<4&&b)for(let $=0,se=g.length;$<se;$++)g[$]===b&&g.splice($,1);if(g.length<1&&b&&(g[0]=be("General"),g[0].generated=!0),g.length<2){const $=be(g[0].pattern);$.tokens.unshift({type:"minus",volatile:!0}),$.generated=!0,g.push($)}if(g.length<3){const $=be(g[0].pattern);$.generated=!0,g.push($)}if(g.length<4)if(b)g.push(b);else{const $=be("@");$.generated=!0,g.push($)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:m}}const k=Math.floor;function z(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let m=_+68569+2415019;const y=k(4*m/146097);m-=k((146097*y+3)/4);const b=k(4e3*(m+1)/1461001);m=m-k(1461*b/4)+31;const N=k(80*m/2447),T=m-k(2447*N/80);m=k(N/11);const M=N+2-12*m;return[0|100*(y-49)+b+m,0|M,0|T]}function me(_){return z(_+1462)}function te(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,m=.1335;let y=_+466935;const b=k(y/10631);y-=10631*b;const N=k((y-m)/g);y-=k(N*g+m);const T=k((y+28.5001)/29.5);return T===13?[30*b+N,12,30]:[30*b+N,T,y-k(29.5001*T-29)]}function Ce(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const y=k(_);return g===6?te(y):g===-1?me(y):z(y,m)}const Ie=Math.floor,Ne=86400;function Pe(_,g){let m=null;if(Array.isArray(_)){const[y,b,N,T,M,C]=_;m=Date.UTC(y,b==null?0:b-1,N!=null?N:1,T||0,M||0,C||0)}else if(_ instanceof Date&&(m=1*_,!g||!g.ignoreTimezone)){const y=new Date;y.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),y.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),m=1*y}if(m!=null&&isFinite(m)){const y=m/864e5;return y-(y<=-25509?-25568:-25569)}return _}function He(_,g){let m=0|_;const y=Ne*(_-m);let b=Ie(y);y-b>.9999&&(b+=1,b===Ne&&(b=0,m+=1));const N=b<0?Ne+b:b,[T,M,C]=Ce(_,0,g&&g.leap1900),H=Ie(N/60/60)%60,ae=Ie(N/60)%60,$=Ie(N)%60;if(g&&g.nativeDate){const se=new Date(0);return se.setUTCFullYear(T,M-1,C),se.setUTCHours(H,ae,$),se}return[T,M,C,H,ae,$]}function Ze(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function O(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function U(_){const[g,m,y,b]=_;return!(g&&!g.generated||m&&!m.generated||y&&!y.generated||!b||!b.text||b.generated)}const Q={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},ne=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],K={total:1,sign:0,period:0,int:1,frac:0},V=(_,g)=>_.replace(/\./,g.decimal);function fe(_,g,m,y){const b=0|m;if(typeof m=="string")_.push(m);else if(m===b)_.push(Math.abs(b));else{const N=Math.abs(m);let T=N?Math.floor(Math.log10(N)):0,M=T<0?N*10**-T:N/10**T;M===10&&(M=1,T++);const C=function(ae){let $=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const se=Math.abs(ae);if(!se)return K;const _e=$&&ae<0?1:0,X=Math.floor(se),A=Math.floor(Math.log10(se)+1);let W=0,ce=0;if(X!==se){W=1;const Re=String(p(A<0?se*10**-A:se/10**A,15));let De=Re.length,xe=!0,je=0;for(;je<=Re.length;){if(Re[je]==="."){De--;break}Re[je]==="0"&&xe?De--:xe=!1,je++}ce=De-A,ce<0&&(ce=0,W=0)}return{total:_e+Math.max(A,1)+W+ce,digits:Math.max(A,0)+ce,sign:_e,period:W,int:Math.max(A,1),frac:ce}}(N),H=()=>{const ae=Math.abs(T);let $;$=M===1?M:p(M,5),_.push(V($+"",y),y.exponent,T<0?y.negative:y.positive,ae<10?"0":"",ae)};if(T>=-4&&T<=-1){const ae=N.toPrecision(10+T).replace(/\.?0+$/,"");_.push(V(ae,y))}else if(T===10){const ae=N.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(V(ae,y))}else if(Math.abs(T)<=9)if(C.total<=11){const ae=p(N,9).toFixed(C.frac);_.push(V(ae,y))}else T===9?_.push(Math.floor(N)):T>=0&&T<9?_.push(p(N,9-T)):H();else C.total>=12?H():Math.floor(N)===N?_.push(Math.floor(N)):_.push(V(p(N,9).toFixed(C.frac),y))}return _}const de=86400,P={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},J=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const m=Math.floor(Math.log10(_));return g>1?Math.floor(m/g)*g:m};function q(_,g,m,y){let b="",N="",T="",M="",C="",H=0,ae=0|_,$=0,se=0,_e=1,X=0,A=0,W=0,ce=0,Re=0,De=0;const xe=y||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(ge){if(ge===0)return ge;const Oe=Math.ceil(Math.log10(ge<0?-ge:ge)),Y=10**(16-Math.floor(Oe));return Math.round(ge*Y)/Y}(_*g.scale)),g.exponential){let ge=Math.abs(_);if(ge){const Oe=10**-J(ge,g.int_max),Y=p(ge*Oe,g.frac_max)/Oe;H=J(Y,g.int_max)}ge/=10**H,_=_<0?-ge:ge,b+=Math.abs(H)}if(g.integer){const ge=Math.abs(p(_,g.fractions?1:g.frac_max));C+=ge<1?"":Math.floor(ge)}if(g.grouping){let ge="",Oe=C.length;for(Oe>g.group_pri&&(Oe-=g.group_pri,ge=xe.group+C.slice(Oe,Oe+g.group_pri)+ge);Oe>g.group_sec;)Oe-=g.group_sec,ge=xe.group+C.slice(Oe,Oe+g.group_sec)+ge;C=Oe?C.slice(0,Oe)+ge:ge}g.dec_fractions&&(M=String(p(_,g.frac_max)).split(".")[1]||"");let je=!1;if(g.fractions){const ge=Math.abs(g.integer?_%1:_);if(ge)if(je=!0,isFinite(g.denominator))T+=g.denominator,N+=p(ge*g.denominator),N==="0"&&(N="",T="",je=!1,C||(C="0"));else{const Oe=E(ge,g.integer?g.num_max:1/0,g.den_max);N+=Oe[0],T+=Oe[1],g.integer&&N==="0"&&(C||(C="0"),N="",T="",je=!1)}}if(g.date){ae=Math.trunc(_);const ge=de*(_-ae);if($=Math.floor(ge),De=ge-$,Math.abs(De)<1e-6?De=0:De>.9999&&(De=0,$+=1,$===de&&($=0,ae+=1)),De){const Oe=512&g.date||256&g.date||128&g.date;(Oe===512&&De>.9995||Oe===256&&De>.995||Oe===128&&De>.95||!Oe&&De>=.5)&&($++,De=0)}if(ae||g.date_system){const Oe=Ce(_,g.date_system,m.leap1900);se=Oe[0],_e=Oe[1],X=Oe[2]}if($){const Oe=$<0?de+$:$;Re=Math.floor(Oe)%60,ce=Math.floor(Oe/60)%60,W=Math.floor(Oe/60/60)%60}if(A=(6+ae)%7,g.date_eval&&(ft=_,_t=ae+$/de,m.dateSpanLarge?ft<-694324||_t>=35830291:ft<0||_t>=2958466)){if(m.dateErrorThrows)throw new Error("Date out of bounds");return m.dateErrorNumber?fe(_<0?[xe.negative]:[],0,_,xe).join(""):m.overflow}}var ft,_t;if(g.int_padding&&(C=g.int_padding.length===1?C||g.int_padding:g.int_padding.substring(0,g.int_padding.length-C.length)+C),g.num_padding&&(N=g.num_padding.length===1?N||g.num_padding:g.num_padding.substring(0,g.num_padding.length-N.length)+N),g.den_padding&&(T=g.den_padding.length===1?T||g.den_padding:T+g.den_padding.slice(T.length)),g.man_padding){const ge=g.exp_plus?"+":"";b=g.man_padding.length===1?(H<0?"-":ge)+(b||g.man_padding):(H<0?"-":ge)+g.man_padding.slice(0,g.man_padding.length-b.length)+b}const ue=[];let qe=0;const pe={int:0,frac:0,man:0,num:0,den:0};for(let ge=0,Oe=g.tokens.length;ge<Oe;ge++){const Y=g.tokens[ge],ut=Y.num?Y.num.length:0;if(Y.type==="string")Y.rule?Y.rule==="num"?je?ue.push(Y.value):(g.num_min>0||g.den_min>0)&&ue.push(Y.value.replace(/./g,x["?"])):Y.rule==="num+int"?je&&C?ue.push(Y.value):g.den_min>0&&(C||g.num_min)&&ue.push(Y.value.replace(/./g,x["?"])):Y.rule==="den"&&(je?ue.push(Y.value):(g.den_min>0||g.den_min>0)&&ue.push(Y.value.replace(/./g,x["?"]))):ue.push(Y.value);else if(Y.type==="error")ue.push(m.invalid);else if(Y.type==="point")ue.push(g.date?Y.value:xe.decimal);else if(Y.type==="general")fe(ue,0,_,xe);else if(Y.type==="exp")ue.push(xe.exponent);else if(Y.type==="minus")Y.volatile&&g.date||Y.volatile&&(_>=0||typeof _!="number")||(Y.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&C&&C!=="0"||M)&&ue.push(xe.negative):ue.push(xe.negative));else if(Y.type==="plus")ue.push(xe.positive);else if(Y.type==="text")ue.push(_);else if(Y.type==="div")je?ue.push("/"):g.num_min>0||g.den_min>0?ue.push(x["?"]):ue.push(x["#"]);else if(Y.type==="int")if(g.int_pattern.length===1)ue.push(C);else{const Fe=qe?g.int_pattern.join("").length-pe.int:1/0,Mt=qe===g.int_pattern.length-1?0:g.int_pattern.join("").length-(pe.int+Y.num.length);ue.push(C.substring(C.length-Fe,C.length-Mt)),qe++,pe.int+=Y.num.length}else if(Y.type==="frac"){const Fe=pe.frac;for(let Mt=0;Mt<ut;Mt++)ue.push(M[Mt+Fe]||x[Y.num[Mt]]);pe.frac+=ut}else if(Y.type in P)g[Y.type+"_pattern"].length===1?(Y.type==="int"&&ue.push(C),Y.type==="frac"&&ue.push(M),Y.type==="man"&&ue.push(b),Y.type==="num"&&ue.push(N),Y.type==="den"&&ue.push(T)):(ue.push(P[Y.type].slice(pe[Y.type],pe[Y.type]+ut)),pe[Y.type]+=ut);else if(Y.type==="year")se<0&&ue.push(xe.negative),ue.push(String(Math.abs(se)).padStart(4,"0"));else if(Y.type==="year-short"){const Fe=se%100;ue.push(Fe<10?"0":"",Fe)}else if(Y.type==="month")ue.push(Y.pad&&_e<10?"0":"",_e);else if(Y.type==="monthname-single")g.date_system===6?ue.push(xe.mmmm6[_e-1].charAt(0)):ue.push(xe.mmmm[_e-1].charAt(0));else if(Y.type==="monthname-short")g.date_system===6?ue.push(xe.mmm6[_e-1]):ue.push(xe.mmm[_e-1]);else if(Y.type==="monthname")g.date_system===6?ue.push(xe.mmmm6[_e-1]):ue.push(xe.mmmm[_e-1]);else if(Y.type==="weekday-short")ue.push(xe.ddd[A]);else if(Y.type==="weekday")ue.push(xe.dddd[A]);else if(Y.type==="day")ue.push(Y.pad&&X<10?"0":"",X);else if(Y.type==="hour"){const Fe=W%g.clock||(g.clock<24?g.clock:0);ue.push(Y.pad&&Fe<10?"0":"",Fe)}else if(Y.type==="min")ue.push(Y.pad&&ce<10?"0":"",ce);else if(Y.type==="sec")ue.push(Y.pad&&Re<10?"0":"",Re);else if(Y.type==="subsec"){ue.push(xe.decimal);const Fe=De.toFixed(g.sec_decimals);ue.push(Fe.slice(2,2+Y.decimals))}else if(Y.type==="am"){const Fe=W<12?0:1;Y.short&&!y?ue.push("AP"[Fe]):ue.push(xe.ampm[Fe])}else if(Y.type==="hour-elap"){_<0&&ue.push(xe.negative);const Fe=24*ae+Math.floor(Math.abs($)/3600);ue.push(String(Math.abs(Fe)).padStart(Y.pad,"0"))}else if(Y.type==="min-elap"){_<0&&ue.push(xe.negative);const Fe=1440*ae+Math.floor(Math.abs($)/60);ue.push(String(Math.abs(Fe)).padStart(Y.pad,"0"))}else if(Y.type==="sec-elap"){_<0&&ue.push(xe.negative);const Fe=ae*de+Math.abs($);ue.push(String(Math.abs(Fe)).padStart(Y.pad,"0"))}else if(Y.type==="b-year")ue.push(se+543);else if(Y.type==="b-year-short"){const Fe=(se+543)%100;ue.push(Fe<10?"0":"",Fe)}}return m.nbsp?ue.join(""):ue.join("").replace(/\u00a0/g," ")}function re(_,g){for(let m=0;m<3;m++){const y=g[m];if(y){let b;if(y.condition){const N=y.condition[0],T=y.condition[1];N==="="?b=_===T:N===">"?b=_>T:N==="<"?b=_<T:N===">="?b=_>=T:N==="<="?b=_<=T:N==="<>"&&(b=_!==T)}else b=!0;if(b)return y}}}const ve=be("@"),ye="black",F={};function he(_,g){if(_){const m=_[0];g[m]=g[m]||{},he(_.slice(1),g[m])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","m-d-y","m-d-Y","m-j-y","m-j-Y","n-d-y","n-d-Y","n-j-y","n-j-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"].forEach(_=>{he(_,F),he(_+" x",F),he(_+" l",F),he(_+" l x",F),he("l "+_,F),he("l "+_+" x",F),he(_+" D",F),he(_+" D x",F),he("D "+_,F),he("D "+_+" x",F)});const Be={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},$e={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Me={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"},Ke=new Date().getUTCFullYear();function It(_){const g=new RegExp("^([\\s+%"+S.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+S.join("")+")]*)$").exec(_);if(g){const[,m,y,b,N,T]=g;let M=1,C="",H=!1,ae=!1,$=!1,se=!1,_e=!1,X=null,A=!1,W=parseFloat(y.replace(/,/g,""));if(!isFinite(W))return null;for(let Re=0;Re<m.length;Re++){const De=m[Re];if(De==="-"){if(H||ae)return null;H=!0,M=-1}else if(L.test(De)){if(_e)return null;_e=!0,X=De}else if(De==="("){if(ae||H)return null;ae=!0,M=-1}else if(De==="%"){if(se)return null;se=!0}}for(let Re=0;Re<T.length;Re++){const De=T[Re];if(L.test(De)){if(_e)return null;_e=!0,X=De,A=!0}else if(De===")"){if($||!ae)return null;$=!0}else if(De==="%"){if(se)return null;se=!0}}if(N){if(se||_e)return null;C="0.00E+00"}else if(se){if(_e)return null;C=b.includes(".")?"0.00%":"0%",W*=.01}else if(_e){const Re=b.includes(".")?"#,##0.00":"#,##0";C=A?Re+X:X+Re}else b.includes(",")&&(C=b.includes(".")?"#,##0.00":"#,##0");const ce={v:W*M};return C&&(ce.z=C),ce}}const We=(_,g,m)=>{const y=m.path||"",b=Object.keys(g);for(let N=0;N<b.length;N++){let T;const M=b[N];if(g[M]){if(M==="$"||M==="€")_||(T=m);else if(M==="-"){const C=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(C){const H=C[1]==="-"||C[1]==="/"||C[1]==="."?C[1]:" ";if(!m.sep||m.sep===H){const ae=C[0].replace(/\s+/g," ");T=We(_.slice(C[0].length),g[M],{...m,sep:H,path:y+ae})}}}else if(M===" "){const C=/^[,.]?\s+/.exec(_);if(C){const H=C[0].replace(/\s+/g," ");T=We(_.slice(C[0].length),g[M],{...m,path:y+H})}}else if(M==="j"||M==="d"){const C=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);C&&(T=We(_.slice(C[0].length),g[M],{...m,day:C[0],path:y+M}))}else if(M==="n"||M==="m"){const C=/^(0?[1-9]|1[012])\b/.exec(_);C&&(T=We(_.slice(C[0].length),g[M],{...m,month:+C[0],_mon:C[0],path:y+M}))}else if(M==="F"||M==="M"){const C=/^([a-z]{3,9})\b/i.exec(_),H=C&&(M==="F"?$e:Be)[C[0].toLowerCase()];H&&(T=We(_.slice(C[0].length),g[M],{...m,month:H,_mon:C[0],path:y+M}))}else if(M==="l"||M==="D"){const C=/^([a-z]{3,9})\b/i.exec(_);(C&&Me[C[0].toLowerCase()])===M&&(T=We(_.slice(C[0].length),g[M],{...m,path:y+M}))}else if(M==="y"){const C=/^\d\d\b/.exec(_);if(C){const H=+C[0]>=30?+C[0]+1900:+C[0]+2e3;T=We(_.slice(C[0].length),g[M],{...m,year:H,path:y+M})}}else if(M==="Y"){const C=/^\d\d\d\d\b/.exec(_);C&&(T=We(_.slice(C[0].length),g[M],{...m,year:+C[0],path:y+M}))}else{if(M!=="x")throw new Error('Unknown date token "'.concat(M,'"'));{const C=Ye(_);C&&(T=We("",g[M],{...m,time:C.v,tf:C.z,path:y+M}))}}if(T)return T}}};function et(_,g){const m=We(_.trim(),F,{path:""});if(m){var y;if(m.sep==="."&&m.path.length===3)return null;const b=+((y=m.year)!==null&&y!==void 0?y:Ke);if(m.day||(m.day=1),!function(M,C,H){if(H<1||C<1||C>12)return!1;if(C===2){if(H>(M%4==0&&M%100!=0||M%400==0||M===1900?29:28))return!1}else if((C===4||C===6||C===9||C===11)&&H>30||(C===1||C===3||C===5||C===7||C===8||C===10||C===12)&&H>31)return!1;return!0}(b,m.month,m.day))return null;let N=-1/0;if(b<1900)return null;b<=1900&&m.month<=2?N=25568:b<1e4&&(N=25569);const T=Date.UTC(b,m.month-1,m.day)/864e5+N+(m.time||0);if(T>=0&&T<=2958465){const M=m._mon[0]==="0"||m.day[0]==="0"||m._mon.length===2&&m.day.length===2,C=m.path.replace(/[jdlDnmMFyYx-]/g,H=>H==="j"||H==="d"?M?"dd":"d":H==="D"?"ddd":H==="l"?"dddd":H==="n"||H==="m"?M?"mm":"m":H==="M"?"mmm":H==="F"?"mmmm":H==="y"?"yy":H==="x"?m.tf||"":H==="Y"?"yyyy":H);return g&&g.nativeDate?{v:He(T,g),z:C}:{v:T,z:C}}}return null}function Ye(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,m,y,b,N,T]=g;if(N&&!b||!T&&!y&&!b)return null;let M=1*(m||0);if(T){if(M>=13)return null;T[0]!=="p"&&T[0]!=="P"||(M+=12)}return{v:(60*M*60+60*(1*(y||0))+1*(b||0)+1*(N||0))/86400,z:(m.length===2?"hh":"h")+":mm"+(b?":ss":"")+(T?" AM/PM":"")}}return null}function ht(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const at={};function $t(_,g){const{pattern:m,partitions:y,locale:b}=_,N=C=>{const H=Object.assign({},D(),g,C);return b&&(H.locale=b),H},T=(C,H)=>{const ae=N(H);return function($,se,_e){const X=h(_e.locale),A=se[3]?se[3]:ve;if(typeof $=="boolean"&&($=$?"TRUE":"FALSE"),$==null)return"";if(typeof $!="number")return q($,A,_e,X);if(!isFinite($)){const ce=X||f;return isNaN($)?ce.nan:($<0?ce.negative:"")+ce.infinity}const W=re($,se);return W?q($,W,_e,X):_e.overflow}(Pe(C,ae),y,ae)};T.color=(C,H)=>function(ae,$){if(typeof ae!="number"||!isFinite(ae))return($[3]?$[3].color:ve.color)||ye;const se=re(ae,$);return se&&se.color||ye}(Pe(C,N(H)),y);const M=function(C){var H;let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[$,se]=C,_e=$.frac_max,X={type:"general",isDate:O(C),isText:U(C),isPercent:Ze(C),maxDecimals:$.general?9:_e,scale:(H=$.scale)!==null&&H!==void 0?H:1,color:0,parentheses:0,grouped:$.grouping?1:0,_partitions:C},A=!X.isDate&&!X.isText&&!$.error&&$.tokens.some(xe=>xe.type==="string"&&(ae?xe.value===ae:L.test(xe.value)));let W="G",ce=_e>=0?Math.min(15,_e):"",Re="",De="";if(se&&se.color&&(De="-",X.color=1),$.parens&&(Re="()",X.parentheses=1),A)W="C",X.type="currency";else if($.error)X.type="error",X.maxDecimals=0;else if(X.isDate){let xe=0,je=0,ft="";$.tokens.forEach(ue=>{const qe=ue.type;/^(b-)?year/.test(qe)?(ft+="Y",je++):qe.startsWith("month")?(ft+="M",je++):/^(week)?day/.test(qe)?(ft+="D",je++):qe!=="hour"&&qe!=="min"&&qe!=="sec"&&qe!=="am"||(ft+=qe[0],xe++)}),X.type="date",je&&xe?X.type="datetime":!je&&xe&&(X.type="time");const _t=ne.find(ue=>ft.startsWith(ue[0]));W=_t?"D":"G",ce=_t?_t[1]:""}else X.isText?(W="G",X.type="text",ce="",X.maxDecimals=0):$.general?(W="G",X.type="general",ce=""):$.fractions?(W="G",X.type="fraction",ce=""):$.exponential?(W="S",X.type="scientific"):X.isPercent?(W="P",X.type="percent"):$.grouping?(W=",",X.type="grouped"):($.int_max||_e)&&(W="F",X.type="number");return X.code=W+ce+De+Re,X.level=Q[X.type],Object.freeze(X)}(y,(g||{}).currency)||new SyntaxError;return T.info=M,T.dateInfo=function(C){const[H]=C;return{year:!!(2&H.date),month:!!(4&H.date),day:!!(8&H.date),hours:!!(16&H.date),minutes:!!(32&H.date),seconds:!!(64&H.date),clockType:H.clock===12?12:24}}(y),T.isPercent=()=>!!M.isPercent,T.isDate=()=>!!M.isDate,T.isText=()=>!!M.isText,T.pattern=m,_.error&&(T.error=_.error),T.options=N,T.locale=b||g&&g.locale||"",Object.freeze(T)}function Ue(_,g){_||(_="General");let m=null;return at[_]?m=at[_]:(m=Object.assign({},D(),g).throws?Z(_):function(y){try{return Z(y)}catch(b){const N={tokens:[{type:"error"}],error:b.message};return{pattern:y,partitions:[N,N,N,N],error:b.message,locale:null}}}(_),m.error||(at[_]=m)),$t(m,g)}Ue.isDate=_=>Ue(_,{throws:!1}).isDate(),Ue.isPercent=_=>Ue(_,{throws:!1}).isPercent(),Ue.isText=_=>Ue(_,{throws:!1}).isText(),Ue.getInfo=(_,g)=>Ue(_,{...g,throws:!1}).info,Ue.getDateInfo=(_,g)=>Ue(_,{...g,throws:!1}).dateInfo,Ue.dateToSerial=Pe,Ue.dateFromSerial=He,Ue.options=D,Ue.dec2frac=E,Ue.round=p,Ue.codeToLocale=s,Ue.parseLocale=l,Ue.getLocale=h,Ue.addLocale=(_,g)=>{const m=l(g);return delete at[m.lang],delete at[m.language],d(_,m)},Ue.format=function(_,g,m){let y=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const b=m&&typeof m=="object"?m:{locale:m,throws:!y};return Ue(_,b)(Pe(g,b),b)},Ue.is_date=Ue.isDate,Ue.parseNumber=It,Ue.parseDate=et,Ue.parseTime=Ye,Ue.parseBool=ht,Ue.parseValue=function(_,g){var m,y,b;return(m=(y=(b=It(_))!==null&&b!==void 0?b:et(_,g))!==null&&y!==void 0?y:Ye(_))!==null&&m!==void 0?m:ht(_)};var dt=Ue;return r=r.default}()})})(kl);var xp=kl.exports,Up=xp;const Pp=wt(Up),kp=Pp;function Zt(e){let n=0;const t=Object.keys(e);for(const r of t){const s=Number(r);n=Math.max(n,s)}return n+1}function Ls(e,n,t){const r=Zt(t),s=t;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=n}function xs(e,n,t){const r=Object.keys(t).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+n?delete t[s]:t[s]!==void 0&&(t[s-n]=t[s],delete t[s])}function Fp(e,n){const t=e,r=Object.keys(t),s=r.length,i=n,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]=t[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function $p(e,n,t){const r=t;if(Zt(t)>0){const i={};let o=0;for(let a=e;a<=n;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Us(e,n,t,r){const s=e>t;if(!s&&e+n>t)throw new Error("Invalid move operation");s?jp(e,n,t,r):Hp(e,n,t,r)}function jp(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e-1;o>=t;o--){const a=s[o];s[o+n]=a,a===void 0&&delete s[o+n]}i.forEach((o,a)=>{s[t+a]=o,o===void 0&&delete s[t+a]})}function Hp(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e+n;o<t;o++){const a=s[o];s[o-n]=a,a===void 0&&delete s[o-n]}i.forEach((o,a)=>{s[t+a-n]=o,o===void 0&&delete s[t+a-n]})}class Pt{constructor(n={}){v(this,"_matrix");this._setOriginValue(n)}static MakeObjectMatrixSize(n){return new Pt({[n-1]:{}})}getMatrix(){return this._matrix}forEach(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,o)===!1)return this}return this}forRow(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(n){const t=this._matrix;for(const r in t){const s=Number(r),i=t[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(n(s,a,l)===!1)return this}}return this}swapRow(n,t){const r=this._matrix[n],s=this._matrix[t];this._matrix[n]=s,this._matrix[t]=r}getRow(n){return this._matrix[n]}getRowOrCreate(n){let t=this.getRow(n);return t==null&&(t={},this._matrix[n]=t),t}reset(){this._setOriginValue({})}hasValue(){const n=this._matrix,t=Object.keys(n);if(t.length===0)return!1;for(const r of t){const s=Number(r),i=n[s];if(Object.keys(i).length>0)return!0}return!1}getValue(n,t){var r,s;return(s=(r=this._matrix)==null?void 0:r[n])==null?void 0:s[t]}setValue(n,t,r){const s=this.getRowOrCreate(n);s[t]=r}deleteValue(n,t){var r,s;(s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t]}realDeleteValue(n,t){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t],this.getRow(n)){const o=this.getRow(n);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[n])}}setRow(n,t){this._matrix[n]=t}moveRows(n,t,r){Us(n,t,r,this._matrix)}moveColumns(n,t,r){this.forEach((s,i)=>{Us(n,t,r,i)})}insertRows(n,t){for(let r=n;r<n+t;r++)Ls(r,{},this._matrix)}insertColumns(n,t){for(let r=n;r<n+t;r++)this.forEach((s,i)=>{i&&Ls(r,void 0,i)})}removeRows(n,t){xs(n,t,this._matrix)}removeColumns(n,t){this.forEach((r,s)=>{s&&xs(n,t,s)})}getFragment(n,t,r,s){const i=new Pt;let o=0;for(let a=n;a<=t;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(n,t,r,s){const i=new Pt;for(let o=n;o<=t;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,G.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Zt(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=Zt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const n=new Array;return this.forValue((t,r,s)=>{n.push(s)}),n}toArray(){const n=[];return this.forRow((t,r)=>{n[t]==null&&(n[t]=[]),r.forEach(s=>{n[t][s]=this.getValue(t,s)})}),n}toFullArray(){const n=this.getRange(),{endColumn:t,endRow:r}=n,s=[];for(let i=0;i<=r;i++){const o=new Array(t+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getData(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getArrayData(){let n=0,t=0,r=!1,s=!1;const i=new Pt;return this.forEach((o,a)=>{r||(r=!0,n=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<t&&(t=c):(s=!0,t=c);const h=this.getValue(o,c);i.setValue(o-n,c-t,h)})}),i.getData()}getStartEndScope(){let n=1/0,t=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(n=+i[0],t=+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:n,endRow:t,startColumn:r,endColumn:s}}getDataRange(){let n=0,t=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,n=a),l==null)return;const c=Zt(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<t&&(t=u):(o=!0,t=u)}),a>s&&(s=a)}),{startRow:n,startColumn:t,endRow:s,endColumn:r}}getDiscreteRanges(){const n=[];return this.forEach((t,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of n)if(t>=a.startRow&&t<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(t,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||n.push({startRow:t,endRow:t,startColumn:i,endColumn:i})})}),n}merge(n){this.forValue((t,r)=>{const s=n.getValue(t,r);s!=null&&this.setValue(t,r,s)})}_setOriginValue(n={}){this._matrix=n}}const Bp={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},Wp={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},Yp={startRow:0,startColumn:0,endRow:0,endColumn:0},zp={row:0,column:0},ct={ff:"Arial",fs:11,it:Te.FALSE,bl:Te.FALSE,ul:{s:Te.FALSE},st:{s:Te.FALSE},ol:{s:Te.FALSE},tr:{a:0,v:Te.FALSE},td:er.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Xt.UNSPECIFIED,vt:an.UNSPECIFIED,tb:cn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},Fl={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},Vp=[si,pa,ii];var $l=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))($l||{});function Rr(e,n){const{textRuns:t=[]}=n;let r=0;for(const i of t){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Te.FALSE;switch(e){case"bl":case"it":{if(o[e]===Te.FALSE)return Te.FALSE;break}case"ul":case"st":{if(o[e].s===Te.FALSE)return Te.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return n.dataStream.indexOf(`\r
7
- `)===r?Te.TRUE:Te.FALSE}const Qn=class Qn{constructor(n,t,r){v(this,"_range");v(this,"_worksheet");this._deps=r,this._range=t,this._worksheet=n}static foreach(n,t){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)t(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=[];for(let o=n;o<=t;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:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Pt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Pt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a-n,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=G.numToWord(r+1)+(n+1),o=G.numToWord(s+1)+(t+1)):(i=G.numToWord(s+1)+(t+1),o=G.numToWord(r+1)+(n+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ct.bg.rgb}))}getCell(n,t){const{startRow:r,startColumn:s}=this._range,i={startRow:r+n,endRow:r+n,startColumn:s+t,endColumn:s+t};return new Qn(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(n={}){return this.getObjectValues(n)[0][0]}getObjectValues(n={}){var a;const{startRow:t,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(t,r,s,i).getData();if(n.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-t;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 n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ct.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("ul",n.body)===Te.TRUE?{s:Te.TRUE}:{s:Te.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("st",n.body)===Te.TRUE?{s:Te.TRUE}:{s:Te.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var t,r;const n=((t=this.getValue())==null?void 0:t.p)||{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?n.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...n.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 t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("it",n.body)===Te.TRUE?kr.ITALIC:kr.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("bl",n.body)===Te.TRUE?Fr.BOLD:Fr.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:n,_worksheet:t}=this,{startRow:r,endRow:s}=n;let i=0;for(let o=0;o<=s-r;o++){const a=t.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:n,endColumn:t}=this._range;return t-n+1}getNumRows(){const{startRow:n,endRow:t}=this._range;return t-n+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(n=>n.map(t=>(t==null?void 0:t.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 n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>n.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:n,_worksheet:t}=this,{startColumn:r,endColumn:s}=n;let i=0;for(let o=0;o<=s-r;o++)i+=t.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===cn.WRAP?Te.TRUE:Te.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(n){Qn.foreach(this._range,n)}_getStyles(n){const t=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=t&&t.getStyleByCell(s);return i&&i[n]||ct[n]}))}};v(Qn,"transformRange",(n,t)=>{const r=t.getMaxColumns()-1,s=t.getMaxRows()-1;return n.rangeType===we.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:n.rangeType===we.COLUMN?{startRow:0,endRow:s,startColumn:n.startColumn,endColumn:n.endColumn}:n.rangeType===we.ROW?{startColumn:0,endColumn:r,startRow:n.startRow,endRow:n.endRow}:{startColumn:n.startColumn,endColumn:Math.min(n.endColumn,r),startRow:n.startRow,endRow:Math.min(n.endRow,s)}});let Tn=Qn;function Gp(e,n,t,r=!1){if(n===0&&t===0)return e;let s={...e};const i=s.startAbsoluteRefType||tt.NONE,o=s.endAbsoluteRefType||tt.NONE,a=s.rangeType||we.NORMAL;if(!r&&i===tt.ALL&&o===tt.ALL)return s;const l=vo(s.startRow,t,s.startColumn,n,a),c=vo(s.endRow,t,s.endColumn,n,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 vo(e,n,t,r,s){return s===we.NORMAL?{row:e+n,column:t+r}:s===we.ROW?{row:e+n,column:t}:s===we.COLUMN?{row:e,column:t+r}:{row:e,column:t}}function pi(e){const n=new Set,t=new Set;for(const o of e)n.add(o.startColumn),n.add(o.endColumn+1),t.add(o.startRow),t.add(o.endRow+1);const r=Array.from(n).sort((o,a)=>o-a),s=Array.from(t).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 d of e){if(d.startRow>u)break;if(d.startRow<=h&&d.endRow>=u&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function Kp(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const n={};for(const r of e)n[r.startRow]||(n[r.startRow]=[]),n[r.startRow].push(r);const t=[];for(const r in n){const s=n[+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):(t.push(i),i=a)}t.push(i)}return t}function Xp(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const n={};for(const r of e)n[r.startColumn]||(n[r.startColumn]=[]),n[r.startColumn].push(r);const t=[];for(const r in n){const s=n[+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):(t.push(i),i=a)}t.push(i)}return t}function Qp(e){const n=pi(e),t=Kp(n);return Xp(t)}function Jp(e,n){const t=[];return e.forEach(r=>{t.push(...en.subtract(r,n))}),en.mergeRanges(t)}function Zp(e,n){const t=Ro(e.startRow,e.endRow,n.startRow,n.endRow),r=Ro(e.startColumn,e.endColumn,n.startColumn,n.endColumn);if(!t||!r)return null;const[s,i]=t,[o,a]=r,l=qp(e.rangeType,n.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Ro(e,n,t,r){const s=isNaN(e)?-1/0:e,i=isNaN(n)?1/0:n,o=isNaN(t)?-1/0:t,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 qp(e,n,t,r,s,i){const o=e!==void 0?e:Io(t,r,s,i),a=n!==void 0?n:Io(t,r,s,i);return o===we.ALL||a===we.ALL?o===a?o:o===we.ALL?a:o:o===a?o:(o===we.NORMAL||a===we.NORMAL,we.NORMAL)}function Io(e,n,t,r){const s=!isNaN(e)&&!isNaN(n),i=!isNaN(t)&&!isNaN(r);return s&&i?we.NORMAL:s?we.ROW:i?we.COLUMN:we.ALL}const Ht=class Ht{static clone(n){return n.rangeType!==void 0?{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn,rangeType:n.rangeType}:{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn}}static equals(n,t){return n==null||t==null?!1:n.endRow===t.endRow&&n.endColumn===t.endColumn&&n.startRow===t.startRow&&n.startColumn===t.startColumn&&(n.rangeType===t.rangeType||n.rangeType===void 0&&t.rangeType===we.NORMAL||t.rangeType===void 0&&n.rangeType===we.NORMAL)}static simpleRangesIntersect(n,t){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=n,{startRow:a,endRow:l,startColumn:c,endColumn:h}=t,u=r<=l&&s>=a,d=i<=h&&o>=c;return u&&d}static intersects(n,t){if(n.rangeType===we.ROW&&t.rangeType===we.COLUMN||n.rangeType===we.COLUMN&&t.rangeType===we.ROW)return!0;if(n.rangeType===we.ROW&&t.rangeType===we.ROW)return n.startRow<=t.endRow&&n.endRow>=t.startRow;if(n.rangeType===we.COLUMN&&t.rangeType===we.COLUMN)return n.startColumn<=t.endColumn&&n.endColumn>=t.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(n.startRow)?0:n.startRow,i=Number.isNaN(n.endRow)?r:n.endRow,o=Number.isNaN(n.startColumn)?0:n.startColumn,a=Number.isNaN(n.endColumn)?r:n.endColumn,l=Number.isNaN(t.startRow)?0:t.startRow,c=Number.isNaN(t.endRow)?r:t.endRow,h=Number.isNaN(t.startColumn)?0:t.startColumn,u=Number.isNaN(t.endColumn)?r:t.endColumn,d=Math.abs(o+a-h-u),f=Math.abs(o-a)+Math.abs(h-u),p=Math.abs(s+i-l-c),E=Math.abs(s-i)+Math.abs(l-c);return d<=f&&p<=E}static getIntersects(n,t){const r=n.startRow,s=n.endRow,i=n.startColumn,o=n.endColumn,a=t.startRow,l=t.endRow,c=t.startColumn,h=t.endColumn;let u,d,f,p;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?p=s:p=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?f=o:f=h;else return null;return{startRow:d,endRow:p,startColumn:u,endColumn:f,rangeType:we.NORMAL}}static contains(n,t){return n.startRow<=t.startRow&&n.endRow>=t.endRow&&n.startColumn<=t.startColumn&&n.endColumn>=t.endColumn}static realContain(n,t){return Ht.contains(n,t)&&(n.startRow<t.startRow||n.endRow>t.endRow||n.startColumn<t.startColumn||n.endColumn>t.endColumn)}static union(...n){return n.reduce((t,r)=>({startRow:Math.min(t.startRow,r.startRow),startColumn:Math.min(t.startColumn,r.startColumn),endRow:Math.max(t.endRow,r.endRow),endColumn:Math.max(t.endColumn,r.endColumn),rangeType:we.NORMAL}),n[0])}static realUnion(...n){const t=n.some(i=>i.rangeType===we.COLUMN),r=n.some(i=>i.rangeType===we.ROW),s=Ht.union(...n);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:t?Number.NaN:s.startRow,endRow:t?Number.NaN:s.endRow,rangeType:r?we.ROW:t?we.COLUMN:we.NORMAL}}static subtract(n,t){if(t.startRow>n.endRow||t.endRow<n.startRow||t.startColumn>n.endColumn||t.endColumn<n.startColumn)return[n];const r=[];t.startRow>=n.startRow&&r.push({startRow:n.startRow,startColumn:n.startColumn,endRow:t.startRow-1,endColumn:n.endColumn}),t.endRow<=n.endRow&&r.push({startRow:t.endRow+1,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn});const s=Math.max(n.startRow,t.startRow),i=Math.min(n.endRow,t.endRow);return t.startColumn>=n.startColumn&&r.push({startRow:s,startColumn:n.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=n.endColumn&&r.push({startRow:s,startColumn:t.endColumn+1,endRow:i,endColumn:n.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(n){return Qp(n)}static splitIntoGrid(n){return pi(n)}static subtractMulti(n,t){if(!t.length)return n;let r=n;return t.forEach(s=>{r=Jp(r,s)}),r}static hasIntersectionBetweenTwoRect(n,t){return!(n.left>t.right||n.right<t.left||n.top>t.bottom||n.bottom<t.top)}static getIntersectionBetweenTwoRect(n,t){const r=Math.max(n.left,t.left),s=Math.min(n.right,t.right),i=Math.max(n.top,t.top),o=Math.min(n.bottom,t.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(n){return n.sort((t,r)=>t.startRow-r.startRow||t.startColumn-r.startColumn)}};v(Ht,"getRelativeRange",(n,t)=>({startRow:n.startRow-t.startRow,endRow:n.endRow-n.startRow,startColumn:n.startColumn-t.startColumn,endColumn:n.endColumn-n.startColumn})),v(Ht,"getPositionRange",(n,t,r)=>({...r||{},startRow:r&&[tt.ROW,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:n.startRow+t.startRow,endRow:r&&[tt.ROW,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:n.endRow+n.startRow+t.startRow,startColumn:r&&[tt.COLUMN,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:n.startColumn+t.startColumn,endColumn:r&&[tt.COLUMN,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:n.endColumn+n.startColumn+t.startColumn})),v(Ht,"moveHorizontal",(n,t=0,r=0)=>({...n,startColumn:n.startColumn+t,endColumn:n.endColumn+t+r})),v(Ht,"moveVertical",(n,t=0,r=0)=>({...n,startRow:n.startRow+t,endRow:n.endRow+t+r})),v(Ht,"moveOffset",(n,t,r)=>({...n,startRow:n.startRow+r,endRow:n.endRow+r,startColumn:n.startColumn+t,endColumn:n.endColumn+t}));let en=Ht;function e_(e,n){if(e.length===0||e[0].length===0)return null;const t=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++)t[a]=n(e[i][a])?t[a]+1:0;const o=t_(t);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function t_(e){const n=[];let t=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(n.length===0||e[s]>=e[n[n.length-1]])n.push(s++);else{const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}for(;n.length>0;){const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}return r}function n_(e,n){Tn.foreach(n,(t,r)=>{e[t][r]=void 0})}function r_(e,n){const t=e.toFullArray(),r=[];for(;;){const s=e_(t,n);if(!s)break;r.push(s),n_(t,s)}return r}class s_{constructor(n,t){v(this,"_values",[]);v(this,"_keys",[]);v(this,"_keyMaps",new Map);this._values=n,this._keys=t,n.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(n){this._keys.forEach(t=>{const r=n[t],s=this._keyMaps.get(t)||new Map;s.set(r,n),this._keyMaps.set(t,s)})}getValue(n,t){const r=t||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(n))return i.get(n)}return null}hasValue(n){for(let t=0;t<this._keys.length;t++){const r=this._keyMaps.get(this._keys[t]);if(r!=null&&r.has(n))return!0}return!1}addValue(n){this._values.push(n),this._initKeyMap(n)}setValue(n,t,r){const s=this.getValue(n);s&&Object.keys(s).includes(t)&&(s[t]=r)}deleteValue(n,t){const r=this.getValue(n,t);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(n){var t;return[...((t=this._keyMaps.get(n))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Ps(e,n,t,r){return{forEach(s){for(let i=e;i<=n;i++)for(let o=t;o<=r;o++)s(i,o)}}}function i_(e){if(e==null||e.length===0)return Number.NaN;const n=e.toLowerCase().split(""),t=n.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<t;o++)i=r(n[o]),s+=i*26**(t-o-1);return s===0?Number.NaN:s-1}const Br=65,jl=90,o_=97;function a_(e){const n=jl-Br+1;let t="";for(;e>=0;)t=String.fromCharCode(e%n+Br)+t,e=Math.floor(e/n)-1;return t}function Hl(e,n){let t="";for(;n>0;)t+=e,n--;return t}function l_(e,n=!1){const t=jl-Br+1;let r=o_;n&&(r=Br);const s=String.fromCharCode(e%t+r),i=Math.floor(e/t)+1;return Hl(s,i)}function u_(e,n){return e.zIndex>n.zIndex?1:e.zIndex===n.zIndex?0:-1}function c_(e,n){return e.zIndex>n.zIndex?-1:e.zIndex===n.zIndex?0:1}function fr(e="index",n=1){return(t,r)=>t[e]>r[e]?n:t[e]===r[e]?0:-n}var ke=(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))(ke||{}),xt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(xt||{}),ks=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(ks||{});class ts extends rt{}function h_(e=G.generateRandomId(6),n=dr.EN_US,t=""){return{id:e,locale:n,title:t,body:{dataStream:`\r
8
- `,textRuns:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},settings:{}}}var mt={},Bl={},_i={};Object.defineProperty(_i,"__esModule",{value:!0});function d_(e,n){if(Array.isArray(n))return!1;for(let t in e)if(!Ei(e[t],n[t]))return!1;for(let t in n)if(e[t]===void 0)return!1;return!0}function f_(e,n){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Ei(e[t],n[t]))return!1;return!0}function Ei(e,n){return e===n?!0:e===null||n===null||typeof e!="object"||typeof n!="object"?!1:Array.isArray(e)?f_(e,n):d_(e,n)}_i.default=Ei;var Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});function Fs(e){if(e===null)return null;if(Array.isArray(e))return e.map(Fs);if(typeof e=="object"){const n={};for(let t in e)n[t]=Fs(e[t]);return n}else return e}Ci.default=Fs;var vi={};(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 n(h,u){if(!h)throw new Error(u)}const t=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 d in h){const f=d;u.write(f,h[f])}}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(){n(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):(n(this.idx>0),this.idx--,t(this.container[this.idx])&&this.idx--)}getPath(){const u=[];let d=this.container,f=this.parents.length-1,p=this.idx;for(;p>=0;)u.unshift(d[p]),p===0?(p=this.indexes[f*2],d=this.parents[f--]):p-=t(d[p-1])?2:1;return u}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return n(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&&t(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||t(this.container[u])&&u+1>=this.container.length)return!1;t(this.container[u])&&u++;const d=this.container[u];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=d):this.idx=u,!0}nextSibling(){if(n(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,d=this.parents[this.parents.length-1];return u>=d.length?!1:(n(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=d[u],!0)}_init(u,d,f,p){this.container=u,this.idx=d,this.parents=f.slice(),this.indexes=p.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,d){const f=this.getComponent();f&&d(f,u);for(const p of this)u&&u.descend(p),this.traverse(u,d),u&&u.ascend()}eachPick(u,d){this.traverse(u,(f,p)=>{f.p!=null&&d(f.p,p)})}eachDrop(u,d){this.traverse(u,(f,p)=>{f.d!=null&&d(f.d,p)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){n(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const d=this.pendingDescent[u];let f=this.idx+1;if(f<this.container.length&&t(this.container[f])&&f++,n(f===this.container.length||!t(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const p=this.container.splice(f,this.container.length-f);this.container.push(p),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(n(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const p=[d];this.container.splice(f,0,p),this.container=p}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&t(this.container[u]))return this.container[u];{const d={};return this.container.splice(u,0,d),d}}write(u,d){const f=this.getComponent();n(f[u]==null||f[u]===d,"Internal consistency error: Overwritten component. File a bug"),f[u]=d}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,d=s){if(u===null)return;if(n(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,p=this.parents.length;let E=0;for(let R=0;R<u.length;R++){const I=u[R];typeof I=="string"||typeof I=="number"?(E++,this.descend(I)):Array.isArray(I)?this.mergeTree(I,d):typeof I=="object"&&d(I,this)}for(;E--;)this.ascend();this.lcIdx=this.parents.length===p?f:-1}at(u,d){this.descendPath(u),d(this);for(let f=0;f<u.length;f++)this.ascend();return this}writeAtPath(u,d,f){return this.at(u,()=>this.write(d,f)),this.reset(),this}writeMove(u,d,f=0){return this.writeAtPath(u,"p",f).writeAtPath(d,"d",f)}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,d){let f,p;p=f=h?h.descendFirst():!1;function E(R){let I;for(;p;){const D=I=h.getKey();if(R!=null){let x=!1;if(u&&typeof D=="number"&&(I=u(D,h.getComponent()),I<0&&(I=~I,x=!0)),r(I,R))return null;if(I===R&&!x)return h}d&&typeof I=="number"&&d(I,h.getComponent()),p=h.nextSibling()}return null}return E.end=()=>{f&&h.ascend()},E}e.advancer=l;function c(h,u,d){let f,p,E,R;for(f=p=h&&h.descendFirst(),E=R=u&&u.descendFirst();f||E;){let I=f?h.getKey():null,D=E?u.getKey():null;I!==null&&D!==null&&(r(D,I)?D=null:I!==D&&(I=null)),d(I==null?D:I,I!=null?h:null,D!=null?u:null),I!=null&&f&&(f=h.nextSibling()),D!=null&&E&&(E=u.nextSibling())}p&&h.ascend(),R&&u.ascend()}e.eachChildOf=c})(vi);var Ri={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(n){n[n.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",n[n.DROP_COLLISION=2]="DROP_COLLISION",n[n.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))})(Ri);var cs={},on={},So;function Ii(){return So||(So=1,Object.defineProperty(on,"__esModule",{value:!0}),on.uniToStrPos=on.strPosToUni=void 0,on.strPosToUni=(e,n=e.length)=>{let t=0,r=0;for(;r<n;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(t++,r++)}if(r!==n)throw Error("Invalid offset - splits unicode bytes");return r-t},on.uniToStrPos=(e,n)=>{let t=0;for(;n>0;n--){const r=e.charCodeAt(t);t+=r>=55296&&r<=57343?2:1}return t}),on}var hs={},Oo;function $s(){return Oo||(Oo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const n=Ii(),t=w=>{if(!Array.isArray(w))throw Error("Op must be an array of components");let S=null;for(let L=0;L<w.length;L++){const j=w[L];switch(typeof j){case"object":if(typeof j.d!="number"&&typeof j.d!="string")throw Error("Delete must be number or string");if(e.dlen(j.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(j.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(j>0))throw Error("Skip components must be >0");if(typeof S=="number")throw Error("Adjacent skip components should be combined");break}S=j}if(typeof S=="number")throw Error("Op has a trailing skip")};function r(w,S){let L=0,j=0;for(let le=0;le<w.length;le++){const ee=w[le];switch(S(ee,L,j),typeof ee){case"object":L+=e.dlen(ee.d);break;case"string":j+=n.strPosToUni(ee);break;case"number":L+=ee,j+=ee;break}}}e.eachOp=r;function s(w,S){const L=[],j=a(L);return r(w,(le,ee,ie)=>{j(S(le,ee,ie))}),u(L)}const i=w=>w,o=w=>s(w,i);e.dlen=w=>typeof w=="number"?w:n.strPosToUni(w);const a=w=>S=>{if(!(!S||S.d===0||S.d===""))if(w.length===0)w.push(S);else if(typeof S==typeof w[w.length-1])if(typeof S=="object"){const L=w[w.length-1];L.d=typeof L.d=="string"&&typeof S.d=="string"?L.d+S.d:e.dlen(L.d)+e.dlen(S.d)}else w[w.length-1]+=S;else w.push(S)},l=w=>typeof w=="number"?w:typeof w=="string"?n.strPosToUni(w):typeof w.d=="number"?w.d:n.strPosToUni(w.d);e.uniSlice=(w,S,L)=>{const j=n.uniToStrPos(w,S),le=L==null?1/0:n.uniToStrPos(w,L);return w.slice(j,le)};const c=(w,S,L)=>typeof w=="number"?L==null?w-S:Math.min(w,L)-S:e.uniSlice(w,S,L),h=w=>{let S=0,L=0;return{take:(ee,ie)=>{if(S===w.length)return ee===-1?null:ee;const be=w[S];let Ae;if(typeof be=="number")return ee===-1||be-L<=ee?(Ae=be-L,++S,L=0,Ae):(L+=ee,ee);if(typeof be=="string"){if(ee===-1||ie==="i"||n.strPosToUni(be.slice(L))<=ee)return Ae=be.slice(L),++S,L=0,Ae;{const Z=L+n.uniToStrPos(be.slice(L),ee);return Ae=be.slice(L,Z),L=Z,Ae}}else{if(ee===-1||ie==="d"||e.dlen(be.d)-L<=ee)return Ae={d:c(be.d,L)},++S,L=0,Ae;{let Z=c(be.d,L,L+ee);return L+=ee,{d:Z}}}},peek:()=>w[S]}},u=w=>(w.length>0&&typeof w[w.length-1]=="number"&&w.pop(),w);function d(w,S,L){if(L!=="left"&&L!=="right")throw Error("side ("+L+") must be 'left' or 'right'");t(w),t(S);const j=[],le=a(j),{take:ee,peek:ie}=h(w);for(let Ae=0;Ae<S.length;Ae++){const Z=S[Ae];let k,z;switch(typeof Z){case"number":for(k=Z;k>0;)z=ee(k,"i"),le(z),typeof z!="string"&&(k-=l(z));break;case"string":L==="left"&&typeof ie()=="string"&&le(ee(-1)),le(n.strPosToUni(Z));break;case"object":for(k=e.dlen(Z.d);k>0;)switch(z=ee(k,"i"),typeof z){case"number":k-=z;break;case"string":le(z);break;case"object":k-=e.dlen(z.d)}break}}let be;for(;be=ee(-1);)le(be);return u(j)}function f(w,S){t(w),t(S);const L=[],j=a(L),{take:le}=h(w);for(let ie=0;ie<S.length;ie++){const be=S[ie];let Ae,Z;switch(typeof be){case"number":for(Ae=be;Ae>0;)Z=le(Ae,"d"),j(Z),typeof Z!="object"&&(Ae-=l(Z));break;case"string":j(be);break;case"object":Ae=e.dlen(be.d);let k=0;for(;k<Ae;)switch(Z=le(Ae-k,"d"),typeof Z){case"number":j({d:c(be.d,k,k+Z)}),k+=Z;break;case"string":k+=n.strPosToUni(Z);break;case"object":j(Z)}break}}let ee;for(;ee=le(-1);)j(ee);return u(L)}const p=(w,S)=>{let L=0;for(let j=0;j<S.length&&w>L;j++){const le=S[j];switch(typeof le){case"number":{L+=le;break}case"string":const ee=n.strPosToUni(le);L+=ee,w+=ee;break;case"object":w-=Math.min(e.dlen(le.d),w-L);break}}return w},E=(w,S)=>typeof w=="number"?p(w,S):w.map(L=>p(L,S));function R(w,S,L){return s(w,(j,le)=>typeof j=="object"&&typeof j.d=="number"?{d:L.slice(S,le,le+j.d)}:j)}function I(w){return s(w,S=>{switch(typeof S){case"object":if(typeof S.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return S.d;case"string":return{d:S};case"number":return S}})}function D(w){return s(w,S=>typeof S=="object"&&typeof S.d=="string"?{d:n.strPosToUni(S.d)}:S)}function x(w){let S=!0;return r(w,L=>{typeof L=="object"&&typeof L.d=="number"&&(S=!1)}),S}function B(w){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,normalize:o,checkOp:t,create(S=""){if(typeof S!="string")throw Error("Initial data must be a string");return w.create(S)},apply(S,L){t(L);const j=w.builder(S);for(let le=0;le<L.length;le++){const ee=L[le];switch(typeof ee){case"number":j.skip(ee);break;case"string":j.append(ee);break;case"object":j.del(e.dlen(ee.d));break}}return j.build()},transform:d,compose:f,transformPosition:p,transformSelection:E,isInvertible:x,makeInvertible(S,L){return R(S,L,w)},stripInvertible:D,invert:I,invertWithDoc(S,L){return I(R(S,L,w))},isNoop:S=>S.length===0}}e.default=B}(hs)),hs}var Ir={},yo;function g_(){if(yo)return Ir;yo=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=$s(),n=Ii();function t(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=n.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=n.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 Ir.default=t,t.provides={text:!0},Ir}var wo;function m_(){return wo||(wo=1,function(e){var n=Qe&&Qe.__createBinding||(Object.create?function(d,f,p,E){E===void 0&&(E=p),Object.defineProperty(d,E,{enumerable:!0,get:function(){return f[p]}})}:function(d,f,p,E){E===void 0&&(E=p),d[E]=f[p]}),t=Qe&&Qe.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Qe&&Qe.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var p in d)Object.hasOwnProperty.call(d,p)&&n(f,d,p);return t(f,d),f},s=Qe&&Qe.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Ii(),o=r($s()),a=s(g_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(p){let E=i.uniToStrPos(d,p);if(E>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,E)),d=d.slice(E)},append(p){f.push(p)},del(p){d=d.slice(i.uniToStrPos(d,p))},build(){return f.join("")+d}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{api:a.default});e.type=h,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var u=$s();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(cs)),cs}(function(e){var n=Qe&&Qe.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const t=n(_i),r=n(Ci),s=vi,i=Ri;function o(O,U){if(!O)throw new Error(U)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:O=>O,isNoop:O=>O==null,setDebug(O){},registerSubtype:I,checkValidOp:le,normalize:ee,apply:ie,transformPosition:be,compose:Ae,tryTransform:Ce,transform:Ne,makeInvertible:z,invert:Z,invertWithDoc:me,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(O,U,Q)=>Ze(()=>!0,O,U,Q),typeAllowingConflictsPred:O=>Object.assign(Object.assign({},e.type),{transform:(U,Q,ne)=>Ze(O,U,Q,ne)})};const a=O=>O?O.getComponent():null;function l(O){return O&&typeof O=="object"&&!Array.isArray(O)}const c=O=>Array.isArray(O)?O.slice():O!==null&&typeof O=="object"?Object.assign({},O):O,h=O=>O&&(O.p!=null||O.r!==void 0),u=O=>O&&(O.d!=null||O.i!==void 0);function d(O,U){return o(O!=null),typeof U=="number"?(o(Array.isArray(O),"Invalid key - child is not an array"),(O=O.slice()).splice(U,1)):(o(l(O),"Invalid key - child is not an object"),delete(O=Object.assign({},O))[U]),O}function f(O,U,Q){return typeof U=="number"?(o(O!=null,"Container is missing for key"),o(Array.isArray(O),"Cannot use numerical key for object container"),o(O.length>=U,"Cannot insert into out of bounds index"),O.splice(U,0,Q)):(o(l(O),"Cannot insert into missing item"),o(O[U]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),O[U]=Q),Q}e.removeOp=(O,U=!0)=>s.writeCursor().writeAtPath(O,"r",U).get(),e.moveOp=(O,U)=>s.writeCursor().writeMove(O,U).get(),e.insertOp=(O,U)=>s.writeCursor().writeAtPath(O,"i",U).get(),e.replaceOp=(O,U,Q)=>s.writeCursor().at(O,ne=>{ne.write("r",U),ne.write("i",Q)}).get(),e.editOp=(O,U,Q,ne=!1)=>s.writeCursor().at(O,K=>S(K,U,Q,ne)).get();const p=(O,U)=>O!=null&&(typeof U=="number"?Array.isArray(O):typeof O=="object"),E=(O,U)=>p(O,U)?O[U]:void 0,R={};function I(O){let U=O.type?O.type:O;U.name&&(R[U.name]=U),U.uri&&(R[U.uri]=U)}const D=O=>{const U=R[O];if(U)return U;throw Error("Missing type: "+O)};I(m_());const x=(O,U)=>O+U;I({name:"number",apply:x,compose:x,invert:O=>-O,transform:O=>O});const B=O=>O==null?null:O.et?D(O.et):O.es?R["text-unicode"]:O.ena!=null?R.number:null,w=O=>O.es?O.es:O.ena!=null?O.ena:O.e,S=(O,U,Q,ne=!1)=>{const[K,V]=typeof U=="string"?[D(U),U]:[U,U.name];!ne&&K.isNoop&&K.isNoop(Q)||(V==="number"?O.write("ena",Q):V==="text-unicode"?O.write("es",Q):(O.write("et",V),O.write("e",Q)))};function L(O){o(typeof O=="number"),o(O>=0),o(O===(0|O))}function j(O){typeof O=="number"?L(O):o(typeof O=="string")}function le(O){if(O===null)return;const U=new Set,Q=new Set,ne=V=>{let fe=!0,de=!1;for(let P in V){const J=V[P];if(fe=!1,o(P==="p"||P==="r"||P==="d"||P==="i"||P==="e"||P==="es"||P==="ena"||P==="et","Invalid component item '"+P+"'"),P==="p")L(J),o(!U.has(J)),U.add(J),o(V.r===void 0);else if(P==="d")L(J),o(!Q.has(J)),Q.add(J),o(V.i===void 0);else if(P==="e"||P==="es"||P==="ena"){o(!de),de=!0;const q=B(V);o(q,"Missing type in edit"),q.checkValidOp&&q.checkValidOp(w(V))}}o(!fe)},K=(V,fe,de)=>{if(!Array.isArray(V))throw Error("Op must be null or a list");if(V.length===0)throw Error("Empty descent");fe||j(V[0]);let P=1,J=0,q=0;for(let re=0;re<V.length;re++){const ve=V[re];if(o(ve!=null),Array.isArray(ve)){const ye=K(ve,!1);if(J){const F=typeof q,he=typeof ye;F===he?o(q<ye,"descent keys are not in order"):o(F==="number"&&he==="string")}q=ye,J++,P=3}else typeof ve=="object"?(o(P===1,`Prev not scalar - instead ${P}`),ne(ve),P=2):(o(P!==3),j(ve),o(s.isValidPathItem(ve),"Invalid path key"),P=1)}return o(J!==1,"Operation makes multiple descents. Remove some []"),o(P===2||P===3),V[0]};K(O,!0),o(U.size===Q.size,"Mismatched picks and drops in op");for(let V=0;V<U.size;V++)o(U.has(V)),o(Q.has(V))}function ee(O){let U=0,Q=[];const ne=s.writeCursor();return ne.mergeTree(O,(K,V)=>{const fe=B(K);if(fe){const P=w(K);S(V,fe,fe.normalize?fe.normalize(P):P)}for(const P of["r","p","i","d"])if(K[P]!==void 0){const J=P==="p"||P==="d"?(de=K[P],Q[de]==null&&(Q[de]=U++),Q[de]):K[P];V.write(P,J)}var de}),ne.get()}function ie(O,U){if(le(U),U===null)return O;const Q=[];return function ne(K,V){let fe=K,de=0,P={root:K},J=0,q=P,re="root";function ve(){for(;J<de;J++){let ye=V[J];typeof ye!="object"&&(o(p(q,re)),q=q[re]=c(q[re]),re=ye)}}for(;de<V.length;de++){const ye=V[de];if(Array.isArray(ye)){const F=ne(fe,ye);F!==fe&&F!==void 0&&(ve(),fe=q[re]=F)}else if(typeof ye=="object"){ye.d!=null?(ve(),fe=f(q,re,Q[ye.d])):ye.i!==void 0&&(ve(),fe=f(q,re,ye.i));const F=B(ye);if(F)ve(),fe=q[re]=F.apply(fe,w(ye));else if(ye.e!==void 0)throw Error("Subtype "+ye.et+" undefined")}else fe=E(fe,ye)}return P.root}(O=function ne(K,V){const fe=[];let de=0;for(;de<V.length;de++){const re=V[de];if(Array.isArray(re))break;typeof re!="object"&&(fe.push(K),K=E(K,re))}for(let re=V.length-1;re>=de;re--)K=ne(K,V[re]);for(--de;de>=0;de--){const re=V[de];if(typeof re!="object"){const ve=fe.pop();K=K===E(ve,re)?ve:K===void 0?d(ve,re):(J=re,q=K,(P=c(P=ve))[J]=q,P)}else h(re)&&(o(K!==void 0,"Cannot pick up or remove undefined"),re.p!=null&&(Q[re.p]=K),K=void 0)}var P,J,q;return K}(O,U),U)}function be(O,U){O=O.slice(),le(U);const Q=s.readCursor(U);let ne,K,V=!1;const fe=[];for(let P=0;;P++){const J=O[P],q=Q.getComponent();if(q&&(q.r!==void 0?V=!0:q.p!=null&&(V=!1,ne=q.p,K=P)),P>=O.length)break;let re=0;const ve=s.advancer(Q,void 0,(F,he)=>{h(he)&&re++});fe.unshift(ve);const ye=ve(J);if(typeof J=="number"&&(O[P]-=re),!ye)break}if(fe.forEach(P=>P.end()),V)return null;const de=()=>{let P=0;if(ne!=null){const J=Q.getPath();P=J.length,O=J.concat(O.slice(K))}for(;P<O.length;P++){const J=O[P],q=a(Q),re=B(q);if(re){const F=w(q);re.transformPosition&&(O[P]=re.transformPosition(O[P],F));break}let ve=0;const ye=s.advancer(Q,(F,he)=>u(he)?~(F-ve):F-ve,(F,he)=>{u(he)&&ve++})(J);if(typeof J=="number"&&(O[P]+=ve),!ye)break}};return ne!=null?Q.eachDrop(null,P=>{P===ne&&de()}):de(),O}function Ae(O,U){if(le(O),le(U),O==null)return U;if(U==null)return O;let Q=0;const ne=s.readCursor(O),K=s.readCursor(U),V=s.writeCursor(),fe=[],de=[],P=[],J=[],q=[],re=[],ve=new Set;ne.traverse(null,F=>{F.p!=null&&(P[F.p]=ne.clone())}),K.traverse(null,F=>{F.d!=null&&(J[F.d]=K.clone())});const ye=s.writeCursor();return function F(he,Be,$e,Me,Ke,It,We,et){o(Be||$e);const Ye=a(Be),ht=a($e),at=!!ht&&ht.r!==void 0,$t=!!Ye&&Ye.i!==void 0,Ue=Ye?Ye.d:null,dt=ht?ht.p:null,_=(It||at)&&dt==null;if(dt!=null)Me=J[dt],We=de[dt]=new s.WriteCursor;else if(ht&&ht.r!==void 0)Me=null;else{const A=a(Me);A&&A.d!=null&&(Me=null)}const g=a(Me);if(Ue!=null)if(he=P[Ue],et=fe[Ue]=new s.WriteCursor,_)It&&!at&&et.write("r",!0);else{const A=q[Ue]=Q++;We.write("d",A)}else if(Ye&&Ye.i!==void 0)he=null;else{const A=a(he);A&&A.p!=null&&(he=null)}let m;$t?(o(Ke===void 0),m=Ye.i):m=Ke;const y=(dt==null?!$t||It||at:m===void 0)?null:We.getComponent();if(dt!=null){if(!(Ke!==void 0||$t)){const A=Ue!=null?q[Ue]:Q++;re[dt]=A,et.write("p",A)}}else at&&($t||Ke!==void 0||(ht.r,et.write("r",ht.r)));const b=_?null:B(Ye),N=B(g);if((b||N)&&(b&&b.name,N&&N.name),b&&N){o(b===N);const A=w(Ye),W=w(g),ce=b.compose(A,W);S(We,b,ce),ve.add(g)}else b?S(We,b,w(Ye)):N&&(S(We,N,w(g)),ve.add(g));const T=typeof m=="object"&&m!=null;let M=!1,C=0,H=0,ae=0,$=0,se=0;const _e=s.advancer(Me,(A,W)=>u(W)?$-A-1:A-$,(A,W)=>{u(W)&&$++}),X=s.advancer(he,(A,W)=>h(W)?C-A-1:A-C,(A,W)=>{h(W)&&C++});if(s.eachChildOf(Be,$e,(A,W,ce)=>{let Re,De,xe=A,je=A,ft=A;if(typeof A=="number"){let Oe=A+ae;De=_e(Oe),je=Oe+$;let Y=A+H;Re=X(Y),u(a(De))&&(Re=null),xe=Y+C,ft=A+se,o(xe>=0,"p1PickKey is negative"),o(je>=0,"p2DropKey is negative");const ut=u(a(W)),Fe=h(a(ce));(ut||Fe&&!_)&&se--,ut&&H--,Fe&&ae--}else Re=X(A),De=_e(A);et.descend(xe),We.descend(je);const _t=T&&!u(a(W))?m[ft]:void 0,ue=F(Re,W,ce,De,_t,_,We,et);var qe,pe,ge;T&&!_?_t!==ue&&(M||(m=Array.isArray(m)?m.slice():Object.assign({},m),M=!0),qe=m,ge=ue,typeof(pe=ft)=="number"?(o(Array.isArray(qe)),o(pe<qe.length)):(o(!Array.isArray(qe)),o(qe[pe]!==void 0)),ge===void 0?typeof pe=="number"?qe.splice(pe,1):delete qe[pe]:qe[pe]=ge):o(ue===void 0),We.ascend(),et.ascend()}),X.end(),_e.end(),y!=null)y.i=m;else if(!It&&!at&&dt==null)return m}(ne,ne.clone(),K,K.clone(),void 0,!1,V,ye),V.reset(),V.mergeTree(ye.get()),V.reset(),V.get(),fe.map(F=>F.get()),de.map(F=>F.get()),ne.traverse(V,(F,he)=>{const Be=F.p;if(Be!=null){const $e=q[Be];$e!=null&&he.write("p",$e);const Me=fe[Be];Me&&Me.get(),Me&&he.mergeTree(Me.get())}else F.r!==void 0&&he.write("r",F.r)}),V.reset(),V.get(),K.traverse(V,(F,he)=>{const Be=F.d;if(Be!=null){const Me=re[Be];Me!=null&&he.write("d",Me);const Ke=de[Be];Ke&&he.mergeTree(Ke.get())}else F.i!==void 0&&he.write("i",F.i);const $e=B(F);$e&&!ve.has(F)&&S(he,$e,w(F))}),V.get()}function Z(O){if(O==null)return null;const U=new s.ReadCursor(O),Q=new s.WriteCursor;let ne;const K=[],V=[];return function fe(de,P,J){const q=de.getComponent();let re,ve=!1;if(q){q.p!=null&&(P.write("d",q.p),K[q.p]=de.clone()),q.r!==void 0&&P.write("i",q.r),q.d!=null&&(P.write("p",q.d),J=void 0),q.i!==void 0&&(J=re=q.i);const F=B(q);F&&(J===void 0?(ne||(ne=new Set),ne.add(q)):(w(q),J=F.apply(J,w(q)),ve=!0))}let ye=0;for(const F of de){P.descend(F);const he=typeof F=="number"?F-ye:F,Be=E(J,he);u(de.getComponent())&&ye++;const $e=fe(de,P,Be);if(J!==void 0&&$e!==void 0){if(ve||(ve=!0,J=c(J)),!p(J,he))throw Error("Cannot modify child - invalid operation");J[he]=$e}P.ascend()}if(re===void 0)return ve?J:void 0;P.write("r",J)}(U,Q,void 0),ne&&(Q.reset(),function fe(de,P,J){const q=P.getComponent();if(q){const F=q.d;if(F!=null&&(de=K[F],J=V[F]=s.writeCursor()),ne.has(q)){const he=B(q);if(!he.invert)throw Error(`Cannot invert subtype ${he.name}`);S(J,he,he.invert(w(q)))}}let re=0,ve=0;const ye=s.advancer(de,(F,he)=>h(he)?re-F-1:F-re,(F,he)=>{h(he)&&re++});for(const F of P)if(typeof F=="number"){const he=F-ve,Be=ye(he),$e=he+re;J.descend($e),fe(Be,P,J),u(P.getComponent())&&ve++,J.ascend()}else J.descend(F),fe(ye(F),P,J),J.ascend();ye.end()}(U.clone(),U,Q),V.length&&(Q.reset(),U.traverse(Q,(fe,de)=>{const P=fe.p;if(P!=null){const J=V[P];J&&J.get(),J&&de.mergeTree(J.get())}}))),Q.get()}const k=(O,U)=>O.some(Q=>typeof Q=="object"&&(Array.isArray(Q)?k(Q,U):U(Q)));function z(O,U){if(O==null||!k(O,P=>{var J;return P.r!==void 0||((J=B(P))===null||J===void 0?void 0:J.makeInvertible)!=null}))return O;const Q=new s.ReadCursor(O),ne=new s.WriteCursor;let K=!1;const V=[],fe=[],de=(P,J,q)=>{const re=P.getComponent();let ve=!1;if(re){re.d!=null&&J.write("d",re.d),re.i!==void 0&&J.write("i",re.i);const F=re.p;if(F!=null&&(V[F]=P.clone(),o(q!==void 0,"Operation picks up at an invalid key"),fe[F]=q,J.write("p",re.p)),re.r!==void 0&&q===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const he=B(re);he&&(he.makeInvertible?K=!0:S(J,he,w(re),!0))}let ye=0;for(const F of P){J.descend(F);const he=typeof F=="number"?F-ye:F,Be=E(q,he),$e=de(P,J,Be);Be!==$e&&(ve||(ve=!0,q=c(q)),$e===void 0?(q=d(q,he),typeof F=="number"&&ye++):q[he]=$e),J.ascend()}return re&&(re.r!==void 0?(J.write("r",r.default(q)),q=void 0):re.p!=null&&(q=void 0)),q};return de(Q,ne,U),ne.get(),K&&(ne.reset(),function P(J,q,re,ve,ye){const F=q.getComponent();if(F){F.i!==void 0?(ve=F.i,ye=!0):F.d!=null&&(ve=fe[F.d],J=V[F.d],ye=!1,F.d);let Me=B(F);if(Me&&Me.makeInvertible){const Ke=w(F);S(re,Me,Me.makeInvertible(Ke,ve),!0)}}let he=0,Be=0;const $e=s.advancer(J,(Me,Ke)=>h(Ke)?he-Me-1:Me-he,(Me,Ke)=>{h(Ke)&&he++});for(const Me of q)if(typeof Me=="number"){const Ke=Me-Be,It=$e(Ke),We=Ke+he,et=E(ve,ye?Ke:We);re.descend(Me),P(It,q,re,et,ye),u(q.getComponent())&&Be++,re.ascend()}else{const Ke=E(ve,Me);re.descend(Me),P($e(Me),q,re,Ke,ye),re.ascend()}$e.end()}(Q.clone(),Q,ne,U,!1)),ne.get()}function me(O,U){return Z(z(O,U))}const te=O=>{if(O==null)return null;const U=O.slice();for(let Q=0;Q<O.length;Q++){const ne=U[Q];Array.isArray(ne)&&(U[Q]=te(ne))}return U};function Ce(O,U,Q){o(Q==="left"||Q==="right","Direction must be left or right");const ne=Q==="left"?0:1;if(U==null)return{ok:!0,result:O};le(O),le(U);let K=null;const V=[],fe=[],de=[],P=[],J=[],q=[],re=[],ve=[],ye=[],F=[],he=[],Be=[],$e=[],Me=[],Ke=[];let It=0;const We=s.readCursor(O),et=s.readCursor(U),Ye=s.writeCursor();if(function g(m,y=null,b){const N=a(y);N&&(N.r!==void 0?b=y.clone():N.p!=null&&(b=null,q[N.p]=m.clone()));const T=m.getComponent();let M;T&&(M=T.p)!=null&&(J[M]=y?y.clone():null,de[M]=m.clone(),b&&(F[M]=!0,ye[M]=b),N&&N.p!=null&&(Me[M]=N.p));const C=s.advancer(y);for(const H of m)g(m,C(H),b);C.end()}(et,We,null),function g(m,y,b,N,T){const M=b.getComponent();let C,H=!1;M&&((C=M.d)!=null?(P[C]=b.clone(),N!=null&&(Ke[N]==null&&(Ke[N]=[]),Ke[N].push(C)),m=J[C]||null,y=de[C]||null,F[C]?(T&&(he[C]=!0),T=ye[C]||null):!T||ne!==1&&Me[C]!=null||K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(T.getPath()),op2:e.moveOp(y.getPath(),b.getPath())}),H=!0):M.i!==void 0&&(m=y=null,H=!0,T&&K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(T.getPath()),op2:e.insertOp(b.getPath(),M.i)})));const ae=a(m);ae&&(ae.r!==void 0?T=m.clone():ae.p!=null&&(ae.p,N=ae.p,T=null));const $=B(M);$&&T&&K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(T.getPath()),op2:e.editOp(b.getPath(),$,w(M),!0)});let se=0,_e=0;const X=s.advancer(y,(W,ce)=>h(ce)?se-W-1:W-se,(W,ce)=>{h(ce)&&se++}),A=s.advancer(m);for(const W of b)if(typeof W=="number"){const ce=W-_e,Re=X(ce);_e+=+g(A(ce+se),Re,b,N,T)}else{const ce=X(W);g(A(W),ce,b,N,T)}return X.end(),A.end(),H}(We,et,et.clone(),null,null),P.map(g=>g&&g.get()),K)return{ok:!1,conflict:K};he.map(g=>!!g);const ht=[];let at=null;(function g(m,y,b,N,T){let M=!1;const C=a(y);if(h(C)){const X=C.p;X!=null?(b=P[X],N=Be[X]=s.writeCursor(),M=!0,T=null):(b=null,T=y.clone())}else u(a(b))&&(b=null);const H=m.getComponent();if(H){const X=H.p;X!=null?(T&&(ve[X]=T),ht[X]=T||ne===1&&M?null:N.getComponent(),V[X]=m.clone(),b&&(re[X]=b.clone())):H.r!==void 0&&(T||N.write("r",!0),(T||M)&&(at==null&&(at=new Set),at.add(H)))}let ae=0,$=0;const se=s.advancer(y,void 0,(X,A)=>{h(A)&&ae++}),_e=s.advancer(b,(X,A)=>u(A)?~(X-$):X-$,(X,A)=>{u(A)&&$++});if(m)for(const X of m)if(typeof X=="string"){const A=se(X),W=_e(X);N.descend(X),g(m,A,W,N,T),N.ascend()}else{const A=se(X),W=X-ae,ce=h(a(A))?null:_e(W),Re=W+$;o(Re>=0),N.descend(Re),g(m,A,ce,N,T),N.ascend()}se.end(),_e.end()})(We,et,et.clone(),Ye,null),Ye.reset();let $t=[];if(function g(m,y,b,N,T,M){o(y);const C=y.getComponent();let H=a(N),ae=!1;const $=(pe,ge,Oe)=>pe?e.moveOp(pe.getPath(),ge.getPath()):e.insertOp(ge.getPath(),Oe.i);if(u(C)){const pe=C.d;pe!=null&&(fe[pe]=y.clone());const ge=pe!=null?ht[pe]:null;let Oe=!1;if(C.i!==void 0||pe!=null&&ge){let Y;H&&(H.i!==void 0||(Y=H.d)!=null&&!F[Y])&&(Oe=Y!=null?pe!=null&&pe===Me[Y]:t.default(H.i,C.i),Oe||Y!=null&&ne!==1&&Me[Y]!=null||K==null&&(K={type:i.ConflictType.DROP_COLLISION,op1:$(pe!=null?V[pe]:null,y,C),op2:$(Y!=null?de[Y]:null,N,H)})),Oe||(M?K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:$(pe!=null?V[pe]:null,y,C),op2:e.removeOp(M.getPath())}):(pe!=null?($t[It]=pe,T.write("d",ge.p=It++)):T.write("i",r.default(C.i)),ae=!0))}else if(pe!=null&&!ge){const Y=ve[pe];Y&&(M=Y.clone())}pe!=null?(m=V[pe],b=q[pe],N=re[pe]):C.i!==void 0&&(m=b=null,Oe||(N=null))}else h(a(m))&&(m=b=N=null);const se=a(m),_e=a(b);if(h(_e)){const pe=_e.p;_e.r!==void 0&&(!se||se.r===void 0)||F[pe]?(N=null,M=b.clone()):pe!=null&&(N=P[pe],ne!==1&&Me[pe]!=null||((T=$e[pe])||(T=$e[pe]=s.writeCursor()),T.reset(),M=null))}else!u(C)&&u(H)&&(N=null);H=N!=null?N.getComponent():null;const X=B(C);if(X){const pe=w(C);if(M)K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(y.getPath(),X,pe,!0),op2:e.removeOp(M.getPath())});else{const ge=B(H);let Oe;if(ge){if(X!==ge)throw Error("Transforming incompatible types");const Y=w(H);Oe=X.transform(pe,Y,Q)}else Oe=r.default(pe);S(T,X,Oe)}}let A=0,W=0,ce=0,Re=0,De=0,xe=0,je=m!=null&&m.descendFirst(),ft=je;const _t=s.advancer(b,void 0,(pe,ge)=>{h(ge)&&ce++});let ue=N!=null&&N.descendFirst(),qe=ue;for(const pe of y)if(typeof pe=="number"){let ge;const Oe=u(y.getComponent()),Y=pe-W;{let Vt;for(;je&&typeof(Vt=m.getKey())=="number";){Vt+=A;const bt=m.getComponent(),pn=h(bt);if(Vt>Y||Vt===Y&&(!pn||ne===0&&Oe))break;if(pn){A--;const nn=bt.p;Me.includes(nn),bt.d,a($e[bt.d]),h(a($e[bt.d])),(bt.r===void 0||at&&at.has(bt))&&(nn==null||!ht[nn]||ne!==1&&Me.includes(nn))||De--}je=m.nextSibling()}ge=je&&Vt===Y?m:null}const ut=Y-A;let Fe=_t(ut);const Mt=ut-ce;let _r=null;{let Vt,bt;for(;ue&&typeof(Vt=N.getKey())=="number";){bt=Vt-Re;const pn=N.getComponent(),nn=u(pn);if(bt>Mt)break;if(bt===Mt){if(!nn){_r=N;break}{if(ne===0&&Oe){_r=N;break}const rn=Fe&&h(Fe.getComponent());if(ne===0&&rn)break}}if(nn){const rn=pn.d;Me[rn],pn.i===void 0&&(F[rn]||Me[rn]!=null&&ne!==1)?(F[rn]||Me[rn]!=null&&ne===0)&&(Re++,xe--):Re++}ue=N.nextSibling()}}const Li=Mt+Re+De+xe;o(Li>=0,"trying to descend to a negative index"),T.descend(Li),Oe&&(ge=Fe=_r=null,W++),g(ge,y,Fe,_r,T,M)&&xe++,T.ascend()}else{let ge;for(;je&&(ge=m.getKey(),typeof ge!="string"||!(ge>pe||ge===pe));)je=m.nextSibling();const Oe=je&&ge===pe?m:null,Y=_t(pe);let ut;for(;ue&&(ut=N.getKey(),typeof ut!="string"||!(ut>pe||ut===pe));)ue=N.nextSibling();const Fe=ue&&ut===pe?N:null;T.descend(pe),g(Oe,y,Y,Fe,T,M),T.ascend()}return _t.end(),ft&&m.ascend(),qe&&N.ascend(),ae}(We,We.clone(),et,et.clone(),Ye,null),K)return{ok:!1,conflict:K};Ye.reset();const Ue=(g,m,y)=>g.traverse(m,(b,N)=>{b.d!=null&&y(b.d,g,N)});(F.length||Be.length)&&(Ue(et,Ye,(g,m,y)=>{F[g]&&!he[g]&&y.write("r",!0),Be[g]&&y.mergeTree(Be[g].get())}),Ye.reset());const dt=[],_=[];if(($e.length||F.length)&&!K){const g=s.readCursor(te(Ye.get()));if(Ue(g,null,(m,y)=>{dt[m]=y.clone()}),$e.forEach(m=>{m&&Ue(s.readCursor(m.get()),null,(y,b)=>{dt[y]=b.clone()})}),function m(y,b,N,T,M,C){const H=a(b);if(H&&h(H))if(H.p!=null){const A=H.p;dt[A].getPath(),N=dt[A],T=_[A]=s.writeCursor()}else H.r!==void 0&&(N=null);else u(a(N))&&(N=null);const ae=y.getComponent();if(ae){let A;if((A=ae.d)!=null){const W=$e[A];W&&(W.get(),T.mergeTree(W.get()),N=s.readCursor(W.get()))}}let $=0,se=0;const _e=s.advancer(b,void 0,(A,W)=>{h(W)&&$--}),X=s.advancer(N,(A,W)=>u(W)?-(A-se)-1:A-se,(A,W)=>{u(W)&&se++});for(const A of y)if(typeof A=="number"){const W=_e(A),ce=A+$,Re=X(ce),De=ce+se;T.descend(De),m(y,W,Re,T),T.ascend()}else T.descend(A),m(y,_e(A),X(A),T),T.ascend();_e.end(),X.end()}(et,g,g.clone(),Ye),Ye.reset(),K)return{ok:!1,conflict:K};if(Ye.get(),_.length){const m=_.map(b=>b?b.get():null),y=s.readCursor(te(Ye.get()));if(Ue(y,Ye,(b,N,T)=>{const M=m[b];M&&(T.mergeTree(M),m[b]=null)}),m.find(b=>b)){const b=s.writeCursor(),N=s.writeCursor();let T=0,M=0;m.forEach(C=>{C!=null&&Ue(s.readCursor(C),null,H=>{const ae=$t[H];b.writeMove(V[ae].getPath(),fe[ae].getPath(),T++);const $=Ke[ae];$&&$.forEach(se=>{F[se]||ne!==1&&Me[se]!=null||N.writeMove(de[se].getPath(),P[se].getPath(),M++)})})}),K={type:i.ConflictType.BLACKHOLE,op1:b.get(),op2:N.get()}}}}return K?{ok:!1,conflict:K}:{ok:!0,result:Ye.get()}}const Ie=O=>{const U=new Error("Transform detected write conflict");throw U.conflict=O,U.type=U.name="writeConflict",U};function Ne(O,U,Q){const ne=Ce(O,U,Q);if(ne.ok)return ne.result;Ie(ne.conflict)}const Pe=O=>{const U=s.writeCursor();return s.readCursor(O).traverse(U,(Q,ne)=>{(u(Q)||B(Q))&&ne.write("r",!0)}),U.get()},He=(O,U)=>{const{type:Q,op1:ne,op2:K}=O;switch(Q){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,Pe(K)]:[Pe(ne),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let V=!1;return s.readCursor(ne).traverse(null,fe=>{fe.r!==void 0&&(V=!0)}),V?[null,Pe(K)]:[Pe(ne),null];case i.ConflictType.BLACKHOLE:return[Pe(ne),Pe(K)];default:throw Error("Unrecognised conflict: "+Q)}};function Ze(O,U,Q,ne){let K=null;for(;;){const V=Ce(U,Q,ne);if(V.ok)return Ae(K,V.result);{const{conflict:fe}=V;O(fe)||Ie(fe);const[de,P]=He(fe,ne);U=Ae(ee(U),de),Q=Ae(ee(Q),P),K=Ae(K,P)}}}})(Bl);(function(e){var n=Qe&&Qe.__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]}),t=Qe&&Qe.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&n(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),t(Bl,e);var r=vi;Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Ri;Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})})(mt);const p_=wt(mt),__=Dc({__proto__:null,default:p_},[mt]);var oe=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(oe||{});function gr(e,n=!1){const t=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!n&&G.isEmptyObject(o)&&r.sId==null)continue;if(t.length===0){t.push(r);continue}const a=t.pop();Ol(r,a)&&G.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?t.push({...r,st:a.st,ed:i}):t.push(a,r)}return t}function Wl(e,n,t,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=n.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:d,ed:f}=u;if(f<=r)i.push(u);else if(r>d&&r<f){a=!0;const p={...u,ed:r};i.push(p),l.length&&i.push(...l);const E={...u,st:r+t,ed:f+t};i.push(E)}else u.st+=t,u.ed+=t,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=gr(i)}function Yl(e,n,t,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=n,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=t),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(fr("startIndex"))}}function zl(e,n,t,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+=t)}const i=n.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(fr("startIndex"))}}function Vl(e,n,t,r){const{customBlocks: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+=t)}const i=n.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(fr("startIndex"))}}function Gl(e,n,t,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+=t,l.endIndex+=t):h>r&&(l.endIndex+=t)}const i=n.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(fr("startIndex"))}}const Kl="$",bo=e=>e.split(Kl)[0];function Si(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const n=[];let t={...e[0]};t.rangeId=bo(t.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=bo(i.rangeId),i.rangeId===t.rangeId&&Pa(t.properties,i.properties)&&t.endIndex+1>=i.startIndex?t.endIndex=i.endIndex:(n.push(t),t={...i})}n.push(t);const r=Object.create(null);for(let s=0,i=n.length;s<i;s++){const o=n[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${Kl}${r[a]}`,r[a]=r[a]+1):r[a]=1}return n}function js(e,n){const t=e.findIndex(s=>s.startIndex<n&&s.endIndex>=n),r=e[t];r&&e.splice(t,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:n-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:n,endIndex:r.endIndex,properties:{...r.properties}})}function Xl(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const n=[];let t={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===t.id&&t.endIndex+1>=s.startIndex?t.endIndex=s.endIndex:(n.push(t),t={...s})}return n.push(t),n}function Hs(e,n){e.filter(r=>r.startIndex<n&&r.endIndex>=n).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:n-1},{id:r.id,type:r.type,startIndex:n,endIndex:r.endIndex})})}function E_(e,n,t,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;js(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customRanges){for(let o=0,a=n.customRanges.length;o<a;o++){const l=n.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=Si(s)}function C_(e,n,t,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;Hs(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customDecorations){for(let o=0,a=n.customDecorations.length;o<a;o++){const l=n.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=Xl(s)}function Ql(e,n,t){const{textRuns:r}=e,s=t,i=t+n,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:d}=h;if(s<=u&&i>=d){o.push({...h,st:u-s,ed:d-s});continue}else u<=s&&d>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=n):s>=u&&s<d?(o.push({...h,st:s-s,ed:d-s}),h.ed=s):i>u&&i<=d?(o.push({...h,st:u-s,ed:i-s}),h.st=i-n,h.ed-=n):u>=i&&(h.st-=n,h.ed-=n);a.push(h)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:n,ts:{}}),o}function Jl(e,n,t){const{paragraphs:r}=e,s=t,i=t+n,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-t});continue}else u>=i&&(h.startIndex-=n);a.push(h)}e.paragraphs=a}return o}function Zl(e,n,t){const{sectionBreaks:r}=e,s=t,i=t+n-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-t});continue}else u>i&&(h.startIndex-=n);a.push(h)}e.sectionBreaks=a}return o}function ql(e,n,t){const{customBlocks:r}=e,s=t,i=t+n-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-t});continue}else u>i&&(h.startIndex-=n);a.push(h)}e.customBlocks=a}return o}function eu(e,n,t){const{tables:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(s<=u&&i>=d){o.push({...h,startIndex:u-t,endIndex:d-t});continue}else if(u<=s&&d>=i){const f=es(u,d,s,i);if(f.length===0||(h.startIndex=f[0],h.endIndex=f[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=n,h.endIndex-=n);a.push(h)}e.tables=a}return o}function v_(e,n,t){const{customRanges:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(u>=s&&d<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,d)){const f=es(u,d,s,i);if(f.length===0)continue;h.startIndex=f[0],h.endIndex=f[1]}else i<u&&(h.startIndex-=n,h.endIndex-=n);a.push(h)}e.customRanges=Si(a)}return o}function R_(e,n,t,r=!0){const{customDecorations:s}=e,i=t,o=t+n-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:d,endIndex:f}=u;if(d>=i&&f<=o){a.push(u);continue}else if(Math.max(i,d)<=Math.min(o,f)){const p=es(d,f,i,o);if(p.length===0)continue;u.startIndex=p[0],u.endIndex=p[1]}else o<d&&r&&(u.startIndex-=n,u.endIndex-=n);l.push(u)}e.customDecorations=l}return a}var tu=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(tu||{}),nu=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(nu||{}),Se=(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))(Se||{}),mr=(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))(mr||{}),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||{}),ln=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(ln||{}),ru=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(ru||{}),su=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(su||{}),iu=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.LINES=1]="LINES",e[e.LINES_AND_CHARS=2]="LINES_AND_CHARS",e[e.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",e))(iu||{}),ou=(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))(ou||{}),au=(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))(au||{}),lu=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(lu||{}),uu=(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))(uu||{}),cu=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(cu||{}),hu=(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))(hu||{}),du=(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))(du||{}),fu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(fu||{}),gu=(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))(gu||{}),mu=(e=>(e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e))(mu||{}),pu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(pu||{}),_u=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(_u||{}),Eu=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Eu||{}),Cu=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Cu||{}),vu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(vu||{}),Ru=(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))(Ru||{}),Sn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Sn||{}),Iu=(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))(Iu||{}),Su=(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))(Su||{}),Ou=(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))(Ou||{}),yu=(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))(yu||{}),wu=(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))(wu||{}),bu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(bu||{}),Au=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(Au||{}),Tu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(Tu||{}),Nu=(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))(Nu||{}),Oi=(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))(Oi||{}),Mu=(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))(Mu||{}),Du=(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))(Du||{}),Lu=(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))(Lu||{}),kt=(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))(kt||{});const Sr={"a)":{glyphFormat:"%1)",glyphType:Se.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Se.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Se.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Se.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER}},_n=e=>[...e,...e,...e].map((n,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:n,bulletAlignment:mr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),En=e=>e.map((n,t)=>({...n,bulletAlignment:mr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),Ao=(e,n)=>new Array(9).fill(0).map((t,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:mr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:n}})),pr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:_n(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:_n(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:_n(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:_n(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:_n(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:_n(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.DECIMAL},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.DECIMAL},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.DECIMAL},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1)",glyphType:Se.DECIMAL},{glyphFormat:"%2)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Se.DECIMAL},{glyphFormat:"%5)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Se.DECIMAL},{glyphFormat:"%8)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:En(["%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:Se.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Se.DECIMAL},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Se.DECIMAL},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Se.DECIMAL},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:Ao("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Ao("☑",{st:{s:Te.TRUE}})}},Or=e=>{const{glyphFormat:n,glyphType:t}=e,r=G.deepClone(pr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=n,r.nestingLevel[0].glyphType=t,r},I_={ORDER_LIST_QUICK_2:Or(Sr["a)"]),ORDER_LIST_QUICK_3:Or(Sr["a."]),ORDER_LIST_QUICK_4:Or(Sr["i."]),ORDER_LIST_QUICK_6:Or(Sr["I."])};Object.assign(pr,I_);const S_={"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 O_(e,n,t,r,s){const i=y_(e,n,t,r,s),o=w_(e,n,t,r,s),a=b_(e,n,t,r,s),l=A_(e,n,t,r,s),c=T_(e,n,t,r,s),h=N_(e,n,t,r),u=M_(e,n,t,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function y_(e,n,t,r,s){const{textRuns:i}=e,{textRuns:o}=n;if(i==null||o==null)return;const a=Ql(e,t,r);if(s!==Le.REPLACE){const l=xu(o,a,s);n.textRuns=l}return Wl(e,n,t,r),a}function xu(e,n,t){if(n.length===0)return e;e=G.deepClone(e),n=G.deepClone(n);const r=[],s=e.length,i=n.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:f,ed:p,ts:E}=e[o],{st:R,ed:I,ts:D,sId:x}=n[a];let B;if(t===Le.COVER?B={...D,...E}:B={...E},p<R)c()||r.push(e[o]),o++;else if(I<f)c()||r.push(n[a]),a++;else{const w={st:Math.min(f,R),ed:Math.max(f,R),ts:f<R?{...E}:{...D},sId:f<R?void 0:x};w.ed>w.st&&r.push(w),r.push({st:Math.max(f,R),ed:Math.min(p,I),ts:B,sId:x}),p<I?(o++,n[a].st=p,n[a].st===n[a].ed&&a++):(a++,e[o].st=I,e[o].st===e[o].ed&&o++);const S={st:Math.min(p,I),ed:Math.max(p,I),ts:p<I?{...D}:{...E},sId:p<I?x:void 0};l=S.ed>S.st?S:null}}c();const h=r[r.length-1],u=e[s-1],d=n[i-1];return h&&h.ed!==Math.max(u.ed,d.ed)&&(u.ed>d.ed?r.push(u):r.push(d)),gr(r)}function w_(e,n,t,r,s){const{paragraphs:i}=e,{paragraphs:o}=n;if(i==null||o==null)return;const a=Jl(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:d}=c;let f=[];for(const p of a){const{startIndex:E,paragraphStyle:R,bullet:I}=p;let D,x;if(s===Le.COVER?(D={...R,...u},x={listId:"",listType:kt.BULLET_LIST,nestingLevel:0,textStyle:{},...I,...d}):(D={...u,...R},x={listId:"",listType:kt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...I}),h===E){f.push({startIndex:h,paragraphStyle:D,bullet:x});break}}l.push(...f),f=[]}n.paragraphs=l}return Yl(e,n,t,r),a}function b_(e,n,t,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=n;if(i==null||o==null)return;const a=Zl(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Le.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}n.sectionBreaks=l}return zl(e,n,t,r),a}function A_(e,n,t,r,s){const{customBlocks:i}=e,{customBlocks:o}=n;if(i==null||o==null)return;const a=ql(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Le.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}n.customBlocks=l}return Vl(e,n,t,r),a}function T_(e,n,t,r,s){const{tables:i}=e,{tables:o}=n;if(i==null||o==null)return;const a=eu(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let d=[];for(const f of a){const{startIndex:p,endIndex:E}=f;if(p>=h&&E<=u){s===Le.COVER?d.push({...f,...c}):d.push({...c,...f});break}}l.push(...d),d=[]}n.tables=l}return Gl(e,n,t,r),a}function N_(e,n,t,r,s){e.customRanges||(e.customRanges=[]),js(e.customRanges,r),js(e.customRanges,r+t);const i=r,o=r+t-1,{customRanges:a}=n,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:d,endIndex:f}=u;d>=i&&f<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:d,endIndex:f}=u;l.push({...u,startIndex:d+r,endIndex:f+r})}),e.customRanges=Si(l),h):[]}function M_(e,n,t,r,s){e.customDecorations||(e.customDecorations=[]),Hs(e.customDecorations,r),Hs(e.customDecorations,r+t);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=n;if(s===Le.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+t-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===ln.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=Xl(o),i}var yi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(yi||{});function qt(e,n,t,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(n,t)};if(o){const I=[];for(const D of o){const x=G.deepClone(D),{st:B,ed:w}=x;G.hasIntersectionBetweenTwoRanges(B,w,n,t)&&(n>=B&&n<=w?I.push({...x,st:n,ed:Math.min(t,w)}):t>=B&&t<=w?I.push({...x,st:Math.max(n,B),ed:t}):I.push(x))}u.textRuns=gr(I.map(D=>{const{st:x,ed:B}=D;return{...D,st:x-n,ed:B-n}}))}else r&&(u.textRuns=[{st:0,ed:t-n,ts:{}}]);const d=[];for(const I of c){const D=G.deepClone(I),{startIndex:x,endIndex:B}=D;x>=n&&B<=t&&d.push({...D,startIndex:x-n,endIndex:B-n})}d.length&&(u.tables=d);const f=[];for(const I of a){const{startIndex:D}=I;D>=n&&D<t&&f.push(G.deepClone(I))}f.length&&(u.paragraphs=f.map(I=>({...I,startIndex:I.startIndex-n})));const p=[];for(const I of h){const{startIndex:D}=I;D>=n&&D<=t&&p.push(G.deepClone(I))}if(p.length&&(u.sectionBreaks=p.map(I=>({...I,startIndex:I.startIndex-n}))),s===1){const I=Pu(e,n,t);I?u.customDecorations=I:r&&(u.customDecorations=[])}const{customRanges:E}=Uu(e,n,t);E?u.customRanges=E:r&&(u.customRanges=[]);const R=[];for(const I of l){const{startIndex:D}=I;D>=n&&D<=t&&R.push(G.deepClone(I))}return R.length&&(u.customBlocks=R.map(I=>({...I,startIndex:I.startIndex-n}))),u}function D_(e){const{dataStream:n,textRuns:t,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>n.length-1&&(l=Math.max(l,h.endIndex-n.length+1))});const c=`${n}`;return t&&(t[0]&&(t[0].st=t[0].st-a),t[t.length-1]&&(t[t.length-1].ed=t[t.length-1].ed+l)),t==null||t.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:t,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function Uu(e,n,t){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,n)<=Math.min(a.endIndex,t-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,n),endIndex:Math.min(a.endIndex,t-1)})).map(a=>({...a,startIndex:a.startIndex-n,endIndex:a.endIndex-n})),leftOffset:0,rightOffset:0}}function Pu(e,n,t){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,n)<=Math.min(i.endIndex,t-1)){const o=G.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-n,0),endIndex:Math.min(o.endIndex,t-1)-n})}}),s}function L_(e,n,t){return e==null||n==null?e!=null?e:n:xu(e,n,t)}function x_(e,n,t){if(e==null||n==null)return e!=null?e:n;if(n.length===0||e.length===0)return e;if(n.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return t===Le.REPLACE?[{...e[0]}]:[{...n[0],...e[0]}]}function U_(e,n,t){return n.length===0||e.length===0||t===Le.REPLACE?e:[...e,...n.filter(r=>!e.some(s=>r.id===s.id))]}function Bs(e,n,t=Le.COVER){if(n.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=[]}=n;r.textRuns=L_(l,s,t),r.customRanges=x_(h,o,t);const d=U_(u,a,t);d.length&&(r.customDecorations=d);const f=[];let p=0,E=0;for(;p<i.length&&E<c.length;){const R=i[p],I=c[E],{startIndex:D}=R,{startIndex:x}=I;D===x?(f.push(G.deepMerge(R,I)),p++,E++):D<x?(f.push(G.deepClone(R)),p++):(f.push(G.deepClone(I)),E++)}return p<i.length&&f.push(...i.slice(p)),E<c.length&&f.push(...c.slice(E)),f.length&&(r.paragraphs=f),r}function P_(e){const{body:n}=e;if(n==null)return!0;const{textRuns:t,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=n;return t==null&&r==null&&s==null&&i==null&&o==null&&a==null}class vn{constructor(n){v(this,"_index",0);v(this,"_offset",0);this._actions=n}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(n){n||(n=Number.POSITIVE_INFINITY);const t=this._actions[this._index];if(t){const r=this._offset,s=t.len;return n>=s-r?(n=s-r,this._index+=1,this._offset=0):this._offset+=n,t.t===oe.DELETE||t.t===oe.RETAIN&&t.body==null?G.deepClone({...t,len:n}):G.deepClone({...t,len:n,body:qt(t.body,r,r+n,!1)})}else return{t:oe.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 n=this._actions[this._index];return n?n.t:oe.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const n=this._offset,t=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=n,this._index=t,[r].concat(s)}}else return[]}}function ku(e,n,t){const{dataStream:r}=e,s=t,i=t+n,o=Ql(e,n,t),a=Jl(e,n,t),l=Zl(e,n,t),c=ql(e,n,t),h=eu(e,n,t),u=v_(e,n,t),d=R_(e,n,t);let f="";return r&&(e.dataStream=Pl(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:d}}function Fu(e,n,t,r){e.dataStream=Ul(e.dataStream,r,n.dataStream),Wl(e,n,t,r),Yl(e,n,t,r),zl(e,n,t,r),Vl(e,n,t,r),Gl(e,n,t,r),E_(e,n,t,r),C_(e,n,t,r)}function k_(e,n,t,r,s=Le.COVER){return O_(e,n,t,r,s)}function F_(e,n,t){return n<=0?{dataStream:""}:ku(e,n,t)}function $_(e,n,t,r){t!==0&&Fu(e,n,t,r)}function j_(e,n){const t=new Ln;return t.reset(),n.forEach(r=>{const s=G.deepClone(r);switch(s.t){case oe.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&k_(e,o,a,t.cursor,i),t.moveCursor(a);break}case oe.INSERT:{const{body:i,len:o}=s;$_(e,i,o,t.cursor),t.moveCursor(o);break}case oe.DELETE:{const{len:i}=s;F_(e,i,t.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function H_(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];n=G.deepClone(n),e=G.deepClone(e);const i=[],o=n.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:E,ed:R,ts:I}=n[l],{st:D,ed:x,ts:B,sId:w}=e[c];let S={};if(s===0)S={...I},t===Le.COVER&&r===Le.REPLACE&&B&&(S=Object.assign({},B,S));else if(S={...I},t===Le.REPLACE){if(r===Le.REPLACE)S={...B};else if(I&&B){const L=Object.keys(I);for(const j of L)B[j]&&delete S[j]}}else if(r===Le.REPLACE){if(B){const L=Object.keys(B);for(const j of L)B[j]!==void 0&&(S[j]=B[j])}}else if(B){const L=Object.keys(B);for(const j of L)S[j]!==void 0&&delete S[j]}if(R<D)u()||i.push(n[l]),l++;else if(x<E)u()||i.push(e[c]),c++;else{const L={st:Math.min(E,D),ed:Math.max(E,D),ts:E<D?{...I}:{...B},sId:E<D?void 0:w};L.ed>L.st&&i.push(),i.push({st:Math.max(E,D),ed:Math.min(R,x),ts:S,sId:w}),R<x?(l++,e[c].st=R,e[c].st===e[c].ed&&c++):(c++,n[l].st=x,n[l].st===n[l].ed&&l++);const j={st:Math.min(R,x),ed:Math.max(R,x),ts:R<x?{...B}:{...I},sId:R<x?w:void 0};h=j.ed>j.st?j:null}}u();const d=i[i.length-1],f=n[o-1],p=e[a-1];return d.ed!==Math.max(f.ed,p.ed)&&(f.ed>p.ed?i.push(f):i.push(p)),gr(i,!0)}function B_(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];if(e.length>1||n.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=n[0];if(t===Le.REPLACE)return s===1?[G.deepClone(i)]:[G.deepClone(o)];if(r===Le.REPLACE){const a=G.deepClone(o);return s===1&&Object.assign(a,G.deepClone(i)),[a]}else{const a=G.deepClone(o);return s===1&&Object.assign(a,G.deepClone(i)),[a]}}function To(e,n,t,r,s){const i={startIndex:n.startIndex};if(n.paragraphStyle&&(i.paragraphStyle=G.deepClone(n.paragraphStyle),e.paragraphStyle)){if(t===Le.REPLACE)if(r===Le.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===Le.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 t===Le.REPLACE&&r===Le.REPLACE?i.bullet=s===1?G.deepClone(e.bullet):G.deepClone(n.bullet):e.bullet===void 0?i.bullet=G.deepClone(n.bullet):t===Le.REPLACE||r===Le.REPLACE?i.bullet=s===0&&n.bullet?G.deepClone(n.bullet):G.deepClone(e.bullet):s===0&&n.bullet!==void 0&&(i.bullet=G.deepClone(n.bullet)),i}function W_(e,n){if(e==null||n==null)return n;if(e.length===0||n.length===0)return G.deepClone(n);const t=[];for(const r of n){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===ln.DELETED||i===ln.DELETED)&&(o=!0,t.push({...r,type:ln.DELETED}));break}o||t.push(r)}return t}function Y_(e,n,t=!1){const{body:r,coverType:s=Le.COVER}=e,{body:i,coverType:o=Le.COVER}=n;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:d}=r,{textRuns:f,paragraphs:p=[],customRanges:E,customDecorations:R}=i,I=H_(c,f,s,o,t?1:0);I&&(a.textRuns=I);const D=B_(u,E,s,o,t?1:0);D&&(a.customRanges=D);const x=W_(d,R);x&&(a.customDecorations=x);const B=[];let w=0,S=0;for(;w<h.length&&S<p.length;){const L=h[w],j=p[S],{startIndex:le}=L,{startIndex:ee}=j;if(le===ee){let ie={startIndex:le};t?ie=To(L,j,s,o,1):ie=To(L,j,s,o,0),B.push(ie),w++,S++}else le<ee?w++:(B.push(G.deepClone(j)),S++)}return S<p.length&&B.push(...p.slice(S)),B.length&&(a.paragraphs=B),{coverType:l,body:a}}function No(e){return Object.keys(e).length===1}const yn=class yn{constructor(){v(this,"_actions",[])}static apply(n,t){return j_(n,t)}static compose(n,t){const r=new vn(n),s=new vn(t),i=new yn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===oe.INSERT)i.push(s.next());else if(r.peekType()===oe.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===oe.INSERT&&l.t===oe.RETAIN)l.body==null?i.push(a):i.push({...a,body:Bs(a.body,l.body,l.coverType)});else if(a.t===oe.RETAIN&&l.t===oe.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===Le.REPLACE||l.coverType===Le.REPLACE?Le.REPLACE:Le.COVER;i.push({...a,t:oe.RETAIN,coverType:c,body:Bs(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===oe.RETAIN&&l.t===oe.DELETE?i.push(l):a.t===oe.INSERT&&(l.t,oe.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(n,t,r="right"){return this._transform(t,n,r==="left"?"right":"left")}static _transform(n,t,r="right"){const s=new vn(n),i=new vn(t),o=new yn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===oe.INSERT&&(r==="left"||i.peekType()!==oe.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===oe.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===oe.DELETE)continue;if(c.t===oe.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=Y_(l,c,r==="left");o.push({...c,t:oe.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(n,t,r=!1){const s=new vn(n);let i=0;for(;s.hasNext()&&i<=t;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===oe.DELETE){t-=Math.min(o,t-i);continue}else a===oe.INSERT&&(i<t||!r)&&(t+=o);i+=o}return t}static isNoop(n){return n.length===0}static invert(n){const t=[];for(const r of n)if(r.t===oe.INSERT)t.push({t:oe.DELETE,len:r.len,body:r.body});else if(r.t===oe.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");t.push({t:oe.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.");t.push({t:oe.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Le.REPLACE})}else t.push(r);return t}static makeInvertible(n,t){const r=[];let s=0;for(const i of n){if(i.t===oe.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=qt(t,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===oe.RETAIN&&i.body!=null){const o=qt(t,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==oe.INSERT&&(s+=i.len)}return r}insert(n,t){const r={t:oe.INSERT,body:t,len:n};return this.push(r),this}retain(n,t,r){const s={t:oe.RETAIN,len:n};return t!=null&&(s.body=t),r!=null&&(s.coverType=r),this.push(s),this}delete(n){const t={t:oe.DELETE,len:n};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...n){if(n.length>1){for(const i of n)this.push(i);return this}let t=this._actions.length,r=this._actions[t-1];const s=G.deepClone(n[0]);if(s.t===oe.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===oe.DELETE&&s.t===oe.DELETE)return r.len+=s.len,this;if(r.t===oe.DELETE&&s.t===oe.INSERT&&(t-=1,r=this._actions[t-1],r==null))return this._actions.unshift(s),this;if(r.t===oe.RETAIN&&s.t===oe.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===oe.INSERT&&No(r.body)&&s.t===oe.INSERT&&No(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return t===this._actions.length?this._actions.push(s):this._actions.splice(t,0,s),this}trimEndUselessRetainAction(){let n=this._actions[this._actions.length-1];for(;n&&n.t===oe.RETAIN&&P_(n);)this._actions.pop(),n=this._actions[this._actions.length-1];return this}};v(yn,"id","text-x"),v(yn,"uri","https://github.com/dream-num/univer#text-x");let nt=yn;Object.defineProperty(nt,"name",{value:"text-x"});const wn=class wn{static registerSubtype(n){var t;n==null||this._subTypes.has(n.name)&&((t=this._subTypes.get(n.name))==null?void 0:t.id)!==nt.id||(this._subTypes.set(n.name,n),mt.type.registerSubtype(n))}static apply(n,t){if(!mt.type.isNoop(t))return mt.type.apply(n,t)}static compose(n,t){return mt.type.compose(n,t)}static transform(n,t,r){return mt.type.transform(n,t,r)}static transformPosition(n,t,r="right"){return n&&n.length===2&&n[0]==="body"&&n[1].et===nt.name?nt.transformPosition(n[1].e,t,r==="left"):t}static invertWithDoc(n,t){return mt.type.invertWithDoc(n,t)}static isNoop(n){return mt.type.isNoop(n)}static getInstance(){return this._instance==null&&(this._instance=new wn),this._instance}removeOp(n,t){return mt.removeOp(n,t)}moveOp(n,t){return mt.moveOp(n,t)}insertOp(n,t){return mt.insertOp(n,t)}replaceOp(n,t,r){return mt.replaceOp(n,t,r)}editOp(n,t=["body"]){return mt.editOp(t,nt.name,n)}};v(wn,"uri","https://github.com/dream-num/univer#json-x"),v(wn,"_subTypes",new Map),v(wn,"_instance",null);let fn=wn;fn.registerSubtype(nt);const wi={id:"default_doc",documentStyle:{}};class z_ extends ts{constructor(t){var r;super();v(this,"type",ke.UNIVER_DOC);v(this,"_name$",new Ee.BehaviorSubject(""));v(this,"name$",this._name$.asObservable());v(this,"snapshot");this.snapshot={...wi,...t},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var t;return(t=this.snapshot.rev)!=null?t:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(t){this.snapshot.rev=t}setName(t){this.snapshot.title=t,this._name$.next(t)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var t;return((t=this.snapshot.settings)==null?void 0:t.zoomRatio)||1}resetDrawing(t,r){this.snapshot.drawings=t,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const t=(s=this.snapshot.lists)!=null?s:{};return{...pr,...t}}updateDocumentId(t){this.snapshot.id=t}updateDocumentRenderConfig(t){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=t:r.renderConfig={...r.renderConfig,...t}}updateDocumentStyle(t){this.snapshot.documentStyle==null?this.snapshot.documentStyle=t:this.snapshot.documentStyle={...this.snapshot.documentStyle,...t}}updateDocumentDataMargin(t){const{t:r,l:s,b:i,r:o}=t,{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(t,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){t=t!=null?t:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:t,height:r};return}t!==void 0&&(s.pageSize.width=t),r!==void 0&&(s.pageSize.height=r)}updateDrawing(t,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[t];if(!c)return;const h=c.docTransform;h.size.width=i,h.size.height=o,h.positionH.posOffset=a,h.positionV.posOffset=l}setZoomRatio(t=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:t}:this.snapshot.settings.zoomRatio=1}}class Wt extends z_{constructor(t){var s,i;super(G.isEmptyObject(t)?h_():t);v(this,"_unitId");v(this,"headerModelMap",new Map);v(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:G.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(t=>{t.dispose()}),this.footerModelMap.forEach(t=>{t.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var t;return(t=this.snapshot.body)==null?void 0:t.customRanges}getCustomDecorations(){var t;return(t=this.snapshot.body)==null?void 0:t.customDecorations}getSettings(){return this.snapshot.settings}reset(t){if(t.id&&t.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...wi,...t},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(t){if(t!=null){if(this.headerModelMap.has(t))return this.headerModelMap.get(t);if(this.footerModelMap.has(t))return this.footerModelMap.get(t)}return this}getUnitId(){return this._unitId}apply(t){if(!fn.isNoop(t))return this.snapshot=fn.apply(this.snapshot,t),t!=null&&t.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(t,r,s=yi.copy){const i=this.getBody();if(i!=null)return qt(i,t,r,!1,s)}_initializeHeaderFooterModel(){const{headers:t,footers:r}=this.getSnapshot();if(t)for(const s in t){const i=t[s];this.headerModelMap.set(s,new Wt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Wt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(t){super.updateDocumentId(t),this._unitId=t}}const V_="0.5.0";function G_(e="",n=dr.ZH_CN,t=""){return{id:e,sheetOrder:[],name:t,appVersion:V_,locale:n,styles:{},sheets:{},resources:[]}}class $u{constructor(n={}){v(this,"_styles");v(this,"_cacheMap",new Hr(1e5));this._styles=n,this._generateCacheMap()}each(n){return Object.entries(this._styles).forEach(n),this}search(n,t){if(this._cacheMap.has(t))return this._cacheMap.get(t);const r=this._getExistingStyleId(n);return r||"-1"}get(n){return typeof n!="string"?n:(n=String(n),this._styles[n])}add(n,t){const r=G.generateRandomId(6);return this._styles[r]=n,this._cacheMap.set(t,r),r}setValue(n){if(n==null)return;const t=JSON.stringify(n),r=this.search(n,t);return r!=="-1"?r:this.add(n,t)}toJSON(){return this._styles}getStyleByCell(n){let t;n&&G.isObject(n.s)?t=n.s:t=(n==null?void 0:n.s)&&this.get(n.s);const r=n==null?void 0:n.interceptorStyle;return r?{...t,...r}:t}_generateCacheMap(){const{_styles:n,_cacheMap:t}=this;for(const r in n){const s=JSON.stringify(n[r]);t.set(s,r)}}_getExistingStyleId(n){const{_styles:t}=this;for(const r in t)if(G.diffValue(t[r],n))return r;return null}}function K_(e){const{ranges:n,id:t,type:r}=e,s=new nt;let i=0;for(let o=0;o<n.length;o++){const a=n[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:oe.RETAIN,len:l-i}),s.push({t:oe.RETAIN,body:{dataStream:"",customDecorations:[{id:t,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function X_(e){var h,u,d;const{id:n,segmentId:t,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(u=(h=r.getSelfOrHeaderFooterModel(t))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:d.find(f=>f.id===n);if(!i)return!1;const o=new nt,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:oe.RETAIN,len:a}),o.push({t:oe.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:n,type:ln.DELETED}]}}),o}function ju(e,n,t,r){return e<=t&&n>=t||e>=t&&e<=r}function Q_(e,n){const t=[];for(let r=0,s=n.length;r<s;r++){const i=n[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&t.push(i):ju(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&t.push(i)}return t}function J_(e){return{...G.deepClone(e),rangeId:hn()}}function Z_(e,n){const t=[];let r=e[0];for(const s of n)s<e[0]||s>e[1]||(r<s&&t.push([r,s-1]),r=s+1);return r<=e[1]&&t.push([r,e[1]]),t}function Hu(e,n,t,r){const s=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,n)&&s.push({...a}),a.startIndex>n)break}return s}function q_(e,n){var i,o,a,l,c;const t=Hu(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=n.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=t[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=t[t.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}const eE=e=>{var u,d,f;const{paragraphs:n,segmentId:t,document:r}=e;let s=e.listType;const i=(d=(u=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:u.paragraphs)!=null?d:[],o=n.every(p=>{var E;return((E=p.bullet)==null?void 0:E.listType.indexOf(s))===0});let l=G.generateRandomId(6);if(n.length===1){const p=i.indexOf(n[0]),E=i[p-1],R=i[p+1];E&&E.bullet&&E.bullet.listType.indexOf(s)===0?(l=E.bullet.listId,s!==kt.CHECK_LIST&&(s=E.bullet.listType)):R&&R.bullet&&R.bullet.listType.indexOf(s)===0&&(l=R.bullet.listId,s!==kt.CHECK_LIST&&(s=R.bullet.listType))}const c=new Ln;c.reset();const h=new nt;for(const p of n){const{startIndex:E,paragraphStyle:R={},bullet:I}=p;h.push({t:oe.RETAIN,len:E-c.cursor}),h.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:R,startIndex:0}:{startIndex:0,paragraphStyle:{...R},bullet:{nestingLevel:(f=I==null?void 0:I.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Le.REPLACE}),c.moveCursorTo(E+1)}return h},tE=e=>{var u;const{paragraphIndex:n,segmentId:t,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===n);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(kt.CHECK_LIST)===-1)return!1;const o=new Ln;o.reset();const a=new nt,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===kt.CHECK_LIST?kt.CHECK_LIST_CHECKED:kt.CHECK_LIST;return a.push({t:oe.RETAIN,len:l-o.cursor}),a.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Le.REPLACE}),o.moveCursorTo(l+1),a},nE=e=>{var h,u;const{paragraphs:n,listType:t,segmentId:r,document:s}=e;if(((h=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:h.paragraphs)==null)return!1;const a=G.generateRandomId(6),l=new Ln;l.reset();const c=new nt;for(const d of n){const{startIndex:f,paragraphStyle:p={},bullet:E}=d;c.push({t:oe.RETAIN,len:f-l.cursor}),c.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:p,bullet:{nestingLevel:(u=E==null?void 0:E.nestingLevel)!=null?u:0,textStyle:(E==null?void 0:E.listType)===t?E.textStyle:{fs:20},listType:t,listId:a}}]},coverType:Le.REPLACE}),l.moveCursorTo(f+1)}return c};function rE(e,n){return n.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}const sE=e=>{var h,u,d;const{paragraphs:n,segmentId:t,document:r,type:s}=e,i=new Ln;i.reset();const o=new nt,a=(h=r.getSnapshot().lists)!=null?h:{},l=(d=(u=r.getBody())==null?void 0:u.tables)!=null?d:[],c={...pr,...a};for(const f of n){const{startIndex:p,paragraphStyle:E={},bullet:R}=f,I=rE(f,l);if(o.push({t:oe.RETAIN,len:p-i.cursor}),R){const D=R.listType;let x=c[D].nestingLevel.length-1;I&&(x=Math.min(x,2)),o.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...E},bullet:{...R,nestingLevel:Math.max(Math.min(R.nestingLevel+s,x),0)}}]},coverType:Le.REPLACE})}else o.push({t:oe.RETAIN,len:1});i.moveCursorTo(p+1)}return o};var Bu=(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))(Bu||{}),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 iE(e){return`${e}`}const oE=[jt.TABLE_START,jt.TABLE_ROW_START,jt.TABLE_CELL_START,jt.TABLE_CELL_END,jt.TABLE_ROW_END,jt.TABLE_END,jt.CUSTOM_BLOCK],Wu=e=>{const n=e.endsWith(`\r
10
- `)?e.slice(0,-2):e;return oE.reduce((t,r)=>t.replaceAll(r,""),n)},aE=e=>e?Wu(e).replaceAll("\r","")==="":!0,lE=e=>{const n=e.replace(/\n/g,"\r"),t=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=n.slice(s,l);if(G.isLegalUrl(h)){const u=hn(),d=`${h}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:u,rangeType:tr.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,c&&(i+="\r",t.push({startIndex:l}))}else i+=n.slice(s,l+1),s=l+1,c&&t.push({startIndex:l})};let a=0;for(let l=0;l<n.length;l++)n[l]==="\r"&&(o(l),a=l);return a!==n.length-1&&o(n.length,!1),{dataStream:i,paragraphs:t,customRanges:r}};function uE(e,n){if(typeof n>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(n<e)throw new Error(`Cannot make a doc selection when endOffset ${n} is less than startOffset ${e}.`);return{startOffset:e,endOffset:n,collapsed:e===n}}function cE(e){const{startOffset:n,endOffset:t,collapsed:r}=e,s=Math.min(n,t),i=Math.max(n,t);return{startOffset:s,endOffset:i,collapsed:r}}function hE(e,n,t,r){return Math.max(e,t)<=Math.min(n,r)}function dE(e,n){var d,f,p;const{rangeId:t,segmentId:r,documentDataModel:s,insert:i}=n,o=(f=(d=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:d.customRanges)==null?void 0:f.find(E=>E.rangeId===t);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new nt,h=l-a+1;c.push({t:oe.RETAIN,len:a}),c.push({t:oe.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:oe.INSERT,body:i,len:i.dataStream.length});const u=l+1+((p=i==null?void 0:i.dataStream.length)!=null?p:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function fE(e){const{ranges:n,rangeId:t,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new nt;let c=!1;return n.forEach(h=>{var x,B,w;const u=q_(h,o);if(!u||!o)return!1;const{startOffset:d,endOffset:f}=u,p=(x=o.customRanges)!=null?x:[],E=(S,L,j)=>{var Ae,Z,k,z;const le=Hu(S,L,p,r),ee=Math.min((Z=(Ae=le[0])==null?void 0:Ae.startIndex)!=null?Z:1/0,S),ie=Math.max((z=(k=le[le.length-1])==null?void 0:k.endIndex)!=null?z:-1/0,L),be={rangeId:j?`${t}$${j}`:t,rangeType:r,startIndex:0,endIndex:ie-ee,wholeEntity:s,properties:{...i}};l.push({t:oe.RETAIN,len:ee-a}),l.push({t:oe.RETAIN,len:ie-ee+1,body:{dataStream:"",customRanges:[be]},coverType:Le.COVER}),a=ie+1},R=((B=o.paragraphs)!=null?B:[]).filter(S=>S.startIndex<f&&S.startIndex>d),I=((w=o.customBlocks)!=null?w:[]).filter(S=>S.startIndex<f&&S.startIndex>d);Z_([d,f-1],[...R.map(S=>S.startIndex),...I.map(S=>S.startIndex)]).forEach(([S,L],j)=>E(S,L,j)),c=!0,l.selections=[{startOffset:u.endOffset,endOffset:u.endOffset,collapsed:!0}]}),c?l:!1}function gE(e,n,t=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=n,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=t;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:oe.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:oe.DELETE,len:u-l}),l=u)}),r&&i.push({t:oe.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-t>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:oe.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Le.REPLACE}))}return i}const mE=e=>{var u;const{selection:n,body:t,doc:r}=e,s=n.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=n.collapsed?null:qt(i,n.startOffset,n.endOffset),a=ma(o?o.dataStream:"",t.dataStream);let l=0;const c=a.map(([d,f])=>{switch(d){case 0:{const p={t:oe.RETAIN,body:{...qt(t,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,p}case 1:{const p={t:oe.INSERT,body:qt(t,l,l+f.length),len:f.length};return l+=f.length,p}default:return{t:oe.DELETE,len:f.length}}}),h=new nt;return h.push({t:oe.RETAIN,len:n.startOffset}),h.push(...c),h};class Lt{}v(Lt,"customRange",{add:fE,delete:dE,copyCustomRange:J_,getCustomRangesInterestsWithSelection:Q_,isIntersecting:ju}),v(Lt,"customDecoration",{add:K_,delete:X_}),v(Lt,"selection",{replace:mE,makeSelection:uE,normalizeSelection:cE,delete:gE}),v(Lt,"range",{isIntersects:hE}),v(Lt,"transform",{getPlainText:Wu,fromPlainText:lE,isEmptyDocument:aE}),v(Lt,"paragraph",{bullet:{set:nE,switch:eE,toggleChecklist:tE,changeNestLevel:sE}});const pE=(e,n)=>n.length===e.length&&!e.some(t=>n.some(r=>!en.equals(r,t))),_E=(e,n)=>n.length===e.length&&e.every((t,r)=>{const s=n[r];return s.unitId===t.unitId&&s.sheetId===t.sheetId&&en.equals(t.range,s.range)}),Ws={t:0,b:2,l:2,r:2},EE=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Mo=90;function yr(e,n,t={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Xt.UNSPECIFIED,verticalAlign:a=an.UNSPECIFIED,wrapStrategy:l=cn.UNSPECIFIED,cellValueType:c}=t,{t:h,r:u,b:d,l:f}=i||Ws,{vertexAngle:p,centerAngle:E}=zu(s),R={id:"d",body:{dataStream:`${e}${_a}`,textRuns:[{ts:n,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:h,marginBottom:d,marginRight:u,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:E,vertexAngle:p,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Wt(R)}function CE(e){if(!e)return{};const{tr:n,td:t,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:n,textDirection:t,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Do(e){if(!e)return{};const{ff:n,fs:t,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return n&&(c.ff=n),t&&(c.fs=t),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 Yu(e,n,t){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===tr.HYPERLINK))return;const s=Lt.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:t,rangeType:tr.HYPERLINK,body:r,properties:{url:n,refId:t}});s&&nt.apply(r,s.serialize())}const vE='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Lo(e){const n=ct.ff,t=ct.fs;if(!e){const u=`${t}pt ${n}`;return{fontCache:u,fontString:u,fontSize:t,originFontSize:t,fontFamily:n}}let r=Sn.ITALIC;(e.it===0||e.it===void 0)&&(r=Sn.NORMAL);let s=Sn.BOLD;(e.bl===0||e.bl===void 0)&&(s=Sn.NORMAL);let i=t;e.fs&&(i=Math.ceil(e.fs));let o=n;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=n),o=u}const{va:a}=e;let l=i;if(a===Bt.SUBSCRIPT||a===Bt.SUPERSCRIPT){const u=RE(o,l),{sbr:d,spr:f}=u;l*=a===Bt.SUBSCRIPT?d:f}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${vE} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function RE(e,n){return EE(n)}function zu(e){const{a:n=0,v:t=Te.FALSE}=e||{a:0,v:Te.FALSE};let r=0,s=n;return t===Te.TRUE&&(r=Mo,s=Mo),{centerAngle:r,vertexAngle:s}}class IE{constructor(n,t){v(this,"_columnData",{});this._config=n,this._columnData=t}getColumnData(){return this._columnData}getColVisible(n){const{_columnData:t}=this,r=t[n];return r?r.hd!==Te.TRUE:!0}getColumnStyle(n){var t;return(t=this._columnData[n])==null?void 0:t.s}setColumnStyle(n,t){const r=this.getColumnOrCreate(n);r.s=t}getHiddenCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:we.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:t,rangeType:we.COLUMN}),r}getVisibleCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:we.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:t,rangeType:we.COLUMN}),r}getColumnDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return Zt(this._columnData)}getColumnWidth(n){const{_columnData:t}=this,r=this._config;let s=0;return s=(t[n]||{hd:Te.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(n){const t=this._columnData[n];if(t)return t}removeColumn(n){delete this._columnData[n]}getColumnOrCreate(n){const{_columnData:t}=this,r=t[n];if(r)return r;const s={};return this._columnData[n]=s,s}}class SE{constructor(n,t,r){v(this,"_rowData");this._config=n,this._viewModel=t,this._rowData=r}getRowData(){return this._rowData}getRowStyle(n){var t;return(t=this._rowData[n])==null?void 0:t.s}setRowStyle(n,t){const r=this.getRowOrCreate(n);r.s=t}getRowDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(n,t=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<t;o++){const a=r[o+n]||{hd:Te.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===Te.TRUE)&&typeof c=="number"?c:h}return i}getRow(n){return this._rowData[n]}removeRow(n){delete this._rowData[n]}getRowOrCreate(n){const{_rowData:t}=this,r=t[n];if(r)return r;const s={};return t[n]=s,s}getHiddenRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:we.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:we.ROW}),r}getVisibleRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:we.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:we.ROW}),r}getRowRawVisible(n){const t=this.getRow(n);return t?t.hd!==Te.TRUE:!0}getSize(){return Zt(this._rowData)}}const OE="DEFAULT_WORKSHEET_ROW_COUNT",Vu=1e3,yE="DEFAULT_WORKSHEET_COLUMN_COUNT",Gu=20,wE="DEFAULT_WORKSHEET_ROW_HEIGHT",Ku=24,bE="DEFAULT_WORKSHEET_COLUMN_WIDTH",Xu=88,AE="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Qu=46,TE="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Ju=20;function Zu(e){const n={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Te.FALSE,rowCount:Vu,columnCount:Gu,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Xu,defaultRowHeight:Ku,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Te.TRUE,rowHeader:{width:Qu,hidden:Te.FALSE},columnHeader:{height:Ju,hidden:Te.FALSE},rightToLeft:Te.FALSE};return Object.keys(n).forEach(t=>{const r=t;typeof e[r]>"u"&&(e[r]=n[r])}),e}class NE extends rt{constructor(t){super();v(this,"_cellCache",new Map);v(this,"_rowCache",new Map);v(this,"_columnCache",new Map);v(this,"_hasRow",!1);v(this,"_hasColumn",!1);v(this,"_hasAll",!1);v(this,"_allIndex",-1);v(this,"_mergeData");v(this,"_rangeMap",new Hr(5e4));v(this,"_skeletonCache",new Hr(5e4));this._init(t.concat())}_init(t){this._mergeData=t,this._createCache(t)}_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(t){let r=0;for(const s of t){const{rangeType:i}=s;i===we.ROW?this._createRowCache(s,r):i===we.COLUMN?this._createColumnCache(s,r):i===we.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(t){this._clearCache(),this._init(t.concat())}_createRowCache(t,r){const{startRow:s,endRow:i}=t;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(t,r){const{startColumn:s,endColumn:i}=t;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(t){this._hasAll=!0,this._allIndex=t}_createCellCache(t,r){for(let s=t.startRow;s<=t.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=t.startColumn;o<=t.endColumn;o++)i.set(o,r)}}add(t){this._mergeData.push(t),this._clearCache(),this._createCache(this._mergeData)}remove(t,r){const s=this._getMergeDataIndex(t,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(t,r){const s=this._getMergeDataIndex(t,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(t,r){return this._getMergeDataIndex(t,r)}isRowContainsMergedCell(t){return this._hasAll||!G.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=t&&t<=r.endRow)}isColumnContainsMergedCell(t){return this._hasAll||!G.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=t&&t<=r.endColumn)}getMergedCellRange(t,r,s,i){const o=[],a=`${t}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const h of this._mergeData||[])en.intersects(h,{startRow:t,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(t,r,s,i){const o=[],a=this._mergeData,l=`${t}-${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:d,startColumn:f,endColumn:p}=a[h];for(let E=t;E<=s;E++){let R=!1;for(let I=r;I<=i;I++)if(E>=u&&E<=d&&I>=f&&I<=p){o.push({startRow:u,endRow:d,startColumn:f,endColumn:p}),c.push(h),R=!0;break}if(R)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(t){const r=this._rangeMap.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(t){const r=this._skeletonCache.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(t,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(t);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(t))==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(t){super();v(this,"_cellContentInterceptor",null);v(this,"_rowFilteredInterceptor",null);this.getRawCell=t}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,In.Value|In.Style):this.getRawCell(t,r)}getCellValueOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,In.Value):this.getRawCell(t,r)}getCellStyleOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,In.Style):this.getRawCell(t,r)}getRowFiltered(t){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(t))!=null?s:!1}registerCellContentInterceptor(t){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=t,Je(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(t){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=t,Je(()=>this._rowFilteredInterceptor=null)}}const xo={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class nr{constructor(n,t,r){v(this,"_sheetId");v(this,"_snapshot");v(this,"_cellData");v(this,"_rowManager");v(this,"_columnManager");v(this,"_viewModel");v(this,"_spanModel");var a;this.unitId=n,this._styles=r,this._snapshot=Zu(t);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:G.generateRandomId(6),this._cellData=new Pt(o),this._viewModel=new qu((l,c)=>this.getCellRaw(l,c)),this._rowManager=new SE(this._snapshot,this._viewModel,i),this._columnManager=new IE(this._snapshot,s),this._spanModel=new NE(this._snapshot.mergeData)}__interceptViewModel(n){n(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(n){this._snapshot.mergeData=n,this.getSpanModel().rebuild(n)}getSpanModel(){return this._spanModel}getColumnStyle(n,t=!1){return t?this._columnManager.getColumnStyle(n):this._styles.get(this._columnManager.getColumnStyle(n))}setColumnStyle(n,t){this._columnManager.setColumnStyle(n,t)}getRowStyle(n,t=!1){return t?this._rowManager.getRowStyle(n):this._styles.get(this._rowManager.getRowStyle(n))}setRowStyle(n,t){this._rowManager.setRowStyle(n,t)}mixinDefaultStyleToCellRaw(n,t,r,s){const i=this.getColumnStyle(t),o=this.getRowStyle(n),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?Ns(a,i,o,l):Ns(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const n=this._snapshot.defaultStyle;return this._styles.get(n)}setDefaultCellStyle(n){this._snapshot.defaultStyle=n}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const n=this.getCellMatrix(),t=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return n.forEach((c,h)=>{Object.keys(h).forEach(u=>{const d=+u,f=n.getValue(c,d),p=f!=null&&f.s?this._styles.get(f.s):null,E=(p==null?void 0:p.bd)&&(p.bd.b||p.bd.l||p.bd.r||p.bd.t||p.bd.bc_tr||p.bd.bl_tr||p.bd.ml_tr||p.bd.tl_bc||p.bd.tl_br||p.bd.tl_mr);(f&&(f.v||f.p)||p!=null&&p.bg||E)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),t.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:n}=this,t=G.deepClone(n);return new nr(this.unitId,t,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(n,t){return this._spanModel.getMergedCell(n,t)}getMergedCellRange(n,t,r,s){return this._spanModel.getMergedCellRange(n,t,r,s)}isRowContainsMergedCell(n){return this._spanModel.isRowContainsMergedCell(n)}isColumnContainsMergedCell(n){return this._spanModel.isColumnContainsMergedCell(n)}getCellInfoInMergeData(n,t){const r=this.getMergedCell(n,t);let s=!1,i=!1,o=n,a=t,l=n,c=t;if(r){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=r;n===h&&t===d?(o=u,a=f,l=h,c=d,i=!0):n>=h&&n<=u&&t>=d&&t<=f&&(o=u,a=f,l=h,c=d,s=!0)}return{actualRow:n,actualColumn:t,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(n,t){return n<0||t<0?null:this._viewModel.getCell(n,t)}getCellValueOnly(n,t){return n<0||t<0?null:this._viewModel.getCellValueOnly(n,t)}getCellStyleOnly(n,t){return n<0||t<0?null:this._viewModel.getCellStyleOnly(n,t)}getCellRaw(n,t){return this.getCellMatrix().getValue(n,t)}getRowFiltered(n){return this._viewModel.getRowFiltered(n)}getMatrixWithMergedCells(n,t,r,s,i=!1){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(n,t,r,s),l=new Pt;return Ps(n,r,t,s).forEach((c,h)=>{const u=i?this.getCellRaw(c,h):this.getCell(c,h);u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:d,endRow:f}=c;Ps(u,f,h,d).forEach((p,E)=>{p===u&&E===h&&l.setValue(p,E,{...o.getValue(p,E),rowSpan:f-u+1,colSpan:d-h+1}),(p!==u||E!==h)&&l.realDeleteValue(p,E)})}),l}getRange(n,t,r,s){return typeof n=="object"?new Tn(this,n,{getStyles:()=>this._styles}):new Tn(this,{startRow:n,startColumn:t,endColumn:s||t,endRow:r||n},{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:n}=this,{columnCount:t}=n;return t}getMaxRows(){const{_snapshot:n}=this,{rowCount:t}=n;return t}getRowCount(){return this._snapshot.rowCount}setRowCount(n){this._snapshot.rowCount=n}getColumnCount(){return this._snapshot.columnCount}setColumnCount(n){this._snapshot.columnCount=n}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:n}=this,{showGridlines:t}=n;return t===0}getTabColor(){const{_snapshot:n}=this,{tabColor:t}=n;return t}getColumnWidth(n){return this.getColumnManager().getColumnWidth(n)}getRowHeight(n){return this._viewModel.getRowFiltered(n)?0:this.getRowManager().getRowHeight(n)}isRowFiltered(n){return this._viewModel.getRowFiltered(n)}getRowVisible(n){return!this.isRowFiltered(n)&&this.getRowRawVisible(n)}getRowRawVisible(n){return this.getRowManager().getRowRawVisible(n)}getHiddenRows(n,t){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(n,t);return s.forEach(i=>i.endColumn=r),s}getColVisible(n){return this._columnManager.getColVisible(n)}getHiddenCols(n,t){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(n,t);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const n=this.getRowCount();return this._rowManager.getVisibleRows(0,n-1)}getVisibleCols(){const n=this.getColumnCount();return this._columnManager.getVisibleCols(0,n-1)}isRightToLeft(){const{_snapshot:n}=this,{rightToLeft:t}=n;return t}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(n){return n&&(n.v!==void 0||n.f!==void 0||n.p!==void 0)}iterateByRow(n,t=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n,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,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(u&&t){c=d.endColumn+1;continue}const p={row:l,col:c,value:h};return p.colSpan=d.endColumn-d.startColumn+1,p.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:p}}if(u&&t)c+=1;else{const f={row:l,col:c,value:h};return c+=1,{done:!1,value:f}}}}}}}}iterateByColumn(n,t=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=n,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 p=c!==u.startRow,E=p||h!==u.startColumn;if(r&&E||!r&&p){c=u.endRow+1;continue}const R=l.getCell(u.startRow,u.startColumn);if(!R&&t){c=u.endRow+1;continue}const D={row:c,col:u.startColumn,value:R};return D.colSpan=u.endColumn-u.startColumn+1,D.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:D}}const d=l.getCell(c,h);if(!d&&t)c+=1;else{const p={row:c,col:h,value:d};return c+=1,{done:!1,value:p}}}}}}}}_getCellDocumentModel(n,t=xo){var E;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...xo,...t},o=this._styles.getStyleByCell(n);if(!n)return;let a,l="document";const c=CE(o),h=i?ct.tr:c.textRotation||ct.tr;let u=c.horizontalAlign||ct.ht;const d=c.verticalAlign||ct.vt,f=c.wrapStrategy||ct.tb,p=c.paddingData||Ws;if(n.f&&s)a=yr(n.f.toString(),{},{verticalAlign:d}),u=ct.ht;else if(n.p){const{centerAngle:R,vertexAngle:I}=zu(h);a=this._updateConfigAndGetDocumentModel(r?G.deepClone(n.p):n.p,u,p,{horizontalAlign:u,verticalAlign:d,centerAngle:R,vertexAngle:I,wrapStrategy:f})}else if(n.v!=null){const R=Do(o);l=Lo(R).fontCache;let I=ec(n);n.t===Jt.FORCE_STRING&&s&&(I=`'${I}`),a=yr(I,R,{...c,textRotation:h,cellValueType:n.t})}return a&&n.linkUrl&&n.linkId&&Yu(a,n.linkUrl,n.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:f,verticalAlign:d,horizontalAlign:u,paddingData:p,fill:(E=o==null?void 0:o.bg)==null?void 0:E.rgb}}_updateConfigAndGetDocumentModel(n,t,r,s){var o,a,l,c,h;if(!s||!((o=n.body)!=null&&o.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(a=r.t)!=null?a:0,n.documentStyle.marginBottom=(l=r.b)!=null?l:2,n.documentStyle.marginLeft=(c=r.l)!=null?c:2,n.documentStyle.marginRight=(h=r.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig=s;const i=n.body.paragraphs||[];for(const u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=t;return new Wt(n)}getBlankCellDocumentModel(n){const t=this._getCellDocumentModel(n,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(n),s=Do(r);if(t!=null)return t.documentModel==null&&(t.documentModel=yr("",s)),t;const i="";let o="document";const a=ct.tr,l=ct.ht,c=ct.vt,h=ct.tb,u=Ws;return o=Lo({}).fontCache,{documentModel:yr(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(n){return this._getCellDocumentModel(n,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function ec(e){var r,s;if(!e)return"";const n=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(n)return Lt.transform.getPlainText(n);const t=e.v;return typeof t=="string"?e.t===Jt.BOOLEAN?t.toUpperCase():t.replace(/[\r\n]/g,""):typeof t=="number"?e.t===Jt.BOOLEAN?t?"TRUE":"FALSE":t.toString():typeof t=="boolean"?t?"TRUE":"FALSE":""}function ME(e){if(e===null)return"";if(e!=null&&e.p){const n=e==null?void 0:e.p.body;if(n==null)return"";const t=n.dataStream;return Lt.transform.getPlainText(t)}return e==null?void 0:e.v}var DE=Object.defineProperty,LE=Object.getOwnPropertyDescriptor,xE=(e,n,t,r)=>{for(var s=r>1?void 0:r?LE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&DE(n,t,s),s},UE=(e,n)=>(t,r)=>n(t,r,e);function PE(e,n){return`${e.getUnitId()}|${n.getSheetId()}`}exports.Workbook=class extends ts{constructor(t={},r){super();v(this,"type",ke.UNIVER_SHEET);v(this,"_sheetCreated$",new Ee.Subject);v(this,"sheetCreated$",this._sheetCreated$.asObservable());v(this,"_sheetDisposed$",new Ee.Subject);v(this,"sheetDisposed$",this._sheetDisposed$.asObservable());v(this,"_activeSheet$",new Ee.BehaviorSubject(null));v(this,"activeSheet$",this._activeSheet$.asObservable());v(this,"_worksheets");v(this,"_styles");v(this,"_snapshot");v(this,"_unitId");v(this,"_count");v(this,"_name$");v(this,"name$");this._logService=r;const s=G_();G.isEmptyObject(t)?this._snapshot=s:this._snapshot=G.commonExtend(s,t);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=G.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new $u(i),this._count=1,this._worksheets=new Map,this._name$=new Ee.BehaviorSubject(t.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(t){return typeof t=="string"||"startRow"in t||"row"in t}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return G.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(t){this._name$.next(t),this._snapshot.name=t}getUnitId(){return this._unitId}getRev(){var t;return(t=this._snapshot.rev)!=null?t:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(t){this._snapshot.rev=t}addWorksheet(t,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[t])return!1;i[t]=s,o.splice(r,0,t);const a=new nr(this._unitId,s,this._styles);return this._worksheets.set(t,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(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===t)}getActiveSheet(t){if(!this._activeSheet&&typeof t>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const t=this._activeSheet;if(t)return t;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()!==Te.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(t){this._activeSheet$.next(t)}removeSheet(t){const r=this._worksheets.get(t);return r?(this._worksheets.delete(t),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(t),1),delete this._snapshot.sheets[t],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:t}=this._snapshot;return t.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:t}=this._snapshot;return t.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:t}=this._snapshot,r=[];return t.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>t.getSheetId()===s)}getSheetBySheetName(t){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===t);return this._worksheets.get(s)}getSheetBySheetId(t){return this._worksheets.get(t)}getSheetByIndex(t){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[t])}getHiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden===Te.TRUE).map(t=>t.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden!==Te.TRUE).map(t=>t.getConfig().id)}load(t){this._snapshot=t}checkSheetName(t){return this.getSheetsName().includes(t)}uniqueSheetName(t="Sheet1"){let r=t;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}generateNewSheetName(t){let r=t+this._count;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:t,_worksheets:r}=this,{sheets:s,sheetOrder:i}=t;if(G.isEmptyObject(s)){const o=G.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 nr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}};exports.Workbook=xE([UE(1,Nt)],exports.Workbook);class bi extends ts{constructor(t){var r;super();v(this,"type",ke.UNIVER_SLIDE);v(this,"_activePage$",new Ee.BehaviorSubject(null));v(this,"activePage$",this._activePage$.asObservable());v(this,"_name$");v(this,"name$");v(this,"_snapshot");v(this,"_unitId");this._snapshot={...Fl,...t},this._unitId=(r=this._snapshot.id)!=null?r:G.generateRandomId(6),this._name$=new Ee.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const t=this._activePage$.getValue();if(!t){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return t}setName(t){var r;this._snapshot.title=t,this._name$.next(t),this._unitId=(r=this._snapshot.id)!=null?r:hn(6)}getRev(){return 0}incrementRev(){}setRev(t){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var t;return(t=this._snapshot.body)==null?void 0:t.pages}getPageOrder(){var t;return(t=this._snapshot.body)==null?void 0:t.pageOrder}getPage(t){const r=this.getPages();return r==null?void 0:r[t]}getElementsByPage(t){var r;return(r=this.getPage(t))==null?void 0:r.pageElements}getElement(t,r){var s;return(s=this.getElementsByPage(t))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const t=hn(6);return{id:t,pageType:Oi.SLIDE,zIndex:10,title:t,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(t){this._activePage$.next(t)}getActivePage(){return this._activePage}updatePage(t,r){this._snapshot.body&&(this._snapshot.body.pages[t]=r)}appendPage(t){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[t.id]=t;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,t.id)}}const Hn="FOCUSING_UNIT",On="FOCUSING_SHEET",Bn="FOCUSING_DOC",Wn="FOCUSING_SLIDE",kE="FOCUSING_EDITOR_BUT_HIDDEN",tc="EDITOR_ACTIVATED",FE="FOCUSING_EDITOR_INPUT_FORMULA",nc="FOCUSING_FX_BAR_EDITOR",$E="FOCUSING_UNIVER_EDITOR",jE="FOCUSING_EDITOR_INPUT_FORMULA",HE="FOCUSING_PANEL_EDITOR",BE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",WE="FOCUSING_COMMON_DRAWINGS",YE="FORMULA_EDITOR_ACTIVATED";var zE=Object.defineProperty,VE=Object.getOwnPropertyDescriptor,GE=(e,n,t,r)=>{for(var s=r>1?void 0:r?VE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&zE(n,t,s),s},Uo=(e,n)=>(t,r)=>n(t,r,e);const gn=Rt("univer.current");exports.UniverInstanceService=class extends rt{constructor(t,r){super();v(this,"_unitsByType",new Map);v(this,"_createHandler");v(this,"_ctorByType",new Map);v(this,"_currentUnits",new Map);v(this,"_currentUnits$",new Ee.BehaviorSubject(this._currentUnits));v(this,"currentUnits$",this._currentUnits$.asObservable());v(this,"_unitAdded$",new Ee.Subject);v(this,"unitAdded$",this._unitAdded$.asObservable());v(this,"_unitDisposed$",new Ee.Subject);v(this,"unitDisposed$",this._unitDisposed$.asObservable());v(this,"_focused$",new Ee.BehaviorSubject(null));v(this,"focused$",this._focused$.asObservable());this._injector=t,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(t){this._createHandler=t}createUnit(t,r,s){return this._createHandler(t,r,this._ctorByType.get(t),s)}registerCtorForType(t,r){return this._ctorByType.set(t,r),{dispose:()=>{this._ctorByType.delete(t)}}}getCurrentTypeOfUnit$(t){return this.currentUnits$.pipe(Ee.map(r=>{var s;return(s=r.get(t))!=null?s:null}),Ee.distinctUntilChanged())}getCurrentUnitForType(t){return this._currentUnits.get(t)}setCurrentUnitForType(t){const r=this._getUnitById(t);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${t}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(t){return this._unitAdded$.pipe(Ee.filter(r=>r.type===t))}__addUnit(t,r){var a;const s=t.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=t.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(t),this._unitAdded$.next(t),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(t.getUnitId())}getTypeOfUnitDisposed$(t){return this.unitDisposed$.pipe(Ee.filter(r=>r.type===t))}getUnit(t,r){var i;const s=(i=this._getUnitById(t))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(ke.UNIVER_DOC)}getUniverDocInstance(t){return this.getUnit(t,ke.UNIVER_DOC)}getUniverSheetInstance(t){return this.getUnit(t,ke.UNIVER_SHEET)}getAllUnitsForType(t){var r;return(r=this._unitsByType.get(t))!=null?r:[]}changeDoc(t,r){const s=this.getAllUnitsForType(ke.UNIVER_DOC),i=s.find(o=>o.getUnitId()===t);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const t=this._focused$.getValue();return t?(r=this._getUnitById(t))==null?void 0:r[0]:null}focusUnit(t){this._focused$.next(t),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(On,!0),this._contextService.setContextValue(Wn,!1),this.setCurrentUnitForType(t)):this.focused instanceof Wt?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!0),this._contextService.setContextValue(On,!1),this._contextService.setContextValue(Wn,!1),this.setCurrentUnitForType(t)):this.focused instanceof bi?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(On,!1),this._contextService.setContextValue(Wn,!0),this.setCurrentUnitForType(t)):(this._contextService.setContextValue(Hn,!1),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(On,!1),this._contextService.setContextValue(Wn,!1))}getFocusedUnit(){return this.focused}getUnitType(t){const r=this._getUnitById(t);return r?r[1]:ke.UNRECOGNIZED}disposeUnit(t){const r=this._getUnitById(t);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(t,i),this._tryBlurUnitOnRemoval(t),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(t,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===t&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(t){var r;((r=this.focused)==null?void 0:r.getUnitId())===t&&this._focused$.next(null)}_getUnitById(t){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===t);if(i)return[i,r]}}};exports.UniverInstanceService=GE([Uo(0,vt(Ft)),Uo(1,cr)],exports.UniverInstanceService);var Ve=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Ve||{});const KE={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var XE=Object.defineProperty,QE=Object.getOwnPropertyDescriptor,JE=(e,n,t,r)=>{for(var s=r>1?void 0:r?QE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&XE(n,t,s),s},ZE=(e,n)=>(t,r)=>n(t,r,e);exports.LifecycleService=class extends rt{constructor(t){super();v(this,"_lifecycle$",new Ee.BehaviorSubject(Ve.Starting));v(this,"lifecycle$",this._lifecycle$.asObservable());v(this,"_lock",!1);this._logService=t,this._reportProgress(Ve.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(t){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(t<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");t!==this.stage&&(this._lock=!0,this._reportProgress(t),this._lifecycle$.next(t),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return Ee.merge(rc(this.stage),this._lifecycle$.pipe(Ee.skip(1))).pipe(Va(t=>t===Ve.Steady))}_reportProgress(t){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${KE[t]}".`)}};exports.LifecycleService=JE([ZE(0,Nt)],exports.LifecycleService);function rc(e){switch(e){case Ve.Starting:return Ee.of(Ve.Starting);case Ve.Ready:return Ee.of(Ve.Starting,Ve.Ready);case Ve.Rendered:return Ee.of(Ve.Starting,Ve.Ready,Ve.Rendered);default:return Ee.of(Ve.Starting,Ve.Ready,Ve.Rendered,Ve.Steady)}}var qE=Object.defineProperty,e0=Object.getOwnPropertyDescriptor,t0=(e,n,t,r)=>{for(var s=r>1?void 0:r?e0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&qE(n,t,s),s},ds=(e,n)=>(t,r)=>n(t,r,e);const Qt=Rt("univer.undo-redo.service"),n0=20;class sc{dispose(){}async dispatchToHandlers(){return!1}}const ic="univer.command.redo",oc="univer.command.undo",rr=new class extends sc{constructor(){super(...arguments);v(this,"type",hr.COMMAND);v(this,"id",oc)}async handler(n){const t=n.get(Qt),r=t.pitchTopUndoElement();if(!r)return!1;const s=n.get(Ut);return fi(r.undoMutations,s)?(t.popUndoToRedo(),!0):!1}},sr=new class extends sc{constructor(){super(...arguments);v(this,"type",hr.COMMAND);v(this,"id",ic)}async handler(n){const t=n.get(Qt),r=t.pitchTopRedoElement();if(!r)return!1;const s=n.get(Ut);return fi(r.redoMutations,s)?(t.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends rt{constructor(t,r,s){super();v(this,"undoRedoStatus$");v(this,"_undoRedoStatus$",new Ee.BehaviorSubject({undos:0,redos:0}));v(this,"_undoStacks",new Map);v(this,"_redoStacks",new Map);v(this,"_batchingStatus",new Map);this._univerInstanceService=t,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(rr)),this.disposeWithMe(this._commandService.registerCommand(sr)),this.disposeWithMe(Je(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Je(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(t){const{unitID:r}=t,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(t.unitID)){const a=this._batchingStatus.get(t.unitID),l=this._pitchUndoElement(t.unitID);a===0||!l?(o(t),this._batchingStatus.set(t.unitID,1)):this._tryBatchingElements(l,t)}else o(t);function o(a){i.push(a),i.length>n0&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(t){const r=this._getRedoStack(t);r&&(r.length=0);const s=this._getUndoStack(t);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const t=this._getFocusedUnitId();return this._pitchUndoElement(t)}pitchTopRedoElement(){const t=this._getFocusedUnitId();return this._pitchRedoElement(t)}_pitchUndoElement(t){const r=this._getUndoStack(t);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(t){const r=this._getRedoStack(t);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(t){if(this._batchingStatus.has(t))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(t,0),Je(()=>this._batchingStatus.delete(t))}_updateStatus(){var i,o;const t=this._getFocusedUnitId(),r=t&&((i=this._undoStacks.get(t))==null?void 0:i.length)||0,s=t&&((o=this._redoStacks.get(t))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(t,r=!1){let s=this._undoStacks.get(t);return!s&&r&&(s=[],this._undoStacks.set(t,s)),s||null}_getRedoStack(t,r=!1){let s=this._redoStacks.get(t);return!s&&r&&(s=[],this._redoStacks.set(t,s)),s||null}_getUndoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getUndoStack(t,!0)}_getRedoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getRedoStack(t,!0)}_tryBatchingElements(t,r){t.redoMutations.push(...r.redoMutations),t.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let t="";const r=this._contextService.getContextValue(On),s=this._contextService.getContextValue(nc),i=this._contextService.getContextValue(tc);return r?s?t=ii:i?t=si:t=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":t=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",t}};exports.LocalUndoRedoService=t0([ds(0,gn),ds(1,Ut),ds(2,cr)],exports.LocalUndoRedoService);const ns=Rt("core.resource-manager.service"),Ys={[xt.Editor]:"Editor",[xt.Owner]:"Owner",[xt.Reader]:"Reader",[xt.UNRECOGNIZED]:"UNRECOGNIZED"},Wr=e=>e?{userID:`${Ys[e]}_${G.generateRandomId(8)}`,name:Ys[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},r0=(e,n)=>e.startsWith(Ys[n]);class ir{constructor(){v(this,"_model",new Map);v(this,"_userChange$",new Ee.Subject);v(this,"userChange$",this._userChange$.asObservable());v(this,"_currentUser$",new Ee.BehaviorSubject(Wr()));v(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(n){this.addUser(n),this._currentUser$.next(n)}addUser(n){this._model.set(n.userID,n),this._userChange$.next({type:"add",user:n})}getUser(n,t){const r=this._model.get(n);if(r)return r;t&&t()}delete(n){const t=this.getUser(n);this._model.delete(n),t&&this._userChange$.next({type:"delete",user:t})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var s0=Object.defineProperty,i0=Object.getOwnPropertyDescriptor,o0=(e,n,t,r)=>{for(var s=r>1?void 0:r?i0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&s0(n,t,s),s},Po=(e,n)=>(t,r)=>n(t,r,e);exports.AuthzIoLocalService=class{constructor(n,t){v(this,"_permissionMap",new Map([]));this._resourceManagerService=n,this._userManagerService=t,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const n=this._userManagerService.getCurrentUser();n&&n.userID||this._userManagerService.setCurrentUser(Wr(xt.Owner))}_getRole(n){const t=this._userManagerService.getCurrentUser();return t?r0(t.userID,n):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:n=>{const t=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(t)},parseJson:n=>JSON.parse(n),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[ke.UNIVER_SHEET,ke.UNIVER_DOC,ke.UNIVER_SLIDE],onLoad:(n,t)=>{for(const r in t)this._permissionMap.set(r,t[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(n){return hn(8)}async allowed(n){return Promise.resolve([])}async batchAllowed(n){return Promise.resolve([])}async list(n){const t=[];return n.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:n.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:xt.Owner,shareScope:-1,scope:{read:ks.AllCollaborator,edit:ks.AllCollaborator},creator:Wr(xt.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:n.actions.map(o=>({action:o,allowed:this._getRole(xt.Owner)||this._getRole(xt.Editor)}))};t.push(i)}}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(n){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(n){}};exports.AuthzIoLocalService=o0([Po(0,ns),Po(1,vt(ir))],exports.AuthzIoLocalService);const ac=Rt("IAuthzIoIoService"),lc=Rt("univer.config-service");class uc{constructor(){v(this,"_configChanged$",new Ee.Subject);v(this,"configChanged$",this._configChanged$.asObservable());v(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(n){return this._config.get(n)}setConfig(n,t,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(n))!=null?o:{};s?i=G.deepMerge(i,t):i=t,this._config.set(n,i),this._configChanged$.next({[n]:i})}deleteConfig(n){return this._config.delete(n)}subscribeConfigValue$(n){return new Ee.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,n)&&t.next(this._config.get(n));const r=this.configChanged$.pipe(Ee.filter(s=>Object.prototype.hasOwnProperty.call(s,n))).subscribe(s=>t.next(s[n]));return()=>r.unsubscribe()})}}class cc extends rt{constructor(){super(...arguments);v(this,"_error$",new Ee.Subject);v(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(t){this._error$.next({errorKey:t})}}class Kn extends rt{constructor(){super();v(this,"_currentLocale$",new Ee.BehaviorSubject(dr.ZH_CN));v(this,"currentLocale$",this._currentLocale$.asObservable());v(this,"_locales",null);v(this,"localeChanged$",new Ee.Subject);v(this,"t",(t,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=t.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 t});this.disposeWithMe(Je(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(t){var r;this._locales=G.deepMerge((r=this._locales)!=null?r:{},t)}setLocale(t){this._currentLocale$.next(t),this.localeChanged$.next()}getLocales(){var t;return(t=this._locales)==null?void 0:t[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(t,r){const s=r.shift();if(s&&t&&s in t){const i=t[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var a0=Object.defineProperty,l0=Object.getOwnPropertyDescriptor,u0=(e,n,t,r)=>{for(var s=r>1?void 0:r?l0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&a0(n,t,s),s},c0=(e,n)=>(t,r)=>n(t,r,e);exports.MentionIOLocalService=class{constructor(n){this._userManagerService=n}async list(n){return{list:[{type:Pr.PERSON,mentions:[{objectType:Pr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:n.page,size:n.size,total:1}}};exports.MentionIOLocalService=u0([c0(0,vt(ir))],exports.MentionIOLocalService);const hc=Rt("univer.service.mention-io");var Ai=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(Ai||{});const dc=Rt("univer.permission-service");class fc extends rt{constructor(){super(...arguments);v(this,"_permissionPointMap",new Map);v(this,"_permissionPointUpdate$",new Ee.Subject);v(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());v(this,"_showComponents",!0)}setShowComponents(t){this._showComponents=t}getShowComponents(){return this._showComponents}deletePermissionPoint(t){const r=this._permissionPointMap.get(t);r&&(r.complete(),this._permissionPointMap.delete(t))}addPermissionPoint(t){const r=t instanceof Ee.BehaviorSubject,s=r?t.getValue():t;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?t:new Ee.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(t,r){const s=this._permissionPointMap.get(t);if(!s)return;const i=s.getValue();i.value=r,i.status=Ai.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(t){const r=this._permissionPointMap.get(t);if(r)return r.getValue()}getPermissionPoint$(t){const r=this._permissionPointMap.get(t);if(r)return r}composePermission$(t){const r=t.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 Ee.combineLatest(r).pipe(Ar.map(s=>s))}composePermission(t){return t.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 t=new Map;return this._permissionPointMap.forEach((r,s)=>{t.set(s,r)}),t}}const gc=Symbol("DependentOn");class zs extends rt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}v(zs,"pluginName"),v(zs,"type",ke.UNIVER_UNKNOWN);class h0{constructor(){v(this,"_plugins",[])}addPlugin(n){this._plugins.push(n)}removePlugins(){const n=this._plugins.slice();return this._plugins.length=0,n}forEachPlugin(n){this._plugins.forEach(n)}}class d0{constructor(){v(this,"_pluginsRegistered",[])}registerPlugin(n,t){this._pluginsRegistered.push({plugin:n,options:t})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var f0=Object.defineProperty,g0=Object.getOwnPropertyDescriptor,mc=(e,n,t,r)=>{for(var s=r>1?void 0:r?g0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&f0(n,t,s),s},Dr=(e,n)=>(t,r)=>n(t,r,e);const m0=4;function p0(...e){return function(n){n[gc]=e}}exports.PluginService=class{constructor(n){v(this,"_pluginHolderForUniver");v(this,"_pluginHoldersForTypes",new Map);v(this,"_seenPlugins",new Set);v(this,"_flushTimer");this._injector=n,this._pluginHolderForUniver=this._injector.createInstance(Yr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set(ke.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const n of this._pluginHoldersForTypes.values())n.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(n,t){this._assertPluginValid(n),this._scheduleInitPlugin();const{type:r}=n;r===ke.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(n,t),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(n,t)}startPluginForType(n){this._ensurePluginHolderForType(n).start()}_ensurePluginHolderForType(n){if(!this._pluginHoldersForTypes.has(n)){const t=this._injector.createInstance(Yr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(n,t),t}return this._pluginHoldersForTypes.get(n)}_immediateInitPlugin(n){this._seenPlugins.add(n.pluginName),this._ensurePluginHolderForType(n.type).immediateInitPlugin(n)}_checkPluginSeen(n){return this._seenPlugins.has(n.pluginName)}_assertPluginValid(n){const{type:t,pluginName:r}=n;if(t===ke.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${n.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${n.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(n.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},m0))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[n,t]of this._pluginHoldersForTypes)t.started&&t.flush()}};exports.PluginService=mc([Dr(0,vt(Ft))],exports.PluginService);let Yr=class extends rt{constructor(n,t,r,s,i){super();v(this,"_started",!1);v(this,"_warnedAboutOnStartingDeprecation",!1);v(this,"_pluginRegistry",new d0);v(this,"_pluginStore",new h0);v(this,"_pluginsInBatches",[]);this._checkPluginRegistered=n,this._registerPlugin=t,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Ee.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(n=>n.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(n,t){this._pluginRegistry.registerPlugin(n,t)}immediateInitPlugin(n){const t=this._initPlugin(n,void 0);this._pluginsRunLifecycle([t])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const n=this._pluginRegistry.getRegisterPlugins().map(({plugin:t,options:r})=>this._initPlugin(t,r));n.length&&(this._pluginsRunLifecycle(n),this._pluginRegistry.removePlugins())}_initPlugin(n,t){const r=n[gc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${n.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(n,t);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(n){rc(this._lifecycleService.stage).subscribe(t=>this._runStage(n,t)),this._pluginsInBatches.push(n)}_runStage(n,t){n.forEach(r=>{switch(t){case Ve.Starting:r.onStarting();break;case Ve.Ready:r.onReady();break;case Ve.Rendered:r.onRendered();break;case Ve.Steady:r.onSteady();break}})}};Yr=mc([Dr(2,Nt),Dr(3,vt(Ft)),Dr(4,vt(exports.LifecycleService))],Yr);function pc(e,n){if(!n)return e;const t=[];for(const r of e){const s=n.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;t.push([r[0],s[1]])}else t.push(r)}return t}var _0=Object.defineProperty,E0=Object.getOwnPropertyDescriptor,C0=(e,n,t,r)=>{for(var s=r>1?void 0:r?E0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&_0(n,t,s),s},ko=(e,n)=>(t,r)=>n(t,r,e);let Vs=class extends rt{constructor(e,n){super(),this._resourceManagerService=e,this._univerInstanceService=n,this._init()}_init(){const e=t=>{t.businesses.forEach(r=>{switch(r){case ke.UNRECOGNIZED:case ke.UNIVER_UNKNOWN:case ke.UNIVER_SLIDE:case ke.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(ke.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}});break}case ke.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(ke.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ke.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ke.UNIVER_DOC).subscribe(t=>{const r=t.getUnitId();Ea(r)||this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ke.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ke.UNIVER_DOC).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())}))}saveUnit(e){const n=this._univerInstanceService.getUnit(e);if(!n)return null;const t=this._resourceManagerService.getResources(e,n.type),r=G.deepClone(n.getSnapshot());return r.resources=t,r}};Vs=C0([ko(0,vt(ns)),ko(1,vt(gn))],Vs);const Gs=Rt("resource-loader-service");class _c extends rt{constructor(){super(...arguments);v(this,"_resourceMap",new Map);v(this,"_register$",new Ee.Subject);v(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(t,r){return r?this.getResourcesByType(t,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}getResourcesByType(t,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}registerPluginResource(t){const r=t.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,t),this._register$.next(t),Je(()=>this._resourceMap.delete(r))}disposePluginResource(t){this._resourceMap.delete(t)}loadResources(t,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(t,a)}catch{console.error("LoadResources Error!")}})}unloadResources(t){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(t)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Ti extends rt{constructor(){super();v(this,"_currentTheme");v(this,"_currentTheme$",new Ee.BehaviorSubject({}));v(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Je(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(t){this._currentTheme=t,this._currentTheme$.next(t)}}class Ec{constructor(n={},t){v(this,"_startedTypes",new Set);v(this,"_injector");const r=this._injector=v0(t,n==null?void 0:n.override),{theme:s,locale:i,locales:o,logLevel:a}=n;s&&this._injector.get(Ti).setTheme(s),o&&this._injector.get(Kn).load(o),i&&this._injector.get(Kn).setLocale(i),a&&this._injector.get(Nt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(gn)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(n){this._injector.get(Kn).setLocale(n)}createUnit(n,t){return this._univerInstanceService.createUnit(n,t)}createUniverSheet(n){return this._injector.get(Nt).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ke.UNIVER_SHEET,n)}createUniverDoc(n){return this._injector.get(Nt).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ke.UNIVER_DOC,n)}createUniverSlide(n){return this._injector.get(Nt).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ke.UNIVER_SLIDE,n)}_init(n){this._univerInstanceService.registerCtorForType(ke.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType(ke.UNIVER_DOC,Wt),this._univerInstanceService.registerCtorForType(ke.UNIVER_SLIDE,bi);const t=n.get(gn);t.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=n.createInstance(i,s);return t.__addUnit(l,o),this._tryProgressToReady(),l}const a=n.createInstance(i,s);return t.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<Ve.Ready&&(this._injector.get(exports.LifecycleService).stage=Ve.Ready)}registerPlugin(n,t){this._pluginService.registerPlugin(n,t)}}function v0(e,n){const t=pc([[cc],[Kn],[Ti],[exports.LifecycleService],[exports.PluginService],[ir],[gn,{useClass:exports.UniverInstanceService}],[dc,{useClass:fc}],[Nt,{useClass:Wa,lazy:!0}],[Ut,{useClass:exports.CommandService}],[Qt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[lc,{useClass:uc}],[cr,{useClass:Ha}],[ns,{useClass:_c,lazy:!0}],[Gs,{useClass:Vs,lazy:!0}],[ac,{useClass:exports.AuthzIoLocalService,lazy:!0}],[hc,{useClass:exports.MentionIOLocalService,lazy:!0}]],n),r=e?e.createChild(t):new Ft(t);return Ua(r,[[ir],[Gs]]),r}var R0=Object.defineProperty,I0=Object.getOwnPropertyDescriptor,S0=(e,n,t,r)=>{for(var s=r>1?void 0:r?I0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&R0(n,t,s),s},Fo=(e,n)=>(t,r)=>n(t,r,e);exports.FHooks=class extends qn{constructor(n,t){super(),this._injector=n,this._lifecycleService=t}onStarting(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Starting)).subscribe(n))}onReady(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Ready)).subscribe(n))}onRendered(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Rendered)).subscribe(n))}onSteady(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Steady)).subscribe(n))}onBeforeUndo(n){return this._injector.get(Ut).beforeCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Qt).pitchTopUndoElement();i&&n(i)}})}onUndo(n){return this._injector.get(Ut).onCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Qt).pitchTopUndoElement();i&&n(i)}})}onBeforeRedo(n){return this._injector.get(Ut).beforeCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Qt).pitchTopRedoElement();i&&n(i)}})}onRedo(n){return this._injector.get(Ut).onCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Qt).pitchTopRedoElement();i&&n(i)}})}};exports.FHooks=S0([Fo(0,vt(Ft)),Fo(1,vt(exports.LifecycleService))],exports.FHooks);var O0=Object.defineProperty,y0=Object.getOwnPropertyDescriptor,w0=(e,n,t,r)=>{for(var s=r>1?void 0:r?y0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&O0(n,t,s),s},fs=(e,n)=>(t,r)=>n(t,r,e);exports.FUniver=class extends qn{constructor(n,t,r){super(),this._injector=n,this._commandService=t,this._univerInstanceService=r}static newAPI(n){return(n instanceof Ec?n.__getInjector():n).createInstance(exports.FUniver)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(rr.id)}redo(){return this._commandService.executeCommand(sr.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((t,r)=>{n(t,r)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((t,r)=>{n(t,r)})}executeCommand(n,t,r){return this._commandService.executeCommand(n,t,r)}syncExecuteCommand(n,t,r){return this._commandService.syncExecuteCommand(n,t,r)}getHooks(){return this._injector.createInstance(exports.FHooks)}};exports.FUniver=w0([fs(0,vt(Ft)),fs(1,Ut),fs(2,gn)],exports.FUniver);function Cc(e){return/^-?\d+(\.\d+)?$/.test(e)}function b0(e){return Cc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}class Ni{constructor(){v(this,"_data",[])}static create(){return new Ni}add(n){this._data.indexOf(n)>-1||this._data.push(n)}delete(n){const t=this._data.indexOf(n);this._data.splice(t,1)}getData(){return this._data}}class Mi{constructor(){v(this,"_data",new Map)}static create(){return new Mi}add(n,t){this._data.has(n)||this._data.set(n,t)}delete(n){this._data.delete(n)}getData(){return this._data}}function A0(e){const n=new MessageChannel;let t=!1;const r=()=>{t||e()};return n.port1.onmessage=r,n.port2.postMessage(null),()=>{t=!0,n.port1.close(),n.port2.close()}}function T0(e,n){return n.forEach(t=>e.add(t)),e}function N0(e,n,t,r){var c;if(n==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Wt(s),o=n.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(n))>=0;){const h=new nt,u=fn.getInstance();if(a>0&&h.retain(a),t.length>0){const d=i.sliceBody(a,a+o),f={dataStream:t};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:t.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const p=d.customRanges[0];f.customRanges=[{...p,startIndex:0,endIndex:t.length-1}]}h.insert(t.length,f)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const M0="__default_document_sub_component_id20231101__";class vc{constructor(){v(this,"skipNextObservers",!1);v(this,"lastReturnValue");v(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class D0 extends Ee.Subject{constructor(){super(...arguments);v(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(t){let r;typeof t=="function"?r={next:([i,o])=>t(i,o)}:r=t;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(t=>{var r;return(r=t.complete)==null?void 0:r.call(t)}),this._sortedObservers.length=0}emitEvent(t){var r;if(!this.closed){const s=new vc;s.lastReturnValue=t;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[t,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 L0(e){return new Ee.Observable(n=>{const t=e.subscribeEvent(r=>{n.next(r)});return()=>t.unsubscribe()})}const x0=Rt("ILocalStorageService");function U0(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function P0(e){return new Promise(n=>setTimeout(n,e))}const k0=["script","style","meta","comment","link"];var Rc=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Rc||{}),Ic=(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))(Ic||{}),Sc=(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))(Sc||{}),Oc=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Oc||{}),yc=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(yc||{}),wc=(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))(wc||{});const $o=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],gs=1,Pn=8;class Di{static from(n){if(!(n instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(n,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==gs)throw new Error(`Got v${s} data when expected v${gs}.`);const i=$o[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(n,2,1),[a]=new Uint32Array(n,4,1);return new Di(a,o,i,n)}constructor(n,t=64,r=Float64Array,s){if(isNaN(n)||n<0)throw new Error(`Unpexpected numItems value: ${n}.`);this.numItems=+n,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=n<65536?Uint16Array:Uint32Array;const i=$o.indexOf(this.ArrayType),o=n*2*this.ArrayType.BYTES_PER_ELEMENT,a=n*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,Pn,n),this.coords=new this.ArrayType(this.data,Pn+a+l,n*2),this._pos=n*2,this._finished=!0):(this.data=new ArrayBuffer(Pn+o+a+l),this.ids=new this.IndexArrayType(this.data,Pn,n),this.coords=new this.ArrayType(this.data,Pn+a+l,n*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(gs<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=n)}add(n,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=n,this.coords[this._pos++]=t,r}finish(){const n=this._pos>>1;if(n!==this.numItems)throw new Error(`Added ${n} items when expected ${this.numItems}.`);return Ks(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(n,t,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,d=l.pop()||0;if(u-d<=a){for(let R=d;R<=u;R++){const I=o[2*R],D=o[2*R+1];I>=n&&I<=r&&D>=t&&D<=s&&c.push(i[R])}continue}const f=d+u>>1,p=o[2*f],E=o[2*f+1];p>=n&&p<=r&&E>=t&&E<=s&&c.push(i[f]),(h===0?n<=p:t<=E)&&(l.push(d),l.push(f-1),l.push(1-h)),(h===0?r>=p:s>=E)&&(l.push(f+1),l.push(u),l.push(1-h))}return c}within(n,t,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,d=a.pop()||0;if(u-d<=o){for(let R=d;R<=u;R++)jo(i[2*R],i[2*R+1],n,t)<=c&&l.push(s[R]);continue}const f=d+u>>1,p=i[2*f],E=i[2*f+1];jo(p,E,n,t)<=c&&l.push(s[f]),(h===0?n-r<=p:t-r<=E)&&(a.push(d),a.push(f-1),a.push(1-h)),(h===0?n+r>=p:t+r>=E)&&(a.push(f+1),a.push(u),a.push(1-h))}return l}}function Ks(e,n,t,r,s,i){if(s-r<=t)return;const o=r+s>>1;bc(e,n,o,r,s,i),Ks(e,n,t,r,o-1,1-i),Ks(e,n,t,o+1,s,1-i)}function bc(e,n,t,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=t-r+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(h-c/2<0?-1:1),p=Math.max(r,Math.floor(t-h*d/c+f)),E=Math.min(s,Math.floor(t+(c-h)*d/c+f));bc(e,n,t,p,E,i)}const o=n[2*t+i];let a=r,l=s;for(kn(e,n,r,t),n[2*s+i]>o&&kn(e,n,r,s);a<l;){for(kn(e,n,a,l),a++,l--;n[2*a+i]<o;)a++;for(;n[2*l+i]>o;)l--}n[2*r+i]===o?kn(e,n,r,l):(l++,kn(e,n,l,s)),l<=t&&(r=l+1),t<=l&&(s=l-1)}}function kn(e,n,t,r){ms(e,t,r),ms(n,2*t,2*r),ms(n,2*t+1,2*r+1)}function ms(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function jo(e,n,t,r){const s=e-t,i=n-r;return s*s+i*i}function Ac(e,n,t=0,r=e.length-1,s=F0){for(;r>t;){if(r-t>600){const l=r-t+1,c=n-t+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(t,Math.floor(n-c*u/l+d)),p=Math.min(r,Math.floor(n+(l-c)*u/l+d));Ac(e,n,f,p,s)}const i=e[n];let o=t,a=r;for(Fn(e,t,n),s(e[r],i)>0&&Fn(e,t,r);o<a;){for(Fn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[t],i)===0?Fn(e,t,a):(a++,Fn(e,a,r)),a<=n&&(t=a+1),n<=a&&(r=a-1)}}function Fn(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function F0(e,n){return e<n?-1:e>n?1:0}class Ho{constructor(n=9){this._maxEntries=Math.max(4,n),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(n){let t=this.data;const r=[];if(!br(n,t))return r;const s=this.toBBox,i=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?s(a):a;br(n,l)&&(t.leaf?r.push(a):_s(n,l)?this._all(a,r):i.push(a))}t=i.pop()}return r}collides(n){let t=this.data;if(!br(n,t))return!1;const r=[];for(;t;){for(let s=0;s<t.children.length;s++){const i=t.children[s],o=t.leaf?this.toBBox(i):i;if(br(n,o)){if(t.leaf||_s(n,o))return!0;r.push(i)}}t=r.pop()}return!1}load(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(let r=0;r<n.length;r++)this.insert(n[r]);return this}let t=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const r=this.data;this.data=t,t=r}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(n){return n&&this._insert(n,this.data.height-1),this}clear(){return this.data=Rn([]),this}remove(n,t){if(!n)return this;let r=this.data;const s=this.toBBox(n),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=$0(n,r.children,t);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&_s(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(n){return n}compareMinX(n,t){return n.minX-t.minX}compareMinY(n,t){return n.minY-t.minY}toJSON(){return this.data}fromJSON(n){return this.data=n,this}_all(n,t){const r=[];for(;n;)n.leaf?t.push(...n.children):r.push(...n.children),n=r.pop();return t}_build(n,t,r,s){const i=r-t+1;let o=this._maxEntries,a;if(i<=o)return a=Rn(n.slice(t,r+1)),Cn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=Rn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Bo(n,t,r,c,this.compareMinX);for(let h=t;h<=r;h+=c){const u=Math.min(h+c-1,r);Bo(n,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(n,d,f,s-1))}}return Cn(a,this.toBBox),a}_chooseSubtree(n,t,r,s){for(;s.push(t),!(t.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],h=ps(c),u=B0(n,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}t=a||t.children[0]}return t}_insert(n,t,r){const s=r?n:this.toBBox(n),i=[],o=this._chooseSubtree(s,this.data,t,i);for(o.children.push(n),zn(o,s);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(s,i,t)}_split(n,t){const r=n[t],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=Rn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Cn(r,this.toBBox),Cn(a,this.toBBox),t?n[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(n,t){this.data=Rn([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Cn(this.data,this.toBBox)}_chooseSplitIndex(n,t,r){let s,i=1/0,o=1/0;for(let a=t;a<=r-t;a++){const l=Yn(n,0,a,this.toBBox),c=Yn(n,a,r,this.toBBox),h=W0(l,c),u=ps(l)+ps(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-t}_chooseSplitAxis(n,t,r){const s=n.leaf?this.compareMinX:j0,i=n.leaf?this.compareMinY:H0,o=this._allDistMargin(n,t,r,s),a=this._allDistMargin(n,t,r,i);o<a&&n.children.sort(s)}_allDistMargin(n,t,r,s){n.children.sort(s);const i=this.toBBox,o=Yn(n,0,t,i),a=Yn(n,r-t,r,i);let l=wr(o)+wr(a);for(let c=t;c<r-t;c++){const h=n.children[c];zn(o,n.leaf?i(h):h),l+=wr(o)}for(let c=r-t-1;c>=t;c--){const h=n.children[c];zn(a,n.leaf?i(h):h),l+=wr(a)}return l}_adjustParentBBoxes(n,t,r){for(let s=r;s>=0;s--)zn(t[s],n)}_condense(n){for(let t=n.length-1,r;t>=0;t--)n[t].children.length===0?t>0?(r=n[t-1].children,r.splice(r.indexOf(n[t]),1)):this.clear():Cn(n[t],this.toBBox)}}function $0(e,n,t){if(!t)return n.indexOf(e);for(let r=0;r<n.length;r++)if(t(e,n[r]))return r;return-1}function Cn(e,n){Yn(e,0,e.children.length,n,e)}function Yn(e,n,t,r,s){s||(s=Rn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=n;i<t;i++){const o=e.children[i];zn(s,e.leaf?r(o):o)}return s}function zn(e,n){return e.minX=Math.min(e.minX,n.minX),e.minY=Math.min(e.minY,n.minY),e.maxX=Math.max(e.maxX,n.maxX),e.maxY=Math.max(e.maxY,n.maxY),e}function j0(e,n){return e.minX-n.minX}function H0(e,n){return e.minY-n.minY}function ps(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function wr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function B0(e,n){return(Math.max(n.maxX,e.maxX)-Math.min(n.minX,e.minX))*(Math.max(n.maxY,e.maxY)-Math.min(n.minY,e.minY))}function W0(e,n){const t=Math.max(e.minX,n.minX),r=Math.max(e.minY,n.minY),s=Math.min(e.maxX,n.maxX),i=Math.min(e.maxY,n.maxY);return Math.max(0,s-t)*Math.max(0,i-r)}function _s(e,n){return e.minX<=n.minX&&e.minY<=n.minY&&n.maxX<=e.maxX&&n.maxY<=e.maxY}function br(e,n){return n.minX<=e.maxX&&n.minY<=e.maxY&&n.maxX>=e.minX&&n.maxY>=e.minY}function Rn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Bo(e,n,t,r,s){const i=[n,t];for(;i.length;){if(t=i.pop(),n=i.pop(),t-n<=r)continue;const o=n+Math.ceil((t-n)/r/2)*r;Ac(e,o,n,t,s),i.push(n,o,o,t)}}class Y0{constructor(n=!1){v(this,"_tree",new Map);v(this,"_oneCellCache",new Map);v(this,"_kdTree",new Map);this._enableOneCellCache=n}dispose(){this.clear()}getTree(n,t){return this._tree.has(n)||this._tree.set(n,new Map),this._tree.get(n).has(t)||this._tree.get(n).set(t,new Ho),this._tree.get(n).get(t)}_getOneCellCache(n,t,r,s){return this._oneCellCache.has(n)||this._oneCellCache.set(n,new Map),this._oneCellCache.get(n).has(t)||this._oneCellCache.get(n).set(t,new Map),this._oneCellCache.get(n).get(t).has(r)||this._oneCellCache.get(n).get(t).set(r,new Map),this._oneCellCache.get(n).get(t).get(r).has(s)||this._oneCellCache.get(n).get(t).get(r).set(s,new Set),this._oneCellCache.get(n).get(t).get(r).get(s)}_removeOneCellCache(n,t,r,s,i){const o=this._oneCellCache.get(n);if(!o)return;const a=o.get(t);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this._oneCellCache.get(t);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:h,endColumn:u}=s;for(let d=l;d<=h;d++){const f=a.get(d);if(f)for(let p=c;p<=u;p++){const E=f.get(p);E&&E.delete(i)}}}_insertOneCellCache(n,t,r,s,i){this._getOneCellCache(n,t,r,s).add(i)}_getRdTreeItems(n){const t=[];for(const[r,s]of n)for(const[i,o]of s)t.push({x:i,y:r,ids:o});return t}_searchByOneCellCache(n){var p;const{unitId:t,sheetId:r,range:s}=n,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(p=this._kdTree.get(t))==null?void 0:p.get(r);if(!c)return[];const{tree:h,items:u}=c,d=h.range(o,i,l,a),f=[];for(const E of d){const R=u[E];f.push(...Array.from(R.ids))}return f}openKdTree(){var n;for(const[t,r]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new Di(o.length);(n=this._kdTree.get(t))==null||n.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var n;for(const[t,r]of this._oneCellCache)for(const[s,i]of r)(n=this._kdTree.get(t))==null||n.set(s,void 0)}insert(n){const{unitId:t,sheetId:r,range:s,id:i}=n;if(!t||t.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(t,r,o,l,i);return}const h=this.getTree(t,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(n){for(const t of n)this.insert(t)}*searchGenerator(n){var a;const{unitId:t,sheetId:r,range:s}=n;if(this._enableOneCellCache){const l=this._searchByOneCellCache(n);for(const c of l)yield c}const i=(a=this._tree.get(t))==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(n,t){const r=new Set;for(const s of n)for(const i of this.searchGenerator(s))(t==null?void 0:t.has(i))!==!0&&r.add(i);return r}removeById(n,t){var r,s;t?((r=this._tree.get(n))==null||r.delete(t),(s=this._oneCellCache.get(n))==null||s.delete(t)):(this._tree.delete(n),this._oneCellCache.delete(n))}_removeRTreeItem(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this.getTree(t,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(n){const{unitId:t,sheetId:r,range:s,id:i}=n,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(t,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(n),this._removeRTreeItem(n)):this._removeRTreeItem(n)}bulkRemove(n){for(const t of n)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const n={};return this._tree.forEach((t,r)=>{n[r]={},t.forEach((s,i)=>{n[r][i]=s.toJSON()})}),n}fromJSON(n){this._tree.clear();for(const t in n){this._tree.set(t,new Map);for(const r in n[t]){const s=new Ho;s.fromJSON(n[t][r]),this._tree.get(t).set(r,s)}}}}Lc();exports.ABCToNumber=i_;exports.AbsoluteRefType=tt;exports.ActionIterator=vn;exports.AlignTypeH=yu;exports.AlignTypeV=wu;exports.ArrangeTypeEnum=Tu;exports.ArrowsAndMarkersShapes=ll;exports.AsyncInterceptorManager=Qg;exports.AutoFillSeries=Qa;exports.BaselineOffset=Bt;exports.BasicShapes=al;exports.BlockType=ru;exports.BooleanNumber=Te;exports.BorderStyleTypes=Ge;exports.BorderType=Ja;exports.BuildTextUtils=Lt;exports.BulletAlignment=mr;exports.COLORS=Ds;exports.CellValueType=Jt;exports.Color=dn;exports.ColorBuilder=qr;exports.ColorKit=At;exports.ColorType=Ot;exports.ColumnSeparatorType=au;exports.CommandType=hr;exports.CommonHideTypes=Za;exports.ConfigService=uc;exports.ContextService=Ha;exports.CopyPasteType=qa;exports.CustomCommandExecutionError=Ts;exports.CustomDecorationType=ln;exports.CustomRangeType=tr;exports.DEFAULT_CELL=zp;exports.DEFAULT_DOC=wi;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=M0;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=_a;exports.DEFAULT_RANGE=Wp;exports.DEFAULT_RANGE_ARRAY=Bp;exports.DEFAULT_SELECTION=Yp;exports.DEFAULT_SLIDE=Fl;exports.DEFAULT_STYLES=ct;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=Gu;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=yE;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Ju;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=TE;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Xu;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=bE;exports.DEFAULT_WORKSHEET_ROW_COUNT=Vu;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=OE;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Ku;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=wE;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Qu;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=AE;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ii;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=si;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=pa;exports.DOC_RANGE_TYPE=Rl;exports.DashStyleType=gu;exports.DataStreamTreeNodeType=Bu;exports.DataStreamTreeTokenType=jt;exports.DataValidationErrorStyle=Rc;exports.DataValidationImeMode=Ic;exports.DataValidationOperator=Sc;exports.DataValidationRenderMode=Oc;exports.DataValidationStatus=yc;exports.DataValidationType=wc;exports.DeleteDirection=el;exports.DependentOn=p0;exports.DesktopLogService=Wa;exports.DeveloperMetadataVisibility=tl;exports.Dimension=nl;exports.Direction=rl;exports.Disposable=rt;exports.DisposableCollection=di;exports.DocStyleType=tu;exports.DocumentDataModel=Wt;exports.DocumentFlavor=su;exports.DrawingTypeEnum=Nu;exports.EDITOR_ACTIVATED=tc;exports.EXTENSION_NAMES=$l;exports.ErrorService=cc;exports.EventState=vc;exports.EventSubject=D0;exports.FBase=qn;exports.FOCUSING_COMMON_DRAWINGS=WE;exports.FOCUSING_DOC=Bn;exports.FOCUSING_EDITOR_BUT_HIDDEN=kE;exports.FOCUSING_EDITOR_INPUT_FORMULA=FE;exports.FOCUSING_EDITOR_STANDALONE=jE;exports.FOCUSING_FX_BAR_EDITOR=nc;exports.FOCUSING_PANEL_EDITOR=HE;exports.FOCUSING_SHEET=On;exports.FOCUSING_SLIDE=Wn;exports.FOCUSING_UNIT=Hn;exports.FOCUSING_UNIVER_EDITOR=$E;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=BE;exports.FORMULA_EDITOR_ACTIVATED=YE;exports.FollowNumberWithType=nu;exports.FontItalic=kr;exports.FontStyleType=Sn;exports.FontWeight=Fr;exports.FormatType=sl;exports.GlyphType=Se;exports.GridType=iu;exports.HLSColor=El;exports.HorizontalAlign=Xt;exports.IAuthzIoService=ac;exports.ICommandService=Ut;exports.IConfigService=lc;exports.IContextService=cr;exports.ILocalStorageService=x0;exports.ILogService=Nt;exports.IMentionIOService=hc;exports.IPermissionService=dc;exports.IResourceLoaderService=Gs;exports.IResourceManagerService=ns;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=eg;exports.IUndoRedoService=Qt;exports.IUniverInstanceService=gn;exports.Inject=vt;exports.Injector=Ft;exports.InterceptorEffectEnum=In;exports.InterceptorManager=Gg;exports.InterpolationPointType=il;exports.JSON1=__;exports.JSONX=fn;exports.LRUHelper=jn;exports.LRUMap=Hr;exports.LifecycleStages=Ve;exports.LocaleService=Kn;exports.LocaleType=dr;exports.LogLevel=Ba;exports.MOVE_BUFFER_VALUE=$n;exports.Many=Oa;exports.MemoryCursor=Ln;exports.MentionType=Pr;exports.NamedStyleType=du;exports.NilCommand=Ya;exports.NumberUnitType=Ou;exports.ObjectMatrix=Pt;exports.ObjectRelativeFromH=Iu;exports.ObjectRelativeFromV=Su;exports.Optional=ya;exports.OtherShapes=ul;exports.PRESET_LIST_TYPE=pr;exports.PageElementType=Mu;exports.PageOrientType=Au;exports.PageType=Oi;exports.ParagraphElementType=uu;exports.PermissionService=fc;exports.PermissionStatus=Ai;exports.Plugin=zs;exports.PositionedObjectLayoutType=hu;exports.PresetListType=kt;exports.ProtectionType=ol;exports.QuickListType=Lu;exports.QuickListTypeMap=S_;exports.RANGE_DIRECTION=vl;exports.RANGE_TYPE=we;exports.RCDisposable=nm;exports.RGBA_PAREN=Dm;exports.RGB_PAREN=Mm;exports.ROTATE_BUFFER_VALUE=Xa;exports.RTree=Y0;exports.Range=Tn;exports.Rectangle=en;exports.RediConsumer=Da;exports.RediContext=ur;exports.RediError=ot;exports.RediProvider=hi;exports.RedoCommand=sr;exports.RedoCommandId=ic;exports.RefAlias=s_;exports.Registry=Ni;exports.RegistryAsMap=Mi;exports.RelativeDate=hl;exports.RelativeSlideLink=Du;exports.ResourceManagerService=_c;exports.RgbColor=$r;exports.RxDisposable=tm;exports.SHEET_EDITOR_UNITS=Vp;exports.SectionType=ou;exports.Self=Ta;exports.SheetTypes=dl;exports.SheetViewModel=qu;exports.SkipSelf=Aa;exports.SliceBodyType=yi;exports.SlideDataModel=bi;exports.SpacingRule=fu;exports.SpecialShapes=cl;exports.Styles=$u;exports.THEME_COLORS=_l;exports.TabStopAlignment=mu;exports.TableAlignmentType=_u;exports.TableLayoutType=Eu;exports.TableRowHeightRule=vu;exports.TableSizeType=pu;exports.TableTextWrapType=Cu;exports.TextDecoration=fl;exports.TextDirection=er;exports.TextDirectionType=lu;exports.TextX=nt;exports.TextXActionType=oe;exports.ThemeColor=jr;exports.ThemeColorType=gt;exports.ThemeColors=Zr;exports.ThemeService=Ti;exports.Tools=G;exports.UndoCommand=rr;exports.UndoCommandId=oc;exports.UnitModel=ts;exports.Univer=Ec;exports.UniverInstanceType=ke;exports.UpdateDocsAttributeType=Le;exports.UserManagerService=ir;exports.VerticalAlign=an;exports.VerticalAlignmentType=Ru;exports.WithDependency=Fg;exports.WithNew=Na;exports.Worksheet=nr;exports.WrapStrategy=cn;exports.WrapTextType=cu;exports.addLinkToDocumentModel=Yu;exports.afterInitApply=hm;exports.afterTime=cm;exports.awaitTime=P0;exports.binSearchFirstGreaterThanTarget=Ka;exports.binarySearchArray=dm;exports.bufferDebounceTime=um;exports.cellToRange=ap;exports.characterSpacingControlType=bu;exports.checkForSubstrings=lp;exports.checkIfMove=mm;exports.checkParagraphHasBullet=wp;exports.checkParagraphHasIndent=bp;exports.checkParagraphHasIndentByStyle=xl;exports.codeToBlob=gm;exports.composeBody=Bs;exports.composeInterceptors=ka;exports.composeStyles=Ns;exports.concatMatrixArray=Fp;exports.connectDependencies=Ug;exports.connectInjector=xg;exports.convertBodyToHtml=Nm;exports.convertCellToRange=Il;exports.covertTextRunToHtml=Ms;exports.createAsyncInterceptorKey=Kg;exports.createDefaultUser=Wr;exports.createIdentifier=Rt;exports.createInterceptorKey=Vg;exports.createInternalEditorID=tg;exports.createRowColIter=Ps;exports.dayjs=zt;exports.debounce=Nf;exports.dedupe=Kf;exports.deepCompare=mi;exports.deleteContent=Pl;exports.extractPureTextFromCell=ec;exports.forwardRef=cg;exports.fromCallback=za;exports.fromEventSubject=L0;exports.fromObservable=em;exports.generateRandomId=hn;exports.get=af;exports.getArrayLength=Zt;exports.getBodySlice=qt;exports.getBodySliceHtml=Mr;exports.getBorderStyleType=sp;exports.getCellInfoInMergeData=Jm;exports.getCellValueType=Gm;exports.getColorStyle=Dt;exports.getCustomDecorationSlice=Pu;exports.getCustomRangeSlice=Uu;exports.getDocsUpdateBody=ip;exports.getIntersectRange=Zp;exports.getOriginCellValue=ME;exports.getReverseDirection=pm;exports.getWorksheetUID=PE;exports.groupBy=Jf;exports.handleStyleToString=rp;exports.hashAlgorithm=Np;exports.horizontalLineSegmentsSubtraction=es;exports.insertMatrixArray=Ls;exports.insertTextToContent=Ul;exports.isAsyncDependencyItem=Os;exports.isAsyncHook=Tr;exports.isBlackColor=Ym;exports.isBooleanString=qf;exports.isCellCoverable=ep;exports.isCellV=Xm;exports.isClassDependencyItem=Rs;exports.isCtor=ai;exports.isDisposable=ws;exports.isEmptyCell=Sl;exports.isFactoryDependencyItem=Is;exports.isFormulaId=np;exports.isFormulaString=tp;exports.isICellData=Vm;exports.isInternalEditorID=Ea;exports.isNodeEnv=Tm;exports.isNullCell=Km;exports.isNumeric=Cc;exports.isRangesEqual=pE;exports.isRealNum=Tp;exports.isSafeNumeric=b0;exports.isSameStyleTextRun=Ol;exports.isUnitRangesEqual=_E;exports.isValidRange=op;exports.isValueDependencyItem=Ss;exports.isWhiteColor=zm;exports.makeArray=Zf;exports.makeCellRangeToRangeData=qm;exports.makeCellToSelection=Zm;exports.makeCustomRangeStream=iE;exports.merge=Uf;exports.mergeOverrideWithDependencies=pc;exports.mergeSets=T0;exports.mergeWith=xf;exports.mergeWorksheetSnapshotWithDefault=Zu;exports.mixinClass=Jg;exports.moveMatrixArray=Us;exports.moveRangeByOffset=Gp;exports.nameCharacterCheck=U0;exports.normalizeBody=D_;exports.normalizeTextRuns=gr;exports.numberToABC=a_;exports.numberToListABC=l_;exports.numfmt=kp;exports.queryObjectMatrix=r_;exports.registerDependencies=Yg;exports.remove=ar;exports.repeatStringNumTimes=Hl;exports.replaceInDocumentBody=N0;exports.requestImmediateMacroTask=A0;exports.rotate=Qf;exports.searchArray=fm;exports.searchInOrderedArray=Ga;exports.selectionToArray=Qm;exports.sequence=$a;exports.sequenceAsync=Fa;exports.sequenceExecute=fi;exports.sequenceExecuteAsync=lm;exports.set=kf;exports.setDependencies=bg;exports.shallowEqual=Pa;exports.skipParseTagNames=k0;exports.sliceMatrixArray=$p;exports.sortRules=u_;exports.sortRulesByDesc=c_;exports.sortRulesFactory=fr;exports.spliceArray=xs;exports.splitIntoGrid=pi;exports.takeAfter=Va;exports.textDiff=ma;exports.throttle=zg;exports.toDisposable=Je;exports.touchDependencies=Ua;exports.updateAttributeByDelete=ku;exports.updateAttributeByInsert=Fu;exports.useDependency=Dg;exports.useDependencyContext=Bg;exports.useDependencyContextValue=Wg;exports.useDependencyValue=xa;exports.useInjector=La;exports.useObservable=jg;exports.useUpdateBinder=Hg;
4
+ For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):uo[co]=!0;var ho="REDI_CONTEXT_LOCK",wg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,fo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;fo[ho]?wg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):fo[ho]=!0;var ur=bt.createContext({injector:null});ur.displayName="RediContext";var Ci=ur.Provider,Va=ur.Consumer,bg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ag=function(e){bg(t,e);function t(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return t}(st);function Ga(){var e=bt.useContext(ur);if(!e.injector)throw new Ag;return e.injector}function Tg(e,t,n){var r=Ga();return bt.useMemo(function(){return r.get(e,t,n)},[e,t,n])}var Vr=function(){return Vr=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},Vr.apply(this,arguments)};function Ng(e){var t=e.children,n=e.dependencies,r=bt.useRef(null);return bt.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),bt.createElement(Va,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(n):new Ut(n),r.current=i),bt.createElement(Ci,{value:{injector:i}},t)})}function Mg(e,t){return function(r){return bt.createElement(Ci,{value:{injector:t}},bt.createElement(e,Vr({},r)))}}function Dg(e,t){return function(r){return bt.createElement(Ng,{dependencies:t},bt.createElement(e,Vr({},r)))}}var xg=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)}}(),Lg=function(e){xg(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}(st);function Ug(e,t,n){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new Lg(r);var i=s.injector,o=i.get(e,t||exports.Quantity.REQUIRED,n);return o}}}}var Pg=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};function Ka(e,t){var n=e instanceof Oe.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 go(e){return typeof e=="function"?e():e}function Fg(e,t,n,r){if(typeof e=="function"&&!r)throw new st("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},Pg([],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=go(o).subscribe(function(d){i.current=!0,h=d});u.unsubscribe()}return h!=null?h:t}());if(ot.useEffect(function(){var h=null;return o&&(s.current=go(o),h=s.current.subscribe(function(u){c.current=u,l(function(d){return d+1})})),function(){return h==null?void 0:h.unsubscribe()}},[o]),n&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function kg(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 ks=new WeakMap;function $g(e,t){var n=ot.useRef(void 0),r=Ka(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&&ks.delete(n.current),n.current=e,ks.set(e,s)),{Provider:i,value:r}}function jg(e){var t=ks.get(e);if(!t)throw new st("try to read context value but no ancestor component subscribed it.");return ot.useContext(t)}function Hg(e,t){t.forEach(n=>e.add(n))}function Xa(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Qa(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 $s extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}function Bg(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 Wg(e){return`sheet_interceptor_${e}`}const qa=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 Yg{constructor(t){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t){const n=t,r=this._interceptorsByName.get(n);return qa(r||[])}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)})),()=>ar(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function zg(e){return`sheet_async_interceptor_${e}`}const Vg=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 Gg{constructor(t){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t){const n=t,r=this._asyncInterceptorsByName.get(n);return Vg(r||[])}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)})),()=>ar(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class Mn{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function Kg(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}const Xn=class Xn{constructor(){const t=this;Xn._constructorQueue.forEach(function(n){n.apply(t)})}_initialize(){}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n==="_initialize"?Xn._constructorQueue.push(t.prototype._initialize):n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}};R(Xn,"_constructorQueue",[]);let Jn=Xn;async function Ja(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Za(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 mo(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 po(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 _o(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 Gn(e){return typeof e=="function"}function Xg(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 ms=Xg(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
5
+ `+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
6
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function Eo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var el=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=mo(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(v){t={error:v}}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(Gn(h))try{h()}catch(v){i=v instanceof ms?v.errors:[v]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=mo(u),f=d.next();!f.done;f=d.next()){var E=f.value;try{vo(E)}catch(v){i=i!=null?i:[],v instanceof ms?i=_o(_o([],po(i)),po(v.errors)):i.push(v)}}}catch(v){r={error:v}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new ms(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)vo(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)&&Eo(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Eo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();el.EMPTY;function Qg(e){return e instanceof el||e&&"closed"in e&&Gn(e.remove)&&Gn(e.add)&&Gn(e.unsubscribe)}function vo(e){Gn(e)?e():e.unsubscribe()}function qe(e){let t=!1;return e?Qg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:qe(()=>{})}function qg(e){return qe(()=>{e.unsubscribe()})}class Ri{constructor(){R(this,"_disposables",new Set)}add(t){const n=qe(t);return this._disposables.add(n),{dispose:()=>{n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class nt{constructor(){R(this,"_disposed",!1);R(this,"_collection",new Ri)}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 Jg extends nt{constructor(){super(...arguments);R(this,"dispose$",new Oe.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class Zg extends nt{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 cr=mt("univer.context-service");class tl extends nt{constructor(){super(...arguments);R(this,"_contextChanged$",new Oe.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 Oe.Observable(r=>{const s=this._contextChanged$.pipe(Oe.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var nl=(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))(nl||{});const At=mt("univer.log");class rl extends nt{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 em=Object.defineProperty,tm=Object.getOwnPropertyDescriptor,nm=(e,t,n,r)=>{for(var s=r>1?void 0:r?tm(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&&em(t,n,s),s},Co=(e,t)=>(n,r)=>t(n,r,e),hr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(hr||{});const Dt=mt("anywhere.command-service");class rm{constructor(){R(this,"_commands",new Map);R(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),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 sl={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends nt{constructor(n,r){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new rm,this._registerCommand(sl)}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 $s)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=Vf(this._commandExecutionStack,d=>d.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 $s)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),qe(()=>ar(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 Ri;s=new sm(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(qe(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return qe(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=nm([Co(0,_t(Ut)),Co(1,At)],exports.CommandService);class sm{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(At),s=t.get(cr),i=t.get(Ut);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 Ii(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Za(r)}function im(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return Ja(r)}function il(e){return new Oe.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function ol(e){return function(n){return new Oe.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function om(e=0){return t=>{let n=[];return t.pipe(Oe.tap(r=>n.push(r)),Oe.debounceTime(e),Oe.map(()=>n),Oe.tap(()=>n=[]))}}function am(e){const t=new Oe.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(Oe.take(1))}const lm=e=>new Promise(t=>{Oe.merge(il(e.onCommandExecuted.bind(e)).pipe(Tr.filter(([n])=>n.type===hr.MUTATION)),Oe.timer(300)).pipe(Tr.debounceTime(16),Tr.first()).subscribe(()=>{t()})});function al(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 um(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 ll(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 cm(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=al(e,t):r=ll(e,t),n){const s=e[r];return e.indexOf(s)}return r}function hm(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const kn=2,ul=1;function dm(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,d=h,f=c,E=i,v=s;return Math.abs(a-n)>kn||Math.abs(l-r)>kn||Math.abs(d-E)>kn||Math.abs(f-v)>kn||Math.abs(u-o)>ul}var cl=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(cl||{}),Ke=(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))(Ke||{}),hl=(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))(hl||{}),Ct=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Ct||{}),dl=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(dl||{}),fl=(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))(fl||{}),gl=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(gl||{}),ml=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(ml||{}),pl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(pl||{}),_l=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(_l||{});function fm(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var El=(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))(El||{}),dr=(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))(dr||{}),Gr=(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))(Gr||{}),vl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(vl||{}),Cl=(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))(Cl||{}),Rl=(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))(Rl||{}),Il=(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))(Il||{}),Sl=(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))(Sl||{}),Ol=(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))(Ol||{}),yl=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(yl||{}),Zn=(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))(Zn||{}),wl=(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))(wl||{}),Gt=(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))(Gt||{}),on=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(on||{}),un=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(un||{}),Kr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Kr||{}),Xr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Xr||{}),kt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(kt||{}),xe=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(xe||{}),Xt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Xt||{}),dt=(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))(dt||{}),os=(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))(os||{});const gm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let mm=e=>crypto.getRandomValues(new Uint8Array(e)),pm=(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}}},_m=(e,t=21)=>pm(e,t|0,mm),Em=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=gm[n[e]&63];return t};const bl=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"]),vm=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[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 Cm(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(vm.test(e)){if(Al(e))return!0;try{const r=new URL(Tl(e)).hostname.split(".").pop();if(r&&bl.has(r))return!0}catch{return!1}}return!1}function Al(e){return/^[a-zA-Z]+:\/\//.test(e)}function Rm(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Tl(e){return Al(e)?e:Rm(e)?`mailto://${e}`:`https://${e}`}const Im=/^-ms-/,Sm=/-([a-z])/g,Yt=["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 Si(e,t){const n=ae.getValueType(e),r=ae.getValueType(t);return n!==r?!1:ae.isArray(e)?Om(e,t):ae.isObject(e)?ym(e,t):ae.isDate(e)?e.getTime()===t.getTime():ae.isRegExp(e)?e.toString()===t.toString():e===t}function Om(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(!Si(s,i))return!1}return!0}function ym(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(!Si(i,o))return!1}return!0}class ae{static stringAt(t){let n="",r=t;for(;r>=Yt.length;)r/=Yt.length,r-=1,n+=Yt[r%Yt.length];const s=t%Yt.length;return n+=Yt[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+=Yt.length**i+Yt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return ae.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 cn(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(ae.isArray(l)){const d=(h=a[c])!=null?h:[];a[c]=d,r(l,d);return}if(ae.isObject(l)){const d=(u=a[c])!=null?u:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(ae.isObject(c)){const d=(h=a[l])!=null?h:{};a[l]=d,s(c,d);return}if(ae.isArray(c)){const d=(u=a[l])!=null?u:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(ae.isArray(l)){const u=(c=t[a])!=null?c:[];t[a]=u,r(l,u);return}if(ae.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 Si(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]=ae.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=ae.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 Cm(t)}static normalizeUrl(t){return Tl(t)}static topLevelDomainCombiningString(){return[...bl].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return ae.isDefine(t)?ae.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(Im,"ms-").replace(Sm,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:ae.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 cn(e=21,t){return t?_m(t,e)():Em(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 wm=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Dr(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;ae.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(Hs(r,{...a,ed:Math.min(c,n)}))):o.push(Hs(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 bm(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:d}=c,f=[];h!=null&&(typeof h=="number"?f.push(`margin-top: ${h}px`):f.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?f.push(`margin-bottom: ${u}px`):f.push(`margin-bottom: ${u.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Dr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Dr(e,o,r.length)),i}else return Dr(e,0,e.dataStream.length)}function Hs(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:d,cl:f,va:E}=s;let v=e.slice(n,r);const y=[];return a===xe.TRUE&&(v=`<i>${v}</i>`),E===kt.SUPERSCRIPT?v=`<sup>${v}</sup>`:E===kt.SUBSCRIPT&&(v=`<sub>${v}</sub>`),(c==null?void 0:c.s)===xe.TRUE&&(v=`<u>${v}</u>`),(h==null?void 0:h.s)===xe.TRUE&&(v=`<s>${v}</s>`),l===xe.TRUE&&(v=`<strong>${v}</strong>`),i&&y.push(`font-family: ${i}`),f&&y.push(`color: ${f.rgb}`),o&&y.push(`font-size: ${o}pt`),u&&y.push("text-decoration: overline"),d&&y.push(`background: ${d.rgb}`),y.length?`<span style="${y.join("; ")};">${v}</span>`:v}const Nl={[os.OFFICE]:{[dt.ACCENT1]:"#4472C4",[dt.ACCENT2]:"#ED7D31",[dt.ACCENT3]:"#A5A5A5",[dt.ACCENT4]:"#70AD47",[dt.ACCENT5]:"#5B9BD5",[dt.ACCENT6]:"#70AD47",[dt.DARK1]:"#000000",[dt.DARK2]:"#44546A",[dt.LIGHT1]:"#FFFFFF",[dt.LIGHT2]:"#E7E6E6",[dt.HYPERLINK]:"#0563C1",[dt.FOLLOWED_HYPERLINK]:"#954F72"}};class as{constructor(){R(this,"_themeValue",dt.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=Ct.UNSUPPORTED,this._themeColors=os.OFFICE,this._themeTint=0}asRgbColor(){return new Qr(this._rgbValue,this)}asThemeColor(){return new qr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case Ct.THEME:return this.asThemeColor();case Ct.RGB:return this.asRgbColor();case Ct.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=Ct.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=Ct.THEME,this._themeColors=t}setThemeTint(t){this._colorType=Ct.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=Ct.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class hn{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 as().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 hn(this._builder)}equals(t){return!1}}class Ml{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 as;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 vt=class vt extends hn{constructor(n,r){super(r);R(this,"_cssString");R(this,"_red");R(this,"_green");R(this,"_blue");R(this,"_alpha");let s=n.match(vt.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(vt.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return hn.rgbColorToHexValue(this)}getRed(){let n=this._red+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return Ct.RGB}clone(){return new vt(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof vt?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};R(vt,"RGB_COLOR_AMT",0),R(vt,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),R(vt,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Qr=vt;const Vt=class Vt extends hn{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=Nl[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(Vt._cacheThemeColor.has(this._themeColors)){if(s=Vt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Vt._cacheThemeColor.set(this._themeColors,s);const i=new Ml(hn.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 Vt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof Vt?n._themeColorType===this._themeColorType:!1}getColorType(){return Ct.THEME}getThemeColorType(){return this._themeColorType}};R(Vt,"_cacheThemeColor",new Map);let qr=Vt;const Am="rgb(",Tm="rgba(",Bs={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 yt{constructor(t){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof yt){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=Dl(t);if(n==null){this._setNullColor();return}this._color=n;const r=Lm(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 yt(t).toRgb(),i=new yt(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 yt(l)}static getContrastRatio(t,n){const r=new yt(t).getLuminance(),s=new yt(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[vr(Math.round(n).toString(16)),vr(Math.round(r).toString(16)),vr(Math.round(s).toString(16)),vr(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return km(this.toRgb())}toHsl(){return Fm(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new yt(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new yt(n)}setAlpha(t){return new yt({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=ps(t),n=ps(n),r=ps(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const vr=e=>e.length===1?`0${e}`:e,ps=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Dl=e=>{if(jm(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(Bs[t]){const n=Bs[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 Nm(t);if(t.startsWith("rgb"))return Mm(t);if(t.startsWith("hsl"))return Dm(t);if(t.startsWith("hsv"))return xm(t)},Nm=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},Mm=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},Dm=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},xm=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},Lm=e=>{const t=Dl(e);if(t!=null)return"r"in t?t:"l"in t?Um(t):Pm(t)},_s=(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),Um=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=_s(c,l,t+1/3),i=_s(c,l,t),o=_s(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},Pm=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],d=[o,o,l,r,r,a][c],f={r:h*255,g:u*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},Fm=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},km=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},$m=e=>e==null,jm=e=>!$m(e)&&typeof e=="object";function Hm(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 Bm(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 Wm(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 Ym(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Xt.STRING;if(typeof e.v=="number")return Xt.NUMBER;if(typeof e.v=="boolean")return Xt.BOOLEAN}function zm(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 Vm(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 Gm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var xl=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(xl||{}),Ll=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Ll||{});function Km(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:d,endColumn:f}=n[c];if(e===h&&t===d){i=u,o=f,a=h,l=d,s=!0;break}if(e>=h&&e<=u&&t>=d&&t<=f){i=u,o=f,a=h,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}function Ul(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,d=t,f=n;if(r&&i){const{startRow:E,startColumn:v,endRow:y,endColumn:T,startY:V,endY:Y,startX:ie,endX:N}=i;h=E,u=v,d=y,f=T,o=V,a=Y,l=ie,c=N}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,f=i.endColumn),{startRow:h,startColumn:u,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:c}}const Xm=Ul;function Qm(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,d=n;return(r||s)&&(c=i,h=o,u=a,d=l),{startRow:c,startColumn:h,endRow:u,endColumn:d}}function Pl(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function qm(e){return Pl(e)&&(e==null?void 0:e.coverable)!==!1}function Nt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new as().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function Jm(e){return ae.isString(e)&&e.substring(0,1)==="="&&e.length>1}function Zm(e){return ae.isString(e)&&e.length>0}function ep(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: ${Nt(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: ${Nt(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: ${Nt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Nt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,d,f,E,v,y,T;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Cr((a=e.bd)==null?void 0:a.b.s)} ${(l=Nt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Cr((h=e.bd)==null?void 0:h.t.s)} ${(u=Nt(e.bd.t.cl))!=null?u:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Cr((f=e.bd)==null?void 0:f.r.s)} ${(E=Nt(e.bd.r.cl))!=null?E:""}; `),(v=e.bd)!=null&&v.l&&(n+=`border-left: ${Cr((y=e.bd)==null?void 0:y.l.s)} ${(T=Nt(e.bd.l.cl))!=null?T:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Nt(e.cl)}; `)}],["va",()=>{e.va===kt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===kt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Zn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Zn.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===Gt.LEFT?n+="text-align: left; ":e.ht===Gt.RIGHT?n+="text-align: right; ":e.ht===Gt.CENTER?n+="text-align: center; ":e.ht===Gt.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===un.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===un.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,u,d,f,E,v,y,T;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(f=e.pd)==null?void 0:f.r}pt`;(E=e.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(v=e.pd)!=null&&v.t&&(n+=`padding-top: ${a}; `),(y=e.pd)!=null&&y.l&&(n+=`padding-left: ${l}; `),(T=e.pd)!=null&&T.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 Cr(e){let t="";return e===Ke.NONE?t="none":e===Ke.THIN?t="0.5pt solid":e===Ke.HAIR?t="0.5pt double":e===Ke.DOTTED?t="0.5pt dotted":e===Ke.DASHED||e===Ke.DASH_DOT?t="0.5pt dashed":e===Ke.DASH_DOT_DOT?t="0.5pt dotted":e===Ke.DOUBLE?t="0.5pt double":e===Ke.MEDIUM?t="1pt solid":e===Ke.MEDIUM_DASHED||e===Ke.MEDIUM_DASH_DOT?t="1pt dashed":e===Ke.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Ke.SLANT_DASH_DOT?t="0.5pt dashed":e===Ke.THICK&&(t="1.5pt solid"),t}function tp(e){let t=0;if(e=e.trim(),e==="none")t=Ke.NONE;else if(e==="0.5pt solid")t=Ke.THIN;else if(e==="0.5pt double")t=Ke.HAIR;else if(e==="0.5pt dotted")t=Ke.DOTTED;else if(e==="0.5pt dashed")t=Ke.DASHED;else if(e==="1pt solid")t=Ke.MEDIUM;else if(e==="1pt dashed")t=Ke.MEDIUM_DASHED;else if(e==="1pt dotted")t=Ke.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Ke.THICK;else if(!e.includes("none"))t=Ke.THIN;else return Ke.NONE;return t}function np(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 rp(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 sp(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Oi(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=>Oi(e[n],t[n])):e===t:!1}function Fl(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Oi(n,r)}function ip(e,t){return t.some(n=>e.indexOf(n)>-1)}var xr={exports:{}},op=xr.exports,Ro;function ap(){return Ro||(Ro=1,function(e,t){(function(n,r){e.exports=r()})(op,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",E="date",v="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|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,V={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var w=["th","st","nd","rd"],O=D%100;return"["+D+(w[(O-20)%10]||w[O]||w[0])+"]"}},Y=function(D,w,O){var F=String(D);return!F||F.length>=w?D:""+Array(w+1-F.length).join(O)+D},ie={s:Y,z:function(D){var w=-D.utcOffset(),O=Math.abs(w),F=Math.floor(O/60),$=O%60;return(w<=0?"+":"-")+Y(F,2,"0")+":"+Y($,2,"0")},m:function D(w,O){if(w.date()<O.date())return-D(O,w);var F=12*(O.year()-w.year())+(O.month()-w.month()),$=w.clone().add(F,u),G=O-$<0,re=w.clone().add(F+(G?-1:1),u);return+(-(F+(O-$)/(G?$-re:re-$))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:u,y:f,w:h,d:c,D:E,h:l,m:a,s:o,ms:i,Q:d}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},N="en",A={};A[N]=V;var B="$isDayjsObject",J=function(D){return D instanceof H||!(!D||!D[B])},de=function D(w,O,F){var $;if(!w)return N;if(typeof w=="string"){var G=w.toLowerCase();A[G]&&($=G),O&&(A[G]=O,$=G);var re=w.split("-");if(!$&&re.length>1)return D(re[0])}else{var he=w.name;A[he]=w,$=he}return!F&&$&&(N=$),$||!F&&N},le=function(D,w){if(J(D))return D.clone();var O=typeof w=="object"?w:{};return O.date=D,O.args=arguments,new H(O)},p=ie;p.l=de,p.i=J,p.w=function(D,w){return le(D,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var H=function(){function D(O){this.$L=de(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[B]=!0}var w=D.prototype;return w.parse=function(O){this.$d=function(F){var $=F.date,G=F.utc;if($===null)return new Date(NaN);if(p.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var re=$.match(y);if(re){var he=re[2]-1||0,fe=(re[7]||"0").substring(0,3);return G?new Date(Date.UTC(re[1],he,re[3]||1,re[4]||0,re[5]||0,re[6]||0,fe)):new Date(re[1],he,re[3]||1,re[4]||0,re[5]||0,re[6]||0,fe)}}return new Date($)}(O),this.init()},w.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},w.$utils=function(){return p},w.isValid=function(){return this.$d.toString()!==v},w.isSame=function(O,F){var $=le(O);return this.startOf(F)<=$&&$<=this.endOf(F)},w.isAfter=function(O,F){return le(O)<this.startOf(F)},w.isBefore=function(O,F){return this.endOf(F)<le(O)},w.$g=function(O,F,$){return p.u(O)?this[F]:this.set($,O)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(O,F){var $=this,G=!!p.u(F)||F,re=p.p(O),he=function(z,W){var ue=p.w($.$u?Date.UTC($.$y,W,z):new Date($.$y,W,z),$);return G?ue:ue.endOf(c)},fe=function(z,W){return p.w($.toDate()[z].apply($.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(W)),$)},Ae=this.$W,we=this.$M,I=this.$D,k="set"+(this.$u?"UTC":"");switch(re){case f:return G?he(1,0):he(31,11);case u:return G?he(1,we):he(0,we+1);case h:var K=this.$locale().weekStart||0,X=(Ae<K?Ae+7:Ae)-K;return he(G?I-X:I+(6-X),we);case c:case E:return fe(k+"Hours",0);case l:return fe(k+"Minutes",1);case a:return fe(k+"Seconds",2);case o:return fe(k+"Milliseconds",3);default:return this.clone()}},w.endOf=function(O){return this.startOf(O,!1)},w.$set=function(O,F){var $,G=p.p(O),re="set"+(this.$u?"UTC":""),he=($={},$[c]=re+"Date",$[E]=re+"Date",$[u]=re+"Month",$[f]=re+"FullYear",$[l]=re+"Hours",$[a]=re+"Minutes",$[o]=re+"Seconds",$[i]=re+"Milliseconds",$)[G],fe=G===c?this.$D+(F-this.$W):F;if(G===u||G===f){var Ae=this.clone().set(E,1);Ae.$d[he](fe),Ae.init(),this.$d=Ae.set(E,Math.min(this.$D,Ae.daysInMonth())).$d}else he&&this.$d[he](fe);return this.init(),this},w.set=function(O,F){return this.clone().$set(O,F)},w.get=function(O){return this[p.p(O)]()},w.add=function(O,F){var $,G=this;O=Number(O);var re=p.p(F),he=function(we){var I=le(G);return p.w(I.date(I.date()+Math.round(we*O)),G)};if(re===u)return this.set(u,this.$M+O);if(re===f)return this.set(f,this.$y+O);if(re===c)return he(1);if(re===h)return he(7);var fe=($={},$[a]=r,$[l]=s,$[o]=n,$)[re]||1,Ae=this.$d.getTime()+O*fe;return p.w(Ae,this)},w.subtract=function(O,F){return this.add(-1*O,F)},w.format=function(O){var F=this,$=this.$locale();if(!this.isValid())return $.invalidDate||v;var G=O||"YYYY-MM-DDTHH:mm:ssZ",re=p.z(this),he=this.$H,fe=this.$m,Ae=this.$M,we=$.weekdays,I=$.months,k=$.meridiem,K=function(W,ue,oe,j){return W&&(W[ue]||W(F,G))||oe[ue].slice(0,j)},X=function(W){return p.s(he%12||12,W,"0")},z=k||function(W,ue,oe){var j=W<12?"AM":"PM";return oe?j.toLowerCase():j};return G.replace(T,function(W,ue){return ue||function(oe){switch(oe){case"YY":return String(F.$y).slice(-2);case"YYYY":return p.s(F.$y,4,"0");case"M":return Ae+1;case"MM":return p.s(Ae+1,2,"0");case"MMM":return K($.monthsShort,Ae,I,3);case"MMMM":return K(I,Ae);case"D":return F.$D;case"DD":return p.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return K($.weekdaysMin,F.$W,we,2);case"ddd":return K($.weekdaysShort,F.$W,we,3);case"dddd":return we[F.$W];case"H":return String(he);case"HH":return p.s(he,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return z(he,fe,!0);case"A":return z(he,fe,!1);case"m":return String(fe);case"mm":return p.s(fe,2,"0");case"s":return String(F.$s);case"ss":return p.s(F.$s,2,"0");case"SSS":return p.s(F.$ms,3,"0");case"Z":return re}return null}(W)||re.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(O,F,$){var G,re=this,he=p.p(F),fe=le(O),Ae=(fe.utcOffset()-this.utcOffset())*r,we=this-fe,I=function(){return p.m(re,fe)};switch(he){case f:G=I()/12;break;case u:G=I();break;case d:G=I()/3;break;case h:G=(we-Ae)/6048e5;break;case c:G=(we-Ae)/864e5;break;case l:G=we/s;break;case a:G=we/r;break;case o:G=we/n;break;default:G=we}return $?G:p.a(G)},w.daysInMonth=function(){return this.endOf(u).$D},w.$locale=function(){return A[this.$L]},w.locale=function(O,F){if(!O)return this.$L;var $=this.clone(),G=de(O,F,!0);return G&&($.$L=G),$},w.clone=function(){return p.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},D}(),S=H.prototype;return le.prototype=S,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",f],["$D",E]].forEach(function(D){S[D[1]]=function(w){return this.$g(w,D[0],D[1])}}),le.extend=function(D,w){return D.$i||(D(w,H,le),D.$i=!0),le},le.locale=de,le.isDayjs=J,le.unix=function(D){return le(1e3*D)},le.en=A[N],le.Ls=A,le.p={},le})}(xr)),xr.exports}var lp=ap();const Bt=It(lp);var Lr={exports:{}},up=Lr.exports,Io;function cp(){return Io||(Io=1,function(e,t){(function(n,r){e.exports=r()})(up,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)}}})}(Lr)),Lr.exports}var hp=cp();const dp=It(hp);var Ur={exports:{}},fp=Ur.exports,So;function gp(){return So||(So=1,function(e,t){(function(n,r){e.exports=r()})(fp,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(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(T){this[y]=+T}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(T){if(!T||T==="Z")return 0;var V=T.match(/([+-]|\d\d)/g),Y=60*V[1]+(+V[2]||0);return Y===0?0:V[0]==="+"?-Y:Y}(y)}],d=function(y){var T=l[y];return T&&(T.indexOf?T:T.s.concat(T.f))},f=function(y,T){var V,Y=l.meridiem;if(Y){for(var ie=1;ie<=24;ie+=1)if(y.indexOf(Y(ie,0,T))>-1){V=ie>12;break}}else V=y===(T?"pm":"PM");return V},E={A:[a,function(y){this.afternoon=f(y,!1)}],a:[a,function(y){this.afternoon=f(y,!0)}],Q:[s,function(y){this.month=3*(y-1)+1}],S:[s,function(y){this.milliseconds=100*+y}],SS:[i,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],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(y){var T=l.ordinal,V=y.match(/\d+/);if(this.day=V[0],T)for(var Y=1;Y<=31;Y+=1)T(Y).replace(/\[|\]/g,"")===y&&(this.day=Y)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(y){var T=d("months"),V=(d("monthsShort")||T.map(function(Y){return Y.slice(0,3)})).indexOf(y)+1;if(V<1)throw new Error;this.month=V%12||V}],MMMM:[a,function(y){var T=d("months").indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(y){this.year=c(y)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function v(y){var T,V;T=y,V=l&&l.formats;for(var Y=(y=T.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(le,p,H){var S=H&&H.toUpperCase();return p||V[H]||n[H]||V[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,w,O){return w||O.slice(1)})})).match(r),ie=Y.length,N=0;N<ie;N+=1){var A=Y[N],B=E[A],J=B&&B[0],de=B&&B[1];Y[N]=de?{regex:J,parser:de}:A.replace(/^\[|\]$/g,"")}return function(le){for(var p={},H=0,S=0;H<ie;H+=1){var D=Y[H];if(typeof D=="string")S+=D.length;else{var w=D.regex,O=D.parser,F=le.slice(S),$=w.exec(F)[0];O.call(p,$),le=le.replace($,"")}}return function(G){var re=G.afternoon;if(re!==void 0){var he=G.hours;re?he<12&&(G.hours+=12):he===12&&(G.hours=0),delete G.afternoon}}(p),p}}return function(y,T,V){V.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(c=y.parseTwoDigitYear);var Y=T.prototype,ie=Y.parse;Y.parse=function(N){var A=N.date,B=N.utc,J=N.args;this.$u=B;var de=J[1];if(typeof de=="string"){var le=J[2]===!0,p=J[3]===!0,H=le||p,S=J[2];p&&(S=J[2]),l=this.$locale(),!le&&S&&(l=V.Ls[S]),this.$d=function(F,$,G,re){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*F);var he=v($)(F),fe=he.year,Ae=he.month,we=he.day,I=he.hours,k=he.minutes,K=he.seconds,X=he.milliseconds,z=he.zone,W=he.week,ue=new Date,oe=we||(fe||Ae?1:ue.getDate()),j=fe||ue.getFullYear(),te=0;fe&&!Ae||(te=Ae>0?Ae-1:ue.getMonth());var se,ge=I||0,ye=k||0,Me=K||0,Q=X||0;return z?new Date(Date.UTC(j,te,oe,ge,ye,Me,Q+60*z.offset*1e3)):G?new Date(Date.UTC(j,te,oe,ge,ye,Me,Q)):(se=new Date(j,te,oe,ge,ye,Me,Q),W&&(se=re(se).week(W).toDate()),se)}catch{return new Date("")}}(A,de,B,V),this.init(),S&&S!==!0&&(this.$L=this.locale(S).$L),H&&A!=this.format(de)&&(this.$d=new Date("")),l={}}else if(de instanceof Array)for(var D=de.length,w=1;w<=D;w+=1){J[1]=de[w-1];var O=V.apply(this,J);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}w===D&&(this.$d=new Date(""))}else ie.call(this,N)}}})}(Ur)),Ur.exports}var mp=gp();const pp=It(mp);var Pr={exports:{}},_p=Pr.exports,Oo;function Ep(){return Oo||(Oo=1,function(e,t){(function(n,r){e.exports=r()})(_p,function(){return function(n,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,d,f,E,v){var y=u.name?u:u.$locale(),T=o(y[d]),V=o(y[f]),Y=T||V.map(function(N){return N.slice(0,E)});if(!v)return Y;var ie=y.weekStart;return Y.map(function(N,A){return Y[(A+(ie||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,d){return u.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(E,v,y){return v||y.slice(1)})}(u.formats[d.toUpperCase()])},h=function(){var u=this;return{months:function(d){return d?d.format("MMMM"):a(u,"months")},monthsShort:function(d){return d?d.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(u,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(u.$locale(),d)},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(d){return c(u,d)},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)}}})}(Pr)),Pr.exports}var vp=Ep();const Cp=It(vp);var Fr={exports:{}},Rp=Fr.exports,yo;function Ip(){return yo||(yo=1,function(e,t){(function(n,r){e.exports=r()})(Rp,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,d){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,E,v){var y=v&&v.toUpperCase();return E||d[v]||n[v]||d[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(T,V,Y){return V||Y.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})}(Fr)),Fr.exports}var Sp=Ip();const Op=It(Sp);var kr={exports:{}},yp=kr.exports,wo;function wp(){return wo||(wo=1,function(e,t){(function(n,r){e.exports=r()})(yp,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(v){var y={date:v,utc:!0,args:arguments};return new o(y)},l.utc=function(v){var y=a(this.toDate(),{locale:this.$L,utc:!0});return v?y.add(this.utcOffset(),n):y},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(v){v.utc&&(this.$u=!0),this.$utils().u(v.$offset)||(this.$offset=v.$offset),c.call(this,v)};var h=l.init;l.init=function(){if(this.$u){var v=this.$d;this.$y=v.getUTCFullYear(),this.$M=v.getUTCMonth(),this.$D=v.getUTCDate(),this.$W=v.getUTCDay(),this.$H=v.getUTCHours(),this.$m=v.getUTCMinutes(),this.$s=v.getUTCSeconds(),this.$ms=v.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(v,y){var T=this.$utils().u;if(T(v))return this.$u?0:T(this.$offset)?u.call(this):this.$offset;if(typeof v=="string"&&(v=function(N){N===void 0&&(N="");var A=N.match(r);if(!A)return null;var B=(""+A[0]).match(s)||["-",0,0],J=B[0],de=60*+B[1]+ +B[2];return de===0?0:J==="+"?de:-de}(v),v===null))return this;var V=Math.abs(v)<=16?60*v:v,Y=this;if(y)return Y.$offset=V,Y.$u=v===0,Y;if(v!==0){var ie=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(Y=this.local().add(V+ie,n)).$offset=V,Y.$x.$localOffset=ie}else Y=this.utc();return Y};var d=l.format;l.format=function(v){var y=v||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,y)},l.valueOf=function(){var v=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*v},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(v){return v==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var E=l.diff;l.diff=function(v,y,T){if(v&&this.$u===v.$u)return E.call(this,v,y,T);var V=this.local(),Y=a(v).local();return E.call(V,Y,y,T)}}})}(kr)),kr.exports}var bp=wp();const Ap=It(bp);var $r={exports:{}},Tp=$r.exports,bo;function Np(){return bo||(bo=1,function(e,t){(function(n,r){e.exports=r()})(Tp,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")}}})}($r)),$r.exports}var Mp=Np();const Dp=It(Mp);var jr={exports:{}},xp=jr.exports,Ao;function Lp(){return Ao||(Ao=1,function(e,t){(function(n,r){e.exports=r()})(xp,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 d=o(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),f=this.diff(d,n,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(jr)),jr.exports}var Up=Lp();const Pp=It(Up);var Hr={exports:{}},Fp=Hr.exports,To;function kp(){return To||(To=1,function(e,t){(function(n,r){e.exports=r()})(Fp,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}}})}(Hr)),Hr.exports}var $p=kp();const jp=It($p);Bt.extend(pp);Bt.extend(dp);Bt.extend(Dp);Bt.extend(Cp);Bt.extend(Pp);Bt.extend(jp);Bt.extend(Ap);Bt.extend(Op);function ls(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 Hp(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function Bp(e){if(e==null)return!1;const t=e.paragraphStyle;return kl(t)}function kl(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 $l(e,t,n){return e.slice(0,t)+n+e.slice(t)}function jl(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const Wp=/\s/g;function Yp(e){return e===null||e.toString().replace(Wp,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function zp(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 Ve=Symbol("newer"),rt=Symbol("older");class Vp{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ve],{done:!1,value:t.key}):{done:!0,value:void 0}}}class Gp{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ve],{done:!1,value:t.value}):{done:!0,value:void 0}}}class Kp{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ve],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}var aa,la;la=Ve,aa=rt;class No{constructor(t,n){R(this,"key");R(this,"value");R(this,la);R(this,aa);this.key=t,this.value=n,this[Ve]=void 0,this[rt]=void 0}toJSON(){return{key:this.key,value:this.value}}}class er{constructor(...t){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if($n.hasLength(t,1)){if($n.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if($n.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if($n.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(()=>ar(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[Ve]&&(t===this.oldest&&(this.oldest=t[Ve]),t[Ve][rt]=t[rt]),t[rt]&&(t[rt][Ve]=t[Ve]),t[Ve]=void 0,t[rt]=this.newest,this.newest&&(this.newest[Ve]=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 No(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ve]=o,o[rt]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new No(t,n)),this.newest?(this.newest[Ve]=r,r[rt]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Ve]?(this.oldest=this.oldest[Ve],this.oldest[rt]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ve]=t[rt]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Ve]&&n[rt]?(n[rt][Ve]=n[Ve],n[Ve][rt]=n[rt]):n[Ve]?(n[Ve][rt]=void 0,this.oldest=n[Ve]):n[rt]?(n[rt][Ve]=void 0,this.newest=n[rt]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new Vp(this.oldest)}values(){return new Gp(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Kp(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[Ve]}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[Ve];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ve],n&&(t+=" < ");return t}}class $n{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 Br={exports:{}},Xp=Br.exports,Mo;function Qp(){return Mo||(Mo=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:Xp,function(){return function(){var n={d:function(_,g){for(var m in g)n.o(g,m)&&!n.o(_,m)&&Object.defineProperty(_,m,{enumerable:!0,get:g[m]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};n.d(r,{default:function(){return ct}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function c(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function h(_){const g=c(_);let m=null;if(g){const b=l(g);m=o[b.lang]||o[b.language]||null}return m}function u(_){return Object.assign({},a,_)}function d(_,g){const m=typeof g=="object"?g:l(g);return o[m.lang]=u(_),m.language===m.lang||o[m.language]||(o[m.language]=u(_)),o[m.lang]}const f=u({group:","});function E(_,g){if(typeof _!="number")return _;if(_<0)return-E(-_,g);if(g){const m=10**(g||0)||1;return E(_*m,0)/m}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function v(_,g,m){const b=_<0?-1:1,M=10**(g||2),U=10**(m||2);let L,P,C=Math.abs(_),Z=0,_e=0,q=0,me=1;if((_=C)%1==0)P=[_*b,1];else if(_<1e-19)P=[b,1e19];else if(_>1e19)P=[1e19*b,1];else{do if(C=1/(C-Math.floor(C)),L=me,me=me*Math.floor(C)+Z,Z=L,_e=q,q=Math.floor(_*me+.5),q>=M||me>=U)return[b*_e,Z];while(Math.abs(_-q/me)>=1e-10&&C!==Math.floor(C));P=[b*q,me]}return P}const y={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},T=Object.assign({},y);function V(_){if(_===null&&(_=y),_){for(const g in _)if(g in y){const m=_[g];T[g]=m==null?y[g]:m}}return{...T}}const Y={"#":"",0:"0","?":" "},ie={"@":"text","-":"minus","+":"plus"},N=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],A=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],B=new RegExp("["+A.join("")+"]");function J(_,g,m){return g[m+"_max"]=_.length,g[m+"_min"]=_.replace(/#/g,"").length,g}const de={};function le(_){if(!(_ in de)){const g=[],m=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,b=>"?".repeat(b.length));for(let b=0;b<m.length;b++){const M=m.charAt(b);g[b]=M in Y?Y[M]:M}de[_]=g.join("")}return de[_]}function p(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,Y["?"])}),g.push(_)}function H(_){const g=[],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:g};let b=_+"",M="int",U=!1,L=null;const P=[];let C,Z,_e=!1;for(;b&&!U;){if(C=/^General/i.exec(b))m.general=!0,p({type:"general"},g);else if(M==="int"&&(C=/^[#?0]+(?:,[#?0]+)*/.exec(b))||M==="den"&&(C=/^[#?\d]+/.exec(b))||(C=/^[#?0]+/.exec(b)))m[M+"_pattern"].push(C[0]),L={type:M,num:C[0]},p(L,g);else if((C=/^\//.exec(b))&&m[M+"_pattern"].length){if(!L)throw new SyntaxError("Missing a numerator in pattern ".concat(_));m.fractions=!0,m.num_pattern.push(m[M+"_pattern"].pop()),L.type="num",M="den",p({type:"div"},g)}else if(C=/^,+/.exec(b)){const x=b.charAt(1)in Y;Z.slice(-1)in Y&&(C[0].length>1||!x)?m.scale=.001**C[0].length:m.dec_fractions||p(C[0],g)}else{if(C=/^;/.exec(b)){U=!0;break}if(C=/^[@+-]/.exec(b))C[0]==="@"&&(m.text=!0),p({type:ie[C[0]]},g);else if(C=/^(?:\[(h+|m+|s+)\])/i.exec(b)){const x=C[1].toLowerCase(),ee=x[0],ve={type:"",size:0,date:1,raw:C[0],pad:x.length};ee==="h"?(ve.size=16,ve.type="hour-elap"):ee==="m"?(ve.size=32,ve.type="min-elap"):(ve.size=64,ve.type="sec-elap"),m.date=m.date|ve.size,P.push(ve),p(ve,g)}else if(C=/^(?:B2)/i.exec(b))_e||(m.date_system=6);else if(C=/^(?:B1)/i.exec(b))_e||(m.date_system=1);else if(C=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(b)){const x={type:"",size:0,date:1,raw:C[0]},ee=C[0].toLowerCase(),ve=ee[0];if(ee==="y"||ee==="yy")x.size=2,x.type="year-short";else if(ve==="y"||ve==="e")x.size=2,x.type="year";else if(ee==="b"||ee==="bb")x.size=2,x.type="b-year-short";else if(ve==="b")x.size=2,x.type="b-year";else if(ee==="d"||ee==="dd")x.size=8,x.type="day",x.pad=/dd/.test(ee);else if(ee==="ddd")x.size=8,x.type="weekday-short";else if(ve==="d")x.size=8,x.type="weekday";else if(ve==="h")x.size=16,x.type="hour",x.pad=/hh/i.test(ee);else if(ve==="m"){ee.length===3?(x.size=4,x.type="monthname-short"):ee.length===5?(x.size=4,x.type="monthname-single"):ee.length>=4&&(x.size=4,x.type="monthname");const be=P[P.length-1];!x.type&&be&&!be.used&&80&be.size&&(be.used=!0,x.size=32,x.type="min",x.pad=/mm/.test(ee)),x.type||(x.size=4,x.type="month",x.pad=/mm/.test(ee),x.indeterminate=!0)}else if(ve==="s"){x.size=64,x.type="sec",x.pad=/ss/.test(ee);const be=P[P.length-1];be&&32&be.size?x.used=!0:be&&be.indeterminate&&(delete be.indeterminate,be.size=32,be.type="min",x.used=!0)}m.date=m.date|x.size,m.date_eval=!0,P.push(x),p(x,g)}else if(C=/^(?:AM\/PM|am\/pm|A\/P)/.exec(b))m.clock=12,m.date=16|m.date,m.date_eval=!0,p({type:"am",short:C[0]==="A/P"},g);else if(m.date&&(C=/^\.0{1,3}/i.exec(b))){const x=C[0].length-1,ee=[64,128,256,512][x];m.date=m.date|ee,m.date_eval=!0,m.sec_decimals=Math.max(m.sec_decimals,x),p({type:"subsec",size:ee,decimals:x,date:1,raw:C[0]},g)}else if((C=/^\\(.)/.exec(b))||(C=/^"([^"]*?)"/.exec(b)))p(C[1],g);else if(C=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(b))m.condition=[C[1],parseFloat(C[2],10)];else if(C=/^\[\$([^\]]+)\]/.exec(b)){const x=C[1].split("-"),ee=x.length<2?"":x[x.length-1],ve=x[0];ve&&p(ve,g);const be=c(ee);be&&(m.locale=be);const Ue=parseInt(ee,16);isFinite(Ue)&&16711680&Ue&&(Ue>>16&255)===6&&(m.date_system=6),_e=!0}else if(C=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(b))m.color=C[2]?N[parseInt(C[2],10)]||"#000":C[1].toLowerCase();else if(!(C=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(b))){if(C=/^%/.exec(b))m.scale=100,m.percent=!0,p("%",g);else if(C=/^_(\\.|.)/.exec(b))p(" ",g);else if(C=/^\./.exec(b))p({type:"point",value:C[0]},g),m.dec_fractions=!0,M="frac";else if(C=/^[Ee]([+-]?|(?=[0#?]))/.exec(b))m.exponential=!0,m.exp_plus=C[1]==="+",M="man",p({type:"exp",plus:C[1]==="+"},g);else if(!(C=/^\*(\\.|.)/.exec(b))){if(C=/^[BENn[]/.exec(b))throw new SyntaxError("Unexpected char ".concat(b.charAt(0)," in pattern ").concat(_));b[0]==="("&&(m.parens=!0),C=[b[0]],p(C[0],g)}}}Z=C[0],b=b.slice(C?C[0].length:1)}if(m.pattern=_.slice(0,_.length-b.length),/^((?:\[[^\]]+\])+)(;|$)/.test(m.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(m.pattern)&&p({type:"text"},g),m.fractions&&m.dec_fractions||m.fractions&&m.exponential)throw new SyntaxError("Invalid pattern: ".concat(m.pattern));const q=m.int_pattern.join("");if(m.grouping=q.indexOf(",")>=0,m.grouping){const x=q.split(","),ee=x.length;ee===2?(m.group_pri=x[1].length,m.group_sec=m.group_pri):ee>2&&(m.group_pri=x[ee-1].length,m.group_sec=x[ee-2].length)}else m.group_pri=0,m.group_sec=0;J(q.replace(/[,]/g,""),m,"int"),J(m.frac_pattern.join(""),m,"frac"),J(m.man_pattern.join(""),m,"man");let me=m.num_pattern.join(""),Se=m.den_pattern.join("");const ce=/\?/.test(Se)||/\?/.test(me);return Se=Se.replace(/\d/g,ce?"?":"#"),ce&&(Se=Se.replace(/#$/g,"?")),J(me,m,"num"),J(Se,m,"den"),ce&&(me=me.replace(/#$/g,"?")),m.int_padding=le(m.int_pattern.join("")),m.man_padding=le(m.man_pattern.join("")),m.num_padding=le(me),m.den_padding=le(Se),m.den_pattern.length&&(m.denominator=parseInt(m.den_pattern.join("").replace(/\D/g,""),10)),m.integer=!!m.int_pattern.join("").length,m.fractions&&g.forEach((x,ee)=>{const ve=g[ee+1];x.type==="string"&&ve&&(ve.type==="num"?x.rule="num+int":ve.type==="div"?x.rule="num":ve.type==="den"&&(x.rule="den"))}),m}const S=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function D(_){const g=[];let m,b=!1,M=null,U=_,L=0,P=!1,C=0,Z=0;do{if(P=H(U),(P.date||P.general)&&(P.int_pattern.length||P.frac_pattern.length||P.scale!==1||P.text))throw new Error("Illegal format");if(P.condition&&(Z++,b=!0),P.text){if(M)throw new Error("Unexpected partition");M=P}P.locale&&(m=c(P.locale)),g.push(P),L=U.charAt(P.pattern.length)===";"?1:0,U=U.slice(P.pattern.length+L),C++}while(L&&C<4&&Z<3);if(L)throw new Error("Unexpected partition");if(Z>2)throw new Error("Unexpected condition");const _e=g[3];if(_e&&(_e.int_pattern.length||_e.frac_pattern.length||_e.date))throw new Error("Unexpected partition");if(b){const q=g.length;if(q===1&&(g[1]=H("General"),g[1].generated=!0),q<3){const me=g[0],Se=g[1];if(S(me),Se.condition)S(Se);else{const ce=me.condition;(ce[0]==="="||ce[1]>=0&&(ce[0]===">"||ce[0]===">="))&&Se.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(S)}else{if(g.length<4&&M)for(let q=0,me=g.length;q<me;q++)g[q]===M&&g.splice(q,1);if(g.length<1&&M&&(g[0]=H("General"),g[0].generated=!0),g.length<2){const q=H(g[0].pattern);q.tokens.unshift({type:"minus",volatile:!0}),q.generated=!0,g.push(q)}if(g.length<3){const q=H(g[0].pattern);q.generated=!0,g.push(q)}if(g.length<4)if(M)g.push(M);else{const q=H("@");q.generated=!0,g.push(q)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:m}}const w=Math.floor;function O(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let m=_+68569+2415019;const b=w(4*m/146097);m-=w((146097*b+3)/4);const M=w(4e3*(m+1)/1461001);m=m-w(1461*M/4)+31;const U=w(80*m/2447),L=m-w(2447*U/80);m=w(U/11);const P=U+2-12*m;return[0|100*(b-49)+M+m,0|P,0|L]}function F(_){return O(_+1462)}function $(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,m=.1335;let b=_+466935;const M=w(b/10631);b-=10631*M;const U=w((b-m)/g);b-=w(U*g+m);const L=w((b+28.5001)/29.5);return L===13?[30*M+U,12,30]:[30*M+U,L,b-w(29.5001*L-29)]}function G(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const b=w(_);return g===6?$(b):g===-1?F(b):O(b,m)}const re=Math.floor,he=86400;function fe(_,g){let m=null;if(Array.isArray(_)){const[b,M,U,L,P,C]=_;m=Date.UTC(b,M==null?0:M-1,U!=null?U:1,L||0,P||0,C||0)}else if(_ instanceof Date&&(m=1*_,!g||!g.ignoreTimezone)){const b=new Date;b.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),b.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),m=1*b}if(m!=null&&isFinite(m)){const b=m/864e5;return b-(b<=-25509?-25568:-25569)}return _}function Ae(_,g){let m=0|_;const b=he*(_-m);let M=re(b);b-M>.9999&&(M+=1,M===he&&(M=0,m+=1));const U=M<0?he+M:M,[L,P,C]=G(_,0,g&&g.leap1900),Z=re(U/60/60)%60,_e=re(U/60)%60,q=re(U)%60;if(g&&g.nativeDate){const me=new Date(0);return me.setUTCFullYear(L,P-1,C),me.setUTCHours(Z,_e,q),me}return[L,P,C,Z,_e,q]}function we(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function I(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function k(_){const[g,m,b,M]=_;return!(g&&!g.generated||m&&!m.generated||b&&!b.generated||!M||!M.text||M.generated)}const K={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},X=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],z={total:1,sign:0,period:0,int:1,frac:0},W=(_,g)=>_.replace(/\./,g.decimal);function ue(_,g,m,b){const M=0|m;if(typeof m=="string")_.push(m);else if(m===M)_.push(Math.abs(M));else{const U=Math.abs(m);let L=U?Math.floor(Math.log10(U)):0,P=L<0?U*10**-L:U/10**L;P===10&&(P=1,L++);const C=function(_e){let q=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const me=Math.abs(_e);if(!me)return z;const Se=q&&_e<0?1:0,ce=Math.floor(me),x=Math.floor(Math.log10(me)+1);let ee=0,ve=0;if(ce!==me){ee=1;const be=String(E(x<0?me*10**-x:me/10**x,15));let Ue=be.length,Fe=!0,Be=0;for(;Be<=be.length;){if(be[Be]==="."){Ue--;break}be[Be]==="0"&&Fe?Ue--:Fe=!1,Be++}ve=Ue-x,ve<0&&(ve=0,ee=0)}return{total:Se+Math.max(x,1)+ee+ve,digits:Math.max(x,0)+ve,sign:Se,period:ee,int:Math.max(x,1),frac:ve}}(U),Z=()=>{const _e=Math.abs(L);let q;q=P===1?P:E(P,5),_.push(W(q+"",b),b.exponent,L<0?b.negative:b.positive,_e<10?"0":"",_e)};if(L>=-4&&L<=-1){const _e=U.toPrecision(10+L).replace(/\.?0+$/,"");_.push(W(_e,b))}else if(L===10){const _e=U.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(W(_e,b))}else if(Math.abs(L)<=9)if(C.total<=11){const _e=E(U,9).toFixed(C.frac);_.push(W(_e,b))}else L===9?_.push(Math.floor(U)):L>=0&&L<9?_.push(E(U,9-L)):Z();else C.total>=12?Z():Math.floor(U)===U?_.push(Math.floor(U)):_.push(W(E(U,9).toFixed(C.frac),b))}return _}const oe=86400,j={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},te=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const m=Math.floor(Math.log10(_));return g>1?Math.floor(m/g)*g:m};function se(_,g,m,b){let M="",U="",L="",P="",C="",Z=0,_e=0|_,q=0,me=0,Se=1,ce=0,x=0,ee=0,ve=0,be=0,Ue=0;const Fe=b||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(Re){if(Re===0)return Re;const Ne=Math.ceil(Math.log10(Re<0?-Re:Re)),ne=10**(16-Math.floor(Ne));return Math.round(Re*ne)/ne}(_*g.scale)),g.exponential){let Re=Math.abs(_);if(Re){const Ne=10**-te(Re,g.int_max),ne=E(Re*Ne,g.frac_max)/Ne;Z=te(ne,g.int_max)}Re/=10**Z,_=_<0?-Re:Re,M+=Math.abs(Z)}if(g.integer){const Re=Math.abs(E(_,g.fractions?1:g.frac_max));C+=Re<1?"":Math.floor(Re)}if(g.grouping){let Re="",Ne=C.length;for(Ne>g.group_pri&&(Ne-=g.group_pri,Re=Fe.group+C.slice(Ne,Ne+g.group_pri)+Re);Ne>g.group_sec;)Ne-=g.group_sec,Re=Fe.group+C.slice(Ne,Ne+g.group_sec)+Re;C=Ne?C.slice(0,Ne)+Re:Re}g.dec_fractions&&(P=String(E(_,g.frac_max)).split(".")[1]||"");let Be=!1;if(g.fractions){const Re=Math.abs(g.integer?_%1:_);if(Re)if(Be=!0,isFinite(g.denominator))L+=g.denominator,U+=E(Re*g.denominator),U==="0"&&(U="",L="",Be=!1,C||(C="0"));else{const Ne=v(Re,g.integer?g.num_max:1/0,g.den_max);U+=Ne[0],L+=Ne[1],g.integer&&U==="0"&&(C||(C="0"),U="",L="",Be=!1)}}if(g.date){_e=Math.trunc(_);const Re=oe*(_-_e);if(q=Math.floor(Re),Ue=Re-q,Math.abs(Ue)<1e-6?Ue=0:Ue>.9999&&(Ue=0,q+=1,q===oe&&(q=0,_e+=1)),Ue){const Ne=512&g.date||256&g.date||128&g.date;(Ne===512&&Ue>.9995||Ne===256&&Ue>.995||Ne===128&&Ue>.95||!Ne&&Ue>=.5)&&(q++,Ue=0)}if(_e||g.date_system){const Ne=G(_,g.date_system,m.leap1900);me=Ne[0],Se=Ne[1],ce=Ne[2]}if(q){const Ne=q<0?oe+q:q;be=Math.floor(Ne)%60,ve=Math.floor(Ne/60)%60,ee=Math.floor(Ne/60/60)%60}if(x=(6+_e)%7,g.date_eval&&(ht=_,ft=_e+q/oe,m.dateSpanLarge?ht<-694324||ft>=35830291:ht<0||ft>=2958466)){if(m.dateErrorThrows)throw new Error("Date out of bounds");return m.dateErrorNumber?ue(_<0?[Fe.negative]:[],0,_,Fe).join(""):m.overflow}}var ht,ft;if(g.int_padding&&(C=g.int_padding.length===1?C||g.int_padding:g.int_padding.substring(0,g.int_padding.length-C.length)+C),g.num_padding&&(U=g.num_padding.length===1?U||g.num_padding:g.num_padding.substring(0,g.num_padding.length-U.length)+U),g.den_padding&&(L=g.den_padding.length===1?L||g.den_padding:L+g.den_padding.slice(L.length)),g.man_padding){const Re=g.exp_plus?"+":"";M=g.man_padding.length===1?(Z<0?"-":Re)+(M||g.man_padding):(Z<0?"-":Re)+g.man_padding.slice(0,g.man_padding.length-M.length)+M}const Ee=[];let Je=0;const Ie={int:0,frac:0,man:0,num:0,den:0};for(let Re=0,Ne=g.tokens.length;Re<Ne;Re++){const ne=g.tokens[Re],at=ne.num?ne.num.length:0;if(ne.type==="string")ne.rule?ne.rule==="num"?Be?Ee.push(ne.value):(g.num_min>0||g.den_min>0)&&Ee.push(ne.value.replace(/./g,Y["?"])):ne.rule==="num+int"?Be&&C?Ee.push(ne.value):g.den_min>0&&(C||g.num_min)&&Ee.push(ne.value.replace(/./g,Y["?"])):ne.rule==="den"&&(Be?Ee.push(ne.value):(g.den_min>0||g.den_min>0)&&Ee.push(ne.value.replace(/./g,Y["?"]))):Ee.push(ne.value);else if(ne.type==="error")Ee.push(m.invalid);else if(ne.type==="point")Ee.push(g.date?ne.value:Fe.decimal);else if(ne.type==="general")ue(Ee,0,_,Fe);else if(ne.type==="exp")Ee.push(Fe.exponent);else if(ne.type==="minus")ne.volatile&&g.date||ne.volatile&&(_>=0||typeof _!="number")||(ne.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&C&&C!=="0"||P)&&Ee.push(Fe.negative):Ee.push(Fe.negative));else if(ne.type==="plus")Ee.push(Fe.positive);else if(ne.type==="text")Ee.push(_);else if(ne.type==="div")Be?Ee.push("/"):g.num_min>0||g.den_min>0?Ee.push(Y["?"]):Ee.push(Y["#"]);else if(ne.type==="int")if(g.int_pattern.length===1)Ee.push(C);else{const je=Je?g.int_pattern.join("").length-Ie.int:1/0,Tt=Je===g.int_pattern.length-1?0:g.int_pattern.join("").length-(Ie.int+ne.num.length);Ee.push(C.substring(C.length-je,C.length-Tt)),Je++,Ie.int+=ne.num.length}else if(ne.type==="frac"){const je=Ie.frac;for(let Tt=0;Tt<at;Tt++)Ee.push(P[Tt+je]||Y[ne.num[Tt]]);Ie.frac+=at}else if(ne.type in j)g[ne.type+"_pattern"].length===1?(ne.type==="int"&&Ee.push(C),ne.type==="frac"&&Ee.push(P),ne.type==="man"&&Ee.push(M),ne.type==="num"&&Ee.push(U),ne.type==="den"&&Ee.push(L)):(Ee.push(j[ne.type].slice(Ie[ne.type],Ie[ne.type]+at)),Ie[ne.type]+=at);else if(ne.type==="year")me<0&&Ee.push(Fe.negative),Ee.push(String(Math.abs(me)).padStart(4,"0"));else if(ne.type==="year-short"){const je=me%100;Ee.push(je<10?"0":"",je)}else if(ne.type==="month")Ee.push(ne.pad&&Se<10?"0":"",Se);else if(ne.type==="monthname-single")g.date_system===6?Ee.push(Fe.mmmm6[Se-1].charAt(0)):Ee.push(Fe.mmmm[Se-1].charAt(0));else if(ne.type==="monthname-short")g.date_system===6?Ee.push(Fe.mmm6[Se-1]):Ee.push(Fe.mmm[Se-1]);else if(ne.type==="monthname")g.date_system===6?Ee.push(Fe.mmmm6[Se-1]):Ee.push(Fe.mmmm[Se-1]);else if(ne.type==="weekday-short")Ee.push(Fe.ddd[x]);else if(ne.type==="weekday")Ee.push(Fe.dddd[x]);else if(ne.type==="day")Ee.push(ne.pad&&ce<10?"0":"",ce);else if(ne.type==="hour"){const je=ee%g.clock||(g.clock<24?g.clock:0);Ee.push(ne.pad&&je<10?"0":"",je)}else if(ne.type==="min")Ee.push(ne.pad&&ve<10?"0":"",ve);else if(ne.type==="sec")Ee.push(ne.pad&&be<10?"0":"",be);else if(ne.type==="subsec"){Ee.push(Fe.decimal);const je=Ue.toFixed(g.sec_decimals);Ee.push(je.slice(2,2+ne.decimals))}else if(ne.type==="am"){const je=ee<12?0:1;ne.short&&!b?Ee.push("AP"[je]):Ee.push(Fe.ampm[je])}else if(ne.type==="hour-elap"){_<0&&Ee.push(Fe.negative);const je=24*_e+Math.floor(Math.abs(q)/3600);Ee.push(String(Math.abs(je)).padStart(ne.pad,"0"))}else if(ne.type==="min-elap"){_<0&&Ee.push(Fe.negative);const je=1440*_e+Math.floor(Math.abs(q)/60);Ee.push(String(Math.abs(je)).padStart(ne.pad,"0"))}else if(ne.type==="sec-elap"){_<0&&Ee.push(Fe.negative);const je=_e*oe+Math.abs(q);Ee.push(String(Math.abs(je)).padStart(ne.pad,"0"))}else if(ne.type==="b-year")Ee.push(me+543);else if(ne.type==="b-year-short"){const je=(me+543)%100;Ee.push(je<10?"0":"",je)}}return m.nbsp?Ee.join(""):Ee.join("").replace(/\u00a0/g," ")}function ge(_,g){for(let m=0;m<3;m++){const b=g[m];if(b){let M;if(b.condition){const U=b.condition[0],L=b.condition[1];U==="="?M=_===L:U===">"?M=_>L:U==="<"?M=_<L:U===">="?M=_>=L:U==="<="?M=_<=L:U==="<>"&&(M=_!==L)}else M=!0;if(M)return b}}}const ye=H("@"),Me="black",Q={};function Ce(_,g){if(_){const m=_[0];g[m]=g[m]||{},Ce(_.slice(1),g[m])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","m-d-y","m-d-Y","m-j-y","m-j-Y","n-d-y","n-d-Y","n-j-y","n-j-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"].forEach(_=>{Ce(_,Q),Ce(_+" x",Q),Ce(_+" l",Q),Ce(_+" l x",Q),Ce("l "+_,Q),Ce("l "+_+" x",Q),Ce(_+" D",Q),Ce(_+" D x",Q),Ce("D "+_,Q),Ce("D "+_+" x",Q)});const We={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},He={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Le={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},Xe=new Date().getUTCFullYear();function Et(_){const g=new RegExp("^([\\s+%"+A.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+A.join("")+")]*)$").exec(_);if(g){const[,m,b,M,U,L]=g;let P=1,C="",Z=!1,_e=!1,q=!1,me=!1,Se=!1,ce=null,x=!1,ee=parseFloat(b.replace(/,/g,""));if(!isFinite(ee))return null;for(let be=0;be<m.length;be++){const Ue=m[be];if(Ue==="-"){if(Z||_e)return null;Z=!0,P=-1}else if(B.test(Ue)){if(Se)return null;Se=!0,ce=Ue}else if(Ue==="("){if(_e||Z)return null;_e=!0,P=-1}else if(Ue==="%"){if(me)return null;me=!0}}for(let be=0;be<L.length;be++){const Ue=L[be];if(B.test(Ue)){if(Se)return null;Se=!0,ce=Ue,x=!0}else if(Ue===")"){if(q||!_e)return null;q=!0}else if(Ue==="%"){if(me)return null;me=!0}}if(U){if(me||Se)return null;C="0.00E+00"}else if(me){if(Se)return null;C=M.includes(".")?"0.00%":"0%",ee*=.01}else if(Se){const be=M.includes(".")?"#,##0.00":"#,##0";C=x?be+ce:ce+be}else M.includes(",")&&(C=M.includes(".")?"#,##0.00":"#,##0");const ve={v:ee*P};return C&&(ve.z=C),ve}}const Ye=(_,g,m)=>{const b=m.path||"",M=Object.keys(g);for(let U=0;U<M.length;U++){let L;const P=M[U];if(g[P]){if(P==="$"||P==="€")_||(L=m);else if(P==="-"){const C=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(C){const Z=C[1]==="-"||C[1]==="/"||C[1]==="."?C[1]:" ";if(!m.sep||m.sep===Z){const _e=C[0].replace(/\s+/g," ");L=Ye(_.slice(C[0].length),g[P],{...m,sep:Z,path:b+_e})}}}else if(P===" "){const C=/^[,.]?\s+/.exec(_);if(C){const Z=C[0].replace(/\s+/g," ");L=Ye(_.slice(C[0].length),g[P],{...m,path:b+Z})}}else if(P==="j"||P==="d"){const C=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);C&&(L=Ye(_.slice(C[0].length),g[P],{...m,day:C[0],path:b+P}))}else if(P==="n"||P==="m"){const C=/^(0?[1-9]|1[012])\b/.exec(_);C&&(L=Ye(_.slice(C[0].length),g[P],{...m,month:+C[0],_mon:C[0],path:b+P}))}else if(P==="F"||P==="M"){const C=/^([a-z]{3,9})\b/i.exec(_),Z=C&&(P==="F"?He:We)[C[0].toLowerCase()];Z&&(L=Ye(_.slice(C[0].length),g[P],{...m,month:Z,_mon:C[0],path:b+P}))}else if(P==="l"||P==="D"){const C=/^([a-z]{3,9})\b/i.exec(_);(C&&Le[C[0].toLowerCase()])===P&&(L=Ye(_.slice(C[0].length),g[P],{...m,path:b+P}))}else if(P==="y"){const C=/^\d\d\b/.exec(_);if(C){const Z=+C[0]>=30?+C[0]+1900:+C[0]+2e3;L=Ye(_.slice(C[0].length),g[P],{...m,year:Z,path:b+P})}}else if(P==="Y"){const C=/^\d\d\d\d\b/.exec(_);C&&(L=Ye(_.slice(C[0].length),g[P],{...m,year:+C[0],path:b+P}))}else{if(P!=="x")throw new Error('Unknown date token "'.concat(P,'"'));{const C=ze(_);C&&(L=Ye("",g[P],{...m,time:C.v,tf:C.z,path:b+P}))}}if(L)return L}}};function Ze(_,g){const m=Ye(_.trim(),Q,{path:""});if(m){var b;if(m.sep==="."&&m.path.length===3)return null;const M=+((b=m.year)!==null&&b!==void 0?b:Xe);if(m.day||(m.day=1),!function(P,C,Z){if(Z<1||C<1||C>12)return!1;if(C===2){if(Z>(P%4==0&&P%100!=0||P%400==0||P===1900?29:28))return!1}else if((C===4||C===6||C===9||C===11)&&Z>30||(C===1||C===3||C===5||C===7||C===8||C===10||C===12)&&Z>31)return!1;return!0}(M,m.month,m.day))return null;let U=-1/0;if(M<1900)return null;M<=1900&&m.month<=2?U=25568:M<1e4&&(U=25569);const L=Date.UTC(M,m.month-1,m.day)/864e5+U+(m.time||0);if(L>=0&&L<=2958465){const P=m._mon[0]==="0"||m.day[0]==="0"||m._mon.length===2&&m.day.length===2,C=m.path.replace(/[jdlDnmMFyYx-]/g,Z=>Z==="j"||Z==="d"?P?"dd":"d":Z==="D"?"ddd":Z==="l"?"dddd":Z==="n"||Z==="m"?P?"mm":"m":Z==="M"?"mmm":Z==="F"?"mmmm":Z==="y"?"yy":Z==="x"?m.tf||"":Z==="Y"?"yyyy":Z);return g&&g.nativeDate?{v:Ae(L,g),z:C}:{v:L,z:C}}}return null}function ze(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,m,b,M,U,L]=g;if(U&&!M||!L&&!b&&!M)return null;let P=1*(m||0);if(L){if(P>=13)return null;L[0]!=="p"&&L[0]!=="P"||(P+=12)}return{v:(60*P*60+60*(1*(b||0))+1*(M||0)+1*(U||0))/86400,z:(m.length===2?"hh":"h")+":mm"+(M?":ss":"")+(L?" AM/PM":"")}}return null}function ut(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const it={};function Pt(_,g){const{pattern:m,partitions:b,locale:M}=_,U=C=>{const Z=Object.assign({},V(),g,C);return M&&(Z.locale=M),Z},L=(C,Z)=>{const _e=U(Z);return function(q,me,Se){const ce=h(Se.locale),x=me[3]?me[3]:ye;if(typeof q=="boolean"&&(q=q?"TRUE":"FALSE"),q==null)return"";if(typeof q!="number")return se(q,x,Se,ce);if(!isFinite(q)){const ve=ce||f;return isNaN(q)?ve.nan:(q<0?ve.negative:"")+ve.infinity}const ee=ge(q,me);return ee?se(q,ee,Se,ce):Se.overflow}(fe(C,_e),b,_e)};L.color=(C,Z)=>function(_e,q){if(typeof _e!="number"||!isFinite(_e))return(q[3]?q[3].color:ye.color)||Me;const me=ge(_e,q);return me&&me.color||Me}(fe(C,U(Z)),b);const P=function(C){var Z;let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[q,me]=C,Se=q.frac_max,ce={type:"general",isDate:I(C),isText:k(C),isPercent:we(C),maxDecimals:q.general?9:Se,scale:(Z=q.scale)!==null&&Z!==void 0?Z:1,color:0,parentheses:0,grouped:q.grouping?1:0,_partitions:C},x=!ce.isDate&&!ce.isText&&!q.error&&q.tokens.some(Fe=>Fe.type==="string"&&(_e?Fe.value===_e:B.test(Fe.value)));let ee="G",ve=Se>=0?Math.min(15,Se):"",be="",Ue="";if(me&&me.color&&(Ue="-",ce.color=1),q.parens&&(be="()",ce.parentheses=1),x)ee="C",ce.type="currency";else if(q.error)ce.type="error",ce.maxDecimals=0;else if(ce.isDate){let Fe=0,Be=0,ht="";q.tokens.forEach(Ee=>{const Je=Ee.type;/^(b-)?year/.test(Je)?(ht+="Y",Be++):Je.startsWith("month")?(ht+="M",Be++):/^(week)?day/.test(Je)?(ht+="D",Be++):Je!=="hour"&&Je!=="min"&&Je!=="sec"&&Je!=="am"||(ht+=Je[0],Fe++)}),ce.type="date",Be&&Fe?ce.type="datetime":!Be&&Fe&&(ce.type="time");const ft=X.find(Ee=>ht.startsWith(Ee[0]));ee=ft?"D":"G",ve=ft?ft[1]:""}else ce.isText?(ee="G",ce.type="text",ve="",ce.maxDecimals=0):q.general?(ee="G",ce.type="general",ve=""):q.fractions?(ee="G",ce.type="fraction",ve=""):q.exponential?(ee="S",ce.type="scientific"):ce.isPercent?(ee="P",ce.type="percent"):q.grouping?(ee=",",ce.type="grouped"):(q.int_max||Se)&&(ee="F",ce.type="number");return ce.code=ee+ve+Ue+be,ce.level=K[ce.type],Object.freeze(ce)}(b,(g||{}).currency)||new SyntaxError;return L.info=P,L.dateInfo=function(C){const[Z]=C;return{year:!!(2&Z.date),month:!!(4&Z.date),day:!!(8&Z.date),hours:!!(16&Z.date),minutes:!!(32&Z.date),seconds:!!(64&Z.date),clockType:Z.clock===12?12:24}}(b),L.isPercent=()=>!!P.isPercent,L.isDate=()=>!!P.isDate,L.isText=()=>!!P.isText,L.pattern=m,_.error&&(L.error=_.error),L.options=U,L.locale=M||g&&g.locale||"",Object.freeze(L)}function ke(_,g){_||(_="General");let m=null;return it[_]?m=it[_]:(m=Object.assign({},V(),g).throws?D(_):function(b){try{return D(b)}catch(M){const U={tokens:[{type:"error"}],error:M.message};return{pattern:b,partitions:[U,U,U,U],error:M.message,locale:null}}}(_),m.error||(it[_]=m)),Pt(m,g)}ke.isDate=_=>ke(_,{throws:!1}).isDate(),ke.isPercent=_=>ke(_,{throws:!1}).isPercent(),ke.isText=_=>ke(_,{throws:!1}).isText(),ke.getInfo=(_,g)=>ke(_,{...g,throws:!1}).info,ke.getDateInfo=(_,g)=>ke(_,{...g,throws:!1}).dateInfo,ke.dateToSerial=fe,ke.dateFromSerial=Ae,ke.options=V,ke.dec2frac=v,ke.round=E,ke.codeToLocale=s,ke.parseLocale=l,ke.getLocale=h,ke.addLocale=(_,g)=>{const m=l(g);return delete it[m.lang],delete it[m.language],d(_,m)},ke.format=function(_,g,m){let b=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const M=m&&typeof m=="object"?m:{locale:m,throws:!b};return ke(_,M)(fe(g,M),M)},ke.is_date=ke.isDate,ke.parseNumber=Et,ke.parseDate=Ze,ke.parseTime=ze,ke.parseBool=ut,ke.parseValue=function(_,g){var m,b,M;return(m=(b=(M=Et(_))!==null&&M!==void 0?M:Ze(_,g))!==null&&b!==void 0?b:ze(_))!==null&&m!==void 0?m:ut(_)};var ct=ke;return r=r.default}()})}(Br)),Br.exports}var Es,Do;function qp(){return Do||(Do=1,Es=Qp()),Es}var Jp=qp();const Zp=It(Jp),e_=Zp;function Qt(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 Ws(e,t,n){const r=Qt(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function Ys(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 t_(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 n_(e,t,n){const r=n;if(Qt(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 zs(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?r_(e,t,n,r):s_(e,t,n,r)}function r_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-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 s_(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 xt{constructor(t={}){R(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new xt({[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){zs(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{zs(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)Ws(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&Ws(r,void 0,i)})}removeRows(t,n){Ys(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&Ys(t,n,s)})}getFragment(t,n,r,s){const i=new xt;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 xt;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,ae.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Qt(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=Qt(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 xt;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=Qt(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 i_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},o_={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},a_={startRow:0,startColumn:0,endRow:0,endColumn:0},l_={row:0,column:0},lt={ff:"Arial",fs:11,it:xe.FALSE,bl:xe.FALSE,ul:{s:xe.FALSE},st:{s:xe.FALSE},ol:{s:xe.FALSE},tr:{a:0,v:xe.FALSE},td:Zn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Gt.UNSPECIFIED,vt:on.UNSPECIFIED,tb:un.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},Hl={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},u_=[fi,Na,gi];var Bl=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(Bl||{});function Rr(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 xe.FALSE;switch(e){case"bl":case"it":{if(o[e]===xe.FALSE)return xe.FALSE;break}case"ul":case"st":{if(o[e].s===xe.FALSE)return xe.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
7
+ `)===r?xe.TRUE:xe.FALSE}const Qn=class Qn{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 xt;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 xt;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=ae.numToWord(r+1)+(t+1),o=ae.numToWord(s+1)+(n+1)):(i=ae.numToWord(s+1)+(n+1),o=ae.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)||lt.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 Qn(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)||lt.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?Rr("ul",t.body)===xe.TRUE?{s:xe.TRUE}:{s:xe.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?Rr("st",t.body)===xe.TRUE?{s:xe.TRUE}:{s:xe.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?Rr("it",t.body)===xe.TRUE?Kr.ITALIC:Kr.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?Rr("bl",t.body)===xe.TRUE?Xr.BOLD:Xr.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()===un.WRAP?xe.TRUE:xe.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Qn.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]||lt[t]}))}};R(Qn,"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 bn=Qn;function c_(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=xo(s.startRow,n,s.startColumn,t,a),c=xo(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 xo(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 yi(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 d of e){if(d.startRow>u)break;if(d.startRow<=h&&d.endRow>=u&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function h_(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 d_(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 f_(e){const t=yi(e),n=h_(t);return d_(n)}function g_(e,t){const n=[];return e.forEach(r=>{n.push(...Jt.subtract(r,t))}),Jt.mergeRanges(n)}function m_(e,t){const n=Lo(e.startRow,e.endRow,t.startRow,t.endRow),r=Lo(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=p_(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Lo(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 p_(e,t,n,r,s,i){const o=e!==void 0?e:Uo(n,r,s,i),a=t!==void 0?t:Uo(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 Uo(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 Ft=class Ft{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===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,d=i<=h&&o>=c;return u&&d}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,d=Math.abs(o+a-h-u),f=Math.abs(o-a)+Math.abs(h-u),E=Math.abs(s+i-l-c),v=Math.abs(s-i)+Math.abs(l-c);return d<=f&&E<=v}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,d,f,E;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?E=s:E=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?f=o:f=h;else return null;return{startRow:d,endRow:E,startColumn:u,endColumn:f,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 Ft.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType: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=Ft.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?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 f_(t)}static splitIntoGrid(t){return yi(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=g_(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(Ft,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),R(Ft,"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(Ft,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),R(Ft,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),R(Ft,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let Jt=Ft;function __(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=E_(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function E_(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 v_(e,t){bn.foreach(t,(n,r)=>{e[n][r]=void 0})}function C_(e,t){const n=e.toFullArray(),r=[];for(;;){const s=__(n,t);if(!s)break;r.push(s),v_(n,s)}return r}class R_{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 Vs(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 I_(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 Jr=65,Wl=90,S_=97;function O_(e){const t=Wl-Jr+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+Jr)+n,e=Math.floor(e/t)-1;return n}function Yl(e,t){let n="";for(;t>0;)n+=e,t--;return n}function y_(e,t=!1){const n=Wl-Jr+1;let r=S_;t&&(r=Jr);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Yl(s,i)}function w_(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function b_(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function fr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var $e=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{}),Mt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Mt||{}),Gs=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Gs||{});class us extends nt{}var zl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(zl||{}),Vl=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Vl||{}),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||{}),gr=(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))(gr||{}),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||{}),an=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(an||{}),Gl=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Gl||{}),wi=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(wi||{}),Kl=(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))(Kl||{}),Xl=(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))(Xl||{}),Ql=(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))(Ql||{}),ql=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(ql||{}),Jl=(e=>(e[e.TEXT_RUN=0]="TEXT_RUN",e[e.AUTO_TEXT=1]="AUTO_TEXT",e[e.PAGE_BREAK=2]="PAGE_BREAK",e[e.COLUMN_BREAK=3]="COLUMN_BREAK",e[e.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",e[e.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",e[e.EQUATION=6]="EQUATION",e[e.DRAWING=7]="DRAWING",e[e.PERSON=8]="PERSON",e[e.RICH_LINK=9]="RICH_LINK",e))(Jl||{}),Zl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Zl||{}),eu=(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))(eu||{}),tu=(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))(tu||{}),nu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(nu||{}),ru=(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))(ru||{}),su=(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))(su||{}),iu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(iu||{}),ou=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(ou||{}),au=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(au||{}),lu=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(lu||{}),uu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(uu||{}),cu=(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))(cu||{}),Rn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Rn||{}),hu=(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))(hu||{}),du=(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))(du||{}),fu=(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))(fu||{}),gu=(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))(gu||{}),mu=(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))(mu||{}),pu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(pu||{}),_u=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(_u||{}),Eu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(Eu||{}),vu=(e=>(e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e[e.DRAWING_IMAGE=0]="DRAWING_IMAGE",e[e.DRAWING_SHAPE=1]="DRAWING_SHAPE",e[e.DRAWING_CHART=2]="DRAWING_CHART",e[e.DRAWING_TABLE=3]="DRAWING_TABLE",e[e.DRAWING_SMART_ART=4]="DRAWING_SMART_ART",e[e.DRAWING_VIDEO=5]="DRAWING_VIDEO",e[e.DRAWING_GROUP=6]="DRAWING_GROUP",e[e.DRAWING_UNIT=7]="DRAWING_UNIT",e[e.DRAWING_DOM=8]="DRAWING_DOM",e))(vu||{}),bi=(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))(bi||{}),Cu=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(Cu||{}),Ru=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(Ru||{});function A_(e=ae.generateRandomId(6),t=dr.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:wi.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:xe.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:xe.TRUE,doNotHyphenateCaps:xe.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:xe.FALSE,useFirstPageHeaderFooter:xe.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var rn={},Ln={},Ir={},Po;function T_(){if(Po)return Ir;Po=1,Object.defineProperty(Ir,"__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 Ir.default=n,Ir}var Sr={},Fo;function N_(){if(Fo)return Sr;Fo=1,Object.defineProperty(Sr,"__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 Sr.default=e,Sr}var vs={},ko;function Iu(){return ko||(ko=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 d in h){const f=d;u.write(f,h[f])}}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 d=this.container,f=this.parents.length-1,E=this.idx;for(;E>=0;)u.unshift(d[E]),E===0?(E=this.indexes[f*2],d=this.parents[f--]):E-=n(d[E-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 d=this.container[u];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=d):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,d=this.parents[this.parents.length-1];return u>=d.length?!1:(t(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=d[u],!0)}_init(u,d,f,E){this.container=u,this.idx=d,this.parents=f.slice(),this.indexes=E.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,d){const f=this.getComponent();f&&d(f,u);for(const E of this)u&&u.descend(E),this.traverse(u,d),u&&u.ascend()}eachPick(u,d){this.traverse(u,(f,E)=>{f.p!=null&&d(f.p,E)})}eachDrop(u,d){this.traverse(u,(f,E)=>{f.d!=null&&d(f.d,E)})}}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 d=this.pendingDescent[u];let f=this.idx+1;if(f<this.container.length&&n(this.container[f])&&f++,t(f===this.container.length||!n(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const E=this.container.splice(f,this.container.length-f);this.container.push(E),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const E=[d];this.container.splice(f,0,E),this.container=E}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&n(this.container[u]))return this.container[u];{const d={};return this.container.splice(u,0,d),d}}write(u,d){const f=this.getComponent();t(f[u]==null||f[u]===d,"Internal consistency error: Overwritten component. File a bug"),f[u]=d}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,d=s){if(u===null)return;if(t(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,E=this.parents.length;let v=0;for(let y=0;y<u.length;y++){const T=u[y];typeof T=="string"||typeof T=="number"?(v++,this.descend(T)):Array.isArray(T)?this.mergeTree(T,d):typeof T=="object"&&d(T,this)}for(;v--;)this.ascend();this.lcIdx=this.parents.length===E?f:-1}at(u,d){this.descendPath(u),d(this);for(let f=0;f<u.length;f++)this.ascend();return this}writeAtPath(u,d,f){return this.at(u,()=>this.write(d,f)),this.reset(),this}writeMove(u,d,f=0){return this.writeAtPath(u,"p",f).writeAtPath(d,"d",f)}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,d){let f,E;E=f=h?h.descendFirst():!1;function v(y){let T;for(;E;){const V=T=h.getKey();if(y!=null){let Y=!1;if(u&&typeof V=="number"&&(T=u(V,h.getComponent()),T<0&&(T=~T,Y=!0)),r(T,y))return null;if(T===y&&!Y)return h}d&&typeof T=="number"&&d(T,h.getComponent()),E=h.nextSibling()}return null}return v.end=()=>{f&&h.ascend()},v}e.advancer=l;function c(h,u,d){let f,E,v,y;for(f=E=h&&h.descendFirst(),v=y=u&&u.descendFirst();f||v;){let T=f?h.getKey():null,V=v?u.getKey():null;T!==null&&V!==null&&(r(V,T)?V=null:T!==V&&(T=null)),d(T==null?V:T,T!=null?h:null,V!=null?u:null),T!=null&&f&&(f=h.nextSibling()),V!=null&&v&&(v=u.nextSibling())}E&&h.ascend(),y&&u.ascend()}e.eachChildOf=c}(vs)),vs}var Cs={},$o;function Su(){return $o||($o=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={}))}(Cs)),Cs}var Ot={},sn={},jo;function Ai(){return jo||(jo=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.uniToStrPos=sn.strPosToUni=void 0,sn.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},sn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),sn}var Rs={},Ho;function Ks(){return Ho||(Ho=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Ai(),n=N=>{if(!Array.isArray(N))throw Error("Op must be an array of components");let A=null;for(let B=0;B<N.length;B++){const J=N[B];switch(typeof J){case"object":if(typeof J.d!="number"&&typeof J.d!="string")throw Error("Delete must be number or string");if(e.dlen(J.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(J.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(J>0))throw Error("Skip components must be >0");if(typeof A=="number")throw Error("Adjacent skip components should be combined");break}A=J}if(typeof A=="number")throw Error("Op has a trailing skip")};function r(N,A){let B=0,J=0;for(let de=0;de<N.length;de++){const le=N[de];switch(A(le,B,J),typeof le){case"object":B+=e.dlen(le.d);break;case"string":J+=t.strPosToUni(le);break;case"number":B+=le,J+=le;break}}}e.eachOp=r;function s(N,A){const B=[],J=a(B);return r(N,(de,le,p)=>{J(A(de,le,p))}),u(B)}const i=N=>N,o=N=>s(N,i);e.dlen=N=>typeof N=="number"?N:t.strPosToUni(N);const a=N=>A=>{if(!(!A||A.d===0||A.d===""))if(N.length===0)N.push(A);else if(typeof A==typeof N[N.length-1])if(typeof A=="object"){const B=N[N.length-1];B.d=typeof B.d=="string"&&typeof A.d=="string"?B.d+A.d:e.dlen(B.d)+e.dlen(A.d)}else N[N.length-1]+=A;else N.push(A)},l=N=>typeof N=="number"?N:typeof N=="string"?t.strPosToUni(N):typeof N.d=="number"?N.d:t.strPosToUni(N.d);e.uniSlice=(N,A,B)=>{const J=t.uniToStrPos(N,A),de=B==null?1/0:t.uniToStrPos(N,B);return N.slice(J,de)};const c=(N,A,B)=>typeof N=="number"?B==null?N-A:Math.min(N,B)-A:e.uniSlice(N,A,B),h=N=>{let A=0,B=0;return{take:(le,p)=>{if(A===N.length)return le===-1?null:le;const H=N[A];let S;if(typeof H=="number")return le===-1||H-B<=le?(S=H-B,++A,B=0,S):(B+=le,le);if(typeof H=="string"){if(le===-1||p==="i"||t.strPosToUni(H.slice(B))<=le)return S=H.slice(B),++A,B=0,S;{const D=B+t.uniToStrPos(H.slice(B),le);return S=H.slice(B,D),B=D,S}}else{if(le===-1||p==="d"||e.dlen(H.d)-B<=le)return S={d:c(H.d,B)},++A,B=0,S;{let D=c(H.d,B,B+le);return B+=le,{d:D}}}},peek:()=>N[A]}},u=N=>(N.length>0&&typeof N[N.length-1]=="number"&&N.pop(),N);function d(N,A,B){if(B!=="left"&&B!=="right")throw Error("side ("+B+") must be 'left' or 'right'");n(N),n(A);const J=[],de=a(J),{take:le,peek:p}=h(N);for(let S=0;S<A.length;S++){const D=A[S];let w,O;switch(typeof D){case"number":for(w=D;w>0;)O=le(w,"i"),de(O),typeof O!="string"&&(w-=l(O));break;case"string":B==="left"&&typeof p()=="string"&&de(le(-1)),de(t.strPosToUni(D));break;case"object":for(w=e.dlen(D.d);w>0;)switch(O=le(w,"i"),typeof O){case"number":w-=O;break;case"string":de(O);break;case"object":w-=e.dlen(O.d)}break}}let H;for(;H=le(-1);)de(H);return u(J)}function f(N,A){n(N),n(A);const B=[],J=a(B),{take:de}=h(N);for(let p=0;p<A.length;p++){const H=A[p];let S,D;switch(typeof H){case"number":for(S=H;S>0;)D=de(S,"d"),J(D),typeof D!="object"&&(S-=l(D));break;case"string":J(H);break;case"object":S=e.dlen(H.d);let w=0;for(;w<S;)switch(D=de(S-w,"d"),typeof D){case"number":J({d:c(H.d,w,w+D)}),w+=D;break;case"string":w+=t.strPosToUni(D);break;case"object":J(D)}break}}let le;for(;le=de(-1);)J(le);return u(B)}const E=(N,A)=>{let B=0;for(let J=0;J<A.length&&N>B;J++){const de=A[J];switch(typeof de){case"number":{B+=de;break}case"string":const le=t.strPosToUni(de);B+=le,N+=le;break;case"object":N-=Math.min(e.dlen(de.d),N-B);break}}return N},v=(N,A)=>typeof N=="number"?E(N,A):N.map(B=>E(B,A));function y(N,A,B){return s(N,(J,de)=>typeof J=="object"&&typeof J.d=="number"?{d:B.slice(A,de,de+J.d)}:J)}function T(N){return s(N,A=>{switch(typeof A){case"object":if(typeof A.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return A.d;case"string":return{d:A};case"number":return A}})}function V(N){return s(N,A=>typeof A=="object"&&typeof A.d=="string"?{d:t.strPosToUni(A.d)}:A)}function Y(N){let A=!0;return r(N,B=>{typeof B=="object"&&typeof B.d=="number"&&(A=!1)}),A}function ie(N){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,normalize:o,checkOp:n,create(A=""){if(typeof A!="string")throw Error("Initial data must be a string");return N.create(A)},apply(A,B){n(B);const J=N.builder(A);for(let de=0;de<B.length;de++){const le=B[de];switch(typeof le){case"number":J.skip(le);break;case"string":J.append(le);break;case"object":J.del(e.dlen(le.d));break}}return J.build()},transform:d,compose:f,transformPosition:E,transformSelection:v,isInvertible:Y,makeInvertible(A,B){return y(A,B,N)},stripInvertible:V,invert:T,invertWithDoc(A,B){return T(y(A,B,N))},isNoop:A=>A.length===0}}e.default=ie}(Rs)),Rs}var Or={},Bo;function M_(){if(Bo)return Or;Bo=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=Ks(),t=Ai();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 Or.default=n,n.provides={text:!0},Or}var Wo;function D_(){return Wo||(Wo=1,function(e){var t=Ot&&Ot.__createBinding||(Object.create?function(d,f,E,v){v===void 0&&(v=E),Object.defineProperty(d,v,{enumerable:!0,get:function(){return f[E]}})}:function(d,f,E,v){v===void 0&&(v=E),d[v]=f[E]}),n=Ot&&Ot.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Ot&&Ot.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var E in d)Object.hasOwnProperty.call(d,E)&&t(f,d,E);return n(f,d),f},s=Ot&&Ot.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Ai(),o=r(Ks()),a=s(M_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(E){let v=i.uniToStrPos(d,E);if(v>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,v)),d=d.slice(v)},append(E){f.push(E)},del(E){d=d.slice(i.uniToStrPos(d,E))},build(){return f.join("")+d}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{api:a.default});e.type=h,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var u=Ks();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(Ot)),Ot}var Yo;function x_(){return Yo||(Yo=1,function(e){var t=Ln&&Ln.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(T_()),r=t(N_()),s=Iu(),i=Su();function o(I,k){if(!I)throw new Error(k)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:I=>I,isNoop:I=>I==null,setDebug(I){},registerSubtype:T,checkValidOp:de,normalize:le,apply:p,transformPosition:H,compose:S,tryTransform:G,transform:he,makeInvertible:O,invert:D,invertWithDoc:F,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(I,k,K)=>we(()=>!0,I,k,K),typeAllowingConflictsPred:I=>Object.assign(Object.assign({},e.type),{transform:(k,K,X)=>we(I,k,K,X)})};const a=I=>I?I.getComponent():null;function l(I){return I&&typeof I=="object"&&!Array.isArray(I)}const c=I=>Array.isArray(I)?I.slice():I!==null&&typeof I=="object"?Object.assign({},I):I,h=I=>I&&(I.p!=null||I.r!==void 0),u=I=>I&&(I.d!=null||I.i!==void 0);function d(I,k){return o(I!=null),typeof k=="number"?(o(Array.isArray(I),"Invalid key - child is not an array"),(I=I.slice()).splice(k,1)):(o(l(I),"Invalid key - child is not an object"),delete(I=Object.assign({},I))[k]),I}function f(I,k,K){return typeof k=="number"?(o(I!=null,"Container is missing for key"),o(Array.isArray(I),"Cannot use numerical key for object container"),o(I.length>=k,"Cannot insert into out of bounds index"),I.splice(k,0,K)):(o(l(I),"Cannot insert into missing item"),o(I[k]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),I[k]=K),K}e.removeOp=(I,k=!0)=>s.writeCursor().writeAtPath(I,"r",k).get(),e.moveOp=(I,k)=>s.writeCursor().writeMove(I,k).get(),e.insertOp=(I,k)=>s.writeCursor().writeAtPath(I,"i",k).get(),e.replaceOp=(I,k,K)=>s.writeCursor().at(I,X=>{X.write("r",k),X.write("i",K)}).get(),e.editOp=(I,k,K,X=!1)=>s.writeCursor().at(I,z=>A(z,k,K,X)).get();const E=(I,k)=>I!=null&&(typeof k=="number"?Array.isArray(I):typeof I=="object"),v=(I,k)=>E(I,k)?I[k]:void 0,y={};function T(I){let k=I.type?I.type:I;k.name&&(y[k.name]=k),k.uri&&(y[k.uri]=k)}const V=I=>{const k=y[I];if(k)return k;throw Error("Missing type: "+I)};T(D_());const Y=(I,k)=>I+k;T({name:"number",apply:Y,compose:Y,invert:I=>-I,transform:I=>I});const ie=I=>I==null?null:I.et?V(I.et):I.es?y["text-unicode"]:I.ena!=null?y.number:null,N=I=>I.es?I.es:I.ena!=null?I.ena:I.e,A=(I,k,K,X=!1)=>{const[z,W]=typeof k=="string"?[V(k),k]:[k,k.name];!X&&z.isNoop&&z.isNoop(K)||(W==="number"?I.write("ena",K):W==="text-unicode"?I.write("es",K):(I.write("et",W),I.write("e",K)))};function B(I){o(typeof I=="number"),o(I>=0),o(I===(0|I))}function J(I){typeof I=="number"?B(I):o(typeof I=="string")}function de(I){if(I===null)return;const k=new Set,K=new Set,X=W=>{let ue=!0,oe=!1;for(let j in W){const te=W[j];if(ue=!1,o(j==="p"||j==="r"||j==="d"||j==="i"||j==="e"||j==="es"||j==="ena"||j==="et","Invalid component item '"+j+"'"),j==="p")B(te),o(!k.has(te)),k.add(te),o(W.r===void 0);else if(j==="d")B(te),o(!K.has(te)),K.add(te),o(W.i===void 0);else if(j==="e"||j==="es"||j==="ena"){o(!oe),oe=!0;const se=ie(W);o(se,"Missing type in edit"),se.checkValidOp&&se.checkValidOp(N(W))}}o(!ue)},z=(W,ue,oe)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");ue||J(W[0]);let j=1,te=0,se=0;for(let ge=0;ge<W.length;ge++){const ye=W[ge];if(o(ye!=null),Array.isArray(ye)){const Me=z(ye,!1);if(te){const Q=typeof se,Ce=typeof Me;Q===Ce?o(se<Me,"descent keys are not in order"):o(Q==="number"&&Ce==="string")}se=Me,te++,j=3}else typeof ye=="object"?(o(j===1,`Prev not scalar - instead ${j}`),X(ye),j=2):(o(j!==3),J(ye),o(s.isValidPathItem(ye),"Invalid path key"),j=1)}return o(te!==1,"Operation makes multiple descents. Remove some []"),o(j===2||j===3),W[0]};z(I,!0),o(k.size===K.size,"Mismatched picks and drops in op");for(let W=0;W<k.size;W++)o(k.has(W)),o(K.has(W))}function le(I){let k=0,K=[];const X=s.writeCursor();return X.mergeTree(I,(z,W)=>{const ue=ie(z);if(ue){const j=N(z);A(W,ue,ue.normalize?ue.normalize(j):j)}for(const j of["r","p","i","d"])if(z[j]!==void 0){const te=j==="p"||j==="d"?(oe=z[j],K[oe]==null&&(K[oe]=k++),K[oe]):z[j];W.write(j,te)}var oe}),X.get()}function p(I,k){if(de(k),k===null)return I;const K=[];return function X(z,W){let ue=z,oe=0,j={root:z},te=0,se=j,ge="root";function ye(){for(;te<oe;te++){let Me=W[te];typeof Me!="object"&&(o(E(se,ge)),se=se[ge]=c(se[ge]),ge=Me)}}for(;oe<W.length;oe++){const Me=W[oe];if(Array.isArray(Me)){const Q=X(ue,Me);Q!==ue&&Q!==void 0&&(ye(),ue=se[ge]=Q)}else if(typeof Me=="object"){Me.d!=null?(ye(),ue=f(se,ge,K[Me.d])):Me.i!==void 0&&(ye(),ue=f(se,ge,Me.i));const Q=ie(Me);if(Q)ye(),ue=se[ge]=Q.apply(ue,N(Me));else if(Me.e!==void 0)throw Error("Subtype "+Me.et+" undefined")}else ue=v(ue,Me)}return j.root}(I=function X(z,W){const ue=[];let oe=0;for(;oe<W.length;oe++){const ge=W[oe];if(Array.isArray(ge))break;typeof ge!="object"&&(ue.push(z),z=v(z,ge))}for(let ge=W.length-1;ge>=oe;ge--)z=X(z,W[ge]);for(--oe;oe>=0;oe--){const ge=W[oe];if(typeof ge!="object"){const ye=ue.pop();z=z===v(ye,ge)?ye:z===void 0?d(ye,ge):(te=ge,se=z,(j=c(j=ye))[te]=se,j)}else h(ge)&&(o(z!==void 0,"Cannot pick up or remove undefined"),ge.p!=null&&(K[ge.p]=z),z=void 0)}var j,te,se;return z}(I,k),k)}function H(I,k){I=I.slice(),de(k);const K=s.readCursor(k);let X,z,W=!1;const ue=[];for(let j=0;;j++){const te=I[j],se=K.getComponent();if(se&&(se.r!==void 0?W=!0:se.p!=null&&(W=!1,X=se.p,z=j)),j>=I.length)break;let ge=0;const ye=s.advancer(K,void 0,(Q,Ce)=>{h(Ce)&&ge++});ue.unshift(ye);const Me=ye(te);if(typeof te=="number"&&(I[j]-=ge),!Me)break}if(ue.forEach(j=>j.end()),W)return null;const oe=()=>{let j=0;if(X!=null){const te=K.getPath();j=te.length,I=te.concat(I.slice(z))}for(;j<I.length;j++){const te=I[j],se=a(K),ge=ie(se);if(ge){const Q=N(se);ge.transformPosition&&(I[j]=ge.transformPosition(I[j],Q));break}let ye=0;const Me=s.advancer(K,(Q,Ce)=>u(Ce)?~(Q-ye):Q-ye,(Q,Ce)=>{u(Ce)&&ye++})(te);if(typeof te=="number"&&(I[j]+=ye),!Me)break}};return X!=null?K.eachDrop(null,j=>{j===X&&oe()}):oe(),I}function S(I,k){if(de(I),de(k),I==null)return k;if(k==null)return I;let K=0;const X=s.readCursor(I),z=s.readCursor(k),W=s.writeCursor(),ue=[],oe=[],j=[],te=[],se=[],ge=[],ye=new Set;X.traverse(null,Q=>{Q.p!=null&&(j[Q.p]=X.clone())}),z.traverse(null,Q=>{Q.d!=null&&(te[Q.d]=z.clone())});const Me=s.writeCursor();return function Q(Ce,We,He,Le,Xe,Et,Ye,Ze){o(We||He);const ze=a(We),ut=a(He),it=!!ut&&ut.r!==void 0,Pt=!!ze&&ze.i!==void 0,ke=ze?ze.d:null,ct=ut?ut.p:null,_=(Et||it)&&ct==null;if(ct!=null)Le=te[ct],Ye=oe[ct]=new s.WriteCursor;else if(ut&&ut.r!==void 0)Le=null;else{const x=a(Le);x&&x.d!=null&&(Le=null)}const g=a(Le);if(ke!=null)if(Ce=j[ke],Ze=ue[ke]=new s.WriteCursor,_)Et&&!it&&Ze.write("r",!0);else{const x=se[ke]=K++;Ye.write("d",x)}else if(ze&&ze.i!==void 0)Ce=null;else{const x=a(Ce);x&&x.p!=null&&(Ce=null)}let m;Pt?(o(Xe===void 0),m=ze.i):m=Xe;const b=(ct==null?!Pt||Et||it:m===void 0)?null:Ye.getComponent();if(ct!=null){if(!(Xe!==void 0||Pt)){const x=ke!=null?se[ke]:K++;ge[ct]=x,Ze.write("p",x)}}else it&&(Pt||Xe!==void 0||(ut.r,Ze.write("r",ut.r)));const M=_?null:ie(ze),U=ie(g);if((M||U)&&(M&&M.name,U&&U.name),M&&U){o(M===U);const x=N(ze),ee=N(g),ve=M.compose(x,ee);A(Ye,M,ve),ye.add(g)}else M?A(Ye,M,N(ze)):U&&(A(Ye,U,N(g)),ye.add(g));const L=typeof m=="object"&&m!=null;let P=!1,C=0,Z=0,_e=0,q=0,me=0;const Se=s.advancer(Le,(x,ee)=>u(ee)?q-x-1:x-q,(x,ee)=>{u(ee)&&q++}),ce=s.advancer(Ce,(x,ee)=>h(ee)?C-x-1:x-C,(x,ee)=>{h(ee)&&C++});if(s.eachChildOf(We,He,(x,ee,ve)=>{let be,Ue,Fe=x,Be=x,ht=x;if(typeof x=="number"){let Ne=x+_e;Ue=Se(Ne),Be=Ne+q;let ne=x+Z;be=ce(ne),u(a(Ue))&&(be=null),Fe=ne+C,ht=x+me,o(Fe>=0,"p1PickKey is negative"),o(Be>=0,"p2DropKey is negative");const at=u(a(ee)),je=h(a(ve));(at||je&&!_)&&me--,at&&Z--,je&&_e--}else be=ce(x),Ue=Se(x);Ze.descend(Fe),Ye.descend(Be);const ft=L&&!u(a(ee))?m[ht]:void 0,Ee=Q(be,ee,ve,Ue,ft,_,Ye,Ze);var Je,Ie,Re;L&&!_?ft!==Ee&&(P||(m=Array.isArray(m)?m.slice():Object.assign({},m),P=!0),Je=m,Re=Ee,typeof(Ie=ht)=="number"?(o(Array.isArray(Je)),o(Ie<Je.length)):(o(!Array.isArray(Je)),o(Je[Ie]!==void 0)),Re===void 0?typeof Ie=="number"?Je.splice(Ie,1):delete Je[Ie]:Je[Ie]=Re):o(Ee===void 0),Ye.ascend(),Ze.ascend()}),ce.end(),Se.end(),b!=null)b.i=m;else if(!Et&&!it&&ct==null)return m}(X,X.clone(),z,z.clone(),void 0,!1,W,Me),W.reset(),W.mergeTree(Me.get()),W.reset(),W.get(),ue.map(Q=>Q.get()),oe.map(Q=>Q.get()),X.traverse(W,(Q,Ce)=>{const We=Q.p;if(We!=null){const He=se[We];He!=null&&Ce.write("p",He);const Le=ue[We];Le&&Le.get(),Le&&Ce.mergeTree(Le.get())}else Q.r!==void 0&&Ce.write("r",Q.r)}),W.reset(),W.get(),z.traverse(W,(Q,Ce)=>{const We=Q.d;if(We!=null){const Le=ge[We];Le!=null&&Ce.write("d",Le);const Xe=oe[We];Xe&&Ce.mergeTree(Xe.get())}else Q.i!==void 0&&Ce.write("i",Q.i);const He=ie(Q);He&&!ye.has(Q)&&A(Ce,He,N(Q))}),W.get()}function D(I){if(I==null)return null;const k=new s.ReadCursor(I),K=new s.WriteCursor;let X;const z=[],W=[];return function ue(oe,j,te){const se=oe.getComponent();let ge,ye=!1;if(se){se.p!=null&&(j.write("d",se.p),z[se.p]=oe.clone()),se.r!==void 0&&j.write("i",se.r),se.d!=null&&(j.write("p",se.d),te=void 0),se.i!==void 0&&(te=ge=se.i);const Q=ie(se);Q&&(te===void 0?(X||(X=new Set),X.add(se)):(N(se),te=Q.apply(te,N(se)),ye=!0))}let Me=0;for(const Q of oe){j.descend(Q);const Ce=typeof Q=="number"?Q-Me:Q,We=v(te,Ce);u(oe.getComponent())&&Me++;const He=ue(oe,j,We);if(te!==void 0&&He!==void 0){if(ye||(ye=!0,te=c(te)),!E(te,Ce))throw Error("Cannot modify child - invalid operation");te[Ce]=He}j.ascend()}if(ge===void 0)return ye?te:void 0;j.write("r",te)}(k,K,void 0),X&&(K.reset(),function ue(oe,j,te){const se=j.getComponent();if(se){const Q=se.d;if(Q!=null&&(oe=z[Q],te=W[Q]=s.writeCursor()),X.has(se)){const Ce=ie(se);if(!Ce.invert)throw Error(`Cannot invert subtype ${Ce.name}`);A(te,Ce,Ce.invert(N(se)))}}let ge=0,ye=0;const Me=s.advancer(oe,(Q,Ce)=>h(Ce)?ge-Q-1:Q-ge,(Q,Ce)=>{h(Ce)&&ge++});for(const Q of j)if(typeof Q=="number"){const Ce=Q-ye,We=Me(Ce),He=Ce+ge;te.descend(He),ue(We,j,te),u(j.getComponent())&&ye++,te.ascend()}else te.descend(Q),ue(Me(Q),j,te),te.ascend();Me.end()}(k.clone(),k,K),W.length&&(K.reset(),k.traverse(K,(ue,oe)=>{const j=ue.p;if(j!=null){const te=W[j];te&&te.get(),te&&oe.mergeTree(te.get())}}))),K.get()}const w=(I,k)=>I.some(K=>typeof K=="object"&&(Array.isArray(K)?w(K,k):k(K)));function O(I,k){if(I==null||!w(I,j=>{var te;return j.r!==void 0||((te=ie(j))===null||te===void 0?void 0:te.makeInvertible)!=null}))return I;const K=new s.ReadCursor(I),X=new s.WriteCursor;let z=!1;const W=[],ue=[],oe=(j,te,se)=>{const ge=j.getComponent();let ye=!1;if(ge){ge.d!=null&&te.write("d",ge.d),ge.i!==void 0&&te.write("i",ge.i);const Q=ge.p;if(Q!=null&&(W[Q]=j.clone(),o(se!==void 0,"Operation picks up at an invalid key"),ue[Q]=se,te.write("p",ge.p)),ge.r!==void 0&&se===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Ce=ie(ge);Ce&&(Ce.makeInvertible?z=!0:A(te,Ce,N(ge),!0))}let Me=0;for(const Q of j){te.descend(Q);const Ce=typeof Q=="number"?Q-Me:Q,We=v(se,Ce),He=oe(j,te,We);We!==He&&(ye||(ye=!0,se=c(se)),He===void 0?(se=d(se,Ce),typeof Q=="number"&&Me++):se[Ce]=He),te.ascend()}return ge&&(ge.r!==void 0?(te.write("r",r.default(se)),se=void 0):ge.p!=null&&(se=void 0)),se};return oe(K,X,k),X.get(),z&&(X.reset(),function j(te,se,ge,ye,Me){const Q=se.getComponent();if(Q){Q.i!==void 0?(ye=Q.i,Me=!0):Q.d!=null&&(ye=ue[Q.d],te=W[Q.d],Me=!1,Q.d);let Le=ie(Q);if(Le&&Le.makeInvertible){const Xe=N(Q);A(ge,Le,Le.makeInvertible(Xe,ye),!0)}}let Ce=0,We=0;const He=s.advancer(te,(Le,Xe)=>h(Xe)?Ce-Le-1:Le-Ce,(Le,Xe)=>{h(Xe)&&Ce++});for(const Le of se)if(typeof Le=="number"){const Xe=Le-We,Et=He(Xe),Ye=Xe+Ce,Ze=v(ye,Me?Xe:Ye);ge.descend(Le),j(Et,se,ge,Ze,Me),u(se.getComponent())&&We++,ge.ascend()}else{const Xe=v(ye,Le);ge.descend(Le),j(He(Le),se,ge,Xe,Me),ge.ascend()}He.end()}(K.clone(),K,X,k,!1)),X.get()}function F(I,k){return D(O(I,k))}const $=I=>{if(I==null)return null;const k=I.slice();for(let K=0;K<I.length;K++){const X=k[K];Array.isArray(X)&&(k[K]=$(X))}return k};function G(I,k,K){o(K==="left"||K==="right","Direction must be left or right");const X=K==="left"?0:1;if(k==null)return{ok:!0,result:I};de(I),de(k);let z=null;const W=[],ue=[],oe=[],j=[],te=[],se=[],ge=[],ye=[],Me=[],Q=[],Ce=[],We=[],He=[],Le=[],Xe=[];let Et=0;const Ye=s.readCursor(I),Ze=s.readCursor(k),ze=s.writeCursor();if(function g(m,b=null,M){const U=a(b);U&&(U.r!==void 0?M=b.clone():U.p!=null&&(M=null,se[U.p]=m.clone()));const L=m.getComponent();let P;L&&(P=L.p)!=null&&(te[P]=b?b.clone():null,oe[P]=m.clone(),M&&(Q[P]=!0,Me[P]=M),U&&U.p!=null&&(Le[P]=U.p));const C=s.advancer(b);for(const Z of m)g(m,C(Z),M);C.end()}(Ze,Ye,null),function g(m,b,M,U,L){const P=M.getComponent();let C,Z=!1;P&&((C=P.d)!=null?(j[C]=M.clone(),U!=null&&(Xe[U]==null&&(Xe[U]=[]),Xe[U].push(C)),m=te[C]||null,b=oe[C]||null,Q[C]?(L&&(Ce[C]=!0),L=Me[C]||null):!L||X!==1&&Le[C]!=null||z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.moveOp(b.getPath(),M.getPath())}),Z=!0):P.i!==void 0&&(m=b=null,Z=!0,L&&z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.insertOp(M.getPath(),P.i)})));const _e=a(m);_e&&(_e.r!==void 0?L=m.clone():_e.p!=null&&(_e.p,U=_e.p,L=null));const q=ie(P);q&&L&&z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.editOp(M.getPath(),q,N(P),!0)});let me=0,Se=0;const ce=s.advancer(b,(ee,ve)=>h(ve)?me-ee-1:ee-me,(ee,ve)=>{h(ve)&&me++}),x=s.advancer(m);for(const ee of M)if(typeof ee=="number"){const ve=ee-Se,be=ce(ve);Se+=+g(x(ve+me),be,M,U,L)}else{const ve=ce(ee);g(x(ee),ve,M,U,L)}return ce.end(),x.end(),Z}(Ye,Ze,Ze.clone(),null,null),j.map(g=>g&&g.get()),z)return{ok:!1,conflict:z};Ce.map(g=>!!g);const ut=[];let it=null;(function g(m,b,M,U,L){let P=!1;const C=a(b);if(h(C)){const ce=C.p;ce!=null?(M=j[ce],U=We[ce]=s.writeCursor(),P=!0,L=null):(M=null,L=b.clone())}else u(a(M))&&(M=null);const Z=m.getComponent();if(Z){const ce=Z.p;ce!=null?(L&&(ye[ce]=L),ut[ce]=L||X===1&&P?null:U.getComponent(),W[ce]=m.clone(),M&&(ge[ce]=M.clone())):Z.r!==void 0&&(L||U.write("r",!0),(L||P)&&(it==null&&(it=new Set),it.add(Z)))}let _e=0,q=0;const me=s.advancer(b,void 0,(ce,x)=>{h(x)&&_e++}),Se=s.advancer(M,(ce,x)=>u(x)?~(ce-q):ce-q,(ce,x)=>{u(x)&&q++});if(m)for(const ce of m)if(typeof ce=="string"){const x=me(ce),ee=Se(ce);U.descend(ce),g(m,x,ee,U,L),U.ascend()}else{const x=me(ce),ee=ce-_e,ve=h(a(x))?null:Se(ee),be=ee+q;o(be>=0),U.descend(be),g(m,x,ve,U,L),U.ascend()}me.end(),Se.end()})(Ye,Ze,Ze.clone(),ze,null),ze.reset();let Pt=[];if(function g(m,b,M,U,L,P){o(b);const C=b.getComponent();let Z=a(U),_e=!1;const q=(Ie,Re,Ne)=>Ie?e.moveOp(Ie.getPath(),Re.getPath()):e.insertOp(Re.getPath(),Ne.i);if(u(C)){const Ie=C.d;Ie!=null&&(ue[Ie]=b.clone());const Re=Ie!=null?ut[Ie]:null;let Ne=!1;if(C.i!==void 0||Ie!=null&&Re){let ne;Z&&(Z.i!==void 0||(ne=Z.d)!=null&&!Q[ne])&&(Ne=ne!=null?Ie!=null&&Ie===Le[ne]:n.default(Z.i,C.i),Ne||ne!=null&&X!==1&&Le[ne]!=null||z==null&&(z={type:i.ConflictType.DROP_COLLISION,op1:q(Ie!=null?W[Ie]:null,b,C),op2:q(ne!=null?oe[ne]:null,U,Z)})),Ne||(P?z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:q(Ie!=null?W[Ie]:null,b,C),op2:e.removeOp(P.getPath())}):(Ie!=null?(Pt[Et]=Ie,L.write("d",Re.p=Et++)):L.write("i",r.default(C.i)),_e=!0))}else if(Ie!=null&&!Re){const ne=ye[Ie];ne&&(P=ne.clone())}Ie!=null?(m=W[Ie],M=se[Ie],U=ge[Ie]):C.i!==void 0&&(m=M=null,Ne||(U=null))}else h(a(m))&&(m=M=U=null);const me=a(m),Se=a(M);if(h(Se)){const Ie=Se.p;Se.r!==void 0&&(!me||me.r===void 0)||Q[Ie]?(U=null,P=M.clone()):Ie!=null&&(U=j[Ie],X!==1&&Le[Ie]!=null||((L=He[Ie])||(L=He[Ie]=s.writeCursor()),L.reset(),P=null))}else!u(C)&&u(Z)&&(U=null);Z=U!=null?U.getComponent():null;const ce=ie(C);if(ce){const Ie=N(C);if(P)z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(b.getPath(),ce,Ie,!0),op2:e.removeOp(P.getPath())});else{const Re=ie(Z);let Ne;if(Re){if(ce!==Re)throw Error("Transforming incompatible types");const ne=N(Z);Ne=ce.transform(Ie,ne,K)}else Ne=r.default(Ie);A(L,ce,Ne)}}let x=0,ee=0,ve=0,be=0,Ue=0,Fe=0,Be=m!=null&&m.descendFirst(),ht=Be;const ft=s.advancer(M,void 0,(Ie,Re)=>{h(Re)&&ve++});let Ee=U!=null&&U.descendFirst(),Je=Ee;for(const Ie of b)if(typeof Ie=="number"){let Re;const Ne=u(b.getComponent()),ne=Ie-ee;{let Wt;for(;Be&&typeof(Wt=m.getKey())=="number";){Wt+=x;const St=m.getComponent(),gn=h(St);if(Wt>ne||Wt===ne&&(!gn||X===0&&Ne))break;if(gn){x--;const en=St.p;Le.includes(en),St.d,a(He[St.d]),h(a(He[St.d])),(St.r===void 0||it&&it.has(St))&&(en==null||!ut[en]||X!==1&&Le.includes(en))||Ue--}Be=m.nextSibling()}Re=Be&&Wt===ne?m:null}const at=ne-x;let je=ft(at);const Tt=at-ve;let _r=null;{let Wt,St;for(;Ee&&typeof(Wt=U.getKey())=="number";){St=Wt-be;const gn=U.getComponent(),en=u(gn);if(St>Tt)break;if(St===Tt){if(!en){_r=U;break}{if(X===0&&Ne){_r=U;break}const tn=je&&h(je.getComponent());if(X===0&&tn)break}}if(en){const tn=gn.d;Le[tn],gn.i===void 0&&(Q[tn]||Le[tn]!=null&&X!==1)?(Q[tn]||Le[tn]!=null&&X===0)&&(be++,Fe--):be++}Ee=U.nextSibling()}}const $i=Tt+be+Ue+Fe;o($i>=0,"trying to descend to a negative index"),L.descend($i),Ne&&(Re=je=_r=null,ee++),g(Re,b,je,_r,L,P)&&Fe++,L.ascend()}else{let Re;for(;Be&&(Re=m.getKey(),typeof Re!="string"||!(Re>Ie||Re===Ie));)Be=m.nextSibling();const Ne=Be&&Re===Ie?m:null,ne=ft(Ie);let at;for(;Ee&&(at=U.getKey(),typeof at!="string"||!(at>Ie||at===Ie));)Ee=U.nextSibling();const je=Ee&&at===Ie?U:null;L.descend(Ie),g(Ne,b,ne,je,L,P),L.ascend()}return ft.end(),ht&&m.ascend(),Je&&U.ascend(),_e}(Ye,Ye.clone(),Ze,Ze.clone(),ze,null),z)return{ok:!1,conflict:z};ze.reset();const ke=(g,m,b)=>g.traverse(m,(M,U)=>{M.d!=null&&b(M.d,g,U)});(Q.length||We.length)&&(ke(Ze,ze,(g,m,b)=>{Q[g]&&!Ce[g]&&b.write("r",!0),We[g]&&b.mergeTree(We[g].get())}),ze.reset());const ct=[],_=[];if((He.length||Q.length)&&!z){const g=s.readCursor($(ze.get()));if(ke(g,null,(m,b)=>{ct[m]=b.clone()}),He.forEach(m=>{m&&ke(s.readCursor(m.get()),null,(b,M)=>{ct[b]=M.clone()})}),function m(b,M,U,L,P,C){const Z=a(M);if(Z&&h(Z))if(Z.p!=null){const x=Z.p;ct[x].getPath(),U=ct[x],L=_[x]=s.writeCursor()}else Z.r!==void 0&&(U=null);else u(a(U))&&(U=null);const _e=b.getComponent();if(_e){let x;if((x=_e.d)!=null){const ee=He[x];ee&&(ee.get(),L.mergeTree(ee.get()),U=s.readCursor(ee.get()))}}let q=0,me=0;const Se=s.advancer(M,void 0,(x,ee)=>{h(ee)&&q--}),ce=s.advancer(U,(x,ee)=>u(ee)?-(x-me)-1:x-me,(x,ee)=>{u(ee)&&me++});for(const x of b)if(typeof x=="number"){const ee=Se(x),ve=x+q,be=ce(ve),Ue=ve+me;L.descend(Ue),m(b,ee,be,L),L.ascend()}else L.descend(x),m(b,Se(x),ce(x),L),L.ascend();Se.end(),ce.end()}(Ze,g,g.clone(),ze),ze.reset(),z)return{ok:!1,conflict:z};if(ze.get(),_.length){const m=_.map(M=>M?M.get():null),b=s.readCursor($(ze.get()));if(ke(b,ze,(M,U,L)=>{const P=m[M];P&&(L.mergeTree(P),m[M]=null)}),m.find(M=>M)){const M=s.writeCursor(),U=s.writeCursor();let L=0,P=0;m.forEach(C=>{C!=null&&ke(s.readCursor(C),null,Z=>{const _e=Pt[Z];M.writeMove(W[_e].getPath(),ue[_e].getPath(),L++);const q=Xe[_e];q&&q.forEach(me=>{Q[me]||X!==1&&Le[me]!=null||U.writeMove(oe[me].getPath(),j[me].getPath(),P++)})})}),z={type:i.ConflictType.BLACKHOLE,op1:M.get(),op2:U.get()}}}}return z?{ok:!1,conflict:z}:{ok:!0,result:ze.get()}}const re=I=>{const k=new Error("Transform detected write conflict");throw k.conflict=I,k.type=k.name="writeConflict",k};function he(I,k,K){const X=G(I,k,K);if(X.ok)return X.result;re(X.conflict)}const fe=I=>{const k=s.writeCursor();return s.readCursor(I).traverse(k,(K,X)=>{(u(K)||ie(K))&&X.write("r",!0)}),k.get()},Ae=(I,k)=>{const{type:K,op1:X,op2:z}=I;switch(K){case i.ConflictType.DROP_COLLISION:return k==="left"?[null,fe(z)]:[fe(X),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(X).traverse(null,ue=>{ue.r!==void 0&&(W=!0)}),W?[null,fe(z)]:[fe(X),null];case i.ConflictType.BLACKHOLE:return[fe(X),fe(z)];default:throw Error("Unrecognised conflict: "+K)}};function we(I,k,K,X){let z=null;for(;;){const W=G(k,K,X);if(W.ok)return S(z,W.result);{const{conflict:ue}=W;I(ue)||re(ue);const[oe,j]=Ae(ue,X);k=S(le(k),oe),K=S(le(K),j),z=S(z,j)}}}}(Ln)),Ln}var zo;function L_(){return zo||(zo=1,function(e){var t=rn&&rn.__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=rn&&rn.__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(x_(),e);var r=Iu();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}})}(rn)),rn}var gt=L_();const U_=It(gt),P_=Fc({__proto__:null,default:U_},[gt]);var pe=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(pe||{});function mr(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&&ae.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();Fl(r,a)&&ae.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Ou(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:d,ed:f}=u;if(f<=r)i.push(u);else if(r>d&&r<f){a=!0;const E={...u,ed:r};i.push(E),l.length&&i.push(...l);const v={...u,st:r+n,ed:f+n};i.push(v)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=mr(i)}function yu(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(fr("startIndex"))}}function wu(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(fr("startIndex"))}}function bu(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(fr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function Au(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(fr("startIndex"))}}const Tu="$",Vo=e=>e.split(Tu)[0];function Ti(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=Vo(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Vo(i.rangeId),i.rangeId===n.rangeId&&Qa(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}${Tu}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function Xs(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 Nu(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 Qs(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 F_(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;Xs(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=Ti(s)}function k_(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;Qs(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=Nu(s)}function Mu(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:d}=h;if(s<=u&&i>=d){o.push({...h,st:u-s,ed:d-s});continue}else u<=s&&d>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=u&&s<d?(o.push({...h,st:s-s,ed:d-s}),h.ed=s):i>u&&i<=d?(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 Du(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 xu(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 Lu(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 Uu(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:d}=h;if(s<=u&&i>=d){o.push({...h,startIndex:u-n,endIndex:d-n});continue}else if(u<=s&&d>=i){const f=ls(u,d,s,i);if(f.length===0||(h.startIndex=f[0],h.endIndex=f[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.tables=a}return o}function $_(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:d}=h;if(u>=s&&d<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,d)){const f=ls(u,d,s,i);if(f.length===0)continue;h.startIndex=f[0],h.endIndex=f[1]}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=Ti(a)}return o}function j_(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:d,endIndex:f}=u;if(d>=i&&f<=o){a.push(u);continue}else if(Math.max(i,d)<=Math.min(o,f)){const E=ls(d,f,i,o);if(E.length===0)continue;u.startIndex=E[0],u.endIndex=E[1]}else o<d&&r&&(u.startIndex-=t,u.endIndex-=t);l.push(u)}e.customDecorations=l}return a}var Pu=(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))(Pu||{}),Lt=(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))(Lt||{});const yr={"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}},mn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:gr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),pn=e=>e.map((t,n)=>({...t,bulletAlignment:gr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Go=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:gr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),pr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:mn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:mn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:mn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:mn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:mn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:mn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:pn([{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:pn([{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:pn(["%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:pn([{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:pn([{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:pn([{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:Go("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Go("☑",{st:{s:xe.TRUE}})}},wr=e=>{const{glyphFormat:t,glyphType:n}=e,r=ae.deepClone(pr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},H_={ORDER_LIST_QUICK_2:wr(yr["a)"]),ORDER_LIST_QUICK_3:wr(yr["a."]),ORDER_LIST_QUICK_4:wr(yr["i."]),ORDER_LIST_QUICK_6:wr(yr["I."])};Object.assign(pr,H_);const B_={"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 W_(e,t,n,r,s){const i=Y_(e,t,n,r,s),o=z_(e,t,n,r,s),a=V_(e,t,n,r,s),l=G_(e,t,n,r,s),c=K_(e,t,n,r,s),h=X_(e,t,n,r),u=Q_(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function Y_(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=Mu(e,n,r);if(s!==Pe.REPLACE){const l=Fu(o,a,s);t.textRuns=l}return Ou(e,t,n,r),a}function Fu(e,t,n){if(t.length===0)return e;e=ae.deepClone(e),t=ae.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:f,ed:E,ts:v}=e[o],{st:y,ed:T,ts:V,sId:Y}=t[a];let ie;if(n===Pe.COVER?ie={...V,...v}:ie={...v},E<y)c()||r.push(e[o]),o++;else if(T<f)c()||r.push(t[a]),a++;else{const N={st:Math.min(f,y),ed:Math.max(f,y),ts:f<y?{...v}:{...V},sId:f<y?void 0:Y};N.ed>N.st&&r.push(N),r.push({st:Math.max(f,y),ed:Math.min(E,T),ts:ie,sId:Y}),E<T?(o++,t[a].st=E,t[a].st===t[a].ed&&a++):(a++,e[o].st=T,e[o].st===e[o].ed&&o++);const A={st:Math.min(E,T),ed:Math.max(E,T),ts:E<T?{...V}:{...v},sId:E<T?Y:void 0};l=A.ed>A.st?A:null}}c();const h=r[r.length-1],u=e[s-1],d=t[i-1];return h&&h.ed!==Math.max(u.ed,d.ed)&&(u.ed>d.ed?r.push(u):r.push(d)),mr(r)}function z_(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs: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,paragraphStyle:u,bullet:d}=c;let f=[];for(const E of a){const{startIndex:v,paragraphStyle:y,bullet:T}=E;let V,Y;if(s===Pe.COVER?(V={...y,...u},Y={listId:"",listType:Lt.BULLET_LIST,nestingLevel:0,textStyle:{},...T,...d}):(V={...u,...y},Y={listId:"",listType:Lt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...T}),h===v){f.push({startIndex:h,paragraphStyle:V,bullet:Y});break}}l.push(...f),f=[]}t.paragraphs=l}return yu(e,t,n,r),a}function V_(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=xu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}t.sectionBreaks=l}return wu(e,t,n,r),a}function G_(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks: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}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}t.customBlocks=l}return bu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function K_(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Uu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let d=[];for(const f of a){const{startIndex:E,endIndex:v}=f;if(E>=h&&v<=u){s===Pe.COVER?d.push({...f,...c}):d.push({...c,...f});break}}l.push(...d),d=[]}t.tables=l}return Au(e,t,n,r),a}function X_(e,t,n,r,s){e.customRanges||(e.customRanges=[]),Xs(e.customRanges,r),Xs(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:d,endIndex:f}=u;d>=i&&f<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:d,endIndex:f}=u;l.push({...u,startIndex:d+r,endIndex:f+r})}),e.customRanges=Ti(l),h):[]}function Q_(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),Qs(e.customDecorations,r),Qs(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===an.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=Nu(o),i}var Ni=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Ni||{});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 T=[];for(const V of o){const Y=ae.deepClone(V),{st:ie,ed:N}=Y;ae.hasIntersectionBetweenTwoRanges(ie,N,t,n)&&(t>=ie&&t<=N?T.push({...Y,st:t,ed:Math.min(n,N)}):n>=ie&&n<=N?T.push({...Y,st:Math.max(t,ie),ed:n}):T.push(Y))}u.textRuns=mr(T.map(V=>{const{st:Y,ed:ie}=V;return{...V,st:Y-t,ed:ie-t}}))}else r&&(u.textRuns=[{st:0,ed:n-t,ts:{}}]);const d=[];for(const T of c){const V=ae.deepClone(T),{startIndex:Y,endIndex:ie}=V;Y>=t&&ie<=n&&d.push({...V,startIndex:Y-t,endIndex:ie-t})}d.length&&(u.tables=d);const f=[];for(const T of a){const{startIndex:V}=T;V>=t&&V<n&&f.push(ae.deepClone(T))}f.length&&(u.paragraphs=f.map(T=>({...T,startIndex:T.startIndex-t})));const E=[];for(const T of h){const{startIndex:V}=T;V>=t&&V<=n&&E.push(ae.deepClone(T))}if(E.length&&(u.sectionBreaks=E.map(T=>({...T,startIndex:T.startIndex-t}))),s===1){const T=$u(e,t,n);T?u.customDecorations=T:r&&(u.customDecorations=[])}const{customRanges:v}=ku(e,t,n);v?u.customRanges=v:r&&(u.customRanges=[]);const y=[];for(const T of l){const{startIndex:V}=T;V>=t&&V<=n&&y.push(ae.deepClone(T))}return y.length&&(u.customBlocks=y.map(T=>({...T,startIndex:T.startIndex-t}))),u}function q_(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(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=ae.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function J_(e,t,n){return e==null||t==null?e!=null?e:t:Fu(e,t,n)}function Z_(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 e0(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 qs(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=J_(l,s,n),r.customRanges=Z_(h,o,n);const d=e0(u,a,n);d.length&&(r.customDecorations=d);const f=[];let E=0,v=0;for(;E<i.length&&v<c.length;){const y=i[E],T=c[v],{startIndex:V}=y,{startIndex:Y}=T;V===Y?(f.push(ae.deepMerge(y,T)),E++,v++):V<Y?(f.push(ae.deepClone(y)),E++):(f.push(ae.deepClone(T)),v++)}return E<i.length&&f.push(...i.slice(E)),v<c.length&&f.push(...c.slice(v)),f.length&&(r.paragraphs=f),r}function t0(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 En{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===pe.DELETE||n.t===pe.RETAIN&&n.body==null?ae.deepClone({...n,len:t}):ae.deepClone({...n,len:t,body:qt(n.body,r,r+t,!1)})}else return{t:pe.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:pe.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 ju(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=Mu(e,t,n),a=Du(e,t,n),l=xu(e,t,n),c=Lu(e,t,n),h=Uu(e,t,n),u=$_(e,t,n),d=j_(e,t,n);let f="";return r&&(e.dataStream=jl(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:d}}function Hu(e,t,n,r){e.dataStream=$l(e.dataStream,r,t.dataStream),Ou(e,t,n,r),yu(e,t,n,r),wu(e,t,n,r),bu(e,t,n,r),Au(e,t,n,r),F_(e,t,n,r),k_(e,t,n,r)}function n0(e,t,n,r,s=Pe.COVER){return W_(e,t,n,r,s)}function r0(e,t,n){return t<=0?{dataStream:""}:ju(e,t,n)}function s0(e,t,n,r){n!==0&&Hu(e,t,n,r)}function i0(e,t){const n=new Mn;return n.reset(),t.forEach(r=>{const s=ae.deepClone(r);switch(s.t){case pe.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&n0(e,o,a,n.cursor,i),n.moveCursor(a);break}case pe.INSERT:{const{body:i,len:o}=s;s0(e,i,o,n.cursor),n.moveCursor(o);break}case pe.DELETE:{const{len:i}=s;r0(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function o0(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=ae.deepClone(t),e=ae.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:v,ed:y,ts:T}=t[l],{st:V,ed:Y,ts:ie,sId:N}=e[c];let A={};if(s===0)A={...T},n===Pe.COVER&&r===Pe.REPLACE&&ie&&(A=Object.assign({},ie,A));else if(A={...T},n===Pe.REPLACE){if(r===Pe.REPLACE)A={...ie};else if(T&&ie){const B=Object.keys(T);for(const J of B)ie[J]&&delete A[J]}}else if(r===Pe.REPLACE){if(ie){const B=Object.keys(ie);for(const J of B)ie[J]!==void 0&&(A[J]=ie[J])}}else if(ie){const B=Object.keys(ie);for(const J of B)A[J]!==void 0&&delete A[J]}if(y<V)u()||i.push(t[l]),l++;else if(Y<v)u()||i.push(e[c]),c++;else{const B={st:Math.min(v,V),ed:Math.max(v,V),ts:v<V?{...T}:{...ie},sId:v<V?void 0:N};B.ed>B.st&&i.push(),i.push({st:Math.max(v,V),ed:Math.min(y,Y),ts:A,sId:N}),y<Y?(l++,e[c].st=y,e[c].st===e[c].ed&&c++):(c++,t[l].st=Y,t[l].st===t[l].ed&&l++);const J={st:Math.min(y,Y),ed:Math.max(y,Y),ts:y<Y?{...ie}:{...T},sId:y<Y?N:void 0};h=J.ed>J.st?J:null}}u();const d=i[i.length-1],f=t[o-1],E=e[a-1];return d.ed!==Math.max(f.ed,E.ed)&&(f.ed>E.ed?i.push(f):i.push(E)),mr(i,!0)}function a0(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?[ae.deepClone(i)]:[ae.deepClone(o)];if(r===Pe.REPLACE){const a=ae.deepClone(o);return s===1&&Object.assign(a,ae.deepClone(i)),[a]}else{const a=ae.deepClone(o);return s===1&&Object.assign(a,ae.deepClone(i)),[a]}}function Ko(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=ae.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?ae.deepClone(e.bullet):ae.deepClone(t.bullet):e.bullet===void 0?i.bullet=ae.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?ae.deepClone(t.bullet):ae.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=ae.deepClone(t.bullet)),i}function l0(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return ae.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===an.DELETED||i===an.DELETED)&&(o=!0,n.push({...r,type:an.DELETED}));break}o||n.push(r)}return n}function u0(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:d}=r,{textRuns:f,paragraphs:E=[],customRanges:v,customDecorations:y}=i,T=o0(c,f,s,o,n?1:0);T&&(a.textRuns=T);const V=a0(u,v,s,o,n?1:0);V&&(a.customRanges=V);const Y=l0(d,y);Y&&(a.customDecorations=Y);const ie=[];let N=0,A=0;for(;N<h.length&&A<E.length;){const B=h[N],J=E[A],{startIndex:de}=B,{startIndex:le}=J;if(de===le){let p={startIndex:de};n?p=Ko(B,J,s,o,1):p=Ko(B,J,s,o,0),ie.push(p),N++,A++}else de<le?N++:(ie.push(ae.deepClone(J)),A++)}return A<E.length&&ie.push(...E.slice(A)),ie.length&&(a.paragraphs=ie),{coverType:l,body:a}}function Xo(e){return Object.keys(e).length===1}const Sn=class Sn{constructor(){R(this,"_actions",[])}static apply(t,n){return i0(t,n)}static compose(t,n){const r=new En(t),s=new En(n),i=new Sn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===pe.INSERT)i.push(s.next());else if(r.peekType()===pe.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===pe.INSERT&&l.t===pe.RETAIN)l.body==null?i.push(a):i.push({...a,body:qs(a.body,l.body,l.coverType)});else if(a.t===pe.RETAIN&&l.t===pe.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:pe.RETAIN,coverType:c,body:qs(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===pe.RETAIN&&l.t===pe.DELETE?i.push(l):a.t===pe.INSERT&&(l.t,pe.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 En(t),i=new En(n),o=new Sn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===pe.INSERT&&(r==="left"||i.peekType()!==pe.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===pe.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===pe.DELETE)continue;if(c.t===pe.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=u0(l,c,r==="left");o.push({...c,t:pe.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new En(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===pe.DELETE){n-=Math.min(o,n-i);continue}else a===pe.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===pe.INSERT)n.push({t:pe.DELETE,len:r.len,body:r.body});else if(r.t===pe.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:pe.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:pe.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===pe.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===pe.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!==pe.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:pe.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:pe.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:pe.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=ae.deepClone(t[0]);if(s.t===pe.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===pe.DELETE&&s.t===pe.DELETE)return r.len+=s.len,this;if(r.t===pe.DELETE&&s.t===pe.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===pe.RETAIN&&s.t===pe.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===pe.INSERT&&Xo(r.body)&&s.t===pe.INSERT&&Xo(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===pe.RETAIN&&t0(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};R(Sn,"id","text-x"),R(Sn,"uri","https://github.com/dream-num/univer#text-x");let tt=Sn;Object.defineProperty(tt,"name",{value:"text-x"});const On=class On{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==tt.id||(this._subTypes.set(t.name,t),gt.type.registerSubtype(t))}static apply(t,n){if(!gt.type.isNoop(n))return gt.type.apply(t,n)}static compose(t,n){return gt.type.compose(t,n)}static transform(t,n,r){return gt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===tt.name?tt.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return gt.type.invertWithDoc(t,n)}static isNoop(t){return gt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new On),this._instance}removeOp(t,n){return gt.removeOp(t,n)}moveOp(t,n){return gt.moveOp(t,n)}insertOp(t,n){return gt.insertOp(t,n)}replaceOp(t,n,r){return gt.replaceOp(t,n,r)}editOp(t,n=["body"]){return gt.editOp(n,tt.name,t)}};R(On,"uri","https://github.com/dream-num/univer#json-x"),R(On,"_subTypes",new Map),R(On,"_instance",null);let $t=On;$t.registerSubtype(tt);const Mi={id:"default_doc",documentStyle:{}};class c0 extends us{constructor(n){var r;super();R(this,"type",$e.UNIVER_DOC);R(this,"_name$",new Oe.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...Mi,...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{...pr,...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 c0{constructor(n){var s,i;super(ae.isEmptyObject(n)?A_():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:ae.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={...Mi,...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(!$t.isNoop(n))return this.snapshot=$t.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=Ni.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 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 h0="0.5.1";function d0(e="",t=dr.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:h0,locale:t,styles:{},sheets:{},resources:[]}}class Bu{constructor(t={}){R(this,"_styles");R(this,"_cacheMap",new er(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=ae.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&&ae.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(ae.diffValue(n[r],t))return r;return null}}function f0(e){const{ranges:t,id:n,type:r}=e,s=new tt;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:pe.RETAIN,len:l-i}),s.push({t:pe.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function g0(e){var h,u,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(u=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:d.find(f=>f.id===t);if(!i)return!1;const o=new tt,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:pe.RETAIN,len:a}),o.push({t:pe.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:an.DELETED}]}}),o}function Wu(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function m0(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):Wu(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function p0(e){return{...ae.deepClone(e),rangeId:cn()}}function _0(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 Yu(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 E0(e,t){var i,o,a,l,c;const n=Yu(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 v0(e,t){var d,f,E;const{rangeId:n,segmentId:r,documentDataModel:s,insert:i}=t,o=(f=(d=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:d.customRanges)==null?void 0:f.find(v=>v.rangeId===n);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new tt,h=l-a+1;c.push({t:pe.RETAIN,len:a}),c.push({t:pe.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:pe.INSERT,body:i,len:i.dataStream.length});const u=l+1+((E=i==null?void 0:i.dataStream.length)!=null?E:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function C0(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new tt;let c=!1;return t.forEach(h=>{var Y,ie,N;const u=E0(h,o);if(!u||!o)return!1;const{startOffset:d,endOffset:f}=u,E=(Y=o.customRanges)!=null?Y:[],v=(A,B,J)=>{var S,D,w,O;const de=Yu(A,B,E,r),le=Math.min((D=(S=de[0])==null?void 0:S.startIndex)!=null?D:1/0,A),p=Math.max((O=(w=de[de.length-1])==null?void 0:w.endIndex)!=null?O:-1/0,B),H={rangeId:J?`${n}$${J}`:n,rangeType:r,startIndex:0,endIndex:p-le,wholeEntity:s,properties:{...i}};l.push({t:pe.RETAIN,len:le-a}),l.push({t:pe.RETAIN,len:p-le+1,body:{dataStream:"",customRanges:[H]},coverType:Pe.COVER}),a=p+1},y=((ie=o.paragraphs)!=null?ie:[]).filter(A=>A.startIndex<f&&A.startIndex>d),T=((N=o.customBlocks)!=null?N:[]).filter(A=>A.startIndex<f&&A.startIndex>d);_0([d,f-1],[...y.map(A=>A.startIndex),...T.map(A=>A.startIndex)]).forEach(([A,B],J)=>v(A,B,J)),c=!0,l.selections=[{startOffset:u.endOffset,endOffset:u.endOffset,collapsed:!0}]}),c?l:!1}function zu(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:pe.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:pe.DELETE,len:u-l}),l=u)}),r&&i.push({t:pe.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:pe.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:pe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}const R0=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=Ta(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,f])=>{switch(d){case 0:{const E={t:pe.RETAIN,body:{...qt(n,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,E}case 1:{const E={t:pe.INSERT,body:qt(n,l,l+f.length),len:f.length};return l+=f.length,E}default:return{t:pe.DELETE,len:f.length}}}),h=new tt;return h.push({t:pe.RETAIN,len:t.startOffset}),h.push(...c),h};function I0(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 S0(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 O0=e=>{var v,y,T,V;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new tt,l=$t.getInstance(),c=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const u=(y=(v=n.getSnapshot().drawingsOrder)==null?void 0:v.length)!=null?y:0;let d=0;if(s)i>0&&a.push({t:pe.RETAIN,len:i});else{const Y=zu([t],h,0,null,!1);a.push(...Y);const ie=I0(h,[t]),N=(T=n.getDrawings())!=null?T:{},A=(V=n.getDrawingsOrder())!=null?V:[],B=ie.sort((J,de)=>A.indexOf(J)>A.indexOf(de)?-1:A.indexOf(J)<A.indexOf(de)?1:0);if(B.length>0)for(const J of B){const de=N[J],le=A.indexOf(J);if(de==null||le<0)continue;const p=l.removeOp(["drawings",J],de),H=l.removeOp(["drawingsOrder",le],J);c.push(p),c.push(H),d++}}a.push({t:pe.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((Y,ie)=>({startIndex:ie,blockId:Y.drawingId}))},len:r.length});const f=S0(n,o),E=l.editOp(a.serialize(),f);c.push(E);for(const Y of r){const{drawingId:ie}=Y,N=l.insertOp(["drawings",ie],Y),A=l.insertOp(["drawingsOrder",u-d],ie);c.push(N),c.push(A)}return c.reduce((Y,ie)=>$t.compose(Y,ie),null)},y0=e=>{var u,d,f;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs)!=null?d:[],o=t.every(E=>{var v;return((v=E.bullet)==null?void 0:v.listType.indexOf(s))===0});let l=ae.generateRandomId(6);if(t.length===1){const E=i.indexOf(t[0]),v=i[E-1],y=i[E+1];v&&v.bullet&&v.bullet.listType.indexOf(s)===0?(l=v.bullet.listId,s!==Lt.CHECK_LIST&&(s=v.bullet.listType)):y&&y.bullet&&y.bullet.listType.indexOf(s)===0&&(l=y.bullet.listId,s!==Lt.CHECK_LIST&&(s=y.bullet.listType))}const c=new Mn;c.reset();const h=new tt;for(const E of t){const{startIndex:v,paragraphStyle:y={},bullet:T}=E;h.push({t:pe.RETAIN,len:v-c.cursor}),h.push({t:pe.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:y,startIndex:0}:{startIndex:0,paragraphStyle:{...y},bullet:{nestingLevel:(f=T==null?void 0:T.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),c.moveCursorTo(v+1)}return h},w0=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(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Lt.CHECK_LIST)===-1)return!1;const o=new Mn;o.reset();const a=new tt,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===Lt.CHECK_LIST?Lt.CHECK_LIST_CHECKED:Lt.CHECK_LIST;return a.push({t:pe.RETAIN,len:l-o.cursor}),a.push({t:pe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},b0=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=ae.generateRandomId(6),l=new Mn;l.reset();const c=new tt;for(const d of t){const{startIndex:f,paragraphStyle:E={},bullet:v}=d;c.push({t:pe.RETAIN,len:f-l.cursor}),c.push({t:pe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:E,bullet:{nestingLevel:(u=v==null?void 0:v.nestingLevel)!=null?u:0,textStyle:(v==null?void 0:v.listType)===n?v.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(f+1)}return c};function A0(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const T0=e=>{var h,u,d;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Mn;i.reset();const o=new tt,a=(h=r.getSnapshot().lists)!=null?h:{},l=(d=(u=r.getBody())==null?void 0:u.tables)!=null?d:[],c={...pr,...a};for(const f of t){const{startIndex:E,paragraphStyle:v={},bullet:y}=f,T=A0(f,l);if(o.push({t:pe.RETAIN,len:E-i.cursor}),y){const V=y.listType;let Y=c[V].nestingLevel.length-1;T&&(Y=Math.min(Y,2)),o.push({t:pe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...v},bullet:{...y,nestingLevel:Math.max(Math.min(y.nestingLevel+s,Y),0)}}]},coverType:Pe.REPLACE})}else o.push({t:pe.RETAIN,len:1});i.moveCursorTo(E+1)}return o};var Vu=(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))(Vu||{}),zt=(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))(zt||{});function N0(e){return`${e}`}const M0=[zt.TABLE_START,zt.TABLE_ROW_START,zt.TABLE_CELL_START,zt.TABLE_CELL_END,zt.TABLE_ROW_END,zt.TABLE_END],Gu=e=>{const t=e.endsWith(`\r
10
+ `)?e.slice(0,-2):e;return M0.reduce((n,r)=>n.replaceAll(r,""),t)},D0=e=>e?Gu(e).replaceAll("\r","")==="":!0,x0=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(ae.isLegalUrl(h)){const u=cn(),d=`${h}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:u,rangeType:tr.HYPERLINK,properties:{url:e}};r.push(f),i+=d,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&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}};function L0(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 U0(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 P0(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class wt{}R(wt,"customRange",{add:C0,delete:v0,copyCustomRange:p0,getCustomRangesInterestsWithSelection:m0,isIntersecting:Wu}),R(wt,"customDecoration",{add:f0,delete:g0}),R(wt,"selection",{replace:R0,makeSelection:L0,normalizeSelection:U0,delete:zu}),R(wt,"range",{isIntersects:P0}),R(wt,"transform",{getPlainText:Gu,fromPlainText:x0,isEmptyDocument:D0}),R(wt,"paragraph",{bullet:{set:b0,switch:y0,toggleChecklist:w0,changeNestLevel:T0}}),R(wt,"drawing",{add:O0});const F0=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Jt.equals(r,n))),k0=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Jt.equals(n.range,s.range)}),Js={t:0,b:2,l:2,r:2},$0=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Qo=90;function jn(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Gt.UNSPECIFIED,verticalAlign:a=on.UNSPECIFIED,wrapStrategy:l=un.UNSPECIFIED,cellValueType:c}=n,{t:h,r:u,b:d,l:f}=i||Js,{vertexAngle:E,centerAngle:v}=Xu(s),y={id:"d",body:{dataStream:`${e}${Ma}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:h,marginBottom:d,marginRight:u,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:v,vertexAngle:E,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new jt(y)}function j0(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 qo(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 Ku(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===tr.HYPERLINK))return;const s=wt.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&&tt.apply(r,s.serialize())}const H0='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Jo(e){const t=lt.ff,n=lt.fs;if(!e){const u=`${n}pt ${t}`;return{fontCache:u,fontString:u,fontSize:n,originFontSize:n,fontFamily:t}}let r=Rn.ITALIC;(e.it===0||e.it===void 0)&&(r=Rn.NORMAL);let s=Rn.BOLD;(e.bl===0||e.bl===void 0)&&(s=Rn.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===kt.SUBSCRIPT||a===kt.SUPERSCRIPT){const u=B0(o,l),{sbr:d,spr:f}=u;l*=a===kt.SUBSCRIPT?d:f}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${H0} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function B0(e,t){return $0(t)}function Xu(e){const{a:t=0,v:n=xe.FALSE}=e||{a:0,v:xe.FALSE};let r=0,s=t;return n===xe.TRUE&&(r=Qo,s=Qo),{centerAngle:r,vertexAngle:s}}class W0{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!==xe.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 Qt(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:xe.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 Y0{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:xe.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===xe.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!==xe.TRUE:!0}getSize(){return Qt(this._rowData)}}const z0="DEFAULT_WORKSHEET_ROW_COUNT",Qu=1e3,V0="DEFAULT_WORKSHEET_COLUMN_COUNT",qu=20,G0="DEFAULT_WORKSHEET_ROW_HEIGHT",Ju=24,K0="DEFAULT_WORKSHEET_COLUMN_WIDTH",Zu=88,X0="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",ec=46,Q0="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",tc=20;function nc(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:xe.FALSE,rowCount:Qu,columnCount:qu,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Zu,defaultRowHeight:Ju,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:xe.TRUE,rowHeader:{width:ec,hidden:xe.FALSE},columnHeader:{height:tc,hidden:xe.FALSE},rightToLeft:xe.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class q0 extends nt{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 er(5e4));R(this,"_skeletonCache",new er(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||!ae.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!ae.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||[])Jt.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:d,startColumn:f,endColumn:E}=a[h];for(let v=n;v<=s;v++){let y=!1;for(let T=r;T<=i;T++)if(v>=u&&v<=d&&T>=f&&T<=E){o.push({startRow:u,endRow:d,startColumn:f,endColumn:E}),c.push(h),y=!0;break}if(y)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 rc extends nt{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,Cn.Value|Cn.Style):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,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 Zo={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class nr{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=nc(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:ae.generateRandomId(6),this._cellData=new xt(o),this._viewModel=new rc((l,c)=>this.getCellRaw(l,c)),this._rowManager=new Y0(this._snapshot,this._viewModel,i),this._columnManager=new W0(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 d=+u,f=t.getValue(c,d),E=f!=null&&f.s?this._styles.get(f.s):null,v=(E==null?void 0:E.bd)&&(E.bd.b||E.bd.l||E.bd.r||E.bd.t||E.bd.bc_tr||E.bd.bl_tr||E.bd.ml_tr||E.bd.tl_bc||E.bd.tl_br||E.bd.tl_mr);(f&&(f.v||f.p)||E!=null&&E.bg||v)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),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=ae.deepClone(t);return new nr(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:d,endColumn:f}=r;t===h&&n===d?(o=u,a=f,l=h,c=d,i=!0):t>=h&&t<=u&&n>=d&&n<=f&&(o=u,a=f,l=h,c=d,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=!1){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new xt;return Vs(t,r,n,s).forEach((c,h)=>{const u=i?this.getCellRaw(c,h):this.getCell(c,h);u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:d,endRow:f}=c;Vs(u,f,h,d).forEach((E,v)=>{E===u&&v===h&&l.setValue(E,v,{...o.getValue(E,v),rowSpan:f-u+1,colSpan:d-h+1}),(E!==u||v!==h)&&l.realDeleteValue(E,v)})}),l}getRange(t,n,r,s){return typeof t=="object"?new bn(this,t,{getStyles:()=>this._styles}):new bn(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}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}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,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(u&&n){c=d.endColumn+1;continue}const E={row:l,col:c,value:h};return E.colSpan=d.endColumn-d.startColumn+1,E.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:E}}if(u&&n)c+=1;else{const f={row:l,col:c,value:h};return c+=1,{done:!1,value:f}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let 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 E=c!==u.startRow,v=E||h!==u.startColumn;if(r&&v||!r&&E){c=u.endRow+1;continue}const y=l.getCell(u.startRow,u.startColumn);if(!y&&n){c=u.endRow+1;continue}const V={row:c,col:u.startColumn,value:y};return V.colSpan=u.endColumn-u.startColumn+1,V.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:V}}const d=l.getCell(c,h);if(!d&&n)c+=1;else{const E={row:c,col:h,value:d};return c+=1,{done:!1,value:E}}}}}}}}_getCellDocumentModel(t,n=Zo){var v;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Zo,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const c=j0(o),h=i?lt.tr:c.textRotation||lt.tr;let u=c.horizontalAlign||lt.ht;const d=c.verticalAlign||lt.vt,f=c.wrapStrategy||lt.tb,E=c.paddingData||Js;if(t.f&&s)a=jn(t.f.toString(),{},{verticalAlign:d}),u=lt.ht;else if(t.p){const{centerAngle:y,vertexAngle:T}=Xu(h);a=this._updateConfigAndGetDocumentModel(r?ae.deepClone(t.p):t.p,u,E,{horizontalAlign:u,verticalAlign:d,centerAngle:y,vertexAngle:T,wrapStrategy:f,zeroWidthParagraphBreak:1})}else if(t.v!=null){const y=qo(o);l=Jo(y).fontCache;let T=sc(t);t.t===Xt.FORCE_STRING&&s&&(T=`'${T}`),a=jn(T,y,{...c,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Ku(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:f,verticalAlign:d,horizontalAlign:u,paddingData:E,fill:(v=o==null?void 0:o.bg)==null?void 0:v.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=qo(r);if(n!=null)return n.documentModel==null&&(n.documentModel=jn("",s)),n;const i="";let o="document";const a=lt.tr,l=lt.ht,c=lt.vt,h=lt.tb,u=Js;return o=Jo({}).fontCache,{documentModel:jn(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 sc(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 wt.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Xt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Xt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function J0(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 wt.transform.getPlainText(n)}return e==null?void 0:e.v}var Z0=Object.defineProperty,eE=Object.getOwnPropertyDescriptor,tE=(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&&Z0(t,n,s),s},nE=(e,t)=>(n,r)=>t(n,r,e);function rE(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}exports.Workbook=class extends us{constructor(n={},r){super();R(this,"type",$e.UNIVER_SHEET);R(this,"_sheetCreated$",new Oe.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new Oe.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new Oe.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=d0();ae.isEmptyObject(n)?this._snapshot=s:this._snapshot=ae.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=ae.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Bu(i),this._count=1,this._worksheets=new Map,this._name$=new Oe.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return ae.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 nr(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()!==xe.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===xe.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==xe.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(ae.isEmptyObject(s)){const o=ae.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 nr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}};exports.Workbook=tE([nE(1,At)],exports.Workbook);class Di extends us{constructor(n){var r;super();R(this,"type",$e.UNIVER_SLIDE);R(this,"_activePage$",new Oe.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...Hl,...n},this._unitId=(r=this._snapshot.id)!=null?r:ae.generateRandomId(6),this._name$=new Oe.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:cn(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=cn(6);return{id:n,pageType:bi.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 Hn="FOCUSING_UNIT",In="FOCUSING_SHEET",Bn="FOCUSING_DOC",Wn="FOCUSING_SLIDE",sE="FOCUSING_EDITOR_BUT_HIDDEN",ic="EDITOR_ACTIVATED",iE="FOCUSING_EDITOR_INPUT_FORMULA",oc="FOCUSING_FX_BAR_EDITOR",oE="FOCUSING_UNIVER_EDITOR",aE="FOCUSING_EDITOR_INPUT_FORMULA",lE="FOCUSING_PANEL_EDITOR",uE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",cE="FOCUSING_COMMON_DRAWINGS",hE="FORMULA_EDITOR_ACTIVATED";var dE=Object.defineProperty,fE=Object.getOwnPropertyDescriptor,gE=(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&&dE(t,n,s),s},ea=(e,t)=>(n,r)=>t(n,r,e);const dn=mt("univer.current");exports.UniverInstanceService=class extends nt{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 Oe.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new Oe.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new Oe.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new Oe.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(Oe.map(r=>{var s;return(s=r.get(n))!=null?s:null}),Oe.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(Oe.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(Oe.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType($e.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,$e.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,$e.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType($e.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(In,!0),this._contextService.setContextValue(Wn,!1),this.setCurrentUnitForType(n)):this.focused instanceof jt?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!0),this._contextService.setContextValue(In,!1),this._contextService.setContextValue(Wn,!1),this.setCurrentUnitForType(n)):this.focused instanceof Di?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(In,!1),this._contextService.setContextValue(Wn,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Hn,!1),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(In,!1),this._contextService.setContextValue(Wn,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:$e.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(n,i),this._tryBlurUnitOnRemoval(n),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}};exports.UniverInstanceService=gE([ea(0,_t(Ut)),ea(1,cr)],exports.UniverInstanceService);var Ge=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Ge||{});const mE={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var pE=Object.defineProperty,_E=Object.getOwnPropertyDescriptor,EE=(e,t,n,r)=>{for(var s=r>1?void 0:r?_E(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},vE=(e,t)=>(n,r)=>t(n,r,e);exports.LifecycleService=class extends nt{constructor(n){super();R(this,"_lifecycle$",new Oe.BehaviorSubject(Ge.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(this,"_lock",!1);this._logService=n,this._reportProgress(Ge.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return Oe.merge(ac(this.stage),this._lifecycle$.pipe(Oe.skip(1))).pipe(ol(n=>n===Ge.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${mE[n]}".`)}};exports.LifecycleService=EE([vE(0,At)],exports.LifecycleService);function ac(e){switch(e){case Ge.Starting:return Oe.of(Ge.Starting);case Ge.Ready:return Oe.of(Ge.Starting,Ge.Ready);case Ge.Rendered:return Oe.of(Ge.Starting,Ge.Ready,Ge.Rendered);default:return Oe.of(Ge.Starting,Ge.Ready,Ge.Rendered,Ge.Steady)}}var CE=Object.defineProperty,RE=Object.getOwnPropertyDescriptor,IE=(e,t,n,r)=>{for(var s=r>1?void 0:r?RE(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&&CE(t,n,s),s},Is=(e,t)=>(n,r)=>t(n,r,e);const Kt=mt("univer.undo-redo.service"),SE=20;class lc{dispose(){}async dispatchToHandlers(){return!1}}const uc="univer.command.redo",cc="univer.command.undo",rr=new class extends lc{constructor(){super(...arguments);R(this,"type",hr.COMMAND);R(this,"id",cc)}async handler(t){const n=t.get(Kt),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(Dt);return Ii(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},sr=new class extends lc{constructor(){super(...arguments);R(this,"type",hr.COMMAND);R(this,"id",uc)}async handler(t){const n=t.get(Kt),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(Dt);return Ii(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends nt{constructor(n,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new Oe.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(rr)),this.disposeWithMe(this._commandService.registerCommand(sr)),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>SE&&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(In),s=this._contextService.getContextValue(oc),i=this._contextService.getContextValue(ic);return r?s?n=gi:i?n=fi: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}};exports.LocalUndoRedoService=IE([Is(0,dn),Is(1,Dt),Is(2,cr)],exports.LocalUndoRedoService);const cs=mt("core.resource-manager.service"),Zs={[Mt.Editor]:"Editor",[Mt.Owner]:"Owner",[Mt.Reader]:"Reader",[Mt.UNRECOGNIZED]:"UNRECOGNIZED"},Zr=e=>e?{userID:`${Zs[e]}_${ae.generateRandomId(8)}`,name:Zs[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},OE=(e,t)=>e.startsWith(Zs[t]);class ir{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new Oe.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new Oe.BehaviorSubject(Zr()));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 yE=Object.defineProperty,wE=Object.getOwnPropertyDescriptor,bE=(e,t,n,r)=>{for(var s=r>1?void 0:r?wE(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&&yE(t,n,s),s},ta=(e,t)=>(n,r)=>t(n,r,e);exports.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(Zr(Mt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?OE(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[$e.UNIVER_SHEET,$e.UNIVER_DOC,$e.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return cn(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:Mt.Owner,shareScope:-1,scope:{read:Gs.AllCollaborator,edit:Gs.AllCollaborator},creator:Zr(Mt.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(Mt.Owner)||this._getRole(Mt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}};exports.AuthzIoLocalService=bE([ta(0,cs),ta(1,_t(ir))],exports.AuthzIoLocalService);const hc=mt("IAuthzIoIoService"),dc=mt("univer.config-service");class fc{constructor(){R(this,"_configChanged$",new Oe.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=ae.deepMerge(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new Oe.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(Oe.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class gc extends nt{constructor(){super(...arguments);R(this,"_error$",new Oe.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class Kn extends nt{constructor(){super();R(this,"_currentLocale$",new Oe.BehaviorSubject(dr.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new Oe.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=ae.deepMerge((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 AE=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&&AE(t,n,s),s},ME=(e,t)=>(n,r)=>t(n,r,e);exports.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:Gr.PERSON,mentions:[{objectType:Gr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}};exports.MentionIOLocalService=NE([ME(0,_t(ir))],exports.MentionIOLocalService);const mc=mt("univer.service.mention-io");var xi=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(xi||{});const pc=mt("univer.permission-service");class _c extends nt{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new Oe.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 Oe.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new Oe.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=xi.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return Oe.combineLatest(r).pipe(Tr.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}}const Ec=Symbol("DependentOn");class ei extends nt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(ei,"pluginName"),R(ei,"type",$e.UNIVER_UNKNOWN);class DE{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 xE{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var LE=Object.defineProperty,UE=Object.getOwnPropertyDescriptor,vc=(e,t,n,r)=>{for(var s=r>1?void 0:r?UE(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&&LE(t,n,s),s},Wr=(e,t)=>(n,r)=>t(n,r,e);const PE=4;function FE(...e){return function(t){t[Ec]=e}}exports.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(es,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set($e.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const t of this._pluginHoldersForTypes.values())t.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(t,n){this._assertPluginValid(t),this._scheduleInitPlugin();const{type:r}=t;r===$e.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(t,n),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(t,n)}startPluginForType(t){this._ensurePluginHolderForType(t).start()}_ensurePluginHolderForType(t){if(!this._pluginHoldersForTypes.has(t)){const n=this._injector.createInstance(es,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(t,n),n}return this._pluginHoldersForTypes.get(t)}_immediateInitPlugin(t){this._seenPlugins.add(t.pluginName),this._ensurePluginHolderForType(t.type).immediateInitPlugin(t)}_checkPluginSeen(t){return this._seenPlugins.has(t.pluginName)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===$e.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},PE))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[t,n]of this._pluginHoldersForTypes)n.started&&n.flush()}};exports.PluginService=vc([Wr(0,_t(Ut))],exports.PluginService);let es=class extends nt{constructor(t,n,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new xE);R(this,"_pluginStore",new DE);R(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Oe.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(t=>t.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(t,n){this._pluginRegistry.registerPlugin(t,n)}immediateInitPlugin(t){const n=this._initPlugin(t,void 0);this._pluginsRunLifecycle([n])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const t=this._pluginRegistry.getRegisterPlugins().map(({plugin:n,options:r})=>this._initPlugin(n,r));t.length&&(this._pluginsRunLifecycle(t),this._pluginRegistry.removePlugins())}_initPlugin(t,n){const r=t[Ec];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){ac(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case Ge.Starting:r.onStarting();break;case Ge.Ready:r.onReady();break;case Ge.Rendered:r.onRendered();break;case Ge.Steady:r.onSteady();break}})}};es=vc([Wr(2,At),Wr(3,_t(Ut)),Wr(4,_t(exports.LifecycleService))],es);function Cc(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}var kE=Object.defineProperty,$E=Object.getOwnPropertyDescriptor,jE=(e,t,n,r)=>{for(var s=r>1?void 0:r?$E(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&&kE(t,n,s),s},na=(e,t)=>(n,r)=>t(n,r,e);let ti=class extends nt{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case $e.UNRECOGNIZED:case $e.UNIVER_UNKNOWN:case $e.UNIVER_SLIDE:case $e.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType($e.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case $e.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType($e.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();Da(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=ae.deepClone(t.getSnapshot());return r.resources=n,r}};ti=jE([na(0,_t(cs)),na(1,_t(dn))],ti);const ni=mt("resource-loader-service");class Rc extends nt{constructor(){super(...arguments);R(this,"_resourceMap",new Map);R(this,"_register$",new Oe.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 Li extends nt{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new Oe.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 Ic{constructor(t={},n){R(this,"_startedTypes",new Set);R(this,"_injector");const r=this._injector=HE(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(Li).setTheme(s),o&&this._injector.get(Kn).load(o),i&&this._injector.get(Kn).setLocale(i),a&&this._injector.get(At).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(dn)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(t){this._injector.get(Kn).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType($e.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType($e.UNIVER_DOC,jt),this._univerInstanceService.registerCtorForType($e.UNIVER_SLIDE,Di);const n=t.get(dn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<Ge.Ready&&(this._injector.get(exports.LifecycleService).stage=Ge.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function HE(e,t){const n=Cc([[gc],[Kn],[Li],[exports.LifecycleService],[exports.PluginService],[ir],[dn,{useClass:exports.UniverInstanceService}],[pc,{useClass:_c}],[At,{useClass:rl,lazy:!0}],[Dt,{useClass:exports.CommandService}],[Kt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[dc,{useClass:fc}],[cr,{useClass:tl}],[cs,{useClass:Rc,lazy:!0}],[ni,{useClass:ti,lazy:!0}],[hc,{useClass:exports.AuthzIoLocalService,lazy:!0}],[mc,{useClass:exports.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Ut(n);return Xa(r,[[ir],[ni]]),r}var BE=Object.defineProperty,WE=Object.getOwnPropertyDescriptor,YE=(e,t,n,r)=>{for(var s=r>1?void 0:r?WE(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&&BE(t,n,s),s},ra=(e,t)=>(n,r)=>t(n,r,e);exports.FHooks=class extends Jn{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===Ge.Starting)).subscribe(t))}onReady(t){return qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===Ge.Ready)).subscribe(t))}onRendered(t){return qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===Ge.Rendered)).subscribe(t))}onSteady(t){return qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===Ge.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(Dt).beforeCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Kt).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(Dt).onCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Kt).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(Dt).beforeCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Kt).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(Dt).onCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Kt).pitchTopRedoElement();i&&t(i)}})}};exports.FHooks=YE([ra(0,_t(Ut)),ra(1,_t(exports.LifecycleService))],exports.FHooks);var zE=Object.defineProperty,VE=Object.getOwnPropertyDescriptor,GE=(e,t,n,r)=>{for(var s=r>1?void 0:r?VE(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},Ss=(e,t)=>(n,r)=>t(n,r,e);exports.FUniver=class extends Jn{constructor(t,n,r){super(),this._injector=t,this._commandService=n,this._univerInstanceService=r}static newAPI(t){return(t instanceof Ic?t.__getInjector():t).createInstance(exports.FUniver)}disposeUnit(t){return this._univerInstanceService.disposeUnit(t)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(rr.id)}redo(){return this._commandService.executeCommand(sr.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(exports.FHooks)}};exports.FUniver=GE([Ss(0,_t(Ut)),Ss(1,Dt),Ss(2,dn)],exports.FUniver);function Sc(e){return/^-?\d+(\.\d+)?$/.test(e)}function KE(e){return Sc(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 XE(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 QE(e,t){return t.forEach(n=>e.add(n)),e}function qE(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 tt,u=$t.getInstance();if(a>0&&h.retain(a),n.length>0){const d=i.sliceBody(a,a+o),f={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const E=d.customRanges[0];f.customRanges=[{...E,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,f)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const JE="__default_document_sub_component_id20231101__";class Oc{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class ZE extends Oe.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 Oc;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 ev(e){return new Oe.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const tv=mt("ILocalStorageService");function nv(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function rv(e){return new Promise(t=>setTimeout(t,e))}function sv(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||{}),yc=(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))(yc||{});const ri=mt("core.image-io.service");class iv{constructor(t,n=100){R(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new er(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(ri)?this._injector.get(ri):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 ov=["script","style","meta","comment","link"];var wc=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(wc||{}),bc=(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))(bc||{}),Ac=(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))(Ac||{}),Tc=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Tc||{}),Nc=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(Nc||{}),Mc=(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))(Mc||{});const sa=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Os=1,Un=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!==Os)throw new Error(`Got v${s} data when expected v${Os}.`);const i=sa[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=sa.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,Un,t),this.coords=new this.ArrayType(this.data,Un+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Un+o+a+l),this.ids=new this.IndexArrayType(this.data,Un,t),this.coords=new this.ArrayType(this.data,Un+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Os<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return si(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const h=l.pop()||0,u=l.pop()||0,d=l.pop()||0;if(u-d<=a){for(let y=d;y<=u;y++){const T=o[2*y],V=o[2*y+1];T>=t&&T<=r&&V>=n&&V<=s&&c.push(i[y])}continue}const f=d+u>>1,E=o[2*f],v=o[2*f+1];E>=t&&E<=r&&v>=n&&v<=s&&c.push(i[f]),(h===0?t<=E:n<=v)&&(l.push(d),l.push(f-1),l.push(1-h)),(h===0?r>=E:s>=v)&&(l.push(f+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,d=a.pop()||0;if(u-d<=o){for(let y=d;y<=u;y++)ia(i[2*y],i[2*y+1],t,n)<=c&&l.push(s[y]);continue}const f=d+u>>1,E=i[2*f],v=i[2*f+1];ia(E,v,t,n)<=c&&l.push(s[f]),(h===0?t-r<=E:n-r<=v)&&(a.push(d),a.push(f-1),a.push(1-h)),(h===0?t+r>=E:n+r>=v)&&(a.push(f+1),a.push(u),a.push(1-h))}return l}}function si(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;Dc(e,t,o,r,s,i),si(e,t,n,r,o-1,1-i),si(e,t,n,o+1,s,1-i)}function Dc(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),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(h-c/2<0?-1:1),E=Math.max(r,Math.floor(n-h*d/c+f)),v=Math.min(s,Math.floor(n+(c-h)*d/c+f));Dc(e,t,n,E,v,i)}const o=t[2*n+i];let a=r,l=s;for(Pn(e,t,r,n),t[2*s+i]>o&&Pn(e,t,r,s);a<l;){for(Pn(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Pn(e,t,r,l):(l++,Pn(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Pn(e,t,n,r){ys(e,n,r),ys(t,2*n,2*r),ys(t,2*n+1,2*r+1)}function ys(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ia(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function xc(e,t,n=0,r=e.length-1,s=av){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),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*u/l+d)),E=Math.min(r,Math.floor(t+(l-c)*u/l+d));xc(e,t,f,E,s)}const i=e[t];let o=n,a=r;for(Fn(e,n,t),s(e[r],i)>0&&Fn(e,n,r);o<a;){for(Fn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?Fn(e,n,a):(a++,Fn(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function Fn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function av(e,t){return e<t?-1:e>t?1:0}class ii{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(!Ar(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;Ar(t,l)&&(n.leaf?r.push(a):bs(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!Ar(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(Ar(t,o)){if(n.leaf||bs(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=vn([]),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=lv(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&bs(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=vn(t.slice(n,r+1)),_n(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=vn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));oa(t,n,r,c,this.compareMinX);for(let h=n;h<=r;h+=c){const u=Math.min(h+c-1,r);oa(t,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(t,d,f,s-1))}}return _n(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=ws(c),u=hv(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),zn(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=vn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,_n(r,this.toBBox),_n(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=vn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,_n(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=Yn(t,0,a,this.toBBox),c=Yn(t,a,r,this.toBBox),h=dv(l,c),u=ws(l)+ws(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:uv,i=t.leaf?this.compareMinY:cv,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=Yn(t,0,n,i),a=Yn(t,r-n,r,i);let l=br(o)+br(a);for(let c=n;c<r-n;c++){const h=t.children[c];zn(o,t.leaf?i(h):h),l+=br(o)}for(let c=r-n-1;c>=n;c--){const h=t.children[c];zn(a,t.leaf?i(h):h),l+=br(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)zn(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():_n(t[n],this.toBBox)}}function lv(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 _n(e,t){Yn(e,0,e.children.length,t,e)}function Yn(e,t,n,r,s){s||(s=vn(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];zn(s,e.leaf?r(o):o)}return s}function zn(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 uv(e,t){return e.minX-t.minX}function cv(e,t){return e.minY-t.minY}function ws(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function br(e){return e.maxX-e.minX+(e.maxY-e.minY)}function hv(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 dv(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 bs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Ar(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function vn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oa(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;xc(e,o,t,n,s),i.push(t,o,o,n)}}class fv{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 ii),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 d=l;d<=h;d++){const f=a.get(d);if(f)for(let E=c;E<=u;E++){const v=f.get(E);v&&v.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var E;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(E=this._kdTree.get(n))==null?void 0:E.get(r);if(!c)return[];const{tree:h,items:u}=c,d=h.range(o,i,l,a),f=[];for(const v of d){const y=u[v];f.push(...Array.from(y.ids))}return f}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new 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 ii;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}kc();exports.ABCToNumber=I_;exports.AbsoluteRefType=et;exports.ActionIterator=En;exports.AlignTypeH=gu;exports.AlignTypeV=mu;exports.ArrangeTypeEnum=Eu;exports.ArrowsAndMarkersShapes=Rl;exports.AsyncInterceptorManager=Gg;exports.AutoFillSeries=cl;exports.BaselineOffset=kt;exports.BasicShapes=Cl;exports.BlockType=Gl;exports.BooleanNumber=xe;exports.BorderStyleTypes=Ke;exports.BorderType=hl;exports.BuildTextUtils=wt;exports.BulletAlignment=gr;exports.COLORS=Bs;exports.CellValueType=Xt;exports.Color=hn;exports.ColorBuilder=as;exports.ColorKit=yt;exports.ColorType=Ct;exports.ColumnSeparatorType=Ql;exports.CommandType=hr;exports.CommonHideTypes=dl;exports.ConfigService=fc;exports.ContextService=tl;exports.CopyPasteType=fl;exports.CustomCommandExecutionError=$s;exports.CustomDecorationType=an;exports.CustomRangeType=tr;exports.DEFAULT_CELL=l_;exports.DEFAULT_DOC=Mi;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=JE;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=Ma;exports.DEFAULT_RANGE=o_;exports.DEFAULT_RANGE_ARRAY=i_;exports.DEFAULT_SELECTION=a_;exports.DEFAULT_SLIDE=Hl;exports.DEFAULT_STYLES=lt;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=qu;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=V0;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=tc;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=Q0;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Zu;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=K0;exports.DEFAULT_WORKSHEET_ROW_COUNT=Qu;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=z0;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Ju;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=G0;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=ec;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=X0;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=gi;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=fi;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=Na;exports.DOC_RANGE_TYPE=Ll;exports.DashStyleType=ru;exports.DataStreamTreeNodeType=Vu;exports.DataStreamTreeTokenType=zt;exports.DataValidationErrorStyle=wc;exports.DataValidationImeMode=bc;exports.DataValidationOperator=Ac;exports.DataValidationRenderMode=Tc;exports.DataValidationStatus=Nc;exports.DataValidationType=Mc;exports.DeleteDirection=gl;exports.DependentOn=FE;exports.DesktopLogService=rl;exports.DeveloperMetadataVisibility=ml;exports.Dimension=pl;exports.Direction=_l;exports.Disposable=nt;exports.DisposableCollection=Ri;exports.DocStyleType=zl;exports.DocumentDataModel=jt;exports.DocumentFlavor=wi;exports.DrawingTypeEnum=vu;exports.EDITOR_ACTIVATED=ic;exports.EXTENSION_NAMES=Bl;exports.ErrorService=gc;exports.EventState=Oc;exports.EventSubject=ZE;exports.FBase=Jn;exports.FOCUSING_COMMON_DRAWINGS=cE;exports.FOCUSING_DOC=Bn;exports.FOCUSING_EDITOR_BUT_HIDDEN=sE;exports.FOCUSING_EDITOR_INPUT_FORMULA=iE;exports.FOCUSING_EDITOR_STANDALONE=aE;exports.FOCUSING_FX_BAR_EDITOR=oc;exports.FOCUSING_PANEL_EDITOR=lE;exports.FOCUSING_SHEET=In;exports.FOCUSING_SLIDE=Wn;exports.FOCUSING_UNIT=Hn;exports.FOCUSING_UNIVER_EDITOR=oE;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=uE;exports.FORMULA_EDITOR_ACTIVATED=hE;exports.FollowNumberWithType=Vl;exports.FontItalic=Kr;exports.FontStyleType=Rn;exports.FontWeight=Xr;exports.GridType=Kl;exports.HLSColor=Ml;exports.HorizontalAlign=Gt;exports.IAuthzIoService=hc;exports.ICommandService=Dt;exports.IConfigService=dc;exports.IContextService=cr;exports.IImageIoService=ri;exports.ILocalStorageService=tv;exports.ILogService=At;exports.IMentionIOService=mc;exports.IPermissionService=pc;exports.IResourceLoaderService=ni;exports.IResourceManagerService=cs;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=qf;exports.IUndoRedoService=Kt;exports.IUniverInstanceService=dn;exports.ImageCacheMap=iv;exports.ImageSourceType=Fi;exports.ImageUploadStatusType=yc;exports.Inject=_t;exports.Injector=Ut;exports.InterceptorEffectEnum=Cn;exports.InterceptorManager=Yg;exports.InterpolationPointType=El;exports.JSON1=P_;exports.JSONX=$t;exports.LRUHelper=$n;exports.LRUMap=er;exports.LifecycleStages=Ge;exports.ListGlyphType=Te;exports.LocaleService=Kn;exports.LocaleType=dr;exports.LogLevel=nl;exports.MOVE_BUFFER_VALUE=kn;exports.Many=ka;exports.MemoryCursor=Mn;exports.MentionType=Gr;exports.NamedStyleType=tu;exports.NilCommand=sl;exports.NumberUnitType=fu;exports.ObjectMatrix=xt;exports.ObjectRelativeFromH=hu;exports.ObjectRelativeFromV=du;exports.Optional=$a;exports.OtherShapes=Il;exports.PRESET_LIST_TYPE=pr;exports.PageElementType=Cu;exports.PageOrientType=_u;exports.PageType=bi;exports.ParagraphElementType=Jl;exports.PermissionService=_c;exports.PermissionStatus=xi;exports.Plugin=ei;exports.PositionedObjectLayoutType=eu;exports.PresetListType=Lt;exports.ProtectionType=vl;exports.QuickListType=Pu;exports.QuickListTypeMap=B_;exports.RANGE_DIRECTION=xl;exports.RANGE_TYPE=De;exports.RBush=ii;exports.RCDisposable=Zg;exports.RGBA_PAREN=Tm;exports.RGB_PAREN=Am;exports.ROTATE_BUFFER_VALUE=ul;exports.RTree=fv;exports.Range=bn;exports.Rectangle=Jt;exports.RediConsumer=Va;exports.RediContext=ur;exports.RediError=st;exports.RediProvider=Ci;exports.RedoCommand=sr;exports.RedoCommandId=uc;exports.RefAlias=R_;exports.Registry=Ui;exports.RegistryAsMap=Pi;exports.RelativeDate=Ol;exports.RelativeSlideLink=Ru;exports.ResourceManagerService=Rc;exports.RgbColor=Qr;exports.RxDisposable=Jg;exports.SHEET_EDITOR_UNITS=u_;exports.SectionType=Xl;exports.Self=Wa;exports.SheetTypes=yl;exports.SheetViewModel=rc;exports.SkipSelf=Ba;exports.SliceBodyType=Ni;exports.SlideDataModel=Di;exports.SpacingRule=nu;exports.SpecialShapes=Sl;exports.Styles=Bu;exports.THEME_COLORS=Nl;exports.TabStopAlignment=su;exports.TableAlignmentType=ou;exports.TableLayoutType=au;exports.TableRowHeightRule=uu;exports.TableSizeType=iu;exports.TableTextWrapType=lu;exports.TextDecoration=wl;exports.TextDirection=Zn;exports.TextDirectionType=ql;exports.TextX=tt;exports.TextXActionType=pe;exports.ThemeColor=qr;exports.ThemeColorType=dt;exports.ThemeColors=os;exports.ThemeService=Li;exports.Tools=ae;exports.UndoCommand=rr;exports.UndoCommandId=cc;exports.UnitModel=us;exports.Univer=Ic;exports.UniverInstanceType=$e;exports.UpdateDocsAttributeType=Pe;exports.UserManagerService=ir;exports.VerticalAlign=on;exports.VerticalAlignmentType=cu;exports.WithDependency=Ug;exports.WithNew=Ya;exports.Worksheet=nr;exports.WrapStrategy=un;exports.WrapTextType=Zl;exports.addLinkToDocumentModel=Ku;exports.afterInitApply=lm;exports.afterTime=am;exports.awaitTime=rv;exports.binSearchFirstGreaterThanTarget=ll;exports.binarySearchArray=um;exports.bufferDebounceTime=om;exports.cellToRange=sp;exports.characterSpacingControlType=pu;exports.checkForSubstrings=ip;exports.checkIfMove=dm;exports.checkParagraphHasBullet=Hp;exports.checkParagraphHasIndent=Bp;exports.checkParagraphHasIndentByStyle=kl;exports.codeToBlob=hm;exports.composeBody=qs;exports.composeInterceptors=qa;exports.composeStyles=js;exports.concatMatrixArray=t_;exports.connectDependencies=Dg;exports.connectInjector=Mg;exports.convertBodyToHtml=bm;exports.convertCellToRange=Ul;exports.covertTextRunToHtml=Hs;exports.createAsyncInterceptorKey=zg;exports.createDefaultUser=Zr;exports.createDocumentModelWithStyle=jn;exports.createIdentifier=mt;exports.createInterceptorKey=Wg;exports.createInternalEditorID=Jf;exports.createRowColIter=Vs;exports.dayjs=Bt;exports.debounce=Uf;exports.dedupe=zf;exports.deepCompare=Oi;exports.delayAnimationFrame=sv;exports.deleteContent=jl;exports.extractPureTextFromCell=sc;exports.forwardRef=ag;exports.fromCallback=il;exports.fromEventSubject=ev;exports.fromObservable=qg;exports.generateRandomId=cn;exports.get=df;exports.getArrayLength=Qt;exports.getBodySlice=qt;exports.getBodySliceHtml=Dr;exports.getBorderStyleType=tp;exports.getCellInfoInMergeData=Km;exports.getCellValueType=Ym;exports.getColorStyle=Nt;exports.getCustomDecorationSlice=$u;exports.getCustomRangeSlice=ku;exports.getDocsUpdateBody=np;exports.getIntersectRange=m_;exports.getOriginCellValue=J0;exports.getReverseDirection=fm;exports.getWorksheetUID=rE;exports.groupBy=Kf;exports.handleStyleToString=ep;exports.hashAlgorithm=zp;exports.horizontalLineSegmentsSubtraction=ls;exports.insertMatrixArray=Ws;exports.insertTextToContent=$l;exports.isAsyncDependencyItem=Ls;exports.isAsyncHook=Nr;exports.isBlackColor=Hm;exports.isBooleanString=Qf;exports.isCellCoverable=qm;exports.isCellV=Vm;exports.isClassDependencyItem=Ms;exports.isCtor=pi;exports.isDisposable=Ps;exports.isEmptyCell=Pl;exports.isFactoryDependencyItem=Ds;exports.isFormulaId=Zm;exports.isFormulaString=Jm;exports.isICellData=Wm;exports.isInternalEditorID=Da;exports.isNodeEnv=wm;exports.isNullCell=zm;exports.isNumeric=Sc;exports.isRangesEqual=F0;exports.isRealNum=Yp;exports.isSafeNumeric=KE;exports.isSameStyleTextRun=Fl;exports.isUnitRangesEqual=k0;exports.isValidRange=rp;exports.isValueDependencyItem=xs;exports.isWhiteColor=Bm;exports.makeArray=Xf;exports.makeCellRangeToRangeData=Qm;exports.makeCellToSelection=Xm;exports.makeCustomRangeStream=N0;exports.merge=jf;exports.mergeOverrideWithDependencies=Cc;exports.mergeSets=QE;exports.mergeWith=$f;exports.mergeWorksheetSnapshotWithDefault=nc;exports.mixinClass=Kg;exports.moveMatrixArray=zs;exports.moveRangeByOffset=c_;exports.nameCharacterCheck=nv;exports.normalizeBody=q_;exports.normalizeTextRuns=mr;exports.numberToABC=O_;exports.numberToListABC=y_;exports.numfmt=e_;exports.queryObjectMatrix=C_;exports.registerDependencies=Hg;exports.remove=ar;exports.repeatStringNumTimes=Yl;exports.replaceInDocumentBody=qE;exports.requestImmediateMacroTask=XE;exports.rotate=Gf;exports.searchArray=cm;exports.searchInOrderedArray=al;exports.selectionToArray=Gm;exports.sequence=Za;exports.sequenceAsync=Ja;exports.sequenceExecute=Ii;exports.sequenceExecuteAsync=im;exports.set=Bf;exports.setDependencies=Og;exports.shallowEqual=Qa;exports.skipParseTagNames=ov;exports.sliceMatrixArray=n_;exports.sortRules=w_;exports.sortRulesByDesc=b_;exports.sortRulesFactory=fr;exports.spliceArray=Ys;exports.splitIntoGrid=yi;exports.takeAfter=ol;exports.textDiff=Ta;exports.throttle=Bg;exports.toDisposable=qe;exports.touchDependencies=Xa;exports.updateAttributeByDelete=ju;exports.updateAttributeByInsert=Hu;exports.useDependency=Tg;exports.useDependencyContext=$g;exports.useDependencyContextValue=jg;exports.useDependencyValue=Ka;exports.useInjector=Ga;exports.useObservable=Fg;exports.useUpdateBinder=kg;