@odoo/o-spreadsheet 18.0.35 → 18.0.36
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 +28 -18
- package/dist/o-spreadsheet.esm.js +28 -18
- package/dist/o-spreadsheet.iife.js +28 -18
- package/dist/o-spreadsheet.iife.min.js +2 -2
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -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 18.0.
|
|
6
|
-
* @date 2025-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.36
|
|
6
|
+
* @date 2025-06-27T09:11:51.920Z
|
|
7
|
+
* @hash b8dc998
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -71196,26 +71196,28 @@ class SelectionStreamProcessorImpl {
|
|
|
71196
71196
|
bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
|
|
71197
71197
|
};
|
|
71198
71198
|
};
|
|
71199
|
-
const {
|
|
71199
|
+
const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
|
|
71200
|
+
const { col: refCol, row: refRow } = refCell;
|
|
71200
71201
|
// check if we can shrink selection
|
|
71201
71202
|
let n = 0;
|
|
71202
71203
|
while (result !== null) {
|
|
71203
71204
|
n++;
|
|
71204
71205
|
if (deltaCol < 0) {
|
|
71205
71206
|
const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
|
|
71206
|
-
result =
|
|
71207
|
+
result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
|
|
71207
71208
|
}
|
|
71208
71209
|
if (deltaCol > 0) {
|
|
71209
71210
|
const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
|
|
71210
|
-
result = left + n <=
|
|
71211
|
+
result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
|
|
71211
71212
|
}
|
|
71212
71213
|
if (deltaRow < 0) {
|
|
71213
71214
|
const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
|
|
71214
|
-
result =
|
|
71215
|
+
result =
|
|
71216
|
+
refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
|
|
71215
71217
|
}
|
|
71216
71218
|
if (deltaRow > 0) {
|
|
71217
71219
|
const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
|
|
71218
|
-
result = top + n <=
|
|
71220
|
+
result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
|
|
71219
71221
|
}
|
|
71220
71222
|
result = result ? reorderZone(result) : result;
|
|
71221
71223
|
if (result && !isEqual(result, anchor.zone)) {
|
|
@@ -71445,18 +71447,26 @@ class SelectionStreamProcessorImpl {
|
|
|
71445
71447
|
* If the anchor is hidden, browses from left to right and top to bottom to
|
|
71446
71448
|
* find a visible cell.
|
|
71447
71449
|
*/
|
|
71448
|
-
|
|
71450
|
+
getReferenceAnchor() {
|
|
71449
71451
|
const sheetId = this.getters.getActiveSheetId();
|
|
71450
71452
|
const anchor = this.anchor;
|
|
71451
71453
|
const { left, right, top, bottom } = anchor.zone;
|
|
71452
71454
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
71455
|
+
const col = this.getters.isColHidden(sheetId, anchorCol)
|
|
71456
|
+
? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
|
|
71457
|
+
: anchorCol;
|
|
71458
|
+
const row = this.getters.isRowHidden(sheetId, anchorRow)
|
|
71459
|
+
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
71460
|
+
: anchorRow;
|
|
71461
|
+
const zone = this.getters.expandZone(sheetId, {
|
|
71462
|
+
left: col,
|
|
71463
|
+
right: col,
|
|
71464
|
+
top: row,
|
|
71465
|
+
bottom: row,
|
|
71466
|
+
});
|
|
71453
71467
|
return {
|
|
71454
|
-
|
|
71455
|
-
|
|
71456
|
-
: anchorCol,
|
|
71457
|
-
row: this.getters.isRowHidden(sheetId, anchorRow)
|
|
71458
|
-
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
71459
|
-
: anchorRow,
|
|
71468
|
+
cell: { col, row },
|
|
71469
|
+
zone,
|
|
71460
71470
|
};
|
|
71461
71471
|
}
|
|
71462
71472
|
deltaToTarget(position, direction, step) {
|
|
@@ -74504,6 +74514,6 @@ exports.tokenColors = tokenColors;
|
|
|
74504
74514
|
exports.tokenize = tokenize;
|
|
74505
74515
|
|
|
74506
74516
|
|
|
74507
|
-
__info__.version = "18.0.
|
|
74508
|
-
__info__.date = "2025-06-
|
|
74509
|
-
__info__.hash = "
|
|
74517
|
+
__info__.version = "18.0.36";
|
|
74518
|
+
__info__.date = "2025-06-27T09:11:51.920Z";
|
|
74519
|
+
__info__.hash = "b8dc998";
|
|
@@ -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 18.0.
|
|
6
|
-
* @date 2025-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.36
|
|
6
|
+
* @date 2025-06-27T09:11:51.920Z
|
|
7
|
+
* @hash b8dc998
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -71194,26 +71194,28 @@ class SelectionStreamProcessorImpl {
|
|
|
71194
71194
|
bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
|
|
71195
71195
|
};
|
|
71196
71196
|
};
|
|
71197
|
-
const {
|
|
71197
|
+
const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
|
|
71198
|
+
const { col: refCol, row: refRow } = refCell;
|
|
71198
71199
|
// check if we can shrink selection
|
|
71199
71200
|
let n = 0;
|
|
71200
71201
|
while (result !== null) {
|
|
71201
71202
|
n++;
|
|
71202
71203
|
if (deltaCol < 0) {
|
|
71203
71204
|
const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
|
|
71204
|
-
result =
|
|
71205
|
+
result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
|
|
71205
71206
|
}
|
|
71206
71207
|
if (deltaCol > 0) {
|
|
71207
71208
|
const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
|
|
71208
|
-
result = left + n <=
|
|
71209
|
+
result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
|
|
71209
71210
|
}
|
|
71210
71211
|
if (deltaRow < 0) {
|
|
71211
71212
|
const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
|
|
71212
|
-
result =
|
|
71213
|
+
result =
|
|
71214
|
+
refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
|
|
71213
71215
|
}
|
|
71214
71216
|
if (deltaRow > 0) {
|
|
71215
71217
|
const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
|
|
71216
|
-
result = top + n <=
|
|
71218
|
+
result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
|
|
71217
71219
|
}
|
|
71218
71220
|
result = result ? reorderZone(result) : result;
|
|
71219
71221
|
if (result && !isEqual(result, anchor.zone)) {
|
|
@@ -71443,18 +71445,26 @@ class SelectionStreamProcessorImpl {
|
|
|
71443
71445
|
* If the anchor is hidden, browses from left to right and top to bottom to
|
|
71444
71446
|
* find a visible cell.
|
|
71445
71447
|
*/
|
|
71446
|
-
|
|
71448
|
+
getReferenceAnchor() {
|
|
71447
71449
|
const sheetId = this.getters.getActiveSheetId();
|
|
71448
71450
|
const anchor = this.anchor;
|
|
71449
71451
|
const { left, right, top, bottom } = anchor.zone;
|
|
71450
71452
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
71453
|
+
const col = this.getters.isColHidden(sheetId, anchorCol)
|
|
71454
|
+
? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
|
|
71455
|
+
: anchorCol;
|
|
71456
|
+
const row = this.getters.isRowHidden(sheetId, anchorRow)
|
|
71457
|
+
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
71458
|
+
: anchorRow;
|
|
71459
|
+
const zone = this.getters.expandZone(sheetId, {
|
|
71460
|
+
left: col,
|
|
71461
|
+
right: col,
|
|
71462
|
+
top: row,
|
|
71463
|
+
bottom: row,
|
|
71464
|
+
});
|
|
71451
71465
|
return {
|
|
71452
|
-
|
|
71453
|
-
|
|
71454
|
-
: anchorCol,
|
|
71455
|
-
row: this.getters.isRowHidden(sheetId, anchorRow)
|
|
71456
|
-
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
71457
|
-
: anchorRow,
|
|
71466
|
+
cell: { col, row },
|
|
71467
|
+
zone,
|
|
71458
71468
|
};
|
|
71459
71469
|
}
|
|
71460
71470
|
deltaToTarget(position, direction, step) {
|
|
@@ -74459,6 +74469,6 @@ const constants = {
|
|
|
74459
74469
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
74460
74470
|
|
|
74461
74471
|
|
|
74462
|
-
__info__.version = "18.0.
|
|
74463
|
-
__info__.date = "2025-06-
|
|
74464
|
-
__info__.hash = "
|
|
74472
|
+
__info__.version = "18.0.36";
|
|
74473
|
+
__info__.date = "2025-06-27T09:11:51.920Z";
|
|
74474
|
+
__info__.hash = "b8dc998";
|
|
@@ -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 18.0.
|
|
6
|
-
* @date 2025-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.36
|
|
6
|
+
* @date 2025-06-27T09:11:51.920Z
|
|
7
|
+
* @hash b8dc998
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -71195,26 +71195,28 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71195
71195
|
bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
|
|
71196
71196
|
};
|
|
71197
71197
|
};
|
|
71198
|
-
const {
|
|
71198
|
+
const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
|
|
71199
|
+
const { col: refCol, row: refRow } = refCell;
|
|
71199
71200
|
// check if we can shrink selection
|
|
71200
71201
|
let n = 0;
|
|
71201
71202
|
while (result !== null) {
|
|
71202
71203
|
n++;
|
|
71203
71204
|
if (deltaCol < 0) {
|
|
71204
71205
|
const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
|
|
71205
|
-
result =
|
|
71206
|
+
result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
|
|
71206
71207
|
}
|
|
71207
71208
|
if (deltaCol > 0) {
|
|
71208
71209
|
const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
|
|
71209
|
-
result = left + n <=
|
|
71210
|
+
result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
|
|
71210
71211
|
}
|
|
71211
71212
|
if (deltaRow < 0) {
|
|
71212
71213
|
const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
|
|
71213
|
-
result =
|
|
71214
|
+
result =
|
|
71215
|
+
refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
|
|
71214
71216
|
}
|
|
71215
71217
|
if (deltaRow > 0) {
|
|
71216
71218
|
const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
|
|
71217
|
-
result = top + n <=
|
|
71219
|
+
result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
|
|
71218
71220
|
}
|
|
71219
71221
|
result = result ? reorderZone(result) : result;
|
|
71220
71222
|
if (result && !isEqual(result, anchor.zone)) {
|
|
@@ -71444,18 +71446,26 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71444
71446
|
* If the anchor is hidden, browses from left to right and top to bottom to
|
|
71445
71447
|
* find a visible cell.
|
|
71446
71448
|
*/
|
|
71447
|
-
|
|
71449
|
+
getReferenceAnchor() {
|
|
71448
71450
|
const sheetId = this.getters.getActiveSheetId();
|
|
71449
71451
|
const anchor = this.anchor;
|
|
71450
71452
|
const { left, right, top, bottom } = anchor.zone;
|
|
71451
71453
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
71454
|
+
const col = this.getters.isColHidden(sheetId, anchorCol)
|
|
71455
|
+
? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
|
|
71456
|
+
: anchorCol;
|
|
71457
|
+
const row = this.getters.isRowHidden(sheetId, anchorRow)
|
|
71458
|
+
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
71459
|
+
: anchorRow;
|
|
71460
|
+
const zone = this.getters.expandZone(sheetId, {
|
|
71461
|
+
left: col,
|
|
71462
|
+
right: col,
|
|
71463
|
+
top: row,
|
|
71464
|
+
bottom: row,
|
|
71465
|
+
});
|
|
71452
71466
|
return {
|
|
71453
|
-
|
|
71454
|
-
|
|
71455
|
-
: anchorCol,
|
|
71456
|
-
row: this.getters.isRowHidden(sheetId, anchorRow)
|
|
71457
|
-
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
71458
|
-
: anchorRow,
|
|
71467
|
+
cell: { col, row },
|
|
71468
|
+
zone,
|
|
71459
71469
|
};
|
|
71460
71470
|
}
|
|
71461
71471
|
deltaToTarget(position, direction, step) {
|
|
@@ -74503,9 +74513,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74503
74513
|
exports.tokenize = tokenize;
|
|
74504
74514
|
|
|
74505
74515
|
|
|
74506
|
-
__info__.version = "18.0.
|
|
74507
|
-
__info__.date = "2025-06-
|
|
74508
|
-
__info__.hash = "
|
|
74516
|
+
__info__.version = "18.0.36";
|
|
74517
|
+
__info__.date = "2025-06-27T09:11:51.920Z";
|
|
74518
|
+
__info__.hash = "b8dc998";
|
|
74509
74519
|
|
|
74510
74520
|
|
|
74511
74521
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -2577,7 +2577,7 @@
|
|
|
2577
2577
|
color: ${M};
|
|
2578
2578
|
}
|
|
2579
2579
|
}
|
|
2580
|
-
`;class OP extends t.Component{static template="o-spreadsheet-Spreadsheet";static props={model:Object,notifyUser:{type:Function,optional:!0},raiseError:{type:Function,optional:!0},askConfirmation:{type:Function,optional:!0}};static components={TopBar:_P,Grid:wF,BottomBar:gP,SidePanel:yP,SpreadsheetDashboard:mP,HeaderGroupContainer:SP};sidePanel;spreadsheetRef=t.useRef("spreadsheet");spreadsheetRect=gx();_focusGrid;keyDownMapping;isViewportTooSmall=!1;notificationStore;composerFocusStore;get model(){return this.props.model}getStyle(){const e={};return this.env.isDashboard()?e["grid-template-rows"]="auto":e["grid-template-rows"]="63px auto 37px",e["grid-template-columns"]=`auto ${this.sidePanel.panelSize}px`,Nh(e)}setup(){const e=wc();e.inject(Ac,this.model),this.notificationStore=xc(D_),this.composerFocusStore=xc(Mc),this.sidePanel=xc(bF),this.keyDownMapping={"CTRL+H":()=>this.sidePanel.toggle("FindAndReplace",{}),"CTRL+F":()=>this.sidePanel.toggle("FindAndReplace",{})};const o=this.model.config.external.fileStore;t.useSubEnv({model:this.model,imageProvider:o?new nP(o):void 0,loadCurrencies:this.model.config.external.loadCurrencies,loadLocales:this.model.config.external.loadLocales,isDashboard:()=>this.model.getters.isDashboard(),openSidePanel:this.sidePanel.open.bind(this.sidePanel),toggleSidePanel:this.sidePanel.toggle.bind(this.sidePanel),clipboard:this.env.clipboard||new DP(navigator.clipboard),startCellEdition:e=>this.composerFocusStore.focusActiveComposer({content:e}),notifyUser:e=>this.notificationStore.notifyUser(e),askConfirmation:(e,t,o)=>this.notificationStore.askConfirmation(e,t,o),raiseError:(e,t)=>this.notificationStore.raiseError(e,t)}),this.notificationStore.updateNotificationCallbacks({...this.props}),t.useEffect((()=>{!this.spreadsheetRef.el.contains(document.activeElement)&&document.activeElement?.contains(this.spreadsheetRef.el)&&this.focusGrid()}),(()=>[this.env.model.getters.getActiveSheetId()])),t.useExternalListener(window,"resize",(()=>this.render(!0))),t.useExternalListener(document.body,"wheel",(()=>{})),this.bindModelEvents(),t.onWillUpdateProps((e=>{if(e.model!==this.props.model)throw new Error("Changing the props model is not supported at the moment.");e.notifyUser===this.props.notifyUser&&e.askConfirmation===this.props.askConfirmation&&e.raiseError===this.props.raiseError||this.notificationStore.updateNotificationCallbacks({...e})}));const s=function(e){let t=!1;return async(...o)=>{t||(t=!0,await Promise.resolve(),t=!1,e(...o))}}(this.render.bind(this,!0));t.onMounted((()=>{this.checkViewportSize(),e.on("store-updated",this,s),i.observe(this.spreadsheetRef.el)})),t.onWillUnmount((()=>{this.unbindModelEvents(),e.off("store-updated",this),i.disconnect()})),t.onPatched((()=>{this.checkViewportSize()}));const i=new ResizeObserver((()=>{this.sidePanel.changePanelSize(this.sidePanel.panelSize,this.spreadsheetRect.width)}))}bindModelEvents(){this.model.on("update",this,(()=>this.render(!0))),this.model.on("notify-ui",this,(e=>this.notificationStore.notifyUser(e))),this.model.on("raise-error-ui",this,(({text:e})=>this.notificationStore.raiseError(e)))}unbindModelEvents(){this.model.off("update",this),this.model.off("notify-ui",this),this.model.off("raise-error-ui",this)}checkViewportSize(){const{xRatio:e,yRatio:t}=this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());if(isFinite(e)&&isFinite(t))if(t>.85||e>.85){if(this.isViewportTooSmall)return;this.notificationStore.notifyUser({text:Io("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),type:"warning",sticky:!1}),this.isViewportTooSmall=!0}else this.isViewportTooSmall=!1}focusGrid(){this._focusGrid&&this._focusGrid()}onKeydown(e){let t="";ux(e)&&(t+="CTRL+"),t+=e.key.toUpperCase();let o=this.keyDownMapping[t];if(o)return e.preventDefault(),e.stopPropagation(),void o()}get gridHeight(){const{height:e}=this.env.model.getters.getSheetViewDimension();return e}get gridContainerStyle(){const e=se*this.rowLayers.length,t=se*this.colLayers.length;return Nh({"grid-template-columns":`${e?e+2:0}px auto`,"grid-template-rows":`${t?t+2:0}px auto`})}get rowLayers(){const e=this.env.model.getters.getActiveSheetId();return this.env.model.getters.getVisibleGroupLayers(e,"ROW")}get colLayers(){const e=this.env.model.getters.getActiveSheetId();return this.env.model.getters.getVisibleGroupLayers(e,"COL")}}class FP{listeners=[];async sendMessage(e){for(const{callback:t}of this.listeners)t(e)}onNewMessage(e,t){this.listeners.push({id:e,callback:t})}leave(e){this.listeners=this.listeners.filter((t=>t.id!==e))}}function MP(e){return qE.get(e.type)(e)}class PP{buildTransformation;operations;constructor(e,t=[]){this.buildTransformation=e,this.operations=t}getOperations(){return this.operations}getOperation(e){const t=this.operations.find((t=>t.id===e));if(!t)throw new Error(`Operation ${e} not found`);return t}getLastOperationId(){return this.operations[this.operations.length-1]?.id}getFirstOperationAmong(e,t){for(const o of this.operations){if(o.id===e)return e;if(o.id===t)return t}throw new Error(`Operation ${e} and ${t} not found`)}contains(e){return!!this.operations.find((t=>t.id===e))}prepend(e){const t=this.buildTransformation.with(e.data);this.operations=[e,...this.operations.map((e=>e.transformed(t)))]}insert(e,t){const o=this.buildTransformation.with(e.data),{before:s,operation:i,after:n}=this.locateOperation(t);this.operations=[...s,i,e,...n.map((e=>e.transformed(o)))]}append(e){this.operations.push(e)}appendBranch(e){this.operations=this.operations.concat(e.operations)}fork(e){const{after:t}=this.locateOperation(e);return new PP(this.buildTransformation,t)}transform(e){this.operations=this.operations.map((t=>t.transformed(e)))}cutBefore(e){this.operations=this.locateOperation(e).before}cutAfter(e){const{before:t,operation:o}=this.locateOperation(e);this.operations=t.concat([o])}locateOperation(e){const t=this.operations.findIndex((t=>t.id===e));if(-1===t)throw new Error(`Operation ${e} not found`);return{before:this.operations.slice(0,t),operation:this.operations[t],after:this.operations.slice(t+1)}}}class NP{id;data;constructor(e,t){this.id=e,this.data=t}transformed(e){return new kP(this.id,at((()=>e(this.data))))}}class kP{id;lazyData;constructor(e,t){this.id=e,this.lazyData=t}get data(){return this.lazyData()}transformed(e){return new kP(this.id,this.lazyData.map(e))}}class LP{operations;constructor(e){this.operations=e}[Symbol.iterator](){return this.operations[Symbol.iterator]()}stopWith(e){return new LP(function*(e,t){for(const o of e)if(yield o,o.operation.id===t)return}(this.operations,e))}stopBefore(e){return new LP(function*(e,t){for(const o of e){if(o.operation.id===t)return;yield o}}(this.operations,e))}startAfter(e){return new LP(function*(e,t){let o=!0;for(const s of e)o||(yield s),s.operation.id===t&&(o=!1)}(this.operations,e))}}class VP{buildTransformation;branches;branchingOperationIds=new Map;constructor(e,t){this.buildTransformation=e,this.branches=[t]}getLastBranch(){return this.branches[this.branches.length-1]}execution(e){return new LP(Ge(this._execution(e),this._execution(e)))}revertedExecution(e){return new LP(Ge(this._revertedExecution(e),this._revertedExecution(e)))}insertOperationLast(e,t){const o=e.getLastOperationId()||this.previousBranch(e)?.getLastOperationId();e.append(t),o&&this.insertPrevious(e,t,o)}insertOperationAfter(e,t,o){e.insert(t,o),this.updateNextWith(e,t,o),this.insertPrevious(e,t,o)}undo(e,t){const o=this.buildTransformation.without(t.data),s=this.branchingOperationIds.get(e);this.branchingOperationIds.set(e,t.id);const i=e.fork(t.id);s&&this.branchingOperationIds.set(i,s),this.insertBranchAfter(e,i),this.transform(i,o)}redo(e){const t=this.nextBranch(e);if(!t)return;const o=this.nextBranch(t);this.removeBranchFromTree(t);const s=this.branchingOperationIds.get(t);s?this.branchingOperationIds.set(e,s):this.branchingOperationIds.delete(e),o&&this.rebaseUp(o)}drop(e){for(const t of this.branches)t.contains(e)&&t.cutBefore(e)}findOperation(e,t){for(const o of this.revertedExecution(e))if(o.operation.id===t)return o;throw new Error(`Operation ${t} not found`)}rebaseUp(e){const{previousBranch:t,branchingOperation:o}=this.findPreviousBranchingOperation(e);if(!t||!o)return;const s=this.buildTransformation.without(o.data),i=t.fork(o.id);this.branchingOperationIds.set(i,this.branchingOperationIds.get(e)),this.removeBranchFromTree(e),this.insertBranchAfter(t,i),i.transform(s);const n=this.nextBranch(i);n&&this.rebaseUp(n)}removeBranchFromTree(e){const t=this.branches.findIndex((t=>t===e));this.branches.splice(t,1)}insertBranchAfter(e,t){const o=this.branches.findIndex((t=>t===e));this.branches.splice(o+1,0,t)}updateNextWith(e,t,o){const s=this.branchingOperationIds.get(e),i=this.nextBranch(e);if(s&&i)if(e.getFirstOperationAmong(o,s)===s){const n=this.addToNextBranch(e,i,s,t,o);this.updateNextWith(i,n,o)}else{const e=this.buildTransformation.with(t.data);this.transform(i,e)}}addToNextBranch(e,t,o,s,i){let n=s;return i===o?(n=this.getTransformedOperation(e,o,s),t.prepend(n)):t.contains(i)?(n=this.getTransformedOperation(e,o,s),t.insert(n,i)):t.append(s),n}getTransformedOperation(e,t,o){const s=e.getOperation(t),i=this.buildTransformation.without(s.data);return o.transformed(i)}shouldExecute(e,t){return t.id!==this.branchingOperationIds.get(e)}transform(e,t){e.transform(t);const o=this.nextBranch(e);o&&this.transform(o,t)}insertPrevious(e,t,o){const{previousBranch:s,branchingOperation:i}=this.findPreviousBranchingOperation(e);if(!s||!i)return;const n=this.buildTransformation.with(i.data),r=e.fork(o);r.transform(n),s.cutAfter(o),s.appendBranch(r);const a=t.transformed(n);this.insertPrevious(s,a,o)}findPreviousBranchingOperation(e){const t=this.previousBranch(e);if(!t)return{previousBranch:void 0,branchingOperation:void 0};const o=this.branchingOperationIds.get(t);return o?{previousBranch:t,branchingOperation:t.getOperation(o)}:{previousBranch:void 0,branchingOperation:void 0}}nextBranch(e){const t=this.branches.findIndex((t=>t===e));if(-1!==t)return this.branches[t+1]}previousBranch(e){const t=this.branches.findIndex((t=>t===e));if(-1!==t)return this.branches[t-1]}*_revertedExecution(e){const t=this.branchingOperationIds.get(e);let o=!!t;const s=e.getOperations();for(let i=s.length-1;i>=0;i--){const n=s[i];n.id===t&&(o=!1),o||(yield{operation:n,branch:e,isCancelled:!this.shouldExecute(e,n)})}const i=this.previousBranch(e);yield*i?this._revertedExecution(i):[]}*_execution(e){for(const t of e.getOperations())if(yield{operation:t,branch:e,isCancelled:!this.shouldExecute(e,t)},t.id===this.branchingOperationIds.get(e)){const t=this.nextBranch(e);return void(yield*t?this._execution(t):[])}if(!this.branchingOperationIds.get(e)){const t=this.nextBranch(e);yield*t?this._execution(t):[]}}}class UP{HEAD_BRANCH;HEAD_OPERATION;tree;applyOperation;revertOperation;buildEmpty;buildTransformation;constructor(e){this.applyOperation=e.applyOperation,this.revertOperation=e.revertOperation,this.buildEmpty=e.buildEmpty,this.buildTransformation=e.buildTransformation,this.HEAD_BRANCH=new PP(this.buildTransformation),this.tree=new VP(this.buildTransformation,this.HEAD_BRANCH);const t=e.initialOperationId,o=new NP(t,this.buildEmpty(t));this.tree.insertOperationLast(this.HEAD_BRANCH,o),this.HEAD_OPERATION=o}get(e){return this.tree.findOperation(this.HEAD_BRANCH,e).operation.data}append(e,t){const o=new NP(e,t),s=this.tree.getLastBranch();this.tree.insertOperationLast(s,o),this.HEAD_BRANCH=s,this.HEAD_OPERATION=o}insert(e,t,o){const s=new NP(e,t);this.revertTo(o),this.tree.insertOperationAfter(this.HEAD_BRANCH,s,o),this.fastForward()}undo(e,t,o){const{branch:s,operation:i}=this.tree.findOperation(this.HEAD_BRANCH,e);this.revertBefore(e),this.tree.undo(s,i),this.fastForward(),this.insert(t,this.buildEmpty(t),o)}redo(e,t,o){const{branch:s}=this.tree.findOperation(this.HEAD_BRANCH,e);this.revertBefore(e),this.tree.redo(s),this.fastForward(),this.insert(t,this.buildEmpty(t),o)}rebase(e){const t=this.get(e),o=[...this.tree.execution(this.HEAD_BRANCH).startAfter(e)];this.revertBefore(e);const s=this.HEAD_OPERATION.id;this.tree.drop(e),this.insert(e,t,s);for(const{operation:e}of o)this.insert(e.id,e.data,this.HEAD_OPERATION.id)}revertBefore(e){const t=this.tree.revertedExecution(this.HEAD_BRANCH).stopWith(e);this.revert(t)}revertTo(e){const t=e?this.tree.revertedExecution(this.HEAD_BRANCH).stopBefore(e):this.tree.revertedExecution(this.HEAD_BRANCH);this.revert(t)}revert(e){for(const{next:t,operation:o,isCancelled:s}of e)s||this.revertOperation(o.data),t&&(this.HEAD_BRANCH=t.branch,this.HEAD_OPERATION=t.operation)}fastForward(){const e=this.HEAD_OPERATION?this.tree.execution(this.HEAD_BRANCH).startAfter(this.HEAD_OPERATION.id):this.tree.execution(this.HEAD_BRANCH);for(const{operation:t,branch:o,isCancelled:s}of e)s||this.applyOperation(t.data),this.HEAD_OPERATION=t,this.HEAD_BRANCH=o}}function HP(e){return new UP({initialOperationId:e.initialRevisionId,applyOperation:t=>{const o=t.commands.slice(),{changes:s}=e.recordChanges((()=>{for(const t of o)e.dispatch(t)}));t.setChanges(s)},revertOperation:e=>function(e){for(const t of e.slice().reverse())for(let e=t.changes.length-1;e>=0;e--){BP(t.changes[e])}}([e]),buildEmpty:e=>new PM(e,"empty",[]),buildTransformation:{with:e=>t=>new PM(t.id,t.clientId,FM(t.commands,e.commands),t.rootCommand,void 0,t.timestamp),without:e=>t=>new PM(t.id,t.clientId,FM(t.commands,e.commands.map(MP).flat()),t.rootCommand,void 0,t.timestamp)}})}function BP(e){const t=e.target,o=e.key,s=e.before;void 0===s?delete t[o]:t[o]=s}class zP{observers=new Map;defaultSubscription;mainSubscription;registerAsDefault(e,t){this.defaultSubscription={owner:e,callbacks:t},this.mainSubscription||(this.mainSubscription=this.defaultSubscription)}observe(e,t){this.observers.set(e,{owner:e,callbacks:t})}detachObserver(e){this.observers.delete(e)}capture(e,t){if(this.observers.get(e))throw new Error("You are already subscribed forever");this.mainSubscription?.owner&&this.mainSubscription.owner!==e&&this.mainSubscription.callbacks.release?.(),this.mainSubscription={owner:e,callbacks:t}}release(e){this.mainSubscription?.owner!==e||this.observers.get(e)||(this.mainSubscription=this.defaultSubscription)}getBackToDefault(){this.mainSubscription!==this.defaultSubscription&&(this.mainSubscription?.callbacks.release?.(),this.mainSubscription=this.defaultSubscription)}isListening(e){return this.mainSubscription?.owner===e}send(e){this.mainSubscription?.callbacks.handleEvent(e),this.observers.forEach((t=>t.callbacks.handleEvent(e)))}}class $P{getters;stream;anchor;defaultAnchor;constructor(e){this.getters=e,this.stream=new zP,this.anchor={cell:{col:0,row:0},zone:Yo({col:0,row:0})},this.defaultAnchor=this.anchor}capture(e,t,o){this.stream.capture(e,o),this.anchor=t}registerAsDefault(e,t,o){this.checkAnchorZoneOrThrow(t),this.stream.registerAsDefault(e,o),this.defaultAnchor=t,this.capture(e,t,o)}resetDefaultAnchor(e,t){this.checkAnchorZoneOrThrow(t),this.stream.isListening(e)&&(this.anchor=t),this.defaultAnchor=t}resetAnchor(e,t){this.checkAnchorZoneOrThrow(t),this.stream.isListening(e)&&(this.anchor=t)}observe(e,t){this.stream.observe(e,t)}detachObserver(e){this.stream.detachObserver(e)}release(e){this.stream.isListening(e)&&(this.stream.release(e),this.anchor=this.defaultAnchor)}getBackToDefault(){this.stream.getBackToDefault()}modifyAnchor(e,t,o){const s=this.getters.getActiveSheetId();return e={...e,zone:this.getters.expandZone(s,e.zone)},this.processEvent({options:o,anchor:e,mode:t})}selectZone(e,t={scrollIntoView:!0}){return this.modifyAnchor(e,"overrideSelection",t)}selectCell(e,t){const o=Yo({col:e,row:t});return this.selectZone({zone:o,cell:{col:e,row:t}},{scrollIntoView:!0})}moveAnchorCell(e,t=1){if("end"!==t&&t<=0)return new Xs("InvalidSelectionStep");const{col:o,row:s}=this.getNextAvailablePosition(e,t);return this.selectCell(o,s)}setAnchorCorner(e,t){const o=this.getters.getActiveSheetId(),{col:s,row:i}=this.anchor.cell,n={left:Math.min(s,e),top:Math.min(i,t),right:Math.max(s,e),bottom:Math.max(i,t)},r={zone:this.getters.expandZone(o,n),cell:{col:s,row:i}};return this.processEvent({mode:"updateAnchor",anchor:r,options:{scrollIntoView:!1}})}addCellToSelection(e,t){const o=this.getters.getActiveSheetId();({col:e,row:t}=this.getters.getMainCellPosition({sheetId:o,col:e,row:t}));const s=this.getters.expandZone(o,Yo({col:e,row:t}));return this.processEvent({options:{scrollIntoView:!0},anchor:{zone:s,cell:{col:e,row:t}},mode:"newAnchor"})}resizeAnchorZone(e,t=1){if("end"!==t&&t<=0)return new Xs("InvalidSelectionStep");const o=this.getters.getActiveSheetId(),s=this.anchor,{col:i,row:n}=s.cell,{left:r,right:a,top:l,bottom:c}=s.zone,h=this.getStartingPosition(e);let[d,u]=this.deltaToTarget(h,e,t);if(0===d&&0===u)return Xs.Success;let g=s.zone;const p=e=>{e=qo(e);const{left:t,right:s,top:i,bottom:n}=this.getters.expandZone(o,e);return{left:Math.max(0,t),right:Math.min(this.getters.getNumberCols(o)-1,s),top:Math.max(0,i),bottom:Math.min(this.getters.getNumberRows(o)-1,n)}},{col:m,row:f}=this.getReferencePosition();let v=0;for(;null!==g;){if(v++,d<0){const e=this.getNextAvailableCol(d,a-(v-1),f);g=m<=a-v?p({top:l,left:r,bottom:c,right:e}):null}if(d>0){const e=this.getNextAvailableCol(d,r+(v-1),f);g=r+v<=m?p({top:l,left:e,bottom:c,right:a}):null}if(u<0){const e=this.getNextAvailableRow(u,m,c-(v-1));g=f<=c-v?p({top:l,left:r,bottom:e,right:a}):null}if(u>0){const e=this.getNextAvailableRow(u,m,l+(v-1));g=l+v<=f?p({top:e,left:r,bottom:c,right:a}):null}if(g=g?qo(g):g,g&&!Vo(g,s.zone))return this.processEvent({options:{scrollIntoView:!0},mode:"updateAnchor",anchor:{zone:g,cell:{col:i,row:n}}})}g=p(ko({top:n,bottom:n,left:i,right:i},qo({top:this.getNextAvailableRow(u,m,l),left:this.getNextAvailableCol(d,r,f),bottom:this.getNextAvailableRow(u,m,c),right:this.getNextAvailableCol(d,a,f)})));const b={zone:g,cell:{col:i,row:n}};return this.processEvent({anchor:b,mode:"updateAnchor",options:{scrollIntoView:!0}})}selectColumn(e,t){const o=this.getters.getActiveSheetId(),s=this.getters.getNumberRows(o)-1;let i={left:e,right:e,top:0,bottom:s};const n=this.getters.findFirstVisibleColRowIndex(o,"ROW");let r,a;switch(t){case"overrideSelection":case"newAnchor":r=e,a=n;break;case"updateAnchor":({col:r,row:a}=this.anchor.cell),i=ko(i,{left:r,right:r,top:n,bottom:s})}return this.processEvent({options:{scrollIntoView:!1,unbounded:!0},anchor:{zone:i,cell:{col:r,row:a}},mode:t})}selectRow(e,t){const o=this.getters.getActiveSheetId(),s=this.getters.getNumberCols(o)-1;let i={top:e,bottom:e,left:0,right:s};const n=this.getters.findFirstVisibleColRowIndex(o,"COL");let r,a;switch(t){case"overrideSelection":case"newAnchor":r=n,a=e;break;case"updateAnchor":({col:r,row:a}=this.anchor.cell),i=ko(i,{left:n,right:s,top:a,bottom:a})}return this.processEvent({options:{scrollIntoView:!1,unbounded:!0},anchor:{zone:i,cell:{col:r,row:a}},mode:t})}loopSelection(){const e=this.getters.getActiveSheetId(),t=this.anchor;if(Vo(this.anchor.zone,this.getters.getSheetZone(e)))return this.modifyAnchor({...t,zone:Yo(t.cell)},"updateAnchor",{scrollIntoView:!1});const o=this.getters.getContiguousZone(e,t.zone);return ht(o,t.zone)?this.selectAll():this.modifyAnchor({...t,zone:o},"updateAnchor",{scrollIntoView:!1})}selectTableAroundSelection(){const e=this.getters.getActiveSheetId(),t=this.getters.getContiguousZone(e,this.anchor.zone);return this.modifyAnchor({...this.anchor,zone:t},"updateAnchor",{scrollIntoView:!1})}selectAll(){const e=this.getters.getActiveSheetId(),t={left:0,top:0,bottom:this.getters.getNumberRows(e)-1,right:this.getters.getNumberCols(e)-1};return this.processEvent({mode:"overrideSelection",anchor:{zone:t,cell:this.anchor.cell},options:{scrollIntoView:!1}})}isListening(e){return this.stream.isListening(e)}processEvent(e){const t={...e,previousAnchor:ke(this.anchor)},o=this.checkEventAnchorZone(t);return"Success"!==o?new Xs(o):(this.anchor=t.anchor,this.stream.send(t),Xs.Success)}checkEventAnchorZone(e){return this.checkAnchorZone(e.anchor)}checkAnchorZone(e){const{cell:t,zone:o}=e;if(!Ho(t.col,t.row,o))return"InvalidAnchorZone";const{left:s,right:i,top:n,bottom:r}=o,a=this.getters.getActiveSheetId(),l=this.getters.findVisibleHeader(a,"COL",s,i);return void 0===this.getters.findVisibleHeader(a,"ROW",n,r)||void 0===l?"SelectionOutOfBound":"Success"}checkAnchorZoneOrThrow(e){if("InvalidAnchorZone"===this.checkAnchorZone(e))throw new Error(Io("The provided anchor is invalid. The cell must be part of the zone."))}getNextAvailablePosition(e,t=1){const{col:o,row:s}=this.anchor.cell,i=this.deltaToTarget({col:o,row:s},e,t);return{col:this.getNextAvailableCol(i[0],o,s),row:this.getNextAvailableRow(i[1],o,s)}}getNextAvailableCol(e,t,o){const s=this.getters.getActiveSheetId(),i={col:t,row:o};return this.getNextAvailableHeader(e,"COL",t,i,(e=>this.getters.isInSameMerge(s,t,o,e,o)))}getNextAvailableRow(e,t,o){const s=this.getters.getActiveSheetId(),i={col:t,row:o};return this.getNextAvailableHeader(e,"ROW",o,i,(e=>this.getters.isInSameMerge(s,t,o,t,e)))}getNextAvailableHeader(e,t,o,s,i){const n=this.getters.getActiveSheetId();if(0===e)return o;const r=Math.sign(e);let a=o+e;for(;i(a);)a+=r;for(;this.getters.isHeaderHidden(n,t,a);)a+=r;return a<0||a>this.getters.getNumberHeaders(n,t)-1?this.getters.isHeaderHidden(n,t,o)?this.getNextAvailableHeader(-r,t,o,s,i):o:a}getReferencePosition(){const e=this.getters.getActiveSheetId(),t=this.anchor,{left:o,right:s,top:i,bottom:n}=t.zone,{col:r,row:a}=t.cell;return{col:this.getters.isColHidden(e,r)&&this.getters.findVisibleHeader(e,"COL",o,s)||r,row:this.getters.isRowHidden(e,a)&&this.getters.findVisibleHeader(e,"ROW",i,n)||a}}deltaToTarget(e,t,o){switch(t){case"up":return"end"!==o?[0,-o]:[0,this.getEndOfCluster(e,"rows",-1)-e.row];case"down":return"end"!==o?[0,o]:[0,this.getEndOfCluster(e,"rows",1)-e.row];case"left":return"end"!==o?[-o,0]:[this.getEndOfCluster(e,"cols",-1)-e.col,0];case"right":return"end"!==o?[o,0]:[this.getEndOfCluster(e,"cols",1)-e.col,0]}}getStartingPosition(e){let{col:t,row:o}=this.getPosition();const s=this.anchor.zone;switch(e){case"down":case"up":o=o===s.top?s.bottom:s.top;break;case"left":case"right":t=t===s.right?s.left:s.right}return{col:t,row:o}}getEndOfCluster(e,t,o){const s=this.getters.getActiveSheetId();let i=e;const n=this.getNextCellPosition(e,t,o);let r=this.isCellSkippableInCluster({...i,sheetId:s})||this.isCellSkippableInCluster({...n,sheetId:s})?"nextCluster":"endOfCluster";for(;;){const e=this.getNextCellPosition(i,t,o);if(i.col===e.col&&i.row===e.row)break;const n=this.isCellSkippableInCluster({...e,sheetId:s});if("endOfCluster"===r&&n)break;if("nextCluster"===r&&!n){i=e;break}i=e}return"cols"===t?i.col:i.row}getNextCellPosition(e,t,o){const s="cols"===t?"col":"row",i={...e},n="cols"===t?this.getNextAvailableCol(o,i.col,i.row):this.getNextAvailableRow(o,i.col,i.row);return i[s]=n,{col:i.col,row:i.row}}getPosition(){return{...this.anchor.cell}}isCellSkippableInCluster(e){const t=this.getters.getMainCellPosition(e),o=this.getters.getEvaluatedCell(t);return o.type===Hs.empty||o.type===Hs.text&&""===o.value}}function GP(e){if("string"==typeof e)return{};if("number"==typeof e)return[];throw new Error("Cannot create new node")}class WP{changes;commands=[];recordChanges(e){return this.changes=[],this.commands=[],e(),{changes:this.changes,commands:this.commands}}addCommand(e){this.commands.push(e)}addChange(...e){const t=e.pop();let o=e[0],s=e.at(-1);const i=e.length-2;for(let t=1;t<=i;t++){const s=e[t];if(void 0===o[s]){const i=e[t+1];o[s]=GP(i)}o=o[s]}o[s]!==t&&(this.changes?.push({key:s,target:o,before:o[s]}),void 0===t?delete o[s]:o[s]=t)}}const qP=17781237,ZP=17781238,jP=88853993,YP=88853994;function XP(e,t,o){const s=[["xmlns:r",bh],["xmlns:a",gh],["xmlns:c",ph]],i=KP({backgroundColor:e.data.backgroundColor,line:{color:"000000"}});let n=qu``;if(e.data.title?.text){const t=e.data.title.color?aE(e.data.title.color):e.data.fontColor;n=qu`
|
|
2580
|
+
`;class OP extends t.Component{static template="o-spreadsheet-Spreadsheet";static props={model:Object,notifyUser:{type:Function,optional:!0},raiseError:{type:Function,optional:!0},askConfirmation:{type:Function,optional:!0}};static components={TopBar:_P,Grid:wF,BottomBar:gP,SidePanel:yP,SpreadsheetDashboard:mP,HeaderGroupContainer:SP};sidePanel;spreadsheetRef=t.useRef("spreadsheet");spreadsheetRect=gx();_focusGrid;keyDownMapping;isViewportTooSmall=!1;notificationStore;composerFocusStore;get model(){return this.props.model}getStyle(){const e={};return this.env.isDashboard()?e["grid-template-rows"]="auto":e["grid-template-rows"]="63px auto 37px",e["grid-template-columns"]=`auto ${this.sidePanel.panelSize}px`,Nh(e)}setup(){const e=wc();e.inject(Ac,this.model),this.notificationStore=xc(D_),this.composerFocusStore=xc(Mc),this.sidePanel=xc(bF),this.keyDownMapping={"CTRL+H":()=>this.sidePanel.toggle("FindAndReplace",{}),"CTRL+F":()=>this.sidePanel.toggle("FindAndReplace",{})};const o=this.model.config.external.fileStore;t.useSubEnv({model:this.model,imageProvider:o?new nP(o):void 0,loadCurrencies:this.model.config.external.loadCurrencies,loadLocales:this.model.config.external.loadLocales,isDashboard:()=>this.model.getters.isDashboard(),openSidePanel:this.sidePanel.open.bind(this.sidePanel),toggleSidePanel:this.sidePanel.toggle.bind(this.sidePanel),clipboard:this.env.clipboard||new DP(navigator.clipboard),startCellEdition:e=>this.composerFocusStore.focusActiveComposer({content:e}),notifyUser:e=>this.notificationStore.notifyUser(e),askConfirmation:(e,t,o)=>this.notificationStore.askConfirmation(e,t,o),raiseError:(e,t)=>this.notificationStore.raiseError(e,t)}),this.notificationStore.updateNotificationCallbacks({...this.props}),t.useEffect((()=>{!this.spreadsheetRef.el.contains(document.activeElement)&&document.activeElement?.contains(this.spreadsheetRef.el)&&this.focusGrid()}),(()=>[this.env.model.getters.getActiveSheetId()])),t.useExternalListener(window,"resize",(()=>this.render(!0))),t.useExternalListener(document.body,"wheel",(()=>{})),this.bindModelEvents(),t.onWillUpdateProps((e=>{if(e.model!==this.props.model)throw new Error("Changing the props model is not supported at the moment.");e.notifyUser===this.props.notifyUser&&e.askConfirmation===this.props.askConfirmation&&e.raiseError===this.props.raiseError||this.notificationStore.updateNotificationCallbacks({...e})}));const s=function(e){let t=!1;return async(...o)=>{t||(t=!0,await Promise.resolve(),t=!1,e(...o))}}(this.render.bind(this,!0));t.onMounted((()=>{this.checkViewportSize(),e.on("store-updated",this,s),i.observe(this.spreadsheetRef.el)})),t.onWillUnmount((()=>{this.unbindModelEvents(),e.off("store-updated",this),i.disconnect()})),t.onPatched((()=>{this.checkViewportSize()}));const i=new ResizeObserver((()=>{this.sidePanel.changePanelSize(this.sidePanel.panelSize,this.spreadsheetRect.width)}))}bindModelEvents(){this.model.on("update",this,(()=>this.render(!0))),this.model.on("notify-ui",this,(e=>this.notificationStore.notifyUser(e))),this.model.on("raise-error-ui",this,(({text:e})=>this.notificationStore.raiseError(e)))}unbindModelEvents(){this.model.off("update",this),this.model.off("notify-ui",this),this.model.off("raise-error-ui",this)}checkViewportSize(){const{xRatio:e,yRatio:t}=this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());if(isFinite(e)&&isFinite(t))if(t>.85||e>.85){if(this.isViewportTooSmall)return;this.notificationStore.notifyUser({text:Io("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),type:"warning",sticky:!1}),this.isViewportTooSmall=!0}else this.isViewportTooSmall=!1}focusGrid(){this._focusGrid&&this._focusGrid()}onKeydown(e){let t="";ux(e)&&(t+="CTRL+"),t+=e.key.toUpperCase();let o=this.keyDownMapping[t];if(o)return e.preventDefault(),e.stopPropagation(),void o()}get gridHeight(){const{height:e}=this.env.model.getters.getSheetViewDimension();return e}get gridContainerStyle(){const e=se*this.rowLayers.length,t=se*this.colLayers.length;return Nh({"grid-template-columns":`${e?e+2:0}px auto`,"grid-template-rows":`${t?t+2:0}px auto`})}get rowLayers(){const e=this.env.model.getters.getActiveSheetId();return this.env.model.getters.getVisibleGroupLayers(e,"ROW")}get colLayers(){const e=this.env.model.getters.getActiveSheetId();return this.env.model.getters.getVisibleGroupLayers(e,"COL")}}class FP{listeners=[];async sendMessage(e){for(const{callback:t}of this.listeners)t(e)}onNewMessage(e,t){this.listeners.push({id:e,callback:t})}leave(e){this.listeners=this.listeners.filter((t=>t.id!==e))}}function MP(e){return qE.get(e.type)(e)}class PP{buildTransformation;operations;constructor(e,t=[]){this.buildTransformation=e,this.operations=t}getOperations(){return this.operations}getOperation(e){const t=this.operations.find((t=>t.id===e));if(!t)throw new Error(`Operation ${e} not found`);return t}getLastOperationId(){return this.operations[this.operations.length-1]?.id}getFirstOperationAmong(e,t){for(const o of this.operations){if(o.id===e)return e;if(o.id===t)return t}throw new Error(`Operation ${e} and ${t} not found`)}contains(e){return!!this.operations.find((t=>t.id===e))}prepend(e){const t=this.buildTransformation.with(e.data);this.operations=[e,...this.operations.map((e=>e.transformed(t)))]}insert(e,t){const o=this.buildTransformation.with(e.data),{before:s,operation:i,after:n}=this.locateOperation(t);this.operations=[...s,i,e,...n.map((e=>e.transformed(o)))]}append(e){this.operations.push(e)}appendBranch(e){this.operations=this.operations.concat(e.operations)}fork(e){const{after:t}=this.locateOperation(e);return new PP(this.buildTransformation,t)}transform(e){this.operations=this.operations.map((t=>t.transformed(e)))}cutBefore(e){this.operations=this.locateOperation(e).before}cutAfter(e){const{before:t,operation:o}=this.locateOperation(e);this.operations=t.concat([o])}locateOperation(e){const t=this.operations.findIndex((t=>t.id===e));if(-1===t)throw new Error(`Operation ${e} not found`);return{before:this.operations.slice(0,t),operation:this.operations[t],after:this.operations.slice(t+1)}}}class NP{id;data;constructor(e,t){this.id=e,this.data=t}transformed(e){return new kP(this.id,at((()=>e(this.data))))}}class kP{id;lazyData;constructor(e,t){this.id=e,this.lazyData=t}get data(){return this.lazyData()}transformed(e){return new kP(this.id,this.lazyData.map(e))}}class LP{operations;constructor(e){this.operations=e}[Symbol.iterator](){return this.operations[Symbol.iterator]()}stopWith(e){return new LP(function*(e,t){for(const o of e)if(yield o,o.operation.id===t)return}(this.operations,e))}stopBefore(e){return new LP(function*(e,t){for(const o of e){if(o.operation.id===t)return;yield o}}(this.operations,e))}startAfter(e){return new LP(function*(e,t){let o=!0;for(const s of e)o||(yield s),s.operation.id===t&&(o=!1)}(this.operations,e))}}class VP{buildTransformation;branches;branchingOperationIds=new Map;constructor(e,t){this.buildTransformation=e,this.branches=[t]}getLastBranch(){return this.branches[this.branches.length-1]}execution(e){return new LP(Ge(this._execution(e),this._execution(e)))}revertedExecution(e){return new LP(Ge(this._revertedExecution(e),this._revertedExecution(e)))}insertOperationLast(e,t){const o=e.getLastOperationId()||this.previousBranch(e)?.getLastOperationId();e.append(t),o&&this.insertPrevious(e,t,o)}insertOperationAfter(e,t,o){e.insert(t,o),this.updateNextWith(e,t,o),this.insertPrevious(e,t,o)}undo(e,t){const o=this.buildTransformation.without(t.data),s=this.branchingOperationIds.get(e);this.branchingOperationIds.set(e,t.id);const i=e.fork(t.id);s&&this.branchingOperationIds.set(i,s),this.insertBranchAfter(e,i),this.transform(i,o)}redo(e){const t=this.nextBranch(e);if(!t)return;const o=this.nextBranch(t);this.removeBranchFromTree(t);const s=this.branchingOperationIds.get(t);s?this.branchingOperationIds.set(e,s):this.branchingOperationIds.delete(e),o&&this.rebaseUp(o)}drop(e){for(const t of this.branches)t.contains(e)&&t.cutBefore(e)}findOperation(e,t){for(const o of this.revertedExecution(e))if(o.operation.id===t)return o;throw new Error(`Operation ${t} not found`)}rebaseUp(e){const{previousBranch:t,branchingOperation:o}=this.findPreviousBranchingOperation(e);if(!t||!o)return;const s=this.buildTransformation.without(o.data),i=t.fork(o.id);this.branchingOperationIds.set(i,this.branchingOperationIds.get(e)),this.removeBranchFromTree(e),this.insertBranchAfter(t,i),i.transform(s);const n=this.nextBranch(i);n&&this.rebaseUp(n)}removeBranchFromTree(e){const t=this.branches.findIndex((t=>t===e));this.branches.splice(t,1)}insertBranchAfter(e,t){const o=this.branches.findIndex((t=>t===e));this.branches.splice(o+1,0,t)}updateNextWith(e,t,o){const s=this.branchingOperationIds.get(e),i=this.nextBranch(e);if(s&&i)if(e.getFirstOperationAmong(o,s)===s){const n=this.addToNextBranch(e,i,s,t,o);this.updateNextWith(i,n,o)}else{const e=this.buildTransformation.with(t.data);this.transform(i,e)}}addToNextBranch(e,t,o,s,i){let n=s;return i===o?(n=this.getTransformedOperation(e,o,s),t.prepend(n)):t.contains(i)?(n=this.getTransformedOperation(e,o,s),t.insert(n,i)):t.append(s),n}getTransformedOperation(e,t,o){const s=e.getOperation(t),i=this.buildTransformation.without(s.data);return o.transformed(i)}shouldExecute(e,t){return t.id!==this.branchingOperationIds.get(e)}transform(e,t){e.transform(t);const o=this.nextBranch(e);o&&this.transform(o,t)}insertPrevious(e,t,o){const{previousBranch:s,branchingOperation:i}=this.findPreviousBranchingOperation(e);if(!s||!i)return;const n=this.buildTransformation.with(i.data),r=e.fork(o);r.transform(n),s.cutAfter(o),s.appendBranch(r);const a=t.transformed(n);this.insertPrevious(s,a,o)}findPreviousBranchingOperation(e){const t=this.previousBranch(e);if(!t)return{previousBranch:void 0,branchingOperation:void 0};const o=this.branchingOperationIds.get(t);return o?{previousBranch:t,branchingOperation:t.getOperation(o)}:{previousBranch:void 0,branchingOperation:void 0}}nextBranch(e){const t=this.branches.findIndex((t=>t===e));if(-1!==t)return this.branches[t+1]}previousBranch(e){const t=this.branches.findIndex((t=>t===e));if(-1!==t)return this.branches[t-1]}*_revertedExecution(e){const t=this.branchingOperationIds.get(e);let o=!!t;const s=e.getOperations();for(let i=s.length-1;i>=0;i--){const n=s[i];n.id===t&&(o=!1),o||(yield{operation:n,branch:e,isCancelled:!this.shouldExecute(e,n)})}const i=this.previousBranch(e);yield*i?this._revertedExecution(i):[]}*_execution(e){for(const t of e.getOperations())if(yield{operation:t,branch:e,isCancelled:!this.shouldExecute(e,t)},t.id===this.branchingOperationIds.get(e)){const t=this.nextBranch(e);return void(yield*t?this._execution(t):[])}if(!this.branchingOperationIds.get(e)){const t=this.nextBranch(e);yield*t?this._execution(t):[]}}}class UP{HEAD_BRANCH;HEAD_OPERATION;tree;applyOperation;revertOperation;buildEmpty;buildTransformation;constructor(e){this.applyOperation=e.applyOperation,this.revertOperation=e.revertOperation,this.buildEmpty=e.buildEmpty,this.buildTransformation=e.buildTransformation,this.HEAD_BRANCH=new PP(this.buildTransformation),this.tree=new VP(this.buildTransformation,this.HEAD_BRANCH);const t=e.initialOperationId,o=new NP(t,this.buildEmpty(t));this.tree.insertOperationLast(this.HEAD_BRANCH,o),this.HEAD_OPERATION=o}get(e){return this.tree.findOperation(this.HEAD_BRANCH,e).operation.data}append(e,t){const o=new NP(e,t),s=this.tree.getLastBranch();this.tree.insertOperationLast(s,o),this.HEAD_BRANCH=s,this.HEAD_OPERATION=o}insert(e,t,o){const s=new NP(e,t);this.revertTo(o),this.tree.insertOperationAfter(this.HEAD_BRANCH,s,o),this.fastForward()}undo(e,t,o){const{branch:s,operation:i}=this.tree.findOperation(this.HEAD_BRANCH,e);this.revertBefore(e),this.tree.undo(s,i),this.fastForward(),this.insert(t,this.buildEmpty(t),o)}redo(e,t,o){const{branch:s}=this.tree.findOperation(this.HEAD_BRANCH,e);this.revertBefore(e),this.tree.redo(s),this.fastForward(),this.insert(t,this.buildEmpty(t),o)}rebase(e){const t=this.get(e),o=[...this.tree.execution(this.HEAD_BRANCH).startAfter(e)];this.revertBefore(e);const s=this.HEAD_OPERATION.id;this.tree.drop(e),this.insert(e,t,s);for(const{operation:e}of o)this.insert(e.id,e.data,this.HEAD_OPERATION.id)}revertBefore(e){const t=this.tree.revertedExecution(this.HEAD_BRANCH).stopWith(e);this.revert(t)}revertTo(e){const t=e?this.tree.revertedExecution(this.HEAD_BRANCH).stopBefore(e):this.tree.revertedExecution(this.HEAD_BRANCH);this.revert(t)}revert(e){for(const{next:t,operation:o,isCancelled:s}of e)s||this.revertOperation(o.data),t&&(this.HEAD_BRANCH=t.branch,this.HEAD_OPERATION=t.operation)}fastForward(){const e=this.HEAD_OPERATION?this.tree.execution(this.HEAD_BRANCH).startAfter(this.HEAD_OPERATION.id):this.tree.execution(this.HEAD_BRANCH);for(const{operation:t,branch:o,isCancelled:s}of e)s||this.applyOperation(t.data),this.HEAD_OPERATION=t,this.HEAD_BRANCH=o}}function HP(e){return new UP({initialOperationId:e.initialRevisionId,applyOperation:t=>{const o=t.commands.slice(),{changes:s}=e.recordChanges((()=>{for(const t of o)e.dispatch(t)}));t.setChanges(s)},revertOperation:e=>function(e){for(const t of e.slice().reverse())for(let e=t.changes.length-1;e>=0;e--){BP(t.changes[e])}}([e]),buildEmpty:e=>new PM(e,"empty",[]),buildTransformation:{with:e=>t=>new PM(t.id,t.clientId,FM(t.commands,e.commands),t.rootCommand,void 0,t.timestamp),without:e=>t=>new PM(t.id,t.clientId,FM(t.commands,e.commands.map(MP).flat()),t.rootCommand,void 0,t.timestamp)}})}function BP(e){const t=e.target,o=e.key,s=e.before;void 0===s?delete t[o]:t[o]=s}class zP{observers=new Map;defaultSubscription;mainSubscription;registerAsDefault(e,t){this.defaultSubscription={owner:e,callbacks:t},this.mainSubscription||(this.mainSubscription=this.defaultSubscription)}observe(e,t){this.observers.set(e,{owner:e,callbacks:t})}detachObserver(e){this.observers.delete(e)}capture(e,t){if(this.observers.get(e))throw new Error("You are already subscribed forever");this.mainSubscription?.owner&&this.mainSubscription.owner!==e&&this.mainSubscription.callbacks.release?.(),this.mainSubscription={owner:e,callbacks:t}}release(e){this.mainSubscription?.owner!==e||this.observers.get(e)||(this.mainSubscription=this.defaultSubscription)}getBackToDefault(){this.mainSubscription!==this.defaultSubscription&&(this.mainSubscription?.callbacks.release?.(),this.mainSubscription=this.defaultSubscription)}isListening(e){return this.mainSubscription?.owner===e}send(e){this.mainSubscription?.callbacks.handleEvent(e),this.observers.forEach((t=>t.callbacks.handleEvent(e)))}}class $P{getters;stream;anchor;defaultAnchor;constructor(e){this.getters=e,this.stream=new zP,this.anchor={cell:{col:0,row:0},zone:Yo({col:0,row:0})},this.defaultAnchor=this.anchor}capture(e,t,o){this.stream.capture(e,o),this.anchor=t}registerAsDefault(e,t,o){this.checkAnchorZoneOrThrow(t),this.stream.registerAsDefault(e,o),this.defaultAnchor=t,this.capture(e,t,o)}resetDefaultAnchor(e,t){this.checkAnchorZoneOrThrow(t),this.stream.isListening(e)&&(this.anchor=t),this.defaultAnchor=t}resetAnchor(e,t){this.checkAnchorZoneOrThrow(t),this.stream.isListening(e)&&(this.anchor=t)}observe(e,t){this.stream.observe(e,t)}detachObserver(e){this.stream.detachObserver(e)}release(e){this.stream.isListening(e)&&(this.stream.release(e),this.anchor=this.defaultAnchor)}getBackToDefault(){this.stream.getBackToDefault()}modifyAnchor(e,t,o){const s=this.getters.getActiveSheetId();return e={...e,zone:this.getters.expandZone(s,e.zone)},this.processEvent({options:o,anchor:e,mode:t})}selectZone(e,t={scrollIntoView:!0}){return this.modifyAnchor(e,"overrideSelection",t)}selectCell(e,t){const o=Yo({col:e,row:t});return this.selectZone({zone:o,cell:{col:e,row:t}},{scrollIntoView:!0})}moveAnchorCell(e,t=1){if("end"!==t&&t<=0)return new Xs("InvalidSelectionStep");const{col:o,row:s}=this.getNextAvailablePosition(e,t);return this.selectCell(o,s)}setAnchorCorner(e,t){const o=this.getters.getActiveSheetId(),{col:s,row:i}=this.anchor.cell,n={left:Math.min(s,e),top:Math.min(i,t),right:Math.max(s,e),bottom:Math.max(i,t)},r={zone:this.getters.expandZone(o,n),cell:{col:s,row:i}};return this.processEvent({mode:"updateAnchor",anchor:r,options:{scrollIntoView:!1}})}addCellToSelection(e,t){const o=this.getters.getActiveSheetId();({col:e,row:t}=this.getters.getMainCellPosition({sheetId:o,col:e,row:t}));const s=this.getters.expandZone(o,Yo({col:e,row:t}));return this.processEvent({options:{scrollIntoView:!0},anchor:{zone:s,cell:{col:e,row:t}},mode:"newAnchor"})}resizeAnchorZone(e,t=1){if("end"!==t&&t<=0)return new Xs("InvalidSelectionStep");const o=this.getters.getActiveSheetId(),s=this.anchor,{col:i,row:n}=s.cell,{left:r,right:a,top:l,bottom:c}=s.zone,h=this.getStartingPosition(e);let[d,u]=this.deltaToTarget(h,e,t);if(0===d&&0===u)return Xs.Success;let g=s.zone;const p=e=>{e=qo(e);const{left:t,right:s,top:i,bottom:n}=this.getters.expandZone(o,e);return{left:Math.max(0,t),right:Math.min(this.getters.getNumberCols(o)-1,s),top:Math.max(0,i),bottom:Math.min(this.getters.getNumberRows(o)-1,n)}},{cell:m,zone:f}=this.getReferenceAnchor(),{col:v,row:b}=m;let S=0;for(;null!==g;){if(S++,d<0){const e=this.getNextAvailableCol(d,a-(S-1),b);g=f.right<=a-S?p({top:l,left:r,bottom:c,right:e}):null}if(d>0){const e=this.getNextAvailableCol(d,r+(S-1),b);g=r+S<=f.left?p({top:l,left:e,bottom:c,right:a}):null}if(u<0){const e=this.getNextAvailableRow(u,v,c-(S-1));g=f.bottom<=c-S?p({top:l,left:r,bottom:e,right:a}):null}if(u>0){const e=this.getNextAvailableRow(u,v,l+(S-1));g=l+S<=f.top?p({top:e,left:r,bottom:c,right:a}):null}if(g=g?qo(g):g,g&&!Vo(g,s.zone))return this.processEvent({options:{scrollIntoView:!0},mode:"updateAnchor",anchor:{zone:g,cell:{col:i,row:n}}})}g=p(ko({top:n,bottom:n,left:i,right:i},qo({top:this.getNextAvailableRow(u,v,l),left:this.getNextAvailableCol(d,r,b),bottom:this.getNextAvailableRow(u,v,c),right:this.getNextAvailableCol(d,a,b)})));const y={zone:g,cell:{col:i,row:n}};return this.processEvent({anchor:y,mode:"updateAnchor",options:{scrollIntoView:!0}})}selectColumn(e,t){const o=this.getters.getActiveSheetId(),s=this.getters.getNumberRows(o)-1;let i={left:e,right:e,top:0,bottom:s};const n=this.getters.findFirstVisibleColRowIndex(o,"ROW");let r,a;switch(t){case"overrideSelection":case"newAnchor":r=e,a=n;break;case"updateAnchor":({col:r,row:a}=this.anchor.cell),i=ko(i,{left:r,right:r,top:n,bottom:s})}return this.processEvent({options:{scrollIntoView:!1,unbounded:!0},anchor:{zone:i,cell:{col:r,row:a}},mode:t})}selectRow(e,t){const o=this.getters.getActiveSheetId(),s=this.getters.getNumberCols(o)-1;let i={top:e,bottom:e,left:0,right:s};const n=this.getters.findFirstVisibleColRowIndex(o,"COL");let r,a;switch(t){case"overrideSelection":case"newAnchor":r=n,a=e;break;case"updateAnchor":({col:r,row:a}=this.anchor.cell),i=ko(i,{left:n,right:s,top:a,bottom:a})}return this.processEvent({options:{scrollIntoView:!1,unbounded:!0},anchor:{zone:i,cell:{col:r,row:a}},mode:t})}loopSelection(){const e=this.getters.getActiveSheetId(),t=this.anchor;if(Vo(this.anchor.zone,this.getters.getSheetZone(e)))return this.modifyAnchor({...t,zone:Yo(t.cell)},"updateAnchor",{scrollIntoView:!1});const o=this.getters.getContiguousZone(e,t.zone);return ht(o,t.zone)?this.selectAll():this.modifyAnchor({...t,zone:o},"updateAnchor",{scrollIntoView:!1})}selectTableAroundSelection(){const e=this.getters.getActiveSheetId(),t=this.getters.getContiguousZone(e,this.anchor.zone);return this.modifyAnchor({...this.anchor,zone:t},"updateAnchor",{scrollIntoView:!1})}selectAll(){const e=this.getters.getActiveSheetId(),t={left:0,top:0,bottom:this.getters.getNumberRows(e)-1,right:this.getters.getNumberCols(e)-1};return this.processEvent({mode:"overrideSelection",anchor:{zone:t,cell:this.anchor.cell},options:{scrollIntoView:!1}})}isListening(e){return this.stream.isListening(e)}processEvent(e){const t={...e,previousAnchor:ke(this.anchor)},o=this.checkEventAnchorZone(t);return"Success"!==o?new Xs(o):(this.anchor=t.anchor,this.stream.send(t),Xs.Success)}checkEventAnchorZone(e){return this.checkAnchorZone(e.anchor)}checkAnchorZone(e){const{cell:t,zone:o}=e;if(!Ho(t.col,t.row,o))return"InvalidAnchorZone";const{left:s,right:i,top:n,bottom:r}=o,a=this.getters.getActiveSheetId(),l=this.getters.findVisibleHeader(a,"COL",s,i);return void 0===this.getters.findVisibleHeader(a,"ROW",n,r)||void 0===l?"SelectionOutOfBound":"Success"}checkAnchorZoneOrThrow(e){if("InvalidAnchorZone"===this.checkAnchorZone(e))throw new Error(Io("The provided anchor is invalid. The cell must be part of the zone."))}getNextAvailablePosition(e,t=1){const{col:o,row:s}=this.anchor.cell,i=this.deltaToTarget({col:o,row:s},e,t);return{col:this.getNextAvailableCol(i[0],o,s),row:this.getNextAvailableRow(i[1],o,s)}}getNextAvailableCol(e,t,o){const s=this.getters.getActiveSheetId(),i={col:t,row:o};return this.getNextAvailableHeader(e,"COL",t,i,(e=>this.getters.isInSameMerge(s,t,o,e,o)))}getNextAvailableRow(e,t,o){const s=this.getters.getActiveSheetId(),i={col:t,row:o};return this.getNextAvailableHeader(e,"ROW",o,i,(e=>this.getters.isInSameMerge(s,t,o,t,e)))}getNextAvailableHeader(e,t,o,s,i){const n=this.getters.getActiveSheetId();if(0===e)return o;const r=Math.sign(e);let a=o+e;for(;i(a);)a+=r;for(;this.getters.isHeaderHidden(n,t,a);)a+=r;return a<0||a>this.getters.getNumberHeaders(n,t)-1?this.getters.isHeaderHidden(n,t,o)?this.getNextAvailableHeader(-r,t,o,s,i):o:a}getReferenceAnchor(){const e=this.getters.getActiveSheetId(),t=this.anchor,{left:o,right:s,top:i,bottom:n}=t.zone,{col:r,row:a}=t.cell,l=this.getters.isColHidden(e,r)&&this.getters.findVisibleHeader(e,"COL",o,s)||r,c=this.getters.isRowHidden(e,a)&&this.getters.findVisibleHeader(e,"ROW",i,n)||a;return{cell:{col:l,row:c},zone:this.getters.expandZone(e,{left:l,right:l,top:c,bottom:c})}}deltaToTarget(e,t,o){switch(t){case"up":return"end"!==o?[0,-o]:[0,this.getEndOfCluster(e,"rows",-1)-e.row];case"down":return"end"!==o?[0,o]:[0,this.getEndOfCluster(e,"rows",1)-e.row];case"left":return"end"!==o?[-o,0]:[this.getEndOfCluster(e,"cols",-1)-e.col,0];case"right":return"end"!==o?[o,0]:[this.getEndOfCluster(e,"cols",1)-e.col,0]}}getStartingPosition(e){let{col:t,row:o}=this.getPosition();const s=this.anchor.zone;switch(e){case"down":case"up":o=o===s.top?s.bottom:s.top;break;case"left":case"right":t=t===s.right?s.left:s.right}return{col:t,row:o}}getEndOfCluster(e,t,o){const s=this.getters.getActiveSheetId();let i=e;const n=this.getNextCellPosition(e,t,o);let r=this.isCellSkippableInCluster({...i,sheetId:s})||this.isCellSkippableInCluster({...n,sheetId:s})?"nextCluster":"endOfCluster";for(;;){const e=this.getNextCellPosition(i,t,o);if(i.col===e.col&&i.row===e.row)break;const n=this.isCellSkippableInCluster({...e,sheetId:s});if("endOfCluster"===r&&n)break;if("nextCluster"===r&&!n){i=e;break}i=e}return"cols"===t?i.col:i.row}getNextCellPosition(e,t,o){const s="cols"===t?"col":"row",i={...e},n="cols"===t?this.getNextAvailableCol(o,i.col,i.row):this.getNextAvailableRow(o,i.col,i.row);return i[s]=n,{col:i.col,row:i.row}}getPosition(){return{...this.anchor.cell}}isCellSkippableInCluster(e){const t=this.getters.getMainCellPosition(e),o=this.getters.getEvaluatedCell(t);return o.type===Hs.empty||o.type===Hs.text&&""===o.value}}function GP(e){if("string"==typeof e)return{};if("number"==typeof e)return[];throw new Error("Cannot create new node")}class WP{changes;commands=[];recordChanges(e){return this.changes=[],this.commands=[],e(),{changes:this.changes,commands:this.commands}}addCommand(e){this.commands.push(e)}addChange(...e){const t=e.pop();let o=e[0],s=e.at(-1);const i=e.length-2;for(let t=1;t<=i;t++){const s=e[t];if(void 0===o[s]){const i=e[t+1];o[s]=GP(i)}o=o[s]}o[s]!==t&&(this.changes?.push({key:s,target:o,before:o[s]}),void 0===t?delete o[s]:o[s]=t)}}const qP=17781237,ZP=17781238,jP=88853993,YP=88853994;function XP(e,t,o){const s=[["xmlns:r",bh],["xmlns:a",gh],["xmlns:c",ph]],i=KP({backgroundColor:e.data.backgroundColor,line:{color:"000000"}});let n=qu``;if(e.data.title?.text){const t=e.data.title.color?aE(e.data.title.color):e.data.fontColor;n=qu`
|
|
2581
2581
|
<c:title>
|
|
2582
2582
|
${JP(e.data.title.text,t,Z,e.data.title)}
|
|
2583
2583
|
<c:overlay val="0" />
|
|
@@ -3275,4 +3275,4 @@
|
|
|
3275
3275
|
<tableParts count="${e.tables.length}">
|
|
3276
3276
|
${Wu(a)}
|
|
3277
3277
|
</tableParts>
|
|
3278
|
-
`}var GN;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(GN||(GN={}));function WN(e,t={}){const o=ke(t);return o.type=e,o}const qN={},ZN={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:Y,HEADER_WIDTH:X,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:K,DEFAULT_CELL_HEIGHT:Q,SCROLLBAR_WIDTH:J},jN={autoCompleteProviders:Up,autofillModifiersRegistry:Kx,autofillRulesRegistry:Qx,cellMenuRegistry:KR,colMenuRegistry:LA,errorTypes:ai,linkMenuRegistry:wI,functionRegistry:Kw,featurePluginRegistry:tP,iconsOnCellRegistry:_h,statefulUIPluginRegistry:oP,coreViewsPluginRegistry:sP,corePluginRegistry:eP,rowMenuRegistry:BA,sidePanelRegistry:SO,figureRegistry:zE,chartSidePanelComponentRegistry:R_,chartComponentRegistry:NE,chartRegistry:PE,chartSubtypeRegistry:LE,topbarMenuRegistry:WA,topbarComponentRegistry:yO,clickableCellRegistry:iP,otRegistry:qA,inverseCommandRegistry:qE,urlRegistry:nn,cellPopoverRegistry:nE,numberFormatMenuRegistry:VA,repeatLocalCommandTransformRegistry:YM,repeatCommandTransformRegistry:jM,clipboardHandlersRegistries:mc,pivotRegistry:WD,pivotTimeAdapterRegistry:Fl,pivotSidePanelRegistry:YD,pivotNormalizationValueRegistry:cc,supportedPivotPositionalFormulaRegistry:Xx,pivotToFunctionValueRegistry:hc,migrationStepRegistry:yg},YN={arg:$p,isEvaluationError:bi,toBoolean:Oi,toJsDate:Fi,toNumber:yi,toString:Ai,toNormalizedPivotValue:nc,toXC:go,toZone:Ao,toUnboundedZone:To,toCartesian:uo,numberToLetters:to,lettersToNumber:oo,UuidGenerator:ra,formatValue:Nn,createCurrencyFormat:Yn,ColorGenerator:eo,computeTextWidth:Zr,createEmptyWorkbookData:Ag,createEmptySheet:Tg,createEmptyExcelSheet:_g,getDefaultChartJsRuntime:Tp,chartFontColor:Gc,getChartAxisTitleRuntime:jc,getChartAxisType:mE,getTrendDatasetForBarChart:Kc,getTrendDatasetForLineChart:SE,getFillingMode:Fp,rgbaToHex:Ut,colorToRGBA:Ht,positionToZone:Yo,isDefined:ot,isMatrix:oi,lazy:at,genericRepeat:XM,createAction:i,createActions:o,transformRangeData:vc,deepEquals:ht,overlap:Uo,union:ko,isInside:Ho,deepCopy:ke,expandZoneOnInsertion:Fo,reduceZoneOnDeletion:No,unquote:Ve,getMaxObjectId:Kl,getFunctionsFromTokens:zx,getFirstPivotFunction:jx,getNumberOfPivotFunctions:Yx,parseDimension:ec,isDateOrDatetimeField:tc,makeFieldProposal:Gx,insertTokenAfterArgSeparator:Wx,insertTokenAfterLeftParenthesis:qx,mergeContiguousZones:es,getPivotHighlights:zA,pivotTimeAdapter:Ml,UNDO_REDO_PIVOT_COMMANDS:CM,createPivotFormula:ic,areDomainArgsFieldsValid:sc,splitReference:Dr,formatTickValue:eh,sanitizeSheetName:He,isNumber:ks,isDateTime:Ss},XN={isMarkdownLink:je,parseMarkdownLink:Ke,markdownLink:Xe,openLink:hn,urlRepresentation:cn},KN={Checkbox:ZA,Section:jA,RoundColorPicker:g_,ChartDataSeries:QA,ChartErrorSection:e_,ChartLabelRange:t_,ChartTitle:m_,ChartPanel:__,ChartFigure:UE,ChartJsComponent:Lp,Grid:wF,GridOverlay:eF,ScorecardChart:Vp,LineConfigPanel:C_,BarConfigPanel:s_,PieChartDesignPanel:w_,GenericChartConfigPanel:o_,ChartWithAxisDesignPanel:b_,GaugeChartConfigPanel:S_,GaugeChartDesignPanel:y_,ScorecardChartConfigPanel:x_,ScorecardChartDesignPanel:E_,ChartTypePicker:T_,FigureComponent:CO,Menu:xI,Popover:oI,SelectionInput:KA,ValidationMessages:JA,AddDimensionButton:CD,PivotDimensionGranularity:ID,PivotDimensionOrder:RD,PivotDimension:ED,PivotLayoutConfigurator:AD,PivotHTMLRenderer:EF,EditableName:xF,PivotDeferUpdate:yD,PivotTitleSection:_D,CogWheelMenu:xD,TextInput:wD,SidePanelCollapsible:n_},QN={useDragAndDropListItems:N_,useHighlights:z_,useHighlightsOnHover:B_},JN={useStoreProvider:wc,DependencyContainer:Sc,CellPopoverStore:QE,ComposerFocusStore:Mc,CellComposerStore:FO,FindAndReplaceStore:pD,HighlightStore:GA,HoveredCellStore:KE,ModelStore:Ac,NotificationStore:D_,RendererStore:Dc,SelectionInputStore:XA,SpreadsheetStore:Oc,useStore:xc,useLocalStore:Ec,SidePanelStore:bF,PivotSidePanelStore:ZD,PivotMeasureDisplayPanelStore:bD};const ek={DEFAULT_LOCALE:ei,HIGHLIGHT_COLOR:a,PIVOT_TABLE_CONFIG:Oe,TREND_LINE_XAXIS_ID:Pc,CHART_AXIS_CHOICES:oh,ChartTerms:kg};e.AbstractCellClipboardHandler=pa,e.AbstractChart=hp,e.AbstractFigureClipboardHandler=pc,e.CellErrorType=ri,e.CorePlugin=RF,e.DispatchResult=Xs,e.EvaluationError=li,e.Model=class extends bc{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new ra,n=!1){const r=performance.now();console.debug("##### Model creation #####"),super(),wo===yo&&xo===Co&&(xo=()=>!0),s=Ig(e,s);const a=Eg(e,n);this.state=new WP,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new MF(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.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.selection=new $P(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of eP.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of sP.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of oP.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of tP.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}if(this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested||e["[Content_Types].xml"]&&!this.getters.isReadonly()){const e=performance.now();console.debug("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.debug("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.debug("Model created in",performance.now()-r,"ms"),console.debug("######")}joinSession(){this.session.join(this.config.client)}async leaveSession(){const e=this.getters.isReadonly()?void 0:at((()=>this.exportData()));await this.session.leave(e)}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new kM(HP({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful?(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1):this.dispatchToHandlers(this.coreHandlers,{type:"UNDO",commands:[e]})}}),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){const t=e.client||{id:this.uuidGenerator.smallUuid(),name:Io("Anonymous").toString()},o=e.transportService||new FP;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Js));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[]}}checkDispatchAllowed(e){const t=Ys(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new Xs(t.flat()):Xs.Success}checkDispatchAllowedCoreCommand(e){const 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(const e of this.handlers)e.finalize();this.status=0,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(WN(e,t));dispatch=(e,t)=>{const o=WN(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!Zs.has(i.type)))return new Xs("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new Xs("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return this.trigger("update"),t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();Ys(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.debug(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(Ys(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(Ys(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Xs.Success};dispatchFromCorePlugin=(e,t)=>{const o=WN(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,Xs.Success};dispatchToHandlers(e,t){const o=Ys(t);for(const s of e)!o&&s instanceof RF||s.beforeHandle(t);for(const s of e)!o&&s instanceof RF||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=Ag();for(let t of this.handlers)t instanceof RF&&t.export(e);return e.revisionId=this.session.getRevisionId()||me,e=ke(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...Ag(),sheets:[_g(xg,"Sheet1")]};for(let t of this.handlers)t instanceof IF&&t.exportForExcel(e);return e=ke(e),zN(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=DD,e.Registry=n,e.Revision=PM,e.SPREADSHEET_DIMENSIONS=ZN,e.Spreadsheet=OP,e.SpreadsheetPivotTable=MD,e.UIPlugin=NF,e.__info__=qN,e.addFunction=function e(t,o){return Kw.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(ii[e])throw new Error(`Layer ${e} already exists`);ii[e]=t},e.astToFormula=Hy,e.compile=Lx,e.compileTokens=Vx,e.components=KN,e.constants=ek,e.convertAstNodes=ky,e.coreTypes=js,e.findCellInNewZone=jo,e.functionCache=kx,e.helpers=YN,e.hooks=QN,e.invalidateCFEvaluationCommands=Ws,e.invalidateDependenciesCommands=Gs,e.invalidateEvaluationCommands=zs,e.iterateAstNodes=Ly,e.links=XN,e.load=Eg,e.parse=Py,e.parseTokens=Ny,e.readonlyAllowedCommands=Zs,e.registries=jN,e.setDefaultSheetViewSize=function(e){Te=e},e.setTranslationMethod=function(e,t=(()=>!0)){wo=e,xo=t},e.stores=JN,e.tokenColors=Tx,e.tokenize=va,qN.version="18.0.35",qN.date="2025-06-23T15:06:32.032Z",qN.hash="a38db25"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
3278
|
+
`}var GN;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(GN||(GN={}));function WN(e,t={}){const o=ke(t);return o.type=e,o}const qN={},ZN={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:Y,HEADER_WIDTH:X,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:K,DEFAULT_CELL_HEIGHT:Q,SCROLLBAR_WIDTH:J},jN={autoCompleteProviders:Up,autofillModifiersRegistry:Kx,autofillRulesRegistry:Qx,cellMenuRegistry:KR,colMenuRegistry:LA,errorTypes:ai,linkMenuRegistry:wI,functionRegistry:Kw,featurePluginRegistry:tP,iconsOnCellRegistry:_h,statefulUIPluginRegistry:oP,coreViewsPluginRegistry:sP,corePluginRegistry:eP,rowMenuRegistry:BA,sidePanelRegistry:SO,figureRegistry:zE,chartSidePanelComponentRegistry:R_,chartComponentRegistry:NE,chartRegistry:PE,chartSubtypeRegistry:LE,topbarMenuRegistry:WA,topbarComponentRegistry:yO,clickableCellRegistry:iP,otRegistry:qA,inverseCommandRegistry:qE,urlRegistry:nn,cellPopoverRegistry:nE,numberFormatMenuRegistry:VA,repeatLocalCommandTransformRegistry:YM,repeatCommandTransformRegistry:jM,clipboardHandlersRegistries:mc,pivotRegistry:WD,pivotTimeAdapterRegistry:Fl,pivotSidePanelRegistry:YD,pivotNormalizationValueRegistry:cc,supportedPivotPositionalFormulaRegistry:Xx,pivotToFunctionValueRegistry:hc,migrationStepRegistry:yg},YN={arg:$p,isEvaluationError:bi,toBoolean:Oi,toJsDate:Fi,toNumber:yi,toString:Ai,toNormalizedPivotValue:nc,toXC:go,toZone:Ao,toUnboundedZone:To,toCartesian:uo,numberToLetters:to,lettersToNumber:oo,UuidGenerator:ra,formatValue:Nn,createCurrencyFormat:Yn,ColorGenerator:eo,computeTextWidth:Zr,createEmptyWorkbookData:Ag,createEmptySheet:Tg,createEmptyExcelSheet:_g,getDefaultChartJsRuntime:Tp,chartFontColor:Gc,getChartAxisTitleRuntime:jc,getChartAxisType:mE,getTrendDatasetForBarChart:Kc,getTrendDatasetForLineChart:SE,getFillingMode:Fp,rgbaToHex:Ut,colorToRGBA:Ht,positionToZone:Yo,isDefined:ot,isMatrix:oi,lazy:at,genericRepeat:XM,createAction:i,createActions:o,transformRangeData:vc,deepEquals:ht,overlap:Uo,union:ko,isInside:Ho,deepCopy:ke,expandZoneOnInsertion:Fo,reduceZoneOnDeletion:No,unquote:Ve,getMaxObjectId:Kl,getFunctionsFromTokens:zx,getFirstPivotFunction:jx,getNumberOfPivotFunctions:Yx,parseDimension:ec,isDateOrDatetimeField:tc,makeFieldProposal:Gx,insertTokenAfterArgSeparator:Wx,insertTokenAfterLeftParenthesis:qx,mergeContiguousZones:es,getPivotHighlights:zA,pivotTimeAdapter:Ml,UNDO_REDO_PIVOT_COMMANDS:CM,createPivotFormula:ic,areDomainArgsFieldsValid:sc,splitReference:Dr,formatTickValue:eh,sanitizeSheetName:He,isNumber:ks,isDateTime:Ss},XN={isMarkdownLink:je,parseMarkdownLink:Ke,markdownLink:Xe,openLink:hn,urlRepresentation:cn},KN={Checkbox:ZA,Section:jA,RoundColorPicker:g_,ChartDataSeries:QA,ChartErrorSection:e_,ChartLabelRange:t_,ChartTitle:m_,ChartPanel:__,ChartFigure:UE,ChartJsComponent:Lp,Grid:wF,GridOverlay:eF,ScorecardChart:Vp,LineConfigPanel:C_,BarConfigPanel:s_,PieChartDesignPanel:w_,GenericChartConfigPanel:o_,ChartWithAxisDesignPanel:b_,GaugeChartConfigPanel:S_,GaugeChartDesignPanel:y_,ScorecardChartConfigPanel:x_,ScorecardChartDesignPanel:E_,ChartTypePicker:T_,FigureComponent:CO,Menu:xI,Popover:oI,SelectionInput:KA,ValidationMessages:JA,AddDimensionButton:CD,PivotDimensionGranularity:ID,PivotDimensionOrder:RD,PivotDimension:ED,PivotLayoutConfigurator:AD,PivotHTMLRenderer:EF,EditableName:xF,PivotDeferUpdate:yD,PivotTitleSection:_D,CogWheelMenu:xD,TextInput:wD,SidePanelCollapsible:n_},QN={useDragAndDropListItems:N_,useHighlights:z_,useHighlightsOnHover:B_},JN={useStoreProvider:wc,DependencyContainer:Sc,CellPopoverStore:QE,ComposerFocusStore:Mc,CellComposerStore:FO,FindAndReplaceStore:pD,HighlightStore:GA,HoveredCellStore:KE,ModelStore:Ac,NotificationStore:D_,RendererStore:Dc,SelectionInputStore:XA,SpreadsheetStore:Oc,useStore:xc,useLocalStore:Ec,SidePanelStore:bF,PivotSidePanelStore:ZD,PivotMeasureDisplayPanelStore:bD};const ek={DEFAULT_LOCALE:ei,HIGHLIGHT_COLOR:a,PIVOT_TABLE_CONFIG:Oe,TREND_LINE_XAXIS_ID:Pc,CHART_AXIS_CHOICES:oh,ChartTerms:kg};e.AbstractCellClipboardHandler=pa,e.AbstractChart=hp,e.AbstractFigureClipboardHandler=pc,e.CellErrorType=ri,e.CorePlugin=RF,e.DispatchResult=Xs,e.EvaluationError=li,e.Model=class extends bc{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new ra,n=!1){const r=performance.now();console.debug("##### Model creation #####"),super(),wo===yo&&xo===Co&&(xo=()=>!0),s=Ig(e,s);const a=Eg(e,n);this.state=new WP,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new MF(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.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.selection=new $P(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of eP.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of sP.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of oP.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of tP.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}if(this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested||e["[Content_Types].xml"]&&!this.getters.isReadonly()){const e=performance.now();console.debug("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.debug("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.debug("Model created in",performance.now()-r,"ms"),console.debug("######")}joinSession(){this.session.join(this.config.client)}async leaveSession(){const e=this.getters.isReadonly()?void 0:at((()=>this.exportData()));await this.session.leave(e)}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new kM(HP({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful?(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1):this.dispatchToHandlers(this.coreHandlers,{type:"UNDO",commands:[e]})}}),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){const t=e.client||{id:this.uuidGenerator.smallUuid(),name:Io("Anonymous").toString()},o=e.transportService||new FP;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Js));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[]}}checkDispatchAllowed(e){const t=Ys(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new Xs(t.flat()):Xs.Success}checkDispatchAllowedCoreCommand(e){const 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(const e of this.handlers)e.finalize();this.status=0,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(WN(e,t));dispatch=(e,t)=>{const o=WN(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!Zs.has(i.type)))return new Xs("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new Xs("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return this.trigger("update"),t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();Ys(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.debug(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(Ys(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(Ys(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Xs.Success};dispatchFromCorePlugin=(e,t)=>{const o=WN(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,Xs.Success};dispatchToHandlers(e,t){const o=Ys(t);for(const s of e)!o&&s instanceof RF||s.beforeHandle(t);for(const s of e)!o&&s instanceof RF||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=Ag();for(let t of this.handlers)t instanceof RF&&t.export(e);return e.revisionId=this.session.getRevisionId()||me,e=ke(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...Ag(),sheets:[_g(xg,"Sheet1")]};for(let t of this.handlers)t instanceof IF&&t.exportForExcel(e);return e=ke(e),zN(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=DD,e.Registry=n,e.Revision=PM,e.SPREADSHEET_DIMENSIONS=ZN,e.Spreadsheet=OP,e.SpreadsheetPivotTable=MD,e.UIPlugin=NF,e.__info__=qN,e.addFunction=function e(t,o){return Kw.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(ii[e])throw new Error(`Layer ${e} already exists`);ii[e]=t},e.astToFormula=Hy,e.compile=Lx,e.compileTokens=Vx,e.components=KN,e.constants=ek,e.convertAstNodes=ky,e.coreTypes=js,e.findCellInNewZone=jo,e.functionCache=kx,e.helpers=YN,e.hooks=QN,e.invalidateCFEvaluationCommands=Ws,e.invalidateDependenciesCommands=Gs,e.invalidateEvaluationCommands=zs,e.iterateAstNodes=Ly,e.links=XN,e.load=Eg,e.parse=Py,e.parseTokens=Ny,e.readonlyAllowedCommands=Zs,e.registries=jN,e.setDefaultSheetViewSize=function(e){Te=e},e.setTranslationMethod=function(e,t=(()=>!0)){wo=e,xo=t},e.stores=JN,e.tokenColors=Tx,e.tokenize=va,qN.version="18.0.36",qN.date="2025-06-27T09:11:51.920Z",qN.hash="b8dc998"}(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 18.0.
|
|
5
|
-
@date 2025-06-
|
|
6
|
-
@hash
|
|
4
|
+
@version 18.0.36
|
|
5
|
+
@date 2025-06-27T09:12:46.311Z
|
|
6
|
+
@hash b8dc998
|
|
7
7
|
-->
|
|
8
8
|
<odoo>
|
|
9
9
|
<t t-name="o-spreadsheet-ActionButton">
|