@odoo/o-spreadsheet 17.0.107 → 17.0.108
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.
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.0.
|
|
6
|
-
* @date 2026-09-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.108
|
|
6
|
+
* @date 2026-09-10T05:35:45.123Z
|
|
7
|
+
* @hash b2580c5
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, useChildSubEnv, useComponent, useEffect, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
|
|
@@ -7223,7 +7223,7 @@ function toXlsxHexColor(color) {
|
|
|
7223
7223
|
//#region src/helpers/ui/paste_interactive.ts
|
|
7224
7224
|
const PasteInteractiveContent = {
|
|
7225
7225
|
wrongPasteSelection: _t("This operation is not allowed with multiple selections."),
|
|
7226
|
-
willRemoveExistingMerge: _t("
|
|
7226
|
+
willRemoveExistingMerge: _t("Cannot perform this action on merged cells. Unmerge the cells and try again."),
|
|
7227
7227
|
wrongFigurePasteOption: _t("Cannot do a special paste of a figure."),
|
|
7228
7228
|
frozenPaneOverlap: _t("This operation is not allowed due to an overlapping frozen pane.")
|
|
7229
7229
|
};
|
|
@@ -50880,6 +50880,6 @@ const constants = { DEFAULT_LOCALE };
|
|
|
50880
50880
|
//#endregion
|
|
50881
50881
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
50882
50882
|
|
|
50883
|
-
__info__.version = "17.0.
|
|
50884
|
-
__info__.date = "2026-09-
|
|
50885
|
-
__info__.hash = "
|
|
50883
|
+
__info__.version = "17.0.108";
|
|
50884
|
+
__info__.date = "2026-09-10T05:35:45.123Z";
|
|
50885
|
+
__info__.hash = "b2580c5";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.0.
|
|
6
|
-
* @date 2026-09-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.108
|
|
6
|
+
* @date 2026-09-10T05:35:45.123Z
|
|
7
|
+
* @hash b2580c5
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -7225,7 +7225,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
7225
7225
|
//#region src/helpers/ui/paste_interactive.ts
|
|
7226
7226
|
const PasteInteractiveContent = {
|
|
7227
7227
|
wrongPasteSelection: _t("This operation is not allowed with multiple selections."),
|
|
7228
|
-
willRemoveExistingMerge: _t("
|
|
7228
|
+
willRemoveExistingMerge: _t("Cannot perform this action on merged cells. Unmerge the cells and try again."),
|
|
7229
7229
|
wrongFigurePasteOption: _t("Cannot do a special paste of a figure."),
|
|
7230
7230
|
frozenPaneOverlap: _t("This operation is not allowed due to an overlapping frozen pane.")
|
|
7231
7231
|
};
|
|
@@ -50918,8 +50918,8 @@ exports.setDefaultSheetViewSize = setDefaultSheetViewSize;
|
|
|
50918
50918
|
exports.setTranslationMethod = setTranslationMethod;
|
|
50919
50919
|
exports.tokenize = tokenize;
|
|
50920
50920
|
|
|
50921
|
-
__info__.version = "17.0.
|
|
50922
|
-
__info__.date = "2026-09-
|
|
50923
|
-
__info__.hash = "
|
|
50921
|
+
__info__.version = "17.0.108";
|
|
50922
|
+
__info__.date = "2026-09-10T05:35:45.123Z";
|
|
50923
|
+
__info__.hash = "b2580c5";
|
|
50924
50924
|
|
|
50925
50925
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
`;var cl=class extends t.Component{static template=`o-spreadsheet-LinkEditor`;static components={Menu:pc};menuItems=sl.getMenuItems();link=(0,t.useState)(this.defaultState);menu=(0,t.useState)({isOpen:!1});linkEditorRef=(0,t.useRef)(`linkEditor`);position=rc(this.linkEditorRef);urlInput=(0,t.useRef)(`urlInput`);setup(){(0,t.onMounted)(()=>this.urlInput.el?.focus())}get defaultState(){let{col:e,row:t}=this.props.cellPosition,n=this.env.model.getters.getActiveSheetId(),r=this.env.model.getters.getEvaluatedCell({sheetId:n,col:e,row:t});return r.link?{url:r.link.url,label:r.formattedValue,isUrlEditable:r.link.isUrlEditable}:{label:r.formattedValue,url:``,isUrlEditable:!0}}get menuPosition(){return{x:this.position.x+320-12-2,y:this.position.y+100}}onSpecialLink(e){let{detail:t}=e,n=$a(t);n&&(this.link.url=n.url,this.link.label=n.label,this.link.isUrlEditable=n.isUrlEditable)}getUrlRepresentation(e){return Za(e,this.env.model.getters)}openMenu(){this.menu.isOpen=!0}removeLink(){this.link.url=``,this.link.isUrlEditable=!0}save(){let{col:e,row:t}=this.props.cellPosition,n=this.env.model.getters.getLocale(),r=this.link.label?Ic(this.link.label,n):this.link.url;this.env.model.dispatch(`UPDATE_CELL`,{col:e,row:t,sheetId:this.env.model.getters.getActiveSheetId(),content:st(r,this.link.url)}),this.props.onClosed?.()}cancel(){this.props.onClosed?.()}onKeyDown(e){switch(e.key){case`Enter`:this.link.url&&this.save(),e.stopPropagation(),e.preventDefault();break;case`Escape`:this.cancel(),e.stopPropagation();break}}};let ll={onOpen:(e,t)=>({isOpen:!0,props:{cellPosition:e},Component:cl,cellCorner:`BottomLeft`})};cl.props={cellPosition:Object,onClosed:{type:Function,optional:!0}};let ul=new H;ul.add(`ErrorToolTip`,Bs).add(`LinkCell`,hc).add(`LinkEditor`,ll).add(`FilterMenu`,Ws);function dl(e){return e=zt(e).replace(`#`,``),e.length===8?e.slice(6)+e.slice(0,6):e}let fl={wrongPasteSelection:y(`This operation is not allowed with multiple selections.`),willRemoveExistingMerge:y(`This operation is not possible due to a merge. Please remove the merges first than try again.`),wrongFigurePasteOption:y(`Cannot do a special paste of a figure.`),frozenPaneOverlap:y(`This operation is not allowed due to an overlapping frozen pane.`)};function pl(e,t){t.isSuccessful||(t.reasons.includes(`WrongPasteSelection`)?e.raiseError(fl.wrongPasteSelection):t.reasons.includes(`WillRemoveExistingMerge`)?e.raiseError(fl.willRemoveExistingMerge):t.reasons.includes(`WrongFigurePasteOption`)?e.raiseError(fl.wrongFigurePasteOption):t.reasons.includes(`FrozenPaneOverlap`)&&e.raiseError(fl.frozenPaneOverlap))}function ml(e,t,n){pl(e,e.model.dispatch(`PASTE`,{target:t,pasteOption:n}))}function hl(e,t,n,r){pl(e,e.model.dispatch(`PASTE_FROM_OS_CLIPBOARD`,{target:t,text:n,pasteOption:r}))}let gl={Errors:{InvalidRange:y(`The range is invalid`),FirstArgMissing:y(`The argument is missing. Please provide a value`),SecondArgMissing:y(`The second argument is missing. Please provide a value`),MinNaN:y(`The minpoint must be a number`),MidNaN:y(`The midpoint must be a number`),MaxNaN:y(`The maxpoint must be a number`),ValueUpperInflectionNaN:y(`The first value must be a number`),ValueLowerInflectionNaN:y(`The second value must be a number`),MinBiggerThanMax:y(`Minimum must be smaller then Maximum`),MinBiggerThanMid:y(`Minimum must be smaller then Midpoint`),MidBiggerThanMax:y(`Midpoint must be smaller then Maximum`),LowerBiggerThanUpper:y(`Lower inflection point must be smaller than upper inflection point`),MinInvalidFormula:y(`Invalid Minpoint formula`),MaxInvalidFormula:y(`Invalid Maxpoint formula`),MidInvalidFormula:y(`Invalid Midpoint formula`),ValueUpperInvalidFormula:y(`Invalid upper inflection point formula`),ValueLowerInvalidFormula:y(`Invalid lower inflection point formula`),EmptyRange:y(`A range needs to be defined`),Unexpected:y(`The rule is invalid for an unknown reason`)},ColorScale:y(`Color scale`),IconSet:y(`Icon set`)},_l={IsEmpty:y(`Is empty`),IsNotEmpty:y(`Is not empty`),ContainsText:y(`Contains`),NotContains:y(`Does not contain`),BeginsWith:y(`Starts with`),EndsWith:y(`Ends with`),Equal:y(`Is equal to`),NotEqual:y(`Is not equal to`),GreaterThan:y(`Is greater than`),GreaterThanOrEqual:y(`Is greater than or equal to`),LessThan:y(`Is less than`),LessThanOrEqual:y(`Is less than or equal to`),Between:y(`Is between`),NotBetween:y(`Is not between`)},vl={Series:y(`Series`),Errors:{Unexpected:y(`The chart definition is invalid for an unknown reason`),InvalidDataSet:y(`The dataset is invalid`),InvalidLabelRange:y(`Labels are invalid`),InvalidScorecardKeyValue:y(`The key value is invalid`),InvalidScorecardBaseline:y(`The baseline value is invalid`),InvalidGaugeDataRange:y(`The data range is invalid`),EmptyGaugeRangeMin:y(`A minimum range limit value is needed`),GaugeRangeMinNaN:y(`The minimum range limit value must be a number`),EmptyGaugeRangeMax:y(`A maximum range limit value is needed`),GaugeRangeMaxNaN:y(`The maximum range limit value must be a number`),GaugeRangeMinBiggerThanRangeMax:y(`Minimum range limit must be smaller than maximum range limit`),GaugeLowerInflectionPointNaN:y(`The lower inflection point value must be a number`),GaugeUpperInflectionPointNaN:y(`The upper inflection point value must be a number`)}},yl={Custom:y(`Custom`)},bl=y(`Merged cells are preventing this operation. Unmerge those cells and try again.`),xl={Errors:{Unexpected:y(`Cannot split the selection for an unknown reason`),NoSplitSeparatorInSelection:y(`There is no match for the selected separator in the selection`),MoreThanOneColumnSelected:y(`Only a selection from a single column can be split`),SplitWillOverwriteContent:y(`Splitting will overwrite existing content`)}},Sl={Errors:{Unexpected:y(`Cannot remove duplicates for an unknown reason`),MoreThanOneRangeSelected:y(`Please select only one range of cells`),EmptyTarget:y(`Please select a range of cells containing values.`),NoColumnsProvided:y(`Please select at latest one column to analyze.`),WillRemoveExistingMerge:fl.willRemoveExistingMerge}},G={DateIs:{today:y(`today`),yesterday:y(`yesterday`),tomorrow:y(`tomorrow`),lastWeek:y(`in the past week`),lastMonth:y(`in the past month`),lastYear:y(`in the past year`)},DateIsBefore:{today:y(`today`),yesterday:y(`yesterday`),tomorrow:y(`tomorrow`),lastWeek:y(`one week ago`),lastMonth:y(`one month ago`),lastYear:y(`one year ago`)},CriterionError:{notEmptyValue:y(`The value must not be empty`),numberValue:y(`The value must be a number`),dateValue:y(`The value must be a date`),validRange:y(`The value must be a valid range`)}};function Cl(e,t){if(t.dataRange){let n=t.labelCell?[B(t.labelCell.zone)]:[],r=pa([B(t.dataRange.zone)],n)[0];if(r===void 0)return[];let i=e.getRangeFromSheetXC(t.dataRange.sheetId,r);return e.getRangeValues(i).map(e=>e===``?void 0:e)}return[]}function wl(e,t){let n=w(0,Math.max(e.length,...t.map(e=>e.data?.length||0))).filter(n=>{let r=e[n],i=t.map(e=>e.data?.[n]);return r||i.some(e=>e===0||!!e)});return{labels:n.map(t=>e[t]||``),dataSetsValues:t.map(e=>({...e,data:n.map(t=>e.data[t])}))}}function Tl(e,t){let n=e=>typeof e==`number`?e:0,r=new Set(e),i={};r.forEach(e=>{i[e]=Array(t.length).fill(0)});for(let r of w(0,e.length)){let a=e[r];for(let e of w(0,t.length))i[a][e]+=n(t[e].data[r])}return{labels:Array.from(r),dataSetsValues:t.map((e,t)=>({...e,data:Array.from(r).map(e=>i[e][t])}))}}function El(e){return e?e.length>20?e.substring(0,20)+`…`:e:``}function Dl(e,t,n,{format:r,locale:i,truncateLabels:a=!0}){let o={responsive:!0,maintainAspectRatio:!1,layout:{padding:{left:20,right:20,top:e.title?10:25,bottom:10}},elements:{line:{fill:!1},point:{hitRadius:15}},animation:!1,plugins:{title:{display:!!e.title,text:y(e.title),color:n,font:{size:22,weight:`normal`}},legend:{onClick:()=>{}},tooltip:{callbacks:{label:function(e){let t=e.dataset?.label||e.label,n=e.parsed.y??e.parsed,a=z(n,{format:!r&&Math.abs(n)>=1e3?`#,##`:r,locale:i});return t?`${t}: ${a}`:a}}}}};return{type:e.type,options:o,data:{labels:a?t.map(El):t,datasets:[]},plugins:[]}}function Ol(e,t,n){if(!t)return;let{sheetId:r,zone:i}=t,a=ba(i).map(t=>e.getEvaluatedCell({sheetId:r,...t}).format);return n&&a.shift(),a.find(e=>e!==void 0)}function kl(e,t,n){let r={values:[],formattedValues:[]};if(n)!n.invalidXc&&!n.invalidSheetName&&(r={formattedValues:e.getRangeFormattedValues(n),values:e.getRangeValues(n).map(e=>String(e))});else if(t.length===1){let n=Cl(e,t[0]).length;for(let e=0;e<n;e++)r.formattedValues.push(``),r.values.push(``)}else t[0]&&(r={formattedValues:w(0,Cl(e,t[0]).length).map(e=>e.toString()),values:r.formattedValues});return r}function Al(e,t){for(let n of t){let t=e.getRangeFormats(n.dataRange).find(e=>e!==void 0&&!_i(e));if(t)return t}}function jl(e,t){let n=[];for(let[r,i]of Object.entries(t)){let t;if(i.labelCell){let n=i.labelCell,a=n?e.getEvaluatedCell({sheetId:n.sheetId,col:n.zone.left,row:n.zone.top}):void 0;t=a&&n?El(a.formattedValue):t=`${vl.Series} ${parseInt(r)+1}`}else t=t=`${vl.Series} ${parseInt(r)+1}`;let a=i.dataRange?Cl(e,i):[];n.push({data:a,label:t})}return n}function Ml(e){return e===0?`origin`:e-1}function Nl(e,t,n){let r=document.createElement(`div`);r.style.width=`${t.width}px`,r.style.height=`${t.height}px`;let i=document.createElement(`canvas`);if(r.append(i),i.setAttribute(`width`,t.width.toString()),i.setAttribute(`height`,t.height.toString()),document.body.append(r),`chartJsConfig`in e){e.chartJsConfig.plugins=[Pl];let t=new window.Chart(i,S(e.chartJsConfig)),n=t.toBase64Image();return t.destroy(),r.remove(),n}else if(n===`scorecard`){ss(gs(t,e),i);let n=i.toDataURL();return r.remove(),n}return``}let Pl={id:`customCanvasBackgroundColor`,beforeDraw:e=>{let{ctx:t}=e;t.save(),t.globalCompositeOperation=`destination-over`,t.fillStyle=`#ffffff`,t.fillRect(0,0,e.width,e.height),t.restore()}};var Fl=class e extends Io{dataSets;labelRange;background;verticalAxisPosition;legendPosition;stacked;aggregated;type=`bar`;dataSetsHaveTitle;constructor(e,t,n){super(e,t,n),this.dataSets=Vo(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Fa(n,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return Go(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,Yo,Xo)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,stacked:!1,aggregated:!1,legendPosition:`top`,title:e.title||``,type:`bar`,verticalAxisPosition:`left`,labelRange:e.auxiliaryRange||void 0}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map(e=>this.getters.getRangeString(e.dataRange,this.sheetId)),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}copyForSheetId(t){let n=Ro(this.sheetId,t,this.dataSets),r=zo(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){return{type:`bar`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>this.getters.getRangeString(e.dataRange,n||this.sheetId)),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,stacked:this.stacked,aggregated:this.aggregated}}getDefinitionForExcel(){let e=this.dataSets.map(e=>Uo(this.getters,e)).filter(e=>e.range!==``&&e.range!==Ie),t=Wo(this.getters,this.labelRange,Zo(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:dl(this.background||`#FFFFFF`),fontColor:dl(Jo(this.background)),dataSets:e,labelRange:t}}updateRanges(t){let{dataSets:n,labelRange:r,isStale:i}=Lo(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function Il(e,t,n){let r=Jo(e.background),i=Dl(e,t,r,n),a={labels:{color:r}};return!e.labelRange&&e.dataSets.length===1||e.legendPosition===`none`?a.display=!1:a.position=e.legendPosition,i.options.plugins.legend={...i.options.plugins?.legend,...a},i.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},i.options.scales={x:{ticks:{padding:5,color:r}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:r,callback:e=>{if(e=Number(e),isNaN(e))return e;let{locale:t,format:r}=n;return z(e,{locale:t,format:!r&&Math.abs(e)>=1e3?`#,##`:r})}}}},e.stacked&&(i.options.scales.x.stacked=!0,i.options.scales.y.stacked=!0),i}function Ll(e,t){let n=kl(t,e.dataSets,e.labelRange).formattedValues,r=jl(t,e.dataSets);Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle)&&n.shift(),{labels:n,dataSetsValues:r}=wl(n,r),e.aggregated&&({labels:n,dataSetsValues:r}=Tl(n,r));let i=Al(t,e.dataSets),a=t.getLocale(),o=Il(e,n,{format:i,locale:a}),s=new qo;for(let{label:e,data:t}of r){let n=s.next(),r={label:e,data:t,borderColor:n,backgroundColor:n};o.data.datasets.push(r)}return{chartJsConfig:o,background:e.background||`#FFFFFF`}}function Rl(e){return e.dataRange&&!Wi.test(e.dataRange)?`InvalidGaugeDataRange`:`Success`}function zl(e,t){return t(t=>t.sectionRule?e(t.sectionRule.rangeMin,`rangeMin`):`Success`,t=>t.sectionRule?e(t.sectionRule.rangeMax,`rangeMax`):`Success`)}function Bl(e,t){return t(t=>t.sectionRule?e(t.sectionRule.lowerInflectionPoint.value,`lowerInflectionPointValue`):`Success`,t=>t.sectionRule?e(t.sectionRule.upperInflectionPoint.value,`upperInflectionPointValue`):`Success`)}function Vl(e){return e.sectionRule&&Number(e.sectionRule.rangeMin)>=Number(e.sectionRule.rangeMax)?`GaugeRangeMinBiggerThanRangeMax`:`Success`}function Hl(e,t){if(e===``)switch(t){case`rangeMin`:return`EmptyGaugeRangeMin`;case`rangeMax`:return`EmptyGaugeRangeMax`}return`Success`}function Ul(e,t){if(isNaN(e))switch(t){case`rangeMin`:return`GaugeRangeMinNaN`;case`rangeMax`:return`GaugeRangeMaxNaN`;case`lowerInflectionPointValue`:return`GaugeLowerInflectionPointNaN`;case`upperInflectionPointValue`:return`GaugeUpperInflectionPointNaN`}return`Success`}var Wl=class e extends Io{dataRange;sectionRule;background;type=`gauge`;constructor(e,t,n){super(e,t,n),this.dataRange=Fa(this.getters,this.sheetId,e.dataRange),this.sectionRule=e.sectionRule,this.background=e.background}static validateChartDefinition(e,t){return e.checkValidations(t,Rl,e.chainValidations(zl(Hl,e.batchValidations),zl(Ul,e.batchValidations),Vl),e.chainValidations(Bl(Ul,e.batchValidations)))}static transformDefinition(e,t){let n;return e.dataRange&&(n=No(Qi(e.dataRange),t)),{...e,dataRange:n?B(n):void 0}}static getDefinitionFromContextCreation(e){return{background:e.background,title:e.title||``,type:`gauge`,dataRange:e.range?e.range[0]:void 0,sectionRule:{colors:{lowerColor:`#cc0000`,middleColor:`#f1c232`,upperColor:`#6aa84f`},rangeMin:`0`,rangeMax:`100`,lowerInflectionPoint:{type:`percentage`,value:`15`},upperInflectionPoint:{type:`percentage`,value:`40`}}}}copyForSheetId(t){let n=zo(this.sheetId,t,this.dataRange);return new e(this.getDefinitionWithSpecificRanges(n,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificRanges(this.dataRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificRanges(this.dataRange)}getDefinitionWithSpecificRanges(e,t){return{background:this.background,sectionRule:this.sectionRule,title:this.title,type:`gauge`,dataRange:e?this.getters.getRangeString(e,t||this.sheetId):void 0}}getDefinitionForExcel(){}getContextCreation(){return{background:this.background,title:this.title,range:this.dataRange?[this.getters.getRangeString(this.dataRange,this.sheetId)]:void 0}}updateRanges(t){let n=Bo(this.dataRange,t);return this.dataRange===n?this:new e(this.getDefinitionWithSpecificRanges(n),this.sheetId,this.getters)}};function Gl(e,t){let n=Dl(e,[],Jo(e.background),{locale:t});return n.options.hover=void 0,n.options.events=[],n.options.layout={padding:{left:30,right:30,top:e.title?10:25,bottom:25}},n.options.needle={width:10,borderColor:`#000000`,backgroundColor:`#000000`},n.options.valueLabel={display:!1,font:{size:30,color:`#FFFFFF`},backgroundColor:`#000000`,borderColor:`#000000`,borderRadius:5,padding:{top:5,right:5,bottom:5,left:5}},n}function Kl(e,t){let n=Gl(e,t.getLocale()),r=e.sectionRule.colors,i=e.sectionRule.lowerInflectionPoint,a=e.sectionRule.upperInflectionPoint,o=Number(i.value),s=Number(a.value),c=Number(e.sectionRule.rangeMin),l=Number(e.sectionRule.rangeMax),u=l-c,d=[];if(i.value!==``){let e=i.type===`number`?o:c+u*o/100;d.push({value:C(e,c,l),color:r.lowerColor})}if(a.value!==``){let e=a.type===`number`?s:c+u*s/100;d.push({value:C(e,c,l),color:r.middleColor})}let f=[],p=[];d.sort((e,t)=>e.value-t.value).map(e=>{f.push(e.value),p.push(e.color)}),f.push(l),p.push(r.upperColor);let m=e.dataRange,h=u/30,g=c-h,_,v=!1;if(m!==void 0){let e=t.getEvaluatedCell({sheetId:m.sheetId,col:m.zone.left,row:m.zone.top});e.type===`number`&&(g=C(e.value,c-h,l+h),_=()=>t.getRangeFormattedValues(m)[0],v=!0)}return n.options.valueLabel.display=v,n.options.valueLabel.formatter=_,n.data.datasets.push({data:f,minValue:Number(e.sectionRule.rangeMin),value:g,backgroundColor:p}),{chartJsConfig:n,background:t.getStyleOfSingleCellChart(e.background,m).background}}let ql={second:1e3,minute:1e3*60,hour:1e3*3600,day:1e3*3600*24,month:1e3*3600*24*30,year:1e3*3600*24*365},Jl={inSeconds:function(e){return Math.floor(e/ql.second)},inMinutes:function(e){return Math.floor(e/ql.minute)},inHours:function(e){return Math.floor(e/ql.hour)},inDays:function(e){return Math.floor(e/ql.day)},inMonths:function(e){return Math.floor(e/ql.month)},inYears:function(e){return Math.floor(e/ql.year)}},Yl=/^((d|dd|m|mm|yyyy|yy|hh|h|ss|a)(-|:|\s|\/))*(d|dd|m|mm|yyyy|yy|hh|h|ss|a)$/i;function Xl(e,t,n){let r=Zl(t),i=$l(e,r,n),a={};return i&&(a[i]=r),{parser:r,displayFormats:a,unit:i??!1,tooltipFormat:r}}function Zl(e){let t=e.indexOf(`h`);return e=t>=0?e.slice(0,t).replace(/m/g,`M`)+e.slice(t):e.replace(/m/g,`M`),e.includes(`a`)||(e=e.replace(/h/g,`H`)),e}function Ql(e){return e.includes(`s`)?`second`:e.includes(`m`)?`minute`:e.includes(`h`)||e.includes(`H`)?`hour`:e.includes(`d`)?`day`:e.includes(`M`)?`month`:`year`}function $l(e,t,n){let r=e.map(e=>yn(e,n)?.jsDate);if(r.some(e=>e===void 0)||e.length<2)return;let i=r.map(e=>e.getTime()),a=Nt(i)-Pt(i),o=Ql(t);return ql.second>=ql[o]&&Jl.inSeconds(a)<180?`second`:ql.minute>=ql[o]&&Jl.inMinutes(a)<180?`minute`:ql.hour>=ql[o]&&Jl.inHours(a)<96?`hour`:ql.day>=ql[o]&&Jl.inDays(a)<90?`day`:ql.month>=ql[o]&&Jl.inMonths(a)<36?`month`:`year`}var eu=class e extends Io{dataSets;labelRange;background;verticalAxisPosition;legendPosition;labelsAsText;stacked;aggregated;type=`line`;dataSetsHaveTitle;cumulative;constructor(e,t,n){super(e,t,n),this.dataSets=Vo(this.getters,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Fa(this.getters,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.labelsAsText=e.labelsAsText,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.cumulative=e.cumulative}static validateChartDefinition(e,t){return e.checkValidations(t,Yo,Xo)}static transformDefinition(e,t){return Go(e,t)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,labelsAsText:!1,legendPosition:`top`,title:e.title||``,type:`line`,verticalAxisPosition:`left`,labelRange:e.auxiliaryRange||void 0,stacked:!1,aggregated:!1,cumulative:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){return{type:`line`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>this.getters.getRangeString(e.dataRange,n||this.sheetId)),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,labelsAsText:this.labelsAsText,stacked:this.stacked,aggregated:this.aggregated,cumulative:this.cumulative}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map(e=>this.getters.getRangeString(e.dataRange,this.sheetId)),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}updateRanges(t){let{dataSets:n,labelRange:r,isStale:i}=Lo(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}getDefinitionForExcel(){let e=this.dataSets.map(e=>Uo(this.getters,e)).filter(e=>e.range!==``&&e.range!==Ie),t=Wo(this.getters,this.labelRange,Zo(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:dl(this.background||`#FFFFFF`),fontColor:dl(Jo(this.background)),dataSets:e,labelRange:t}}copyForSheetId(t){let n=Ro(this.sheetId,t,this.dataSets),r=zo(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}};function tu(e,t){if(e.length===0||e.every(e=>!e))return{labels:e,dataSetsValues:t};let n=[...e],r=S(t);for(let e=0;e<n.length;e++)if(!n[e]){n[e]=yt(n,e);for(let t of r)t.data[e]=void 0}return{labels:n,dataSetsValues:r}}function nu(e,t){return ou(e,t)||su(e,t)}function ru(e,t){return iu(e,t)&&du()?`time`:au(e,t)?`linear`:`category`}function iu(e,t){return!e.labelsAsText&&ou(e,t)}function au(e,t){return!e.labelsAsText&&su(e,t)}function ou(e,t){if(!e.labelRange||!su(e,t))return!1;let n=Ol(t,e.labelRange,Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle));return!!(n&&Yl.test(n))}function su(e,t){if(!e.labelRange)return!1;let n=t.getRangeValues(e.labelRange);return Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle)&&n.shift(),!(n.some(e=>isNaN(Number(e))&&e)||n.every(e=>!e))}function cu(e,t,n){let r=Jo(e.background),i=Dl(e,t,r,n),a={labels:{color:r,generateLabels(e){let{data:t}=e,n=window.Chart.defaults.plugins.legend.labels.generateLabels(e);for(let[e,r]of n.entries())r.fillStyle=t.datasets[e].borderColor;return n}}};return!e.labelRange&&e.dataSets.length===1||e.legendPosition===`none`?a.display=!1:a.position=e.legendPosition,Object.assign(i.options.plugins.legend||{},a),i.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},i.options.scales={x:{ticks:{padding:5,color:r}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:r,callback:e=>{if(e=Number(e),isNaN(e))return e;let{locale:t,format:r}=n;return z(e,{locale:t,format:!r&&Math.abs(e)>=1e3?`#,##`:r})}}}},e.stacked&&i.options?.scales?.y&&(i.options.scales.y.stacked=!0),i}function lu(e,t){let n=ru(e,t),r=kl(t,e.dataSets,e.labelRange),i=n===`linear`?r.values:r.formattedValues,a=jl(t,e.dataSets),o=Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle);o&&i.shift(),{labels:i,dataSetsValues:a}=wl(i,a),n===`time`&&({labels:i,dataSetsValues:a}=tu(i,a)),e.aggregated&&({labels:i,dataSetsValues:a}=Tl(i,a));let s=t.getLocale(),c=n===`category`,l={format:Al(t,e.dataSets),locale:s,truncateLabels:c},u=cu(e,i,l),d=Ol(t,e.labelRange,o);if(n===`time`){let e={type:`time`,time:Xl(i,d,s)};Object.assign(u.options.scales.x,e),u.options.scales.x.ticks.maxTicksLimit=15}else n===`linear`&&(u.options.scales.x.type=`linear`,u.options.scales.x.ticks.callback=e=>z(e,{format:d,locale:s}),u.options.plugins.tooltip.callbacks.title=e=>z(e[0].parsed.x||e[0].label,{locale:s,format:d}));let f=new qo;for(let[t,{label:r,data:o}]of a.entries()){if(e.cumulative){let e=0;o=o.map(t=>isNaN(t)?t:(e+=parseFloat(t),e))}[`linear`,`time`].includes(n)&&(o=o.map((e,t)=>({x:i[t]||void 0,y:e})));let a=f.next(),s=qt(a);e.stacked&&(s.a=.4);let c=Kt(s),l={label:r,data:o,tension:0,borderColor:a,backgroundColor:c,pointBackgroundColor:a,fill:e.stacked?Ml(t):!1};u.data.datasets.push(l)}return{chartJsConfig:u,background:e.background||`#FFFFFF`}}let uu=!1;function du(){if(!window.Chart)return!1;let e=new window.Chart._adapters._date({})._id===`luxon`;return!e&&!uu&&(uu=!0,console.warn(`'chartjs-adapter-luxon' time adapter is not installed. Time scale axes are disabled.`)),e}var fu=class e extends Io{dataSets;labelRange;background;legendPosition;type=`pie`;aggregated;dataSetsHaveTitle;constructor(e,t,n){super(e,t,n),this.dataSets=Vo(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Fa(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return Go(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,Yo,Xo)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,legendPosition:`top`,title:e.title||``,type:`pie`,labelRange:e.auxiliaryRange||void 0,aggregated:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map(e=>this.getters.getRangeString(e.dataRange,this.sheetId)),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}getDefinitionWithSpecificDataSets(e,t,n){return{type:`pie`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>this.getters.getRangeString(e.dataRange,n||this.sheetId)),legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated}}copyForSheetId(t){let n=Ro(this.sheetId,t,this.dataSets),r=zo(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinitionForExcel(){let e=this.dataSets.map(e=>Uo(this.getters,e)).filter(e=>e.range!==``&&e.range!==Ie),t=Wo(this.getters,this.labelRange,Zo(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:dl(this.background||`#FFFFFF`),fontColor:dl(Jo(this.background)),verticalAxisPosition:`left`,dataSets:e,labelRange:t}}updateRanges(t){let{dataSets:n,labelRange:r,isStale:i}=Lo(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function pu(e,t,n){let r=Jo(e.background),i=Dl(e,t,r,n),a={labels:{color:r}};return!e.labelRange&&e.dataSets.length===1||e.legendPosition===`none`?a.display=!1:a.position=e.legendPosition,Object.assign(i.options.plugins.legend||{},a),i.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},i.options.plugins.tooltip.callbacks.title=function(e){return e[0].dataset.label},i.options.plugins.tooltip.callbacks.label=function(e){let{format:t,locale:r}=n,i=e.dataset.data,a=e.dataIndex,o=hu(i,a),s=e.label||e.dataset.label,c=e.parsed.y??e.parsed,l=z(c,{format:!t&&Math.abs(c)>=1e3?`#,##`:t,locale:r});return s?`${s}: ${l} (${o}%)`:`${l} (${o}%)`},i}function mu(e,t){let n=[],r=Nt(t.map(e=>e.data.length));for(let t=0;t<=r;t++)n.push(e.next());return n}function hu(e,t){let n=e.filter(e=>typeof e==`number`).reduce((e,t)=>e+t,0);return n?(e[t]/n*100).toFixed(2):``}function gu(e,t){let n=kl(t,e.dataSets,e.labelRange).formattedValues,r=jl(t,e.dataSets);Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle)&&n.shift(),{labels:n,dataSetsValues:r}=wl(n,r),e.aggregated&&({labels:n,dataSetsValues:r}=Tl(n,r));let i=Al(t,e.dataSets),a=t.getLocale(),o=pu(e,n,{format:i,locale:a}),s=new qo;for(let{label:t,data:n}of r){let i=mu(s,r),a={label:t,data:n,borderColor:e.background||`#FFFFFF`,backgroundColor:i};o.data.datasets.push(a)}return{chartJsConfig:o,background:e.background||`#FFFFFF`}}let _u=new H;_u.add(`bar`,{match:e=>e===`bar`,createChart:(e,t,n)=>new Fl(e,t,n),getChartRuntime:Ll,validateChartDefinition:(e,t)=>Fl.validateChartDefinition(e,t),transformDefinition:(e,t)=>Fl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>Fl.getDefinitionFromContextCreation(e),name:y(`Bar`),sequence:10}),_u.add(`line`,{match:e=>e===`line`,createChart:(e,t,n)=>new eu(e,t,n),getChartRuntime:lu,validateChartDefinition:(e,t)=>eu.validateChartDefinition(e,t),transformDefinition:(e,t)=>eu.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>eu.getDefinitionFromContextCreation(e),name:y(`Line`),sequence:20}),_u.add(`pie`,{match:e=>e===`pie`,createChart:(e,t,n)=>new fu(e,t,n),getChartRuntime:gu,validateChartDefinition:(e,t)=>fu.validateChartDefinition(e,t),transformDefinition:(e,t)=>fu.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>fu.getDefinitionFromContextCreation(e),name:y(`Pie`),sequence:30}),_u.add(`scorecard`,{match:e=>e===`scorecard`,createChart:(e,t,n)=>new os(e,t,n),getChartRuntime:cs,validateChartDefinition:(e,t)=>os.validateChartDefinition(e,t),transformDefinition:(e,t)=>os.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>os.getDefinitionFromContextCreation(e),name:y(`Scorecard`),sequence:40}),_u.add(`gauge`,{match:e=>e===`gauge`,createChart:(e,t,n)=>new Wl(e,t,n),getChartRuntime:Kl,validateChartDefinition:(e,t)=>Wl.validateChartDefinition(e,t),transformDefinition:(e,t)=>Wl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>Wl.getDefinitionFromContextCreation(e),name:y(`Gauge`),sequence:50});let vu=new H;vu.add(`line`,Fo),vu.add(`bar`,Fo),vu.add(`pie`,Fo),vu.add(`gauge`,Fo),vu.add(`scorecard`,xs);let yu=new H;U`
|
|
291
|
+
`;var cl=class extends t.Component{static template=`o-spreadsheet-LinkEditor`;static components={Menu:pc};menuItems=sl.getMenuItems();link=(0,t.useState)(this.defaultState);menu=(0,t.useState)({isOpen:!1});linkEditorRef=(0,t.useRef)(`linkEditor`);position=rc(this.linkEditorRef);urlInput=(0,t.useRef)(`urlInput`);setup(){(0,t.onMounted)(()=>this.urlInput.el?.focus())}get defaultState(){let{col:e,row:t}=this.props.cellPosition,n=this.env.model.getters.getActiveSheetId(),r=this.env.model.getters.getEvaluatedCell({sheetId:n,col:e,row:t});return r.link?{url:r.link.url,label:r.formattedValue,isUrlEditable:r.link.isUrlEditable}:{label:r.formattedValue,url:``,isUrlEditable:!0}}get menuPosition(){return{x:this.position.x+320-12-2,y:this.position.y+100}}onSpecialLink(e){let{detail:t}=e,n=$a(t);n&&(this.link.url=n.url,this.link.label=n.label,this.link.isUrlEditable=n.isUrlEditable)}getUrlRepresentation(e){return Za(e,this.env.model.getters)}openMenu(){this.menu.isOpen=!0}removeLink(){this.link.url=``,this.link.isUrlEditable=!0}save(){let{col:e,row:t}=this.props.cellPosition,n=this.env.model.getters.getLocale(),r=this.link.label?Ic(this.link.label,n):this.link.url;this.env.model.dispatch(`UPDATE_CELL`,{col:e,row:t,sheetId:this.env.model.getters.getActiveSheetId(),content:st(r,this.link.url)}),this.props.onClosed?.()}cancel(){this.props.onClosed?.()}onKeyDown(e){switch(e.key){case`Enter`:this.link.url&&this.save(),e.stopPropagation(),e.preventDefault();break;case`Escape`:this.cancel(),e.stopPropagation();break}}};let ll={onOpen:(e,t)=>({isOpen:!0,props:{cellPosition:e},Component:cl,cellCorner:`BottomLeft`})};cl.props={cellPosition:Object,onClosed:{type:Function,optional:!0}};let ul=new H;ul.add(`ErrorToolTip`,Bs).add(`LinkCell`,hc).add(`LinkEditor`,ll).add(`FilterMenu`,Ws);function dl(e){return e=zt(e).replace(`#`,``),e.length===8?e.slice(6)+e.slice(0,6):e}let fl={wrongPasteSelection:y(`This operation is not allowed with multiple selections.`),willRemoveExistingMerge:y(`Cannot perform this action on merged cells. Unmerge the cells and try again.`),wrongFigurePasteOption:y(`Cannot do a special paste of a figure.`),frozenPaneOverlap:y(`This operation is not allowed due to an overlapping frozen pane.`)};function pl(e,t){t.isSuccessful||(t.reasons.includes(`WrongPasteSelection`)?e.raiseError(fl.wrongPasteSelection):t.reasons.includes(`WillRemoveExistingMerge`)?e.raiseError(fl.willRemoveExistingMerge):t.reasons.includes(`WrongFigurePasteOption`)?e.raiseError(fl.wrongFigurePasteOption):t.reasons.includes(`FrozenPaneOverlap`)&&e.raiseError(fl.frozenPaneOverlap))}function ml(e,t,n){pl(e,e.model.dispatch(`PASTE`,{target:t,pasteOption:n}))}function hl(e,t,n,r){pl(e,e.model.dispatch(`PASTE_FROM_OS_CLIPBOARD`,{target:t,text:n,pasteOption:r}))}let gl={Errors:{InvalidRange:y(`The range is invalid`),FirstArgMissing:y(`The argument is missing. Please provide a value`),SecondArgMissing:y(`The second argument is missing. Please provide a value`),MinNaN:y(`The minpoint must be a number`),MidNaN:y(`The midpoint must be a number`),MaxNaN:y(`The maxpoint must be a number`),ValueUpperInflectionNaN:y(`The first value must be a number`),ValueLowerInflectionNaN:y(`The second value must be a number`),MinBiggerThanMax:y(`Minimum must be smaller then Maximum`),MinBiggerThanMid:y(`Minimum must be smaller then Midpoint`),MidBiggerThanMax:y(`Midpoint must be smaller then Maximum`),LowerBiggerThanUpper:y(`Lower inflection point must be smaller than upper inflection point`),MinInvalidFormula:y(`Invalid Minpoint formula`),MaxInvalidFormula:y(`Invalid Maxpoint formula`),MidInvalidFormula:y(`Invalid Midpoint formula`),ValueUpperInvalidFormula:y(`Invalid upper inflection point formula`),ValueLowerInvalidFormula:y(`Invalid lower inflection point formula`),EmptyRange:y(`A range needs to be defined`),Unexpected:y(`The rule is invalid for an unknown reason`)},ColorScale:y(`Color scale`),IconSet:y(`Icon set`)},_l={IsEmpty:y(`Is empty`),IsNotEmpty:y(`Is not empty`),ContainsText:y(`Contains`),NotContains:y(`Does not contain`),BeginsWith:y(`Starts with`),EndsWith:y(`Ends with`),Equal:y(`Is equal to`),NotEqual:y(`Is not equal to`),GreaterThan:y(`Is greater than`),GreaterThanOrEqual:y(`Is greater than or equal to`),LessThan:y(`Is less than`),LessThanOrEqual:y(`Is less than or equal to`),Between:y(`Is between`),NotBetween:y(`Is not between`)},vl={Series:y(`Series`),Errors:{Unexpected:y(`The chart definition is invalid for an unknown reason`),InvalidDataSet:y(`The dataset is invalid`),InvalidLabelRange:y(`Labels are invalid`),InvalidScorecardKeyValue:y(`The key value is invalid`),InvalidScorecardBaseline:y(`The baseline value is invalid`),InvalidGaugeDataRange:y(`The data range is invalid`),EmptyGaugeRangeMin:y(`A minimum range limit value is needed`),GaugeRangeMinNaN:y(`The minimum range limit value must be a number`),EmptyGaugeRangeMax:y(`A maximum range limit value is needed`),GaugeRangeMaxNaN:y(`The maximum range limit value must be a number`),GaugeRangeMinBiggerThanRangeMax:y(`Minimum range limit must be smaller than maximum range limit`),GaugeLowerInflectionPointNaN:y(`The lower inflection point value must be a number`),GaugeUpperInflectionPointNaN:y(`The upper inflection point value must be a number`)}},yl={Custom:y(`Custom`)},bl=y(`Merged cells are preventing this operation. Unmerge those cells and try again.`),xl={Errors:{Unexpected:y(`Cannot split the selection for an unknown reason`),NoSplitSeparatorInSelection:y(`There is no match for the selected separator in the selection`),MoreThanOneColumnSelected:y(`Only a selection from a single column can be split`),SplitWillOverwriteContent:y(`Splitting will overwrite existing content`)}},Sl={Errors:{Unexpected:y(`Cannot remove duplicates for an unknown reason`),MoreThanOneRangeSelected:y(`Please select only one range of cells`),EmptyTarget:y(`Please select a range of cells containing values.`),NoColumnsProvided:y(`Please select at latest one column to analyze.`),WillRemoveExistingMerge:fl.willRemoveExistingMerge}},G={DateIs:{today:y(`today`),yesterday:y(`yesterday`),tomorrow:y(`tomorrow`),lastWeek:y(`in the past week`),lastMonth:y(`in the past month`),lastYear:y(`in the past year`)},DateIsBefore:{today:y(`today`),yesterday:y(`yesterday`),tomorrow:y(`tomorrow`),lastWeek:y(`one week ago`),lastMonth:y(`one month ago`),lastYear:y(`one year ago`)},CriterionError:{notEmptyValue:y(`The value must not be empty`),numberValue:y(`The value must be a number`),dateValue:y(`The value must be a date`),validRange:y(`The value must be a valid range`)}};function Cl(e,t){if(t.dataRange){let n=t.labelCell?[B(t.labelCell.zone)]:[],r=pa([B(t.dataRange.zone)],n)[0];if(r===void 0)return[];let i=e.getRangeFromSheetXC(t.dataRange.sheetId,r);return e.getRangeValues(i).map(e=>e===``?void 0:e)}return[]}function wl(e,t){let n=w(0,Math.max(e.length,...t.map(e=>e.data?.length||0))).filter(n=>{let r=e[n],i=t.map(e=>e.data?.[n]);return r||i.some(e=>e===0||!!e)});return{labels:n.map(t=>e[t]||``),dataSetsValues:t.map(e=>({...e,data:n.map(t=>e.data[t])}))}}function Tl(e,t){let n=e=>typeof e==`number`?e:0,r=new Set(e),i={};r.forEach(e=>{i[e]=Array(t.length).fill(0)});for(let r of w(0,e.length)){let a=e[r];for(let e of w(0,t.length))i[a][e]+=n(t[e].data[r])}return{labels:Array.from(r),dataSetsValues:t.map((e,t)=>({...e,data:Array.from(r).map(e=>i[e][t])}))}}function El(e){return e?e.length>20?e.substring(0,20)+`…`:e:``}function Dl(e,t,n,{format:r,locale:i,truncateLabels:a=!0}){let o={responsive:!0,maintainAspectRatio:!1,layout:{padding:{left:20,right:20,top:e.title?10:25,bottom:10}},elements:{line:{fill:!1},point:{hitRadius:15}},animation:!1,plugins:{title:{display:!!e.title,text:y(e.title),color:n,font:{size:22,weight:`normal`}},legend:{onClick:()=>{}},tooltip:{callbacks:{label:function(e){let t=e.dataset?.label||e.label,n=e.parsed.y??e.parsed,a=z(n,{format:!r&&Math.abs(n)>=1e3?`#,##`:r,locale:i});return t?`${t}: ${a}`:a}}}}};return{type:e.type,options:o,data:{labels:a?t.map(El):t,datasets:[]},plugins:[]}}function Ol(e,t,n){if(!t)return;let{sheetId:r,zone:i}=t,a=ba(i).map(t=>e.getEvaluatedCell({sheetId:r,...t}).format);return n&&a.shift(),a.find(e=>e!==void 0)}function kl(e,t,n){let r={values:[],formattedValues:[]};if(n)!n.invalidXc&&!n.invalidSheetName&&(r={formattedValues:e.getRangeFormattedValues(n),values:e.getRangeValues(n).map(e=>String(e))});else if(t.length===1){let n=Cl(e,t[0]).length;for(let e=0;e<n;e++)r.formattedValues.push(``),r.values.push(``)}else t[0]&&(r={formattedValues:w(0,Cl(e,t[0]).length).map(e=>e.toString()),values:r.formattedValues});return r}function Al(e,t){for(let n of t){let t=e.getRangeFormats(n.dataRange).find(e=>e!==void 0&&!_i(e));if(t)return t}}function jl(e,t){let n=[];for(let[r,i]of Object.entries(t)){let t;if(i.labelCell){let n=i.labelCell,a=n?e.getEvaluatedCell({sheetId:n.sheetId,col:n.zone.left,row:n.zone.top}):void 0;t=a&&n?El(a.formattedValue):t=`${vl.Series} ${parseInt(r)+1}`}else t=t=`${vl.Series} ${parseInt(r)+1}`;let a=i.dataRange?Cl(e,i):[];n.push({data:a,label:t})}return n}function Ml(e){return e===0?`origin`:e-1}function Nl(e,t,n){let r=document.createElement(`div`);r.style.width=`${t.width}px`,r.style.height=`${t.height}px`;let i=document.createElement(`canvas`);if(r.append(i),i.setAttribute(`width`,t.width.toString()),i.setAttribute(`height`,t.height.toString()),document.body.append(r),`chartJsConfig`in e){e.chartJsConfig.plugins=[Pl];let t=new window.Chart(i,S(e.chartJsConfig)),n=t.toBase64Image();return t.destroy(),r.remove(),n}else if(n===`scorecard`){ss(gs(t,e),i);let n=i.toDataURL();return r.remove(),n}return``}let Pl={id:`customCanvasBackgroundColor`,beforeDraw:e=>{let{ctx:t}=e;t.save(),t.globalCompositeOperation=`destination-over`,t.fillStyle=`#ffffff`,t.fillRect(0,0,e.width,e.height),t.restore()}};var Fl=class e extends Io{dataSets;labelRange;background;verticalAxisPosition;legendPosition;stacked;aggregated;type=`bar`;dataSetsHaveTitle;constructor(e,t,n){super(e,t,n),this.dataSets=Vo(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Fa(n,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return Go(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,Yo,Xo)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,stacked:!1,aggregated:!1,legendPosition:`top`,title:e.title||``,type:`bar`,verticalAxisPosition:`left`,labelRange:e.auxiliaryRange||void 0}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map(e=>this.getters.getRangeString(e.dataRange,this.sheetId)),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}copyForSheetId(t){let n=Ro(this.sheetId,t,this.dataSets),r=zo(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){return{type:`bar`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>this.getters.getRangeString(e.dataRange,n||this.sheetId)),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,stacked:this.stacked,aggregated:this.aggregated}}getDefinitionForExcel(){let e=this.dataSets.map(e=>Uo(this.getters,e)).filter(e=>e.range!==``&&e.range!==Ie),t=Wo(this.getters,this.labelRange,Zo(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:dl(this.background||`#FFFFFF`),fontColor:dl(Jo(this.background)),dataSets:e,labelRange:t}}updateRanges(t){let{dataSets:n,labelRange:r,isStale:i}=Lo(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function Il(e,t,n){let r=Jo(e.background),i=Dl(e,t,r,n),a={labels:{color:r}};return!e.labelRange&&e.dataSets.length===1||e.legendPosition===`none`?a.display=!1:a.position=e.legendPosition,i.options.plugins.legend={...i.options.plugins?.legend,...a},i.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},i.options.scales={x:{ticks:{padding:5,color:r}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:r,callback:e=>{if(e=Number(e),isNaN(e))return e;let{locale:t,format:r}=n;return z(e,{locale:t,format:!r&&Math.abs(e)>=1e3?`#,##`:r})}}}},e.stacked&&(i.options.scales.x.stacked=!0,i.options.scales.y.stacked=!0),i}function Ll(e,t){let n=kl(t,e.dataSets,e.labelRange).formattedValues,r=jl(t,e.dataSets);Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle)&&n.shift(),{labels:n,dataSetsValues:r}=wl(n,r),e.aggregated&&({labels:n,dataSetsValues:r}=Tl(n,r));let i=Al(t,e.dataSets),a=t.getLocale(),o=Il(e,n,{format:i,locale:a}),s=new qo;for(let{label:e,data:t}of r){let n=s.next(),r={label:e,data:t,borderColor:n,backgroundColor:n};o.data.datasets.push(r)}return{chartJsConfig:o,background:e.background||`#FFFFFF`}}function Rl(e){return e.dataRange&&!Wi.test(e.dataRange)?`InvalidGaugeDataRange`:`Success`}function zl(e,t){return t(t=>t.sectionRule?e(t.sectionRule.rangeMin,`rangeMin`):`Success`,t=>t.sectionRule?e(t.sectionRule.rangeMax,`rangeMax`):`Success`)}function Bl(e,t){return t(t=>t.sectionRule?e(t.sectionRule.lowerInflectionPoint.value,`lowerInflectionPointValue`):`Success`,t=>t.sectionRule?e(t.sectionRule.upperInflectionPoint.value,`upperInflectionPointValue`):`Success`)}function Vl(e){return e.sectionRule&&Number(e.sectionRule.rangeMin)>=Number(e.sectionRule.rangeMax)?`GaugeRangeMinBiggerThanRangeMax`:`Success`}function Hl(e,t){if(e===``)switch(t){case`rangeMin`:return`EmptyGaugeRangeMin`;case`rangeMax`:return`EmptyGaugeRangeMax`}return`Success`}function Ul(e,t){if(isNaN(e))switch(t){case`rangeMin`:return`GaugeRangeMinNaN`;case`rangeMax`:return`GaugeRangeMaxNaN`;case`lowerInflectionPointValue`:return`GaugeLowerInflectionPointNaN`;case`upperInflectionPointValue`:return`GaugeUpperInflectionPointNaN`}return`Success`}var Wl=class e extends Io{dataRange;sectionRule;background;type=`gauge`;constructor(e,t,n){super(e,t,n),this.dataRange=Fa(this.getters,this.sheetId,e.dataRange),this.sectionRule=e.sectionRule,this.background=e.background}static validateChartDefinition(e,t){return e.checkValidations(t,Rl,e.chainValidations(zl(Hl,e.batchValidations),zl(Ul,e.batchValidations),Vl),e.chainValidations(Bl(Ul,e.batchValidations)))}static transformDefinition(e,t){let n;return e.dataRange&&(n=No(Qi(e.dataRange),t)),{...e,dataRange:n?B(n):void 0}}static getDefinitionFromContextCreation(e){return{background:e.background,title:e.title||``,type:`gauge`,dataRange:e.range?e.range[0]:void 0,sectionRule:{colors:{lowerColor:`#cc0000`,middleColor:`#f1c232`,upperColor:`#6aa84f`},rangeMin:`0`,rangeMax:`100`,lowerInflectionPoint:{type:`percentage`,value:`15`},upperInflectionPoint:{type:`percentage`,value:`40`}}}}copyForSheetId(t){let n=zo(this.sheetId,t,this.dataRange);return new e(this.getDefinitionWithSpecificRanges(n,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificRanges(this.dataRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificRanges(this.dataRange)}getDefinitionWithSpecificRanges(e,t){return{background:this.background,sectionRule:this.sectionRule,title:this.title,type:`gauge`,dataRange:e?this.getters.getRangeString(e,t||this.sheetId):void 0}}getDefinitionForExcel(){}getContextCreation(){return{background:this.background,title:this.title,range:this.dataRange?[this.getters.getRangeString(this.dataRange,this.sheetId)]:void 0}}updateRanges(t){let n=Bo(this.dataRange,t);return this.dataRange===n?this:new e(this.getDefinitionWithSpecificRanges(n),this.sheetId,this.getters)}};function Gl(e,t){let n=Dl(e,[],Jo(e.background),{locale:t});return n.options.hover=void 0,n.options.events=[],n.options.layout={padding:{left:30,right:30,top:e.title?10:25,bottom:25}},n.options.needle={width:10,borderColor:`#000000`,backgroundColor:`#000000`},n.options.valueLabel={display:!1,font:{size:30,color:`#FFFFFF`},backgroundColor:`#000000`,borderColor:`#000000`,borderRadius:5,padding:{top:5,right:5,bottom:5,left:5}},n}function Kl(e,t){let n=Gl(e,t.getLocale()),r=e.sectionRule.colors,i=e.sectionRule.lowerInflectionPoint,a=e.sectionRule.upperInflectionPoint,o=Number(i.value),s=Number(a.value),c=Number(e.sectionRule.rangeMin),l=Number(e.sectionRule.rangeMax),u=l-c,d=[];if(i.value!==``){let e=i.type===`number`?o:c+u*o/100;d.push({value:C(e,c,l),color:r.lowerColor})}if(a.value!==``){let e=a.type===`number`?s:c+u*s/100;d.push({value:C(e,c,l),color:r.middleColor})}let f=[],p=[];d.sort((e,t)=>e.value-t.value).map(e=>{f.push(e.value),p.push(e.color)}),f.push(l),p.push(r.upperColor);let m=e.dataRange,h=u/30,g=c-h,_,v=!1;if(m!==void 0){let e=t.getEvaluatedCell({sheetId:m.sheetId,col:m.zone.left,row:m.zone.top});e.type===`number`&&(g=C(e.value,c-h,l+h),_=()=>t.getRangeFormattedValues(m)[0],v=!0)}return n.options.valueLabel.display=v,n.options.valueLabel.formatter=_,n.data.datasets.push({data:f,minValue:Number(e.sectionRule.rangeMin),value:g,backgroundColor:p}),{chartJsConfig:n,background:t.getStyleOfSingleCellChart(e.background,m).background}}let ql={second:1e3,minute:1e3*60,hour:1e3*3600,day:1e3*3600*24,month:1e3*3600*24*30,year:1e3*3600*24*365},Jl={inSeconds:function(e){return Math.floor(e/ql.second)},inMinutes:function(e){return Math.floor(e/ql.minute)},inHours:function(e){return Math.floor(e/ql.hour)},inDays:function(e){return Math.floor(e/ql.day)},inMonths:function(e){return Math.floor(e/ql.month)},inYears:function(e){return Math.floor(e/ql.year)}},Yl=/^((d|dd|m|mm|yyyy|yy|hh|h|ss|a)(-|:|\s|\/))*(d|dd|m|mm|yyyy|yy|hh|h|ss|a)$/i;function Xl(e,t,n){let r=Zl(t),i=$l(e,r,n),a={};return i&&(a[i]=r),{parser:r,displayFormats:a,unit:i??!1,tooltipFormat:r}}function Zl(e){let t=e.indexOf(`h`);return e=t>=0?e.slice(0,t).replace(/m/g,`M`)+e.slice(t):e.replace(/m/g,`M`),e.includes(`a`)||(e=e.replace(/h/g,`H`)),e}function Ql(e){return e.includes(`s`)?`second`:e.includes(`m`)?`minute`:e.includes(`h`)||e.includes(`H`)?`hour`:e.includes(`d`)?`day`:e.includes(`M`)?`month`:`year`}function $l(e,t,n){let r=e.map(e=>yn(e,n)?.jsDate);if(r.some(e=>e===void 0)||e.length<2)return;let i=r.map(e=>e.getTime()),a=Nt(i)-Pt(i),o=Ql(t);return ql.second>=ql[o]&&Jl.inSeconds(a)<180?`second`:ql.minute>=ql[o]&&Jl.inMinutes(a)<180?`minute`:ql.hour>=ql[o]&&Jl.inHours(a)<96?`hour`:ql.day>=ql[o]&&Jl.inDays(a)<90?`day`:ql.month>=ql[o]&&Jl.inMonths(a)<36?`month`:`year`}var eu=class e extends Io{dataSets;labelRange;background;verticalAxisPosition;legendPosition;labelsAsText;stacked;aggregated;type=`line`;dataSetsHaveTitle;cumulative;constructor(e,t,n){super(e,t,n),this.dataSets=Vo(this.getters,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Fa(this.getters,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.labelsAsText=e.labelsAsText,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.cumulative=e.cumulative}static validateChartDefinition(e,t){return e.checkValidations(t,Yo,Xo)}static transformDefinition(e,t){return Go(e,t)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,labelsAsText:!1,legendPosition:`top`,title:e.title||``,type:`line`,verticalAxisPosition:`left`,labelRange:e.auxiliaryRange||void 0,stacked:!1,aggregated:!1,cumulative:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){return{type:`line`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>this.getters.getRangeString(e.dataRange,n||this.sheetId)),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,labelsAsText:this.labelsAsText,stacked:this.stacked,aggregated:this.aggregated,cumulative:this.cumulative}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map(e=>this.getters.getRangeString(e.dataRange,this.sheetId)),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}updateRanges(t){let{dataSets:n,labelRange:r,isStale:i}=Lo(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}getDefinitionForExcel(){let e=this.dataSets.map(e=>Uo(this.getters,e)).filter(e=>e.range!==``&&e.range!==Ie),t=Wo(this.getters,this.labelRange,Zo(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:dl(this.background||`#FFFFFF`),fontColor:dl(Jo(this.background)),dataSets:e,labelRange:t}}copyForSheetId(t){let n=Ro(this.sheetId,t,this.dataSets),r=zo(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}};function tu(e,t){if(e.length===0||e.every(e=>!e))return{labels:e,dataSetsValues:t};let n=[...e],r=S(t);for(let e=0;e<n.length;e++)if(!n[e]){n[e]=yt(n,e);for(let t of r)t.data[e]=void 0}return{labels:n,dataSetsValues:r}}function nu(e,t){return ou(e,t)||su(e,t)}function ru(e,t){return iu(e,t)&&du()?`time`:au(e,t)?`linear`:`category`}function iu(e,t){return!e.labelsAsText&&ou(e,t)}function au(e,t){return!e.labelsAsText&&su(e,t)}function ou(e,t){if(!e.labelRange||!su(e,t))return!1;let n=Ol(t,e.labelRange,Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle));return!!(n&&Yl.test(n))}function su(e,t){if(!e.labelRange)return!1;let n=t.getRangeValues(e.labelRange);return Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle)&&n.shift(),!(n.some(e=>isNaN(Number(e))&&e)||n.every(e=>!e))}function cu(e,t,n){let r=Jo(e.background),i=Dl(e,t,r,n),a={labels:{color:r,generateLabels(e){let{data:t}=e,n=window.Chart.defaults.plugins.legend.labels.generateLabels(e);for(let[e,r]of n.entries())r.fillStyle=t.datasets[e].borderColor;return n}}};return!e.labelRange&&e.dataSets.length===1||e.legendPosition===`none`?a.display=!1:a.position=e.legendPosition,Object.assign(i.options.plugins.legend||{},a),i.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},i.options.scales={x:{ticks:{padding:5,color:r}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:r,callback:e=>{if(e=Number(e),isNaN(e))return e;let{locale:t,format:r}=n;return z(e,{locale:t,format:!r&&Math.abs(e)>=1e3?`#,##`:r})}}}},e.stacked&&i.options?.scales?.y&&(i.options.scales.y.stacked=!0),i}function lu(e,t){let n=ru(e,t),r=kl(t,e.dataSets,e.labelRange),i=n===`linear`?r.values:r.formattedValues,a=jl(t,e.dataSets),o=Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle);o&&i.shift(),{labels:i,dataSetsValues:a}=wl(i,a),n===`time`&&({labels:i,dataSetsValues:a}=tu(i,a)),e.aggregated&&({labels:i,dataSetsValues:a}=Tl(i,a));let s=t.getLocale(),c=n===`category`,l={format:Al(t,e.dataSets),locale:s,truncateLabels:c},u=cu(e,i,l),d=Ol(t,e.labelRange,o);if(n===`time`){let e={type:`time`,time:Xl(i,d,s)};Object.assign(u.options.scales.x,e),u.options.scales.x.ticks.maxTicksLimit=15}else n===`linear`&&(u.options.scales.x.type=`linear`,u.options.scales.x.ticks.callback=e=>z(e,{format:d,locale:s}),u.options.plugins.tooltip.callbacks.title=e=>z(e[0].parsed.x||e[0].label,{locale:s,format:d}));let f=new qo;for(let[t,{label:r,data:o}]of a.entries()){if(e.cumulative){let e=0;o=o.map(t=>isNaN(t)?t:(e+=parseFloat(t),e))}[`linear`,`time`].includes(n)&&(o=o.map((e,t)=>({x:i[t]||void 0,y:e})));let a=f.next(),s=qt(a);e.stacked&&(s.a=.4);let c=Kt(s),l={label:r,data:o,tension:0,borderColor:a,backgroundColor:c,pointBackgroundColor:a,fill:e.stacked?Ml(t):!1};u.data.datasets.push(l)}return{chartJsConfig:u,background:e.background||`#FFFFFF`}}let uu=!1;function du(){if(!window.Chart)return!1;let e=new window.Chart._adapters._date({})._id===`luxon`;return!e&&!uu&&(uu=!0,console.warn(`'chartjs-adapter-luxon' time adapter is not installed. Time scale axes are disabled.`)),e}var fu=class e extends Io{dataSets;labelRange;background;legendPosition;type=`pie`;aggregated;dataSetsHaveTitle;constructor(e,t,n){super(e,t,n),this.dataSets=Vo(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Fa(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return Go(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,Yo,Xo)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,legendPosition:`top`,title:e.title||``,type:`pie`,labelRange:e.auxiliaryRange||void 0,aggregated:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map(e=>this.getters.getRangeString(e.dataRange,this.sheetId)),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}getDefinitionWithSpecificDataSets(e,t,n){return{type:`pie`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>this.getters.getRangeString(e.dataRange,n||this.sheetId)),legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated}}copyForSheetId(t){let n=Ro(this.sheetId,t,this.dataSets),r=zo(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinitionForExcel(){let e=this.dataSets.map(e=>Uo(this.getters,e)).filter(e=>e.range!==``&&e.range!==Ie),t=Wo(this.getters,this.labelRange,Zo(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:dl(this.background||`#FFFFFF`),fontColor:dl(Jo(this.background)),verticalAxisPosition:`left`,dataSets:e,labelRange:t}}updateRanges(t){let{dataSets:n,labelRange:r,isStale:i}=Lo(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function pu(e,t,n){let r=Jo(e.background),i=Dl(e,t,r,n),a={labels:{color:r}};return!e.labelRange&&e.dataSets.length===1||e.legendPosition===`none`?a.display=!1:a.position=e.legendPosition,Object.assign(i.options.plugins.legend||{},a),i.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},i.options.plugins.tooltip.callbacks.title=function(e){return e[0].dataset.label},i.options.plugins.tooltip.callbacks.label=function(e){let{format:t,locale:r}=n,i=e.dataset.data,a=e.dataIndex,o=hu(i,a),s=e.label||e.dataset.label,c=e.parsed.y??e.parsed,l=z(c,{format:!t&&Math.abs(c)>=1e3?`#,##`:t,locale:r});return s?`${s}: ${l} (${o}%)`:`${l} (${o}%)`},i}function mu(e,t){let n=[],r=Nt(t.map(e=>e.data.length));for(let t=0;t<=r;t++)n.push(e.next());return n}function hu(e,t){let n=e.filter(e=>typeof e==`number`).reduce((e,t)=>e+t,0);return n?(e[t]/n*100).toFixed(2):``}function gu(e,t){let n=kl(t,e.dataSets,e.labelRange).formattedValues,r=jl(t,e.dataSets);Zo(e.labelRange,e.dataSets[0],e.dataSetsHaveTitle)&&n.shift(),{labels:n,dataSetsValues:r}=wl(n,r),e.aggregated&&({labels:n,dataSetsValues:r}=Tl(n,r));let i=Al(t,e.dataSets),a=t.getLocale(),o=pu(e,n,{format:i,locale:a}),s=new qo;for(let{label:t,data:n}of r){let i=mu(s,r),a={label:t,data:n,borderColor:e.background||`#FFFFFF`,backgroundColor:i};o.data.datasets.push(a)}return{chartJsConfig:o,background:e.background||`#FFFFFF`}}let _u=new H;_u.add(`bar`,{match:e=>e===`bar`,createChart:(e,t,n)=>new Fl(e,t,n),getChartRuntime:Ll,validateChartDefinition:(e,t)=>Fl.validateChartDefinition(e,t),transformDefinition:(e,t)=>Fl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>Fl.getDefinitionFromContextCreation(e),name:y(`Bar`),sequence:10}),_u.add(`line`,{match:e=>e===`line`,createChart:(e,t,n)=>new eu(e,t,n),getChartRuntime:lu,validateChartDefinition:(e,t)=>eu.validateChartDefinition(e,t),transformDefinition:(e,t)=>eu.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>eu.getDefinitionFromContextCreation(e),name:y(`Line`),sequence:20}),_u.add(`pie`,{match:e=>e===`pie`,createChart:(e,t,n)=>new fu(e,t,n),getChartRuntime:gu,validateChartDefinition:(e,t)=>fu.validateChartDefinition(e,t),transformDefinition:(e,t)=>fu.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>fu.getDefinitionFromContextCreation(e),name:y(`Pie`),sequence:30}),_u.add(`scorecard`,{match:e=>e===`scorecard`,createChart:(e,t,n)=>new os(e,t,n),getChartRuntime:cs,validateChartDefinition:(e,t)=>os.validateChartDefinition(e,t),transformDefinition:(e,t)=>os.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>os.getDefinitionFromContextCreation(e),name:y(`Scorecard`),sequence:40}),_u.add(`gauge`,{match:e=>e===`gauge`,createChart:(e,t,n)=>new Wl(e,t,n),getChartRuntime:Kl,validateChartDefinition:(e,t)=>Wl.validateChartDefinition(e,t),transformDefinition:(e,t)=>Wl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>Wl.getDefinitionFromContextCreation(e),name:y(`Gauge`),sequence:50});let vu=new H;vu.add(`line`,Fo),vu.add(`bar`,Fo),vu.add(`pie`,Fo),vu.add(`gauge`,Fo),vu.add(`scorecard`,xs);let yu=new H;U`
|
|
292
292
|
.o-chart-container {
|
|
293
293
|
width: 100%;
|
|
294
294
|
height: 100%;
|
|
@@ -2677,4 +2677,4 @@
|
|
|
2677
2677
|
<Relationships xmlns="${Hw.Relationships}">
|
|
2678
2678
|
<Relationship ${Y(e)} />
|
|
2679
2679
|
</Relationships>
|
|
2680
|
-
`),`_rels/.rels`)}var AN=class extends Bk{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers=[];status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},n={},r=[],i=new ko,a=!0){super(),v(),r=TO(e,r);let o=yO(e,a);this.state=new fM,this.uuidGenerator=i,this.config=this.setupConfig(n),this.session=this.setupSession(o.revisionId),this.coreGetters={},this.range=new uk(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.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.getters={isReadonly:()=>this.config.mode===`readonly`||this.config.mode===`dashboard`,isDashboard:()=>this.config.mode===`dashboard`},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new dM(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of yj.getAll())this.setupCorePlugin(e,o);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(r);for(let e of Sj.getAll()){let t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of xj.getAll()){let t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of bj.getAll()){let t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch(`START`),this.selection.observe(this,{handleEvent:()=>this.trigger(`update`)}),this.setupSessionEvents(),this.joinSession(),n.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),(0,t.markRaw)(this)}joinSession(){this.session.join(this.config.client)}async leaveSession(){let e=this.getters.isReadonly()?void 0:vt(()=>this.exportData());await this.session.leave(e)}setupUiPlugin(e){let t=new e(this.uiPluginConfig);for(let n of e.getters){if(!(n in t))throw Error(`Invalid getter name: ${n} for plugin ${t.constructor}`);if(n in this.getters)throw Error(`Getter "${n}" is already defined.`);this.getters[n]=t[n].bind(t)}let n=e.layers.map(e=>[t,e]);return this.renderers.push(...n),this.renderers.sort((e,t)=>e[1]-t[1]),t}setupCorePlugin(e,t){let n=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in n))throw Error(`Invalid getter name: ${t} for plugin ${n.constructor}`);if(t in this.coreGetters)throw Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=n[t].bind(n)}n.import(t),this.corePlugins.push(n),this.coreHandlers.push(n),this.handlers.push(n)}onRemoteRevisionReceived({commands:e}){for(let t of e){let e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new uA(sM({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{if(!this.checkDispatchAllowed(e).isSuccessful){this.dispatchToHandlers(this.coreHandlers,{type:`UNDO`,commands:[e]});return}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-undone`,this,({commands:e})=>{this.dispatchFromCorePlugin(`UNDO`,{commands:e}),this.finalize()}),this.session.on(`revision-redone`,this,({commands:e})=>{this.dispatchFromCorePlugin(`REDO`,{commands:e}),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){let t=e.client||{id:this.uuidGenerator.smallUuid(),name:y(`Anonymous`).toString()},n=e.transportService||new Qj;return{...e,mode:e.mode||`normal`,custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:n,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger(`notify-ui`,e),raiseBlockingErrorUI:e=>this.trigger(`raise-error-ui`,{text:e})}}setupExternalConfig(e){let t=e.loadLocales||(()=>Promise.resolve(hr));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrencyFormat:this.config.defaultCurrencyFormat}}checkDispatchAllowed(e){let t=ur(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some(e=>e!==`Success`)?new fr(t.flat()):fr.Success}checkDispatchAllowedCoreCommand(e){let t=this.corePlugins.map(t=>t.allowDispatch(e));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map(t=>t.allowDispatch(e))}finalize(){this.status=3;for(let e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(jN(e,t));dispatch=(e,t)=>{let n=jN(e,t),r=this.status;if(this.getters.isReadonly()&&!dr(n))return new fr(`Readonly`);if(!this.session.canApplyOptimisticUpdate())return new fr(`WaitingSessionConfirmation`);switch(r){case 0:let t=this.checkDispatchAllowed(n);if(!t.isSuccessful)return t;this.status=1;let{changes:r,commands:i}=this.state.recordChanges(()=>{ur(n)&&this.state.addCommand(n),this.dispatchToHandlers(this.handlers,n),this.finalize()});this.session.save(n,i,r),this.status=0,this.trigger(`update`);break;case 1:if(ur(n)){let e=this.checkDispatchAllowed(n);if(!e.isSuccessful)return e;this.state.addCommand(n)}this.dispatchToHandlers(this.handlers,n);break;case 3:throw Error(`Cannot dispatch commands in the finalize state`);case 2:if(ur(n))throw Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,n)}return fr.Success};dispatchFromCorePlugin=(e,t)=>{let n=jN(e,t),r=this.status;this.status=2;let i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,n),this.status=r,fr.Success};dispatchToHandlers(e,t){let n=ur(t);for(let r of e)!n&&r instanceof IO||r.beforeHandle(t);for(let r of e)!n&&r instanceof IO||r.handle(t)}drawGrid(e){for(let[t,n]of this.renderers)e.ctx.save(),t.drawGrid(e,n),e.ctx.restore()}exportData(){let e=MO();for(let t of this.handlers)t instanceof IO&&t.export(e);return e.revisionId=this.session.getRevisionId()||`START_REVISION`,e=S(e),e}updateMode(e){e!==`normal`&&this.dispatch(`CANCEL_EDITION`),this.config.mode=e,this.trigger(`update`)}exportXLSX(){this.dispatch(`EVALUATE_CELLS`);let e=PO();for(let t of this.handlers)t instanceof FO&&t.exportForExcel(e);return e=S(e),xN(e)}garbageCollectExternalResources(){for(let e of this.corePlugins)e.garbageCollectExternalResources()}};function jN(e,t={}){let n=S(t);return n.type=e,n}let MN={},NN={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:26,HEADER_WIDTH:48,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:96,DEFAULT_CELL_HEIGHT:23,SCROLLBAR_WIDTH:15},PN={autofillModifiersRegistry:Ss,autofillRulesRegistry:Cs,cellMenuRegistry:db,colMenuRegistry:rS,linkMenuRegistry:sl,functionRegistry:Ny,featurePluginRegistry:bj,statefulUIPluginRegistry:xj,coreViewsPluginRegistry:Sj,corePluginRegistry:yj,rowMenuRegistry:oS,sidePanelRegistry:bC,figureRegistry:wu,chartSidePanelComponentRegistry:kS,chartComponentRegistry:vu,chartRegistry:_u,topbarMenuRegistry:cS,topbarComponentRegistry:xC,clickableCellRegistry:Cj,otRegistry:lS,inverseCommandRegistry:Au,urlRegistry:qa,cellPopoverRegistry:ul,numberFormatMenuRegistry:iS,repeatLocalCommandTransformRegistry:WA,repeatCommandTransformRegistry:$},FN={arg:K,toBoolean:F,toJsDate:I,toNumber:N,toString:P,toXC:O,toZone:ea,toUnboundedZone:Qi,toCartesian:rn,numberToLetters:D,lettersToNumber:en,UuidGenerator:ko,formatValue:z,createCurrencyFormat:Ei,computeTextWidth:_o,createEmptyWorkbookData:MO,createEmptySheet:jO,createEmptyExcelSheet:NO,getDefaultChartJsRuntime:Dl,chartFontColor:Jo,ChartColors:qo,EvaluationError:b,CellErrorLevel:te,getFillingMode:Ml,rgbaToHex:Kt,colorToRGBA:qt,positionToZone:V,isDefined:T,isMatrix:j,lazy:vt,genericRepeat:GA,createAction:Mo,createActions:Ao,transformRangeData:Po,deepEquals:E,isNumber:Yn,isDateTime:_n},IN={isMarkdownLink:at,parseMarkdownLink:ct,markdownLink:st,openLink:Qa,urlRepresentation:Za},LN={ChartPanel:AS,ChartFigure:bu,ChartJsComponent:Fo,Grid:Lw,GridOverlay:bw,ScorecardChart:xs,LineConfigPanel:TS,LineBarPieDesignPanel:xS,BarConfigPanel:gS,LineBarPieConfigPanel:hS,GaugeChartConfigPanel:CS,GaugeChartDesignPanel:wS,ScorecardChartConfigPanel:DS,ScorecardChartDesignPanel:OS,FigureComponent:SC,Menu:pc,SelectionInput:pS},RN={useDragAndDropListItems:FS};function zN(e,t){return Ny.add(e,t),{addFunction:(e,t)=>zN(e,t)}}let BN={DEFAULT_LOCALE:A};e.AbstractChart=Io,e.CommandResult=mr,e.CorePlugin=IO,e.DispatchResult=fr,e.EvaluationError=b,e.Model=AN,e.Registry=H,e.Revision=cA,e.SPREADSHEET_DIMENSIONS=NN,e.Spreadsheet=Zj,e.UIPlugin=Q,e.__info__=MN,e.addFunction=zN,e.astToFormula=ET,e.compile=NT,e.compileTokens=PT,e.components=LN,e.constants=BN,e.convertAstNodes=ST,e.coreTypes=lr,e.findCellInNewZone=Ta,e.functionCache=MT,e.helpers=FN,e.hooks=RN,e.invalidateCFEvaluationCommands=sr,e.invalidateDependenciesCommands=or,e.invalidateEvaluationCommands=ar,e.iterateAstNodes=CT,e.links=IN,e.load=yO,e.parse=bT,e.parseTokens=xT,e.readonlyAllowedCommands=cr,e.registries=PN,e.setDefaultSheetViewSize=Ke,e.setTranslationMethod=_,e.tokenize=vc,MN.version=`17.0.107`,MN.date=`2026-09-04T05:56:05.210Z`,MN.hash=`c25210d`})(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
2680
|
+
`),`_rels/.rels`)}var AN=class extends Bk{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers=[];status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},n={},r=[],i=new ko,a=!0){super(),v(),r=TO(e,r);let o=yO(e,a);this.state=new fM,this.uuidGenerator=i,this.config=this.setupConfig(n),this.session=this.setupSession(o.revisionId),this.coreGetters={},this.range=new uk(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.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.getters={isReadonly:()=>this.config.mode===`readonly`||this.config.mode===`dashboard`,isDashboard:()=>this.config.mode===`dashboard`},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new dM(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of yj.getAll())this.setupCorePlugin(e,o);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(r);for(let e of Sj.getAll()){let t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of xj.getAll()){let t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of bj.getAll()){let t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch(`START`),this.selection.observe(this,{handleEvent:()=>this.trigger(`update`)}),this.setupSessionEvents(),this.joinSession(),n.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),(0,t.markRaw)(this)}joinSession(){this.session.join(this.config.client)}async leaveSession(){let e=this.getters.isReadonly()?void 0:vt(()=>this.exportData());await this.session.leave(e)}setupUiPlugin(e){let t=new e(this.uiPluginConfig);for(let n of e.getters){if(!(n in t))throw Error(`Invalid getter name: ${n} for plugin ${t.constructor}`);if(n in this.getters)throw Error(`Getter "${n}" is already defined.`);this.getters[n]=t[n].bind(t)}let n=e.layers.map(e=>[t,e]);return this.renderers.push(...n),this.renderers.sort((e,t)=>e[1]-t[1]),t}setupCorePlugin(e,t){let n=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in n))throw Error(`Invalid getter name: ${t} for plugin ${n.constructor}`);if(t in this.coreGetters)throw Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=n[t].bind(n)}n.import(t),this.corePlugins.push(n),this.coreHandlers.push(n),this.handlers.push(n)}onRemoteRevisionReceived({commands:e}){for(let t of e){let e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new uA(sM({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{if(!this.checkDispatchAllowed(e).isSuccessful){this.dispatchToHandlers(this.coreHandlers,{type:`UNDO`,commands:[e]});return}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-undone`,this,({commands:e})=>{this.dispatchFromCorePlugin(`UNDO`,{commands:e}),this.finalize()}),this.session.on(`revision-redone`,this,({commands:e})=>{this.dispatchFromCorePlugin(`REDO`,{commands:e}),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){let t=e.client||{id:this.uuidGenerator.smallUuid(),name:y(`Anonymous`).toString()},n=e.transportService||new Qj;return{...e,mode:e.mode||`normal`,custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:n,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger(`notify-ui`,e),raiseBlockingErrorUI:e=>this.trigger(`raise-error-ui`,{text:e})}}setupExternalConfig(e){let t=e.loadLocales||(()=>Promise.resolve(hr));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrencyFormat:this.config.defaultCurrencyFormat}}checkDispatchAllowed(e){let t=ur(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some(e=>e!==`Success`)?new fr(t.flat()):fr.Success}checkDispatchAllowedCoreCommand(e){let t=this.corePlugins.map(t=>t.allowDispatch(e));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map(t=>t.allowDispatch(e))}finalize(){this.status=3;for(let e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(jN(e,t));dispatch=(e,t)=>{let n=jN(e,t),r=this.status;if(this.getters.isReadonly()&&!dr(n))return new fr(`Readonly`);if(!this.session.canApplyOptimisticUpdate())return new fr(`WaitingSessionConfirmation`);switch(r){case 0:let t=this.checkDispatchAllowed(n);if(!t.isSuccessful)return t;this.status=1;let{changes:r,commands:i}=this.state.recordChanges(()=>{ur(n)&&this.state.addCommand(n),this.dispatchToHandlers(this.handlers,n),this.finalize()});this.session.save(n,i,r),this.status=0,this.trigger(`update`);break;case 1:if(ur(n)){let e=this.checkDispatchAllowed(n);if(!e.isSuccessful)return e;this.state.addCommand(n)}this.dispatchToHandlers(this.handlers,n);break;case 3:throw Error(`Cannot dispatch commands in the finalize state`);case 2:if(ur(n))throw Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,n)}return fr.Success};dispatchFromCorePlugin=(e,t)=>{let n=jN(e,t),r=this.status;this.status=2;let i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,n),this.status=r,fr.Success};dispatchToHandlers(e,t){let n=ur(t);for(let r of e)!n&&r instanceof IO||r.beforeHandle(t);for(let r of e)!n&&r instanceof IO||r.handle(t)}drawGrid(e){for(let[t,n]of this.renderers)e.ctx.save(),t.drawGrid(e,n),e.ctx.restore()}exportData(){let e=MO();for(let t of this.handlers)t instanceof IO&&t.export(e);return e.revisionId=this.session.getRevisionId()||`START_REVISION`,e=S(e),e}updateMode(e){e!==`normal`&&this.dispatch(`CANCEL_EDITION`),this.config.mode=e,this.trigger(`update`)}exportXLSX(){this.dispatch(`EVALUATE_CELLS`);let e=PO();for(let t of this.handlers)t instanceof FO&&t.exportForExcel(e);return e=S(e),xN(e)}garbageCollectExternalResources(){for(let e of this.corePlugins)e.garbageCollectExternalResources()}};function jN(e,t={}){let n=S(t);return n.type=e,n}let MN={},NN={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:26,HEADER_WIDTH:48,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:96,DEFAULT_CELL_HEIGHT:23,SCROLLBAR_WIDTH:15},PN={autofillModifiersRegistry:Ss,autofillRulesRegistry:Cs,cellMenuRegistry:db,colMenuRegistry:rS,linkMenuRegistry:sl,functionRegistry:Ny,featurePluginRegistry:bj,statefulUIPluginRegistry:xj,coreViewsPluginRegistry:Sj,corePluginRegistry:yj,rowMenuRegistry:oS,sidePanelRegistry:bC,figureRegistry:wu,chartSidePanelComponentRegistry:kS,chartComponentRegistry:vu,chartRegistry:_u,topbarMenuRegistry:cS,topbarComponentRegistry:xC,clickableCellRegistry:Cj,otRegistry:lS,inverseCommandRegistry:Au,urlRegistry:qa,cellPopoverRegistry:ul,numberFormatMenuRegistry:iS,repeatLocalCommandTransformRegistry:WA,repeatCommandTransformRegistry:$},FN={arg:K,toBoolean:F,toJsDate:I,toNumber:N,toString:P,toXC:O,toZone:ea,toUnboundedZone:Qi,toCartesian:rn,numberToLetters:D,lettersToNumber:en,UuidGenerator:ko,formatValue:z,createCurrencyFormat:Ei,computeTextWidth:_o,createEmptyWorkbookData:MO,createEmptySheet:jO,createEmptyExcelSheet:NO,getDefaultChartJsRuntime:Dl,chartFontColor:Jo,ChartColors:qo,EvaluationError:b,CellErrorLevel:te,getFillingMode:Ml,rgbaToHex:Kt,colorToRGBA:qt,positionToZone:V,isDefined:T,isMatrix:j,lazy:vt,genericRepeat:GA,createAction:Mo,createActions:Ao,transformRangeData:Po,deepEquals:E,isNumber:Yn,isDateTime:_n},IN={isMarkdownLink:at,parseMarkdownLink:ct,markdownLink:st,openLink:Qa,urlRepresentation:Za},LN={ChartPanel:AS,ChartFigure:bu,ChartJsComponent:Fo,Grid:Lw,GridOverlay:bw,ScorecardChart:xs,LineConfigPanel:TS,LineBarPieDesignPanel:xS,BarConfigPanel:gS,LineBarPieConfigPanel:hS,GaugeChartConfigPanel:CS,GaugeChartDesignPanel:wS,ScorecardChartConfigPanel:DS,ScorecardChartDesignPanel:OS,FigureComponent:SC,Menu:pc,SelectionInput:pS},RN={useDragAndDropListItems:FS};function zN(e,t){return Ny.add(e,t),{addFunction:(e,t)=>zN(e,t)}}let BN={DEFAULT_LOCALE:A};e.AbstractChart=Io,e.CommandResult=mr,e.CorePlugin=IO,e.DispatchResult=fr,e.EvaluationError=b,e.Model=AN,e.Registry=H,e.Revision=cA,e.SPREADSHEET_DIMENSIONS=NN,e.Spreadsheet=Zj,e.UIPlugin=Q,e.__info__=MN,e.addFunction=zN,e.astToFormula=ET,e.compile=NT,e.compileTokens=PT,e.components=LN,e.constants=BN,e.convertAstNodes=ST,e.coreTypes=lr,e.findCellInNewZone=Ta,e.functionCache=MT,e.helpers=FN,e.hooks=RN,e.invalidateCFEvaluationCommands=sr,e.invalidateDependenciesCommands=or,e.invalidateEvaluationCommands=ar,e.iterateAstNodes=CT,e.links=IN,e.load=yO,e.parse=bT,e.parseTokens=xT,e.readonlyAllowedCommands=cr,e.registries=PN,e.setDefaultSheetViewSize=Ke,e.setTranslationMethod=_,e.tokenize=vc,MN.version=`17.0.108`,MN.date=`2026-09-10T05:35:45.123Z`,MN.hash=`b2580c5`})(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
package/dist/o_spreadsheet.xml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
3
3
|
@see https://github.com/odoo/o-spreadsheet
|
|
4
|
-
@version 17.0.
|
|
5
|
-
@date 2026-09-
|
|
6
|
-
@hash
|
|
4
|
+
@version 17.0.108
|
|
5
|
+
@date 2026-09-10T05:35:45.552Z
|
|
6
|
+
@hash b2580c5
|
|
7
7
|
-->
|
|
8
8
|
<odoo>
|
|
9
9
|
<t t-name="o-spreadsheet-ActionButton">
|