@odoo/o-spreadsheet 16.0.62 → 16.0.63
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/dist/o-spreadsheet.cjs.js +13 -11
- package/dist/o-spreadsheet.esm.js +13 -11
- package/dist/o-spreadsheet.iife.js +13 -11
- package/dist/o-spreadsheet.iife.min.js +2 -2
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +2 -1
|
@@ -2399,11 +2399,12 @@ class UuidGenerator {
|
|
|
2399
2399
|
if (this.isFastIdStrategy) {
|
|
2400
2400
|
this.fastIdStart++;
|
|
2401
2401
|
return String(this.fastIdStart);
|
|
2402
|
-
//@ts-ignore
|
|
2403
2402
|
}
|
|
2404
|
-
else if (window.crypto
|
|
2405
|
-
|
|
2406
|
-
|
|
2403
|
+
else if (window.crypto) {
|
|
2404
|
+
return "10000000-1000".replace(/[01]/g, (c) => {
|
|
2405
|
+
const n = Number(c);
|
|
2406
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2407
|
+
});
|
|
2407
2408
|
}
|
|
2408
2409
|
else {
|
|
2409
2410
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -2421,11 +2422,12 @@ class UuidGenerator {
|
|
|
2421
2422
|
if (this.isFastIdStrategy) {
|
|
2422
2423
|
this.fastIdStart++;
|
|
2423
2424
|
return String(this.fastIdStart);
|
|
2424
|
-
//@ts-ignore
|
|
2425
2425
|
}
|
|
2426
|
-
else if (window.crypto
|
|
2427
|
-
|
|
2428
|
-
|
|
2426
|
+
else if (window.crypto) {
|
|
2427
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
|
|
2428
|
+
const n = Number(c);
|
|
2429
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2430
|
+
});
|
|
2429
2431
|
}
|
|
2430
2432
|
else {
|
|
2431
2433
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -43689,6 +43691,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
43689
43691
|
exports.tokenize = tokenize;
|
|
43690
43692
|
|
|
43691
43693
|
|
|
43692
|
-
__info__.version = '16.0.
|
|
43693
|
-
__info__.date = '2025-02-
|
|
43694
|
-
__info__.hash = '
|
|
43694
|
+
__info__.version = '16.0.63';
|
|
43695
|
+
__info__.date = '2025-02-25T05:54:41.386Z';
|
|
43696
|
+
__info__.hash = 'b01aca6';
|
|
@@ -2395,11 +2395,12 @@ class UuidGenerator {
|
|
|
2395
2395
|
if (this.isFastIdStrategy) {
|
|
2396
2396
|
this.fastIdStart++;
|
|
2397
2397
|
return String(this.fastIdStart);
|
|
2398
|
-
//@ts-ignore
|
|
2399
2398
|
}
|
|
2400
|
-
else if (window.crypto
|
|
2401
|
-
|
|
2402
|
-
|
|
2399
|
+
else if (window.crypto) {
|
|
2400
|
+
return "10000000-1000".replace(/[01]/g, (c) => {
|
|
2401
|
+
const n = Number(c);
|
|
2402
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2403
|
+
});
|
|
2403
2404
|
}
|
|
2404
2405
|
else {
|
|
2405
2406
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -2417,11 +2418,12 @@ class UuidGenerator {
|
|
|
2417
2418
|
if (this.isFastIdStrategy) {
|
|
2418
2419
|
this.fastIdStart++;
|
|
2419
2420
|
return String(this.fastIdStart);
|
|
2420
|
-
//@ts-ignore
|
|
2421
2421
|
}
|
|
2422
|
-
else if (window.crypto
|
|
2423
|
-
|
|
2424
|
-
|
|
2422
|
+
else if (window.crypto) {
|
|
2423
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
|
|
2424
|
+
const n = Number(c);
|
|
2425
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2426
|
+
});
|
|
2425
2427
|
}
|
|
2426
2428
|
else {
|
|
2427
2429
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -43657,6 +43659,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
43657
43659
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
43658
43660
|
|
|
43659
43661
|
|
|
43660
|
-
__info__.version = '16.0.
|
|
43661
|
-
__info__.date = '2025-02-
|
|
43662
|
-
__info__.hash = '
|
|
43662
|
+
__info__.version = '16.0.63';
|
|
43663
|
+
__info__.date = '2025-02-25T05:54:41.386Z';
|
|
43664
|
+
__info__.hash = 'b01aca6';
|
|
@@ -2396,11 +2396,12 @@
|
|
|
2396
2396
|
if (this.isFastIdStrategy) {
|
|
2397
2397
|
this.fastIdStart++;
|
|
2398
2398
|
return String(this.fastIdStart);
|
|
2399
|
-
//@ts-ignore
|
|
2400
2399
|
}
|
|
2401
|
-
else if (window.crypto
|
|
2402
|
-
|
|
2403
|
-
|
|
2400
|
+
else if (window.crypto) {
|
|
2401
|
+
return "10000000-1000".replace(/[01]/g, (c) => {
|
|
2402
|
+
const n = Number(c);
|
|
2403
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2404
|
+
});
|
|
2404
2405
|
}
|
|
2405
2406
|
else {
|
|
2406
2407
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -2418,11 +2419,12 @@
|
|
|
2418
2419
|
if (this.isFastIdStrategy) {
|
|
2419
2420
|
this.fastIdStart++;
|
|
2420
2421
|
return String(this.fastIdStart);
|
|
2421
|
-
//@ts-ignore
|
|
2422
2422
|
}
|
|
2423
|
-
else if (window.crypto
|
|
2424
|
-
|
|
2425
|
-
|
|
2423
|
+
else if (window.crypto) {
|
|
2424
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
|
|
2425
|
+
const n = Number(c);
|
|
2426
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2427
|
+
});
|
|
2426
2428
|
}
|
|
2427
2429
|
else {
|
|
2428
2430
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -43688,9 +43690,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
43688
43690
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
43689
43691
|
|
|
43690
43692
|
|
|
43691
|
-
__info__.version = '16.0.
|
|
43692
|
-
__info__.date = '2025-02-
|
|
43693
|
-
__info__.hash = '
|
|
43693
|
+
__info__.version = '16.0.63';
|
|
43694
|
+
__info__.date = '2025-02-25T05:54:41.386Z';
|
|
43695
|
+
__info__.hash = 'b01aca6';
|
|
43694
43696
|
|
|
43695
43697
|
|
|
43696
43698
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"use strict";let i=e=>e;function o(e,...t){if(1===t.length&&"object"==typeof t[0]){const i=t[0];e=e.replace(/\%\(?([^\)]+)\)s/g,((e,t)=>i[t]))}else t.length>0&&(e=e.replace(/\%s/g,(()=>t.shift())));return e}const n=function(e,...t){return o(i(e),...t)},s=function(e,...t){return new r(e,t)};class r extends String{constructor(e,t){super(e),this.values=t}valueOf(){const e=super.valueOf();return o(i(e),...this.values)}toString(){return this.valueOf()}}var a,l;!function(e){e.NotAvailable="#N/A",e.InvalidReference="#REF",e.BadExpression="#BAD_EXPR",e.CircularDependency="#CYCLE",e.UnknownFunction="#NAME?",e.GenericError="#ERROR"}(a||(a={})),function(e){e[e.silent=0]="silent",e[e.error=1]="error"}(l||(l={}));class c extends Error{constructor(e,t,i=l.error){super(t),this.errorType=e,this.logLevel=i}}class h extends c{constructor(e){super(a.BadExpression,e)}}class d extends c{constructor(){super(a.CircularDependency,s("Circular reference"))}}class u extends c{constructor(){super(a.InvalidReference,s("Invalid reference"))}}class g extends c{constructor(){super(a.NotAvailable,s("Data not available"),l.silent)}}class p extends c{constructor(e){super(a.UnknownFunction,s('Unknown function: "%s"',e))}}const m=.5,f="#f5f5f5",v="#F8F9FA",b="#E8EAED",S="#595959",C="#666666",E="#3266ca",w="#FFFFFF",y="#CACACA",x=11982760,R="#01666b",I="#188038",T="#E6F4EA",A="#CEEAD6",O=["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF","#980000","#FF0000","#FF9900","#FFFF00","#00FF00","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF","#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#741B47","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"],N=26,M=48,_=96,F=23,D=15,k=18,$=14,L=4,P=4,U=3,V=P,z=17,B=250,H=1,W="400",G=10,q="'Roboto', arial",Z=["thin","#000"],j=["thin",I],Y=/[ymdhs:]/,X=a.InvalidReference,K="START_REVISION",Q=20,J=.4,ee=["'","*","?","/","\\","[","]"],te=/'|\*|\?|\/|\\|\[|\]/,ie="|",oe=s("Invalid expression");var ne;!function(e){e[e.Grid=0]="Grid",e[e.Highlight=5]="Highlight",e[e.Figure=10]="Figure",e[e.ScrollBar=15]="ScrollBar",e[e.GridPopover=19]="GridPopover",e[e.GridComposer=20]="GridComposer",e[e.Dropdown=21]="Dropdown",e[e.ColorPicker=25]="ColorPicker",e[e.IconPicker=25]="IconPicker",e[e.TopBarComposer=30]="TopBarComposer",e[e.Popover=35]="Popover",e[e.ChartAnchor=1e3]="ChartAnchor"}(ne||(ne={}));const se=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48}],re={};for(let e of se)re[e.pt]=e.px;class ae{constructor(e,t,i,o=0,n=0,s=0){this.jsDate=new Date(Date.UTC(e,t,i,o,n,s,0))}static fromTimestamp(e){const t=new Date(e);return new ae(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}static now(){const e=new Date;return new ae(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())}toString(){return this.jsDate.toString()}getTime(){return this.jsDate.getTime()}getFullYear(){return this.jsDate.getUTCFullYear()}getMonth(){return this.jsDate.getUTCMonth()}getDate(){return this.jsDate.getUTCDate()}getDay(){return this.jsDate.getUTCDay()}getHours(){return this.jsDate.getUTCHours()}getMinutes(){return this.jsDate.getUTCMinutes()}getSeconds(){return this.jsDate.getUTCSeconds()}setFullYear(e){this.jsDate.setFullYear(e)}setDate(e){this.jsDate.setUTCDate(e)}setHours(e){this.jsDate.setUTCHours(e)}setMinutes(e){this.jsDate.setUTCMinutes(e)}setSeconds(e){this.jsDate.setUTCSeconds(e)}}const le=new ae(1899,11,30),ce=864e5,he=2e3,de=ae.now().getFullYear(),ue=ae.fromTimestamp(0).getTime()-le.getTime(),ge=/^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/,pe=/^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/,me=/((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/,fe={};function ve(e){if(fe[e])return fe[e];const t=function(e){let t;e=e.trim();const i=e.match(me);if(i){if(t=function(e){if(e=e.trim(),me.test(e)){const t=/AM/i.test(e),i=/PM/i.test(e),o=(t||i?e.substring(0,e.length-2).trim():e).split(/:/),n=o.length>=2,s=3===o.length;let r=Number(o[0]),a=n?Number(o[1]):0,l=s?Number(o[2]):0,c=s?"hh:mm:ss":"hh:mm";if(t||i)c+=" a";else if(!n)return null;r>=12&&t?r-=12:r<12&&i&&(r+=12),a+=Math.floor(l/60),l%=60,r+=Math.floor(a/60),a%=60,r>=24&&(c="hhhh:mm:ss");return{value:r/24+a/1440+l/86400,format:c,jsDate:new ae(1899,11,30,r,a,l)}}return null}(i[0]),null===t)return null;e=e.replace(i[0],"").trim()}let o;const n=e.match(ge),s=e.match(pe);if(n||s){let t;if(n?(t=n[0],o=be(t,"mdy")):(t=s[0],o=be(t,"ymd")),null===o)return null;e=e.replace(t,"").trim()}if(""!==e||!o&&!t)return null;if(o&&t)return{value:o.value+t.value,format:o.format+" "+("hhhh:mm:ss"===t.format?"hh:mm:ss":t.format),jsDate:new ae(o.jsDate.getFullYear()+t.jsDate.getFullYear()-1899,o.jsDate.getMonth()+t.jsDate.getMonth()-11,o.jsDate.getDate()+t.jsDate.getDate()-30,o.jsDate.getHours()+t.jsDate.getHours(),o.jsDate.getMinutes()+t.jsDate.getMinutes(),o.jsDate.getSeconds()+t.jsDate.getSeconds())};return o||t}(e);return fe[e]=t,t}function be(e,t){const i="mdy"===t;if(i||"ymd"===t){const t=e.split(/\/|-|\s/),o=i?0:1,n=i?1:2,s=i?2:0,r=Number(t[o]),a=Number(t[n]),l=2===t[o].length&&r<10||2===t[n].length&&a<10,c=t[s]?function(e){const t=Number(e);switch(e.length){case 1:return he+t;case 2:return he+(he+t>de+10?-100:0)+t;case 3:case 4:return t}return 0}(t[s]):de,h=new ae(c,r-1,a),d=e.match(/\/|-|\s/)[0];if(h.getMonth()!==r-1||h.getDate()!==a)return null;const u=h.getTime()-le.getTime();let g=l?`mm${d}dd`:`m${d}d`;return t[s]&&(g=i?g+d+"yyyy":"yyyy"+d+g),{value:Math.round(u/ce),format:g,jsDate:h}}return null}function Se(e){const t=Math.trunc(e);let i=ae.fromTimestamp(t*ce-ue),o=e-t;o=o<0?1+o:o;const n=Math.round(24*o),s=Math.round(24*(o-n/24)*60),r=Math.round(24*(o-n/24-s/24/60)*60*60);return i.setHours(n),i.setMinutes(s),i.setSeconds(r),i}function Ce(e){const t=e.getTime()-le.getTime();return Math.round(t/ce)}function Ee(e){return new ae(e.getFullYear(),e.getMonth()+1,0).getDate()}function we(e){return Ee(e)===e.getDate()}function ye(e,t,i){const o=e.getFullYear(),n=e.getMonth(),s=e.getDate(),r=new ae(o,n+t,1);return i&&s===Ee(e)||s>Ee(r)?r.setDate(Ee(r)):r.setDate(s),r}function xe(e){const t=Math.trunc(e);return t%4==0&&t%100!=0||t%400==0}function Re(e,t,i){if(e===t)return 0;if(e>t){const i=t;t=e,e=i}const o=Se(e),n=Se(t);let s=o.getDate(),r=n.getDate();const a=o.getMonth(),l=n.getMonth(),c=o.getFullYear(),h=n.getFullYear();let d=0,u=0;switch(i){case 0:31===s&&(s=30),30===s&&31===r&&(r=30),1===a&&s===(xe(c)?29:28)&&(s=30,1===l&&r===(xe(h)?29:28)&&(r=30)),d=c+(30*a+s)/360,u=h+(30*l+r)/360;break;case 1:let i=365;const o=c===h;if(!o&&!(c+1===h)||!o&&a<l||!o&&a===l&&s<r){let e=0,t=0;for(let i=c;i<=h;i++)e++,t+=xe(i)?366:365;i=t/e}else o?xe(c)&&(i=366):(xe(c)&&a<2&&(i=366),xe(h)&&(l>1||1===l&&29===r)&&(i=366));d=e/i,u=t/i;break;case 2:d=e/360,u=t/360;break;case 3:d=e/365,u=t/365;break;case 4:31===s&&(s=30),31===r&&(r=30),d=c+(30*a+s)/360,u=h+(30*l+r)/360}return u-d}function Ie(e){return'"'===e[0]&&(e=e.slice(1)),'"'===e[e.length-1]&&"\\"!==e[e.length-2]?e.slice(0,e.length-1):e}function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ae(e){const t=Array.isArray(e)?[]:{};switch(typeof e){case"object":if(null===e)return e;if(function(e){return"clone"in e&&e.clone instanceof Function}(e))return e.clone();if(!(function(e){return"object"==typeof e&&(null==e?void 0:e.constructor)===Object}(e)||e instanceof Array))throw new Error("Unsupported type: only objects and arrays are supported");for(const i in e)t[i]=Ae(e[i]);return t;case"number":case"string":case"boolean":case"function":case"undefined":return e;default:throw new Error("Unsupported type: "+typeof e)}}function Oe(e){return e.startsWith("'")&&(e=e.slice(1,-1).replace(/''/g,"'")),e}function Ne(e){var t;return(null===(t=e.match(/\w/g))||void 0===t?void 0:t.length)!==e.length&&(e=`'${e}'`),e}function Me(e,t,i){return e<t?t:e>i?i:e}function _e(e,t,i){const o=De(i);if(Fe[o]||(Fe[o]={}),void 0===Fe[o][t]){e.save(),e.font=o;const i=e.measureText(t).width;e.restore(),Fe[o][t]=i}return Fe[o][t]}const Fe={};function De(e){return`${e.italic?"italic ":""}${e.bold?"bold":W} ${ke(e)}px ${q}`}function ke(e){const t=e.fontSize||G;if(!re[t])throw new Error("Size of the font is not supported");return re[t]}function $e(e,t,i=1){if(t<=e&&i>0)return[];if(0===i)throw new Error("range() step must not be zero");const o=Math.ceil(Math.abs((t-e)/i)),n=Array(o);for(let t=0;t<o;t++)n[t]=e+t*i;return n}function Le(e){return e.reduce(((e,t,i,o)=>{if(1===Math.abs(t-o[i-1])){e[e.length-1].push(t)}else e.push([t]);return e}),[])}function*Pe(e,t){t.next();for(const i of e){const e=t.next();yield{...i,next:e.done?void 0:e.value}}}function Ue(e){const t=e.toUpperCase();return"TRUE"===t||"FALSE"===t}function Ve(e){return null!==ve(e)}const ze=/^\[(.+)\]\((.+)\)$/,Be=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;function He(e){return ze.test(e)}function We(e,t){return`[${e}](${t})`}function Ge(e){const t=e.match(ze)||[],i=t[1],o=t[2];if(!i||!o)throw new Error(`Could not parse markdown link ${e}.`);return{label:i,url:o}}const qe="o-spreadsheet://";function Ze(e){if(!He(e))return!1;const{url:t}=Ge(e);return t.startsWith(qe)}function je(e){return`${qe}${e}`}function Ye(e){if(e.startsWith(qe))return e.substr(qe.length);throw new Error(`${e} is not a valid sheet link`)}function Xe(e){return void 0!==e}function Ke(e){return void 0!==e&&""!==e}function Qe(e){return void 0===e||Object.values(e).every((e=>"object"==typeof e?Qe(e):!e))}function Je(e,t){for(let[i,o]of Object.entries(t))if(nt(o,e))return parseInt(i,10);const i=Object.keys(t),o=0===i.length?0:lt(i.map((e=>parseInt(e,10))));return t[o+1]=e,o+1}function et(e){let t="";for(let i=0,o=e.length;i<o;i++)t+=e[i];return t}function tt(e){let t,i=!1;const o=()=>(i||(t=e instanceof Function?e():e,i=!0),t);return o.map=e=>tt((()=>e(o()))),o}function it(e,t){let i=e.slice(t).find((e=>e));return i||(i=e.slice(0,t).reverse().find((e=>e))),i||""}function ot(e,t){return"after"===e?t+1:t}function nt(e,t){if(e===t)return!0;if(e&&!t||t&&!e)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;const i=new Set;Object.keys(e).forEach((e=>i.add(e))),Object.keys(t).forEach((e=>i.add(e)));for(let o of i){if(typeof e[o]!=typeof e[o])return!1;if("object"==typeof e[o]){if(!nt(e[o],t[o]))return!1}else if(e[o]!==t[o])return!1}return!0}function st(e,t){if(e.length<t.length)return!1;const i=new Set(e);return t.every((e=>i.has(e)))}function rt(e){const t={...e};return Object.keys(t).forEach((e=>!t[e]&&delete t[e])),t}function at(e){return e?e.toLowerCase():""}function lt(e){let t=e.length;if(t<1e5)return Math.max(...e);let i=-1/0;for(;t--;)i=e[t]>i?e[t]:i;return i}function ct(e){let t=e.length;if(t<1e5)return Math.min(...e);let i=1/0;for(;t--;)i=e[t]<i?e[t]:i;return i}const ht=/rgba?\(|\s+|\)/gi,dt=/^#([A-F\d]{2}){3,4}$/g,ut=["#eb6d00","#0074d9","#ad8e00","#169ed4","#b10dc9","#00a82d","#00a3a3","#f012be","#3d9970","#111111","#62A300","#ff4136","#949494","#85144b","#001f3f"];function gt(e){return mt(e.toString(16).padStart(6,"0"))}let pt=0;function mt(e){let t=e;if(e.startsWith("rgb")?t=function(e){const t=e.replace(ht,"").split(",");let i=255;if(3!==t.length&&4!==t.length)throw new Error("invalid color");if(4===t.length){const e=parseFloat(t.pop()||"1");i=Math.round(255*(e||1))}const o=t.map((e=>parseInt(e,10)));255!==i&&o.push(i);return"#"+et(o.map((e=>e.toString(16).padStart(2,"0")))).toUpperCase()}(e):(t=e.replace("#","").toUpperCase(),3!==t.length&&4!==t.length||(t=t.split("").reduce(((e,t)=>e+t+t),"")),t=`#${t}`),!t.match(dt))throw new Error(`invalid color input: ${e}`);return t}function ft(e){try{return mt(e),!0}catch(e){return!1}}const vt=e=>e>=0&&e<=255;function bt(e,t,i,o=1){if(!vt(e)||!vt(t)||!vt(i)||o<0||o>1)throw new Error(`Invalid RGBA values ${[e,t,i,o]}`);return{a:o,b:i,g:t,r:e}}function St(e){let{r:t,g:i,b:o}=Et(e);t/=255,i/=255,o/=255;const n=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return.2126*n(t)+.7152*n(i)+.0722*n(o)}function Ct(e){let t=e.r.toString(16),i=e.g.toString(16),o=e.b.toString(16),n=Math.round(255*e.a).toString(16);return 1==t.length&&(t="0"+t),1==i.length&&(i="0"+i),1==o.length&&(o="0"+o),1==n.length&&(n="0"+n),"ff"===n&&(n=""),("#"+t+i+o+n).toUpperCase()}function Et(e){let t,i,o,n;if(7===(e=mt(e)).length)t=parseInt(e[1]+e[2],16),i=parseInt(e[3]+e[4],16),o=parseInt(e[5]+e[6],16),n=255;else{if(9!==e.length)throw new Error("Invalid color");t=parseInt(e[1]+e[2],16),i=parseInt(e[3]+e[4],16),o=parseInt(e[5]+e[6],16),n=parseInt(e[7]+e[8],16)}return n=+(n/255).toFixed(3),{a:n,r:t,g:i,b:o}}function wt(e){(e={...e}).s/=100,e.l/=100;let t=(1-Math.abs(2*e.l-1))*e.s,i=t*(1-Math.abs(e.h/60%2-1)),o=e.l-t/2,n=0,s=0,r=0;return 0<=e.h&&e.h<60?(n=t,s=i,r=0):60<=e.h&&e.h<120?(n=i,s=t,r=0):120<=e.h&&e.h<180?(n=0,s=t,r=i):180<=e.h&&e.h<240?(n=0,s=i,r=t):240<=e.h&&e.h<300?(n=i,s=0,r=t):300<=e.h&&e.h<360&&(n=t,s=0,r=i),n=Math.round(255*(n+o)),s=Math.round(255*(s+o)),r=Math.round(255*(r+o)),{a:e.a,r:n,g:s,b:r}}function yt(e){const t=e.r/255,i=e.g/255,o=e.b/255;let n=Math.min(t,i,o),s=Math.max(t,i,o),r=s-n,a=0,l=0,c=0;return a=0==r?0:s==t?(i-o)/r%6:s==i?(o-t)/r+2:(t-i)/r+4,a=Math.round(60*a),a<0&&(a+=360),c=(s+n)/2,l=0==r?0:r/(1-Math.abs(2*c-1)),l=+(100*l).toFixed(1),c=+(100*c).toFixed(1),{a:e.a,h:a,s:l,l:c}}const xt=new RegExp(/\$?([A-Z]{1,3})\$?([0-9]{1,7})/,"i"),Rt=new RegExp(/^\$?([A-Z]{1,3})\$?([0-9]{1,7})$/,"i"),It=new RegExp(/^\$?([A-Z]{1,3})+$/,"i"),Tt=new RegExp(/^\$?([0-9]{1,7})+$/,"i"),At=new RegExp(/^\s*('.+'!|[^']+!)?\$?([A-Z]{1,3})$/,"i"),Ot=new RegExp(/^\s*('.+'!|[^']+!)?\$?([0-9]{1,7})$/,"i"),Nt=new RegExp(/^\s*('.+'!|[^']+!)?/.source+"("+[xt.source,/(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*:\s*(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*/i.source,/\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*:\s*\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*/i.source].join("|")+")"+/$/.source,"i");function Mt(e){return At.test(e)}function _t(e){return Ot.test(e)}function Ft(e){return It.test(e)}function Dt(e){return Tt.test(e)}function kt(e){return Rt.test(e)}function $t(e){const t=e.split("!"),i=t.pop();return{sheetName:Oe(t.join("!"))||void 0,xc:i}}function Lt(e){if(e<0)throw new Error(`number must be positive. Got ${e}`);return e<26?String.fromCharCode(65+e):Lt(Math.floor(e/26)-1)+Lt(e%26)}function Pt(e){let t=0;const i=e.length;for(let o=0;o<i;o++){t+=(e.charCodeAt(o)-65+(o<i-1?1:0))*26**(i-o-1)}return t}function Ut(e){const t=(e=e.toUpperCase().trim()).match(xt);if(null!==t){const[i,o,n]=t;if(i===e){return{col:Pt(o),row:parseInt(n,10)-1}}}throw new Error(`Invalid cell description: ${e}`)}function Vt(e,t,i={colFixed:!1,rowFixed:!1}){return(i.colFixed?"$":"")+Lt(e)+(i.rowFixed?"$":"")+String(t+1)}const zt=140,Bt=20,Ht=.035;function Wt(e){return Bt+(zt-Bt)*Math.exp(-Ht*(e-1))}const Gt=20,qt=/(\d+?)(?=(\d{3})+(?!\d)|$)/g,Zt=/0/g,jt={0:s("January"),1:s("February"),2:s("March"),3:s("April"),4:s("May"),5:s("June"),6:s("July"),7:s("August"),8:s("September"),9:s("October"),10:s("November"),11:s("December")},Yt={0:s("Sunday"),1:s("Monday"),2:s("Tuesday"),3:s("Wednesday"),4:s("Thursday"),5:s("Friday"),6:s("Saturday")},Xt={};function Kt(e){let t=Xt[e];return void 0===t&&(t=function(e){if(""===e)throw new Error("A format cannot be empty");let t=0,i=[];for(;t<e.length;){let o;if("["===e.charAt(t)){if("$"!==e.charAt(t+1))throw new Error(`Currency formats have to be prefixed by a $: ${e}`);if(o=e.substring(t+1).indexOf("]")+t+2,0===o)throw new Error(`Invalid currency brackets format: ${e}`);const n=e.substring(t+2,o-1);if(n.includes("["))throw new Error(`Invalid currency format: ${e}`);i.push({type:"STRING",format:n})}else{const n=e.substring(t).indexOf("[");o=n>-1?n+t:e.length;const s=e.substring(t,o);s.match(Y)?i.push({type:"DATE",format:s}):i.push({type:"NUMBER",format:di(s)})}t=o}return i}(e),Xt[e]=t),t}function Qt(e,t){switch(typeof e){case"string":return e.includes('\\"')?e.replace(/\\"/g,'"'):e;case"boolean":return e?"TRUE":"FALSE";case"number":t||(t=ai(e));return function(e,t){if("DATE"===t[0].type)return ni(e,t[0].format);let i=e<0?"-":"";for(let o of t)switch(o.type){case"NUMBER":i+=Jt(Math.abs(e),o.format);break;case"STRING":i+=o.format}return i}(e,Kt(t));case"object":return"0"}}function Jt(e,t){t.isPercent&&(e*=100),e/=t.magnitude;let i=0;void 0!==t.decimalPart&&(i=t.decimalPart.length);const{integerDigits:o,decimalDigits:n}=ti(e,i);let s=function(e,t,i){var o;const n="0"===e?"":e;let s=n;const r=t.length-n.length;if(r>0){const e=(t.substring(0,r).match(Zt)||[]).length;s="0".repeat(e)+s}i&&(s=(null===(o=s.match(qt))||void 0===o?void 0:o.join(","))||s);return s}(o,t.integerPart,t.thousandsSeparator);return void 0!==t.decimalPart&&(s+="."+function(e,t){let i=e;if(t.length-e.length>0){const o=(t.substring(e.length,t.length+1).match(Zt)||[]).length;i+="0".repeat(o)}return i}(n||"",t.decimalPart)),t.isPercent&&(s+="%"),s}const ei=[];function ti(e,t=Gt){const i=e.toString();if(i.includes("e"))return function(e,t=Gt){let i=ei[t];i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),ei[t]=i);const[o,n]=i.format(e).split(".");return{integerDigits:o,decimalDigits:n}}(e,t);if(Number.isInteger(e))return{integerDigits:i,decimalDigits:void 0};const o=i.indexOf(".");let n=i.substring(0,o),s=i.substring(o+1);if(0===t)return Number(s[0])>=5&&(n=(Number(n)+1).toString()),{integerDigits:n,decimalDigits:void 0};if(s.length>t){const{integerDigits:e,decimalDigits:i}=function(e,t){var i;let o="0",n=e,s=e.slice(0,t);const r=t;if(Number(e[r])<5)return{integerDigits:o,decimalDigits:s};const a=(null===(i=s.match(oi))||void 0===i?void 0:i[0])||"",l=(Number(s)+1).toString(),c=s.slice(a.length),h=l.length>c.length;h&&!a?(o="1",n=void 0):n=h?a.slice(0,-1)+l:a+l;return{integerDigits:o,decimalDigits:n}}(s,t);s=i,"0"!==e&&(n=(Number(n)+Number(e)).toString())}return{integerDigits:n,decimalDigits:ii(s||"")}}function ii(e){let t=e.length-1;for(;t>=0&&"0"===e[t];)t--;return e.slice(0,t+1)||void 0}const oi=/^0+/;function ni(e,t){const i=Se(e),o=t.indexOf("h");let n="",s="";return o>0?(n=si(i,t.substring(0,o-1)),s=ri(i,t.substring(o))):0===o?s=ri(i,t):o<0&&(n=si(i,t)),n+(n&&s?" ":"")+s}function si(e,t){var i;const o=null===(i=t.match(/\/|-|\s/))||void 0===i?void 0:i[0];return(o?t.split(o):[t]).map((i=>{switch(i){case"d":return e.getDate();case"dd":return e.getDate().toString().padStart(2,"0");case"ddd":return Yt[e.getDay()].slice(0,3);case"dddd":return Yt[e.getDay()];case"m":return e.getMonth()+1;case"mm":return String(e.getMonth()+1).padStart(2,"0");case"mmm":return jt[e.getMonth()].slice(0,3);case"mmmm":return jt[e.getMonth()];case"mmmmm":return jt[e.getMonth()].slice(0,1);case"yy":const i=String(e.getFullYear()).replace("-","").padStart(2,"0");return i.slice(i.length-2);case"yyyy":return e.getFullYear();default:throw new Error(`invalid format: ${t}`)}})).join(o)}function ri(e,t){let i=t.split(/:|\s/);const o=e.getHours(),n="a"===i[i.length-1];let s=o,r="";return n&&(s=0===s?12:s>12?s-12:s,r=o>=12?" PM":" AM",i.pop()),i.map((i=>{switch(i){case"hhhh":return Math.floor((e.getTime()-le.getTime())/36e5).toString();case"hh":return s.toString().padStart(2,"0");case"mm":return e.getMinutes().toString().padStart(2,"0");case"ss":return e.getSeconds().toString().padStart(2,"0");default:throw new Error(`invalid format: ${t}`)}})).join(":")+r}function ai(e){let{decimalDigits:t}=ti(e,10);return t?"0."+"0".repeat(t.length):"0"}function li(e,t,i){const o=Kt(e||"#,##0"),n=[];for(let e=0;e<o.length;e++){const s=o[e];if("NUMBER"!==s.type){n.push(s);continue}n.push({...s,format:{...s.format,magnitude:t,decimalPart:void 0}}),n.push({type:"STRING",format:i});const r=o[e+1];"STRING"===(null==r?void 0:r.type)&&["k","m","b"].includes(r.format)&&e++}return gi(n)}function ci(e,t){var i;const o={...e},n=Math.sign(t),s=(null===(i=o.decimalPart)||void 0===i?void 0:i.length)||0,r=Math.min(Math.max(0,s+n),Gt);return o.decimalPart="0".repeat(r),""===o.decimalPart&&delete o.decimalPart,o}const hi=/,*?$/;function di(e){var t;if(function(e){return Boolean(e.replace(ui,""))}(e=e.trim()))throw new Error(`Invalid number format: ${e}`);const i=e.includes("%"),o=(null===(t=e.match(hi))||void 0===t?void 0:t[0])||"",n=o?1e3**o.length:1;let s=e.slice(0,e.length-(o.length||0));const r=s.includes(",");if(s.match(/\..*,/))throw new Error("A format can't contain ',' symbol in the decimal part");s=s.replace("%","").replace(",","");const a=s.match(/[\%|,]/);if(a)throw new Error(`A format can only contain a single '${a[0]}' symbol`);const[l,c]=s.split(".");if(c&&c.length>20)throw new Error("A format can't contain more than 20 decimal places");return void 0!==c?{integerPart:l,isPercent:i,thousandsSeparator:r,decimalPart:c,magnitude:n}:{integerPart:l,isPercent:i,thousandsSeparator:r,magnitude:n}}const ui=/[,#0.%]/g;function gi(e){let t="";for(let i of e){let e;switch(i.type){case"NUMBER":const t=i.format;e=t.integerPart,t.thousandsSeparator&&(e=e.slice(0,-3)+","+e.slice(-3)),void 0!==t.decimalPart&&(e+="."+t.decimalPart),t.isPercent&&(e+="%"),t.magnitude&&(e+=",".repeat(Math.log10(t.magnitude)/3));break;case"STRING":e=`[$${i.format}]`;break;case"DATE":e=i.format}t+=e}return t}const pi=/(^-?\d+(\.?\d*(e\d+)?)?|^-?\.\d+)(?!\w|!)/,mi="(\\s*(\\d+(,\\d{3,})*(\\.\\d*)?)|(\\.\\d+))(e(\\+|-)?\\d+)?(\\s*%)?",fi="(\\s*-)?",vi="(\\s*[\\$€])?",bi="^(("+[fi+vi+mi,fi+mi+vi,vi+fi+mi].join(")|(")+"))$",Si=new RegExp(bi,"i");function Ci(e){return!!e&&Si.test(e.trim())}const Ei=/[,\$€]+/g;function wi(e){e=e.replace(Ei,"");let t=Number(e);return isNaN(t)&&e.includes("%")&&(t=Number(e.split("%")[0]),!isNaN(t))?t/100:t}function yi(e,t,i){const o=[...e].sort(((e,t)=>e-t));let n=(o.length+(i?-1:1))*t;if(i||n--,Number.isInteger(n))return o[n];const s=Math.ceil(n),r=Math.floor(n);return o[s]*(n-r)+o[r]*(s-n)}class xi{constructor(e,t){this.getSheetSize=t,this.prefixSheet=!1,this._zone=e.zone,this.parts=e.parts,this.prefixSheet=e.prefixSheet,this.invalidXc=e.invalidXc,this.sheetId=e.sheetId,this.invalidSheetName=e.invalidSheetName}static fromRange(e,t){return e instanceof xi?e:new xi(e,t.getSheetSize)}get unboundedZone(){return this._zone}get zone(){const{left:e,top:t,bottom:i,right:o}=this._zone;if(void 0!==o&&void 0!==i)return this._zone;if(void 0===i&&void 0!==o)return{right:o,top:t,left:e,bottom:this.getSheetSize(this.sheetId).height-1};if(void 0===o&&void 0!==i)return{bottom:i,left:e,top:t,right:this.getSheetSize(this.sheetId).width-1};throw new Error(s("Bad zone format"))}static getRangeParts(e,t){const i=e.split(":").map((e=>{const t=_t(e);return{colFixed:!t&&e.startsWith("$"),rowFixed:t?e.startsWith("$"):e.includes("$",1)}})),o=void 0===t.bottom,n=void 0===t.right;return o&&(i[0].rowFixed=i[0].rowFixed||i[1].rowFixed,i[1].rowFixed=i[0].rowFixed||i[1].rowFixed),n&&(i[0].colFixed=i[0].colFixed||i[1].colFixed,i[1].colFixed=i[0].colFixed||i[1].colFixed),i}get isFullCol(){return void 0===this._zone.bottom}get isFullRow(){return void 0===this._zone.right}get rangeData(){return{_zone:this._zone,_sheetId:this.sheetId}}orderZone(){if(void 0!==this._zone.right&&this._zone.right<this._zone.left){let e=this._zone.right;this._zone.right=this._zone.left,this._zone.left=e;let t=this.parts[1].colFixed;this.parts[1].colFixed=this.parts[0].colFixed,this.parts[0].colFixed=t}if(void 0!==this._zone.bottom&&this._zone.bottom<this._zone.top){let e=this._zone.bottom;this._zone.bottom=this._zone.top,this._zone.top=e;let t=this.parts[1].rowFixed;this.parts[1].rowFixed=this.parts[0].rowFixed,this.parts[0].rowFixed=t}}clone(e){return new xi({zone:(null==e?void 0:e.zone)?e.zone:{...this._zone},sheetId:(null==e?void 0:e.sheetId)?e.sheetId:this.sheetId,invalidSheetName:e&&"invalidSheetName"in e?e.invalidSheetName:this.invalidSheetName,invalidXc:e&&"invalidXc"in e?e.invalidXc:this.invalidXc,parts:(null==e?void 0:e.parts)?e.parts:this.parts.map((e=>({rowFixed:e.rowFixed,colFixed:e.colFixed}))),prefixSheet:(null==e?void 0:e.prefixSheet)?e.prefixSheet:this.prefixSheet},this.getSheetSize)}}function Ri(e,t,i){const o=i.sheetId===e?t:i.sheetId;return i.clone({sheetId:o})}function Ii(e,t,i){if(!i)return;const o=e.getRangeFromSheetXC(t,i);return o.invalidSheetName||o.invalidXc?void 0:o}function Ti(e){const t=[];for(let i=0;i<e;i++){const e={cells:{}};t.push(e)}return t}class Ai{constructor(){this.isFastIdStrategy=!1,this.fastIdStart=0}setIsFastStrategy(e){this.isFastIdStrategy=e}smallUuid(){return this.isFastIdStrategy?(this.fastIdStart++,String(this.fastIdStart)):window.crypto&&window.crypto.getRandomValues?([1e7]+-1e3).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):"xxxxxxxx-xxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}uuidv4(){return this.isFastIdStrategy?(this.fastIdStart++,String(this.fastIdStart)):window.crypto&&window.crypto.getRandomValues?([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}}function Oi(e){const t=function(e){const t=(e=e.split("!").pop()).replace(/\$/g,"").split(":").map((e=>e.trim()));let i,o,n,s,r=!1,a=!1,l=!1;const c=t[0],h=t[1]&&t[1];if(Mt(c))n=s=Pt(c),i=o=0,r=!0;else if(_t(c))i=o=parseInt(c,10)-1,n=s=0,a=!0;else{const e=Ut(c);n=s=e.col,i=o=e.row,l=!0}if(2===t.length)if(Mt(h))s=Pt(h),r=!0;else if(_t(h))o=parseInt(h,10)-1,a=!0;else{const e=Ut(h);s=e.col,o=e.row,i=r?o:i,n=a?s:n,l=!0}if(r&&a)throw new Error("Wrong zone xc. The zone cannot be at the same time a full column and a full row");const d={top:i,left:n,bottom:r?void 0:o,right:a?void 0:s};return l=l&&(a||r),l&&(d.hasHeader=l),d}(e);return function(e){if(void 0!==e.right&&e.right<e.left){const t=e.left;e.left=e.right,e.right=t}if(void 0!==e.bottom&&e.bottom<e.top){const t=e.top;e.top=e.bottom,e.bottom=t}}(t),t}function Ni(e){const t=Oi(e);if(void 0===t.bottom||void 0===t.right)throw new Error("This does not support unbounded ranges");return t}function Mi(e){const{bottom:t,top:i,left:o,right:n}=e;return!(void 0!==t&&isNaN(t)||isNaN(i)||isNaN(o)||void 0!==n&&isNaN(n))&&((void 0===e.bottom||e.bottom>=e.top&&e.bottom>=0)&&(void 0===e.right||e.right>=e.left&&e.right>=0)&&e.top>=0&&e.left>=0)}function _i(e){const{top:t,bottom:i,left:o,right:n}=e,r="hasHeader"in e&&e.hasHeader,a=t===i&&o===n;if(void 0===i&&void 0!==n)return 0!==t||r?`${Vt(o,t)}:${Lt(n)}`:`${Lt(o)}:${Lt(n)}`;if(void 0===n&&void 0!==i)return 0!==o||r?`${Vt(o,t)}:${i+1}`:`${t+1}:${i+1}`;if(void 0!==i&&void 0!==n)return a?Vt(o,t):`${Vt(o,t)}:${Vt(n,i)}`;throw new Error(s("Bad zone format"))}function Fi(e,t,i,o,n){const s="left"===t?"columns":"rows",r="before"===o?i-1:i,a=e["left"===t?"right":"bottom"];return e[t]<=r&&a&&a>r?ji(e,s,"RESIZE",n):r<e[t]?ji(e,s,"MOVE",n):{...e}}function Di(e,t,i,o,n){const s="left"===t?"columns":"rows",r="before"===o?i-1:i,a="left"===t?"right":"bottom";return e[t]<=r&&e[a]>r?ji(e,s,"RESIZE",n):r<e[t]?ji(e,s,"MOVE",n):{...e}}function ki(e,t,i){const o="left"===t?"right":"bottom";let n=e[t],s=e[o];for(let r of i.sort(((e,t)=>t-e)))e[t]>r&&(n--,s--),e[t]<r&&e[o]>=r&&s--;return{...e,[t]:n,[o]:s}}function $i(e,t,i){const o="left"===t?"right":"bottom";let n=e[t],s=e[o];const r=e[o];for(let o of i.sort(((e,t)=>t-e)))e[t]>o&&(n--,void 0!==s&&s--),void 0!==r&&void 0!==s&&e[t]<=o&&r>=o&&s--;if(!(void 0!==s&&n>s))return{...e,[t]:n,[o]:s}}function Li(...e){return{top:Math.min(...e.map((e=>e.top))),left:Math.min(...e.map((e=>e.left))),bottom:Math.max(...e.map((e=>e.bottom))),right:Math.max(...e.map((e=>e.right)))}}function Pi(e,t){if(Vi(e,t))return{top:Math.max(e.top,t.top),left:Math.max(e.left,t.left),bottom:Math.min(e.bottom,t.bottom),right:Math.min(e.right,t.right)}}function Ui(e,t){return e.left===t.left&&e.right===t.right&&e.top===t.top&&e.bottom===t.bottom}function Vi(e,t){return!(e.bottom<t.top||t.bottom<e.top)&&!(e.right<t.left||t.right<e.left)}function zi(e,t,i){const{left:o,right:n,top:s,bottom:r}=i;return e>=o&&e<=n&&t>=s&&t<=r}function Bi(e,t){return Ui(Li(t,e),t)}function Hi(e,t){const i=e.map(Oi),o=t.map(Ni),n=Math.max(...i.concat(o).map((e=>e.bottom||0))),s=Math.max(...i.concat(o).map((e=>e.right||0))),r=i.map((e=>({...e,bottom:void 0===e.bottom?n+1:e.bottom,right:void 0===e.right?s+1:e.right}))),a=o.map((e=>({...e,bottom:void 0===e.bottom?n+1:e.bottom,right:void 0===e.right?s+1:e.right}))),l=function(e,t){const i=new Set(t.map((({col:e,row:t})=>`${e}-${t}`)));return e.filter((({col:e,row:t})=>!i.has(`${e}-${t}`)))}(r.map(Zi).flat(),a.map(Zi).flat()),c=function(e){if(0===e.length)return[];const[t,...i]=[...e].sort(((e,t)=>e.row-t.row)).sort(((e,t)=>e.col-t.col)),o=[];let n=Ki(t);for(const{col:e,row:t}of i)if(!zi(e,t,n))if(e===n.left&&t===n.bottom+1){const e=n.bottom+1;n={...n,bottom:e}}else o.push(n),n=Ki({col:e,row:t});return[...o,n]}(l);return function(e){if(0===e.length)return[];if(e.some((e=>e.left!==e.right)))throw new Error("only columns can be merged");const t=[],i=Wi(e),o=(e,t)=>e.top===t.top&&e.bottom===t.bottom&&e.right+1===t.left;for(;i.length;){const e=i.reduce(((e,t)=>o(e,t)?Li(e,t):e),i.shift());t.push(e)}return Wi(t)}(c).map((e=>({...e,bottom:e.bottom===n+1?void 0:e.bottom,right:e.right===s+1?void 0:e.right}))).map(_i)}function Wi(e){const t=[...e].sort(((e,t)=>t.right-e.right)).sort(((e,t)=>t.bottom-e.bottom)).sort(((e,t)=>e.top-t.top)).sort(((e,t)=>e.left-t.left)).reverse(),i=[];for(;0!==t.length;){const e=t.shift();t.some((t=>Bi(e,t)))||i.push(e)}return i.reverse()}function Gi(e){return{height:e.bottom-e.top+1,width:e.right-e.left+1}}function qi(e){const{width:t,height:i}=Gi(e);return 1===t||1===i}function Zi(e){const t=[],[i,o]=[e.right,e.left].sort(((e,t)=>e-t)),[n,s]=[e.top,e.bottom].sort(((e,t)=>e-t));for(const e of $e(i,o+1))for(const i of $e(n,s+1))t.push({col:e,row:i});return t}function ji(e,t,i,o){const n="both"===t?o[0]:"columns"===t?o:0,s="both"===t?o[1]:"rows"===t?o:0,r="hasHeader"in e&&e.hasHeader;let a;a=!function(e){return void 0===e.bottom}(e)||r?!(Qi(e)&&!r)||"columns"!==t:"rows"!==t;const l={...e};return a&&"MOVE"===i&&(l.left+=n,l.top+=s),void 0!==l.right&&(l.right+=n),void 0!==l.bottom&&(l.bottom+=s),l}function Yi(e,t){let i,o;const{left:n,right:s,top:r,bottom:a}=e,{left:l,right:c,top:h,bottom:d}=t;return i=l!=n?l:c!=s?c:l,o=h!=r?h:d!=a?d:h,{col:i,row:o}}function Xi(e){return{top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom),left:Math.min(e.left,e.right),right:Math.max(e.left,e.right)}}function Ki(e){return{left:e.col,right:e.col,top:e.row,bottom:e.row}}function Qi(e){return void 0===e.right}function Ji(e){return(e.bottom-e.top+1)*(e.right-e.left+1)}function eo(...e){return e.length<2||1===Hi(e.map(_i),[]).length}class to{constructor(){this.content={}}add(e,t){return this.content[e]=t,this}get(e){const t=this.content[e];if(!t&&!(e in this.content))throw new Error(`Cannot find ${e} in this registry!`);return t}contains(e){return e in this.content}getAll(){return Object.values(this.content)}getKeys(){return Object.keys(this.content)}remove(e){delete this.content[e]}}const io=new to,oo=new to;class no extends t.Component{constructor(){super(...arguments),this.canvas=t.useRef("graphContainer")}get background(){return this.chartRuntime.background}get canvasStyle(){return`background-color: ${this.background}`}get chartRuntime(){const e=this.env.model.getters.getChartRuntime(this.props.figure.id);if(!("chartJsConfig"in e))throw new Error("Unsupported chart runtime");return e}setup(){t.onMounted((()=>{const e=this.chartRuntime;this.createChart(e.chartJsConfig)}));let e=this.chartRuntime;t.onPatched((()=>{const t=this.chartRuntime;nt(e,t)||(this.updateChartJs(t),e=t)}))}createChart(e){const t=this.canvas.el.getContext("2d");this.chart=new window.Chart(t,e)}updateChartJs(e){var t,i,o,n;const s=e.chartJsConfig;s.data&&s.data.datasets?(this.chart.data=s.data,(null===(t=s.options)||void 0===t?void 0:t.title)&&(this.chart.config.options.title=s.options.title),s.options&&"valueLabel"in s.options&&(null===(i=s.options)||void 0===i?void 0:i.valueLabel)&&(this.chart.config.options.valueLabel=s.options.valueLabel)):this.chart.data.datasets=void 0,this.chart.config.options.legend=null===(o=s.options)||void 0===o?void 0:o.legend,this.chart.config.options.scales=null===(n=s.options)||void 0===n?void 0:n.scales,this.chart.update({duration:0})}}no.template="o-spreadsheet-ChartJsComponent",oo.add("line",no),oo.add("bar",no),oo.add("pie",no),oo.add("gauge",no);const so=new to;var ro;so.add("INCREMENT_MODIFIER",{apply:(e,t)=>{var i;e.current+=e.increment;const o=e.current.toString(),n=Qt(e.current,null===(i=t.cell)||void 0===i?void 0:i.format);return{cellData:{border:t.border,style:t.cell&&t.cell.style,format:t.cell&&t.cell.format,content:o},tooltip:o?{props:{content:n}}:void 0}}}).add("COPY_MODIFIER",{apply:(e,t,i)=>{var o,n;const s=(null===(o=t.cell)||void 0===o?void 0:o.content)||"";return{cellData:{border:t.border,style:t.cell&&t.cell.style,format:t.cell&&t.cell.format,content:s},tooltip:s?{props:{content:null===(n=t.cell)||void 0===n?void 0:n.formattedValue}}:void 0}}}).add("FORMULA_MODIFIER",{apply:(e,t,i,o)=>{e.current+=e.increment;let n=0,s=0;switch(o){case"up":n=0,s=-e.current;break;case"down":n=0,s=e.current;break;case"left":n=-e.current,s=0;break;case"right":n=e.current,s=0}if(!t.cell||!t.cell.isFormula())return{cellData:{}};const r=t.sheetId,a=i.createAdaptedRanges(t.cell.dependencies,n,s,r),l=i.buildFormulaContent(r,t.cell,a);return{cellData:{border:t.border,style:t.cell.style,format:t.cell.format,content:l},tooltip:l?{props:{content:l}}:void 0}}}),function(e){e.boolean="boolean",e.number="number",e.text="text",e.empty="empty",e.error="error"}(ro||(ro={}));const ao=new Set(["RENAME_SHEET","DELETE_SHEET","CREATE_SHEET","ADD_COLUMNS_ROWS","REMOVE_COLUMNS_ROWS","DELETE_CELL","INSERT_CELL","UNDO","REDO"]),lo=new Set([...ao,"DUPLICATE_SHEET","EVALUATE_CELLS","ADD_CONDITIONAL_FORMAT","REMOVE_CONDITIONAL_FORMAT","MOVE_CONDITIONAL_FORMAT"]),co=new Set(["START","ACTIVATE_SHEET","COPY","PREPARE_SELECTION_INPUT_EXPANSION","STOP_SELECTION_INPUT","RESIZE_SHEETVIEW","SET_VIEWPORT_OFFSET","SELECT_SEARCH_NEXT_MATCH","SELECT_SEARCH_PREVIOUS_MATCH","UPDATE_SEARCH","CLEAR_SEARCH","EVALUATE_CELLS","SET_CURRENT_CONTENT","SET_FORMULA_VISIBILITY","OPEN_CELL_POPOVER","CLOSE_CELL_POPOVER","UPDATE_FILTER"]),ho=new Set(["UPDATE_CELL","UPDATE_CELL_POSITION","CLEAR_CELL","DELETE_CONTENT","ADD_COLUMNS_ROWS","REMOVE_COLUMNS_ROWS","RESIZE_COLUMNS_ROWS","HIDE_COLUMNS_ROWS","UNHIDE_COLUMNS_ROWS","SET_GRID_LINES_VISIBILITY","UNFREEZE_COLUMNS","UNFREEZE_ROWS","FREEZE_COLUMNS","FREEZE_ROWS","UNFREEZE_COLUMNS_ROWS","ADD_MERGE","REMOVE_MERGE","CREATE_SHEET","DELETE_SHEET","DUPLICATE_SHEET","MOVE_SHEET","RENAME_SHEET","HIDE_SHEET","SHOW_SHEET","MOVE_RANGES","ADD_CONDITIONAL_FORMAT","REMOVE_CONDITIONAL_FORMAT","MOVE_CONDITIONAL_FORMAT","CREATE_FIGURE","DELETE_FIGURE","UPDATE_FIGURE","SET_FORMATTING","CLEAR_FORMATTING","SET_BORDER","CREATE_CHART","UPDATE_CHART","CREATE_FILTER_TABLE","REMOVE_FILTER_TABLE"]);function uo(e){return ho.has(e.type)}class go{constructor(e=[]){Array.isArray(e)||(e=[e]),e=[...new Set(e)],this.reasons=e.filter((e=>0!==e))}static get Success(){return po}get isSuccessful(){return 0===this.reasons.length}isCancelledBecause(e){return this.reasons.includes(e)}}const po=new go;var mo,fo,vo;e.CommandResult=void 0,(mo=e.CommandResult||(e.CommandResult={}))[mo.Success=0]="Success",mo[mo.CancelledForUnknownReason=1]="CancelledForUnknownReason",mo[mo.WillRemoveExistingMerge=2]="WillRemoveExistingMerge",mo[mo.MergeIsDestructive=3]="MergeIsDestructive",mo[mo.CellIsMerged=4]="CellIsMerged",mo[mo.InvalidTarget=5]="InvalidTarget",mo[mo.EmptyUndoStack=6]="EmptyUndoStack",mo[mo.EmptyRedoStack=7]="EmptyRedoStack",mo[mo.NotEnoughElements=8]="NotEnoughElements",mo[mo.NotEnoughSheets=9]="NotEnoughSheets",mo[mo.MissingSheetName=10]="MissingSheetName",mo[mo.DuplicatedSheetName=11]="DuplicatedSheetName",mo[mo.DuplicatedSheetId=12]="DuplicatedSheetId",mo[mo.ForbiddenCharactersInSheetName=13]="ForbiddenCharactersInSheetName",mo[mo.WrongSheetMove=14]="WrongSheetMove",mo[mo.WrongSheetPosition=15]="WrongSheetPosition",mo[mo.InvalidAnchorZone=16]="InvalidAnchorZone",mo[mo.SelectionOutOfBound=17]="SelectionOutOfBound",mo[mo.TargetOutOfSheet=18]="TargetOutOfSheet",mo[mo.WrongCutSelection=19]="WrongCutSelection",mo[mo.WrongPasteSelection=20]="WrongPasteSelection",mo[mo.WrongPasteOption=21]="WrongPasteOption",mo[mo.WrongFigurePasteOption=22]="WrongFigurePasteOption",mo[mo.EmptyClipboard=23]="EmptyClipboard",mo[mo.EmptyRange=24]="EmptyRange",mo[mo.InvalidRange=25]="InvalidRange",mo[mo.InvalidZones=26]="InvalidZones",mo[mo.InvalidSheetId=27]="InvalidSheetId",mo[mo.InvalidCellId=28]="InvalidCellId",mo[mo.InputAlreadyFocused=29]="InputAlreadyFocused",mo[mo.MaximumRangesReached=30]="MaximumRangesReached",mo[mo.InvalidInputId=31]="InvalidInputId",mo[mo.InvalidChartDefinition=32]="InvalidChartDefinition",mo[mo.InvalidDataSet=33]="InvalidDataSet",mo[mo.InvalidLabelRange=34]="InvalidLabelRange",mo[mo.InvalidScorecardKeyValue=35]="InvalidScorecardKeyValue",mo[mo.InvalidScorecardBaseline=36]="InvalidScorecardBaseline",mo[mo.InvalidGaugeDataRange=37]="InvalidGaugeDataRange",mo[mo.EmptyGaugeRangeMin=38]="EmptyGaugeRangeMin",mo[mo.GaugeRangeMinNaN=39]="GaugeRangeMinNaN",mo[mo.EmptyGaugeRangeMax=40]="EmptyGaugeRangeMax",mo[mo.GaugeRangeMaxNaN=41]="GaugeRangeMaxNaN",mo[mo.GaugeRangeMinBiggerThanRangeMax=42]="GaugeRangeMinBiggerThanRangeMax",mo[mo.GaugeLowerInflectionPointNaN=43]="GaugeLowerInflectionPointNaN",mo[mo.GaugeUpperInflectionPointNaN=44]="GaugeUpperInflectionPointNaN",mo[mo.GaugeLowerBiggerThanUpper=45]="GaugeLowerBiggerThanUpper",mo[mo.InvalidAutofillSelection=46]="InvalidAutofillSelection",mo[mo.WrongComposerSelection=47]="WrongComposerSelection",mo[mo.MinBiggerThanMax=48]="MinBiggerThanMax",mo[mo.LowerBiggerThanUpper=49]="LowerBiggerThanUpper",mo[mo.MidBiggerThanMax=50]="MidBiggerThanMax",mo[mo.MinBiggerThanMid=51]="MinBiggerThanMid",mo[mo.FirstArgMissing=52]="FirstArgMissing",mo[mo.SecondArgMissing=53]="SecondArgMissing",mo[mo.MinNaN=54]="MinNaN",mo[mo.MidNaN=55]="MidNaN",mo[mo.MaxNaN=56]="MaxNaN",mo[mo.ValueUpperInflectionNaN=57]="ValueUpperInflectionNaN",mo[mo.ValueLowerInflectionNaN=58]="ValueLowerInflectionNaN",mo[mo.MinInvalidFormula=59]="MinInvalidFormula",mo[mo.MidInvalidFormula=60]="MidInvalidFormula",mo[mo.MaxInvalidFormula=61]="MaxInvalidFormula",mo[mo.ValueUpperInvalidFormula=62]="ValueUpperInvalidFormula",mo[mo.ValueLowerInvalidFormula=63]="ValueLowerInvalidFormula",mo[mo.InvalidSortZone=64]="InvalidSortZone",mo[mo.WaitingSessionConfirmation=65]="WaitingSessionConfirmation",mo[mo.MergeOverlap=66]="MergeOverlap",mo[mo.TooManyHiddenElements=67]="TooManyHiddenElements",mo[mo.Readonly=68]="Readonly",mo[mo.InvalidViewportSize=69]="InvalidViewportSize",mo[mo.InvalidScrollingDirection=70]="InvalidScrollingDirection",mo[mo.FigureDoesNotExist=71]="FigureDoesNotExist",mo[mo.InvalidConditionalFormatId=72]="InvalidConditionalFormatId",mo[mo.InvalidCellPopover=73]="InvalidCellPopover",mo[mo.EmptyTarget=74]="EmptyTarget",mo[mo.InvalidFreezeQuantity=75]="InvalidFreezeQuantity",mo[mo.FrozenPaneOverlap=76]="FrozenPaneOverlap",mo[mo.ValuesNotChanged=77]="ValuesNotChanged",mo[mo.InvalidFilterZone=78]="InvalidFilterZone",mo[mo.FilterOverlap=79]="FilterOverlap",mo[mo.FilterNotFound=80]="FilterNotFound",mo[mo.MergeInFilter=81]="MergeInFilter",mo[mo.NonContinuousTargets=82]="NonContinuousTargets",mo[mo.DuplicatedFigureId=83]="DuplicatedFigureId",mo[mo.InvalidSelectionStep=84]="InvalidSelectionStep",mo[mo.DuplicatedChartId=85]="DuplicatedChartId",mo[mo.ChartDoesNotExist=86]="ChartDoesNotExist",mo[mo.InvalidHeaderIndex=87]="InvalidHeaderIndex",mo[mo.InvalidQuantity=88]="InvalidQuantity",mo[mo.NoChanges=89]="NoChanges",function(e){e.UP="up",e.DOWN="down",e.LEFT="left",e.RIGHT="right"}(fo||(fo={})),function(e){e[e.Background=0]="Background",e[e.Highlights=1]="Highlights",e[e.Clipboard=2]="Clipboard",e[e.Search=3]="Search",e[e.Chart=4]="Chart",e[e.Selection=5]="Selection",e[e.Autofill=6]="Autofill",e[e.Headers=7]="Headers"}(vo||(vo={}));const bo=new to;bo.add("simple_value_copy",{condition:(e,t)=>{var i;return 1===t.length&&!e.isFormula()&&!(null===(i=e.format)||void 0===i?void 0:i.match(Y))},generateRule:()=>({type:"COPY_MODIFIER"}),sequence:10}).add("copy_text",{condition:e=>!e.isFormula()&&e.evaluated.type===ro.text,generateRule:()=>({type:"COPY_MODIFIER"}),sequence:20}).add("update_formula",{condition:e=>e.isFormula(),generateRule:(e,t)=>({type:"FORMULA_MODIFIER",increment:t.length,current:0}),sequence:30}).add("increment_number",{condition:e=>e.evaluated.type===ro.number,generateRule:(e,t)=>{const i=function(e,t){let i=[],o=!1;for(let n of t)if(n===e&&(o=!0),(null==n?void 0:n.evaluated.type)===ro.number)i.push(n.evaluated.value);else{if(o)return i;i=[]}return i}(e,t);let o=1;return 2==i.length?o=2*(i[1]-i[0]):i.length>2&&(o=function(e){const t=[];let i=e[0];for(let o=1;o<e.length;o++){const n=e[o];t.push(n-i),i=n}return t.reduce(((e,t)=>e+t),0)/t.length}(i)*i.length),{type:"INCREMENT_MODIFIER",increment:o,current:e.evaluated.type===ro.number?e.evaluated.value:0}},sequence:40});const So={};let Co=0;function Eo(e,...t){const i="__sheet__"+Co++;return function(e,t){const i=document.createElement("style");i.textContent=function(e){const t=e.split(/(\{|\}|;)/).map((e=>e.trim())),i=[],o=[];let n=[];function s(e,t){const o=[];for(const n of i[e]){let r=t&&t+" "+n||n;r.includes("&")&&(r=n.replace(/&/g,t||"")),e<i.length-1&&(r=s(e+1,r)),o.push(r)}return o.join(", ")}function r(){n.length&&(o.push(s(0)+" {"),o.push(...n),o.push("}"),n=[])}for(;t.length;){let e=t.shift();"}"===e?(r(),i.pop()):("{"===t[0]&&(r(),i.push(e.split(/\s*,\s*/)),t.shift()),";"===t[0]&&n.push(" "+e+";"))}return o.join("\n")}(t),So[e]=i}(i,String.raw(e,...t)),function(e){const t=So[e];t.setAttribute("component",e),document.head.appendChild(t)}(i),i}function wo({strikethrough:e,underline:t}){return e||t?`${e?"line-through":""} ${t?"underline":""}`:"none"}function yo(e){return"\n"+Object.entries(e).map((([e,t])=>`${e}: ${t};`)).join("\n")+"\n"}Eo`
|
|
1
|
+
!function(e,t){"use strict";let i=e=>e;function o(e,...t){if(1===t.length&&"object"==typeof t[0]){const i=t[0];e=e.replace(/\%\(?([^\)]+)\)s/g,((e,t)=>i[t]))}else t.length>0&&(e=e.replace(/\%s/g,(()=>t.shift())));return e}const n=function(e,...t){return o(i(e),...t)},s=function(e,...t){return new r(e,t)};class r extends String{constructor(e,t){super(e),this.values=t}valueOf(){const e=super.valueOf();return o(i(e),...this.values)}toString(){return this.valueOf()}}var a,l;!function(e){e.NotAvailable="#N/A",e.InvalidReference="#REF",e.BadExpression="#BAD_EXPR",e.CircularDependency="#CYCLE",e.UnknownFunction="#NAME?",e.GenericError="#ERROR"}(a||(a={})),function(e){e[e.silent=0]="silent",e[e.error=1]="error"}(l||(l={}));class c extends Error{constructor(e,t,i=l.error){super(t),this.errorType=e,this.logLevel=i}}class h extends c{constructor(e){super(a.BadExpression,e)}}class d extends c{constructor(){super(a.CircularDependency,s("Circular reference"))}}class u extends c{constructor(){super(a.InvalidReference,s("Invalid reference"))}}class g extends c{constructor(){super(a.NotAvailable,s("Data not available"),l.silent)}}class p extends c{constructor(e){super(a.UnknownFunction,s('Unknown function: "%s"',e))}}const m=.5,f="#f5f5f5",v="#F8F9FA",b="#E8EAED",S="#595959",C="#666666",E="#3266ca",w="#FFFFFF",y="#CACACA",x=11982760,R="#01666b",I="#188038",T="#E6F4EA",A="#CEEAD6",O=["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF","#980000","#FF0000","#FF9900","#FFFF00","#00FF00","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF","#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#741B47","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"],N=26,M=48,_=96,F=23,D=15,k=18,$=14,L=4,P=4,U=3,V=P,z=17,B=250,H=1,W="400",G=10,q="'Roboto', arial",Z=["thin","#000"],j=["thin",I],Y=/[ymdhs:]/,X=a.InvalidReference,K="START_REVISION",Q=20,J=.4,ee=["'","*","?","/","\\","[","]"],te=/'|\*|\?|\/|\\|\[|\]/,ie="|",oe=s("Invalid expression");var ne;!function(e){e[e.Grid=0]="Grid",e[e.Highlight=5]="Highlight",e[e.Figure=10]="Figure",e[e.ScrollBar=15]="ScrollBar",e[e.GridPopover=19]="GridPopover",e[e.GridComposer=20]="GridComposer",e[e.Dropdown=21]="Dropdown",e[e.ColorPicker=25]="ColorPicker",e[e.IconPicker=25]="IconPicker",e[e.TopBarComposer=30]="TopBarComposer",e[e.Popover=35]="Popover",e[e.ChartAnchor=1e3]="ChartAnchor"}(ne||(ne={}));const se=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48}],re={};for(let e of se)re[e.pt]=e.px;class ae{constructor(e,t,i,o=0,n=0,s=0){this.jsDate=new Date(Date.UTC(e,t,i,o,n,s,0))}static fromTimestamp(e){const t=new Date(e);return new ae(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}static now(){const e=new Date;return new ae(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())}toString(){return this.jsDate.toString()}getTime(){return this.jsDate.getTime()}getFullYear(){return this.jsDate.getUTCFullYear()}getMonth(){return this.jsDate.getUTCMonth()}getDate(){return this.jsDate.getUTCDate()}getDay(){return this.jsDate.getUTCDay()}getHours(){return this.jsDate.getUTCHours()}getMinutes(){return this.jsDate.getUTCMinutes()}getSeconds(){return this.jsDate.getUTCSeconds()}setFullYear(e){this.jsDate.setFullYear(e)}setDate(e){this.jsDate.setUTCDate(e)}setHours(e){this.jsDate.setUTCHours(e)}setMinutes(e){this.jsDate.setUTCMinutes(e)}setSeconds(e){this.jsDate.setUTCSeconds(e)}}const le=new ae(1899,11,30),ce=864e5,he=2e3,de=ae.now().getFullYear(),ue=ae.fromTimestamp(0).getTime()-le.getTime(),ge=/^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/,pe=/^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/,me=/((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/,fe={};function ve(e){if(fe[e])return fe[e];const t=function(e){let t;e=e.trim();const i=e.match(me);if(i){if(t=function(e){if(e=e.trim(),me.test(e)){const t=/AM/i.test(e),i=/PM/i.test(e),o=(t||i?e.substring(0,e.length-2).trim():e).split(/:/),n=o.length>=2,s=3===o.length;let r=Number(o[0]),a=n?Number(o[1]):0,l=s?Number(o[2]):0,c=s?"hh:mm:ss":"hh:mm";if(t||i)c+=" a";else if(!n)return null;r>=12&&t?r-=12:r<12&&i&&(r+=12),a+=Math.floor(l/60),l%=60,r+=Math.floor(a/60),a%=60,r>=24&&(c="hhhh:mm:ss");return{value:r/24+a/1440+l/86400,format:c,jsDate:new ae(1899,11,30,r,a,l)}}return null}(i[0]),null===t)return null;e=e.replace(i[0],"").trim()}let o;const n=e.match(ge),s=e.match(pe);if(n||s){let t;if(n?(t=n[0],o=be(t,"mdy")):(t=s[0],o=be(t,"ymd")),null===o)return null;e=e.replace(t,"").trim()}if(""!==e||!o&&!t)return null;if(o&&t)return{value:o.value+t.value,format:o.format+" "+("hhhh:mm:ss"===t.format?"hh:mm:ss":t.format),jsDate:new ae(o.jsDate.getFullYear()+t.jsDate.getFullYear()-1899,o.jsDate.getMonth()+t.jsDate.getMonth()-11,o.jsDate.getDate()+t.jsDate.getDate()-30,o.jsDate.getHours()+t.jsDate.getHours(),o.jsDate.getMinutes()+t.jsDate.getMinutes(),o.jsDate.getSeconds()+t.jsDate.getSeconds())};return o||t}(e);return fe[e]=t,t}function be(e,t){const i="mdy"===t;if(i||"ymd"===t){const t=e.split(/\/|-|\s/),o=i?0:1,n=i?1:2,s=i?2:0,r=Number(t[o]),a=Number(t[n]),l=2===t[o].length&&r<10||2===t[n].length&&a<10,c=t[s]?function(e){const t=Number(e);switch(e.length){case 1:return he+t;case 2:return he+(he+t>de+10?-100:0)+t;case 3:case 4:return t}return 0}(t[s]):de,h=new ae(c,r-1,a),d=e.match(/\/|-|\s/)[0];if(h.getMonth()!==r-1||h.getDate()!==a)return null;const u=h.getTime()-le.getTime();let g=l?`mm${d}dd`:`m${d}d`;return t[s]&&(g=i?g+d+"yyyy":"yyyy"+d+g),{value:Math.round(u/ce),format:g,jsDate:h}}return null}function Se(e){const t=Math.trunc(e);let i=ae.fromTimestamp(t*ce-ue),o=e-t;o=o<0?1+o:o;const n=Math.round(24*o),s=Math.round(24*(o-n/24)*60),r=Math.round(24*(o-n/24-s/24/60)*60*60);return i.setHours(n),i.setMinutes(s),i.setSeconds(r),i}function Ce(e){const t=e.getTime()-le.getTime();return Math.round(t/ce)}function Ee(e){return new ae(e.getFullYear(),e.getMonth()+1,0).getDate()}function we(e){return Ee(e)===e.getDate()}function ye(e,t,i){const o=e.getFullYear(),n=e.getMonth(),s=e.getDate(),r=new ae(o,n+t,1);return i&&s===Ee(e)||s>Ee(r)?r.setDate(Ee(r)):r.setDate(s),r}function xe(e){const t=Math.trunc(e);return t%4==0&&t%100!=0||t%400==0}function Re(e,t,i){if(e===t)return 0;if(e>t){const i=t;t=e,e=i}const o=Se(e),n=Se(t);let s=o.getDate(),r=n.getDate();const a=o.getMonth(),l=n.getMonth(),c=o.getFullYear(),h=n.getFullYear();let d=0,u=0;switch(i){case 0:31===s&&(s=30),30===s&&31===r&&(r=30),1===a&&s===(xe(c)?29:28)&&(s=30,1===l&&r===(xe(h)?29:28)&&(r=30)),d=c+(30*a+s)/360,u=h+(30*l+r)/360;break;case 1:let i=365;const o=c===h;if(!o&&!(c+1===h)||!o&&a<l||!o&&a===l&&s<r){let e=0,t=0;for(let i=c;i<=h;i++)e++,t+=xe(i)?366:365;i=t/e}else o?xe(c)&&(i=366):(xe(c)&&a<2&&(i=366),xe(h)&&(l>1||1===l&&29===r)&&(i=366));d=e/i,u=t/i;break;case 2:d=e/360,u=t/360;break;case 3:d=e/365,u=t/365;break;case 4:31===s&&(s=30),31===r&&(r=30),d=c+(30*a+s)/360,u=h+(30*l+r)/360}return u-d}function Ie(e){return'"'===e[0]&&(e=e.slice(1)),'"'===e[e.length-1]&&"\\"!==e[e.length-2]?e.slice(0,e.length-1):e}function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ae(e){const t=Array.isArray(e)?[]:{};switch(typeof e){case"object":if(null===e)return e;if(function(e){return"clone"in e&&e.clone instanceof Function}(e))return e.clone();if(!(function(e){return"object"==typeof e&&(null==e?void 0:e.constructor)===Object}(e)||e instanceof Array))throw new Error("Unsupported type: only objects and arrays are supported");for(const i in e)t[i]=Ae(e[i]);return t;case"number":case"string":case"boolean":case"function":case"undefined":return e;default:throw new Error("Unsupported type: "+typeof e)}}function Oe(e){return e.startsWith("'")&&(e=e.slice(1,-1).replace(/''/g,"'")),e}function Ne(e){var t;return(null===(t=e.match(/\w/g))||void 0===t?void 0:t.length)!==e.length&&(e=`'${e}'`),e}function Me(e,t,i){return e<t?t:e>i?i:e}function _e(e,t,i){const o=De(i);if(Fe[o]||(Fe[o]={}),void 0===Fe[o][t]){e.save(),e.font=o;const i=e.measureText(t).width;e.restore(),Fe[o][t]=i}return Fe[o][t]}const Fe={};function De(e){return`${e.italic?"italic ":""}${e.bold?"bold":W} ${ke(e)}px ${q}`}function ke(e){const t=e.fontSize||G;if(!re[t])throw new Error("Size of the font is not supported");return re[t]}function $e(e,t,i=1){if(t<=e&&i>0)return[];if(0===i)throw new Error("range() step must not be zero");const o=Math.ceil(Math.abs((t-e)/i)),n=Array(o);for(let t=0;t<o;t++)n[t]=e+t*i;return n}function Le(e){return e.reduce(((e,t,i,o)=>{if(1===Math.abs(t-o[i-1])){e[e.length-1].push(t)}else e.push([t]);return e}),[])}function*Pe(e,t){t.next();for(const i of e){const e=t.next();yield{...i,next:e.done?void 0:e.value}}}function Ue(e){const t=e.toUpperCase();return"TRUE"===t||"FALSE"===t}function Ve(e){return null!==ve(e)}const ze=/^\[(.+)\]\((.+)\)$/,Be=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;function He(e){return ze.test(e)}function We(e,t){return`[${e}](${t})`}function Ge(e){const t=e.match(ze)||[],i=t[1],o=t[2];if(!i||!o)throw new Error(`Could not parse markdown link ${e}.`);return{label:i,url:o}}const qe="o-spreadsheet://";function Ze(e){if(!He(e))return!1;const{url:t}=Ge(e);return t.startsWith(qe)}function je(e){return`${qe}${e}`}function Ye(e){if(e.startsWith(qe))return e.substr(qe.length);throw new Error(`${e} is not a valid sheet link`)}function Xe(e){return void 0!==e}function Ke(e){return void 0!==e&&""!==e}function Qe(e){return void 0===e||Object.values(e).every((e=>"object"==typeof e?Qe(e):!e))}function Je(e,t){for(let[i,o]of Object.entries(t))if(nt(o,e))return parseInt(i,10);const i=Object.keys(t),o=0===i.length?0:lt(i.map((e=>parseInt(e,10))));return t[o+1]=e,o+1}function et(e){let t="";for(let i=0,o=e.length;i<o;i++)t+=e[i];return t}function tt(e){let t,i=!1;const o=()=>(i||(t=e instanceof Function?e():e,i=!0),t);return o.map=e=>tt((()=>e(o()))),o}function it(e,t){let i=e.slice(t).find((e=>e));return i||(i=e.slice(0,t).reverse().find((e=>e))),i||""}function ot(e,t){return"after"===e?t+1:t}function nt(e,t){if(e===t)return!0;if(e&&!t||t&&!e)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;const i=new Set;Object.keys(e).forEach((e=>i.add(e))),Object.keys(t).forEach((e=>i.add(e)));for(let o of i){if(typeof e[o]!=typeof e[o])return!1;if("object"==typeof e[o]){if(!nt(e[o],t[o]))return!1}else if(e[o]!==t[o])return!1}return!0}function st(e,t){if(e.length<t.length)return!1;const i=new Set(e);return t.every((e=>i.has(e)))}function rt(e){const t={...e};return Object.keys(t).forEach((e=>!t[e]&&delete t[e])),t}function at(e){return e?e.toLowerCase():""}function lt(e){let t=e.length;if(t<1e5)return Math.max(...e);let i=-1/0;for(;t--;)i=e[t]>i?e[t]:i;return i}function ct(e){let t=e.length;if(t<1e5)return Math.min(...e);let i=1/0;for(;t--;)i=e[t]<i?e[t]:i;return i}const ht=/rgba?\(|\s+|\)/gi,dt=/^#([A-F\d]{2}){3,4}$/g,ut=["#eb6d00","#0074d9","#ad8e00","#169ed4","#b10dc9","#00a82d","#00a3a3","#f012be","#3d9970","#111111","#62A300","#ff4136","#949494","#85144b","#001f3f"];function gt(e){return mt(e.toString(16).padStart(6,"0"))}let pt=0;function mt(e){let t=e;if(e.startsWith("rgb")?t=function(e){const t=e.replace(ht,"").split(",");let i=255;if(3!==t.length&&4!==t.length)throw new Error("invalid color");if(4===t.length){const e=parseFloat(t.pop()||"1");i=Math.round(255*(e||1))}const o=t.map((e=>parseInt(e,10)));255!==i&&o.push(i);return"#"+et(o.map((e=>e.toString(16).padStart(2,"0")))).toUpperCase()}(e):(t=e.replace("#","").toUpperCase(),3!==t.length&&4!==t.length||(t=t.split("").reduce(((e,t)=>e+t+t),"")),t=`#${t}`),!t.match(dt))throw new Error(`invalid color input: ${e}`);return t}function ft(e){try{return mt(e),!0}catch(e){return!1}}const vt=e=>e>=0&&e<=255;function bt(e,t,i,o=1){if(!vt(e)||!vt(t)||!vt(i)||o<0||o>1)throw new Error(`Invalid RGBA values ${[e,t,i,o]}`);return{a:o,b:i,g:t,r:e}}function St(e){let{r:t,g:i,b:o}=Et(e);t/=255,i/=255,o/=255;const n=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return.2126*n(t)+.7152*n(i)+.0722*n(o)}function Ct(e){let t=e.r.toString(16),i=e.g.toString(16),o=e.b.toString(16),n=Math.round(255*e.a).toString(16);return 1==t.length&&(t="0"+t),1==i.length&&(i="0"+i),1==o.length&&(o="0"+o),1==n.length&&(n="0"+n),"ff"===n&&(n=""),("#"+t+i+o+n).toUpperCase()}function Et(e){let t,i,o,n;if(7===(e=mt(e)).length)t=parseInt(e[1]+e[2],16),i=parseInt(e[3]+e[4],16),o=parseInt(e[5]+e[6],16),n=255;else{if(9!==e.length)throw new Error("Invalid color");t=parseInt(e[1]+e[2],16),i=parseInt(e[3]+e[4],16),o=parseInt(e[5]+e[6],16),n=parseInt(e[7]+e[8],16)}return n=+(n/255).toFixed(3),{a:n,r:t,g:i,b:o}}function wt(e){(e={...e}).s/=100,e.l/=100;let t=(1-Math.abs(2*e.l-1))*e.s,i=t*(1-Math.abs(e.h/60%2-1)),o=e.l-t/2,n=0,s=0,r=0;return 0<=e.h&&e.h<60?(n=t,s=i,r=0):60<=e.h&&e.h<120?(n=i,s=t,r=0):120<=e.h&&e.h<180?(n=0,s=t,r=i):180<=e.h&&e.h<240?(n=0,s=i,r=t):240<=e.h&&e.h<300?(n=i,s=0,r=t):300<=e.h&&e.h<360&&(n=t,s=0,r=i),n=Math.round(255*(n+o)),s=Math.round(255*(s+o)),r=Math.round(255*(r+o)),{a:e.a,r:n,g:s,b:r}}function yt(e){const t=e.r/255,i=e.g/255,o=e.b/255;let n=Math.min(t,i,o),s=Math.max(t,i,o),r=s-n,a=0,l=0,c=0;return a=0==r?0:s==t?(i-o)/r%6:s==i?(o-t)/r+2:(t-i)/r+4,a=Math.round(60*a),a<0&&(a+=360),c=(s+n)/2,l=0==r?0:r/(1-Math.abs(2*c-1)),l=+(100*l).toFixed(1),c=+(100*c).toFixed(1),{a:e.a,h:a,s:l,l:c}}const xt=new RegExp(/\$?([A-Z]{1,3})\$?([0-9]{1,7})/,"i"),Rt=new RegExp(/^\$?([A-Z]{1,3})\$?([0-9]{1,7})$/,"i"),It=new RegExp(/^\$?([A-Z]{1,3})+$/,"i"),Tt=new RegExp(/^\$?([0-9]{1,7})+$/,"i"),At=new RegExp(/^\s*('.+'!|[^']+!)?\$?([A-Z]{1,3})$/,"i"),Ot=new RegExp(/^\s*('.+'!|[^']+!)?\$?([0-9]{1,7})$/,"i"),Nt=new RegExp(/^\s*('.+'!|[^']+!)?/.source+"("+[xt.source,/(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*:\s*(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*/i.source,/\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*:\s*\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*/i.source].join("|")+")"+/$/.source,"i");function Mt(e){return At.test(e)}function _t(e){return Ot.test(e)}function Ft(e){return It.test(e)}function Dt(e){return Tt.test(e)}function kt(e){return Rt.test(e)}function $t(e){const t=e.split("!"),i=t.pop();return{sheetName:Oe(t.join("!"))||void 0,xc:i}}function Lt(e){if(e<0)throw new Error(`number must be positive. Got ${e}`);return e<26?String.fromCharCode(65+e):Lt(Math.floor(e/26)-1)+Lt(e%26)}function Pt(e){let t=0;const i=e.length;for(let o=0;o<i;o++){t+=(e.charCodeAt(o)-65+(o<i-1?1:0))*26**(i-o-1)}return t}function Ut(e){const t=(e=e.toUpperCase().trim()).match(xt);if(null!==t){const[i,o,n]=t;if(i===e){return{col:Pt(o),row:parseInt(n,10)-1}}}throw new Error(`Invalid cell description: ${e}`)}function Vt(e,t,i={colFixed:!1,rowFixed:!1}){return(i.colFixed?"$":"")+Lt(e)+(i.rowFixed?"$":"")+String(t+1)}const zt=140,Bt=20,Ht=.035;function Wt(e){return Bt+(zt-Bt)*Math.exp(-Ht*(e-1))}const Gt=20,qt=/(\d+?)(?=(\d{3})+(?!\d)|$)/g,Zt=/0/g,jt={0:s("January"),1:s("February"),2:s("March"),3:s("April"),4:s("May"),5:s("June"),6:s("July"),7:s("August"),8:s("September"),9:s("October"),10:s("November"),11:s("December")},Yt={0:s("Sunday"),1:s("Monday"),2:s("Tuesday"),3:s("Wednesday"),4:s("Thursday"),5:s("Friday"),6:s("Saturday")},Xt={};function Kt(e){let t=Xt[e];return void 0===t&&(t=function(e){if(""===e)throw new Error("A format cannot be empty");let t=0,i=[];for(;t<e.length;){let o;if("["===e.charAt(t)){if("$"!==e.charAt(t+1))throw new Error(`Currency formats have to be prefixed by a $: ${e}`);if(o=e.substring(t+1).indexOf("]")+t+2,0===o)throw new Error(`Invalid currency brackets format: ${e}`);const n=e.substring(t+2,o-1);if(n.includes("["))throw new Error(`Invalid currency format: ${e}`);i.push({type:"STRING",format:n})}else{const n=e.substring(t).indexOf("[");o=n>-1?n+t:e.length;const s=e.substring(t,o);s.match(Y)?i.push({type:"DATE",format:s}):i.push({type:"NUMBER",format:di(s)})}t=o}return i}(e),Xt[e]=t),t}function Qt(e,t){switch(typeof e){case"string":return e.includes('\\"')?e.replace(/\\"/g,'"'):e;case"boolean":return e?"TRUE":"FALSE";case"number":t||(t=ai(e));return function(e,t){if("DATE"===t[0].type)return ni(e,t[0].format);let i=e<0?"-":"";for(let o of t)switch(o.type){case"NUMBER":i+=Jt(Math.abs(e),o.format);break;case"STRING":i+=o.format}return i}(e,Kt(t));case"object":return"0"}}function Jt(e,t){t.isPercent&&(e*=100),e/=t.magnitude;let i=0;void 0!==t.decimalPart&&(i=t.decimalPart.length);const{integerDigits:o,decimalDigits:n}=ti(e,i);let s=function(e,t,i){var o;const n="0"===e?"":e;let s=n;const r=t.length-n.length;if(r>0){const e=(t.substring(0,r).match(Zt)||[]).length;s="0".repeat(e)+s}i&&(s=(null===(o=s.match(qt))||void 0===o?void 0:o.join(","))||s);return s}(o,t.integerPart,t.thousandsSeparator);return void 0!==t.decimalPart&&(s+="."+function(e,t){let i=e;if(t.length-e.length>0){const o=(t.substring(e.length,t.length+1).match(Zt)||[]).length;i+="0".repeat(o)}return i}(n||"",t.decimalPart)),t.isPercent&&(s+="%"),s}const ei=[];function ti(e,t=Gt){const i=e.toString();if(i.includes("e"))return function(e,t=Gt){let i=ei[t];i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),ei[t]=i);const[o,n]=i.format(e).split(".");return{integerDigits:o,decimalDigits:n}}(e,t);if(Number.isInteger(e))return{integerDigits:i,decimalDigits:void 0};const o=i.indexOf(".");let n=i.substring(0,o),s=i.substring(o+1);if(0===t)return Number(s[0])>=5&&(n=(Number(n)+1).toString()),{integerDigits:n,decimalDigits:void 0};if(s.length>t){const{integerDigits:e,decimalDigits:i}=function(e,t){var i;let o="0",n=e,s=e.slice(0,t);const r=t;if(Number(e[r])<5)return{integerDigits:o,decimalDigits:s};const a=(null===(i=s.match(oi))||void 0===i?void 0:i[0])||"",l=(Number(s)+1).toString(),c=s.slice(a.length),h=l.length>c.length;h&&!a?(o="1",n=void 0):n=h?a.slice(0,-1)+l:a+l;return{integerDigits:o,decimalDigits:n}}(s,t);s=i,"0"!==e&&(n=(Number(n)+Number(e)).toString())}return{integerDigits:n,decimalDigits:ii(s||"")}}function ii(e){let t=e.length-1;for(;t>=0&&"0"===e[t];)t--;return e.slice(0,t+1)||void 0}const oi=/^0+/;function ni(e,t){const i=Se(e),o=t.indexOf("h");let n="",s="";return o>0?(n=si(i,t.substring(0,o-1)),s=ri(i,t.substring(o))):0===o?s=ri(i,t):o<0&&(n=si(i,t)),n+(n&&s?" ":"")+s}function si(e,t){var i;const o=null===(i=t.match(/\/|-|\s/))||void 0===i?void 0:i[0];return(o?t.split(o):[t]).map((i=>{switch(i){case"d":return e.getDate();case"dd":return e.getDate().toString().padStart(2,"0");case"ddd":return Yt[e.getDay()].slice(0,3);case"dddd":return Yt[e.getDay()];case"m":return e.getMonth()+1;case"mm":return String(e.getMonth()+1).padStart(2,"0");case"mmm":return jt[e.getMonth()].slice(0,3);case"mmmm":return jt[e.getMonth()];case"mmmmm":return jt[e.getMonth()].slice(0,1);case"yy":const i=String(e.getFullYear()).replace("-","").padStart(2,"0");return i.slice(i.length-2);case"yyyy":return e.getFullYear();default:throw new Error(`invalid format: ${t}`)}})).join(o)}function ri(e,t){let i=t.split(/:|\s/);const o=e.getHours(),n="a"===i[i.length-1];let s=o,r="";return n&&(s=0===s?12:s>12?s-12:s,r=o>=12?" PM":" AM",i.pop()),i.map((i=>{switch(i){case"hhhh":return Math.floor((e.getTime()-le.getTime())/36e5).toString();case"hh":return s.toString().padStart(2,"0");case"mm":return e.getMinutes().toString().padStart(2,"0");case"ss":return e.getSeconds().toString().padStart(2,"0");default:throw new Error(`invalid format: ${t}`)}})).join(":")+r}function ai(e){let{decimalDigits:t}=ti(e,10);return t?"0."+"0".repeat(t.length):"0"}function li(e,t,i){const o=Kt(e||"#,##0"),n=[];for(let e=0;e<o.length;e++){const s=o[e];if("NUMBER"!==s.type){n.push(s);continue}n.push({...s,format:{...s.format,magnitude:t,decimalPart:void 0}}),n.push({type:"STRING",format:i});const r=o[e+1];"STRING"===(null==r?void 0:r.type)&&["k","m","b"].includes(r.format)&&e++}return gi(n)}function ci(e,t){var i;const o={...e},n=Math.sign(t),s=(null===(i=o.decimalPart)||void 0===i?void 0:i.length)||0,r=Math.min(Math.max(0,s+n),Gt);return o.decimalPart="0".repeat(r),""===o.decimalPart&&delete o.decimalPart,o}const hi=/,*?$/;function di(e){var t;if(function(e){return Boolean(e.replace(ui,""))}(e=e.trim()))throw new Error(`Invalid number format: ${e}`);const i=e.includes("%"),o=(null===(t=e.match(hi))||void 0===t?void 0:t[0])||"",n=o?1e3**o.length:1;let s=e.slice(0,e.length-(o.length||0));const r=s.includes(",");if(s.match(/\..*,/))throw new Error("A format can't contain ',' symbol in the decimal part");s=s.replace("%","").replace(",","");const a=s.match(/[\%|,]/);if(a)throw new Error(`A format can only contain a single '${a[0]}' symbol`);const[l,c]=s.split(".");if(c&&c.length>20)throw new Error("A format can't contain more than 20 decimal places");return void 0!==c?{integerPart:l,isPercent:i,thousandsSeparator:r,decimalPart:c,magnitude:n}:{integerPart:l,isPercent:i,thousandsSeparator:r,magnitude:n}}const ui=/[,#0.%]/g;function gi(e){let t="";for(let i of e){let e;switch(i.type){case"NUMBER":const t=i.format;e=t.integerPart,t.thousandsSeparator&&(e=e.slice(0,-3)+","+e.slice(-3)),void 0!==t.decimalPart&&(e+="."+t.decimalPart),t.isPercent&&(e+="%"),t.magnitude&&(e+=",".repeat(Math.log10(t.magnitude)/3));break;case"STRING":e=`[$${i.format}]`;break;case"DATE":e=i.format}t+=e}return t}const pi=/(^-?\d+(\.?\d*(e\d+)?)?|^-?\.\d+)(?!\w|!)/,mi="(\\s*(\\d+(,\\d{3,})*(\\.\\d*)?)|(\\.\\d+))(e(\\+|-)?\\d+)?(\\s*%)?",fi="(\\s*-)?",vi="(\\s*[\\$€])?",bi="^(("+[fi+vi+mi,fi+mi+vi,vi+fi+mi].join(")|(")+"))$",Si=new RegExp(bi,"i");function Ci(e){return!!e&&Si.test(e.trim())}const Ei=/[,\$€]+/g;function wi(e){e=e.replace(Ei,"");let t=Number(e);return isNaN(t)&&e.includes("%")&&(t=Number(e.split("%")[0]),!isNaN(t))?t/100:t}function yi(e,t,i){const o=[...e].sort(((e,t)=>e-t));let n=(o.length+(i?-1:1))*t;if(i||n--,Number.isInteger(n))return o[n];const s=Math.ceil(n),r=Math.floor(n);return o[s]*(n-r)+o[r]*(s-n)}class xi{constructor(e,t){this.getSheetSize=t,this.prefixSheet=!1,this._zone=e.zone,this.parts=e.parts,this.prefixSheet=e.prefixSheet,this.invalidXc=e.invalidXc,this.sheetId=e.sheetId,this.invalidSheetName=e.invalidSheetName}static fromRange(e,t){return e instanceof xi?e:new xi(e,t.getSheetSize)}get unboundedZone(){return this._zone}get zone(){const{left:e,top:t,bottom:i,right:o}=this._zone;if(void 0!==o&&void 0!==i)return this._zone;if(void 0===i&&void 0!==o)return{right:o,top:t,left:e,bottom:this.getSheetSize(this.sheetId).height-1};if(void 0===o&&void 0!==i)return{bottom:i,left:e,top:t,right:this.getSheetSize(this.sheetId).width-1};throw new Error(s("Bad zone format"))}static getRangeParts(e,t){const i=e.split(":").map((e=>{const t=_t(e);return{colFixed:!t&&e.startsWith("$"),rowFixed:t?e.startsWith("$"):e.includes("$",1)}})),o=void 0===t.bottom,n=void 0===t.right;return o&&(i[0].rowFixed=i[0].rowFixed||i[1].rowFixed,i[1].rowFixed=i[0].rowFixed||i[1].rowFixed),n&&(i[0].colFixed=i[0].colFixed||i[1].colFixed,i[1].colFixed=i[0].colFixed||i[1].colFixed),i}get isFullCol(){return void 0===this._zone.bottom}get isFullRow(){return void 0===this._zone.right}get rangeData(){return{_zone:this._zone,_sheetId:this.sheetId}}orderZone(){if(void 0!==this._zone.right&&this._zone.right<this._zone.left){let e=this._zone.right;this._zone.right=this._zone.left,this._zone.left=e;let t=this.parts[1].colFixed;this.parts[1].colFixed=this.parts[0].colFixed,this.parts[0].colFixed=t}if(void 0!==this._zone.bottom&&this._zone.bottom<this._zone.top){let e=this._zone.bottom;this._zone.bottom=this._zone.top,this._zone.top=e;let t=this.parts[1].rowFixed;this.parts[1].rowFixed=this.parts[0].rowFixed,this.parts[0].rowFixed=t}}clone(e){return new xi({zone:(null==e?void 0:e.zone)?e.zone:{...this._zone},sheetId:(null==e?void 0:e.sheetId)?e.sheetId:this.sheetId,invalidSheetName:e&&"invalidSheetName"in e?e.invalidSheetName:this.invalidSheetName,invalidXc:e&&"invalidXc"in e?e.invalidXc:this.invalidXc,parts:(null==e?void 0:e.parts)?e.parts:this.parts.map((e=>({rowFixed:e.rowFixed,colFixed:e.colFixed}))),prefixSheet:(null==e?void 0:e.prefixSheet)?e.prefixSheet:this.prefixSheet},this.getSheetSize)}}function Ri(e,t,i){const o=i.sheetId===e?t:i.sheetId;return i.clone({sheetId:o})}function Ii(e,t,i){if(!i)return;const o=e.getRangeFromSheetXC(t,i);return o.invalidSheetName||o.invalidXc?void 0:o}function Ti(e){const t=[];for(let i=0;i<e;i++){const e={cells:{}};t.push(e)}return t}class Ai{constructor(){this.isFastIdStrategy=!1,this.fastIdStart=0}setIsFastStrategy(e){this.isFastIdStrategy=e}smallUuid(){return this.isFastIdStrategy?(this.fastIdStart++,String(this.fastIdStart)):window.crypto?"10000000-1000".replace(/[01]/g,(e=>{const t=Number(e);return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)})):"xxxxxxxx-xxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}uuidv4(){return this.isFastIdStrategy?(this.fastIdStart++,String(this.fastIdStart)):window.crypto?"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>{const t=Number(e);return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)})):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}}function Oi(e){const t=function(e){const t=(e=e.split("!").pop()).replace(/\$/g,"").split(":").map((e=>e.trim()));let i,o,n,s,r=!1,a=!1,l=!1;const c=t[0],h=t[1]&&t[1];if(Mt(c))n=s=Pt(c),i=o=0,r=!0;else if(_t(c))i=o=parseInt(c,10)-1,n=s=0,a=!0;else{const e=Ut(c);n=s=e.col,i=o=e.row,l=!0}if(2===t.length)if(Mt(h))s=Pt(h),r=!0;else if(_t(h))o=parseInt(h,10)-1,a=!0;else{const e=Ut(h);s=e.col,o=e.row,i=r?o:i,n=a?s:n,l=!0}if(r&&a)throw new Error("Wrong zone xc. The zone cannot be at the same time a full column and a full row");const d={top:i,left:n,bottom:r?void 0:o,right:a?void 0:s};return l=l&&(a||r),l&&(d.hasHeader=l),d}(e);return function(e){if(void 0!==e.right&&e.right<e.left){const t=e.left;e.left=e.right,e.right=t}if(void 0!==e.bottom&&e.bottom<e.top){const t=e.top;e.top=e.bottom,e.bottom=t}}(t),t}function Ni(e){const t=Oi(e);if(void 0===t.bottom||void 0===t.right)throw new Error("This does not support unbounded ranges");return t}function Mi(e){const{bottom:t,top:i,left:o,right:n}=e;return!(void 0!==t&&isNaN(t)||isNaN(i)||isNaN(o)||void 0!==n&&isNaN(n))&&((void 0===e.bottom||e.bottom>=e.top&&e.bottom>=0)&&(void 0===e.right||e.right>=e.left&&e.right>=0)&&e.top>=0&&e.left>=0)}function _i(e){const{top:t,bottom:i,left:o,right:n}=e,r="hasHeader"in e&&e.hasHeader,a=t===i&&o===n;if(void 0===i&&void 0!==n)return 0!==t||r?`${Vt(o,t)}:${Lt(n)}`:`${Lt(o)}:${Lt(n)}`;if(void 0===n&&void 0!==i)return 0!==o||r?`${Vt(o,t)}:${i+1}`:`${t+1}:${i+1}`;if(void 0!==i&&void 0!==n)return a?Vt(o,t):`${Vt(o,t)}:${Vt(n,i)}`;throw new Error(s("Bad zone format"))}function Fi(e,t,i,o,n){const s="left"===t?"columns":"rows",r="before"===o?i-1:i,a=e["left"===t?"right":"bottom"];return e[t]<=r&&a&&a>r?ji(e,s,"RESIZE",n):r<e[t]?ji(e,s,"MOVE",n):{...e}}function Di(e,t,i,o,n){const s="left"===t?"columns":"rows",r="before"===o?i-1:i,a="left"===t?"right":"bottom";return e[t]<=r&&e[a]>r?ji(e,s,"RESIZE",n):r<e[t]?ji(e,s,"MOVE",n):{...e}}function ki(e,t,i){const o="left"===t?"right":"bottom";let n=e[t],s=e[o];for(let r of i.sort(((e,t)=>t-e)))e[t]>r&&(n--,s--),e[t]<r&&e[o]>=r&&s--;return{...e,[t]:n,[o]:s}}function $i(e,t,i){const o="left"===t?"right":"bottom";let n=e[t],s=e[o];const r=e[o];for(let o of i.sort(((e,t)=>t-e)))e[t]>o&&(n--,void 0!==s&&s--),void 0!==r&&void 0!==s&&e[t]<=o&&r>=o&&s--;if(!(void 0!==s&&n>s))return{...e,[t]:n,[o]:s}}function Li(...e){return{top:Math.min(...e.map((e=>e.top))),left:Math.min(...e.map((e=>e.left))),bottom:Math.max(...e.map((e=>e.bottom))),right:Math.max(...e.map((e=>e.right)))}}function Pi(e,t){if(Vi(e,t))return{top:Math.max(e.top,t.top),left:Math.max(e.left,t.left),bottom:Math.min(e.bottom,t.bottom),right:Math.min(e.right,t.right)}}function Ui(e,t){return e.left===t.left&&e.right===t.right&&e.top===t.top&&e.bottom===t.bottom}function Vi(e,t){return!(e.bottom<t.top||t.bottom<e.top)&&!(e.right<t.left||t.right<e.left)}function zi(e,t,i){const{left:o,right:n,top:s,bottom:r}=i;return e>=o&&e<=n&&t>=s&&t<=r}function Bi(e,t){return Ui(Li(t,e),t)}function Hi(e,t){const i=e.map(Oi),o=t.map(Ni),n=Math.max(...i.concat(o).map((e=>e.bottom||0))),s=Math.max(...i.concat(o).map((e=>e.right||0))),r=i.map((e=>({...e,bottom:void 0===e.bottom?n+1:e.bottom,right:void 0===e.right?s+1:e.right}))),a=o.map((e=>({...e,bottom:void 0===e.bottom?n+1:e.bottom,right:void 0===e.right?s+1:e.right}))),l=function(e,t){const i=new Set(t.map((({col:e,row:t})=>`${e}-${t}`)));return e.filter((({col:e,row:t})=>!i.has(`${e}-${t}`)))}(r.map(Zi).flat(),a.map(Zi).flat()),c=function(e){if(0===e.length)return[];const[t,...i]=[...e].sort(((e,t)=>e.row-t.row)).sort(((e,t)=>e.col-t.col)),o=[];let n=Ki(t);for(const{col:e,row:t}of i)if(!zi(e,t,n))if(e===n.left&&t===n.bottom+1){const e=n.bottom+1;n={...n,bottom:e}}else o.push(n),n=Ki({col:e,row:t});return[...o,n]}(l);return function(e){if(0===e.length)return[];if(e.some((e=>e.left!==e.right)))throw new Error("only columns can be merged");const t=[],i=Wi(e),o=(e,t)=>e.top===t.top&&e.bottom===t.bottom&&e.right+1===t.left;for(;i.length;){const e=i.reduce(((e,t)=>o(e,t)?Li(e,t):e),i.shift());t.push(e)}return Wi(t)}(c).map((e=>({...e,bottom:e.bottom===n+1?void 0:e.bottom,right:e.right===s+1?void 0:e.right}))).map(_i)}function Wi(e){const t=[...e].sort(((e,t)=>t.right-e.right)).sort(((e,t)=>t.bottom-e.bottom)).sort(((e,t)=>e.top-t.top)).sort(((e,t)=>e.left-t.left)).reverse(),i=[];for(;0!==t.length;){const e=t.shift();t.some((t=>Bi(e,t)))||i.push(e)}return i.reverse()}function Gi(e){return{height:e.bottom-e.top+1,width:e.right-e.left+1}}function qi(e){const{width:t,height:i}=Gi(e);return 1===t||1===i}function Zi(e){const t=[],[i,o]=[e.right,e.left].sort(((e,t)=>e-t)),[n,s]=[e.top,e.bottom].sort(((e,t)=>e-t));for(const e of $e(i,o+1))for(const i of $e(n,s+1))t.push({col:e,row:i});return t}function ji(e,t,i,o){const n="both"===t?o[0]:"columns"===t?o:0,s="both"===t?o[1]:"rows"===t?o:0,r="hasHeader"in e&&e.hasHeader;let a;a=!function(e){return void 0===e.bottom}(e)||r?!(Qi(e)&&!r)||"columns"!==t:"rows"!==t;const l={...e};return a&&"MOVE"===i&&(l.left+=n,l.top+=s),void 0!==l.right&&(l.right+=n),void 0!==l.bottom&&(l.bottom+=s),l}function Yi(e,t){let i,o;const{left:n,right:s,top:r,bottom:a}=e,{left:l,right:c,top:h,bottom:d}=t;return i=l!=n?l:c!=s?c:l,o=h!=r?h:d!=a?d:h,{col:i,row:o}}function Xi(e){return{top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom),left:Math.min(e.left,e.right),right:Math.max(e.left,e.right)}}function Ki(e){return{left:e.col,right:e.col,top:e.row,bottom:e.row}}function Qi(e){return void 0===e.right}function Ji(e){return(e.bottom-e.top+1)*(e.right-e.left+1)}function eo(...e){return e.length<2||1===Hi(e.map(_i),[]).length}class to{constructor(){this.content={}}add(e,t){return this.content[e]=t,this}get(e){const t=this.content[e];if(!t&&!(e in this.content))throw new Error(`Cannot find ${e} in this registry!`);return t}contains(e){return e in this.content}getAll(){return Object.values(this.content)}getKeys(){return Object.keys(this.content)}remove(e){delete this.content[e]}}const io=new to,oo=new to;class no extends t.Component{constructor(){super(...arguments),this.canvas=t.useRef("graphContainer")}get background(){return this.chartRuntime.background}get canvasStyle(){return`background-color: ${this.background}`}get chartRuntime(){const e=this.env.model.getters.getChartRuntime(this.props.figure.id);if(!("chartJsConfig"in e))throw new Error("Unsupported chart runtime");return e}setup(){t.onMounted((()=>{const e=this.chartRuntime;this.createChart(e.chartJsConfig)}));let e=this.chartRuntime;t.onPatched((()=>{const t=this.chartRuntime;nt(e,t)||(this.updateChartJs(t),e=t)}))}createChart(e){const t=this.canvas.el.getContext("2d");this.chart=new window.Chart(t,e)}updateChartJs(e){var t,i,o,n;const s=e.chartJsConfig;s.data&&s.data.datasets?(this.chart.data=s.data,(null===(t=s.options)||void 0===t?void 0:t.title)&&(this.chart.config.options.title=s.options.title),s.options&&"valueLabel"in s.options&&(null===(i=s.options)||void 0===i?void 0:i.valueLabel)&&(this.chart.config.options.valueLabel=s.options.valueLabel)):this.chart.data.datasets=void 0,this.chart.config.options.legend=null===(o=s.options)||void 0===o?void 0:o.legend,this.chart.config.options.scales=null===(n=s.options)||void 0===n?void 0:n.scales,this.chart.update({duration:0})}}no.template="o-spreadsheet-ChartJsComponent",oo.add("line",no),oo.add("bar",no),oo.add("pie",no),oo.add("gauge",no);const so=new to;var ro;so.add("INCREMENT_MODIFIER",{apply:(e,t)=>{var i;e.current+=e.increment;const o=e.current.toString(),n=Qt(e.current,null===(i=t.cell)||void 0===i?void 0:i.format);return{cellData:{border:t.border,style:t.cell&&t.cell.style,format:t.cell&&t.cell.format,content:o},tooltip:o?{props:{content:n}}:void 0}}}).add("COPY_MODIFIER",{apply:(e,t,i)=>{var o,n;const s=(null===(o=t.cell)||void 0===o?void 0:o.content)||"";return{cellData:{border:t.border,style:t.cell&&t.cell.style,format:t.cell&&t.cell.format,content:s},tooltip:s?{props:{content:null===(n=t.cell)||void 0===n?void 0:n.formattedValue}}:void 0}}}).add("FORMULA_MODIFIER",{apply:(e,t,i,o)=>{e.current+=e.increment;let n=0,s=0;switch(o){case"up":n=0,s=-e.current;break;case"down":n=0,s=e.current;break;case"left":n=-e.current,s=0;break;case"right":n=e.current,s=0}if(!t.cell||!t.cell.isFormula())return{cellData:{}};const r=t.sheetId,a=i.createAdaptedRanges(t.cell.dependencies,n,s,r),l=i.buildFormulaContent(r,t.cell,a);return{cellData:{border:t.border,style:t.cell.style,format:t.cell.format,content:l},tooltip:l?{props:{content:l}}:void 0}}}),function(e){e.boolean="boolean",e.number="number",e.text="text",e.empty="empty",e.error="error"}(ro||(ro={}));const ao=new Set(["RENAME_SHEET","DELETE_SHEET","CREATE_SHEET","ADD_COLUMNS_ROWS","REMOVE_COLUMNS_ROWS","DELETE_CELL","INSERT_CELL","UNDO","REDO"]),lo=new Set([...ao,"DUPLICATE_SHEET","EVALUATE_CELLS","ADD_CONDITIONAL_FORMAT","REMOVE_CONDITIONAL_FORMAT","MOVE_CONDITIONAL_FORMAT"]),co=new Set(["START","ACTIVATE_SHEET","COPY","PREPARE_SELECTION_INPUT_EXPANSION","STOP_SELECTION_INPUT","RESIZE_SHEETVIEW","SET_VIEWPORT_OFFSET","SELECT_SEARCH_NEXT_MATCH","SELECT_SEARCH_PREVIOUS_MATCH","UPDATE_SEARCH","CLEAR_SEARCH","EVALUATE_CELLS","SET_CURRENT_CONTENT","SET_FORMULA_VISIBILITY","OPEN_CELL_POPOVER","CLOSE_CELL_POPOVER","UPDATE_FILTER"]),ho=new Set(["UPDATE_CELL","UPDATE_CELL_POSITION","CLEAR_CELL","DELETE_CONTENT","ADD_COLUMNS_ROWS","REMOVE_COLUMNS_ROWS","RESIZE_COLUMNS_ROWS","HIDE_COLUMNS_ROWS","UNHIDE_COLUMNS_ROWS","SET_GRID_LINES_VISIBILITY","UNFREEZE_COLUMNS","UNFREEZE_ROWS","FREEZE_COLUMNS","FREEZE_ROWS","UNFREEZE_COLUMNS_ROWS","ADD_MERGE","REMOVE_MERGE","CREATE_SHEET","DELETE_SHEET","DUPLICATE_SHEET","MOVE_SHEET","RENAME_SHEET","HIDE_SHEET","SHOW_SHEET","MOVE_RANGES","ADD_CONDITIONAL_FORMAT","REMOVE_CONDITIONAL_FORMAT","MOVE_CONDITIONAL_FORMAT","CREATE_FIGURE","DELETE_FIGURE","UPDATE_FIGURE","SET_FORMATTING","CLEAR_FORMATTING","SET_BORDER","CREATE_CHART","UPDATE_CHART","CREATE_FILTER_TABLE","REMOVE_FILTER_TABLE"]);function uo(e){return ho.has(e.type)}class go{constructor(e=[]){Array.isArray(e)||(e=[e]),e=[...new Set(e)],this.reasons=e.filter((e=>0!==e))}static get Success(){return po}get isSuccessful(){return 0===this.reasons.length}isCancelledBecause(e){return this.reasons.includes(e)}}const po=new go;var mo,fo,vo;e.CommandResult=void 0,(mo=e.CommandResult||(e.CommandResult={}))[mo.Success=0]="Success",mo[mo.CancelledForUnknownReason=1]="CancelledForUnknownReason",mo[mo.WillRemoveExistingMerge=2]="WillRemoveExistingMerge",mo[mo.MergeIsDestructive=3]="MergeIsDestructive",mo[mo.CellIsMerged=4]="CellIsMerged",mo[mo.InvalidTarget=5]="InvalidTarget",mo[mo.EmptyUndoStack=6]="EmptyUndoStack",mo[mo.EmptyRedoStack=7]="EmptyRedoStack",mo[mo.NotEnoughElements=8]="NotEnoughElements",mo[mo.NotEnoughSheets=9]="NotEnoughSheets",mo[mo.MissingSheetName=10]="MissingSheetName",mo[mo.DuplicatedSheetName=11]="DuplicatedSheetName",mo[mo.DuplicatedSheetId=12]="DuplicatedSheetId",mo[mo.ForbiddenCharactersInSheetName=13]="ForbiddenCharactersInSheetName",mo[mo.WrongSheetMove=14]="WrongSheetMove",mo[mo.WrongSheetPosition=15]="WrongSheetPosition",mo[mo.InvalidAnchorZone=16]="InvalidAnchorZone",mo[mo.SelectionOutOfBound=17]="SelectionOutOfBound",mo[mo.TargetOutOfSheet=18]="TargetOutOfSheet",mo[mo.WrongCutSelection=19]="WrongCutSelection",mo[mo.WrongPasteSelection=20]="WrongPasteSelection",mo[mo.WrongPasteOption=21]="WrongPasteOption",mo[mo.WrongFigurePasteOption=22]="WrongFigurePasteOption",mo[mo.EmptyClipboard=23]="EmptyClipboard",mo[mo.EmptyRange=24]="EmptyRange",mo[mo.InvalidRange=25]="InvalidRange",mo[mo.InvalidZones=26]="InvalidZones",mo[mo.InvalidSheetId=27]="InvalidSheetId",mo[mo.InvalidCellId=28]="InvalidCellId",mo[mo.InputAlreadyFocused=29]="InputAlreadyFocused",mo[mo.MaximumRangesReached=30]="MaximumRangesReached",mo[mo.InvalidInputId=31]="InvalidInputId",mo[mo.InvalidChartDefinition=32]="InvalidChartDefinition",mo[mo.InvalidDataSet=33]="InvalidDataSet",mo[mo.InvalidLabelRange=34]="InvalidLabelRange",mo[mo.InvalidScorecardKeyValue=35]="InvalidScorecardKeyValue",mo[mo.InvalidScorecardBaseline=36]="InvalidScorecardBaseline",mo[mo.InvalidGaugeDataRange=37]="InvalidGaugeDataRange",mo[mo.EmptyGaugeRangeMin=38]="EmptyGaugeRangeMin",mo[mo.GaugeRangeMinNaN=39]="GaugeRangeMinNaN",mo[mo.EmptyGaugeRangeMax=40]="EmptyGaugeRangeMax",mo[mo.GaugeRangeMaxNaN=41]="GaugeRangeMaxNaN",mo[mo.GaugeRangeMinBiggerThanRangeMax=42]="GaugeRangeMinBiggerThanRangeMax",mo[mo.GaugeLowerInflectionPointNaN=43]="GaugeLowerInflectionPointNaN",mo[mo.GaugeUpperInflectionPointNaN=44]="GaugeUpperInflectionPointNaN",mo[mo.GaugeLowerBiggerThanUpper=45]="GaugeLowerBiggerThanUpper",mo[mo.InvalidAutofillSelection=46]="InvalidAutofillSelection",mo[mo.WrongComposerSelection=47]="WrongComposerSelection",mo[mo.MinBiggerThanMax=48]="MinBiggerThanMax",mo[mo.LowerBiggerThanUpper=49]="LowerBiggerThanUpper",mo[mo.MidBiggerThanMax=50]="MidBiggerThanMax",mo[mo.MinBiggerThanMid=51]="MinBiggerThanMid",mo[mo.FirstArgMissing=52]="FirstArgMissing",mo[mo.SecondArgMissing=53]="SecondArgMissing",mo[mo.MinNaN=54]="MinNaN",mo[mo.MidNaN=55]="MidNaN",mo[mo.MaxNaN=56]="MaxNaN",mo[mo.ValueUpperInflectionNaN=57]="ValueUpperInflectionNaN",mo[mo.ValueLowerInflectionNaN=58]="ValueLowerInflectionNaN",mo[mo.MinInvalidFormula=59]="MinInvalidFormula",mo[mo.MidInvalidFormula=60]="MidInvalidFormula",mo[mo.MaxInvalidFormula=61]="MaxInvalidFormula",mo[mo.ValueUpperInvalidFormula=62]="ValueUpperInvalidFormula",mo[mo.ValueLowerInvalidFormula=63]="ValueLowerInvalidFormula",mo[mo.InvalidSortZone=64]="InvalidSortZone",mo[mo.WaitingSessionConfirmation=65]="WaitingSessionConfirmation",mo[mo.MergeOverlap=66]="MergeOverlap",mo[mo.TooManyHiddenElements=67]="TooManyHiddenElements",mo[mo.Readonly=68]="Readonly",mo[mo.InvalidViewportSize=69]="InvalidViewportSize",mo[mo.InvalidScrollingDirection=70]="InvalidScrollingDirection",mo[mo.FigureDoesNotExist=71]="FigureDoesNotExist",mo[mo.InvalidConditionalFormatId=72]="InvalidConditionalFormatId",mo[mo.InvalidCellPopover=73]="InvalidCellPopover",mo[mo.EmptyTarget=74]="EmptyTarget",mo[mo.InvalidFreezeQuantity=75]="InvalidFreezeQuantity",mo[mo.FrozenPaneOverlap=76]="FrozenPaneOverlap",mo[mo.ValuesNotChanged=77]="ValuesNotChanged",mo[mo.InvalidFilterZone=78]="InvalidFilterZone",mo[mo.FilterOverlap=79]="FilterOverlap",mo[mo.FilterNotFound=80]="FilterNotFound",mo[mo.MergeInFilter=81]="MergeInFilter",mo[mo.NonContinuousTargets=82]="NonContinuousTargets",mo[mo.DuplicatedFigureId=83]="DuplicatedFigureId",mo[mo.InvalidSelectionStep=84]="InvalidSelectionStep",mo[mo.DuplicatedChartId=85]="DuplicatedChartId",mo[mo.ChartDoesNotExist=86]="ChartDoesNotExist",mo[mo.InvalidHeaderIndex=87]="InvalidHeaderIndex",mo[mo.InvalidQuantity=88]="InvalidQuantity",mo[mo.NoChanges=89]="NoChanges",function(e){e.UP="up",e.DOWN="down",e.LEFT="left",e.RIGHT="right"}(fo||(fo={})),function(e){e[e.Background=0]="Background",e[e.Highlights=1]="Highlights",e[e.Clipboard=2]="Clipboard",e[e.Search=3]="Search",e[e.Chart=4]="Chart",e[e.Selection=5]="Selection",e[e.Autofill=6]="Autofill",e[e.Headers=7]="Headers"}(vo||(vo={}));const bo=new to;bo.add("simple_value_copy",{condition:(e,t)=>{var i;return 1===t.length&&!e.isFormula()&&!(null===(i=e.format)||void 0===i?void 0:i.match(Y))},generateRule:()=>({type:"COPY_MODIFIER"}),sequence:10}).add("copy_text",{condition:e=>!e.isFormula()&&e.evaluated.type===ro.text,generateRule:()=>({type:"COPY_MODIFIER"}),sequence:20}).add("update_formula",{condition:e=>e.isFormula(),generateRule:(e,t)=>({type:"FORMULA_MODIFIER",increment:t.length,current:0}),sequence:30}).add("increment_number",{condition:e=>e.evaluated.type===ro.number,generateRule:(e,t)=>{const i=function(e,t){let i=[],o=!1;for(let n of t)if(n===e&&(o=!0),(null==n?void 0:n.evaluated.type)===ro.number)i.push(n.evaluated.value);else{if(o)return i;i=[]}return i}(e,t);let o=1;return 2==i.length?o=2*(i[1]-i[0]):i.length>2&&(o=function(e){const t=[];let i=e[0];for(let o=1;o<e.length;o++){const n=e[o];t.push(n-i),i=n}return t.reduce(((e,t)=>e+t),0)/t.length}(i)*i.length),{type:"INCREMENT_MODIFIER",increment:o,current:e.evaluated.type===ro.number?e.evaluated.value:0}},sequence:40});const So={};let Co=0;function Eo(e,...t){const i="__sheet__"+Co++;return function(e,t){const i=document.createElement("style");i.textContent=function(e){const t=e.split(/(\{|\}|;)/).map((e=>e.trim())),i=[],o=[];let n=[];function s(e,t){const o=[];for(const n of i[e]){let r=t&&t+" "+n||n;r.includes("&")&&(r=n.replace(/&/g,t||"")),e<i.length-1&&(r=s(e+1,r)),o.push(r)}return o.join(", ")}function r(){n.length&&(o.push(s(0)+" {"),o.push(...n),o.push("}"),n=[])}for(;t.length;){let e=t.shift();"}"===e?(r(),i.pop()):("{"===t[0]&&(r(),i.push(e.split(/\s*,\s*/)),t.shift()),";"===t[0]&&n.push(" "+e+";"))}return o.join("\n")}(t),So[e]=i}(i,String.raw(e,...t)),function(e){const t=So[e];t.setAttribute("component",e),document.head.appendChild(t)}(i),i}function wo({strikethrough:e,underline:t}){return e||t?`${e?"line-through":""} ${t?"underline":""}`:"none"}function yo(e){return"\n"+Object.entries(e).map((([e,t])=>`${e}: ${t};`)).join("\n")+"\n"}Eo`
|
|
2
2
|
.o-error-tooltip {
|
|
3
3
|
font-size: 13px;
|
|
4
4
|
background-color: white;
|
|
@@ -2437,4 +2437,4 @@
|
|
|
2437
2437
|
<tableParts count="${e.filterTables.length}">
|
|
2438
2438
|
${Af(a)}
|
|
2439
2439
|
</tableParts>
|
|
2440
|
-
`}var CS;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(CS||(CS={}));const ES={},wS={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:N,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:_,DEFAULT_CELL_HEIGHT:F,SCROLLBAR_WIDTH:D},yS={autofillModifiersRegistry:so,autofillRulesRegistry:bo,cellMenuRegistry:Gn,colMenuRegistry:qn,linkMenuRegistry:Yo,functionRegistry:Gu,uiPluginRegistry:cb,corePluginRegistry:lb,rowMenuRegistry:Zn,sidePanelRegistry:wr,figureRegistry:tn,sheetMenuRegistry:Yn,chartSidePanelComponentRegistry:gr,chartComponentRegistry:oo,chartRegistry:io,topbarMenuRegistry:os,topbarComponentRegistry:yr,clickableCellRegistry:hb,otRegistry:ns,inverseCommandRegistry:on,cellRegistry:Jo,cellPopoverRegistry:Qo},xS={LinkCell:Fp},RS={args:$r,toBoolean:jr,toJsDate:Yr,toNumber:Br,toString:Wr,toXC:Vt,toZone:Ni,toCartesian:Ut,numberToLetters:Lt,createFullMenuItem:qo,UuidGenerator:Ai,formatValue:Qt,computeTextWidth:_e,isMarkdownLink:He,parseMarkdownLink:Ge,markdownLink:We,createEmptyWorkbookData:ev,createEmptySheet:Jf,createEmptyExcelSheet:tv,getDefaultChartJsRuntime:Ms,chartFontColor:ws,getMenuChildren:No,ChartColors:Es,EvaluationError:c,CellErrorLevel:l,getFillingMode:Ds,rgbaToHex:Ct,colorToRGBA:Et,positionToZone:Ki,deepEquals:nt},IS={ChartPanel:pr,ChartFigure:Ar,ChartJsComponent:no,Grid:Ip,GridOverlay:hp,ScorecardChart:Rr,LineConfigPanel:cr,LineBarPieDesignPanel:sr,BarConfigPanel:ls,LineBarPieConfigPanel:as,GaugeChartConfigPanel:ar,GaugeChartDesignPanel:lr,ScorecardChartConfigPanel:dr,ScorecardChartDesignPanel:ur};e.AbstractChart=cs,e.CorePlugin=iv,e.DATETIME_FORMAT=Y,e.DispatchResult=go,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},i={},o=[],n=new Ai,s=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const i={type:e,...t};let o=this.status;if(this.getters.isReadonly()&&(n=i,!co.has(n.type)))return new go(68);var n;if(!this.session.canApplyOptimisticUpdate())return new go(65);switch(o){case 0:const t=this.checkDispatchAllowed(i);if(!t.isSuccessful)return t;this.status=1;const{changes:o,commands:n}=this.state.recordChanges((()=>{uo(i)&&this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i),this.finalize()}));this.session.save(n,o),this.status=0,this.trigger("update");break;case 1:if(uo(i)){const e=this.checkDispatchAllowed(i);if(!e.isSuccessful)return e;this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i)}else this.dispatchToHandlers(this.handlers,i);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(uo(i))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,i)}return go.Success},this.dispatchFromCorePlugin=(e,t)=>{const i={type:e,...t},o=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,i),this.status=o,go.Success},o=Kf(e,o);const r=Yf(e,s);this.state=new kb,this.uuidGenerator=n,this.config=this.setupConfig(i),this.session=this.setupSession(r.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new Mb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new _b(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Db(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range);for(let e of lb.getAll())this.setupCorePlugin(e,r);Object.assign(this.getters,this.coreGetters);for(let e of cb.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.isLoading=!0,this.setupSessionEvents(),this.session.loadInitialMessages(o),this.joinSession(),i.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this),this.isLoading=!1,this.finalize()}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.getters,this.state,this.dispatch,this.config,this.selection);for(let i of e.getters){if(!(i in t))throw new Error(`Invalid getter name: ${i} for plugin ${t.constructor}`);if(i in this.getters)throw new Error(`Getter "${i}" is already defined.`);this.getters[i]=t[i].bind(t)}this.uiPlugins.push(t),this.handlers.push(t);const i=e.layers.map((e=>[t,e]));this.renderers.push(...i),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const i=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);for(let t of e.getters){if(!(t in i))throw new Error(`Invalid getter name: ${t} for plugin ${i.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=i[t].bind(i)}i.import(t),this.corePlugins.push(i),this.coreHandlers.push(i),this.handlers.push(i)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.uiPlugins,t),this.status=e}this.finalize()}setupSession(e){return new eb(Ob(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)})),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-redone",this,this.finalize),this.session.on("revision-undone",this,this.finalize),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.smallUuid(),name:s("Anonymous").toString()},i=e.transportService||new Cb;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:i,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return t.some((e=>0!==e))?new go(t.flat()):go.Success}finalize(){if(!this.isLoading){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}}dispatchToHandlers(e,t){t=Ae(t);for(const i of e)i.beforeHandle(t);for(const i of e)i.handle(t)}drawGrid(e){for(let[t,i]of this.renderers)e.ctx.save(),t.drawGrid(e,i),e.ctx.restore()}exportData(){let e=ev();for(let t of this.handlers)t instanceof iv&&t.export(e);return e.revisionId=this.session.getRevisionId()||K,e=Ae(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...ev(),sheets:[tv(jf,"Sheet1")]};for(let t of this.handlers)t instanceof Ug&&t.exportForExcel(e);return e=Ae(e),bS(e)}},e.Registry=to,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=wS,e.Spreadsheet=Sb,e.UIPlugin=Vg,e.__info__=ES,e.addFunction=function(e,t){Gu.add(e,t)},e.astToFormula=Ig,e.cellTypes=xS,e.compile=Dg,e.components=IS,e.convertAstNodes=Rg,e.coreTypes=ho,e.findCellInNewZone=Yi,e.functionCache=Fg,e.helpers=RS,e.invalidateEvaluationCommands=ao,e.load=Yf,e.parse=yg,e.readonlyAllowedCommands=co,e.registries=yS,e.setTranslationMethod=function(e){i=e},e.tokenize=Yu,Object.defineProperty(e,"__esModule",{value:!0}),ES.version="16.0.
|
|
2440
|
+
`}var CS;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(CS||(CS={}));const ES={},wS={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:N,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:_,DEFAULT_CELL_HEIGHT:F,SCROLLBAR_WIDTH:D},yS={autofillModifiersRegistry:so,autofillRulesRegistry:bo,cellMenuRegistry:Gn,colMenuRegistry:qn,linkMenuRegistry:Yo,functionRegistry:Gu,uiPluginRegistry:cb,corePluginRegistry:lb,rowMenuRegistry:Zn,sidePanelRegistry:wr,figureRegistry:tn,sheetMenuRegistry:Yn,chartSidePanelComponentRegistry:gr,chartComponentRegistry:oo,chartRegistry:io,topbarMenuRegistry:os,topbarComponentRegistry:yr,clickableCellRegistry:hb,otRegistry:ns,inverseCommandRegistry:on,cellRegistry:Jo,cellPopoverRegistry:Qo},xS={LinkCell:Fp},RS={args:$r,toBoolean:jr,toJsDate:Yr,toNumber:Br,toString:Wr,toXC:Vt,toZone:Ni,toCartesian:Ut,numberToLetters:Lt,createFullMenuItem:qo,UuidGenerator:Ai,formatValue:Qt,computeTextWidth:_e,isMarkdownLink:He,parseMarkdownLink:Ge,markdownLink:We,createEmptyWorkbookData:ev,createEmptySheet:Jf,createEmptyExcelSheet:tv,getDefaultChartJsRuntime:Ms,chartFontColor:ws,getMenuChildren:No,ChartColors:Es,EvaluationError:c,CellErrorLevel:l,getFillingMode:Ds,rgbaToHex:Ct,colorToRGBA:Et,positionToZone:Ki,deepEquals:nt},IS={ChartPanel:pr,ChartFigure:Ar,ChartJsComponent:no,Grid:Ip,GridOverlay:hp,ScorecardChart:Rr,LineConfigPanel:cr,LineBarPieDesignPanel:sr,BarConfigPanel:ls,LineBarPieConfigPanel:as,GaugeChartConfigPanel:ar,GaugeChartDesignPanel:lr,ScorecardChartConfigPanel:dr,ScorecardChartDesignPanel:ur};e.AbstractChart=cs,e.CorePlugin=iv,e.DATETIME_FORMAT=Y,e.DispatchResult=go,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},i={},o=[],n=new Ai,s=!0){super(),this.corePlugins=[],this.uiPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const i={type:e,...t};let o=this.status;if(this.getters.isReadonly()&&(n=i,!co.has(n.type)))return new go(68);var n;if(!this.session.canApplyOptimisticUpdate())return new go(65);switch(o){case 0:const t=this.checkDispatchAllowed(i);if(!t.isSuccessful)return t;this.status=1;const{changes:o,commands:n}=this.state.recordChanges((()=>{uo(i)&&this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i),this.finalize()}));this.session.save(n,o),this.status=0,this.trigger("update");break;case 1:if(uo(i)){const e=this.checkDispatchAllowed(i);if(!e.isSuccessful)return e;this.state.addCommand(i),this.dispatchToHandlers(this.handlers,i)}else this.dispatchToHandlers(this.handlers,i);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(uo(i))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,i)}return go.Success},this.dispatchFromCorePlugin=(e,t)=>{const i={type:e,...t},o=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,i),this.status=o,go.Success},o=Kf(e,o);const r=Yf(e,s);this.state=new kb,this.uuidGenerator=n,this.config=this.setupConfig(i),this.session=this.setupSession(r.revisionId),this.config.moveClient=this.session.move.bind(this.session),this.history=new Mb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new _b(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Db(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range);for(let e of lb.getAll())this.setupCorePlugin(e,r);Object.assign(this.getters,this.coreGetters);for(let e of cb.getAll())this.setupUiPlugin(e);this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.isLoading=!0,this.setupSessionEvents(),this.session.loadInitialMessages(o),this.joinSession(),i.snapshotRequested&&this.session.snapshot(this.exportData()),t.markRaw(this),this.isLoading=!1,this.finalize()}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.getters,this.state,this.dispatch,this.config,this.selection);for(let i of e.getters){if(!(i in t))throw new Error(`Invalid getter name: ${i} for plugin ${t.constructor}`);if(i in this.getters)throw new Error(`Getter "${i}" is already defined.`);this.getters[i]=t[i].bind(t)}this.uiPlugins.push(t),this.handlers.push(t);const i=e.layers.map((e=>[t,e]));this.renderers.push(...i),this.renderers.sort(((e,t)=>e[1]-t[1]))}setupCorePlugin(e,t){const i=new e(this.coreGetters,this.state,this.range,this.dispatchFromCorePlugin,this.config,this.uuidGenerator);for(let t of e.getters){if(!(t in i))throw new Error(`Invalid getter name: ${t} for plugin ${i.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=i[t].bind(i)}i.import(t),this.corePlugins.push(i),this.coreHandlers.push(i),this.handlers.push(i)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.uiPlugins,t),this.status=e}this.finalize()}setupSession(e){return new eb(Ob(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)})),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-redone",this,this.finalize),this.session.on("revision-undone",this,this.finalize),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.smallUuid(),name:s("Anonymous").toString()},i=e.transportService||new Cb;return{...e,mode:e.mode||"normal",evalContext:e.evalContext||{},transportService:i,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return t.some((e=>0!==e))?new go(t.flat()):go.Success}finalize(){if(!this.isLoading){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}}dispatchToHandlers(e,t){t=Ae(t);for(const i of e)i.beforeHandle(t);for(const i of e)i.handle(t)}drawGrid(e){for(let[t,i]of this.renderers)e.ctx.save(),t.drawGrid(e,i),e.ctx.restore()}exportData(){let e=ev();for(let t of this.handlers)t instanceof iv&&t.export(e);return e.revisionId=this.session.getRevisionId()||K,e=Ae(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...ev(),sheets:[tv(jf,"Sheet1")]};for(let t of this.handlers)t instanceof Ug&&t.exportForExcel(e);return e=Ae(e),bS(e)}},e.Registry=to,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=wS,e.Spreadsheet=Sb,e.UIPlugin=Vg,e.__info__=ES,e.addFunction=function(e,t){Gu.add(e,t)},e.astToFormula=Ig,e.cellTypes=xS,e.compile=Dg,e.components=IS,e.convertAstNodes=Rg,e.coreTypes=ho,e.findCellInNewZone=Yi,e.functionCache=Fg,e.helpers=RS,e.invalidateEvaluationCommands=ao,e.load=Yf,e.parse=yg,e.readonlyAllowedCommands=co,e.registries=yS,e.setTranslationMethod=function(e){i=e},e.tokenize=Yu,Object.defineProperty(e,"__esModule",{value:!0}),ES.version="16.0.63",ES.date="2025-02-25T05:54:41.386Z",ES.hash="b01aca6"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
package/dist/o_spreadsheet.xml
CHANGED
|
@@ -3242,7 +3242,7 @@ https://fontawesome.com/license -->
|
|
|
3242
3242
|
</t>
|
|
3243
3243
|
</odoo>
|
|
3244
3244
|
<!--
|
|
3245
|
-
__info__.version = '16.0.
|
|
3246
|
-
__info__.date = '2025-02-
|
|
3247
|
-
__info__.hash = '
|
|
3245
|
+
__info__.version = '16.0.63';
|
|
3246
|
+
__info__.date = '2025-02-25T05:55:02.329Z';
|
|
3247
|
+
__info__.hash = 'b01aca6';
|
|
3248
3248
|
-->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odoo/o-spreadsheet",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.63",
|
|
4
4
|
"description": "A spreadsheet component",
|
|
5
5
|
"main": "dist/o-spreadsheet.cjs.js",
|
|
6
6
|
"browser": "dist/o-spreadsheet.iife.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"build": "npm-run-all build:js build:bundleJs \"build:bundleXml -- --outDir build\"",
|
|
22
22
|
"doc": "typedoc",
|
|
23
23
|
"precommit": "npm run prettier && npm run doc",
|
|
24
|
+
"monkey": "SPREADSHEET_MONKEY_COUNT=$npm_config_monkey_count jest 'tests/collaborative/collaborative_monkey_party.test.ts'",
|
|
24
25
|
"test": "jest",
|
|
25
26
|
"test:watch": "jest --watch",
|
|
26
27
|
"prettier": "prettier . --write",
|