@univerjs/preset-sheets-node-core 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/locales/en-US.js +1 -1
- package/lib/cjs/locales/fa-IR.js +1 -1
- package/lib/cjs/locales/fr-FR.js +1 -1
- package/lib/cjs/locales/ru-RU.js +1 -1
- package/lib/cjs/locales/vi-VN.js +1 -1
- package/lib/cjs/locales/zh-CN.js +1 -1
- package/lib/cjs/locales/zh-TW.js +1 -1
- package/lib/es/locales/en-US.js +5 -5
- package/lib/es/locales/fa-IR.js +4 -4
- package/lib/es/locales/fr-FR.js +2 -2
- package/lib/es/locales/ru-RU.js +3 -3
- package/lib/es/locales/vi-VN.js +4 -4
- package/lib/es/locales/zh-CN.js +4 -4
- package/lib/es/locales/zh-TW.js +4 -4
- package/lib/umd/index.js +12 -12
- package/lib/umd/locales/en-US.js +1 -1
- package/lib/umd/locales/fa-IR.js +1 -1
- package/lib/umd/locales/fr-FR.js +1 -1
- package/lib/umd/locales/ru-RU.js +1 -1
- package/lib/umd/locales/vi-VN.js +1 -1
- package/lib/umd/locales/zh-CN.js +1 -1
- package/lib/umd/locales/zh-TW.js +1 -1
- package/package.json +17 -17
package/lib/umd/index.js
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets/index
|
|
10
|
-
(function(g,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/rpc"),require("rxjs"),require("@univerjs/engine-numfmt"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula","@univerjs/rpc","rxjs","@univerjs/engine-numfmt","rxjs/operators"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g.UniverSheets={},g.UniverCore,g.UniverEngineFormula,g.UniverRpc,g.rxjs,g.UniverEngineNumfmt,g.rxjs.operators))})(this,function(g,r,z,$r,W,wo,it){"use strict";var dl=Object.defineProperty;var cl=(g,r,z)=>r in g?dl(g,r,{enumerable:!0,configurable:!0,writable:!0,value:z}):g[r]=z;var S=(g,r,z)=>cl(g,typeof r!="symbol"?r+"":r,z);var _o=(o=>(o.OthersCanView="othersCanView",o.NoOneElseCanView="noOneElseCanView",o))(_o||{}),yo=(o=>(o.DesignedUserCanEdit="designedUserCanEdit",o.OnlyMe="onlyMe",o))(yo||{});class J{constructor(){S(this,"_model",new Map);S(this,"_ruleChange",new W.Subject);S(this,"ruleChange$",this._ruleChange.asObservable());S(this,"_ruleRefresh",new W.Subject);S(this,"ruleRefresh$",this._ruleRefresh.asObservable());S(this,"_rangeRuleInitStateChange",new W.BehaviorSubject(!1));S(this,"rangeRuleInitStateChange$",this._rangeRuleInitStateChange.asObservable())}ruleRefresh(e){this._ruleRefresh.next(e)}getRangeRuleInitState(){return this._rangeRuleInitStateChange.value}changeRuleInitState(e){this._rangeRuleInitStateChange.next(e)}addRule(e,t,n){this._ensureRuleMap(e,t).set(n.id,n),this._ruleChange.next({unitId:e,subUnitId:t,rule:n,type:"add"})}deleteRule(e,t,n){var i,a,u,l;const s=(a=(i=this._model.get(e))==null?void 0:i.get(t))==null?void 0:a.get(n);s&&((l=(u=this._model.get(e))==null?void 0:u.get(t))==null||l.delete(n),this._ruleChange.next({unitId:e,subUnitId:t,rule:s,type:"delete"}))}setRule(e,t,n,s){var a,u;const i=this.getRule(e,t,n);i&&((u=(a=this._model.get(e))==null?void 0:a.get(t))==null||u.set(n,s),this._ruleChange.next({unitId:e,subUnitId:t,oldRule:i,rule:s,type:"set"}))}getRule(e,t,n){var s,i;return(i=(s=this._model.get(e))==null?void 0:s.get(t))==null?void 0:i.get(n)}getSubunitRuleList(e,t){var s;return[...(((s=this._model.get(e))==null?void 0:s.get(t))||new Map).values()]}getSubunitRuleListLength(e,t){var s;const n=(s=this._model.get(e))==null?void 0:s.get(t);return n?n.size:0}_ensureRuleMap(e,t){let n=this._model.get(e);n||(n=new Map,this._model.set(e,n));let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const s=this._model.get(n),i=[...s.keys()];e[n]={},i.forEach(a=>{const u=s.get(a);e[n][a]=[...u.values()]})}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const s=e[n],i=new Map;Object.keys(s).forEach(a=>{const u=s[a].reduce((l,d)=>(l.set(d.id,d),l),new Map);i.set(a,u)}),t.set(n,i)}),this._model=t}deleteUnitModel(e){this._model.delete(e)}createRuleId(e,t){let n=r.Tools.generateRandomId(4);const s=this._ensureRuleMap(e,t);for(;s.has(n);)n=r.Tools.generateRandomId(4);return n}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[s,i]of n)for(const a of i.values())if(a.permissionId===t)return[e,s];return null}}const Lr=(o,e)=>{const t=o.get(J),n=e.ruleIds.map(i=>t.getRule(e.unitId,e.subUnitId,i)).filter(i=>!!i);return{id:ie.id,params:{subUnitId:e.subUnitId,unitId:e.unitId,rules:n}}},de={id:"sheet.mutation.delete-range-protection",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,ruleIds:s}=e,i=o.get(J);return s.forEach(a=>{i.deleteRule(t,n,a)}),!0}},Br=o=>{const e={...o,ruleIds:o.rules.map(t=>t.id)};return{id:de.id,params:e}},ie={id:"sheet.mutation.add-range-protection",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,rules:s}=e,i=o.get(J);return s.forEach(a=>{i.addRule(t,n,a)}),!0}},bo={type:r.CommandType.COMMAND,id:"sheet.command.add-range-protection",async handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(J),{rule:i,permissionId:a}=e,{unitId:u,subUnitId:l,ranges:d,description:c,viewState:m,editState:h}=i,R=[{ranges:d,permissionId:a,id:s.createRuleId(u,l),description:c,unitType:i.unitType,unitId:u,subUnitId:l,viewState:m,editState:h}];if(await t.executeCommand(ie.id,{unitId:u,subUnitId:l,rules:R})){const f=[{id:ie.id,params:{unitId:u,subUnitId:l,rules:R}}],v=[{id:de.id,params:{unitId:u,subUnitId:l,ruleIds:R.map(I=>I.id)}}];n.pushUndoRedo({unitID:u,redoMutations:f,undoMutations:v})}return!0}};class Ee{constructor(){S(this,"_model",new Map);S(this,"_ruleChange",new W.Subject);S(this,"_ruleRefresh",new W.Subject);S(this,"_resetOrder",new W.Subject);S(this,"ruleChange$",this._ruleChange.asObservable());S(this,"ruleRefresh$",this._ruleRefresh.asObservable());S(this,"resetOrder$",this._resetOrder.asObservable());S(this,"_worksheetRuleInitStateChange",new W.BehaviorSubject(!1));S(this,"worksheetRuleInitStateChange$",this._worksheetRuleInitStateChange.asObservable())}changeRuleInitState(e){this._worksheetRuleInitStateChange.next(e)}getSheetRuleInitState(){return this._worksheetRuleInitStateChange.value}addRule(e,t){this._ensureSubUnitMap(e).set(t.subUnitId,t),this._ruleChange.next({unitId:e,rule:t,type:"add",subUnitId:t.subUnitId})}deleteRule(e,t){var s,i,a;const n=(i=(s=this._model)==null?void 0:s.get(e))==null?void 0:i.get(t);n&&((a=this._model.get(e))==null||a.delete(t),this._ruleChange.next({unitId:e,rule:n,type:"delete",subUnitId:t}))}setRule(e,t,n){var i,a;const s=this.getRule(e,t);s&&((a=(i=this._model)==null?void 0:i.get(e))==null||a.set(t,n),this._ruleChange.next({unitId:e,oldRule:s,rule:n,type:"set",subUnitId:t}))}getRule(e,t){var n,s;return(s=(n=this._model)==null?void 0:n.get(e))==null?void 0:s.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const s=this._model.get(n);s!=null&&s.size&&(e[n]=[],[...s.keys()].forEach(a=>{const u=s.get(a);u&&e[n].push(u)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const s=e[n];if(s!=null&&s.length){const i=new Map;s.forEach(a=>{i.set(a.subUnitId,a)}),t.set(n,i)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}ruleRefresh(e){this._ruleRefresh.next(e)}resetOrder(){this._resetOrder.next(Math.random())}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[s,i]of n)if(i.permissionId===t)return[e,s]}}const Pe={id:"sheet.mutation.add-worksheet-protection",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,rule:n}=e;return o.get(Ee).addRule(t,n),!0}},ke={id:"sheet.mutation.delete-worksheet-protection",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n}=e;return o.get(Ee).deleteRule(t,n),!0}},Uo={type:r.CommandType.COMMAND,id:"sheet.command.add-worksheet-protection",async handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),{rule:s,unitId:i}=e,a=s.subUnitId;if(await t.executeCommand(Pe.id,{unitId:i,rule:s,subUnitId:s.subUnitId})){const l=[{id:Pe.id,params:{unitId:i,rule:s,subUnitId:s.subUnitId}}],d=[{id:ke.id,params:{unitId:i,subUnitId:a}}];n.pushUndoRedo({unitID:i,redoMutations:l,undoMutations:d})}return!0}},jr=(o,e,t="")=>o.reduce((n,s)=>{const i=s&&s[e];return typeof i!="string"?(console.warn(s,`${e} is not string`),n):(i?(n[i]||(n[i]=[]),n[i].push(s)):n[t].push(s),n)},{}),Fr=(o=0)=>{let e=o;return function(){return e++}};function Qt(o){const e=new r.ObjectMatrix;return o.forEach(t=>{const{startRow:n,startColumn:s,endRow:i,endColumn:a}=t;for(let u=n;u<=i;u++)for(let l=s;l<=a;l++)e.setValue(u,l,null)}),e.clone()}function To(o){const e=new r.ObjectMatrix;return o.forEach(t=>{const{startRow:n,startColumn:s,endRow:i,endColumn:a}=t;for(let u=n;u<=i;u++)for(let l=s;l<=a;l++)e.setValue(u,l,{v:null,p:null,f:null,si:null,custom:null})}),e.clone()}function Hr(o){const e=new r.ObjectMatrix;return o.forEach(t=>{const{startRow:n,startColumn:s,endRow:i,endColumn:a}=t;for(let u=n;u<=i;u++)for(let l=s;l<=a;l++)e.setValue(u,l,{s:null})}),e.clone()}var X=(o=>(o[o.MOVE_START=0]="MOVE_START",o[o.MOVING=1]="MOVING",o[o.MOVE_END=2]="MOVE_END",o[o.ONLY_SET=3]="ONLY_SET",o))(X||{});class Eo extends r.Disposable{constructor(t){super();S(this,"_worksheetSelections",new Map);S(this,"_selectionMoveStart$",new W.Subject);S(this,"selectionMoveStart$",this._selectionMoveStart$.asObservable());S(this,"_selectionMoving$",new W.Subject);S(this,"selectionMoving$",this._selectionMoving$.asObservable());S(this,"_selectionMoveEnd$",new W.BehaviorSubject([]));S(this,"selectionMoveEnd$",this._selectionMoveEnd$.asObservable());S(this,"_selectionSet$",new W.BehaviorSubject([]));S(this,"selectionSet$",this._selectionSet$.asObservable());S(this,"_beforeSelectionMoveEnd$",new W.BehaviorSubject([]));S(this,"beforeSelectionMoveEnd$",this._beforeSelectionMoveEnd$.asObservable());this._workbook=t}dispose(){super.dispose(),this._beforeSelectionMoveEnd$.complete(),this._selectionMoveEnd$.complete(),this._selectionMoving$.complete(),this._selectionMoveStart$.complete(),this._selectionSet$.complete()}addSelections(t,n){const s=this.getSelectionsOfWorksheet(t);s.push(...n),this._selectionSet$.next(s)}setSelections(t,n=[],s){switch(this.setSelectionsOfWorksheet(t,n),s){case X.MOVE_START:this._selectionMoveStart$.next(n);break;case X.MOVING:this._selectionMoving$.next(n);break;case X.MOVE_END:this._beforeSelectionMoveEnd$.next(n),this._selectionMoveEnd$.next(n);break;case X.ONLY_SET:{this._selectionSet$.next(n);break}default:this._selectionSet$.next(n);break}}getCurrentSelections(){return this._getCurrentSelections()}getSelectionOfWorksheet(t){return this.getSelectionsOfWorksheet(t)}getSelectionsOfWorksheet(t){return this._worksheetSelections.has(t)||this._worksheetSelections.set(t,[]),this._worksheetSelections.get(t)}setSelectionsOfWorksheet(t,n){this._worksheetSelections.set(t,[...n])}deleteSheetSelection(t){this._worksheetSelections.set(t,[])}clear(){this._worksheetSelections.clear(),this._eventAfterSetSelections([])}_getCurrentSelections(){return this.getSelectionsOfWorksheet(this._workbook.getActiveSheet().getSheetId())}getCurrentLastSelection(){const t=this._getCurrentSelections();return t[t.length-1]}_eventAfterSetSelections(t){this._selectionSet$.next(t)}}var Gr=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,Yr=(o,e,t,n)=>{for(var s=n>1?void 0:n?qr(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Gr(e,t,s),s},zr=(o,e)=>(t,n)=>e(t,n,o);g.SheetsSelectionsService=class extends r.RxDisposable{constructor(t){super();S(this,"selectionMoveStart$");S(this,"selectionMoving$");S(this,"selectionMoveEnd$");S(this,"selectionSet$");S(this,"_workbookSelections",new Map);this._instanceSrv=t,this._init()}get _currentSelectionPos(){const t=this._instanceSrv.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const n=t.getActiveSheet();return{unitId:t.getUnitId(),sheetId:n.getSheetId()}}get currentSelectionParam(){return this._currentSelectionPos}_init(){const t=this._instanceSrv.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_SHEET).pipe(W.shareReplay(1),W.takeUntil(this.dispose$));this.selectionMoveStart$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveStart$:W.of())),this.selectionMoving$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoving$:W.of())),this.selectionMoveEnd$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveEnd$:W.of([]))),this.selectionSet$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionSet$:W.of([]))),this._instanceSrv.getTypeOfUnitDisposed$(r.UniverInstanceType.UNIVER_SHEET).pipe(W.takeUntil(this.dispose$)).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId())})}clear(){this._workbookSelections.forEach(t=>t.clear())}getCurrentSelections(){return this._getCurrentSelections()}getCurrentLastSelection(){const t=this._getCurrentSelections();return t==null?void 0:t[t.length-1]}addSelections(t,n,s){if(typeof t=="string"){this._ensureWorkbookSelection(t).addSelections(n,s);return}const i=this._currentSelectionPos;if(!i)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:a,sheetId:u}=i;this._ensureWorkbookSelection(a).addSelections(u,t)}setSelections(t,n,s,i){if(typeof t=="string"&&typeof n=="string"){const d=t;this.getWorkbookSelections(d).setSelections(n,s||[],i!=null?i:X.ONLY_SET);return}const a=this._currentSelectionPos;if(!a)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:u,sheetId:l}=a;if(typeof t=="object"){const d=t!=null?t:s,c=n!=null?n:X.ONLY_SET;this._ensureWorkbookSelection(u).setSelections(l,d,c)}}clearCurrentSelections(){this._getCurrentSelections().splice(0)}isOverlapping(){const t=this.getCurrentSelections();return t==null?!1:t.some(({range:n},s)=>t.some(({range:i},a)=>s===a?!1:n.startRow<=i.endRow&&n.endRow>=i.startRow&&n.startColumn<=i.endColumn&&n.endColumn>=i.startColumn))}_getCurrentSelections(){const t=this._currentSelectionPos;if(!t)return[];const{unitId:n,sheetId:s}=t;return this._ensureWorkbookSelection(n).getSelectionsOfWorksheet(s)}getWorkbookSelections(t){return this._ensureWorkbookSelection(t)}_ensureWorkbookSelection(t){let n=this._workbookSelections.get(t);if(!n){const s=this._instanceSrv.getUnit(t);if(!s)throw new Error(`[SheetsSelectionsService]: cannot resolve unit with id "${t}"!`);n=new Eo(s),this._workbookSelections.set(t,n)}return n}_removeWorkbookSelection(t){this._workbookSelections.delete(t)}},g.SheetsSelectionsService=Yr([zr(0,r.IUniverInstanceService)],g.SheetsSelectionsService);const Kr="DISABLE_NORMAL_SELECTIONS",xr="SELECTIONS_ENABLED",Po="REF_SELECTIONS_ENABLED",Jr=r.createInterceptorKey("CELL_CONTENT"),Xr=r.createInterceptorKey("ROW_FILTERED"),Le={CELL_CONTENT:Jr,ROW_FILTERED:Xr};var ko=(o=>(o[o.DATA_VALIDATION=9]="DATA_VALIDATION",o[o.NUMFMT=10]="NUMFMT",o[o.CELL_IMAGE=11]="CELL_IMAGE",o))(ko||{}),Zr=Object.defineProperty,Qr=Object.getOwnPropertyDescriptor,ei=(o,e,t,n)=>{for(var s=n>1?void 0:n?Qr(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Zr(e,t,s),s},ti=(o,e)=>(t,n)=>e(t,n,o);const en=r.createInterceptorKey("BEFORE_CELL_EDIT"),Mt=r.createInterceptorKey("AFTER_CELL_EDIT"),wt=r.createInterceptorKey("AFTER_CELL_EDIT_ASYNC");g.SheetInterceptorService=class extends r.Disposable{constructor(t){super();S(this,"_interceptorsByName",new Map);S(this,"_commandInterceptors",[]);S(this,"_rangeInterceptors",[]);S(this,"_beforeCommandInterceptor",[]);S(this,"_afterCommandInterceptors",[]);S(this,"_workbookDisposables",new Map);S(this,"_worksheetDisposables",new Map);S(this,"writeCellInterceptor",new r.InterceptorManager({BEFORE_CELL_EDIT:en,AFTER_CELL_EDIT:Mt,AFTER_CELL_EDIT_ASYNC:wt}));this._univerInstanceService=t,this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(r.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._interceptWorkbook(n)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(r.UniverInstanceType.UNIVER_SHEET).subscribe(n=>this._disposeWorkbookInterceptor(n))),this.intercept(Le.CELL_CONTENT,{priority:-1,effect:r.InterceptorEffectEnum.Style|r.InterceptorEffectEnum.Value,handler(n,s){const i=s.worksheet.getCellRaw(s.row,s.col);return n?{...i,...n}:i}}),this.disposeWithMe(this.writeCellInterceptor.intercept(Mt,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(en,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(wt,{priority:-1,handler:n=>n}))}dispose(){super.dispose(),this._workbookDisposables.forEach(t=>t.dispose()),this._workbookDisposables.clear(),this._worksheetDisposables.clear()}interceptCommand(t){if(this._commandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._commandInterceptors.push(t),this._commandInterceptors.sort((n,s)=>{var i,a;return((i=s.priority)!=null?i:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(r.toDisposable(()=>r.remove(this._commandInterceptors,t)))}onCommandExecute(t){const n=this._commandInterceptors.map(s=>s.getMutations(t));return{preUndos:n.map(s=>{var i;return(i=s.preUndos)!=null?i:[]}).flat(),undos:n.map(s=>s.undos).flat(),preRedos:n.map(s=>{var i;return(i=s.preRedos)!=null?i:[]}).flat(),redos:n.map(s=>s.redos).flat()}}interceptAfterCommand(t){if(this._afterCommandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._afterCommandInterceptors.push(t),this._afterCommandInterceptors.sort((n,s)=>{var i,a;return((i=s.priority)!=null?i:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(r.toDisposable(()=>r.remove(this._afterCommandInterceptors,t)))}afterCommandExecute(t){const n=this._afterCommandInterceptors.map(s=>s.getMutations(t));return{undos:n.map(s=>s.undos).flat(),redos:n.map(s=>s.redos).flat()}}interceptBeforeCommand(t){if(this._beforeCommandInterceptor.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._beforeCommandInterceptor.push(t),this._beforeCommandInterceptor.sort((n,s)=>{var i,a;return((i=s.priority)!=null?i:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(r.toDisposable(()=>r.remove(this._beforeCommandInterceptor,t)))}async beforeCommandExecute(t){return(await Promise.all(this._beforeCommandInterceptor.map(s=>s.performCheck(t)))).every(s=>s)}interceptRanges(t){if(this._rangeInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._rangeInterceptors.push(t),this._rangeInterceptors.sort((n,s)=>{var i,a;return((i=s.priority)!=null?i:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(r.toDisposable(()=>r.remove(this._rangeInterceptors,t)))}generateMutationsByRanges(t){const n=this._rangeInterceptors.map(s=>s.getMutations(t));return{preUndos:n.map(s=>{var i;return(i=s.preUndos)!=null?i:[]}).flat(),undos:n.map(s=>s.undos).flat(),preRedos:n.map(s=>{var i;return(i=s.preRedos)!=null?i:[]}).flat(),redos:n.map(s=>s.redos).flat()}}async onWriteCell(t,n,s,i,a){const u={subUnitId:n.getSheetId(),unitId:t.getUnitId(),workbook:t,worksheet:n,row:s,col:i,origin:r.Tools.deepClone(a)},l=this.writeCellInterceptor.fetchThroughInterceptors(Mt)(a,u);return await this.writeCellInterceptor.fetchThroughInterceptors(wt)(Promise.resolve(l),u)}intercept(t,n){const s=t;this._interceptorsByName.has(s)||this._interceptorsByName.set(s,[]);const i=this._interceptorsByName.get(s);i.push(n);const a=i.sort((u,l)=>{var d,c;return((d=l.priority)!=null?d:0)-((c=u.priority)!=null?c:0)});if(s===Le.CELL_CONTENT){this._interceptorsByName.set(`${s}-${r.InterceptorEffectEnum.Style|r.InterceptorEffectEnum.Value}`,a);const u=r.InterceptorEffectEnum.Style|r.InterceptorEffectEnum.Value;this._interceptorsByName.set(`${s}-${r.InterceptorEffectEnum.Style}`,a.filter(l=>((l.effect||u)&r.InterceptorEffectEnum.Style)>0)),this._interceptorsByName.set(`${s}-${r.InterceptorEffectEnum.Value}`,a.filter(l=>((l.effect||u)&r.InterceptorEffectEnum.Value)>0))}else this._interceptorsByName.set(s,a);return this.disposeWithMe(r.toDisposable(()=>r.remove(this._interceptorsByName.get(s),n)))}fetchThroughInterceptors(t,n){const s=n===void 0?t:`${t}-${n}`,i=this._interceptorsByName.get(s);return r.composeInterceptors(i||[])}_interceptWorkbook(t){const n=new r.DisposableCollection,s=t.getUnitId(),i=this,a=u=>{const l=u.getSheetId();u.__interceptViewModel(d=>{const c=new r.DisposableCollection;i._worksheetDisposables.set(No(s,u),c),c.add(d.registerCellContentInterceptor({getCell(m,h,R){const C=u.getCellRaw(m,h);return i.fetchThroughInterceptors(Le.CELL_CONTENT,R)(C,{unitId:s,subUnitId:l,row:m,col:h,worksheet:u,workbook:t,rawData:C})}})),c.add(d.registerRowFilteredInterceptor({getRowFiltered(m){return!!i.fetchThroughInterceptors(Le.ROW_FILTERED)(!1,{unitId:s,subUnitId:l,row:m,workbook:t,worksheet:u})}}))})};t.getSheets().forEach(u=>a(u)),n.add(t.sheetCreated$.subscribe(u=>a(u))),n.add(r.toDisposable(()=>t.getSheets().forEach(u=>this._disposeSheetInterceptor(s,u)))),n.add(t.sheetDisposed$.subscribe(u=>this._disposeSheetInterceptor(s,u))),this._workbookDisposables.set(s,n)}_disposeWorkbookInterceptor(t){const n=t.getUnitId(),s=this._workbookDisposables.get(n);s&&(s.dispose(),this._workbookDisposables.delete(n))}_disposeSheetInterceptor(t,n){const s=No(t,n),i=this._worksheetDisposables.get(s);i&&(i.dispose(),this._worksheetDisposables.delete(s))}},g.SheetInterceptorService=ei([ti(0,r.IUniverInstanceService)],g.SheetInterceptorService);function No(o,e){return`${o}|${e.getSheetId()}`}function ni(o,e,t){var a;const n=o.getStyleByCell(e);n==null&&delete e.s,typeof t.s=="string"&&(t.s=o.get(t.s));const s=_t(n,t.s?t.s:null);s&&r.Tools.removeNull(s),r.Tools.isEmptyObject(s)?delete e.s:e.s=o.setValue(s);const i=t.v?`${t.v}\r
|
|
11
|
-
`:"";!t.p&&e.p&&(
|
|
12
|
-
`)?o.body.dataStream.length-2:o.body.dataStream.length;if(t<i){const u={st:t,ed:i},l=_t({},e,!0);l&&r.Tools.removeNull(l),r.Tools.isEmptyObject(l)||(u.ts=l),n.push(u)}o.body.textRuns=r.normalizeTextRuns(n)}function ii(o,e,t){if(e.t)return e.t;if(e.v===null)return null;const n=o.getStyleByCell(e),s=o.getStyleByCell(t);if(t.t===r.CellValueType.FORCE_STRING){if(!tn(s)&&e.v!==void 0){if(r.isRealNum(e.v))return r.CellValueType.NUMBER;if(r.isBooleanString(`${e.v}`))return r.CellValueType.BOOLEAN}return r.CellValueType.FORCE_STRING}return ai(n)?tn(n)?r.CellValueType.STRING:Do(e,t):tn(s)?r.CellValueType.STRING:Do(e,t)}function Do(o,e){return o.v!==void 0?Ao(o.v,o.t):Ao(e.v,e.t)}function ai(o){var e;return!!((e=o==null?void 0:o.n)!=null&&e.pattern)}function tn(o){var e;return((e=o==null?void 0:o.n)==null?void 0:e.pattern)===wo.DEFAULT_TEXT_FORMAT}function Ao(o,e){return o===null?null:typeof o=="string"?r.isRealNum(o)?(+o==0||+o==1)&&e===r.CellValueType.BOOLEAN?r.CellValueType.BOOLEAN:r.CellValueType.NUMBER:r.isBooleanString(o)?r.CellValueType.BOOLEAN:r.CellValueType.STRING:typeof o=="number"?(o===0||o===1)&&e===r.CellValueType.BOOLEAN?r.CellValueType.BOOLEAN:r.CellValueType.NUMBER:typeof o=="boolean"?r.CellValueType.BOOLEAN:r.CellValueType.FORCE_STRING}function Wo(o,e){return o===r.CellValueType.NUMBER?Number(e.v):o===r.CellValueType.BOOLEAN?ui(e.v)?1:0:o===r.CellValueType.STRING||o===r.CellValueType.FORCE_STRING?`${e.v}`:e.v}function ui(o){if(typeof o=="string"){if(o.toUpperCase()==="TRUE")return!0;if(o.toUpperCase()==="FALSE")return!1;if(r.isSafeNumeric(o)){if(Number(o)===0)return!1;if(Number(o)===1)return!0}}if(typeof o=="number"){if(o===0)return!1;if(o===1)return!0}return typeof o=="boolean"?o:null}function li(o){return o==null?null:(o.f===void 0&&(o.f=null),o.si===void 0&&(o.si=null),o.p===void 0&&(o.p=null),o.v===void 0&&(o.v=null),o.t===void 0&&(o.t=null),o.s===void 0&&(o.s=null),o.custom===void 0&&(o.custom=null),o)}const ne=(o,e)=>{const{unitId:t,subUnitId:n,cellValue:s}=e,a=o.get(r.IUniverInstanceService).getUniverSheetInstance(t);if(a==null)throw new Error("workbook is null error!");const u=a.getSheetBySheetId(n);if(u==null)throw new Error("worksheet is null error!");const l=u.getCellMatrix(),d=a.getStyles(),c=new r.ObjectMatrix;return new r.ObjectMatrix(s).forValue((h,R,C)=>{const f=r.Tools.deepClone(l==null?void 0:l.getValue(h,R))||{},v=d.getStyleByCell(f),I=d.getStyleByCell(C);f.s=oi(v,I),c.setValue(h,R,li(f))}),{...e,options:{},cellValue:c.getMatrix()}},B={id:"sheet.mutation.set-range-values",type:r.CommandType.MUTATION,handler:(o,e)=>{const{cellValue:t,subUnitId:n,unitId:s}=e,a=o.get(r.IUniverInstanceService).getUnit(s);if(!a)return!1;const u=a.getSheetBySheetId(n);if(!u)return!1;const l=u.getCellMatrix(),d=a.getStyles();return new r.ObjectMatrix(t).forValue((m,h,R)=>{if(!R)l==null||l.setValue(m,h,{});else{const C=l.getValue(m,h)||{},f=ii(d,R,C);R.f!==void 0&&(C.f=R.f),R.si!==void 0&&(C.si=R.si),R.p!==void 0&&(C.p=R.p),R.v!==void 0&&(C.v=Wo(f,R)),C.v!==void 0&&(C.t=f,C.v=Wo(f,C)),R.s!==void 0&&ni(d,C,R),R.custom!==void 0&&(C.custom=R.custom),l.setValue(m,h,r.Tools.removeNull(C))}}),!0}},yt={id:"sheet.command.clear-selection-all",type:r.CommandType.COMMAND,handler:async(o,e)=>{var p;const t=o.get(r.IUniverInstanceService),n=o.get(r.ICommandService),s=o.get(g.SheetsSelectionsService),i=o.get(r.IUndoRedoService),a=o.get(g.SheetInterceptorService),u=t.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!u)return!1;const l=(e==null?void 0:e.unitId)||u.getUnitId(),d=u.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=s.getCurrentSelections())==null?void 0:p.map(w=>w.range));if(!(m!=null&&m.length))return!1;const h=[],R=[],C={subUnitId:c,unitId:l,cellValue:Qt(m)},f=ne(o,C);h.push({id:B.id,params:C}),R.push({id:B.id,params:f});const v=a.onCommandExecute({id:yt.id});return h.push(...v.redos),R.unshift(...v.undos),r.sequenceExecute(h,n)?(i.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:h}),!0):!1}},nn={id:"sheet.command.clear-selection-content",type:r.CommandType.COMMAND,handler:async(o,e)=>{var p;const t=o.get(r.IUniverInstanceService),n=o.get(r.ICommandService),s=o.get(g.SheetsSelectionsService),i=o.get(r.IUndoRedoService),a=o.get(g.SheetInterceptorService),u=t.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!u)return!1;const l=(e==null?void 0:e.unitId)||u.getUnitId(),d=u.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=s.getCurrentSelections())==null?void 0:p.map(w=>w.range));if(!(m!=null&&m.length))return!1;const h={subUnitId:c,unitId:l,cellValue:To(m)},R=ne(o,h),C=a.onCommandExecute({id:nn.id}),f=[{id:B.id,params:h},...C.redos],v=[...C.undos,{id:B.id,params:R}];return r.sequenceExecute(f,n).result?(i.pushUndoRedo({unitID:l,undoMutations:v,redoMutations:f}),!0):!1}},bt={id:"sheet.command.clear-selection-format",type:r.CommandType.COMMAND,handler:async(o,e)=>{var p;const t=o.get(r.IUniverInstanceService),n=o.get(r.ICommandService),s=o.get(g.SheetsSelectionsService),i=o.get(r.IUndoRedoService),a=o.get(g.SheetInterceptorService),u=t.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!u)return!1;const l=(e==null?void 0:e.unitId)||u.getUnitId(),d=u.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=s.getCurrentSelections())==null?void 0:p.map(w=>w.range));if(!(m!=null&&m.length))return!1;const h=[],R=[],C={subUnitId:c,unitId:l,cellValue:Hr(m)},f=ne(o,C);h.push({id:B.id,params:C}),R.push({id:B.id,params:f});const v=a.onCommandExecute({id:bt.id});return h.push(...v.redos),R.unshift(...v.undos),r.sequenceExecute(h,n)?(i.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:h}),!0):!1}},on=(o,e)=>({subUnitId:e.sheet.id,unitId:e.unitId,subUnitName:e.sheet.name}),Be={id:"sheet.mutation.insert-sheet",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService),{sheet:n,index:s,unitId:i}=e,a=t.getUniverSheetInstance(i);return a?a.addWorksheet(n.id,s,n):!1}};function Vo(o,e){const{unitId:t}=e,n=t?o.getUniverSheetInstance(t):o.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);return n?{workbook:n,unitId:n.getUnitId()}:null}function k(o,e={}){const{unitId:t,subUnitId:n}=e,s=t?o.getUniverSheetInstance(t):o.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!s)return null;const i=n?s.getSheetBySheetId(n):s.getActiveSheet(!0);return i?{worksheet:i,workbook:s,unitId:s.getUnitId(),subUnitId:i.getSheetId()}:null}function at(o,e){const{unitId:t,subUnitId:n}=e,s=o.getUniverSheetInstance(t);if(!s)return null;const i=s.getSheetBySheetId(n);return i?{worksheet:i,workbook:s}:null}const $o=(o,e)=>{const t=o.get(r.IUniverInstanceService),{subUnitId:n,unitId:s}=e,i=at(t,e);if(!i)throw new Error("[RemoveSheetUndoMutationFactory]: Worksheet is null error!");const{workbook:a,worksheet:u}=i,l=u.getConfig();return{index:a.getConfig().sheetOrder.findIndex(m=>m===n),sheet:l,unitId:s}},Ne={id:"sheet.mutation.remove-sheet",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService),{subUnitId:n,unitId:s}=e,i=t.getUniverSheetInstance(s);return i?i.removeSheet(n):!1}},sn={type:r.CommandType.COMMAND,id:"sheet.command.copy-sheet",handler:async(o,e)=>{var M,_;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetInterceptorService),a=o.get(r.LocaleService),u=k(s,e);if(!u)return!1;const{workbook:l,worksheet:d,unitId:c,subUnitId:m}=u,h=r.Tools.deepClone(d.getConfig());h.name=di(l,a,h.name),h.id=r.Tools.generateRandomId();const C={index:l.getSheetIndex(d)+1,sheet:h,unitId:c},f=on(o,C),v=i.onCommandExecute({id:sn.id,params:{unitId:c,subUnitId:m,targetSubUnitId:h.id}}),I=[...(M=v.preRedos)!=null?M:[],{id:Be.id,params:C},...v.redos],p=[...(_=v.preUndos)!=null?_:[],{id:Ne.id,params:f},...v.undos];return r.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:c,undoMutations:p,redoMutations:I}),!0):!1}};function di(o,e,t){let n=t+e.t("sheets.tabs.sheetCopy",""),s=2;for(;o.checkSheetName(n);)n=t+e.t("sheets.tabs.sheetCopy",`${s}`),s++;return n}const Me={id:"sheet.mutation.move-range",type:r.CommandType.MUTATION,handler:(o,e)=>{const{from:t,to:n}=e;if(!t||!n)return!1;const i=o.get(r.IUniverInstanceService).getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;const a=i.getSheetBySheetId(e.from.subUnitId),u=i.getSheetBySheetId(e.to.subUnitId);if(!a||!u)return!1;const l=a.getCellMatrix(),d=u.getCellMatrix();return new r.ObjectMatrix(t.value).forValue((c,m,h)=>{l.setValue(c,m,h)}),new r.ObjectMatrix(n.value).forValue((c,m,h)=>{d.setValue(c,m,h)}),!0}};var ci=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,hi=(o,e,t,n)=>{for(var s=n>1?void 0:n?mi(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ci(e,t,s),s},gi=(o,e)=>(t,n)=>e(t,n,o);const Lo=r.createIdentifier("sheets-formula.ref-selections.service");g.RefSelectionsService=class extends g.SheetsSelectionsService{constructor(e){super(e)}_init(){const e=this._getAliveWorkbooks$().pipe(W.takeUntil(this.dispose$));this.selectionMoveStart$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionMoveStart$)))),this.selectionMoving$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionMoving$)))),this.selectionMoveEnd$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionMoveEnd$)))),this.selectionSet$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionSet$))))}_getAliveWorkbooks$(){const e=this._instanceSrv.getAllUnitsForType(r.UniverInstanceType.UNIVER_SHEET);e.forEach(n=>this._ensureWorkbookSelection(n.getUnitId()));const t=new W.BehaviorSubject(e);return this.disposeWithMe(this._instanceSrv.getTypeOfUnitAdded$(r.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._ensureWorkbookSelection(n.getUnitId()),t.next([...t.getValue(),n])})),this.disposeWithMe(this._instanceSrv.getTypeOfUnitDisposed$(r.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId()),t.next(t.getValue().filter(s=>s!==n))})),t.pipe(W.map(n=>n.map(s=>this._ensureWorkbookSelection(s.getUnitId()))))}},g.RefSelectionsService=hi([gi(0,r.IUniverInstanceService)],g.RefSelectionsService);function Bo(o){const t=o.get(r.IContextService).getContextValue(Po);return o.get(t?Lo:g.SheetsSelectionsService)}const q={id:"sheet.operation.set-selections",type:r.CommandType.OPERATION,handler:(o,e)=>{if(!e)return!1;const{selections:t,type:n,unitId:s,subUnitId:i}=e;return Bo(o).setSelections(s,i,[...t],n),!0}};function ut(o,e,t=!0){const n=e.getMatrixWithMergedCells(...r.selectionToArray(o)),s=[];if(n.forValue((a,u,l)=>{if(l.colSpan!==void 0&&l.rowSpan!==void 0){const d={startRow:a,startColumn:u,endRow:a+l.rowSpan-1,endColumn:u+l.colSpan-1};r.Rectangle.contains(o,d)||s.push(d)}}),s.length===0)return o;const i=r.Rectangle.union(o,...s);return t?ut(i,e,t):i}function Ri(o,e,t){let n=null;return t.getMatrixWithMergedCells(o,e,o,e).forValue((i,a,u)=>(n={actualRow:i,actualColumn:a,startRow:i,startColumn:a,isMerged:u.rowSpan!==void 0||u.colSpan!==void 0,isMergedMainCell:u.rowSpan!==void 0&&u.colSpan!==void 0,endRow:i+(u.rowSpan!==void 0?u.rowSpan-1:0),endColumn:a+(u.colSpan!==void 0?u.colSpan-1:0),rangeType:r.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:o,startRow:o,startColumn:e,endRow:o,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:r.RANGE_TYPE.NORMAL}}function Ci(o,e,t){const{startRow:n,startColumn:s,endRow:i,endColumn:a}=o;return Number.isNaN(n)&&(o.startRow=0),Number.isNaN(i)&&(o.endRow=e-1),Number.isNaN(s)&&(o.startColumn=0),Number.isNaN(a)&&(o.endColumn=t-1),o}function Q(o,e){const t=Number.isNaN(o.startRow)?0:o.startRow,n=Number.isNaN(o.startColumn)?0:o.startColumn,s=e.getMergedCell(t,n);return s?{...s,actualRow:t,actualColumn:n,rangeType:r.RANGE_TYPE.NORMAL,isMerged:!0,isMergedMainCell:!0}:{startRow:t,startColumn:n,endRow:o.startRow,endColumn:o.startColumn,actualRow:t,actualColumn:n,rangeType:r.RANGE_TYPE.NORMAL,isMerged:!1,isMergedMainCell:!1}}const ce=(o,e,t)=>({id:q.id,params:{unitId:e.getUnitId(),subUnitId:t.getSheetId(),reveal:!0,selections:[{range:o,primary:Q(o,t)}]}});function fi(o){if(!o)return!1;const{range:e,primary:t}=o;return r.Rectangle.equals(e,t)}function Si(o){function e(t,n){function s(i){for(let a=i.startRow;a<=i.endRow;a++)if(!o.getRowFiltered(a))for(let u=i.startColumn;u<=i.endColumn;u++)n(a,u,i)}s(t)}return{forOperableEach:e}}function lt(o,e,t,n,s,i,a){const u={};for(let l=e;l<=t;l++)for(let d=n;d<=s;d++){const c=i?o.getCell(a,d):o.getCell(l,a);!c||!c.s||(u[l]||(u[l]={}),u[l][d]={s:c.s})}return u}const jo="sheet.command.move-range",je={type:r.CommandType.COMMAND,id:jo,handler:async(o,e)=>{var w,M;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(r.ErrorService),a=o.get(r.LocaleService),u=o.get(g.SheetInterceptorService),l=k(s);if(!l||!await u.beforeCommandExecute({id:je.id,params:e}))return!1;const{worksheet:c,subUnitId:m,unitId:h}=l,R=Ut(o,{unitId:h,subUnitId:m,range:e.fromRange},{unitId:h,subUnitId:m,range:e.toRange});if(R===null)return i.emit(a.t("sheets.info.acrossMergedCell")),!1;const C=u.onCommandExecute({id:je.id,params:{...e}}),f=[...(w=C.preRedos)!=null?w:[],...R.redos,...C.redos,{id:q.id,params:{unitId:h,subUnitId:m,selections:[{range:e.toRange,primary:vi(e.fromRange,e.toRange,c)}],type:X.MOVE_END}}],v=[...(M=C.preUndos)!=null?M:[],...R.undos,...C.undos,{id:q.id,params:{unitId:h,subUnitId:m,selections:[{range:e.fromRange,primary:Q(e.fromRange,c)}],type:X.MOVE_END}}],I=r.sequenceExecute(f,t).result,p=u.afterCommandExecute({id:je.id,params:{...e}});return I?(r.sequenceExecute(p.redos,t),n.pushUndoRedo({unitID:h,undoMutations:[...v,...p.undos],redoMutations:[...f,...p.redos]}),!0):!1}};function Ut(o,e,t,n=!1){const s=[],i=[],{range:a,subUnitId:u,unitId:l}=e,{range:d,subUnitId:c}=t,h=o.get(r.IUniverInstanceService).getUniverSheetInstance(l),R=h==null?void 0:h.getSheetBySheetId(c),C=h==null?void 0:h.getSheetBySheetId(u),f=R==null?void 0:R.getCellMatrix(),v=C==null?void 0:C.getCellMatrix();if(R&&C&&f&&v){const I=ut(d,R,!1);if(!r.Rectangle.equals(d,I)&&!n)return null;const p=new r.ObjectMatrix,w=new r.ObjectMatrix,M=new r.ObjectMatrix;r.Range.foreach(a,(U,P)=>{const N=v.getValue(U,P);if(p.setValue(U,P,r.Tools.deepClone(N)),N){const A=h==null?void 0:h.getStyles().get(N.s);M.setValue(U,P,r.Tools.deepClone(A))}w.setValue(U,P,null)});const _=new r.ObjectMatrix,b=new r.ObjectMatrix;r.Range.foreach(d,(U,P)=>{_.setValue(U,P,r.Tools.deepClone(f.getValue(U,P)))}),r.Range.foreach(a,(U,P)=>{const N=r.cellToRange(U,P),A=r.Rectangle.getRelativeRange(N,a),j=r.Rectangle.getPositionRange(A,d),$=r.Tools.deepClone(M.getValue(U,P)),F=r.Tools.deepClone(p.getValue(U,P));F&&$&&(F.s=$),b.setValue(j.startRow,j.startColumn,F)});const E={fromRange:e.range,toRange:t.range,from:{value:w.getMatrix(),subUnitId:u},to:{value:b.getMatrix(),subUnitId:c},unitId:l},T={fromRange:t.range,toRange:e.range,from:{value:p.getMatrix(),subUnitId:u},to:{value:_.getMatrix(),subUnitId:c},unitId:l};s.push({id:Me.id,params:E}),i.push({id:Me.id,params:T})}return{redos:s,undos:i}}function vi(o,e,t){const n=o.startRow,s=o.startColumn,i=t.getMergedCell(n,s),a=Q(e,t);if(i){const u=i.endRow-i.startRow+1,l=i.endColumn-i.startColumn+1;a.endRow=a.startRow+u-1,a.endColumn=a.startColumn+l-1,a.actualRow=a.startRow,a.actualColumn=a.startColumn,a.isMerged=!1,a.isMergedMainCell=!0}return a}var Tt=(o=>(o[o.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",o[o.UNIVER_DOC=1]="UNIVER_DOC",o[o.UNIVER_SHEET=2]="UNIVER_SHEET",o[o.UNIVER_SLIDE=3]="UNIVER_SLIDE",o[o.UNIVER_PROJECT=4]="UNIVER_PROJECT",o[o.UNRECOGNIZED=-1]="UNRECOGNIZED",o))(Tt||{}),y=(o=>(o[o.View=0]="View",o[o.Edit=1]="Edit",o[o.ManageCollaborator=2]="ManageCollaborator",o[o.Print=3]="Print",o[o.Duplicate=4]="Duplicate",o[o.Comment=5]="Comment",o[o.Copy=6]="Copy",o[o.Share=7]="Share",o[o.Export=8]="Export",o[o.MoveWorksheet=9]="MoveWorksheet",o[o.DeleteWorksheet=10]="DeleteWorksheet",o[o.HideWorksheet=11]="HideWorksheet",o[o.RenameWorksheet=12]="RenameWorksheet",o[o.CreateWorksheet=13]="CreateWorksheet",o[o.SetWorksheetStyle=14]="SetWorksheetStyle",o[o.EditWorksheetCell=15]="EditWorksheetCell",o[o.InsertHyperlink=16]="InsertHyperlink",o[o.Sort=17]="Sort",o[o.Filter=18]="Filter",o[o.PivotTable=19]="PivotTable",o[o.FloatImg=20]="FloatImg",o[o.History=21]="History",o[o.RwHgtClWdt=22]="RwHgtClWdt",o[o.ViemRwHgtClWdt=23]="ViemRwHgtClWdt",o[o.ViewFilter=24]="ViewFilter",o[o.MoveSheet=25]="MoveSheet",o[o.DeleteSheet=26]="DeleteSheet",o[o.HideSheet=27]="HideSheet",o[o.CopySheet=28]="CopySheet",o[o.RenameSheet=29]="RenameSheet",o[o.CreateSheet=30]="CreateSheet",o[o.SelectProtectedCells=31]="SelectProtectedCells",o[o.SelectUnProtectedCells=32]="SelectUnProtectedCells",o[o.SetCellStyle=33]="SetCellStyle",o[o.SetCellValue=34]="SetCellValue",o[o.SetRowStyle=35]="SetRowStyle",o[o.SetColumnStyle=36]="SetColumnStyle",o[o.InsertRow=37]="InsertRow",o[o.InsertColumn=38]="InsertColumn",o[o.DeleteRow=39]="DeleteRow",o[o.DeleteColumn=40]="DeleteColumn",o[o.EditExtraObject=41]="EditExtraObject",o[o.Delete=42]="Delete",o[o.RecoverHistory=43]="RecoverHistory",o[o.ViewHistory=44]="ViewHistory",o[o.CreatePermissionObject=45]="CreatePermissionObject",o[o.UNRECOGNIZED=-1]="UNRECOGNIZED",o))(y||{}),D=(o=>(o[o.Unkonwn=0]="Unkonwn",o[o.Workbook=1]="Workbook",o[o.Worksheet=2]="Worksheet",o[o.SelectRange=3]="SelectRange",o[o.Document=4]="Document",o[o.Slide=5]="Slide",o[o.UNRECOGNIZED=-1]="UNRECOGNIZED",o))(D||{});class dt{constructor(e,t,n){S(this,"type",D.SelectRange);S(this,"subType",y.Edit);S(this,"status",r.PermissionStatus.INIT);S(this,"value",!0);S(this,"id");S(this,"unitId");S(this,"subUnitId");S(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${y.Edit}.${n}`}}class Et{constructor(e,t,n){S(this,"type",D.SelectRange);S(this,"subType",y.View);S(this,"status",r.PermissionStatus.INIT);S(this,"value",!0);S(this,"id");S(this,"unitId");S(this,"subUnitId");S(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${y.View}.${n}`}}class rn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Comment);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Comment}_${e}`}}class an{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Copy);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Copy}_${e}`}}class Fo{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"subType",y.CopySheet);S(this,"status",r.PermissionStatus.INIT);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.CopySheet}_${e}`}}class un{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.CreatePermissionObject);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.CreatePermissionObject}_${e}`}}class ln{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.CreateSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.CreateSheet}_${e}`}}class dn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.DeleteSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.DeleteSheet}_${e}`}}class cn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Duplicate);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Duplicate}_${e}`}}class Pt{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Edit);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Edit}_${e}`}}class mn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Export);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Export}_${e}`}}class hn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.HideSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.HideSheet}_${e}`}}class Ho{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.History);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.History}_${e}`}}class gn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.ManageCollaborator);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.ManageCollaborator}_${e}`}}class Rn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.MoveSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.MoveSheet}_${e}`}}class Cn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Print);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Print}_${e}`}}class fn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.RecoverHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.RecoverHistory}_${e}`}}class Sn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.RenameSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.RenameSheet}_${e}`}}class vn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.Share);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.Share}_${e}`}}class In{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.View);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.View}_${e}`}}class pn{constructor(e){S(this,"id");S(this,"value",!0);S(this,"type",D.Workbook);S(this,"status",r.PermissionStatus.INIT);S(this,"subType",y.ViewHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${y.ViewHistory}_${e}`}}class Mn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.Copy);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.Copy}_${e}_${t}`}}class wn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.DeleteColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.DeleteColumn}_${e}_${t}`}}class _n{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.Delete);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.Delete}_${e}_${t}`}}class yn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.DeleteRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.DeleteRow}_${e}_${t}`}}class ct{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.Edit);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.Edit}_${e}_${t}`}}class bn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.EditExtraObject);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.EditExtraObject}_${e}_${t}`}}class Un{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.Filter);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.Filter}_${e}_${t}`}}class Tn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.InsertColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.InsertColumn}_${e}_${t}`}}class En{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.InsertHyperlink);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.InsertHyperlink}_${e}_${t}`}}class Pn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.InsertRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.InsertRow}_${e}_${t}`}}class kn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.ManageCollaborator);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.ManageCollaborator}_${e}_${t}`}}class Nn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.PivotTable);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.PivotTable}_${e}_${t}`}}class Go{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.SelectProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.SelectProtectedCells}_${e}_${t}`}}class qo{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.SelectUnProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.SelectUnProtectedCells}_${e}_${t}`}}class On{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.SetCellStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.SetCellStyle}_${e}_${t}`}}class Dn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.SetCellValue);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.SetCellValue}_${e}_${t}`}}class An{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.SetColumnStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.SetColumnStyle}_${e}_${t}`}}class Wn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.SetRowStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.SetRowStyle}_${e}_${t}`}}class Vn{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.Sort);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.Sort}_${e}_${t}`}}class $n{constructor(e,t){S(this,"value",!0);S(this,"type",D.Worksheet);S(this,"status",r.PermissionStatus.INIT);S(this,"id");S(this,"subType",y.View);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${y.View}_${e}_${t}`}}const mt={id:"sheet.command.set-range-values",type:r.CommandType.COMMAND,handler:(o,e)=>{var T;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),u=o.get(r.IPermissionService),l=k(s,e);if(!l)return!1;const{subUnitId:d,unitId:c,workbook:m,worksheet:h}=l,{value:R,range:C}=e,f=C?[C]:(T=i.getCurrentSelections())==null?void 0:T.map(U=>U.range);if(!f||!f.length||!u.getPermissionPoint(new ct(c,d).id))return!1;const v=new r.ObjectMatrix;let I;if(r.Tools.isArray(R))for(let U=0;U<f.length;U++){const{startRow:P,startColumn:N,endRow:A,endColumn:j}=f[U];for(let $=0;$<=A-P;$++)for(let F=0;F<=j-N;F++)v.setValue($+P,F+N,R[$][F])}else if(r.isICellData(R))for(let U=0;U<f.length;U++){const{startRow:P,startColumn:N,endRow:A,endColumn:j}=f[U];for(let $=P;$<=A;$++)for(let F=N;F<=j;F++)v.setValue($,F,R)}else I=R;const p={subUnitId:d,unitId:c,cellValue:I!=null?I:v.getMatrix()},w=ne(o,p);if(!t.syncExecuteCommand(B.id,p))return!1;const{undos:_,redos:b}=a.onCommandExecute({id:mt.id,params:{...p,range:f}});if(r.sequenceExecute([...b],t).result){const U=ce(C!=null?C:v.getRange(),m,h);return n.pushUndoRedo({unitID:c,undoMutations:[{id:B.id,params:w},..._,U],redoMutations:[{id:B.id,params:p},...b,r.Tools.deepClone(U)]}),!0}return!1}};function Ln(o,e){const t=[],n=[],{unitId:s,subUnitId:i,range:a,shiftDimension:u,cellValue:l={}}=e,d=o.get(r.IUniverInstanceService),c=o.get(g.SheetInterceptorService),m=d.getUniverSheetInstance(s),h=m==null?void 0:m.getSheetBySheetId(i);if(h){const R=h.getCellMatrix(),C=R.getDataRange();if(a.startColumn<=C.endColumn||a.startRow<=C.endRow){let w,M;if(u===r.Dimension.COLUMNS){const b=Math.min(a.endRow,C.endRow);let E=0;for(let U=a.startRow;U<=b;U++){const P=R.getRow(U),N=P?r.getArrayLength(P)-1:0;E=Math.max(E,N)}w={startRow:a.startRow,startColumn:a.startColumn,endRow:b,endColumn:E};const T=a.endColumn-a.startColumn+1;M={startRow:a.startRow,startColumn:w.startColumn+T,endRow:b,endColumn:w.endColumn+T}}else{const b=Math.min(a.endColumn,C.endColumn),E=C.endRow;w={startRow:a.startRow,startColumn:a.startColumn,endRow:E,endColumn:b};const T=a.endRow-a.startRow+1;M={startRow:w.startRow+T,startColumn:a.startColumn,endRow:w.endRow+T,endColumn:b}}const _=Ut(o,{unitId:s,subUnitId:i,range:w},{unitId:s,subUnitId:i,range:M},!0);_&&(t.push(..._.redos),n.push(..._.undos))}if(Object.entries(l).length===0)for(let w=a.startRow;w<=a.endRow;w++){l[w]||(l[w]={});for(let M=a.startColumn;M<=a.endColumn;M++)l[w][M]=null}const f={subUnitId:i,unitId:s,cellValue:l},v=ne(o,f),{undos:I,redos:p}=c.onCommandExecute({id:mt.id,params:{...f,range:a}});t.push({id:B.id,params:f},...p),n.push({id:B.id,params:v},...I)}return{redo:t,undo:n}}function Bn(o,e){const t=[],n=[],{unitId:s,subUnitId:i,range:a,shiftDimension:u}=e,l=o.get(r.IUniverInstanceService),d=o.get(g.SheetInterceptorService),c=l.getUniverSheetInstance(s),m=c==null?void 0:c.getSheetBySheetId(i);if(m){const h=m.getCellMatrix(),R=h.getDataRange(),C={subUnitId:i,unitId:s,cellValue:Qt([a])},f=ne(o,C),v=d.onCommandExecute({id:mt.id,params:C});if(t.push({id:B.id,params:C},...v.redos),n.push(...v.undos,{id:B.id,params:f}),a.startColumn<=R.endColumn||a.startRow<=R.endRow){let I=null,p=null;if(u===r.Dimension.COLUMNS&&a.endColumn<R.endColumn){const w=Math.min(a.endRow,R.endRow);let M=0;for(let b=a.startRow;b<=w;b++){const E=h.getRow(b),T=E?r.getArrayLength(E)-1:0;M=Math.max(M,T)}I={startRow:a.startRow,startColumn:a.endColumn+1,endRow:w,endColumn:M};const _=a.endColumn-a.startColumn+1;p={startRow:a.startRow,startColumn:I.startColumn-_,endRow:w,endColumn:I.endColumn-_}}if(u===r.Dimension.ROWS&&a.endRow<R.endRow){const w=Math.min(a.endColumn,R.endColumn),M=R.endRow;I={startRow:a.endRow+1,startColumn:a.startColumn,endRow:M,endColumn:w};const _=a.endRow-a.startRow+1;p={startRow:I.startRow-_,startColumn:a.startColumn,endRow:I.endRow-_,endColumn:w}}if(I&&p){const w=Ut(o,{unitId:s,subUnitId:i,range:I},{unitId:s,subUnitId:i,range:p},!0);w&&(t.push(...w.redos),n.push(...w.undos))}}}return{redo:t,undo:n}}function Ii(o,e,t,n,s,i){const{startRow:a,endRow:u,startColumn:l,endColumn:d}=e;if(s===r.Dimension.ROWS){const c=u-a+1;for(let m=t;m>=a;m--)for(let h=l;h<=d;h++){const R=o.getValue(m,h);R==null?o.realDeleteValue(m+c,h):o.setValue(m+c,h,R)}for(let m=u;m>=a;m--)for(let h=l;h<=d;h++)i&&i[m]&&i[m][h]?o.setValue(m,h,i[m][h]):o.realDeleteValue(m,h)}else if(s===r.Dimension.COLUMNS){const c=d-l+1;for(let m=a;m<=u;m++)for(let h=n;h>=l;h--){const R=o.getValue(m,h);R==null?o.realDeleteValue(m,h+c):o.setValue(m,h+c,R)}for(let m=a;m<=u;m++)for(let h=d;h>=l;h--)i&&i[m]&&i[m][h]?o.setValue(m,h,i[m][h]):o.realDeleteValue(m,h)}}function pi(o,e,t,n,s){const{startRow:i,endRow:a,startColumn:u,endColumn:l}=e,d=a-i+1,c=l-u+1;if(s===r.Dimension.ROWS)for(let m=i;m<=t;m++)for(let h=u;h<=l;h++){const R=o.getValue(m+d,h);R==null?o.realDeleteValue(m,h):o.setValue(m,h,R)}else if(s===r.Dimension.COLUMNS)for(let m=i;m<=a;m++)for(let h=u;h<=n;h++){const R=o.getValue(m,h+c);R==null?o.realDeleteValue(m,h):o.setValue(m,h,R)}}const Yo="sheet.command.delete-range-move-left",Fe={type:r.CommandType.COMMAND,id:Yo,handler:async(o,e)=>{var M,_,b;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),u=k(s);if(!u)return!1;const{worksheet:l,workbook:d,subUnitId:c,unitId:m}=u;let h=e==null?void 0:e.range;if(h||(h=(M=i.getCurrentLastSelection())==null?void 0:M.range),!h)return!1;const R={range:h,subUnitId:c,unitId:m,shiftDimension:r.Dimension.COLUMNS},C=a.onCommandExecute({id:Fe.id,params:{range:h}}),{redo:f,undo:v}=Bn(o,R),I=[...(_=C.preRedos)!=null?_:[],...f],p=[...C.undos,...v];return I.push(...C.redos),I.push(ce(h,d,l)),p.push(...(b=C.preUndos)!=null?b:[]),r.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:m,undoMutations:p.reverse(),redoMutations:I}),!0):!1}},zo="sheet.command.delete-range-move-up",He={type:r.CommandType.COMMAND,id:zo,handler:async(o,e)=>{var M,_,b;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),u=k(s);if(!u)return!1;const{unitId:l,subUnitId:d,workbook:c,worksheet:m}=u;let h=e==null?void 0:e.range;if(h||(h=(M=i.getCurrentLastSelection())==null?void 0:M.range),!h)return!1;const R={range:h,subUnitId:d,unitId:l,shiftDimension:r.Dimension.ROWS},C=a.onCommandExecute({id:He.id,params:{range:h}}),{redo:f,undo:v}=Bn(o,R),I=[...(_=C.preRedos)!=null?_:[],...f],p=[...C.undos,...v];return I.push(...C.redos),I.push(ce(h,c,m)),p.push(...(b=C.preUndos)!=null?b:[]),r.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:l,undoMutations:p.reverse(),redoMutations:I}),!0):!1}},Ko={type:r.CommandType.COMMAND,id:"sheet.command.delete-range-protection",async handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),{unitId:s,subUnitId:i,rule:a}=e,u={unitId:s,subUnitId:i,ruleIds:[a.id]};return await t.executeCommand(de.id,u)&&n.pushUndoRedo({unitID:s,redoMutations:[{id:de.id,params:u}],undoMutations:[{id:ie.id,params:{unitId:s,subUnitId:i,rules:[a]}}]}),!0}},xo={type:r.CommandType.COMMAND,id:"sheet.command.delete-worksheet-protection",handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),{rule:s,unitId:i,subUnitId:a}=e;t.executeCommand(ke.id,{unitId:i,subUnitId:a});const u=[{id:ke.id,params:{unitId:i,subUnitId:a}}],l=[{id:Pe.id,params:{unitId:i,rule:s,subUnitId:a}}];return n.pushUndoRedo({unitID:i,redoMutations:u,undoMutations:l}),!0}},Jo={id:"sheet.command.insert-defined-name",type:r.CommandType.COMMAND,handler:(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService);if(!e)return!1;const s={...e};return t.syncExecuteCommand(z.SetDefinedNameMutation.id,s)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:[{id:z.RemoveDefinedNameMutation.id,params:s}],redoMutations:[{id:z.SetDefinedNameMutation.id,params:s}]}),!0):!1}},jn=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},me={id:"sheet.mutation.insert-row",type:r.CommandType.MUTATION,handler:(o,e)=>{var C;const{unitId:t,subUnitId:n,range:s,rowInfo:i}=e,u=o.get(r.IUniverInstanceService).getUniverSheetInstance(t);if(u==null)throw new Error("universheet is null error!");const l=u.getSheetBySheetId(n);if(l==null)throw new Error("worksheet is null error!");const d=l.getRowManager().getRowData(),c={h:l.getConfig().defaultRowHeight,hd:0},m=s.startRow,h=s.endRow-s.startRow+1;for(let f=m;f<m+h;f++)i?r.insertMatrixArray(f,(C=i[f-s.startRow])!=null?C:c,d):r.insertMatrixArray(f,c,d);return l.setRowCount(l.getRowCount()+s.endRow-s.startRow+1),l.getCellMatrix().insertRows(s.startRow,h),!0}},kt=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},ae={id:"sheet.mutation.insert-col",type:r.CommandType.MUTATION,handler:(o,e)=>{var C;const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const i=s.getColumnManager(),{range:a,colInfo:u}=e,d=i.getColumnData(),c=a.startColumn,m=a.endColumn-a.startColumn+1,h=s.getConfig().defaultColumnWidth;for(let f=c;f<c+m;f++){const v={w:h,hd:0};u?r.insertMatrixArray(f,(C=u[f-a.startColumn])!=null?C:v,d):r.insertMatrixArray(f,v,d)}return s.setColumnCount(s.getColumnCount()+a.endColumn-a.startColumn+1),s.getCellMatrix().insertColumns(a.startColumn,m),!0}},Mi=(o,e)=>{const s=e.getRowManager().getRowData(),i={},a=o.range,u=r.sliceMatrixArray(a.startRow,a.endRow,s),l=r.concatMatrixArray(i,u);return{unitId:o.unitId,subUnitId:o.subUnitId,range:o.range,rowInfo:l}},he={id:"sheet.mutation.remove-rows",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const i=e.range,u=s.getRowManager().getRowData();for(let c=i.startRow;c<=i.endRow;c++)s.getRowFiltered(c);const l=i.endRow-i.startRow+1;return r.spliceArray(i.startRow,l,u),s.getCellMatrix().removeRows(i.startRow,l),s.setRowCount(s.getRowCount()-l),!0}},wi=(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(s==null)throw new Error("worksheet is null error!");const u=s.getColumnManager().getColumnData(),l={},d=e.range,c=r.sliceMatrixArray(d.startColumn,d.endColumn,u),m=r.concatMatrixArray(l,c);return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,colInfo:m}},oe={id:"sheet.mutation.remove-col",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const i=e.range,u=s.getColumnManager().getColumnData(),l=i.endColumn-i.startColumn+1;return r.spliceArray(i.startColumn,l,u),s.setColumnCount(s.getColumnCount()-l),s.getCellMatrix().removeColumns(i.startColumn,l),!0}},_i="sheet.command.insert-range-move-down",ht={type:r.CommandType.COMMAND,id:"sheet.command.insert-range-move-down",handler:async(o,e)=>{var A,j,$;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),u=o.get(r.ErrorService),l=o.get(r.LocaleService);if(i.isOverlapping())return u.emit(l.t("sheets.info.overlappingSelections")),!1;const d=k(s);if(!d)return!1;const{unitId:c,subUnitId:m,worksheet:h,workbook:R}=d;let C=e==null?void 0:e.range;if(C||(C=(A=i.getCurrentLastSelection())==null?void 0:A.range),!C)return!1;const f=[],v=[],I=h.getCellMatrix(),p=I.getDataRange(),M=I.getSlice(p.startRow,p.endRow,C.startColumn,C.endColumn).getDataRange().endRow,_=Math.max(M+(C.endRow-C.startRow+1)-p.endRow,0);if(_>0){const F=C.startRow-1,Z=h.getRowHeight(F),Y={unitId:c,subUnitId:m,range:{startRow:p.endRow+1,endRow:p.endRow+_,startColumn:p.startColumn,endColumn:p.endColumn},rowInfo:new Array(_).fill(void 0).map(()=>({h:Z,hd:r.BooleanNumber.FALSE}))};f.push({id:me.id,params:Y});const Ce=jn(o,Y);v.push({id:he.id,params:Ce})}const b={};r.Range.foreach(C,(F,Z)=>{const Y=h.getCell(F,Z);Y&&(b[F]||(b[F]={}),b[F][Z]={s:Y.s})});const E={range:C,subUnitId:m,unitId:c,shiftDimension:r.Dimension.ROWS,cellValue:b},{redo:T,undo:U}=Ln(o,E);f.push(...T),v.push(...U);const P=a.onCommandExecute({id:ht.id,params:{range:C}});return f.push(...P.redos),f.push(ce(C,R,h)),v.push(...(j=P.preUndos)!=null?j:[]),f.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),r.sequenceExecute(f,t)?(n.pushUndoRedo({unitID:c,undoMutations:v.reverse(),redoMutations:f}),!0):!1}},Fn="sheet.command.insert-range-move-right",Nt={type:r.CommandType.COMMAND,id:Fn,handler:async(o,e)=>{var A,j,$;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),u=o.get(r.ErrorService),l=o.get(r.LocaleService);if(i.isOverlapping())return u.emit(l.t("sheets.info.overlappingSelections")),!1;const d=k(s);if(!d)return!1;const{workbook:c,worksheet:m,unitId:h,subUnitId:R}=d;let C=e==null?void 0:e.range;if(C||(C=(A=i.getCurrentLastSelection())==null?void 0:A.range),!C)return!1;const f=[],v=[],I=m.getCellMatrix(),p=I.getDataRange(),M=I.getSlice(C.startRow,C.endRow,p.startColumn,p.endColumn).getDataRange().endColumn,_=Math.max(M+(C.endColumn-C.startColumn+1)-p.endColumn,0);if(_>0){const F=C.startColumn-1,Z=m.getColumnWidth(F),Y={unitId:h,subUnitId:R,range:{startRow:p.startRow+1,endRow:p.endRow,startColumn:p.endColumn+1,endColumn:p.endColumn+_},colInfo:new Array(_).fill(void 0).map(()=>({w:Z,hd:r.BooleanNumber.FALSE}))};f.push({id:ae.id,params:Y});const Ce=kt(o,Y);v.push({id:oe.id,params:Ce})}const b={};r.Range.foreach(C,(F,Z)=>{const Y=m.getCell(F,Z);!Y||!Y.s||(b[F]||(b[F]={}),b[F][Z]={s:Y.s})});const E={range:C,subUnitId:R,unitId:h,shiftDimension:r.Dimension.COLUMNS,cellValue:b},{redo:T,undo:U}=Ln(o,E);f.push(...T),v.push(...U);const P=a.onCommandExecute({id:Nt.id,params:{range:C}});return f.push(...P.redos),f.push(ce(C,c,m)),v.push(...(j=P.preUndos)!=null?j:[]),f.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),r.sequenceExecute(f,t).result?(n.pushUndoRedo({unitID:h,undoMutations:v.reverse(),redoMutations:f}),!0):!1}},Xo="sheet.command.insert-row",we={type:r.CommandType.COMMAND,id:Xo,handler:async(o,e)=>{var T,U,P,N;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetInterceptorService),a=k(s,e);if(!a)return!1;const{workbook:u,worksheet:l}=a,{range:d,direction:c,unitId:m,subUnitId:h,cellValue:R}=e,{startRow:C,endRow:f}=d;d.rangeType=r.RANGE_TYPE.ROW;const v=c===r.Direction.UP?C:C-1,I=l.getRowHeight(v),p={unitId:m,subUnitId:h,range:d,rowInfo:new Array(f-C+1).fill(void 0).map(()=>({h:I,hd:r.BooleanNumber.FALSE}))},w=jn(o,p);if(!await i.beforeCommandExecute({id:we.id,params:p}))return!1;const M=[{id:me.id,params:p}],_=[{id:he.id,params:w}];R&&M.push({id:B.id,params:{unitId:m,subUnitId:h,cellValue:R}});const b=i.onCommandExecute({id:we.id,params:e});return M.unshift(...(T=b.preRedos)!=null?T:[]),M.push(...(U=b.redos)!=null?U:[]),M.push(ce(d,u,l)),_.unshift(...(P=b.preUndos)!=null?P:[]),_.push(...(N=b.undos)!=null?N:[]),r.sequenceExecute(M,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:_,redoMutations:M}),!0):!1}},Zo={type:r.CommandType.COMMAND,id:"sheet.command.insert-row-before",handler:async o=>{var C;const t=(C=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:C.map(f=>f.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const s=o.get(r.IUniverInstanceService),i=k(s);if(!i)return!1;const{worksheet:a,subUnitId:u,unitId:l}=i,{startRow:d,endRow:c}=n,m=0,h=a.getColumnCount()-1,R={unitId:l,subUnitId:u,direction:r.Direction.UP,range:{startRow:d,endRow:c,startColumn:m,endColumn:h},cellValue:lt(a,d,c,m,h,!0,d-1)};return o.get(r.ICommandService).executeCommand(we.id,R)}},Qo={type:r.CommandType.COMMAND,id:"sheet.command.insert-row-after",handler:async o=>{var f;const t=(f=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:f.map(v=>v.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const s=o.get(r.IUniverInstanceService),i=k(s);if(!i)return!1;const{worksheet:a,unitId:u,subUnitId:l}=i,d=n.endRow-n.startRow+1,c=n.endRow+1,m=n.endRow+d,h=0,R=a.getColumnCount()-1,C={unitId:u,subUnitId:l,direction:r.Direction.DOWN,range:{startRow:c,endRow:m,startColumn:h,endColumn:R,rangeType:r.RANGE_TYPE.ROW},cellValue:lt(a,c,m,h,R,!0,n.endRow)};return o.get(r.ICommandService).executeCommand(we.id,C)}},es="sheet.command.insert-col",_e={type:r.CommandType.COMMAND,id:es,handler:async(o,e)=>{var T,U,P,N;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetInterceptorService),{range:a,direction:u,subUnitId:l,unitId:d,cellValue:c}=e,{startColumn:m,endColumn:h}=e.range;a.rangeType=r.RANGE_TYPE.COLUMN;const R=s.getUniverSheetInstance(e.unitId),C=R.getSheetBySheetId(e.subUnitId),f=u===r.Direction.LEFT?m:m-1,v=C.getColumnWidth(f),I={unitId:d,subUnitId:l,range:a,colInfo:new Array(h-m+1).fill(void 0).map(()=>({w:v,hd:r.BooleanNumber.FALSE}))},p=kt(o,I);if(!await i.beforeCommandExecute({id:_e.id,params:I}))return!1;const M=[{id:ae.id,params:I}],_=[{id:oe.id,params:p}];c&&M.push({id:B.id,params:{unitId:d,subUnitId:l,cellValue:c}});const b=i.onCommandExecute({id:_e.id,params:e});return M.unshift(...(T=b.preRedos)!=null?T:[]),M.push(...(U=b.redos)!=null?U:[]),M.push(ce(a,R,C)),_.unshift(...(P=b.preUndos)!=null?P:[]),_.push(...(N=b.undos)!=null?N:[]),r.sequenceExecute(M,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:_.filter(Boolean),redoMutations:M.filter(Boolean)}),!0):!1}},ts={type:r.CommandType.COMMAND,id:"sheet.command.insert-col-before",handler:async o=>{const t=o.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const s=o.get(r.IUniverInstanceService),i=k(s);if(!i)return!1;const{worksheet:a,unitId:u,subUnitId:l}=i,{startColumn:d,endColumn:c}=n,m=0,h=a.getRowCount()-1,R={unitId:u,subUnitId:l,direction:r.Direction.LEFT,range:{startColumn:d,endColumn:c,startRow:m,endRow:h,rangeType:r.RANGE_TYPE.COLUMN},cellValue:lt(a,m,h,d,c,!1,d-1)};return o.get(r.ICommandService).executeCommand(_e.id,R)}},ns={type:r.CommandType.COMMAND,id:"sheet.command.insert-col-after",handler:async o=>{const t=o.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const s=o.get(r.IUniverInstanceService),i=k(s);if(!i)return!1;const{worksheet:a,unitId:u,subUnitId:l}=i,d=n.endColumn-n.startColumn+1,c=n.endColumn+1,m=n.endColumn+d,h=0,R=a.getRowCount()-1,C={unitId:u,subUnitId:l,direction:r.Direction.RIGHT,range:{startColumn:c,endColumn:m,startRow:h,endRow:R},cellValue:lt(a,h,R,c,m,!1,n.endColumn)};return o.get(r.ICommandService).executeCommand(_e.id,C)}},os={id:"sheet.command.insert-sheet",type:r.CommandType.COMMAND,handler:(o,e)=>{var v;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(r.LocaleService),a=Vo(s,{unitId:e==null?void 0:e.unitId});if(!a)return!1;const{unitId:u,workbook:l}=a;let d=l.getSheets().length;const c=e==null?void 0:e.sheet,m=c==null?void 0:c.id,h=r.mergeWorksheetSnapshotWithDefault(c||{});e?(d=(v=e.index)!=null?v:d,h.id=m||r.Tools.generateRandomId(),h.name=(c==null?void 0:c.name)||l.generateNewSheetName(`${i.t("sheets.tabs.sheet")}`)):(h.id=r.Tools.generateRandomId(),h.name=l.generateNewSheetName(`${i.t("sheets.tabs.sheet")}`));const R={index:d,sheet:h,unitId:u},C=on(o,R);return t.syncExecuteCommand(Be.id,R)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:Ne.id,params:C}],redoMutations:[{id:Be.id,params:R}]}),!0):!1}};function ss(o,e){const{unitId:t,subUnitId:n,sourceRange:s,targetRange:i}=e,a=s.startRow>i.startRow,u=s.endRow-s.startRow+1;return a?{unitId:t,subUnitId:n,sourceRange:r.Rectangle.clone(i),targetRange:{...s,endRow:s.endRow+u,startRow:s.startRow+u}}:{unitId:t,subUnitId:n,targetRange:r.Rectangle.clone(s),sourceRange:{...i,endRow:i.endRow-u,startRow:i.startRow-u}}}const fe={id:"sheet.mutation.move-rows",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,sourceRange:s,targetRange:i}=e,u=o.get(r.IUniverInstanceService).getUniverSheetInstance(t);if(!u)throw new Error("[MoveRowMutation] univerSheet is null!");const l=u.getSheetBySheetId(n);if(!l)throw new Error("[MoveRowMutation] worksheet is null!");const d=s.startRow,c=s.endRow-s.startRow+1,m=i.startRow,h=l.getRowManager().getRowData();return r.moveMatrixArray(d,c,m,h),l.getCellMatrix().moveRows(d,c,m),!0}};function rs(o,e){const{unitId:t,subUnitId:n,sourceRange:s,targetRange:i}=e,a=s.startColumn>i.startColumn,u=s.endColumn-s.startColumn+1;return a?{unitId:t,subUnitId:n,sourceRange:r.Rectangle.clone(i),targetRange:{...s,endColumn:s.endColumn+u,startColumn:s.startColumn+u}}:{unitId:t,subUnitId:n,targetRange:r.Rectangle.clone(s),sourceRange:{...i,startColumn:i.startColumn-u,endColumn:i.endColumn-u}}}const Se={id:"sheet.mutation.move-columns",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,sourceRange:s,targetRange:i}=e,u=o.get(r.IUniverInstanceService).getUniverSheetInstance(t);if(!u)throw new Error("[MoveColumnMutation] univerSheet is null!");const l=u.getSheetBySheetId(n);if(!l)throw new Error("[MoveColumnMutation] worksheet is null!");const d=s.startColumn,c=s.endColumn-s.startColumn+1,m=i.startColumn,h=l.getColumnManager().getColumnData();return r.moveMatrixArray(d,c,m,h),l.getCellMatrix().moveColumns(d,c,m),!0}};function yi(o,e){return e.getMergeData().some(t=>t.startRow<o&&o<=t.endRow)}function bi(o,e){return e.getMergeData().some(t=>t.startColumn<o&&o<=t.endColumn)}const is="sheet.command.move-rows",Ot={id:is,type:r.CommandType.COMMAND,handler:async(o,e)=>{var A,j;const t=o.get(g.SheetsSelectionsService),{fromRange:{startRow:n},toRange:{startRow:s},range:i}=e,a=i?[us(i)]:t.getCurrentSelections(),u=a==null?void 0:a.filter($=>$.range.rangeType===r.RANGE_TYPE.ROW&&$.range.startRow<=n&&n<=$.range.endRow);if((u==null?void 0:u.length)!==1)return!1;const l=o.get(g.SheetInterceptorService),d=o.get(r.IUniverInstanceService),c=k(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),C=h.getSheetId(),f=o.get(r.ErrorService),v=o.get(r.LocaleService),I=u[0].range,p=u[0].primary,w=ut(I,h,!1);if(!r.Rectangle.equals(I,w))return f.emit(v.t("sheets.info.partOfCell")),!1;if(yi(s,h))return f.emit(v.t("sheets.info.acrossMergedCell")),!1;const M={...I,startRow:s,endRow:s+I.endRow-I.startRow},_={unitId:R,subUnitId:C,sourceRange:I,targetRange:M},b=ss(o,_),E=o.get(r.ICommandService),T=l.onCommandExecute({id:Ot.id,params:e}),U=[...(A=T.preRedos)!=null?A:[],{id:fe.id,params:_}],P=[...(j=T.preUndos)!=null?j:[],{id:fe.id,params:b}];if(p){const F=s-n<0,Z=I.endRow-I.startRow+1,Y=F?M:{...M,startRow:M.startRow-Z,endRow:M.endRow-Z},Ce={unitId:R,subUnitId:C,type:X.MOVE_END,selections:[{range:Y,primary:Q(Y,h),style:null}]},rt={unitId:R,subUnitId:C,type:X.MOVE_END,selections:[{range:I,primary:p,style:null}]};U.push({id:q.id,params:Ce}),P.push({id:q.id,params:rt})}return U.push(...T.redos),P.push(...T.undos),r.sequenceExecute(U,E).result?(o.get(r.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:U}),!0):!1}},as="sheet.command.move-cols",Dt={id:as,type:r.CommandType.COMMAND,handler:async(o,e)=>{var A,j;const t=o.get(g.SheetsSelectionsService),{fromRange:{startColumn:n},toRange:{startColumn:s},range:i}=e,a=i?[us(i)]:t.getCurrentSelections(),u=a==null?void 0:a.filter($=>$.range.rangeType===r.RANGE_TYPE.COLUMN&&$.range.startColumn<=n&&n<=$.range.endColumn);if((u==null?void 0:u.length)!==1)return!1;const l=o.get(g.SheetInterceptorService),d=o.get(r.IUniverInstanceService),c=k(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),C=h.getSheetId(),f=o.get(r.ErrorService),v=o.get(r.LocaleService),I=u[0].range,p=u[0].primary,w=ut(I,h,!1);if(!r.Rectangle.equals(I,w))return f.emit(v.t("sheets.info.partOfCell")),!1;if(bi(s,h))return f.emit(v.t("sheets.info.acrossMergedCell")),!1;const M={...I,startColumn:s,endColumn:s+I.endColumn-I.startColumn},_={unitId:R,subUnitId:C,sourceRange:I,targetRange:M},b=rs(o,_),E=o.get(r.ICommandService),T=l.onCommandExecute({id:Dt.id,params:e}),U=[...(A=T.preRedos)!=null?A:[],{id:Se.id,params:_}],P=[...(j=T.preUndos)!=null?j:[],{id:Se.id,params:b}];if(p){const $=I.endColumn-I.startColumn+1,Y=s-n<0?M:{...M,startColumn:M.startColumn-$,endColumn:M.endColumn-$},Ce={unitId:R,subUnitId:C,type:X.MOVE_END,selections:[{range:Y,primary:Q(Y,h),style:null}]},rt={unitId:R,subUnitId:C,type:X.MOVE_END,selections:[{range:I,primary:p,style:null}]};U.push({id:q.id,params:Ce}),P.push({id:q.id,params:rt})}return U.push(...T.redos),P.push(...T.undos),r.sequenceExecute(U,E).result&&o.get(r.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:U}),!0}};function us(o){return{range:o,primary:null,style:null}}const Hn={id:"sheet.command.remove-defined-name",type:r.CommandType.COMMAND,handler:(o,e)=>{var c,m;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(g.SheetInterceptorService);if(!e)return!1;const i={...e},a=s.onCommandExecute({id:Hn.id,params:e}),u=[...(c=a.preRedos)!=null?c:[],{id:z.RemoveDefinedNameMutation.id,params:i},...a.redos],l=[...(m=a.preUndos)!=null?m:[],{id:z.SetDefinedNameMutation.id,params:i},...a.undos];return r.sequenceExecute(u,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:l.filter(Boolean),redoMutations:u.filter(Boolean)}),!0):!1}},ls="sheet.command.remove-row",Ge={type:r.CommandType.COMMAND,id:ls,handler:async(o,e)=>{var w,M,_,b;const t=o.get(g.SheetsSelectionsService),n=o.get(g.SheetInterceptorService);let s=e==null?void 0:e.range;if(s||(s=(w=t.getCurrentLastSelection())==null?void 0:w.range),!s)return!1;const i=o.get(r.IUniverInstanceService),a=k(i);if(!a)return!1;const{workbook:u,worksheet:l,subUnitId:d,unitId:c}=a;s={...s,startColumn:0,endColumn:Math.max(l.getMaxColumns()-1,0)};const m=[];for(let E=s.startRow;E<=s.endRow;E++)l.getRowFiltered(E)&&m.push(E);const h=[];if(m.length){const E=[s.startRow,...m.map(U=>U+1)],T=[...m.map(U=>U-1),s.endRow];for(let U=E.length-1;U>=0;U--)E[U]<=T[U]&&h.push({startRow:E[U],endRow:T[U],startColumn:s.startColumn,endColumn:s.endColumn})}else h.push(s);if(!await n.beforeCommandExecute({id:Ge.id,params:{range:s,ranges:h}}))return!1;const C=[],f=[];h.forEach(E=>{const T={unitId:c,subUnitId:d,range:E},U=l.getCellMatrix().getSlice(E.startRow,E.endRow,0,l.getColumnCount()-1),P={unitId:c,subUnitId:d,cellValue:U.getMatrix()},N=Mi(T,l);C.push({id:he.id,params:T}),f.unshift({id:me.id,params:N},{id:B.id,params:P})});const v=n.onCommandExecute({id:Ge.id,params:{range:s,ranges:h}}),I=o.get(r.ICommandService);return r.sequenceExecute([...(M=v.preRedos)!=null?M:[],...C,...v.redos,ce(s,u,l)],I).result?(o.get(r.IUndoRedoService).pushUndoRedo({unitID:c,undoMutations:[...(_=v.preUndos)!=null?_:[],...f,...v.undos],redoMutations:[...(b=v.preRedos)!=null?b:[],...C,...v.redos]}),!0):!1}},ds="sheet.command.remove-col",qe={type:r.CommandType.COMMAND,id:ds,handler:async(o,e)=>{var w,M,_,b;const t=o.get(g.SheetsSelectionsService),n=o.get(g.SheetInterceptorService);let s=e==null?void 0:e.range;if(s||(s=(w=t.getCurrentLastSelection())==null?void 0:w.range),!s)return!1;const i=o.get(r.IUniverInstanceService),a=k(i);if(!a)return!1;const{workbook:u,worksheet:l,subUnitId:d,unitId:c}=a;s={...s,startRow:0,endRow:Math.max(l.getMaxRows()-1,0)};const m={unitId:c,subUnitId:d,range:s},h=wi(o,m),R=l.getCellMatrix().getSlice(0,l.getRowCount()-1,s.startColumn,s.endColumn),C={unitId:c,subUnitId:d,cellValue:R.getMatrix()};if(!await n.beforeCommandExecute({id:qe.id,params:{range:s}}))return!1;const v=n.onCommandExecute({id:qe.id,params:{range:s}}),I=o.get(r.ICommandService);return r.sequenceExecute([...(M=v.preRedos)!=null?M:[],{id:oe.id,params:m},...v.redos,ce(s,u,l)],I).result?(o.get(r.IUndoRedoService).pushUndoRedo({unitID:c,undoMutations:[...(_=v.preUndos)!=null?_:[],{id:ae.id,params:h},{id:B.id,params:C},...v.undos],redoMutations:[...(b=v.preRedos)!=null?b:[],{id:oe.id,params:m},...v.redos]}),!0):!1}},At={id:"sheet.command.remove-sheet",type:r.CommandType.COMMAND,handler:async(o,e)=>{var I,p;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetInterceptorService),a=k(s,e);if(!a)return!1;const{unitId:u,subUnitId:l,workbook:d,worksheet:c}=a;if(d.getSheets().length<=1)return!1;const m={subUnitId:l,unitId:u,subUnitName:c.getName()},h=$o(o,m),R=i.onCommandExecute({id:At.id,params:{unitId:u,subUnitId:l}}),C=[...(I=R.preRedos)!=null?I:[],{id:Ne.id,params:m},...R.redos],f=[...(p=R.preUndos)!=null?p:[],{id:Be.id,params:h},...R.undos];return r.sequenceExecute(C,t).result?(n.pushUndoRedo({unitID:u,undoMutations:f,redoMutations:C}),!0):!1}},se=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:r.Tools.deepClone(e.ranges)}},H={id:"sheet.mutation.add-worksheet-merge",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const a=s.getConfig().mergeData,u=e.ranges;for(let l=0;l<u.length;l++)a.push(u[l]);return s.getSpanModel().rebuild(a),!0}},ee=(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(s==null)throw new Error("worksheet is null error!");const a=s.getConfig().mergeData,u=e.ranges,l=[];for(let d=0;d<u.length;d++)for(let c=a.length-1;c>=0;c--){const m=a[c],h=u[d];r.Rectangle.intersects(m,h)&&l.push(a[c])}return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:l}},G={id:"sheet.mutation.remove-worksheet-merge",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const a=s.getConfig().mergeData,u=e.ranges;for(let l=0;l<u.length;l++)for(let d=a.length-1;d>=0;d--){const c=a[d],m=u[l];r.Rectangle.intersects(c,m)&&a.splice(d,1)}return s.getSpanModel().rebuild(a),!0}},cs={type:r.CommandType.COMMAND,id:"sheet.command.remove-worksheet-merge",handler:async(o,e)=>{var N;const t=o.get(g.SheetsSelectionsService),n=o.get(r.ICommandService),s=o.get(r.IUndoRedoService),i=o.get(r.IUniverInstanceService),a=(e==null?void 0:e.ranges)||((N=t.getCurrentSelections())==null?void 0:N.map(A=>A.range));if(!(a!=null&&a.length))return!1;const u=k(i);if(!u)return!1;const{subUnitId:l,unitId:d,worksheet:c}=u,m={unitId:d,subUnitId:l,ranges:a},R=c.getConfig().mergeData.filter(A=>a.some(j=>r.Rectangle.intersects(j,A)));if(!R.length)return!1;const C=ee(o,m),f=t.getCurrentSelections();if(!(f!=null&&f.length))return!1;const v=r.Tools.deepClone(f),I=r.Tools.deepClone(f),p=I[I.length-1],{startRow:w,startColumn:M}=p.range;p.primary={startRow:w,startColumn:M,endRow:w,endColumn:M,actualRow:w,actualColumn:M,isMerged:!1,isMergedMainCell:!1};const _=Ui(c,R),b={unitId:d,subUnitId:l,cellValue:_.redoParams.getMatrix()},E={unitId:d,subUnitId:l,cellValue:_.undoParams.getMatrix()},T=[{id:G.id,params:C},{id:B.id,params:b},{id:q.id,params:{selections:I}}],U=[{id:H.id,params:C},{id:B.id,params:E},{id:q.id,params:{selections:v}}];return r.sequenceExecute(T,n)?(s.pushUndoRedo({unitID:d,undoMutations:U,redoMutations:T}),!0):!1}};function Ui(o,e){const t=new r.ObjectMatrix,n=new r.ObjectMatrix;return e.forEach(s=>{const{startRow:i,startColumn:a,endColumn:u,endRow:l}=s,d=o.getCellMatrix().getValue(i,a);if(d!=null&&d.s)for(let c=i;c<=l;c++)for(let m=a;m<=u;m++)(c!==i||m!==a)&&(t.setValue(c,m,{s:d.s}),n.setValue(c,m,null))}),{redoParams:t,undoParams:n}}const ms=o=>{const{order:e}=o,t={};return Object.keys(e).forEach(n=>{t[e[Number(n)]]=Number(n)}),{...o,order:t}},gt={id:"sheet.mutation.reorder-range",type:r.CommandType.MUTATION,handler:(o,e)=>{const{subUnitId:t,unitId:n,range:s,order:i}=e,l=o.get(r.IUniverInstanceService).getUnit(n).getSheetBySheetId(t);if(!l)return!1;const d=new r.ObjectMatrix;r.Range.foreach(s,(m,h)=>{if(i.hasOwnProperty(m)){const R=i[m],C=r.Tools.deepClone(l.getCellRaw(R,h));d.setValue(m,h,C)}});const c=l.getCellMatrix();return d.forValue((m,h,R)=>{c.setValue(m,h,R)}),!0}},hs="sheet.command.reorder-range",Wt={id:hs,type:r.CommandType.COMMAND,handler:(o,e)=>{var f,v;const{subUnitId:t,unitId:n,range:s,order:i}=e,a=o.get(r.ICommandService),u={id:gt.id,params:{unitId:n,subUnitId:t,order:i,range:s}},l={id:gt.id,params:ms(u.params)},d=o.get(g.SheetInterceptorService),c=d.onCommandExecute({id:Wt.id,params:e}),m=[...(f=c.preRedos)!=null?f:[],u,...c.redos],h=[...(v=c.preUndos)!=null?v:[],l,...c.undos],R=r.sequenceExecute(m,a),C=d.afterCommandExecute({id:Wt.id,params:e});return R.result?(r.sequenceExecute(C.redos,a),o.get(r.IUndoRedoService).pushUndoRedo({unitID:n,undoMutations:[...h,...C.undos],redoMutations:[...m,...C.redos]}),!0):!1}};class Oe{constructor(){S(this,"_borderInfo",{type:r.BorderType.ALL,color:"#000000",style:r.BorderStyleTypes.THIN,activeBorderType:!1});S(this,"_borderInfo$",new W.BehaviorSubject(this._borderInfo));S(this,"borderInfo$",this._borderInfo$.asObservable())}dispose(){this._borderInfo$.complete()}setType(e){this._borderInfo.type=e,this.setActiveBorderType(!0),this._refresh()}setColor(e){this._borderInfo.color=e,this._refresh()}setStyle(e){this._borderInfo.style=e,this._refresh()}setActiveBorderType(e){this._borderInfo.activeBorderType=e}getBorderInfo(){return this._borderInfo}_refresh(){this._borderInfo$.next(this._borderInfo)}}function Vt(o,e){const{startRow:t,startColumn:n,endRow:s,endColumn:i}=o;for(let a=t;a<=s;a++)for(let u=n;u<=i;u++)e(a,u)}const Gn=(o,e,t,n)=>{const{mr:s,worksheet:i}=o;e.startRow<0||e.startColumn<0||Vt(e,(a,u)=>{var c,m;const l=i.getMergedCell(a,u);let d=t;if(l&&(t.bc_tr||t.ml_tr||t.bl_tr||t.tl_mr||t.tl_bc||t.tl_br)){if(n){const h=r.Tools.deepClone((c=s.getValue(l.startRow,l.startColumn))==null?void 0:c.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}s.setValue(l.startRow,l.startColumn,{s:{bd:d}})}else{if(n){const h=r.Tools.deepClone((m=s.getValue(a,u))==null?void 0:m.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}s.setValue(a,u,{s:{bd:d}})}})},Ti=o=>{const e={startRow:o.startRow-1,startColumn:o.startColumn,endRow:o.startRow-1,endColumn:o.endColumn},t={startRow:o.startRow,startColumn:o.startColumn-1,endRow:o.endRow,endColumn:o.startColumn-1},n={startRow:o.endRow+1,startColumn:o.startColumn,endRow:o.endRow+1,endColumn:o.endColumn},s={startRow:o.startRow,startColumn:o.endColumn+1,endRow:o.endRow,endColumn:o.endColumn+1},i={startRow:o.startRow,startColumn:o.startColumn,endRow:o.startRow,endColumn:o.endColumn},a={startRow:o.startRow,startColumn:o.startColumn,endRow:o.endRow,endColumn:o.startColumn},u={startRow:o.endRow,startColumn:o.startColumn,endRow:o.endRow,endColumn:o.endColumn},l={startRow:o.startRow,startColumn:o.endColumn,endRow:o.endRow,endColumn:o.endColumn};return{topRangeOut:e,leftRangeOut:t,bottomRangeOut:n,rightRangeOut:s,topRange:i,leftRange:a,bottomRange:u,rightRange:l}};function Ei(o,e,t){const{style:n,color:s,type:i}=o.getBorderInfo(),a=i===r.BorderType.TOP||i===r.BorderType.ALL||i===r.BorderType.OUTSIDE,u=i===r.BorderType.LEFT||i===r.BorderType.ALL||i===r.BorderType.OUTSIDE,l=i===r.BorderType.BOTTOM||i===r.BorderType.ALL||i===r.BorderType.OUTSIDE,d=i===r.BorderType.RIGHT||i===r.BorderType.ALL||i===r.BorderType.OUTSIDE,c=i===r.BorderType.VERTICAL||i===r.BorderType.ALL||i===r.BorderType.INSIDE,m=i===r.BorderType.HORIZONTAL||i===r.BorderType.ALL||i===r.BorderType.INSIDE,h=i.indexOf("tlbr")>-1,R=i.indexOf("tlbc")>-1,C=i.indexOf("tlmr")>-1,f=i.indexOf("bltr")>-1,v=i.indexOf("mltr")>-1,I=i.indexOf("bctr")>-1,p=t[0],{topRangeOut:w,leftRangeOut:M,bottomRangeOut:_,rightRangeOut:b,topRange:E,leftRange:T,bottomRange:U,rightRange:P}=Ti(p),N=new r.ObjectMatrix,{worksheet:A,unitId:j,subUnitId:$}=e;return{worksheet:A,unitId:j,subUnitId:$,style:n,color:s,type:i,top:a,left:u,right:d,bottom:l,vertical:c,horizontal:m,tl_br:h,tl_bc:R,tl_mr:C,bl_tr:f,ml_tr:v,bc_tr:I,topRangeOut:w,leftRangeOut:M,bottomRangeOut:_,rightRangeOut:b,topRange:E,leftRange:T,bottomRange:U,rightRange:P,range:p,mr:N,borderStyle:{s:n,cl:{rgb:s}}}}const Pi=o=>{const{range:e,mr:t,borderStyle:n,vertical:s,horizontal:i,worksheet:a}=o;s&&Vt(e,(u,l)=>{var c,m,h;const d=a.getMergedCell(u,l);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startColumn!==e.startColumn&&t.setValue(u,l,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:r.Tools.deepClone(n)}):{l:r.Tools.deepClone(n)}}})}else{if(l!==e.endColumn){const R=(m=t.getValue(u,l))==null?void 0:m.s;t.setValue(u,l,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{r:r.Tools.deepClone(n)}):{r:r.Tools.deepClone(n)}}})}if(l!==e.startColumn){const R=(h=t.getValue(u,l))==null?void 0:h.s;t.setValue(u,l,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:r.Tools.deepClone(n)}):{l:r.Tools.deepClone(n)}}})}}}),i&&Vt(e,(u,l)=>{var c,m,h;const d=a.getMergedCell(u,l);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startRow!==e.startRow&&t.setValue(u,l,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:r.Tools.deepClone(n)}):{t:r.Tools.deepClone(n)}}})}else{if(u!==e.endRow){const R=(m=t.getValue(u,l))==null?void 0:m.s;t.setValue(u,l,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{b:r.Tools.deepClone(n)}):{b:r.Tools.deepClone(n)}}})}if(u!==e.startRow){const R=(h=t.getValue(u,l))==null?void 0:h.s;t.setValue(u,l,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:r.Tools.deepClone(n)}):{t:r.Tools.deepClone(n)}}})}}})};function ki(o){const{borderStyle:e,tl_br:t,tl_bc:n,tl_mr:s,bl_tr:i,ml_tr:a,bc_tr:u}=o,l=(d,c,m)=>{Gn(o,d,c,m)};t&&l(o.range,{tl_br:r.Tools.deepClone(e)},!0),n&&l(o.range,{tl_bc:r.Tools.deepClone(e)},!0),s&&l(o.range,{tl_mr:r.Tools.deepClone(e)},!0),i&&l(o.range,{bl_tr:r.Tools.deepClone(e)},!0),a&&l(o.range,{ml_tr:r.Tools.deepClone(e)},!0),u&&l(o.range,{bc_tr:r.Tools.deepClone(e)},!0)}const Ni=o=>{const{top:e,left:t,right:n,bottom:s,borderStyle:i,bottomRange:a,topRange:u,leftRange:l,rightRange:d,bottomRangeOut:c,topRangeOut:m,leftRangeOut:h,rightRangeOut:R}=o,C=(f,v,I)=>{Gn(o,f,v,I)};e&&(C(m,{b:null}),C(u,{t:r.Tools.deepClone(i)},!0)),s&&(C(c,{t:null}),C(a,{b:r.Tools.deepClone(i)},!0)),t&&(C(h,{r:null}),C(l,{l:r.Tools.deepClone(i)},!0)),n&&(C(R,{l:null}),C(d,{r:r.Tools.deepClone(i)},!0))},Oi=o=>{const{range:e,worksheet:t,mr:n,top:s,bottom:i,left:a,right:u,vertical:l,horizontal:d,tl_br:c,tl_bc:m,tl_mr:h,bl_tr:R,ml_tr:C,bc_tr:f,topRange:v,bottomRange:I,leftRange:p,rightRange:w,topRangeOut:M,bottomRangeOut:_,leftRangeOut:b,rightRangeOut:E}=o,T=(U,P,N)=>{Gn(o,U,P,N)};!s&&!i&&!a&&!u&&!l&&!d&&!c&&!m&&!h&&!R&&!C&&!f&&(Vt(e,(U,P)=>{var A,j,$,F,Z,Y,Ce,rt;const N=t.getMergedCell(U,P);if(N){if(N.endColumn!==e.endColumn){const L=(A=n.getValue(N.startRow,N.startColumn))==null?void 0:A.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{r:null}):{r:null}}})}if(N.startColumn!==e.startColumn){const L=(j=n.getValue(N.startRow,N.startColumn))==null?void 0:j.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{l:null}):{l:null}}})}if(N.endRow!==e.endRow){const L=($=n.getValue(N.startRow,N.startColumn))==null?void 0:$.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{b:null}):{b:null}}})}if(N.startRow!==e.startRow){const L=(F=n.getValue(N.startRow,N.startColumn))==null?void 0:F.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{t:null}):{t:null}}})}}else{if(P!==e.endColumn){const L=(Z=n.getValue(U,P))==null?void 0:Z.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{r:null}):{r:null}}})}if(P!==e.startColumn){const L=(Y=n.getValue(U,P))==null?void 0:Y.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{l:null}):{l:null}}})}if(U!==e.endRow){const L=(Ce=n.getValue(U,P))==null?void 0:Ce.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{b:null}):{b:null}}})}if(U!==e.startRow){const L=(rt=n.getValue(U,P))==null?void 0:rt.s;n.setValue(U,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{t:null}):{t:null}}})}}}),T(M,{b:null}),T(v,{t:null},!0),T(_,{t:null}),T(I,{b:null},!0),T(b,{r:null}),T(p,{l:null},!0),T(E,{l:null}),T(w,{r:null},!0),T(e,{tl_br:null},!0),T(e,{tl_bc:null},!0),T(e,{tl_mr:null},!0),T(e,{bl_tr:null},!0),T(e,{ml_tr:null},!0),T(e,{bc_tr:null},!0))},Ye={id:"sheet.command.set-border",type:r.CommandType.COMMAND,handler:async(o,e)=>{var I;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=o.get(g.SheetsSelectionsService),a=o.get(Oe),u=k(s,e);if(!u)return!1;const l=(I=i.getCurrentSelections())==null?void 0:I.map(p=>p.range);if(!(l!=null&&l.length))return!1;const{activeBorderType:d}=a.getBorderInfo();if(!d)return!1;const c=Ei(a,u,l);Pi(c),Ni(c),ki(c),Oi(c);const{unitId:m,subUnitId:h,mr:R}=c,C={unitId:m,subUnitId:h,cellValue:R.getData()},f=ne(o,C);return t.syncExecuteCommand(B.id,C)?(n.pushUndoRedo({unitID:m,undoMutations:[{id:B.id,params:f}],redoMutations:[{id:B.id,params:C}]}),!0):!1}},gs={id:"sheet.command.set-border-position",type:r.CommandType.COMMAND,handler:async(o,e)=>{if(!e.value)return!1;const t=o.get(r.ICommandService);return o.get(Oe).setType(e.value),t.executeCommand(Ye.id)}},Rs={id:"sheet.command.set-border-style",type:r.CommandType.COMMAND,handler:async(o,e)=>{const t=o.get(r.ICommandService);return o.get(Oe).setStyle(e.value),t.executeCommand(Ye.id)}},Cs={id:"sheet.command.set-border-color",type:r.CommandType.COMMAND,handler:async(o,e)=>{const t=o.get(r.ICommandService);return o.get(Oe).setColor(e.value),t.executeCommand(Ye.id)}},fs={id:"sheet.command.set-border-basic",type:r.CommandType.COMMAND,handler:async(o,e)=>{const{unitId:t,subUnitId:n,value:s}=e,{type:i,color:a,style:u}=s,l=o.get(r.ICommandService),d=o.get(Oe);return d.setType(i),a&&d.setColor(a),d.setStyle(u),l.executeCommand(Ye.id,{unitId:t,subUnitId:n})}};function Di(o,e){if(o==null)return o;const t=r.Tools.deepClone(o);if(e==null)return t;const n={};return"h"in e&&(n.h=t.h),"ia"in e&&(n.ia=t.ia),"ah"in e&&(n.ah=t.ah),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}function Ai(o,e){if(o==null)return o;const t=r.Tools.deepClone(o);if(e==null)return t;const n={};return"w"in e&&(n.w=t.w),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}const Ss=(o,e)=>{const{unitId:t,subUnitId:n,columnData:s}=o,i={},a=e.getColumnManager();for(const u in s){const l=s[u],d=a.getColumn(Number(u));i[u]=Ai(d,l)}return{unitId:t,subUnitId:n,columnData:i}},ze={id:"sheet.mutation.set-col-data",type:r.CommandType.MUTATION,handler:(o,e)=>{const{columnData:t}=e,n=o.get(r.IUniverInstanceService),s=k(n,e);if(!s)return!1;const{worksheet:i}=s,a=i.getColumnManager();for(const u in t){const l=t[u];if(l==null){a.removeColumn(Number(u));continue}const d=a.getColumnOrCreate(Number(u));Object.assign(d,l)}return!0}},vs={type:r.CommandType.COMMAND,id:"sheet.command.set-col-data",handler:(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=k(s,e);if(!i)return!1;const{columnData:a}=e,{unitId:u,subUnitId:l,worksheet:d}=i,c={subUnitId:l,unitId:u,columnData:a},m=Ss(c,d);return t.syncExecuteCommand(ze.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:ze.id,params:m}],redoMutations:[{id:ze.id,params:c}]}),!0):!1}},Wi=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},Ke={id:"sheet.mutation.set-col-hidden",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const s=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let i=0;i<e.ranges.length;i++){const a=e.ranges[i];for(let u=a.startColumn;u<a.endColumn+1;u++){const l=s.getColumnOrCreate(u);l!=null&&(l.hd=r.BooleanNumber.TRUE)}}return!0}},Vi=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},xe={id:"sheet.mutation.set-col-visible",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const s=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let i=0;i<e.ranges.length;i++){const a=e.ranges[i];for(let u=a.startColumn;u<a.endColumn+1;u++){const l=s.getColumnOrCreate(u);l!=null&&(l.hd=r.BooleanNumber.FALSE)}}return!0}},$t={type:r.CommandType.COMMAND,id:"sheet.command.set-col-visible-on-cols",handler:async(o,e)=>{var I,p;const{unitId:t,subUnitId:n,ranges:s}=e,i=o.get(g.SheetInterceptorService),a=o.get(r.ICommandService),u=o.get(r.IUniverInstanceService),l=k(u,{unitId:t,subUnitId:n});if(!l)return!1;const{worksheet:d}=l,c={unitId:t,subUnitId:n,ranges:s},m={unitId:t,subUnitId:n,reveal:!0,selections:s.map(w=>({range:w,primary:Q(w,d),style:null}))},h=Vi(o,c),R={unitId:t,subUnitId:n,selections:ps(s).map(w=>({range:w,primary:Q(w,d),style:null}))},C=r.sequenceExecute([{id:xe.id,params:c},{id:q.id,params:m}],a),f=i.onCommandExecute({id:$t.id,params:e}),v=r.sequenceExecute([...f.redos],a);return C.result&&v.result&&o.get(r.IUndoRedoService).pushUndoRedo({unitID:t,undoMutations:[{id:Ke.id,params:h},{id:q.id,params:R},...(I=f.undos)!=null?I:[]],redoMutations:[...(p=f.preRedos)!=null?p:[],{id:xe.id,params:c},{id:q.id,params:m},...f.redos]}),!0}},Is={type:r.CommandType.COMMAND,id:"sheet.command.set-selected-cols-visible",handler:async o=>{var d;const e=o.get(g.SheetsSelectionsService),t=o.get(r.ICommandService),n=(d=e.getCurrentSelections())==null?void 0:d.map(c=>c.range).filter(c=>c.rangeType===r.RANGE_TYPE.COLUMN);if(!(n!=null&&n.length))return!1;const s=k(o.get(r.IUniverInstanceService));if(!s)return!1;const{worksheet:i,unitId:a,subUnitId:u}=s,l=n.map(c=>i.getHiddenCols(c.startColumn,c.endColumn)).flat();return t.executeCommand($t.id,{unitId:a,subUnitId:u,ranges:l})}},qn={type:r.CommandType.COMMAND,id:"sheet.command.set-col-hidden",handler:async(o,e)=>{var p,w,M,_;const t=o.get(g.SheetsSelectionsService),n=o.get(g.SheetInterceptorService),s=o.get(r.IUniverInstanceService),i=o.get(r.ICommandService);let a=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(b=>b.range).filter(b=>b.rangeType===r.RANGE_TYPE.COLUMN);if(!(a!=null&&a.length))return!1;const u=k(s,e);if(!u)return!1;const{worksheet:l,unitId:d,subUnitId:c}=u;a=$i(u.worksheet,a);const m={unitId:d,subUnitId:c,ranges:a},h={unitId:d,subUnitId:c,selections:ps(a).map(b=>({range:b,primary:Q(b,l),style:null}))},R=Wi(o,m),C={unitId:d,subUnitId:c,reveal:!0,selections:a.map(b=>({range:b,primary:Q(b,l),style:null}))},f=r.sequenceExecute([{id:Ke.id,params:m},{id:q.id,params:h}],i),v=n.onCommandExecute({id:qn.id,params:m}),I=r.sequenceExecute([...v.redos],i);return f.result&&I.result?(o.get(r.IUndoRedoService).pushUndoRedo({unitID:d,undoMutations:[{id:xe.id,params:R},{id:q.id,params:C},...(M=v.undos)!=null?M:[]],redoMutations:[...(_=v.preRedos)!=null?_:[],{id:Ke.id,params:m},{id:q.id,params:h},...v.redos]}),!0):!1}};function $i(o,e){const t=o.getRowCount()-1,n=o.getHiddenCols(),s=[];return e.forEach(i=>{const a=n.filter(u=>u.startColumn>=i.startColumn&&u.endColumn<=i.endColumn);if(a.length){let u=i.startColumn;a.forEach(l=>{l.startColumn>u&&(s.push({startColumn:u,endColumn:l.startColumn-1,startRow:0,endRow:t}),u=l.endColumn+1)}),u<=i.endColumn&&s.push({startColumn:u,endColumn:i.endColumn,startRow:0,endRow:t})}else s.push(i)}),s}function ps(o){return Li(o).map(t=>{const n=t.startColumn===0?t.endColumn+1:t.startColumn-1;return{...t,startColumn:n,endColumn:n}})}function Li(o){const e=[];let t;return o.sort((n,s)=>n.startColumn-s.startColumn).forEach(n=>{if(!t){t=n;return}t.endColumn===n.startColumn-1?t.endColumn=n.endColumn:(e.push(t),t=n)}),e.push(t),e}const Yn={id:"sheet.command.set-defined-name",type:r.CommandType.COMMAND,handler:(o,e)=>{var m,h;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(g.SheetInterceptorService);if(!e)return!1;const i={...e},a=z.SetDefinedNameMutationFactory(o,e),u=s.onCommandExecute({id:Yn.id,params:e}),l=[...(m=u.preRedos)!=null?m:[],{id:z.RemoveDefinedNameMutation.id,params:a},{id:z.SetDefinedNameMutation.id,params:i},...u.redos],d=[...(h=u.preUndos)!=null?h:[],{id:z.RemoveDefinedNameMutation.id,params:i},{id:z.SetDefinedNameMutation.id,params:a},...u.undos];return r.sequenceExecute(l,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:d.filter(Boolean),redoMutations:l.filter(Boolean)}),!0):!1}},zn=(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(s==null)throw new Error("worksheet is null error!");const a=s.getConfig().freeze;return{unitId:e.unitId,subUnitId:e.subUnitId,...a}},ye={id:"sheet.mutation.set-frozen",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const i=s.getConfig(),{startRow:a,startColumn:u,ySplit:l,xSplit:d}=e;return i.freeze={startRow:a,startColumn:u,ySplit:l,xSplit:d},!0}},Ms={type:r.CommandType.COMMAND,id:"sheet.command.set-frozen",handler:(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=k(s,{unitId:e.unitId,subUnitId:e.subUnitId});if(!i)return!1;const{unitId:a,subUnitId:u,worksheet:l}=i,{startColumn:d,startRow:c,xSplit:m,ySplit:h}=e;if(c>=l.getRowCount()||d>=l.getColumnCount()||m>=l.getColumnCount()||h>=l.getRowCount())return!1;const R={unitId:a,subUnitId:u,...e},C=zn(o,R);return t.syncExecuteCommand(ye.id,R)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:ye.id,params:C}],redoMutations:[{id:ye.id,params:R}]}),!0):!1}},ws={type:r.CommandType.COMMAND,id:"sheet.command.cancel-frozen",handler:(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUniverInstanceService),s=o.get(r.IUndoRedoService),i=k(n,{unitId:e==null?void 0:e.unitId,subUnitId:e==null?void 0:e.subUnitId});if(!i)return!1;const{unitId:a,subUnitId:u}=i,l={unitId:a,subUnitId:u,startRow:-1,startColumn:-1,xSplit:0,ySplit:0},d=zn(o,l);return t.syncExecuteCommand(ye.id,l)&&s.pushUndoRedo({unitID:a,undoMutations:[{id:ye.id,params:d}],redoMutations:[{id:ye.id,params:l}]}),!0}},Je={id:"sheet.mutation.set-gridlines-color",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=k(o.get(r.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,s=n.getConfig();return s.gridlinesColor=e.color,!0}},_s={type:r.CommandType.COMMAND,id:"sheet.command.set-gridlines-color",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=k(s);if(!i)return!1;const{worksheet:a}=i,u=a.getConfig().gridlinesColor;if(u===(e==null?void 0:e.color))return!1;const{unitId:l,subUnitId:d}=i,c={color:e==null?void 0:e.color,unitId:l,subUnitId:d},m={color:u,unitId:l,subUnitId:d};return t.syncExecuteCommand(Je.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:Je.id,params:m}],redoMutations:[{id:Je.id,params:c}]}),!0):!1}},K={id:"sheet.mutation.set-range-protection",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,rule:s,ruleId:i}=e;return o.get(J).setRule(t,n,i,s),!0}},Bi=(o,e)=>{const{unitId:t,subUnitId:n,ruleId:s}=e,a=o.get(J).getRule(t,n,s);return a?{id:K.id,params:{...e,rule:a}}:null},De={id:"sheet.mutation.set-worksheet-protection",type:r.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,rule:s}=e;return o.get(Ee).setRule(t,n,s),!0}},ys={type:r.CommandType.COMMAND,id:"sheet.command.set-protection",async handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(J),{rule:i,oldRule:a}=e,{unitId:u,subUnitId:l}=i,d=[],c=[];return(a==null?void 0:a.unitType)===i.unitType?i.unitType===D.Worksheet?(d.push({id:De.id,params:{unitId:u,subUnitId:l,rule:i}}),c.push({id:De.id,params:{unitId:u,subUnitId:l,rule:a}})):(d.push({id:K.id,params:{unitId:u,subUnitId:l,rule:i,ruleId:i.id}}),c.push({id:K.id,params:{unitId:u,subUnitId:l,ruleId:a.id,rule:a}})):(a&&(a.unitType===D.Worksheet?(d.push({id:ke.id,params:{unitId:u,subUnitId:l}}),c.push({id:Pe.id,params:{unitId:u,rule:a,subUnitId:a.subUnitId}})):a.unitType===D.SelectRange&&(d.push({id:de.id,params:{unitId:u,subUnitId:l,ruleIds:[a.id]}}),c.push({id:ie.id,params:{unitId:u,subUnitId:l,rules:[a]}}))),i.unitType===D.Worksheet?(d.push({id:Pe.id,params:{unitId:u,rule:i,subUnitId:i.subUnitId}}),c.unshift({id:ke.id,params:{unitId:u,subUnitId:l}})):i.unitType===D.SelectRange&&(i.id=s.createRuleId(u,l),d.push({id:ie.id,params:{unitId:u,subUnitId:l,rules:[i]}}),c.unshift({id:de.id,params:{unitId:u,subUnitId:l,ruleIds:[i.id]}}))),r.sequenceExecute(d,t)&&n.pushUndoRedo({unitID:u,undoMutations:c,redoMutations:d}),!0}},bs=(o,e)=>{const{unitId:t,subUnitId:n,rowData:s}=o,i={},a=e.getRowManager();for(const u in s){const l=s[u],d=a.getRow(Number(u));i[u]=Di(d,l)}return{unitId:t,subUnitId:n,rowData:i}},Xe={id:"sheet.mutation.set-row-data",type:r.CommandType.MUTATION,handler:(o,e)=>{const{rowData:t}=e,n=o.get(r.IUniverInstanceService),s=k(n,e);if(!s)return!1;const{worksheet:i}=s,a=i.getRowManager();for(const u in t){const l=t[u];if(l==null){a.removeRow(Number(u));continue}const d=a.getRowOrCreate(Number(u));Object.assign(d,l)}return!0}},Us={type:r.CommandType.COMMAND,id:"sheet.command.set-row-data",handler:(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=k(s,e);if(!i)return!1;const{rowData:a}=e,{unitId:u,subUnitId:l,worksheet:d}=i,c={subUnitId:l,unitId:u,rowData:a},m=bs(c,d);return t.syncExecuteCommand(Xe.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:Xe.id,params:m}],redoMutations:[{id:Xe.id,params:c}]}),!0):!1}},ji=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},Ze={id:"sheet.mutation.set-row-visible",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let i=0;i<e.ranges.length;i++){const a=e.ranges[i];for(let u=a.startRow;u<a.endRow+1;u++){const l=s.getRowOrCreate(u);l!=null&&(l.hd=0)}}return!0}},Fi=(o,e)=>{if(o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},Qe={id:"sheet.mutation.set-row-hidden",type:r.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let i=0;i<e.ranges.length;i++){const a=e.ranges[i];for(let u=a.startRow;u<a.endRow+1;u++){const l=s.getRowOrCreate(u);l!=null&&(l.hd=1)}}return!0}},Lt={type:r.CommandType.COMMAND,id:"sheet.command.set-specific-rows-visible",handler:async(o,e)=>{var I,p,w;const{unitId:t,subUnitId:n,ranges:s}=e,i=o.get(r.ICommandService),a=o.get(r.IUndoRedoService),u=o.get(g.SheetInterceptorService),l=k(o.get(r.IUniverInstanceService),{unitId:t,subUnitId:n});if(!l)return!1;const{worksheet:d}=l,c={unitId:t,subUnitId:n,ranges:s},m={unitId:t,subUnitId:n,reveal:!0,selections:s.map(M=>({range:M,primary:Q(M,d),style:null}))},h=ji(o,c),R={unitId:t,subUnitId:n,selections:Es(s).map(M=>({range:M,primary:Q(M,d),style:null}))},C=r.sequenceExecute([{id:Ze.id,params:c},{id:q.id,params:m}],i),f=u.onCommandExecute({id:Lt.id,params:e}),v=r.sequenceExecute([...f.redos],i);return C.result&&v.result&&a.pushUndoRedo({unitID:t,undoMutations:[...(I=f.preUndos)!=null?I:[],{id:Qe.id,params:h},{id:q.id,params:R},...(p=f.undos)!=null?p:[]],redoMutations:[...(w=f.preRedos)!=null?w:[],{id:Ze.id,params:c},{id:q.id,params:m},...f.redos]}),!0}},Ts={type:r.CommandType.COMMAND,id:"sheet.command.set-selected-rows-visible",handler:async o=>{var c;const e=o.get(g.SheetsSelectionsService),t=o.get(r.IUniverInstanceService),n=o.get(r.ICommandService),s=(c=e.getCurrentSelections())==null?void 0:c.map(m=>m.range).filter(m=>m.rangeType===r.RANGE_TYPE.ROW);if(!(s!=null&&s.length))return!1;const i=k(t);if(!i)return!1;const{worksheet:a,unitId:u,subUnitId:l}=i,d=s.map(m=>a.getHiddenRows(m.startRow,m.endRow)).flat();return n.executeCommand(Lt.id,{unitId:u,subUnitId:l,ranges:d})}},Kn={type:r.CommandType.COMMAND,id:"sheet.command.set-rows-hidden",handler:async(o,e)=>{var p,w,M,_,b,E;const t=o.get(g.SheetsSelectionsService),n=o.get(r.ICommandService),s=o.get(r.IUndoRedoService),i=o.get(r.IUniverInstanceService),a=o.get(g.SheetInterceptorService);let u=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(T=>T.range).filter(T=>T.rangeType===r.RANGE_TYPE.ROW);if(!(u!=null&&u.length))return!1;const l=k(i,e);if(!l)return!1;u=Hi(l.worksheet,u);const{unitId:d,subUnitId:c,worksheet:m}=l,h={unitId:d,subUnitId:c,ranges:u},R={unitId:d,subUnitId:c,selections:Es(u).map(T=>({range:T,primary:Q(T,m),style:null}))},C=Fi(o,h),f={unitId:d,subUnitId:c,reveal:!0,selections:u.map(T=>({range:T,primary:Q(T,m),style:null}))},v=a.onCommandExecute({id:Kn.id,params:h});return r.sequenceExecute([...(M=v.preRedos)!=null?M:[],{id:Qe.id,params:h},{id:q.id,params:R},...v.redos],n).result&&s.pushUndoRedo({unitID:d,undoMutations:[...(_=v.preUndos)!=null?_:[],{id:Ze.id,params:C},{id:q.id,params:f},...(b=v.undos)!=null?b:[]],redoMutations:[...(E=v.preRedos)!=null?E:[],{id:Qe.id,params:h},{id:q.id,params:R},...v.redos]}),!0}};function Hi(o,e){const t=o.getMaxColumns()-1,n=o.getHiddenRows(),s=[];return e.forEach(i=>{const a=n.filter(u=>u.startRow>=i.startRow&&u.endRow<=i.endRow);if(a.length){let u=i.startRow;a.forEach(l=>{l.startRow>u&&(s.push({startRow:u,endRow:l.startRow-1,startColumn:0,endColumn:t}),u=l.endRow+1)}),u<=i.endRow&&s.push({startRow:u,endRow:i.endRow,startColumn:0,endColumn:t})}else s.push(i)}),s}function Es(o){return Gi(o).map(t=>{const n=t.startRow===0?t.endRow+1:t.startRow-1;return{...t,startRow:n,endRow:n}})}function Gi(o){const e=[];let t;return o.sort((n,s)=>n.startRow-s.startRow).forEach(n=>{if(!t){t=n;return}n.startRow===t.endRow+1?t.endRow=n.endRow:(e.push(t),t=n)}),e.push(t),e}const x={type:r.CommandType.COMMAND,id:"sheet.command.set-style",handler:async(o,e)=>{var _;const t=o.get(r.IUniverInstanceService),n=k(t,e);if(!n)return!1;const{unitId:s,subUnitId:i,worksheet:a}=n,{range:u,style:l}=e,d=o.get(r.ICommandService),c=o.get(r.IUndoRedoService),m=o.get(g.SheetsSelectionsService),h=u?[u]:(_=m.getCurrentSelections())==null?void 0:_.map(b=>b.range);if(!(h!=null&&h.length))return!1;const R=new r.ObjectMatrix,C=Si(a);if(r.Tools.isArray(l.value))for(let b=0;b<h.length;b++)C.forOperableEach(h[b],(E,T,U)=>{R.setValue(E,T,{s:{[l.type]:l.value[E-U.startRow][T-U.startColumn]}})});else for(let b=0;b<h.length;b++){const E={s:{[l.type]:l.value}};C.forOperableEach(h[b],(T,U)=>R.setValue(T,U,E))}const f={subUnitId:i,unitId:s,cellValue:R.getMatrix()},v=ne(o,f),I=d.syncExecuteCommand(B.id,f),{undos:p,redos:w}=o.get(g.SheetInterceptorService).onCommandExecute({id:x.id,params:e}),M=r.sequenceExecute([...w],d);return I&&M.result?(c.pushUndoRedo({unitID:f.unitId,undoMutations:[{id:B.id,params:v},...p],redoMutations:[{id:B.id,params:f},...w]}),!0):!1}},qi={type:r.CommandType.COMMAND,id:"sheet.command.set-bold",handler:async o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=k(o.get(r.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t,{actualRow:s,actualColumn:i}=e.primary,u={style:{type:"bl",value:n.getRange(s,i).getFontWeight()===r.FontWeight.BOLD?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE}};return o.get(r.ICommandService).executeCommand(x.id,u)}},Yi={type:r.CommandType.COMMAND,id:"sheet.command.set-italic",handler:async o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=k(o.get(r.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;if(e.primary){const{startRow:a,startColumn:u}=e.primary;s=n.getRange(a,u).getFontStyle()===r.FontItalic.ITALIC}const i={style:{type:"it",value:s?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE}};return o.get(r.ICommandService).executeCommand(x.id,i)}},zi={type:r.CommandType.COMMAND,id:"sheet.command.set-underline",handler:async o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=k(o.get(r.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;e.primary&&(s=!!n.getRange(e.primary.startRow,e.primary.startColumn).getUnderline().s);const i={style:{type:"ul",value:{s:s?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE}}};return o.get(r.ICommandService).executeCommand(x.id,i)}},Ki={type:r.CommandType.COMMAND,id:"sheet.command.set-stroke",handler:async o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=k(o.get(r.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;e.primary&&(s=!!n.getRange(e.primary.actualRow,e.primary.actualColumn).getStrikeThrough().s);const i={style:{type:"st",value:{s:s?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE}}};return o.get(r.ICommandService).executeCommand(x.id,i)}},xi={type:r.CommandType.COMMAND,id:"sheet.command.set-overline",handler:async o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=k(o.get(r.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;e.primary&&(s=!!n.getRange(e.primary.startRow,e.primary.startColumn).getOverline().s);const i={style:{type:"ol",value:{s:s?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE}}};return o.get(r.ICommandService).executeCommand(x.id,i)}},Ji={type:r.CommandType.COMMAND,id:"sheet.command.set-font-family",handler:async(o,e)=>{if(!e)return!1;const t=o.get(r.ICommandService),n={style:{type:"ff",value:e.value}};return t.executeCommand(x.id,n)}},Xi={type:r.CommandType.COMMAND,id:"sheet.command.set-font-size",handler:async(o,e)=>{if(!e)return!1;const t=o.get(r.ICommandService),n={style:{type:"fs",value:e.value}};return t.executeCommand(x.id,n)}},Ps={type:r.CommandType.COMMAND,id:"sheet.command.set-text-color",handler:async(o,e)=>{if(!e)return!1;const t=o.get(r.ICommandService),n={style:{type:"cl",value:{rgb:e.value}}};return t.executeCommand(x.id,n)}},ks={type:r.CommandType.COMMAND,id:"sheet.command.reset-text-color",handler:async o=>{const e=o.get(r.ICommandService),t={style:{type:"cl",value:{rgb:null}}};return e.executeCommand(x.id,t)}},Ns={type:r.CommandType.COMMAND,id:"sheet.command.set-background-color",handler:async(o,e)=>{if(!e||!e.value)return!1;const t=o.get(r.ICommandService),n={style:{type:"bg",value:{rgb:e.value}}};return t.executeCommand(x.id,n)}},Os={type:r.CommandType.COMMAND,id:"sheet.command.reset-background-color",handler:async o=>{const e=o.get(r.ICommandService),t={style:{type:"bg",value:{rgb:null}}};return e.executeCommand(x.id,t)}},Ds={type:r.CommandType.COMMAND,id:"sheet.command.set-vertical-text-align",handler:async(o,e)=>{if(!e)return!1;const t=o.get(r.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"vt",value:e.value}};return t.executeCommand(x.id,n)}},As={type:r.CommandType.COMMAND,id:"sheet.command.set-horizontal-text-align",handler:async(o,e)=>{if(!e)return!1;const t=o.get(r.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"ht",value:e.value}};return t.executeCommand(x.id,n)}},Ws={type:r.CommandType.COMMAND,id:"sheet.command.set-text-wrap",handler:async(o,e)=>{if(!e)return!1;const t=o.get(r.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"tb",value:e.value}};return t.executeCommand(x.id,n)}},Vs={type:r.CommandType.COMMAND,id:"sheet.command.set-text-rotation",handler:async(o,e)=>{if(!e)return!1;const t=typeof e.value=="number"?{a:e.value}:{a:0,v:r.BooleanNumber.TRUE},n=o.get(r.ICommandService),s={style:{type:"tr",value:t}};return n.executeCommand(x.id,s)}},Zi=(o,e)=>{const i=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().tabColor;return{...r.Tools.deepClone(e),color:i}},Rt={id:"sheet.mutation.set-tab-color",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().tabColor=e.color,!0):!1}},$s={type:r.CommandType.COMMAND,id:"sheet.command.set-tab-color",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=k(o.get(r.IUniverInstanceService));if(!s)return!1;const{unitId:i,subUnitId:a}=s,u={color:e.value,unitId:i,subUnitId:a},l=Zi(o,u);return t.syncExecuteCommand(Rt.id,u)?(n.pushUndoRedo({unitID:i,undoMutations:[{id:Rt.id,params:l}],redoMutations:[{id:Rt.id,params:u}]}),!0):!1}},xn={id:"sheet.mutation.set-workbook-name",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUnit(e.unitId,r.UniverInstanceType.UNIVER_SHEET);return t?(t.setName(e.name),!0):!1}},Jn={type:r.CommandType.COMMAND,id:"sheet.command.set-workbook-name",handler:async(o,e)=>{var d;if(!o.get(r.IUniverInstanceService).getUnit(e.unitId,r.UniverInstanceType.UNIVER_SHEET))return!1;const i=o.get(g.SheetInterceptorService).onCommandExecute({id:Jn.id,params:e}),a={name:e.name,unitId:e.unitId},u=[...(d=i.preRedos)!=null?d:[],{id:xn.id,params:a},...i.redos],l=o.get(r.ICommandService);return r.sequenceExecute(u,l).result}},et={id:"sheet.operation.set-worksheet-active",type:r.CommandType.OPERATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getWorksheets();for(const[,s]of n)if(s.getSheetId()===e.subUnitId)return t.setActiveSheet(s),!0;return!1}},Qi=4,Xn={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-activate",handler:(o,e,t)=>{const n=o.get(r.ICommandService),s=k(o.get(r.IUniverInstanceService),e);if(!s)return!1;const{unitId:i,subUnitId:a}=s;return new Promise(u=>{setTimeout(()=>{const l=n.syncExecuteCommand(et.id,{unitId:i,subUnitId:a},t);u(l)},Qi)})}},Zn=(o,e)=>{const{unitId:t,subUnitId:n,ranges:s}=o,i={},a=e.getColumnManager();for(let u=0;u<s.length;u++){const l=s[u];for(let d=l.startColumn;d<l.endColumn+1;d++){const c=a.getColumnOrCreate(d);i[d]=c.w}}return{unitId:t,subUnitId:n,ranges:s,colWidth:i}},ve={id:"sheet.mutation.set-worksheet-col-width",type:r.CommandType.MUTATION,handler:(o,e)=>{var l;const t=o.get(r.IUniverInstanceService),n=k(t,e);if(!n)return!1;const{worksheet:s}=n,i=s.getConfig().defaultColumnWidth,a=s.getColumnManager(),u=e.ranges;for(let d=0;d<u.length;d++){const c=u[d];for(let m=c.startColumn;m<c.endColumn+1;m++){if(!s.getColVisible(m))continue;const R=a.getColumnOrCreate(m);typeof e.colWidth=="number"?R.w=e.colWidth:R.w=(l=e.colWidth[m])!=null?l:i}}return!0}},Qn={type:r.CommandType.COMMAND,id:"sheet.command.delta-column-width",handler:async(o,e)=>{const n=o.get(g.SheetsSelectionsService).getCurrentSelections();if(!(n!=null&&n.length))return!1;const s=o.get(r.ICommandService),i=o.get(r.IUndoRedoService),a=k(o.get(r.IUniverInstanceService));if(!a)return!1;const{worksheet:u,unitId:l,subUnitId:d}=a,{anchorCol:c,deltaX:m}=e,R=u.getColumnWidth(c)+m,C=n.length===1&&n[0].range.rangeType===r.RANGE_TYPE.ALL,f=n.filter(E=>E.range.rangeType===r.RANGE_TYPE.COLUMN),v=C?r.RANGE_TYPE.ALL:f.some(({range:E})=>{const{startColumn:T,endColumn:U}=E;return T<=c&&c<=U})?r.RANGE_TYPE.COLUMN:r.RANGE_TYPE.NORMAL;let I;if(v===r.RANGE_TYPE.ALL){const E=u.getRowCount(),T=new Array(u.getColumnCount()).fill(void 0).map((U,P)=>({startRow:0,endRow:E-1,startColumn:P,endColumn:P}));I={subUnitId:d,unitId:l,colWidth:R,ranges:T}}else v===r.RANGE_TYPE.COLUMN?I={subUnitId:d,unitId:l,ranges:f.map(E=>r.Rectangle.clone(E.range)),colWidth:R}:I={subUnitId:d,unitId:l,colWidth:R,ranges:[{startRow:0,endRow:u.getMaxRows()-1,startColumn:c,endColumn:c}]};const{undos:p,redos:w}=o.get(g.SheetInterceptorService).onCommandExecute({id:Qn.id,params:I}),M=Zn(I,u),_=s.syncExecuteCommand(ve.id,I),b=r.sequenceExecute([...w],s);return _&&b.result&&i.pushUndoRedo({unitID:l,undoMutations:[{id:ve.id,params:M},...p],redoMutations:[{id:ve.id,params:I},...w]}),!0}},Bt={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-col-width",handler:async(o,e)=>{var p,w,M,_;const t=o.get(g.SheetsSelectionsService),n=o.get(r.ICommandService),s=o.get(r.IUndoRedoService),i=o.get(g.SheetInterceptorService),a=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(b=>b.range);if(!(a!=null&&a.length))return!1;const u=k(o.get(r.IUniverInstanceService),e);if(!u)return!1;const{subUnitId:l,unitId:d,worksheet:c}=u,m={subUnitId:l,unitId:d,ranges:a,colWidth:e.value},h=Zn(m,c),R=n.syncExecuteCommand(ve.id,m),{undos:C,redos:f}=o.get(g.SheetInterceptorService).onCommandExecute({id:Bt.id,params:m}),v=i.onCommandExecute({id:Bt.id,params:m}),I=r.sequenceExecute([...f,...v.redos],n);return R&&I.result?(s.pushUndoRedo({unitID:d,undoMutations:[...(M=v.preUndos)!=null?M:[],{id:ve.id,params:h},...C],redoMutations:[...(_=v.preRedos)!=null?_:[],{id:ve.id,params:m},...f]}),!0):!1}},ea={type:r.CommandType.COMMAND,id:"sheet.command.set-col-is-auto-width",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(g.SheetsSelectionsService),i=o.get(r.IUniverInstanceService),a=k(i,e);if(!a)return!1;const{unitId:u,subUnitId:l}=a;let d=[];if(e!=null&&e.ranges)d=[...e.ranges];else{const C=s.getCurrentSelections();for(let f=0;f<C.length;f++)d.push(C[f].range)}if(!(d!=null&&d.length))return!1;const c={unitId:u,subUnitId:l,ranges:d},{undos:m,redos:h}=o.get(g.SheetInterceptorService).onCommandExecute({id:ea.id,params:c});return r.sequenceExecute([...h],t).result?(n.pushUndoRedo({unitID:u,undoMutations:[...m],redoMutations:[...h]}),!0):!1}},tt={id:"sheet.mutation.set-worksheet-default-style",type:r.CommandType.MUTATION,handler:(o,e)=>{const{defaultStyle:t}=e,n=o.get(r.IUniverInstanceService),s=k(n);if(!s)return!1;const{worksheet:i}=s;return i?(i.setDefaultCellStyle(t),!0):!1}},Ls=(o,e)=>{const t=at(o.get(r.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetDefaultStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),defaultStyle:n.getDefaultCellStyle()}},Bs={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-default-style",handler:(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),{unitId:s}=e,i=Ls(o,e);return t.syncExecuteCommand(tt.id,e)?(n.pushUndoRedo({unitID:s,undoMutations:[{id:tt.id,params:i}],redoMutations:[{id:tt.id,params:e}]}),!0):!1}},js=(o,e)=>{const t=at(o.get(r.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetHideMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{hidden:n.isSheetHidden(),unitId:e.unitId,subUnitId:n.getSheetId()}},be={id:"sheet.mutation.set-worksheet-hidden",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().hidden=e.hidden,!0):!1}},Fs={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-hidden",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.ErrorService),i=o.get(r.LocaleService),a=k(o.get(r.IUniverInstanceService),e);if(!a)return!1;const{workbook:u,worksheet:l,unitId:d,subUnitId:c}=a;if(l.getConfig().hidden===r.BooleanNumber.TRUE)return!1;const h={unitId:d,subUnitId:c,hidden:r.BooleanNumber.TRUE},R=js(o,h);return u.getSheets().filter(I=>I.getConfig().hidden===r.BooleanNumber.FALSE).length===1?(s.emit(i.t("sheets.info.hideSheet")),!1):t.syncExecuteCommand(be.id,h)?(n.pushUndoRedo({unitID:d,undoMutations:[{id:be.id,params:R}],redoMutations:[{id:be.id,params:h}]}),!0):!1}},ta=(o,e)=>{const t=at(o.get(r.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetNameMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,name:n.getName(),subUnitId:n.getSheetId()}},jt={id:"sheet.mutation.set-worksheet-name",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().name=e.name,!0):!1}},eo={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-name",handler:async(o,e)=>{var C,f;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(g.SheetInterceptorService),i=k(o.get(r.IUniverInstanceService),e);if(!i)return!1;const{unitId:a,subUnitId:u}=i,l={subUnitId:u,name:e.name,unitId:a},d=ta(o,l),c=s.onCommandExecute({id:eo.id,params:e}),m=[...(C=c.preRedos)!=null?C:[],{id:jt.id,params:l},...c.redos],h=[...(f=c.preUndos)!=null?f:[],{id:jt.id,params:d},...c.undos];return await r.sequenceExecute(m,t).result?(n.pushUndoRedo({unitID:a,undoMutations:h,redoMutations:m}),!0):!1}},na=(o,e)=>({...r.Tools.deepClone(e),toOrder:e.fromOrder,fromOrder:e.toOrder}),Ct={id:"sheet.mutation.set-worksheet-order",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getConfig();return n.sheetOrder.splice(e.fromOrder,1),n.sheetOrder.splice(e.toOrder,0,e.subUnitId),!0}},Hs={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-order",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=k(o.get(r.IUniverInstanceService),e);if(!s)return!1;const{workbook:i,unitId:a,subUnitId:u}=s,d={fromOrder:i.getConfig().sheetOrder.indexOf(u),toOrder:e.order,unitId:a,subUnitId:u},c=na(o,d);return t.syncExecuteCommand(Ct.id,d)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:Ct.id,params:c}],redoMutations:[{id:Ct.id,params:d}]}),!0):!1}};class ft{constructor(){S(this,"_model",new Map);S(this,"_pointChange",new W.Subject);S(this,"pointChange$",this._pointChange.asObservable())}addRule(e){this._ensureSubUnitMap(e.unitId).set(e.subUnitId,e),this._pointChange.next(e)}deleteRule(e,t){var s,i,a;const n=(s=this._model.get(e))==null?void 0:s.get(t);n&&((a=(i=this._model)==null?void 0:i.get(e))==null||a.delete(t),this._pointChange.next(n))}getRule(e,t){var n,s;return(s=(n=this._model)==null?void 0:n.get(e))==null?void 0:s.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const s=this._model.get(n);s!=null&&s.size&&(e[n]=[],[...s.keys()].forEach(a=>{const u=s.get(a);u&&e[n].push(u)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const s=e[n];if(s!=null&&s.length){const i=new Map;s.forEach(a=>{i.set(a.subUnitId,a)}),t.set(n,i)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[s,i]of n)if(i.permissionId===t)return[e,s]}}class to{constructor(e,t,n){S(this,"type",D.SelectRange);S(this,"subType",y.Delete);S(this,"status",r.PermissionStatus.INIT);S(this,"value",!0);S(this,"id");S(this,"unitId");S(this,"subUnitId");S(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${y.Delete}.${n}`}}class no{constructor(e,t,n){S(this,"type",D.SelectRange);S(this,"subType",y.ManageCollaborator);S(this,"status",r.PermissionStatus.INIT);S(this,"value",!0);S(this,"id");S(this,"unitId");S(this,"subUnitId");S(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${y.ManageCollaborator}.${n}`}}const ge=()=>[Et,dt,no,to],Gs=[y.Edit,y.View,y.ManageCollaborator,y.Delete],oa=(o="unitId",e="subUnitId",t="permissionId")=>ge().reduce((n,s)=>{const i=new s(o,e,t);return n[i.subType]=i.value,n},{}),Ft=()=>[Pt,Cn,rn,In,an,mn,gn,ln,dn,Sn,hn,cn,vn,Rn,Fo,pn,fn,un],sa=[y.Edit,y.Print,y.Comment,y.View,y.Copy,y.Export,y.ManageCollaborator,y.CreateSheet,y.DeleteSheet,y.RenameSheet,y.HideSheet,y.Duplicate,y.Share,y.MoveSheet,y.CopySheet,y.RecoverHistory,y.ViewHistory,y.CreatePermissionObject],Ie=()=>[ct,$n,kn,_n],nt=()=>[Mn,wn,yn,bn,Un,Tn,Pn,En,Nn,On,Dn,An,Wn,Vn],ra=[y.Copy,y.DeleteColumn,y.DeleteRow,y.EditExtraObject,y.Filter,y.InsertColumn,y.InsertRow,y.InsertHyperlink,y.PivotTable,y.SetCellStyle,y.SetCellValue,y.SetColumnStyle,y.SetRowStyle,y.Sort];var ia=Object.defineProperty,aa=Object.getOwnPropertyDescriptor,ua=(o,e,t,n)=>{for(var s=n>1?void 0:n?aa(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ia(e,t,s),s},Ue=(o,e)=>(t,n)=>e(t,n,o);const la="SHEET_WORKSHEET_PROTECTION_PLUGIN",da="SHEET_WORKSHEET_PROTECTION_POINT_PLUGIN";g.WorksheetPermissionService=class extends r.RxDisposable{constructor(e,t,n,s,i,a,u,l){super(),this._permissionService=e,this._univerInstanceService=t,this._injector=n,this._worksheetProtectionRuleModel=s,this._worksheetProtectionPointRuleModel=i,this._resourceManagerService=a,this._rangeProtectionRuleModel=u,this._logService=l,this._init(),this._initRuleChange(),this._initRuleSnapshot(),this._initPointSnapshot()}_init(){const e=t=>{const n=t.getUnitId(),s=i=>{const a=i.getSheetId();[...Ie(),...nt()].forEach(u=>{const l=new u(n,a);this._permissionService.addPermissionPoint(l)}),this._logService.log("[WorksheetPermissionService]","Initialization completed",n,a)};t.getSheets().forEach(i=>{s(i)}),t.sheetCreated$.subscribe(i=>{s(i)}),t.sheetDisposed$.subscribe(i=>{const a=i.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,a).forEach(l=>{[...ge()].forEach(d=>{const c=new d(n,a,l.permissionId);this._permissionService.deletePermissionPoint(c.id)})}),[...Ie(),...nt()].forEach(l=>{const d=new l(n,a);this._permissionService.deletePermissionPoint(d.id)})})};this._univerInstanceService.getAllUnitsForType(r.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this._univerInstanceService.getTypeOfUnitAdded$(r.UniverInstanceType.UNIVER_SHEET).pipe(it.takeUntil(this.dispose$)).subscribe(e),this._univerInstanceService.getTypeOfUnitDisposed$(r.UniverInstanceType.UNIVER_SHEET).pipe(it.takeUntil(this.dispose$)).subscribe(t=>{t.getSheets().forEach(n=>{const s=t.getUnitId(),i=n.getSheetId();Ie().forEach(a=>{const u=new a(s,i);this._permissionService.deletePermissionPoint(u.id)})})})}_initRuleChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":break;case"delete":{Ie().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)});break}case"set":{Ie().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,e.rule)});break}}}))}_initRuleSnapshot(){const e=()=>{const n=this._worksheetProtectionRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:la,businesses:[Tt.UNIVER_SHEET],onLoad:(n,s)=>{this._worksheetProtectionRuleModel.fromObject(s),Object.keys(s).forEach(i=>{Ie().forEach(a=>{const u=new a(n,i);u.value=!1,this._permissionService.addPermissionPoint(u)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)},onUnLoad:n=>{const s=this._univerInstanceService.getUnit(n);s&&(s.getSheets().forEach(i=>{const a=i.getSheetId();[...Ie(),...nt()].forEach(u=>{const l=new u(n,a);this._permissionService.deletePermissionPoint(l.id)})}),Ft().forEach(i=>{const a=new i(n);this._permissionService.deletePermissionPoint(a.id)})),this._worksheetProtectionRuleModel.deleteUnitModel(n)}}))}_initPointSnapshot(){const e=()=>{const n=this._worksheetProtectionPointRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:da,businesses:[Tt.UNIVER_SHEET],onLoad:(n,s)=>{this._worksheetProtectionPointRuleModel.fromObject(s),Object.keys(s).forEach(i=>{nt().forEach(a=>{const u=new a(n,i);this._permissionService.addPermissionPoint(u)})})},onUnLoad:n=>{this._worksheetProtectionPointRuleModel.deleteUnitModel(n)}}))}},g.WorksheetPermissionService=ua([Ue(0,r.Inject(r.IPermissionService)),Ue(1,r.Inject(r.IUniverInstanceService)),Ue(2,r.Inject(r.Injector)),Ue(3,r.Inject(Ee)),Ue(4,r.Inject(ft)),Ue(5,r.Inject(r.IResourceManagerService)),Ue(6,r.Inject(J)),Ue(7,r.Inject(r.ILogService))],g.WorksheetPermissionService);const oo={id:"sheet.mutation.set-worksheet-permission-points",type:r.CommandType.MUTATION,handler:(o,e)=>{const{rule:t}=e;return o.get(ft).addRule(t),!0}},qs={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-permission-points",async handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),{rule:n}=e;return t.executeCommand(oo.id,{rule:n,unitId:n.unitId,subUnitId:n.subUnitId}),!0}},Ys={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-protection",async handler(o,e){if(!e)return!1;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),{rule:s,permissionId:i,oldRule:a}=e,{unitId:u,subUnitId:l}=s,d={...s,permissionId:i};if(await t.executeCommand(De.id,{unitId:u,subUnitId:l,newRule:d})){const m=[{id:De.id,params:{unitId:u,subUnitId:l,newRule:d}}],h=[{id:De.id,params:{unitId:u,subUnitId:l,rule:a}}];n.pushUndoRedo({unitID:u,redoMutations:m,undoMutations:h})}return!0}},ca=2e3,zs=(o,e)=>{const{unitId:t,subUnitId:n,ranges:s}=o,i={},a=e.getRowManager();for(const{startRow:u,endRow:l}of s)for(let d=u;d<l+1;d++){const c=a.getRowOrCreate(d);i[d]=c.h}return{unitId:t,subUnitId:n,ranges:s,rowHeight:i}},so=(o,e)=>{const{unitId:t,subUnitId:n,ranges:s}=o,i={},a=e.getRowManager();for(const{startRow:u,endRow:l}of s)for(let d=u;d<=l;d++){const c=a.getRowOrCreate(d);i[d]=c.ia}return{unitId:t,subUnitId:n,ranges:s,autoHeightInfo:i}},ma=(o,e)=>{const{unitId:t,subUnitId:n,rowsAutoHeightInfo:s}=o,i=[],a=e.getRowManager();for(const u of s){const{row:l}=u,{ah:d}=a.getRowOrCreate(l);i.push({row:l,autoHeight:d})}return{unitId:t,subUnitId:n,rowsAutoHeightInfo:i}},pe={id:"sheet.mutation.set-worksheet-row-height",type:r.CommandType.MUTATION,handler:(o,e)=>{var d;const{ranges:t,rowHeight:n}=e,s=o.get(r.IUniverInstanceService),i=k(s,e);if(!i)return!1;const{worksheet:a}=i,u=a.getRowManager(),l=a.getConfig().defaultRowHeight;for(const{startRow:c,endRow:m}of t)for(let h=c;h<=m;h++){const R=u.getRowOrCreate(h);typeof n=="number"?R.h=n:R.h=(d=n[h])!=null?d:l,R.h=Math.min(ca,R.h)}return!0}},re={id:"sheet.mutation.set-worksheet-row-is-auto-height",type:r.CommandType.MUTATION,handler:(o,e)=>{var u;const{ranges:t,autoHeightInfo:n}=e,s=o.get(r.IUniverInstanceService),i=k(s,e);if(!i)return!1;const a=i.worksheet.getRowManager();for(const{startRow:l,endRow:d}of t)for(let c=l;c<=d;c++){const m=a.getRowOrCreate(c);typeof n=="number"?m.ia=n:m.ia=(u=n[c])!=null?u:void 0}return!0}},ro={id:"sheet.mutation.set-worksheet-row-auto-height",type:r.CommandType.MUTATION,handler:(o,e)=>{const{rowsAutoHeightInfo:t}=e,n=o.get(r.IUniverInstanceService),s=k(n,e);if(!s)return!1;const i=s.worksheet.getRowManager();for(const{row:a,autoHeight:u}of t){const l=i.getRowOrCreate(a);l.ah=u}return!0}},io={type:r.CommandType.COMMAND,id:"sheet.command.delta-row-height",handler:async(o,e)=>{var U,P;const n=o.get(g.SheetsSelectionsService).getCurrentSelections(),s=o.get(g.SheetInterceptorService);if(!(n!=null&&n.length))return!1;const i=k(o.get(r.IUniverInstanceService));if(!i)return!1;const{worksheet:a,subUnitId:u,unitId:l}=i,{anchorRow:d,deltaY:c}=e,h=a.getRowHeight(d)+c,R=n.length===1&&n[0].range.rangeType===r.RANGE_TYPE.ALL,C=n.filter(N=>N.range.rangeType===r.RANGE_TYPE.ROW),f=R?r.RANGE_TYPE.ALL:C.some(({range:N})=>{const{startRow:A,endRow:j}=N;return A<=d&&d<=j})?r.RANGE_TYPE.ROW:r.RANGE_TYPE.NORMAL;let v;if(f===r.RANGE_TYPE.ALL){const N=a.getRowCount(),A=new Array(a.getColumnCount()).fill(void 0).map((j,$)=>({startRow:$,endRow:$,startColumn:0,endColumn:N-1}));v={subUnitId:u,unitId:l,rowHeight:h,ranges:A}}else f===r.RANGE_TYPE.ROW?v={subUnitId:u,unitId:l,ranges:C.map(N=>r.Rectangle.clone(N.range)),rowHeight:h}:v={subUnitId:u,unitId:l,rowHeight:h,ranges:[{startRow:d,endRow:d,startColumn:0,endColumn:a.getMaxColumns()-1}]};const I=zs(v,a),p={unitId:l,subUnitId:u,ranges:v.ranges,autoHeightInfo:r.BooleanNumber.FALSE},w=so(p,a),M=o.get(r.ICommandService),_=o.get(r.IUndoRedoService),b=s.onCommandExecute({id:io.id,params:v}),E=r.sequenceExecute([{id:pe.id,params:v},{id:re.id,params:p}],M),T=r.sequenceExecute([...b.redos],M);return E.result&&T.result?(_.pushUndoRedo({unitID:l,undoMutations:[...(U=b.preUndos)!=null?U:[],{id:pe.id,params:I},{id:re.id,params:w},...b.undos],redoMutations:[...(P=b.preRedos)!=null?P:[],{id:pe.id,params:v},{id:re.id,params:p},...b.redos]}),!0):!1}},ao={type:r.CommandType.COMMAND,id:"sheet.command.set-row-height",handler:(o,e)=>{var w,M,_,b;const t=o.get(g.SheetsSelectionsService),n=o.get(r.ICommandService),s=o.get(r.IUndoRedoService),i=o.get(r.IUniverInstanceService),a=o.get(g.SheetInterceptorService),u=(w=e==null?void 0:e.ranges)!=null&&w.length?e.ranges:(M=t.getCurrentSelections())==null?void 0:M.map(E=>E.range);if(!(u!=null&&u.length))return!1;const l=k(i,e);if(!l)return!1;const{unitId:d,subUnitId:c,worksheet:m}=l,h={subUnitId:c,unitId:d,ranges:u,rowHeight:e.value},R=zs(h,m),C={unitId:d,subUnitId:c,ranges:h.ranges,autoHeightInfo:r.BooleanNumber.FALSE},f=so(C,m),v=r.sequenceExecute([{id:pe.id,params:h},{id:re.id,params:C}],n),I=a.onCommandExecute({id:ao.id,params:h}),p=r.sequenceExecute([...I.redos],n);return v.result&&p.result?(s.pushUndoRedo({unitID:d,undoMutations:[...(_=I.preRedos)!=null?_:[],{id:pe.id,params:R},{id:re.id,params:f},...I.undos],redoMutations:[...(b=I.preRedos)!=null?b:[],{id:pe.id,params:h},{id:re.id,params:C},...I.redos]}),!0):!1}},uo={type:r.CommandType.COMMAND,id:"sheet.command.set-row-is-auto-height",handler:async(o,e)=>{var I,p;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(g.SheetsSelectionsService),i=o.get(r.IUniverInstanceService),a=k(i,e);if(!a)return!1;const{unitId:u,subUnitId:l,worksheet:d}=a,c=(I=e==null?void 0:e.ranges)!=null&&I.length?e.ranges:(p=s.getCurrentSelections())==null?void 0:p.map(w=>w.range);if(!(c!=null&&c.length))return!1;const m={unitId:u,subUnitId:l,ranges:c,autoHeightInfo:r.BooleanNumber.TRUE},h=so(m,d),R=t.syncExecuteCommand(re.id,m),{undos:C,redos:f}=o.get(g.SheetInterceptorService).onCommandExecute({id:uo.id,params:m}),v=r.sequenceExecute([...f],t);return R&&v.result?(n.pushUndoRedo({unitID:u,undoMutations:[{id:re.id,params:h},...C],redoMutations:[{id:re.id,params:m},...f]}),!0):!1}},Ks={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-show",handler:async(o,e)=>{const{unitId:t,subUnitId:n}=e,s=o.get(r.ICommandService),i=o.get(r.IUndoRedoService),a=o.get(r.IUniverInstanceService);if(!k(o.get(r.IUniverInstanceService)))return!1;const l=a.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const d=l.getSheetBySheetId(n);if(!d||d.getConfig().hidden===r.BooleanNumber.FALSE)return!1;const m={unitId:t,subUnitId:n,hidden:r.BooleanNumber.FALSE},h=js(o,m),R=s.syncExecuteCommand(be.id,m),C={unitId:t,subUnitId:n},f=s.syncExecuteCommand(et.id,C);return R&&f?(i.pushUndoRedo({unitID:t,undoMutations:[{id:be.id,params:h}],redoMutations:[{id:be.id,params:m}]}),!0):!1}};class ha{constructor(){S(this,"_tabCount",0);S(this,"_commaCount",0);S(this,"_semicolonCount",0);S(this,"_spaceCount",0)}add(e){switch(e){case" ":this._tabCount++;break;case",":this._commaCount++;break;case";":this._semicolonCount++;break;case" ":this._spaceCount++;break}}update(e){e&&typeof e=="string"&&(e.includes(" ")&&this._tabCount++,e.includes(",")&&this._commaCount++,e.includes(";")&&this._semicolonCount++,e.trim().includes(" ")&&this._spaceCount++)}getDelimiter(){const e=Math.max(this._tabCount,this._commaCount,this._semicolonCount,this._spaceCount);return e===0||e===this._tabCount?1:e===this._commaCount?2:e===this._semicolonCount?4:e===this._spaceCount?8:1}}function ga(o,e,t){const n=[];t!==void 0&&(o&16)>0&&n.push(t),(o&1)>0&&n.push(" "),(o&2)>0&&n.push(","),(o&4)>0&&n.push(";"),(o&8)>0&&n.push(" ");let s="";for(const a of n)s+=Ra(a);let i="[".concat(s,"]");return e&&(i+="+"),new RegExp(i)}function Ra(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Ca=o=>{var t;return((t=o.body)==null?void 0:t.dataStream.replace(/\r\n$/,""))||""};function fa(o){if(o!=null){if(o.p)return Ca(o.p);if(o.v&&typeof o.v=="string")return o.v;if(o.t&&(o.t===r.CellValueType.FORCE_STRING||o.t===r.CellValueType.STRING))return String(o.v)}}function xs(o,e,t,n,s=!1){const i=r.Range.transformRange(e,o),{startColumn:a,startRow:u,endColumn:l,endRow:d}=i;if(a!==l)throw new Error("The range must be in the same column.");if(t&&(t&16)>0&&(n===void 0||n.length!==1))throw new Error("The custom delimiter must a character.");const c=t===void 0,m=c?new ha:null,h=[];for(let w=u;w<=d;w++){const M=o.getCell(w,a),_=fa(M);h.push(_),m&&m.update(_)}const R=c?m.getDelimiter():t,C=ga(R,s,n);let f=-1,v=0,I=0;const p=[];for(const w of h){if(w!==void 0){const M=String(w).split(C);f<0?f=M.length:f=Math.max(f,M.length),p.push(M),v=I}else p.push(void 0);I++}return{rs:p,maxLength:f===-1?0:f,lastRow:v}}const Js={type:r.CommandType.COMMAND,id:"sheet.command.split-text-to-columns",handler:async(o,e)=>{const{unitId:t,subUnitId:n,range:s,delimiter:i,customDelimiter:a,treatMultipleDelimitersAsOne:u}=e,l=o.get(r.ICommandService),d=o.get(r.IUniverInstanceService),c=o.get(r.IUndoRedoService);if(!k(o.get(r.IUniverInstanceService)))return!1;const h=d.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!h)return!1;const R=h.getSheetBySheetId(n);if(!R)return!1;const{lastRow:C,rs:f,maxLength:v}=xs(R,s,i,a,u),I=R.getColumnCount(),{startColumn:p}=r.Range.transformRange(s,R);if(s.startColumn!==s.endColumn)return!1;const w=[],M=[],_=p+v+1-I;if(_>0){const N={unitId:t,subUnitId:n,range:{startRow:0,endRow:R.getRowCount()-1,startColumn:I-1,endColumn:I-1+_}};w.push({id:ae.id,params:N});const A=kt(o,N);M.push({id:oe.id,params:A})}const b={startRow:s.startRow,endRow:C,startColumn:p,endColumn:p+v},E=new r.ObjectMatrix;for(let N=b.startRow;N<=b.endRow;N++)for(let A=b.startColumn;A<=b.endColumn;A++){const j=f[N-b.startRow];A===0&&(j==null?void 0:j.length)===1?E.setValue(N,A,R.getCell(N,A)):E.setValue(N,A,{v:(j==null?void 0:j[A-b.startColumn])||null,p:null,f:null,si:null,custom:null})}const T={unitId:t,subUnitId:n,cellValue:E.clone()},U=ne(o,T);return w.push({id:B.id,params:T}),M.unshift({id:B.id,params:U}),r.sequenceExecute(w,l).result?(c.pushUndoRedo({unitID:t,undoMutations:M,redoMutations:w}),!0):!1}},Xs={id:"sheet.command.toggle-cell-checkbox",type:r.CommandType.COMMAND,handler:(o,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,row:s,col:i,paragraphIndex:a}=e,l=o.get(r.IUniverInstanceService).getUnit(t,r.UniverInstanceType.UNIVER_SHEET),d=l==null?void 0:l.getSheetBySheetId(n),c=o.get(r.IUndoRedoService),m=o.get(r.ICommandService);if(!d)return!1;const h=d.getCell(s,i);if(!(h!=null&&h.p))return!1;const R=r.Tools.deepClone(h.p),C=new r.DocumentDataModel(R),f=r.BuildTextUtils.paragraph.bullet.toggleChecklist({document:C,paragraphIndex:a});if(!f)return!1;r.TextX.apply(C.getBody(),f.serialize());const v={unitId:t,subUnitId:n,cellValue:{[s]:{[i]:{p:R,t:r.CellValueType.STRING}}}},I={id:B.id,params:v},p=ne(o,v),w={id:B.id,params:p},M=[I],_=[w];return c.pushUndoRedo({redoMutations:M,undoMutations:_,unitID:t}),m.syncExecuteCommand(I.id,I.params)}},ot={id:"sheet.mutation.toggle-gridlines",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=k(o.get(r.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,s=n.getConfig();return s.showGridlines=e.showGridlines,!0}},Zs={type:r.CommandType.COMMAND,id:"sheet.command.toggle-gridlines",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=k(s);if(!i)return!1;const{worksheet:a}=i,u=a.getConfig().showGridlines;if(u===(e==null?void 0:e.showGridlines))return!1;const{unitId:l,subUnitId:d}=i,c={showGridlines:u===r.BooleanNumber.TRUE?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE,unitId:l,subUnitId:d},m={showGridlines:u,unitId:l,subUnitId:d};return t.syncExecuteCommand(ot.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:ot.id,params:m}],redoMutations:[{id:ot.id,params:c}]}),!0):!1}},Qs={id:"sheet.mutation.empty",type:r.CommandType.MUTATION,handler:()=>!0},er=o=>{const e=new r.ObjectMatrix;return o.forEach(t=>{r.Range.foreach(t,(n,s)=>{e.setValue(n,s,1)})}),e.forValue((t,n)=>{const s=e.getValue(t-1,n);s&&e.setValue(t,n,s+1)}),e},tr=o=>{const e=o;return e.forValue((t,n)=>{const s=o.getValue(t-1,n);s&&e.setValue(t,n,s+1)}),e},nr=o=>{const e={area:0},t=(n,s)=>e.area<n?(e.area=n,e.range=s,!0):!1;return o.forValue((n,s,i)=>{let a=1,u=i;t(a*u,{startRow:n-u+1,endRow:n,startColumn:s,endColumn:s});const l={startRow:n-u+1,endRow:n,startColumn:0,endColumn:s};for(let d=s-1;d>=0&&o.getValue(n,d);d--){u=Math.min(o.getValue(n,d)||0,u),a++;const c=u*a;l.startColumn=d,l.startRow=n-u+1,t(c,l)}}),e},Sa=(o,e)=>{r.Range.foreach(e,(t,n)=>{o.realDeleteValue(t,n)});for(let t=e.startColumn;t<=e.endColumn;t++){const n=e.endRow+1;if(o.getValue(n,t)>0){o.setValue(n,t,1);let i=n+1;for(;o.getValue(i,t)>0;)o.setValue(i,t,o.getValue(i-1,t)+1),i++}}return o},lo=o=>{const e=[];let t=nr(o);for(;t.area>0;)t.range&&(e.push(t.range),Sa(o,t.range)),t=nr(o);return e},co=o=>{const e=er(o);return lo(e)};class va{constructor(){S(this,"_matrix",new r.ObjectMatrix)}add(...e){return e.forEach(t=>{r.Range.foreach(t,(n,s)=>{this._matrix.setValue(n,s,1)})}),this}subtract(...e){return e.forEach(t=>{r.Range.foreach(t,(n,s)=>{this._matrix.realDeleteValue(n,s)})}),this}merge(){const e=tr(this._matrix);return lo(e)}}const Ae=r.createIdentifier("INumfmtService"),Ia=(o,e)=>{const t=o.get(Ae),{values:n,unitId:s,subUnitId:i}=e,a=[],u=[];Object.keys(n).forEach(d=>{n[d].ranges.forEach(m=>{r.Range.foreach(m,(h,R)=>{const C=t.getValue(s,i,h,R);C?a.push({pattern:C.pattern,row:h,col:R}):u.push({startColumn:R,endColumn:R,startRow:h,endRow:h})})})});const l=[];if(a.length){const d=Gt(s,i,a);Object.keys(d.values).forEach(c=>{const m=d.values[c];m.ranges=co(m.ranges)}),l.push({id:Ht.id,params:Gt(s,i,a)})}return u.length&&l.push({id:mo.id,params:{unitId:s,subUnitId:i,ranges:u}}),l},Ht={id:"sheet.mutation.set.numfmt",type:r.CommandType.MUTATION,handler:(o,e)=>{if(!e)return!1;const{values:t,refMap:n}=e,s=o.get(Ae),i=e.unitId,a=e.subUnitId,u=Object.keys(t).reduce((l,d)=>{const c=n[d],m=t[d].ranges;return c&&l.push({...c,ranges:m}),l},[]);return s.setValues(i,a,u),!0}},mo={id:"sheet.mutation.remove.numfmt",type:r.CommandType.MUTATION,handler:(o,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,ranges:s}=e;return o.get(Ae).deleteValues(t,n,s),!0}},pa=(o,e)=>{const t=o.get(Ae),{ranges:n,unitId:s,subUnitId:i}=e,a=[];if(n.forEach(l=>{r.Range.foreach(l,(d,c)=>{const m=t.getValue(s,i,d,c);m&&a.push({pattern:m.pattern,row:d,col:c})})}),!a.length)return[];const u=Gt(s,i,a);return Object.keys(u.values).forEach(l=>{const d=u.values[l];d.ranges=co(d.ranges)}),[{id:Ht.id,params:u}]},Gt=(o,e,t)=>{const n=jr(t,"pattern"),s={},i={},a=Fr();return Object.keys(n).forEach(u=>{const l=n[u],d=a();s[d]={pattern:u},l.forEach(c=>{i[d]||(i[d]={ranges:[]}),i[d].ranges.push(r.cellToRange(c.row,c.col))})}),{unitId:o,subUnitId:e,refMap:s,values:i}},or={id:"sheet.operation.scroll-to-cell",type:r.CommandType.OPERATION,handler:()=>!0},sr="ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY",rr="maxCellsPerSheet",Ma=3e6;var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,ya=(o,e,t,n)=>{for(var s=n>1?void 0:n?_a(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&wa(e,t,s),s},ho=(o,e)=>(t,n)=>e(t,n,o);let qt=class extends r.Disposable{constructor(o,e,t){var s;super(),this._commandService=o,this._configService=e,this._dataSyncPrimaryController=t,[B,ae,me,Be,Me,fe,Se,oe,he,Ne,G,mo,H,xn,jt,Ht,gt,Qs].forEach(i=>{var a;this._commandService.registerCommand(i),(a=this._dataSyncPrimaryController)==null||a.registerSyncingMutations(i)}),((s=this._configService.getConfig(sr))!=null?s:!1)||[yt,nn,bt,sn,Fe,He,Qn,io,ns,ts,_e,ht,Nt,Qo,Zo,we,os,Dt,je,Ot,qe,Ge,At,Wt,cs,Os,ks,Ns,fs,Cs,Ye,gs,Rs,qn,Ke,xe,Bt,vs,ze,Ms,ye,ws,As,mt,ao,Kn,Qe,Ze,Us,Xe,Is,Ts,$t,Lt,x,$s,Rt,Ps,Vs,Ws,Ds,Jn,Xn,et,Fs,be,eo,Hs,Ct,ro,pe,uo,re,ve,q,or,Jo,Hn,Yn,Ks,Zs,ot,_s,Je,qs,Pe,De,ke,oo,bo,ys,Ko,Uo,xo,Ys,ie,de,K,Xs,tt,Bs,Js].forEach(i=>this.disposeWithMe(this._commandService.registerCommand(i))),this._configService.setConfig(rr,Ma)}};qt=ya([ho(0,r.ICommandService),ho(1,r.IConfigService),ho(2,r.Optional($r.DataSyncPrimaryController))],qt);var ba=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Ta=(o,e,t,n)=>{for(var s=n>1?void 0:n?Ua(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ba(e,t,s),s},ir=(o,e)=>(t,n)=>e(t,n,o);let Yt=class extends r.Disposable{constructor(o,e){super(),this._univerInstanceService=o,this._commandService=e,this._initialize()}_initialize(){this.disposeWithMe(this._commandService.onCommandExecuted(o=>{if(o.id!==z.SetFormulaCalculationResultMutation.id)return;const e=o.params,{unitData:t}=e,n=Object.keys(t),s=[];for(let a=0;a<n.length;a++){const u=n[a],l=t[u];if(l==null)continue;const d=Object.keys(l);for(let c=0;c<d.length;c++){const m=d[c],h=l[m];if(h==null)continue;const R=this._getMergedCellData(u,m,h),C={subUnitId:m,unitId:u,cellValue:R};s.push({id:B.id,params:C})}}return s.every(a=>this._commandService.executeCommand(a.id,a.params,{onlyLocal:!0}))}))}_getMergedCellData(o,e,t){const n=this._univerInstanceService.getUniverSheetInstance(o),s=n==null?void 0:n.getStyles(),i=n==null?void 0:n.getSheetBySheetId(e),a=i==null?void 0:i.getCellMatrix(),u=new r.ObjectMatrix(t);return u.forValue((l,d,c)=>{const m=a==null?void 0:a.getValue(l,d),h=z.handleNumfmtInCell(m,c,s);u.setValue(l,d,h)}),u.getMatrix()}};Yt=Ta([ir(0,r.Inject(r.IUniverInstanceService)),ir(1,r.ICommandService)],Yt);const Ea="sheets.config",ar={};var Pa=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,Na=(o,e,t,n)=>{for(var s=n>1?void 0:n?ka(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Pa(e,t,s),s},ur=(o,e)=>(t,n)=>e(t,n,o);const Oa="SHEET_DEFINED_NAME_PLUGIN",Da="AllDefaultWorkbook";g.DefinedNameDataController=class extends r.Disposable{constructor(e,t){super(),this._definedNamesService=e,this._resourceManagerService=t,this._initialize()}_initialize(){this._initSnapshot()}_initSnapshot(){const e=n=>{const s=this._definedNamesService.getDefinedNameMap(n);return s?JSON.stringify(s):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:Oa,businesses:[r.UniverInstanceType.UNIVER_SHEET],toJson:n=>e(n),parseJson:n=>t(n),onUnLoad:n=>{this._definedNamesService.removeUnitDefinedName(n)},onLoad:(n,s)=>{this._definedNamesService.registerDefinedNames(n,s)}}))}},g.DefinedNameDataController=Na([ur(0,z.IDefinedNamesService),ur(1,r.IResourceManagerService)],g.DefinedNameDataController);const O={MoveRangeCommandId:jo,InsertRowCommandId:Xo,InsertColCommandId:es,RemoveColCommandId:ds,RemoveRowCommandId:ls,DeleteRangeMoveLeftCommandId:Yo,DeleteRangeMoveUpCommandId:zo,InsertRangeMoveDownCommandId:_i,InsertRangeMoveRightCommandId:Fn,MoveColsCommandId:as,MoveRowsCommandId:is,ReorderRangeCommandId:hs};var V=(o=>(o[o.Set=0]="Set",o[o.Delete=1]="Delete",o[o.HorizontalMove=2]="HorizontalMove",o[o.VerticalMove=3]="VerticalMove",o[o.Unknown=4]="Unknown",o))(V||{});const zt=Number.MAX_SAFE_INTEGER,Re=o=>{const e={...o},t=Number.isNaN(e.startRow)&&Number.isNaN(e.endRow)&&!Number.isNaN(e.startColumn)&&!Number.isNaN(e.endColumn),n=Number.isNaN(e.startColumn)&&Number.isNaN(e.endColumn)&&!Number.isNaN(e.startRow)&&!Number.isNaN(e.endRow);return(e.rangeType===r.RANGE_TYPE.COLUMN||t)&&(e.startRow=0,e.endRow=zt),(e.rangeType===r.RANGE_TYPE.ROW||n)&&(e.startColumn=0,e.endColumn=zt),e.rangeType===r.RANGE_TYPE.ALL&&(e.startColumn=0,e.endColumn=zt,e.startRow=0,e.endRow=zt),e},te=o=>{let e=o.rangeType;return o.rangeType===r.RANGE_TYPE.COLUMN?e=r.RANGE_TYPE.ROW:o.rangeType===r.RANGE_TYPE.ROW&&(e=r.RANGE_TYPE.COLUMN),{startRow:o.startColumn,endRow:o.endColumn,startColumn:o.startRow,endColumn:o.endRow,rangeType:e}},St=(o,e,t)=>{const n={...t},s={...e},i=(f,v)=>{const I=Math.max(f.start,v.start),p=Math.min(f.end,v.end);return p<I?null:{start:I,end:p}},a=f=>f.end-f.start+1,u=(f,v)=>({start:f.start-v.start,end:f.start-v.start+f.end-f.start}),l=(f,v)=>({start:v.start+f.start,end:v.start+f.start+f.end-f.start}),d=e.start>o.start;if(d){const f=Math.min(o.end,e.start)-o.start+1;s.start-=f,s.end-=f}const c=a(o),m=c,h=i(o,n),R=h&&a(h)>=a(n);if(o.end<n.start)n.start-=c,n.end-=c;else if(h){const f=a(h);if(R){const v=u(n,o),I=l(v,s);n.start=I.start,n.end=I.end}else h.start>o.start?d?(n.end-=f+c,n.start-=c):n.end-=f:d?n.end-=f:n.start>o.start&&n.end>o.end?(n.start-=c,n.end-=c+f):n.end-=f}const C=i(s,n);return R||(s.start<=n.start?(n.start+=m,n.end+=m):C&&(d?s.end<=n.start||s.start<=n.start&&s.end>=n.start?(n.start+=m,n.end+=m):s.start>=n.start&&s.start<=n.end&&(n.end+=m):n.start<s.start&&n.end>s.start?n.end+=m:(n.start>=s.end||n.start>=s.start&&n.start<=s.end)&&(n.end+=m,n.start+=m))),{step:n.start-t.start,length:a(n)-a(t)}},go=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!n||!t)return[];const s=Re(t),i=Re(n),a=Re(e),u=St({start:s.startRow,end:s.endRow},{start:i.startRow,end:i.endRow},{start:a.startRow,end:a.endRow});return u===null?[{type:V.Delete}]:[{type:V.VerticalMove,step:u.step||0,length:u.length||0}]},Aa=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!t||!n)return[e];const s=t.startRow,i=t.endRow-t.startRow+1,a=n.startRow,u=new r.ObjectMatrix;return r.Range.foreach(e,(d,c)=>{u.setValue(d,c,1)}),u.moveRows(s,i,a),r.queryObjectMatrix(u,d=>d===1)},Wa=(o,e)=>{const{range:t,order:n}=o.params||{};if(!t||!n)return[e];const s=new r.ObjectMatrix;r.Range.foreach(e,(u,l)=>{s.setValue(u,l,1)});const i=new r.ObjectMatrix;return r.Range.foreach(t,(u,l)=>{var d;if(n.hasOwnProperty(u)){const c=n[u],m=(d=s.getValue(c,l))!=null?d:0;i.setValue(u,l,m)}}),i.forValue((u,l,d)=>{s.setValue(u,l,d)}),r.queryObjectMatrix(s,u=>u===1)},Ro=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!n||!t)return[];const s=Re(t),i=Re(n),a=Re(e),u=St({start:s.startColumn,end:s.endColumn},{start:i.startColumn,end:i.endColumn},{start:a.startColumn,end:a.endColumn});return u===null?[{type:V.Delete}]:[{type:V.HorizontalMove,step:u.step||0,length:u.length||0}]},Va=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!t||!n)return[e];const s=t.startColumn,i=t.endColumn-t.startColumn+1,a=n.startColumn,u=new r.ObjectMatrix;return r.Range.foreach(e,(l,d)=>{u.setValue(l,d,1)}),u.moveColumns(s,i,a),r.queryObjectMatrix(u,l=>l===1)},lr=(o,e)=>{var i,a;const t=(i=o.params)==null?void 0:i.toRange,n=(a=o.params)==null?void 0:a.fromRange;if(!t||!n)return[];const s=[];if(r.Rectangle.contains(t,e)&&s.push({type:V.Delete}),r.Rectangle.contains(n,e)){s.push({type:V.Delete});const u=r.Rectangle.getRelativeRange(e,n),l=r.Rectangle.getPositionRange(u,t);return[{type:V.Set,range:l}]}return s},$a=(o,e)=>{var m,h;const t=(m=o.params)==null?void 0:m.toRange,n=(h=o.params)==null?void 0:h.fromRange;if(!t||!n)return[e];if(!r.Rectangle.intersects(n,e)&&!r.Rectangle.intersects(t,e))return[e];if(r.Rectangle.contains(n,e)){const R=r.Rectangle.getRelativeRange(e,n);return[r.Rectangle.getPositionRange(R,t)]}const s=new r.ObjectMatrix;r.Range.foreach(e,(R,C)=>{s.setValue(R,C,1)});const i=new r.ObjectMatrix,a=r.Rectangle.getIntersects(n,e);a&&r.Range.foreach(a,(R,C)=>{s.getValue(R,C)&&(s.setValue(R,C,void 0),i.setValue(R,C,1))});const u=t.startColumn-n.startColumn,l=t.startRow-n.startRow,d={startColumn:t.startColumn-u,endColumn:t.endColumn-u,startRow:t.startRow-l,endRow:t.endRow-l};return d&&r.Range.foreach(d,(R,C)=>{var I;const f=R+l,v=C+u;s.setValue(f,v,(I=i.getValue(R,C))!=null?I:0)}),r.queryObjectMatrix(s,R=>R===1)},We=(o,e)=>{const t=Re(o),n=Re(e),s=a=>a.endColumn-a.startColumn+1,i=a=>a.endRow-a.startRow+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn){const a=r.Rectangle.getIntersects(n,t);if(a)return{step:0,length:-s(a)}}if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn&&i(t)>=i(n))return null;if(n.startColumn>=t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn){const a=r.Rectangle.getIntersects(n,t);if(a){const u=-s(a);return{step:-(s(t)-s(a)),length:u}}}if(n.startColumn>t.endColumn)return{step:-s(t),length:0}}return{step:0,length:0}},Co=(o,e)=>{var i;const t=(i=o.params)==null?void 0:i.range;if(!t)return[];const n=[],s=We(t,e);if(!s)n.push({type:V.Delete});else{const{step:a,length:u}=s;n.push({type:V.HorizontalMove,step:a,length:u})}return n},dr=(o,e)=>{var i;const t=(i=o.params)==null?void 0:i.range;if(!t)return[];const n=[],s=We(te(t),te(e));if(!s)n.push({type:V.Delete});else{const{step:a,length:u}=s;n.push({type:V.VerticalMove,step:a,length:u})}return n},La=(o,e)=>{const{range:t,order:n}=o.params||{};if(!t||!n)return[];if(r.Rectangle.contains(t,e)&&e.endRow===e.startRow){const s=[],i=e.startRow;for(const a in n)if(n[a]===i){const u=Number(a);return s.push({type:V.VerticalMove,step:u-i,length:0}),s}return[]}return[]},Ve=(o,e)=>{const t=Re(o),n=Re(e),s=i=>i.endColumn-i.startColumn+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn)return{step:0,length:s(t)};if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn>t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn||n.startColumn>=t.endColumn)return{step:s(t),length:0}}return{step:0,length:0}};function Ba(o,e,t){const n=[];if(r.Rectangle.contains(e,t)&&n.push({type:V.Delete}),r.Rectangle.contains(o,t)){n.push({type:V.Delete});const s=r.Rectangle.getRelativeRange(t,o),i=r.Rectangle.getPositionRange(s,e);return[{type:V.Set,range:i}]}return n}const cr=(o,e)=>{var u;const t=(u=o.params)==null?void 0:u.range;if(!t)return[];const n=[],s=Ve(te(t),te(e)),{step:i,length:a}=s;return n.push({type:V.VerticalMove,step:i,length:a}),n},mr=(o,e)=>{var u;const t=(u=o.params)==null?void 0:u.range;if(!t)return[];const n=[],s=Ve(t,e),{step:i,length:a}=s;return n.push({type:V.HorizontalMove,step:i,length:a}),n},hr=(o,e)=>{var u;const t=(u=o.params)==null?void 0:u.range;if(!t)return[];const n=[],s=Ve(te(t),te(e)),{step:i,length:a}=s;return n.push({type:V.VerticalMove,step:i,length:a}),n},ja=(o,e)=>{var l;const t=(l=o.params)==null?void 0:l.range;if(!t)return[e];const n=t.endRow-t.startRow+1,s={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},i=r.Rectangle.subtract(e,s),a=r.Rectangle.getIntersects(s,e);if(!a)return[e];const u=new r.ObjectMatrix;return i.forEach(d=>{r.Range.foreach(d,(c,m)=>{u.setValue(c,m,1)})}),a&&r.Range.foreach(a,(d,c)=>{u.setValue(d+n,c,1)}),r.queryObjectMatrix(u,d=>d===1)},gr=(o,e)=>{var u;const t=(u=o.params)==null?void 0:u.range;if(!t)return[];const n=[],s=Ve(t,e),{step:i,length:a}=s;return n.push({type:V.HorizontalMove,step:i,length:a}),n},Fa=(o,e)=>{var l;const t=(l=o.params)==null?void 0:l.range;if(!t)return[e];const n=t.endColumn-t.startColumn+1,s={...t,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},i=r.Rectangle.subtract(e,s),a=r.Rectangle.getIntersects(s,e);if(!a)return[e];const u=new r.ObjectMatrix;return i.forEach(d=>{r.Range.foreach(d,(c,m)=>{u.setValue(c,m,1)})}),a&&r.Range.foreach(a,(d,c)=>{u.setValue(d,c+n,1)}),r.queryObjectMatrix(u,d=>d===1)},Rr=(o,e)=>{var i;const t=(i=o.params)==null?void 0:i.range;if(!t)return[];const n=[],s=We(t,e);if(!s)n.push({type:V.Delete});else{const{step:a,length:u}=s;n.push({type:V.HorizontalMove,step:a,length:u})}return n},Ha=(o,e)=>{var d;const t=(d=o.params)==null?void 0:d.range;if(!t)return[e];const n={startRow:t.startRow,endRow:t.endRow,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},s=t.endColumn-t.startColumn+1,i=r.Rectangle.getIntersects(t,e),a=r.Rectangle.subtract(e,n),u=r.Rectangle.getIntersects(n,e);if(!i&&!u)return[e];const l=new r.ObjectMatrix;return u&&r.Range.foreach(u,(c,m)=>{l.setValue(c,m-s,1)}),i&&r.Range.foreach(i,(c,m)=>{l.setValue(c,m-s,0)}),a.forEach(c=>{r.Range.foreach(c,(m,h)=>{l.setValue(m,h,1)})}),r.queryObjectMatrix(l,c=>c===1)},Cr=(o,e)=>{var i;const t=(i=o.params)==null?void 0:i.range;if(!t)return[];const n=[],s=We(te(t),te(e));if(!s)n.push({type:V.Delete});else{const{step:a,length:u}=s;n.push({type:V.VerticalMove,step:a,length:u})}return n},Ga=(o,e)=>{var d;const t=(d=o.params)==null?void 0:d.range;if(!t)return[e];const n={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},s=t.endRow-t.startRow+1,i=r.Rectangle.getIntersects(t,e),a=r.Rectangle.subtract(e,n),u=r.Rectangle.getIntersects(n,e);if(!i&&!u)return[e];const l=new r.ObjectMatrix;return u&&r.Range.foreach(u,(c,m)=>{l.setValue(c-s,m,1)}),i&&r.Range.foreach(i,(c,m)=>{l.setValue(c-s,m,0)}),a.forEach(c=>{r.Range.foreach(c,(m,h)=>{l.setValue(m,h,1)})}),r.queryObjectMatrix(l,c=>c===1)},qa=(o,e)=>{var s;const t=(s=o.ranges)!=null?s:[o.range],n=new r.ObjectMatrix;return r.Range.foreach(e,(i,a)=>{n.setValue(i,a,1)}),t.forEach(i=>{const a=i.startRow,l=i.endRow-a+1;n.removeRows(a,l)}),r.queryObjectMatrix(n,i=>i===1)},Ya=(o,e)=>{const t=o.params,n=t.range.startRow,s=t.range.endRow-t.range.startRow+1,i=t.direction;return i===r.Direction.UP&&n===e.startRow||i===r.Direction.DOWN&&n-1===e.endRow?[{startRow:e.startRow,endRow:e.endRow+s,startColumn:e.startColumn,endColumn:e.endColumn}]:e.startRow>=n?[{startRow:e.startRow+s,endRow:e.endRow+s,startColumn:e.startColumn,endColumn:e.endColumn}]:e.endRow<=n?[e]:[{startRow:e.startRow,endRow:e.endRow+s,startColumn:e.startColumn,endColumn:e.endColumn}]},za=(o,e)=>{const t=o.params,n=t.range.startColumn,s=t.range.endColumn-t.range.startColumn+1,i=t.direction;return i===r.Direction.LEFT&&n===e.startColumn||i===r.Direction.RIGHT&&n-1===e.endColumn?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+s}]:e.startColumn>=n?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn+s,endColumn:e.endColumn+s}]:e.endColumn<=n?[e]:[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+s}]},$e=(o,e)=>{let t={...e};return o.forEach(n=>{switch(n.type){case V.Delete:{t=null;break}case V.HorizontalMove:{if(!t)return;t.startColumn+=n.step,t.endColumn+=n.step+(n.length||0);break}case V.VerticalMove:{if(!t)return;t.startRow+=n.step,t.endRow+=n.step+(n.length||0);break}case V.Set:{t=n.range;break}}}),t&&(t.endColumn<t.startColumn||t.endRow<t.startRow)?null:t},fo=(o,e)=>{let t=[];switch(e.id){case O.DeleteRangeMoveLeftCommandId:{t=Rr(e,o);break}case O.DeleteRangeMoveUpCommandId:{t=Cr(e,o);break}case O.InsertColCommandId:{t=mr(e,o);break}case O.InsertRangeMoveDownCommandId:{t=hr(e,o);break}case O.InsertRangeMoveRightCommandId:{t=gr(e,o);break}case O.InsertRowCommandId:{t=cr(e,o);break}case O.MoveColsCommandId:{t=Ro(e,o);break}case O.MoveRangeCommandId:{t=lr(e,o);break}case O.MoveRowsCommandId:{t=go(e,o);break}case O.RemoveColCommandId:{t=Co(e,o);break}case O.RemoveRowCommandId:{t=dr(e,o);break}case O.ReorderRangeCommandId:{t=La(e,o);break}}return $e(t,o)},Ka=(o,e,t)=>[Fe.id,He.id].includes(e.id)||Sr(e,t).some(i=>r.Rectangle.intersects(i,o))?fo(o,e):o,So=(o,e)=>{let t=[];switch(e.id){case O.DeleteRangeMoveLeftCommandId:return Ha(e,o);case O.DeleteRangeMoveUpCommandId:return Ga(e,o);case O.InsertRangeMoveDownCommandId:return ja(e,o);case O.InsertRangeMoveRightCommandId:return Fa(e,o);case O.InsertColCommandId:return za(e,o);case O.InsertRowCommandId:return Ya(e,o);case O.MoveColsCommandId:return Va(e,o);case O.MoveRangeCommandId:return $a(e,o);case O.MoveRowsCommandId:return Aa(e,o);case O.ReorderRangeCommandId:return Wa(e,o);case O.RemoveColCommandId:{t=Co(e,o);break}case O.RemoveRowCommandId:return qa(e.params,o)}const n=$e(t,o);return n?[n]:[]},xa=(o,e,t)=>[Fe.id,He.id,ht.id,Fn].includes(e.id)||Sr(e,t).some(i=>r.Rectangle.intersects(i,o))?So(o,e):o;function fr(o,e){const{id:t,params:n}=e;let s={length:0,step:0,type:V.Unknown};switch(t){case Ne.id:s.type=V.Delete;break;case fe.id:s=St({start:n.sourceRange.startRow,end:n.sourceRange.endRow},{start:n.targetRange.startRow,end:n.targetRange.endRow},{start:o.startRow,end:o.endRow}),s.type=V.VerticalMove;break;case Se.id:s=St({start:n.sourceRange.startColumn,end:n.sourceRange.endColumn},{start:n.targetRange.startColumn,end:n.targetRange.endColumn},{start:o.startColumn,end:o.endColumn}),s.type=V.HorizontalMove;break;case oe.id:s=We(n.range,o),s?s.type=V.HorizontalMove:s={step:0,length:0,type:V.Delete};break;case he.id:s=We(te(n.range),te(o)),s?s.type=V.VerticalMove:s={step:0,length:0,type:V.Delete};break;case me.id:s=Ve(te(n.range),te(o)),s.type=V.VerticalMove;break;case ae.id:s=Ve(n.range,o),s.type=V.HorizontalMove;break;case Me.id:{const i=n.fromRange||new r.ObjectMatrix(n.from).getRange(),a=n.toRange||new r.ObjectMatrix(n.to).getRange();s=Ba(i,a,o)}break}return s?Array.isArray(s)?$e(s,o):$e([s],o):o}function Sr(o,e){var n,s,i,a,u,l;const{selectionManagerService:t}=e;switch(o.id){case O.MoveColsCommandId:{const d=o.params;return[d.fromRange,{...d.toRange,startColumn:d.toRange.startColumn-.5,endColumn:d.toRange.endColumn-.5}]}case O.MoveRowsCommandId:{const d=o.params;return[d.fromRange,{...d.toRange,startRow:d.toRange.startRow-.5,endRow:d.toRange.startRow-.5}]}case O.MoveRangeCommandId:{const d=o;return[d.params.fromRange,d.params.toRange]}case O.InsertRowCommandId:{const c=o.params.range;return[{...c,startRow:c.startRow-.5,endRow:c.endRow-.5}]}case O.InsertColCommandId:{const c=o.params.range;return[{...c,startColumn:c.startColumn-.5,endColumn:c.endColumn-.5}]}case O.RemoveRowCommandId:return[o.params.range];case O.RemoveColCommandId:return[o.params.range];case O.DeleteRangeMoveUpCommandId:case O.InsertRangeMoveDownCommandId:{const c=((n=o.params)==null?void 0:n.range)||((i=(s=t.getCurrentSelections())==null?void 0:s.map(m=>m.range))==null?void 0:i[0]);return c?[c]:[]}case O.DeleteRangeMoveLeftCommandId:case O.InsertRangeMoveRightCommandId:{const c=((a=o.params)==null?void 0:a.range)||((l=(u=t.getCurrentSelections())==null?void 0:u.map(m=>m.range))==null?void 0:l[0]);return c?[c]:[]}case O.ReorderRangeCommandId:{const d=o,{range:c,order:m}=d.params,h=[];for(let R=c.startRow;R<=c.endRow;R++)R in m&&h.push({startRow:R,endRow:R,startColumn:c.startColumn,endColumn:c.endColumn});return h}}}function Ja(o){switch(o.id){case Se.id:{const e=o.params;return[e.sourceRange,{...e.targetRange,startColumn:e.targetRange.startColumn-.5,endColumn:e.targetRange.startColumn-.5}]}case fe.id:{const e=o.params;return[e.sourceRange,{...e.targetRange,startRow:e.targetRange.startRow-.5,endRow:e.targetRange.startRow-.5}]}case Me.id:{const e=o.params;return[new r.ObjectMatrix(e.from.value).getRange(),new r.ObjectMatrix(e.to.value).getRange()]}case ae.id:{const t=o.params.range;return[{...t,startColumn:t.startColumn-.5,endColumn:t.startColumn-.5}]}case me.id:{const t=o.params.range;return[{...t,startRow:t.startRow-.5,endRow:t.startRow-.5}]}case oe.id:return[o.params.range];case he.id:return[o.params.range]}}function Xa(o,e){var s,i,a,u,l,d;const t=o.get(r.IUniverInstanceService),n=o.get(g.SheetsSelectionsService);switch(e.id){case O.MoveColsCommandId:{const c=e.params,m=k(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startColumn:c.fromRange.startColumn<c.toRange.startColumn?c.fromRange.endColumn+1:c.toRange.startColumn,endColumn:c.fromRange.startColumn<c.toRange.startColumn?c.toRange.endColumn-1:c.fromRange.startColumn-1}]}}case O.MoveRowsCommandId:{const c=e.params,m=k(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startRow:c.fromRange.startRow<c.toRange.startRow?c.fromRange.endRow+1:c.toRange.startRow,endRow:c.fromRange.startRow<c.toRange.startRow?c.toRange.endRow-1:c.fromRange.startRow-1}]}}case O.MoveRangeCommandId:{const c=e.params,m=k(t);return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,c.toRange]}}case O.InsertRowCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startRow>0?[{...m,startRow:m.startRow-1,endRow:m.endRow-1}]:[],{...m,startRow:m.startRow,endRow:Number.MAX_SAFE_INTEGER}]}}case O.InsertColCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startColumn>0?[{...m,startColumn:m.startColumn-1,endColumn:m.endColumn-1}]:[],{...m,startColumn:m.startColumn,endColumn:Number.MAX_SAFE_INTEGER}]}}case O.RemoveRowCommandId:{const m=e.params.range,h=k(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startRow:m.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}}case O.RemoveColCommandId:{const m=e.params.range,h=k(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}}case O.DeleteRangeMoveUpCommandId:case O.InsertRangeMoveDownCommandId:{const c=e,m=k(t),h=((s=c.params)==null?void 0:s.range)||((a=(i=n.getCurrentSelections())==null?void 0:i.map(R=>R.range))==null?void 0:a[0]);return h?{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[h,{...h,startRow:h.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}:{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[]}}case O.DeleteRangeMoveLeftCommandId:case O.InsertRangeMoveRightCommandId:{const m=((u=e.params)==null?void 0:u.range)||((d=(l=n.getCurrentSelections())==null?void 0:l.map(R=>R.range))==null?void 0:d[0]),h=k(t);return m?{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}:{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[]}}case O.ReorderRangeCommandId:{const c=e,{range:m,order:h}=c.params,R=[];for(let f=m.startRow;f<=m.endRow;f++)f in h&&R.push({startRow:f,endRow:f,startColumn:m.startColumn,endColumn:m.endColumn});const C=k(t);return{unitId:C.unitId,subUnitId:C.subUnitId,ranges:R}}}}var Za=Object.defineProperty,Qa=Object.getOwnPropertyDescriptor,eu=(o,e,t,n)=>{for(var s=n>1?void 0:n?Qa(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Za(e,t,s),s},Kt=(o,e)=>(t,n)=>e(t,n,o);const tu=r.createInterceptorKey("MERGE_REDO"),nu=r.createInterceptorKey("MERGE_UNDO"),vr=Math.floor(Number.MAX_SAFE_INTEGER/10);class ou extends r.Disposable{constructor(e,t,n,s,i=!1){super(),this._unitId=e,this._subUnitId=t,this._range=n,this._callback=s,this._skipIntersects=i}onMutation(e){var s,i;if(((s=e.params)==null?void 0:s.unitId)!==this._unitId)return;if(e.id===Me.id){const a=e.params;if(a.from.subUnitId!==this._subUnitId||a.to.subUnitId!==this._subUnitId)return}else if(((i=e.params)==null?void 0:i.subUnitId)!==this._subUnitId)return;if(!this._range)return;if(this._skipIntersects){if(e.id===Ne.id)return;const a=Ja(e);if(a!=null&&a.some(u=>r.Rectangle.intersects(u,this._range)))return}const t=fr(this._range,e);if(t&&r.Rectangle.equals(t,this._range))return!1;const n=this._range;this._range=t,this._callback(n,t)}}g.RefRangeService=class extends r.Disposable{constructor(t,n,s,i){super();S(this,"interceptor",new r.InterceptorManager({MERGE_REDO:tu,MERGE_UNDO:nu}));S(this,"_watchRanges",new Set);S(this,"_refRangeManagerMap",new Map);S(this,"_serializer",su());S(this,"_onRefRangeChange",()=>{this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET).getActiveSheet(),s=Ir(this._univerInstanceService),i=pr(this._univerInstanceService);if(!n||!s||!i)return{redos:[],undos:[],preRedos:[],preUndos:[]};const l=((()=>{switch(t.id){case O.MoveColsCommandId:{const R=t.params,C=Math.min(R.fromRange.startColumn,R.toRange.startColumn);return this._checkRange([{...R.fromRange,startColumn:C,endColumn:n.getColumnCount()-1}],s,i)}case O.MoveRowsCommandId:{const R=t.params,C=Math.min(R.fromRange.startRow,R.toRange.startRow);return this._checkRange([{...R.fromRange,startRow:C,endRow:n.getRowCount()-1}],s,i)}case O.MoveRangeCommandId:{const R=t;return this._checkRange([R.params.fromRange,R.params.toRange],s,i)}case O.InsertRowCommandId:{const f={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW};return this._checkRange([f],s,i)}case O.InsertColCommandId:{const C=t.params.range.startColumn,f={startRow:0,endRow:n.getRowCount()-1,startColumn:C,endColumn:n.getColumnCount()-1,rangeType:r.RANGE_TYPE.COLUMN};return this._checkRange([f],s,i)}case O.RemoveRowCommandId:{const f={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW};return this._checkRange([f],s,i)}case O.RemoveColCommandId:{const C=t.params.range.startColumn,f={startRow:0,endRow:n.getRowCount()-1,startColumn:C,endColumn:n.getColumnCount()-1,rangeType:r.RANGE_TYPE.COLUMN};return this._checkRange([f],s,i)}case O.DeleteRangeMoveUpCommandId:case O.InsertRangeMoveDownCommandId:{const C=t.params.range||Mr(this._selectionManagerService)[0],f={startRow:C.startRow,startColumn:C.startColumn,endColumn:C.endColumn,endRow:vr};return this._checkRange([f],s,i)}case O.DeleteRangeMoveLeftCommandId:case O.InsertRangeMoveRightCommandId:{const C=t.params.range||Mr(this._selectionManagerService)[0],f={startRow:C.startRow,startColumn:C.startColumn,endColumn:vr,endRow:C.endRow};return this._checkRange([f],s,i)}case O.ReorderRangeCommandId:{const R=t,{range:C,order:f}=R.params,v=[];for(let I=C.startRow;I<=C.endRow;I++)I in f&&v.push({startRow:I,endRow:I,startColumn:C.startColumn,endColumn:C.endColumn});return this._checkRange(v,s,i)}}})()||[]).reduce((R,C)=>{const f=C(t);return R.push(f),R},[]).reduce((R,C)=>{var f,v;return R.redos.push(...C.redos),R.undos.push(...C.undos),R.preRedos.push(...(f=C.preRedos)!=null?f:[]),R.preUndos.push(...(v=C.preUndos)!=null?v:[]),R},{redos:[],undos:[],preUndos:[],preRedos:[]}),d=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(l.preRedos,null)||[],c=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(l.redos,null)||[],m=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(l.preUndos,null)||[],h=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(l.undos,null)||[];return{redos:c,undos:h,preRedos:d,preUndos:m}}})});S(this,"_checkRange",(t,n,s)=>{const i=wr(n,s),a=this._refRangeManagerMap.get(i);if(a){const u=new Set;return[...a.keys()].forEach(d=>{const c=a.get(d),m=this._serializer.deserialize(d),h={...m,startRow:+m.startRow,endRow:+m.endRow,startColumn:+m.startColumn,endColumn:+m.endColumn,rangeType:m.rangeType&&+m.rangeType};t.some(R=>r.Rectangle.intersects(R,h))&&c&&c.forEach(R=>{u.add(R)})}),[...u]}return[]});S(this,"registerRefRange",(t,n,s,i)=>{const a=s||Ir(this._univerInstanceService),u=i||pr(this._univerInstanceService);if(!a||!u)return r.toDisposable(()=>{});const l=wr(a,u),d=this._serializer.serialize(t);let c=this._refRangeManagerMap.get(l);c||(c=new Map,this._refRangeManagerMap.set(l,c));const m=c.get(d);return m?m.add(n):c.set(d,new Set([n])),r.toDisposable(()=>{const h=c.get(d);h&&(h.delete(n),h.size||(c.delete(d),c.size||this._refRangeManagerMap.delete(l)))})});this._commandService=t,this._sheetInterceptorService=n,this._univerInstanceService=s,this._selectionManagerService=i,this._onRefRangeChange(),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_REDO,{priority:-1,handler:a=>a}),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_UNDO,{priority:-1,handler:a=>a})}watchRange(t,n,s,i,a){let u;this._watchRanges.size===0&&(u=this._commandService.onCommandExecuted(m=>{if(m.type!==r.CommandType.MUTATION)return!1;for(const h of this._watchRanges)h.onMutation(m)}));const l=new ou(t,n,s,i,a);this._watchRanges.add(l);const d=r.toDisposable(()=>{this._watchRanges.delete(l),this._watchRanges.size===0&&(u==null||u.dispose(),u=null)}),c=this.disposeWithMe(d);return r.toDisposable(()=>{c.dispose(),d.dispose()})}},g.RefRangeService=eu([Kt(0,r.ICommandService),Kt(1,r.Inject(g.SheetInterceptorService)),Kt(2,r.Inject(r.IUniverInstanceService)),Kt(3,r.Inject(g.SheetsSelectionsService))],g.RefRangeService);function Ir(o){return o.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET).getUnitId()}function pr(o){var e;return(e=o.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()}function Mr(o){var e;return((e=o.getCurrentSelections())==null?void 0:e.map(t=>t.range))||[]}function wr(o,e){return`${o}_${e}`}function su(){const o=["startRow","startColumn","endRow","endColumn","rangeType"],e="_";return{deserialize:t=>{const n=o.reduce((i,a,u)=>(i[String(u)]=a,i),{});return t.split(e).reduce((i,a,u)=>{const l=String(u);return a&&n[l]&&(i[n[l]]=a),i},{})},serialize:t=>o.reduce((n,s,i)=>{const a=t[s];return a!==void 0?`${n}${i>0?e:""}${a}`:`${n}`},"")}}var ru=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,au=(o,e,t,n)=>{for(var s=n>1?void 0:n?iu(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ru(e,t,s),s},st=(o,e)=>(t,n)=>e(t,n,o);const uu=[ae.id,me.id,oe.id,he.id],lu=[fe.id,Se.id];function vo(o,e){let t=o;if(e!==void 0){const n=[];for(let s=0;s<t.length;s++){const{startRow:i,endRow:a,startColumn:u,endColumn:l}=t[s];if(e===r.Dimension.ROWS)for(let d=i;d<=a;d++){const c={startRow:d,endRow:d,startColumn:u,endColumn:l};n.push(c)}else if(e===r.Dimension.COLUMNS)for(let d=u;d<=l;d++){const c={startRow:i,endRow:a,startColumn:d,endColumn:d};n.push(c)}}t=n}return t}const _r=r.createInterceptorKey("mergeCellPermissionCheck");g.MergeCellController=class extends r.Disposable{constructor(t,n,s,i,a,u){super();S(this,"disposableCollection",new r.DisposableCollection);S(this,"interceptor",new r.InterceptorManager({MERGE_CELL_INTERCEPTOR_CHECK:_r}));this._commandService=t,this._refRangeService=n,this._univerInstanceService=s,this._injector=i,this._sheetInterceptorService=a,this._selectionManagerService=u,this._onRefRangeChange(),this._initCommandInterceptor(),this._commandExecutedListener()}_initCommandInterceptor(){const t=this;this._sheetInterceptorService.interceptCommand({getMutations(n){var s;switch(n.id){case yt.id:case bt.id:{const i=t._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET),a=i.getUnitId(),u=i==null?void 0:i.getActiveSheet();if(!u)return{redos:[],undos:[]};const l=u.getSheetId(),d=u.getConfig().mergeData,c=(s=t._selectionManagerService.getCurrentSelections())==null?void 0:s.map(m=>m.range);if(c&&c.length>0&&c.some(h=>d.some(R=>r.Rectangle.intersects(R,h)))){const h={unitId:a,subUnitId:l,ranges:c},R=ee(t._injector,h),C=[{id:G.id,params:h}],f=[{id:H.id,params:R}];return{redos:C,undos:f}}}}return{redos:[],undos:[]}}}),this._sheetInterceptorService.interceptRanges({getMutations:({unitId:n,subUnitId:s,ranges:i})=>{const a=[],u=[],l={redos:a,undos:u};if(!i||!i.length)return l;const d=k(this._univerInstanceService,{unitId:n,subUnitId:s});if(!d)return l;const{worksheet:c}=d,h=c.getMergeData().filter(R=>i.some(C=>r.Rectangle.intersects(R,C)));return h.length?(a.push({id:G.id,params:{unitId:n,subUnitId:s,ranges:h}}),u.push({id:H.id,params:{unitId:n,subUnitId:s,ranges:h}}),{undos:u,redos:a}):l}})}refRangeHandle(t,n,s){switch(t.id){case O.MoveColsCommandId:{const i=t.params;return this._handleMoveColsCommand(i,n,s)}case O.MoveRowsCommandId:{const i=t.params;return this._handleMoveRowsCommand(i,n,s)}case we.id:{const i=t.params,a=i.unitId||n,u=i.subUnitId||s;return this._handleInsertRowCommand(i,a,u)}case _e.id:{const i=t.params,a=i.unitId||n,u=i.subUnitId||s;return this._handleInsertColCommand(i,a,u)}case qe.id:{const i=t.params;return this._handleRemoveColCommand(i,n,s)}case Ge.id:{const i=t.params;return this._handleRemoveRowCommand(i,n,s)}case je.id:{const i=t.params;return this._handleMoveRangeCommand(i,n,s)}case Nt.id:{const i=t.params;return this._handleInsertRangeMoveRightCommand(i,n,s)}case ht.id:{const i=t.params;return this._handleInsertRangeMoveDownCommand(i,n,s)}case He.id:{const i=t.params;return this._handleDeleteRangeMoveUpCommand(i,n,s)}case Fe.id:{const i=t.params;return this._handleDeleteRangeMoveLeftCommand(i,n,s)}}return{redos:[],undos:[]}}_onRefRangeChange(){const t=(n,s)=>{const i=this._univerInstanceService.getUniverSheetInstance(n);if(!i)return;const a=i==null?void 0:i.getSheetBySheetId(s);if(!a)return;this.disposableCollection.dispose();const u=a.getMergeData(),l=d=>this.refRangeHandle(d,n,s);u.forEach(d=>{this.disposableCollection.add(this._refRangeService.registerRefRange(d,l,n,s))})};this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===et.id){const s=n.params,i=s.subUnitId,a=s.unitId;if(!i||!a)return;t(a,i)}if(n.id===H.id){const s=n.params,i=s.subUnitId,a=s.unitId;if(!i||!a)return;t(s.unitId,s.subUnitId)}})),this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_SHEET).pipe(W.first(n=>!!n)).subscribe(n=>{const s=n.getActiveSheet();s&&t(n.getUnitId(),s.getSheetId())})}_handleMoveRowsCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=[...a.getMergeData()],l={unitId:n,subUnitId:s,ranges:[]},d={unitId:n,subUnitId:s,ranges:[]},{fromRange:c}=t,{startRow:m,endRow:h}=c;if(u.forEach(f=>{if(m<=f.startRow&&h>=f.endRow){l.ranges.push(f);const v=go({id:O.MoveRowsCommandId,params:t},f),I=$e(v,f);I&&d.ranges.push(I)}}),l.ranges.length===0)return this._handleNull();const R=ee(this._injector,l),C=se(this._injector,d);return{preRedos:[{id:G.id,params:l}],redos:[{id:H.id,params:d}],preUndos:[{id:G.id,params:C}],undos:[{id:H.id,params:R}]}}_handleMoveColsCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=[...a.getMergeData()],l={unitId:n,subUnitId:s,ranges:[]},d={unitId:n,subUnitId:s,ranges:[]},{fromRange:c}=t,{startColumn:m,endColumn:h}=c;if(u.forEach(f=>{if(m<=f.startColumn&&h>=f.endColumn){l.ranges.push(f);const v=Ro({id:O.MoveColsCommandId,params:t},f),I=$e(v,f);I&&d.ranges.push(I)}}),l.ranges.length===0)return this._handleNull();const R=ee(this._injector,l),C=se(this._injector,d);return{preRedos:[{id:G.id,params:l}],redos:[{id:H.id,params:d}],preUndos:[{id:G.id,params:C}],undos:[{id:H.id,params:R}]}}_handleMoveRangeCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=a.getMergeData(),l=u.filter(C=>r.Rectangle.intersects(C,t.fromRange)),d=u.filter(C=>r.Rectangle.intersects(C,t.toRange)),c=l.map(C=>r.Rectangle.getRelativeRange(C,t.fromRange)).map(C=>r.Rectangle.getPositionRange(C,t.toRange)),m=vo(c).filter(C=>!u.some(f=>r.Rectangle.equals(C,f))),h=[{id:G.id,params:{unitId:n,subUnitId:s,ranges:l}},{id:G.id,params:{unitId:n,subUnitId:s,ranges:d}},{id:H.id,params:{unitId:n,subUnitId:s,ranges:m}}],R=[{id:G.id,params:{unitId:n,subUnitId:s,ranges:m}},{id:H.id,params:{unitId:n,subUnitId:s,ranges:d}},{id:H.id,params:{unitId:n,subUnitId:s,ranges:l}}];return{redos:h,undos:R}}_handleInsertRowCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const{range:u}=t,{startRow:l,endRow:d}=u,c=r.Tools.deepClone(a.getMergeData()).reduce((p,w)=>(l>w.startRow&&l<=w.endRow&&p.push(w),p),[]);if(c.length===0)return this._handleNull();const m=r.Tools.deepClone(a.getMergeData()).reduce((p,w)=>{if(l>w.startRow&&l<=w.endRow){const M=d-l+1;w.endRow+=M,this._checkIsMergeCell(w)&&p.push(w)}return p},[]),h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C),v=[{id:G.id,params:h},{id:H.id,params:C}],I=[{id:G.id,params:f},{id:H.id,params:R}];return{redos:v,undos:I}}_handleInsertColCommand(t,n,s){const{range:i}=t,a=ue(this._univerInstanceService,n);if(!a)return this._handleNull();const u=le(a,s);if(!u)return this._handleNull();const{startColumn:l,endColumn:d}=i,c=r.Tools.deepClone(u.getMergeData()).reduce((p,w)=>(l>w.startColumn&&l<=w.endColumn&&p.push(w),p),[]);if(c.length===0)return this._handleNull();const m=r.Tools.deepClone(u.getMergeData()).reduce((p,w)=>{if(l>w.startColumn&&l<=w.endColumn){const M=d-l+1;w.endColumn+=M,this._checkIsMergeCell(w)&&p.push(w)}return p},[]),h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C),v=[{id:G.id,params:h},{id:H.id,params:C}],I=[{id:G.id,params:f},{id:H.id,params:R}];return{redos:v,undos:I}}_handleRemoveColCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const{range:u}=t,{startColumn:l,endColumn:d}=u,c=r.Tools.deepClone(a.getMergeData()).reduce((M,_)=>(r.Rectangle.intersects(u,_)&&M.push(_),M),[]);if(c.length===0)return this._handleNull();const m=r.Tools.deepClone(a.getMergeData()).reduce((M,_)=>{if(r.Rectangle.intersects(u,_)){if(l<=_.startColumn&&d>=_.endColumn)return M;l>=_.startColumn&&d<=_.endColumn?_.endColumn-=d-l+1:l<_.startColumn?(_.startColumn=l,_.endColumn-=d-l+1):d>_.endColumn&&(_.endColumn=l-1),this._checkIsMergeCell(_)&&M.push(_)}return M},[]),h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C),v=[{id:G.id,params:h}],I=[{id:H.id,params:C}],p=[{id:G.id,params:f}],w=[{id:H.id,params:R}];return{preUndos:p,undos:w,preRedos:v,redos:I}}_handleRemoveRowCommand(t,n,s){const{range:i}=t,a=ue(this._univerInstanceService,n);if(!a)return this._handleNull();const u=le(a,s);if(!u)return this._handleNull();const{startRow:l,endRow:d}=i,c=r.Tools.deepClone(u.getMergeData()).reduce((M,_)=>(r.Rectangle.intersects(i,_)&&M.push(_),M),[]);if(c.length===0)return this._handleNull();const m=r.Tools.deepClone(u.getMergeData()).reduce((M,_)=>{if(r.Rectangle.intersects(i,_)){if(l<=_.startRow&&d>=_.endRow)return M;l>=_.startRow&&d<=_.endRow?_.endRow-=d-l+1:l<_.startRow?(_.startRow=l,_.endRow-=d-l+1):d>_.endRow&&(_.endRow=l-1),this._checkIsMergeCell(_)&&M.push(_)}return M},[]),h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C),v=[{id:G.id,params:h}],I=[{id:H.id,params:C}],p=[{id:G.id,params:f}],w=[{id:H.id,params:R}];return{preUndos:p,undos:w,preRedos:v,redos:I}}_handleInsertRangeMoveRightCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=t.range,l=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:p,startColumn:w,endColumn:M}=u;if(r.Rectangle.intersects({startRow:I,startColumn:w,endRow:p,endColumn:l},v)&&(c.push(v),r.Rectangle.contains({startRow:I,startColumn:w,endRow:p,endColumn:l},v))){const E=M-w+1;m.push({startRow:v.startRow,startColumn:v.startColumn+E,endRow:v.endRow,endColumn:v.endColumn+E})}});const h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C);return{preRedos:[{id:G.id,params:h}],redos:[{id:H.id,params:C}],preUndos:[{id:G.id,params:f}],undos:[{id:H.id,params:R}]}}_handleInsertRangeMoveDownCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=t.range,l=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(M=>{const{startRow:_,startColumn:b,endColumn:E,endRow:T}=u;if(r.Rectangle.intersects({startRow:_,startColumn:b,endRow:l,endColumn:E},M)&&(c.push(M),r.Rectangle.contains({startRow:_,startColumn:b,endRow:l,endColumn:E},M))){const N=T-_+1;m.push({startRow:M.startRow+N,startColumn:M.startColumn,endRow:M.endRow+N,endColumn:M.endColumn})}});const h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C),v=[{id:G.id,params:h}],I=[{id:H.id,params:C}],p=[{id:G.id,params:f}],w=[{id:H.id,params:R}];return{redos:I,undos:w,preRedos:v,preUndos:p}}_handleDeleteRangeMoveUpCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=t.range,l=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(M=>{const{startRow:_,startColumn:b,endColumn:E,endRow:T}=u;if(r.Rectangle.intersects({startRow:_,startColumn:b,endRow:l,endColumn:E},M)&&(c.push(M),r.Rectangle.contains({startRow:_,startColumn:b,endRow:l,endColumn:E},M))){const N=T-_+1,A=r.Rectangle.moveVertical(M,-N);m.push(A)}});const h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C),v=[{id:G.id,params:h}],I=[{id:H.id,params:C}],p=[{id:G.id,params:f}],w=[{id:H.id,params:R}];return{redos:I,undos:w,preRedos:v,preUndos:p}}_handleDeleteRangeMoveLeftCommand(t,n,s){const i=ue(this._univerInstanceService,n);if(!i)return this._handleNull();const a=le(i,s);if(!a)return this._handleNull();const u=t.range,l=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:p,startColumn:w,endColumn:M}=u;if(r.Rectangle.intersects({startRow:I,startColumn:w,endRow:p,endColumn:l},v)&&(c.push(v),r.Rectangle.contains({startRow:I,startColumn:w,endRow:p,endColumn:l},v))){const E=M-w+1;m.push({startRow:v.startRow,startColumn:v.startColumn-E,endRow:v.endRow,endColumn:v.endColumn-E})}});const h={unitId:n,subUnitId:s,ranges:c},R=ee(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},f=se(this._injector,C);return{preRedos:[{id:G.id,params:h}],redos:[{id:H.id,params:C}],undos:[{id:H.id,params:R}],preUndos:[{id:G.id,params:f}]}}_checkIsMergeCell(t){return!(t.startRow===t.endRow&&t.startColumn===t.endColumn)}_handleNull(){return{redos:[],undos:[]}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(lu.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const{sourceRange:i,targetRange:a}=t.params,u=i.startColumn===a.startColumn&&i.endColumn===a.endColumn,l=u?i.endRow-i.startRow+1:i.endColumn-i.startColumn+1,d=u?i.startRow:i.startColumn,c=u?a.startRow:a.startColumn,m=s.getConfig().mergeData,h=[];m.forEach(v=>{let{startRow:I,endRow:p,startColumn:w,endColumn:M,rangeType:_}=v;r.Rectangle.intersects(v,i)||(u?d<I&&c>p?(I-=l,p-=l):d>p&&c<=I&&(I+=l,p+=l):d<w&&c>M?(w-=l,M-=l):d>M&&c<=w&&(w+=l,M+=l)),v.startRow===v.endRow&&v.startColumn===v.endColumn||h.push({startRow:I,endRow:p,startColumn:w,endColumn:M,rangeType:_})}),s.setMergeData(h),this.disposableCollection.dispose();const{unitId:R,subUnitId:C}=t.params,f=v=>this.refRangeHandle(v,R,C);h.forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,f,R,C))})}if(uu.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const i=s.getConfig().mergeData,a=t.params;if(!a)return;const{range:u}=a,l=t.id.includes("row"),d=t.id.includes("insert"),c=l?u.startRow:u.startColumn,m=l?u.endRow:u.endColumn,h=m-c+1,R=[];i.forEach(I=>{let{startRow:p,endRow:w,startColumn:M,endColumn:_,rangeType:b}=I;d?l?c<=p&&(p+=h,w+=h):c<=M&&(M+=h,_+=h):l?m<p&&(p-=h,w-=h):m<M&&(M-=h,_-=h),I.startRow===I.endRow&&I.startColumn===I.endColumn||R.push({startRow:p,endRow:w,startColumn:M,endColumn:_,rangeType:b})}),s.setMergeData(R),this.disposableCollection.dispose();const{unitId:C,subUnitId:f}=t.params,v=I=>this.refRangeHandle(I,C,f);R.forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,v,C,f))})}}))}},g.MergeCellController=au([st(0,r.Inject(r.ICommandService)),st(1,r.Inject(g.RefRangeService)),st(2,r.Inject(r.IUniverInstanceService)),st(3,r.Inject(r.Injector)),st(4,r.Inject(g.SheetInterceptorService)),st(5,r.Inject(g.SheetsSelectionsService))],g.MergeCellController);function ue(o,e){return e?o.getUniverSheetInstance(e):o.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET)}function le(o,e){return e?o.getSheetBySheetId(e):o.getActiveSheet()}var du=Object.defineProperty,cu=Object.getOwnPropertyDescriptor,mu=(o,e,t,n)=>{for(var s=n>1?void 0:n?cu(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&du(e,t,s),s},hu=(o,e)=>(t,n)=>e(t,n,o);let xt=class extends r.Disposable{constructor(o){super(),this._sheetInterceptorService=o,this._initialize()}_initialize(){this._initInterceptorCellContent()}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(Le.CELL_CONTENT,{priority:11,effect:r.InterceptorEffectEnum.Value|r.InterceptorEffectEnum.Style,handler:(o,e,t)=>{var s;const n=e.workbook.getStyles().getStyleByCell(o);return(s=n==null?void 0:n.n)!=null&&s.pattern?t({...o}):(o==null?void 0:o.t)===r.CellValueType.NUMBER&&typeof(o==null?void 0:o.v)=="number"?t({...o,v:z.stripErrorMargin(o.v)}):t({...o})}}))}};xt=mu([hu(0,r.Inject(g.SheetInterceptorService))],xt);var gu=Object.defineProperty,Ru=Object.getOwnPropertyDescriptor,Cu=(o,e,t,n)=>{for(var s=n>1?void 0:n?Ru(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&gu(e,t,s),s},yr=(o,e)=>(t,n)=>e(t,n,o);g.RangeProtectionRenderModel=class{constructor(e,t){S(this,"_cache",new r.LRUMap(1e4));this._selectionProtectionRuleModel=e,this._permissionService=t,this._init()}_init(){this._permissionService.permissionPointUpdate$.pipe(it.filter(e=>e.type===D.SelectRange),it.filter(e=>ge().some(t=>e instanceof t)),it.map(e=>e)).subscribe(e=>{const t=this._selectionProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId);for(const n of t)n.permissionId===e.permissionId&&n.ranges.forEach(s=>{r.Range.foreach(s,(i,a)=>{const u=this._createKey(e.unitId,e.subUnitId,i,a);this._cache.delete(u)})})}),this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{var t;e.rule.ranges.forEach(n=>{r.Range.foreach(n,(s,i)=>{const a=this._createKey(e.unitId,e.subUnitId,s,i);this._cache.delete(a)})}),e.type==="set"&&((t=e.oldRule)==null||t.ranges.forEach(n=>{r.Range.foreach(n,(s,i)=>{const a=this._createKey(e.unitId,e.subUnitId,s,i);this._cache.delete(a)})}))})}_createKey(e,t,n,s){return`${e}_${t}_${n}_${s}`}getCellInfo(e,t,n,s){const i=this._selectionProtectionRuleModel.getSubunitRuleList(e,t),a=[];if(!i||!i.length)return a;const u=this._createKey(e,t,n,s),l=this._cache.get(u);if(l)return l;const d=[];for(const c of i)if(c.ranges.some(m=>m.startRow<=n&&m.endRow>=n&&m.startColumn<=s&&m.endColumn>=s)){const m=ge().reduce((h,R)=>{var v;const C=new R(e,t,c.permissionId),f=this._permissionService.getPermissionPoint(C.id);return h[C.subType]=(v=f==null?void 0:f.value)!=null?v:C.value,h},{});d.push({...m,ruleId:c.id,ranges:c.ranges})}return this._cache.set(u,d),d}clear(){this._cache.clear()}},g.RangeProtectionRenderModel=Cu([yr(0,r.Inject(J)),yr(1,r.Inject(r.IPermissionService))],g.RangeProtectionRenderModel);var fu=Object.defineProperty,Su=Object.getOwnPropertyDescriptor,vu=(o,e,t,n)=>{for(var s=n>1?void 0:n?Su(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&fu(e,t,s),s},Io=(o,e)=>(t,n)=>e(t,n,o);g.RangeProtectionCache=class extends r.Disposable{constructor(t,n,s){super();S(this,"_cellRuleCache",new Map);S(this,"_permissionIdCache",new Map);S(this,"_cellInfoCache",new Map);S(this,"_rowInfoCache",new Map);S(this,"_colInfoCache",new Map);this._ruleModel=t,this._permissionService=n,this._univerInstanceService=s,this._initUpdateCellRuleCache(),this._initUpdateCellInfoCache(),this._initUpdateRowColInfoCache(),this._initCache()}_initCache(){this._univerInstanceService.getAllUnitsForType(r.UniverInstanceType.UNIVER_SHEET).forEach(t=>{t.getSheets().forEach(n=>{const s=t.getUnitId(),i=n.getSheetId();this.reBuildCache(s,i)})})}_initUpdateCellInfoCache(){this._permissionService.permissionPointUpdate$.pipe(W.filter(t=>t.type===D.SelectRange),W.map(t=>t)).subscribe(t=>{const{subUnitId:n,unitId:s,permissionId:i}=t,a=this._permissionIdCache.get(i);if(!a)return;const u=this._ruleModel.getRule(s,n,a);if(!u)return;const l=this._ensureCellInfoMap(s,n);u.ranges.forEach(d=>{const{startRow:c,endRow:m,startColumn:h,endColumn:R}=d;for(let C=c;C<=m;C++)for(let f=h;f<=R;f++)l.delete(`${C}-${f}`)})}),this._ruleModel.ruleChange$.subscribe(t=>{var a;const{unitId:n,subUnitId:s}=t,i=this._ensureCellInfoMap(n,s);t.rule.ranges.forEach(u=>{r.Range.foreach(u,(l,d)=>{i.delete(`${l}-${d}`)})}),t.type==="set"&&((a=t.oldRule)==null||a.ranges.forEach(u=>{r.Range.foreach(u,(l,d)=>{this._cellInfoCache.delete(`${l}-${d}`)})}))})}_initUpdateCellRuleCache(){this._ruleModel.ruleChange$.subscribe(t=>{const{type:n}=t;n==="add"?this._addCellRuleCache(t):n==="delete"?this._deleteCellRuleCache(t):(this._deleteCellRuleCache({...t,rule:t.oldRule}),this._addCellRuleCache(t))})}_ensureRuleMap(t,n){let s=this._cellRuleCache.get(t);s||(s=new Map,this._cellRuleCache.set(t,s));let i=s.get(n);return i||(i=new Map,s.set(n,i)),i}_ensureCellInfoMap(t,n){let s=this._cellInfoCache.get(t);s||(s=new Map,this._cellInfoCache.set(t,s));let i=s.get(n);return i||(i=new Map,s.set(n,i)),i}_ensureRowColInfoMap(t,n,s){let i=s==="row"?this._rowInfoCache.get(t):this._colInfoCache.get(t);i||(i=new Map,s==="row"?this._rowInfoCache.set(t,i):this._colInfoCache.set(t,i));let a=i.get(n);return a||(a=new Map,i.set(n,a)),a}_addCellRuleCache(t){const{subUnitId:n,unitId:s,rule:i}=t,a=this._ensureRuleMap(s,n);i.ranges.forEach(u=>{const{startRow:l,endRow:d,startColumn:c,endColumn:m}=u;for(let h=l;h<=d;h++)for(let R=c;R<=m;R++)a.set(`${h}-${R}`,i.id)}),this._permissionIdCache.set(i.permissionId,i.id)}_deleteCellRuleCache(t){const{subUnitId:n,unitId:s,rule:i}=t,a=this._ensureRuleMap(s,n),u=this._ensureCellInfoMap(s,n);i.ranges.forEach(l=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=l;for(let R=d;R<=c;R++)for(let C=m;C<=h;C++)a.delete(`${R}-${C}`),u.delete(`${R}-${C}`)}),this._permissionIdCache.delete(i.permissionId)}_getSelectionActions(t,n,s){var c,m,h,R,C,f,v,I,p,w,M,_;const i=(h=(m=this._permissionService.getPermissionPoint((c=new dt(t,n,s.permissionId))==null?void 0:c.id))==null?void 0:m.value)!=null?h:!0,a=(f=(C=this._permissionService.getPermissionPoint((R=new Et(t,n,s.permissionId))==null?void 0:R.id))==null?void 0:C.value)!=null?f:!0,u=(p=(I=this._permissionService.getPermissionPoint((v=new no(t,n,s.permissionId))==null?void 0:v.id))==null?void 0:I.value)!=null?p:!1,l=(_=(M=this._permissionService.getPermissionPoint((w=new to(t,n,s.permissionId))==null?void 0:w.id))==null?void 0:M.value)!=null?_:!1;return{[y.Edit]:i,[y.View]:a,[y.ManageCollaborator]:u,[y.Delete]:l}}reBuildCache(t,n){const s=this._ensureRuleMap(t,n),i=this._ensureCellInfoMap(t,n);s.clear(),i.clear();const a=this._ensureRowColInfoMap(t,n,"row"),u=this._ensureRowColInfoMap(t,n,"col");a.clear(),u.clear(),this._ruleModel.getSubunitRuleList(t,n).forEach(l=>{const d=this._getSelectionActions(t,n,l),c={...d,ruleId:l.id,ranges:l.ranges};l.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:C,endColumn:f}=m;for(let v=h;v<=R;v++){const I=a.get(`${v}`);I?I.set(l.id,d):a.set(`${v}`,new Map([[l.id,d]]));for(let p=C;p<=f;p++){s.set(`${v}-${p}`,l.id),i.set(`${v}-${p}`,c);const w=u.get(`${p}`);w?w.set(l.id,d):u.set(`${p}`,new Map([[l.id,d]]))}}}),this._permissionIdCache.set(l.permissionId,l.id)})}getRowPermissionInfo(t,n,s,i){var l;const a=(l=this._rowInfoCache.get(t))==null?void 0:l.get(n);if(!a)return!0;const u=a.get(`${s}`);return u?i.every(d=>{for(const c of u.values())if(c[d]===!1)return!1;return!0}):!0}getColPermissionInfo(t,n,s,i){var l;const a=(l=this._colInfoCache.get(t))==null?void 0:l.get(n);if(!a)return!0;const u=a.get(`${s}`);return u?i.every(d=>{for(const c of u.values())if(c[d]===!1)return!1;return!0}):!0}_initUpdateRowColInfoCache(){this._permissionService.permissionPointUpdate$.pipe(W.filter(t=>t.type===D.SelectRange),W.map(t=>t)).subscribe({next:t=>{const{subUnitId:n,unitId:s,permissionId:i}=t,a=this._permissionIdCache.get(i);if(!a)return;const u=this._ruleModel.getRule(s,n,a);if(!u)return;const l=this._ensureRowColInfoMap(s,n,"row"),d=this._ensureRowColInfoMap(s,n,"col"),c=this._getSelectionActions(s,n,u);u.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:C,endColumn:f}=m;for(let v=h;v<=R;v++){const I=l.get(`${v}`);I?I.set(a,c):l.set(`${v}`,new Map([[a,c]]));for(let p=C;p<=f;p++){const w=d.get(`${p}`);w?w.set(a,c):d.set(`${p}`,new Map([[a,c]]))}}})}}),this._ruleModel.ruleChange$.subscribe(t=>{if(t.type==="delete"){const{unitId:n,subUnitId:s,rule:i}=t,a=this._ensureRowColInfoMap(n,s,"row"),u=this._ensureRowColInfoMap(n,s,"col");i.ranges.forEach(l=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=l;for(let R=d;R<=c;R++){const C=a.get(`${R}`);C==null||C.delete(i.id);for(let f=m;f<=h;f++){const v=u.get(`${f}`);v==null||v.delete(i.id)}}})}})}getCellInfo(t,n,s,i){var c,m;const a=this._ensureCellInfoMap(t,n),u=a.get(`${s}-${i}`);if(u)return u;const l=(m=(c=this._cellRuleCache.get(t))==null?void 0:c.get(n))==null?void 0:m.get(`${s}-${i}`);if(!l)return;const d=this._ruleModel.getRule(t,n,l);if(d){const R={...this._getSelectionActions(t,n,d),ruleId:l,ranges:d.ranges};return a.set(`${s}-${i}`,R),R}}deleteUnit(t){this._cellRuleCache.delete(t),this._cellInfoCache.delete(t),this._rowInfoCache.delete(t),this._colInfoCache.delete(t);const n=this._univerInstanceService.getUnit(t);n==null||n.getSheets().forEach(s=>{const i=s.getSheetId();this._ruleModel.getSubunitRuleList(t,i).forEach(a=>{this._permissionIdCache.delete(a.permissionId)})})}},g.RangeProtectionCache=vu([Io(0,r.Inject(J)),Io(1,r.Inject(r.IPermissionService)),Io(2,r.Inject(r.IUniverInstanceService))],g.RangeProtectionCache);const po=r.createIdentifier("univer.exclusive-range-service");class br extends r.Disposable{constructor(){super(...arguments);S(this,"_exclusiveRanges",new Map);S(this,"_exclusiveRangesChange$",new W.Subject);S(this,"exclusiveRangesChange$",this._exclusiveRangesChange$.asObservable())}_ensureUnitMap(t){return this._exclusiveRanges.has(t)||this._exclusiveRanges.set(t,new Map),this._exclusiveRanges.get(t)}_ensureSubunitMap(t,n){const s=this._ensureUnitMap(t);return s.has(n)||s.set(n,new Map),s.get(n)}_ensureFeature(t,n,s){const i=this._ensureSubunitMap(t,n);return i.has(s)||i.set(s,[]),i.get(s)}addExclusiveRange(t,n,s,i){const a=this._ensureFeature(t,n,s);a.push(...i),this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:a.map(u=>u.range)})}getExclusiveRanges(t,n,s){var i,a;return(a=(i=this._exclusiveRanges.get(t))==null?void 0:i.get(n))==null?void 0:a.get(s)}clearExclusiveRanges(t,n,s){const i=this.getExclusiveRanges(t,n,s);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(i==null?void 0:i.map(a=>a.range))||[]}),this._ensureFeature(t,n,s),this._exclusiveRanges.get(t).get(n).set(s,[])}clearExclusiveRangesByGroupId(t,n,s,i){const a=this.getExclusiveRanges(t,n,s);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(a==null?void 0:a.map(l=>l.range))||[]});const u=this.getExclusiveRanges(t,n,s);if(u){const l=u.filter(d=>d.groupId!==i);this._exclusiveRanges.get(t).get(n).set(s,l)}}getInterestGroupId(t){const n=[];return t.forEach(s=>{var d;const i=s.range,{unitId:a,sheetId:u}=i;if(!a||!u)return;const l=(d=this._exclusiveRanges.get(a))==null?void 0:d.get(u);if(l)for(const c of l.keys()){const m=l.get(c);if(m){for(const h of m)if(r.Rectangle.intersects(i,h.range)){n.push(c);break}}}}),n}}var Iu=Object.defineProperty,pu=Object.getOwnPropertyDescriptor,Mu=(o,e,t,n)=>{for(var s=n>1?void 0:n?pu(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Iu(e,t,s),s},Mo=(o,e)=>(t,n)=>e(t,n,o);g.NumfmtService=class extends r.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._logService=n}getValue(e,t,n,s){const i=this._univerInstanceService.getUniverSheetInstance(e);if(!i)return;const a=i==null?void 0:i.getSheetBySheetId(t);if(!a)return;const u=i.getStyles(),l=a.getCellRaw(n,s);if(l!=null&&l.s){const d=u.get(l.s);if(d!=null&&d.n)return d.n}return null}deleteValues(e,t,n){const s=this._univerInstanceService.getUniverSheetInstance(e);if(!s)return;const i=s==null?void 0:s.getSheetBySheetId(t);if(!i)return;const a=s.getStyles();n.forEach(u=>{r.Range.foreach(u,(l,d)=>{const c=i.getCellRaw(l,d);if(!c)return;const m=c==null?void 0:c.s,R={...m&&a.get(m)||{}};delete R.n;const C=a.setValue(R);c.s=C})})}setValues(e,t,n){const s=this._univerInstanceService.getUniverSheetInstance(e);if(!s)return;const i=s==null?void 0:s.getSheetBySheetId(t);if(!i)return;const a=s.getStyles(),u=i.getCellMatrix();n.forEach(l=>{l.ranges.forEach(d=>{r.Range.foreach(d,(c,m)=>{const h=i.getCellRaw(c,m);if(h){const C={...a.getStyleByCell(h)||{},n:{pattern:l.pattern}},f=a.setValue(C);h.s=f,l.pattern===wo.DEFAULT_TEXT_FORMAT&&(h.t=r.CellValueType.STRING)}else{const R={n:{pattern:l.pattern}},C=a.setValue(R);C&&u.setValue(c,m,{s:C})}})})})}},g.NumfmtService=Mu([Mo(0,r.IResourceManagerService),Mo(1,r.IUniverInstanceService),Mo(2,r.ILogService)],g.NumfmtService);var wu=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,yu=(o,e,t,n)=>{for(var s=n>1?void 0:n?_u(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&wu(e,t,s),s},Te=(o,e)=>(t,n)=>e(t,n,o);const Ur=[ae.id,me.id,oe.id,he.id],Tr=[fe.id,Se.id];g.RangeProtectionRefRangeService=class extends r.Disposable{constructor(t,n,s,i,a,u,l,d){super();S(this,"disposableCollection",new r.DisposableCollection);this._selectionProtectionRuleModel=t,this._univerInstanceService=n,this._commandService=s,this._refRangeService=i,this._selectionProtectionRenderModel=a,this._rangeProtectionCache=u,this._sheetInterceptorService=l,this._rangeProtectionRuleModel=d,this._onRefRangeChange(),this._correctPermissionRange(),this._initReBuildCache(),this._initRemoveSheet()}_onRefRangeChange(){const t=(s,i)=>{const a=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!a||!(a==null?void 0:a.getSheetBySheetId(i)))return;this.disposableCollection.dispose();const l=c=>this.refRangeHandle(c,s,i);this._selectionProtectionRuleModel.getSubunitRuleList(s,i).reduce((c,m)=>[...c,...m.ranges],[]).forEach(c=>{this.disposableCollection.add(this._refRangeService.registerRefRange(c,l,s,i))})};this.disposeWithMe(this._commandService.onCommandExecuted(s=>{if(s.id===Xn.id){const i=s.params,a=i.subUnitId,u=i.unitId;if(!a||!u)return;t(u,a)}if(s.id===K.id||s.id===ie.id){const i=s.params,a=i.subUnitId,u=i.unitId;if(!a||!u)return;t(u,a)}}));const n=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(n){const s=n.getActiveSheet();if(!s)return;t(n.getUnitId(),s.getSheetId())}}refRangeHandle(t,n,s){switch(t.id){case Ot.id:return this._getRefRangeMutationsByMoveRows(t.params,n,s);case Dt.id:return this._getRefRangeMutationsByMoveCols(t.params,n,s);case we.id:return this._getRefRangeMutationsByInsertRows(t.params,n,s);case _e.id:return this._getRefRangeMutationsByInsertCols(t.params,n,s);case qe.id:return this._getRefRangeMutationsByDeleteCols(t.params,n,s);case Ge.id:return this._getRefRangeMutationsByDeleteRows(t.params,n,s)}return{redos:[],undos:[]}}_getRefRangeMutationsByDeleteCols(t,n,s){const i=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(u=>u.ranges.some(l=>r.Rectangle.intersects(l,t.range))),a=t.range;if(i.length){const u=[],l=[];return i.forEach(d=>{const c=r.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(r.Rectangle.intersects(R,a)){const C=r.Tools.deepClone(R),{startColumn:f,endColumn:v}=a;if(f<=C.startColumn&&v>=C.endColumn)return h;f>=C.startColumn&&v<=C.endColumn?C.endColumn-=v-f+1:f<C.startColumn?(C.startColumn=f,C.endColumn-=v-f+1):v>C.endColumn&&(C.endColumn=f-1),this._checkIsRightRange(C)&&h.push(C)}return h},[]);c.ranges=m,c.ranges.length?(u.push({id:K.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:d.id}}),l.push({id:K.id,params:{unitId:n,subUnitId:s,rule:d,ruleId:d.id}})):(u.push({id:de.id,params:{unitId:n,subUnitId:s,ruleIds:[d.id]}}),l.push({id:ie.id,params:{unitId:n,subUnitId:s,name:"",rules:[d]}}))}),{redos:u,undos:l}}return{undos:[],redos:[]}}_getRefRangeMutationsByDeleteRows(t,n,s){const i=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(u=>u.ranges.some(l=>r.Rectangle.intersects(l,t.range))),a=t.range;if(i.length){const u=[],l=[];return i.forEach(d=>{const c=r.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(r.Rectangle.intersects(R,a)){const C=r.Tools.deepClone(R),{startRow:f,endRow:v}=a;if(f<=C.startRow&&v>=C.endRow)return h;f>=C.startRow&&v<=C.endRow?C.endRow-=v-f+1:f<C.startRow?(C.startRow=f,C.endRow-=v-f+1):v>C.endRow&&(C.endRow=f-1),this._checkIsRightRange(C)&&h.push(C)}return h},[]);c.ranges=m,u.push({id:K.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:d.id}}),l.push({id:K.id,params:{unitId:n,subUnitId:s,rule:d,ruleId:d.id}})}),{redos:u,undos:l}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertCols(t,n,s){const i=t.range.startColumn,a=t.range.endColumn-t.range.startColumn+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(l=>l.ranges.some(d=>i>d.startColumn&&i<=d.endColumn));if(u.length){const l=[],d=[];return u.forEach(c=>{const m=r.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{i>R.startColumn&&i<=R.endColumn&&(R.endColumn+=a,h=!0)}),h&&(l.push({id:K.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:c.id}}),d.push({id:K.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:c.id}}))}),{redos:l,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertRows(t,n,s){const i=t.range.startRow,a=t.range.endRow-t.range.startRow+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(l=>l.ranges.some(d=>i>d.startRow&&i<=d.endRow));if(u.length){const l=[],d=[];return u.forEach(c=>{const m=r.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{i>R.startRow&&i<=R.endRow&&(R.endRow+=a,h=!0)}),h&&(l.push({id:K.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:c.id}}),d.push({id:K.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:c.id}}))}),{redos:l,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveRows(t,n,s){const i=t.toRange,a=i.startRow,u=i.endRow-i.startRow+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(d=>d.ranges.some(c=>a>c.startRow&&a<=c.endRow));if(l.length){const d=[],c=[];return l.forEach(m=>{const h=r.Tools.deepClone(m),C=t.fromRange.startRow;let f=!1;h.ranges.forEach(v=>{a>v.startRow&&a<=v.endRow&&(C<v.startRow&&(v.startRow=v.startRow-u,v.endRow=v.endRow-u),v.endRow+=u,f=!0)}),f&&(d.push({id:K.id,params:{unitId:n,subUnitId:s,rule:h,ruleId:m.id}}),c.push({id:K.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveCols(t,n,s){const i=t.toRange,a=i.startColumn,u=i.endColumn-i.startColumn+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(d=>d.ranges.some(c=>a>c.startColumn&&a<=c.endColumn));if(l.length){const d=[],c=[];return l.forEach(m=>{const h=r.Tools.deepClone(m),C=t.fromRange.startColumn;let f=!1;h.ranges.forEach(v=>{a>v.startColumn&&a<=v.endColumn&&(C<v.startColumn&&(v.startColumn=v.startColumn-u,v.endColumn=v.endColumn-u),v.endColumn+=u,f=!0)}),f&&(d.push({id:K.id,params:{unitId:n,subUnitId:s,rule:h,ruleId:m.id}}),c.push({id:K.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_correctPermissionRange(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(Tr.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const{sourceRange:i,targetRange:a}=t.params,u=i.startColumn===a.startColumn&&i.endColumn===a.endColumn,l=u?i.endRow-i.startRow+1:i.endColumn-i.startColumn+1,d=u?i.startRow:i.startColumn,c=u?a.startRow:a.startColumn;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),s.getSheetId()).forEach(v=>{v.ranges.forEach(p=>{let{startRow:w,endRow:M,startColumn:_,endColumn:b}=p;r.Rectangle.intersects(p,i)||(u?d<w&&c>M?(w-=l,M-=l):d>M&&c<=w&&(w+=l,M+=l):d<_&&c>b?(_-=l,b-=l):d>b&&c<=_&&(_+=l,b+=l)),this._checkIsRightRange({startRow:w,endRow:M,startColumn:_,endColumn:b})&&(p.startColumn=_,p.endColumn=b,p.startRow=w,p.endRow=M)})}),this.disposableCollection.dispose();const{unitId:h,subUnitId:R}=t.params,C=v=>this.refRangeHandle(v,h,R);this._selectionProtectionRuleModel.getSubunitRuleList(h,R).reduce((v,I)=>[...v,...I.ranges],[]).forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,C,h,R))}),this._selectionProtectionRenderModel.clear()}if(Ur.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const i=t.params;if(!i)return;const{range:a}=i,u=t.id.includes("row"),l=t.id.includes("insert"),d=u?a.startRow:a.startColumn,c=u?a.endRow:a.endColumn,m=c-d+1;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),s.getSheetId()).forEach(I=>{I.ranges.forEach(w=>{let{startRow:M,endRow:_,startColumn:b,endColumn:E}=w;l?u?d<=M&&(M+=m,_+=m):d<=b&&(b+=m,E+=m):u?c<M&&(M-=m,_-=m):c<b&&(b-=m,E-=m),this._checkIsRightRange({startRow:M,endRow:_,startColumn:b,endColumn:E})&&(w.startColumn=b,w.endColumn=E,w.startRow=M,w.endRow=_)})}),this.disposableCollection.dispose();const{unitId:R,subUnitId:C}=t.params,f=I=>this.refRangeHandle(I,R,C);this._selectionProtectionRuleModel.getSubunitRuleList(R,C).reduce((I,p)=>[...I,...p.ranges],[]).forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,f,R,C))}),this._selectionProtectionRenderModel.clear()}}))}_checkIsRightRange(t){return t.startRow<=t.endRow&&t.startColumn<=t.endColumn}_initReBuildCache(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(Ur.includes(t.id)||Tr.includes(t.id)){const{unitId:n,subUnitId:s}=t.params;this._rangeProtectionCache.reBuildCache(n,s)}}))}_initRemoveSheet(){this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=[],s=[],i=[],a=[];if(t.id===At.id){const u=t.params,l=[],d=[];this._rangeProtectionRuleModel.getSubunitRuleList(u.unitId,u.subUnitId).forEach(c=>{l.push(c.id),d.push(c)}),l.length&&d.length&&(i.push({id:de.id,params:{unitId:u.unitId,subUnitId:u.subUnitId,ruleIds:l}}),n.push({id:ie.id,params:{unitId:u.unitId,subUnitId:u.subUnitId,name:"",rules:d}}))}return{redos:s,undos:n,preRedos:i,preUndos:a}}})}},g.RangeProtectionRefRangeService=yu([Te(0,r.Inject(J)),Te(1,r.Inject(r.IUniverInstanceService)),Te(2,r.ICommandService),Te(3,r.Inject(g.RefRangeService)),Te(4,r.Inject(g.RangeProtectionRenderModel)),Te(5,r.Inject(g.RangeProtectionCache)),Te(6,r.Inject(g.SheetInterceptorService)),Te(7,r.Inject(J))],g.RangeProtectionRefRangeService);var bu=Object.defineProperty,Uu=Object.getOwnPropertyDescriptor,Tu=(o,e,t,n)=>{for(var s=n>1?void 0:n?Uu(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&bu(e,t,s),s},vt=(o,e)=>(t,n)=>e(t,n,o);const Eu="SHEET_RANGE_PROTECTION_PLUGIN";g.RangeProtectionService=class extends r.Disposable{constructor(e,t,n,s,i){super(),this._selectionProtectionRuleModel=e,this._permissionService=t,this._resourceManagerService=n,this._selectionProtectionCache=s,this._univerInstanceService=i,this._initSnapshot(),this._initRuleChange()}_initRuleChange(){this.disposeWithMe(this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":{ge().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(n)});break}case"delete":{ge().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.deletePermissionPoint(n.id)});break}case"set":{e.oldRule.permissionId!==e.rule.permissionId&&ge().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.oldRule.permissionId);this._permissionService.deletePermissionPoint(n.id);const s=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(s)});break}}}))}_initSnapshot(){const e=n=>{const i=this._selectionProtectionRuleModel.toObject()[n];return i?JSON.stringify(i):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Eu,businesses:[Tt.UNIVER_SHEET],onLoad:(n,s)=>{const i=this._selectionProtectionRuleModel.toObject();i[n]=s,this._selectionProtectionRuleModel.fromObject(i);const a=[];Object.keys(s).forEach(u=>{const l=s[u];this._selectionProtectionRuleModel.getSubunitRuleList(n,u).forEach(d=>{a.push({objectID:d.permissionId,unitID:n,objectType:D.SelectRange,actions:Gs})}),l.forEach(d=>{ge().forEach(c=>{const m=new c(n,u,d.permissionId);m.value=!1,this._permissionService.addPermissionPoint(m)})}),this._selectionProtectionCache.reBuildCache(n,u)})},onUnLoad:n=>{this._selectionProtectionCache.deleteUnit(n)}}))}},g.RangeProtectionService=Tu([vt(0,r.Inject(J)),vt(1,r.Inject(r.IPermissionService)),vt(2,r.Inject(r.IResourceManagerService)),vt(3,r.Inject(g.RangeProtectionCache)),vt(4,r.Inject(r.IUniverInstanceService))],g.RangeProtectionService);var Pu=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,Nu=(o,e,t,n)=>{for(var s=n>1?void 0:n?ku(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Pu(e,t,s),s},It=(o,e)=>(t,n)=>e(t,n,o);g.WorkbookPermissionService=class extends r.Disposable{constructor(e,t,n,s,i){super(),this._permissionService=e,this._univerInstanceService=t,this._rangeProtectionRuleModel=n,this._worksheetProtectionRuleModel=s,this._worksheetProtectionPointModel=i,this._init()}_init(){const e=t=>{const n=t.getUnitId();Ft().forEach(s=>{const i=new s(n);this._permissionService.addPermissionPoint(i)})};this._univerInstanceService.getAllUnitsForType(r.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(r.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{e(t)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(r.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=t.getUnitId();t.getSheets().forEach(s=>{const i=s.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,i).forEach(u=>{[...ge()].forEach(l=>{const d=new l(n,i,u.permissionId);this._permissionService.deletePermissionPoint(d.id)})}),[...Ie(),...nt()].forEach(u=>{const l=new u(n,i);this._permissionService.deletePermissionPoint(l.id)})}),Ft().forEach(s=>{const i=new s(n);this._permissionService.deletePermissionPoint(i.id)}),this._rangeProtectionRuleModel.deleteUnitModel(n),this._worksheetProtectionPointModel.deleteUnitModel(n),this._worksheetProtectionRuleModel.deleteUnitModel(n)}))}},g.WorkbookPermissionService=Nu([It(0,r.Inject(r.IPermissionService)),It(1,r.Inject(r.IUniverInstanceService)),It(2,r.Inject(J)),It(3,r.Inject(Ee)),It(4,r.Inject(ft))],g.WorkbookPermissionService);var Er=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,Du=(o,e,t)=>e in o?Er(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Au=(o,e,t,n)=>{for(var s=n>1?void 0:n?Ou(e,t):e,i=o.length-1,a;i>=0;i--)(a=o[i])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Er(e,t,s),s},Pr=(o,e)=>(t,n)=>e(t,n,o),kr=(o,e,t)=>Du(o,typeof e!="symbol"?e+"":e,t);const Wu="SHEET_PLUGIN";g.UniverSheetsPlugin=class extends r.Plugin{constructor(e=ar,t,n){super(),this._config=e,this._injector=t,this._configService=n;const{...s}=r.merge({},ar,this._config);this._configService.setConfig(Ea,s),this._initConfig(),this._initDependencies()}_initConfig(){var e,t;(e=this._config)!=null&&e.onlyRegisterFormulaRelatedMutations&&this._configService.setConfig(sr,!0),(t=this._config)!=null&&t.isRowStylePrecedeColumnStyle&&this._configService.setConfig(r.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE,!0)}_initDependencies(){var t;const e=[[Oe],[g.SheetsSelectionsService],[g.RefRangeService],[g.WorkbookPermissionService],[Ae,{useClass:g.NumfmtService}],[g.SheetInterceptorService],[qt],[g.MergeCellController],[xt],[g.DefinedNameDataController],[g.WorksheetPermissionService],[Ee],[ft],[g.RangeProtectionRenderModel],[J],[g.RangeProtectionCache],[g.RangeProtectionRefRangeService],[g.RangeProtectionService],[po,{useClass:br,deps:[g.SheetsSelectionsService]}]];(t=this._config)!=null&&t.notExecuteFormula||e.push([Yt]),r.registerDependencies(this._injector,r.mergeOverrideWithDependencies(e,this._config.override)),r.touchDependencies(this._injector,[[g.SheetInterceptorService],[g.RangeProtectionService],[po]])}onStarting(){r.touchDependencies(this._injector,[[qt],[g.MergeCellController],[g.WorkbookPermissionService],[g.WorksheetPermissionService]])}onRendered(){r.touchDependencies(this._injector,[[Ae]])}onReady(){r.touchDependencies(this._injector,[[Yt],[g.DefinedNameDataController],[xt],[g.RangeProtectionRenderModel],[g.RangeProtectionRefRangeService],[g.RefRangeService]])}},kr(g.UniverSheetsPlugin,"pluginName",Wu),kr(g.UniverSheetsPlugin,"type",r.UniverInstanceType.UNIVER_SHEET),g.UniverSheetsPlugin=Au([r.DependentOn(z.UniverFormulaEnginePlugin),Pr(1,r.Inject(r.Injector)),Pr(2,r.IConfigService)],g.UniverSheetsPlugin);const Vu=[pe.id,re.id,ro.id,ve.id,et.id,fe.id,Se.id,Ke.id,xe.id,Qe.id,Ze.id,ae.id,me.id,oe.id,he.id,ot.id,Je.id],$u=[B.id,Me.id,G.id,H.id,gt.id,tt.id,Xe.id,ze.id],Lu=1.5,Bu="rgba(255, 255, 255, 0.01)";function ju(o){const{rangeWithCoord:e,primaryWithCoord:t,style:n}=o,s={range:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType,unitId:e.unitId,sheetId:e.sheetId},primary:null,style:n};return t!=null&&(s.primary=Nr(t)),s}function Nr(o){const{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:s}=o,{startRow:i,startColumn:a,endRow:u,endColumn:l}=o.mergeInfo;return{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:s,startRow:i,startColumn:a,endRow:u,endColumn:l}}const Fu=(o,e,t)=>{const s=o.get(g.SheetsSelectionsService).getCurrentSelections(),{value:i,selections:a,unitId:u,subUnitId:l}=e;if(s){const c=s[(s==null?void 0:s.length)-1].primary;if(c){const{actualColumn:m,actualRow:h}=c;let{startRow:R,startColumn:C,endRow:f,endColumn:v}=a[a.length-1];if(i===r.Dimension.COLUMNS){const M=t.find(_=>_.startColumn===m&&_.endColumn===m&&h===_.startRow);M&&(v=M.endColumn,R=M.startRow,f=M.endRow)}else if(i===r.Dimension.ROWS){const M=t.find(_=>_.startRow===h&&_.endRow===h&&m===_.startColumn);M&&(f=M.endRow,C=M.startColumn,v=M.endColumn)}const I={startRow:R,startColumn:C,endRow:f,endColumn:v,actualRow:h,actualColumn:m,isMerged:!0,isMergedMainCell:R===h&&C===m},p=s.map((M,_,b)=>({range:M.range,style:null,primary:_===b.length-1?I:null})),w={unitId:u,subUnitId:l,type:X.ONLY_SET,selections:p};return{id:q.id,params:w}}return null}return null},Hu=(o,e)=>{const n=o.get(g.SheetsSelectionsService).getCurrentSelections(),{unitId:s,subUnitId:i}=e;if(n&&n[(n==null?void 0:n.length)-1].primary){const l={unitId:s,subUnitId:i,type:X.ONLY_SET,selections:[...n]};return{id:q.id,params:l}}return null};function Or(o){return o==null?!1:o.v!==void 0&&o.v!==null&&o.v!==""||o.p!==void 0}function Jt(o,e){return o&&o.spanAnchor?Or(e.getValue(o.spanAnchor.startRow,o.spanAnchor.startColumn)):Or(o)}function Gu(o,e,t,n,s){const i=o.getCellMatrix(),a=o.getSpanModel().getMergedCellRange(e,t,n,s),u=new r.ObjectMatrix;return i.forValue((l,d)=>{const c=i.getValue(l,d);c&&u.setValue(l,d,c)}),a.forEach(l=>{const{startColumn:d,startRow:c,endColumn:m,endRow:h}=l;r.createRowColIter(c,h,d,m).forEach((R,C)=>{R===c&&C===d&&u.setValue(R,C,{...i.getValue(R,C),spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}),(R!==c||C!==d)&&(u.realDeleteValue(R,C),u.setValue(R,C,{spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}))})}),u}function qu(o,e,t,n){const{startRow:s,startColumn:i,endRow:a}=o;let u=null,l=!1;for(let d=s;d<=a;d++){const c=e.getValue(d,i-t);if(l=l||Jt(c,e),!n&&l)break;c&&c.spanAnchor&&(u?u={startRow:Math.min(c.spanAnchor.startRow,u.startRow),startColumn:Math.min(c.spanAnchor.startColumn,u.startColumn),endRow:Math.max(c.spanAnchor.endRow,u.endRow),endColumn:Math.max(c.spanAnchor.endColumn,u.endColumn)}:u={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return l?(o.startColumn=o.startColumn-t,{spanAnchor:u,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function Yu(o,e,t,n){const{startRow:s,endColumn:i,endRow:a}=o;let u=null,l=!1;for(let d=s;d<=a;d++){const c=e.getValue(d,i+t);if(l=l||Jt(c,e),!n&&l)break;c&&c.spanAnchor&&(u?u={startRow:Math.min(c.spanAnchor.startRow,u.startRow),startColumn:Math.min(c.spanAnchor.startColumn,u.startColumn),endRow:Math.max(c.spanAnchor.endRow,u.endRow),endColumn:Math.max(c.spanAnchor.endColumn,u.endColumn)}:u={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return l?(o.endColumn=o.endColumn+t,{spanAnchor:u,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function zu(o,e,t,n){const{startRow:s,startColumn:i,endColumn:a}=o;let u=null,l=!1;for(let d=i;d<=a;d++){const c=e.getValue(s-t,d);if(l=l||Jt(c,e),!n&&l)break;c&&c.spanAnchor&&(u?u={startRow:Math.min(c.spanAnchor.startRow,u.startRow),startColumn:Math.min(c.spanAnchor.startColumn,u.startColumn),endRow:Math.max(c.spanAnchor.endRow,u.endRow),endColumn:Math.max(c.spanAnchor.endColumn,u.endColumn)}:u={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return l?(o.startRow=o.startRow-t,{spanAnchor:u,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function Ku(o,e,t,n){const{startColumn:s,endColumn:i,endRow:a}=o;let u=null,l=!1;for(let d=s;d<=i;d++){const c=e.getValue(a+t,d);if(l=l||Jt(c,e),!n&&l)break;c&&c.spanAnchor&&(u?u={startRow:Math.min(c.spanAnchor.startRow,u.startRow),startColumn:Math.min(c.spanAnchor.startColumn,u.startColumn),endRow:Math.max(c.spanAnchor.endRow,u.endRow),endColumn:Math.max(c.spanAnchor.endColumn,u.endColumn)}:u={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return l?(o.endRow=o.endRow+t,{spanAnchor:u,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function xu(o,e,t){const n=t.getMaxRows(),s=t.getMaxColumns(),i=Gu(t,0,0,n-1,s-1),a=t.getSnapshot().mergeData.length>0,{left:u,right:l,up:d,down:c}=e;let m=!0,h={...o};const R=[];for(;m;){if(m=!1,d&&h.startRow!==0){const{hasValue:C,range:f,spanAnchor:v}=zu(h,i,1,a);if(v&&R.push(v),C){h=f,m=!0;continue}}if(c&&h.endRow!==n-1){const{hasValue:C,range:f,spanAnchor:v}=Ku(h,i,1,a);if(v&&R.push(v),C){h=f,m=!0;continue}}if(u&&h.startColumn!==0){const{hasValue:C,range:f,spanAnchor:v}=qu(h,i,1,a);if(v&&R.push(v),C){h=f,m=!0;continue}}if(l&&h.endColumn!==s-1){const{hasValue:C,range:f,spanAnchor:v}=Yu(h,i,1,a);if(v&&R.push(v),C){h=f,m=!0;continue}}}return R.length>0&&(h=r.Rectangle.union(h,...R)),h}const Dr=(o,e,t,n=1,s=!0,i=!0)=>{const a=r.Range.transformRange(o,e),{startRow:u,endRow:l}=a;let d=t.startRow-n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d--,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d>=u)return{...t,startRow:d,endRow:d};if(i){const h={...t,startRow:l,endRow:l};return Wr(o,e,h,n,s,!1)}},Ar=(o,e,t,n=1,s=!0,i=!0)=>{const a=r.Range.transformRange(o,e),{startRow:u,endRow:l}=a;let d=t.endRow+n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d++,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d<=l)return{...t,startRow:d,endRow:d};if(i){const h={...t,startRow:u,endRow:u};return Vr(o,e,h,n,s,!1)}},Wr=(o,e,t,n=1,s=!0,i=!0)=>{const a=r.Range.transformRange(o,e),{startColumn:u,endColumn:l}=a;let d=t.startColumn-n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d--,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d>=u)return{...t,startColumn:d,endColumn:d};if(i){const h={...t,startColumn:l,endColumn:l};return Dr(o,e,h,n,s,!1)}},Vr=(o,e,t,n=1,s=!0,i=!0)=>{const a=r.Range.transformRange(o,e),{startColumn:u,endColumn:l}=a;let d=t.endColumn+n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d++,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d<=l)return{...t,endColumn:d,startColumn:d};if(i){const h={...t,startColumn:u,endColumn:u};return Ar(o,e,h,n,s,!1)}};function Xt(o,e,t){let n=null;return t.getMatrixWithMergedCells(o,e,o,e).forValue((i,a,u)=>(n={actualRow:i,actualColumn:a,startRow:i,startColumn:a,isMerged:u.rowSpan!==void 0||u.colSpan!==void 0,isMergedMainCell:u.rowSpan!==void 0&&u.colSpan!==void 0,endRow:i+(u.rowSpan!==void 0?u.rowSpan-1:0),endColumn:a+(u.colSpan!==void 0?u.colSpan-1:0),rangeType:r.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:o,startRow:o,startColumn:e,endRow:o,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:r.RANGE_TYPE.NORMAL}}const Ju=(o,e,t,n,s=1)=>{switch(n){case r.Direction.UP:return Dr(o,e,t,s);case r.Direction.DOWN:return Ar(o,e,t,s);case r.Direction.LEFT:return Wr(o,e,t,s);case r.Direction.RIGHT:return Vr(o,e,t,s)}},Xu=(o,e,t)=>{let n,s=-1,i;for(let I=0;I<o.length;I++)if(o[I].primary){n=o[I],s=I,i=n.primary;break}if(s===-1)return null;const a=e===r.Direction.LEFT||e===r.Direction.UP,u=a?s-1>=0?s-1:o.length-1:s+1<o.length?s+1:0,l=o[u];if(!n||!i)return null;const d={...i},{startRow:c,startColumn:m,endRow:h,endColumn:R}=n.range,C=a?d.startRow===c&&d.startColumn===m:d.endRow===h&&d.endColumn===R,f=C&&a;if(!r.Rectangle.equals(n.range,d)){const I=C?l.range:Ju(n.range,t,d,e);if(!I)return null;const p=f?Xt(I.endRow,I.endColumn,t):Xt(I.startRow,I.startColumn,t);return{startRow:p.startRow,startColumn:p.startColumn,endRow:p.endRow,endColumn:p.endColumn}}const v=f?Xt(l.range.endRow,l.range.endColumn,t):Xt(l.range.startRow,l.range.startColumn,t);return{startRow:v.startRow,startColumn:v.startColumn,endRow:v.endRow,endColumn:v.endColumn}},Zu={WorkbookCommentPermission:rn,WorkbookCopyPermission:an,WorkbookCreateProtectPermission:un,WorkbookCreateSheetPermission:ln,WorkbookDeleteSheetPermission:dn,WorkbookDuplicatePermission:cn,WorkbookEditablePermission:Pt,WorkbookExportPermission:mn,WorkbookHideSheetPermission:hn,WorkbookHistoryPermission:Ho,WorkbookManageCollaboratorPermission:gn,WorkbookMoveSheetPermission:Rn,WorkbookPrintPermission:Cn,WorkbookRecoverHistoryPermission:fn,WorkbookRenameSheetPermission:Sn,WorkbookSharePermission:vn,WorkbookViewHistoryPermission:pn,WorkbookViewPermission:In,WorksheetCopyPermission:Mn,WorksheetDeleteColumnPermission:wn,WorksheetDeleteProtectionPermission:_n,WorksheetDeleteRowPermission:yn,WorksheetEditExtraObjectPermission:bn,WorksheetEditPermission:ct,WorksheetFilterPermission:Un,WorksheetInsertColumnPermission:Tn,WorksheetInsertHyperlinkPermission:En,WorksheetInsertRowPermission:Pn,WorksheetManageCollaboratorPermission:kn,WorksheetPivotTablePermission:Nn,WorksheetSelectProtectedCellsPermission:Go,WorksheetSelectUnProtectedCellsPermission:qo,WorksheetSetCellStylePermission:On,WorksheetSetCellValuePermission:Dn,WorksheetSetColumnStylePermission:An,WorksheetSetRowStylePermission:Wn,WorksheetSortPermission:Vn,WorksheetViewPermission:$n,RangeProtectionPermissionEditPoint:dt,RangeProtectionPermissionViewPoint:Et},Qu=(o,e,t,n)=>{const s=o.get(r.IPermissionService),i=o.get(J),a=s.getPermissionPoint(new Pt(e).id);if(!(a!=null&&a.value))return!1;const u=s.getPermissionPoint(new ct(e,t).id);if(!(u!=null&&u.value))return!1;const d=i.getSubunitRuleList(e,t).filter(c=>c.ranges.some(m=>n.some(h=>r.Rectangle.intersects(m,h))));return d.length?d.every(c=>{const m=c.permissionId,h=s.getPermissionPoint(new dt(e,t,m).id);return!!(h!=null&&h.value)}):!0};function el(o,e){return e.some(t=>tl(o,t))}function tl(o,e){const{startRow:t,startColumn:n,endColumn:s,endRow:i}=e,a=o.getMatrixWithMergedCells(t,n,i,s);let u=!1;return a.forValue((l,d,c)=>{if(c&&(l!==t||d!==n)&&o.cellHasValue(c))return u=!0,!1}),u}function nl(o,e,t,n){const s=[],i=[],a=t.getSheetId();return n.forEach(u=>{const l=ol(t,u),d={unitId:e,subUnitId:a,cellValue:l.getData()},c=ne(o,d);s.push({id:B.id,params:c}),i.push({id:B.id,params:d})}),{undos:s,redos:i}}function ol(o,e){const{startRow:t,startColumn:n,endColumn:s,endRow:i}=e,a=o.getMatrixWithMergedCells(t,n,i,s,r.CellModeEnum.Intercepted),u=new r.ObjectMatrix;return a.forValue((l,d,c)=>{c&&(l!==t||d!==n)&&u.setValue(l,d,null)}),u}const pt={type:r.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge",handler:async(o,e)=>{const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=o.get(r.IUniverInstanceService),i=e.unitId,a=e.subUnitId,u=e.selections,l=vo(u,e.value),d=s.getUniverSheetInstance(i).getSheetBySheetId(a),c=[],m=[],h=el(d,l),R={unitId:i,subUnitId:a,ranges:l},C={unitId:i,subUnitId:a,ranges:l};c.push({id:G.id,params:R}),c.push({id:H.id,params:C});const f=ee(o,R),v=se(o,C);if(m.push({id:G.id,params:v}),m.push({id:H.id,params:f}),h){const p=nl(o,i,d,l);c.unshift(...p.redos),m.push(...p.undos)}return r.sequenceExecute(c,t).result?(n.pushUndoRedo({unitID:i,undoMutations:m,redoMutations:c}),!0):!1}},sl={type:r.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-all",handler:async o=>{var d;const e=o.get(r.ICommandService),n=(d=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const i=o.get(r.IUniverInstanceService).getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;const a=i.getActiveSheet();if(!a)return!1;const u=i.getUnitId(),l=a.getSheetId();return e.executeCommand(pt.id,{selections:n,unitId:u,subUnitId:l})}},rl={type:r.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-vertical",handler:async o=>{var d;const e=o.get(r.ICommandService),n=(d=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const i=o.get(r.IUniverInstanceService).getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;const a=i.getActiveSheet();if(!a)return!1;const u=i.getUnitId(),l=a.getSheetId();return e.executeCommand(pt.id,{value:r.Dimension.COLUMNS,selections:n,unitId:u,subUnitId:l})}},il={type:r.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-horizontal",handler:async o=>{var d;const e=o.get(r.ICommandService),n=(d=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const i=o.get(r.IUniverInstanceService).getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;const a=i.getActiveSheet();if(!a)return!1;const u=i.getUnitId(),l=a.getSheetId();return e.executeCommand(pt.id,{value:r.Dimension.ROWS,selections:n,unitId:u,subUnitId:l})}};async function al(o,e,t,n,s){const i=o.get(r.IUniverInstanceService),a=k(i,{unitId:e,subUnitId:t});if(!a)return;const{worksheet:u}=a;if(u.getMergeData().some(m=>n.some(h=>r.Rectangle.intersects(h,m))))throw new Error("The ranges to be merged overlap with the existing merged cells");await o.get(r.ICommandService).executeCommand(pt.id,{unitId:e,subUnitId:t,selections:n,defaultMerge:s})}const ul=(o,e)=>{const i=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().rightToLeft;return{...r.Tools.deepClone(e),rightToLeft:i}},Zt={id:"sheet.mutation.set-worksheet-right-to-left",type:r.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(r.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);if(!n)return!1;const s=n.getConfig();return s.rightToLeft=e.rightToLeft,!0}},ll={type:r.CommandType.COMMAND,id:"sheet.command.set-worksheet-right-to-left",handler:async(o,e)=>{var m;const t=o.get(r.ICommandService),n=o.get(r.IUndoRedoService),s=k(o.get(r.IUniverInstanceService),e);if(!s)return!1;const{unitId:i,subUnitId:a}=s;let u=r.BooleanNumber.FALSE;e&&(u=(m=e.rightToLeft)!=null?m:r.BooleanNumber.FALSE);const l={rightToLeft:u,unitId:i,subUnitId:a},d=ul(o,l);return t.syncExecuteCommand(Zt.id,l)?(n.pushUndoRedo({unitID:i,undoMutations:[{id:Zt.id,params:d}],redoMutations:[{id:Zt.id,params:l}]}),!0):!1}};g.AFTER_CELL_EDIT=Mt,g.AFTER_CELL_EDIT_ASYNC=wt,g.AddMergeRedoSelectionsOperationFactory=Fu,g.AddMergeUndoMutationFactory=se,g.AddMergeUndoSelectionsOperationFactory=Hu,g.AddRangeProtectionCommand=bo,g.AddRangeProtectionMutation=ie,g.AddWorksheetMergeAllCommand=sl,g.AddWorksheetMergeCommand=pt,g.AddWorksheetMergeHorizontalCommand=il,g.AddWorksheetMergeMutation=H,g.AddWorksheetMergeVerticalCommand=rl,g.AddWorksheetProtectionCommand=Uo,g.AddWorksheetProtectionMutation=Pe,g.BEFORE_CELL_EDIT=en,g.BorderStyleManagerService=Oe,g.COMMAND_LISTENER_SKELETON_CHANGE=Vu,g.COMMAND_LISTENER_VALUE_CHANGE=$u,g.CancelFrozenCommand=ws,g.ClearSelectionAllCommand=yt,g.ClearSelectionContentCommand=nn,g.ClearSelectionFormatCommand=bt,g.CopySheetCommand=sn,g.DISABLE_NORMAL_SELECTIONS=Kr,g.DeleteRangeMoveLeftCommand=Fe,g.DeleteRangeMoveUpCommand=He,g.DeleteRangeProtectionCommand=Ko,g.DeleteRangeProtectionMutation=de,g.DeleteWorksheetProtectionCommand=xo,g.DeleteWorksheetProtectionMutation=ke,g.DeltaColumnWidthCommand=Qn,g.DeltaRowHeightCommand=io,g.EditStateEnum=yo,g.EffectRefRangId=O,g.EmptyMutation=Qs,g.ExclusiveRangeService=br,g.FactoryAddRangeProtectionMutation=Br,g.FactoryDeleteRangeProtectionMutation=Lr,g.FactorySetRangeProtectionMutation=Bi,g.IExclusiveRangeService=po,g.INTERCEPTOR_POINT=Le,g.INumfmtService=Ae,g.IRefSelectionsService=Lo,g.InsertColAfterCommand=ns,g.InsertColBeforeCommand=ts,g.InsertColCommand=_e,g.InsertColMutation=ae,g.InsertColMutationUndoFactory=kt,g.InsertDefinedNameCommand=Jo,g.InsertRangeMoveDownCommand=ht,g.InsertRangeMoveRightCommand=Nt,g.InsertRowAfterCommand=Qo,g.InsertRowBeforeCommand=Zo,g.InsertRowCommand=we,g.InsertRowMutation=me,g.InsertRowMutationUndoFactory=jn,g.InsertSheetCommand=os,g.InsertSheetMutation=Be,g.InsertSheetUndoMutationFactory=on,g.InterceptCellContentPriority=ko,g.MAX_CELL_PER_SHEET_KEY=rr,g.MERGE_CELL_INTERCEPTOR_CHECK=_r,g.MoveColsCommand=Dt,g.MoveColsMutation=Se,g.MoveColsMutationUndoFactory=rs,g.MoveRangeCommand=je,g.MoveRangeMutation=Me,g.MoveRowsCommand=Ot,g.MoveRowsMutation=fe,g.MoveRowsMutationUndoFactory=ss,g.OperatorType=V,g.PermissionPointsDefinitions=Zu,g.REF_SELECTIONS_ENABLED=Po,g.RangeMergeUtil=va,g.RangeProtectionPermissionDeleteProtectionPoint=to,g.RangeProtectionPermissionEditPoint=dt,g.RangeProtectionPermissionManageCollaPoint=no,g.RangeProtectionPermissionViewPoint=Et,g.RangeProtectionRuleModel=J,g.RemoveColCommand=qe,g.RemoveColMutation=oe,g.RemoveDefinedNameCommand=Hn,g.RemoveMergeUndoMutationFactory=ee,g.RemoveNumfmtMutation=mo,g.RemoveRowCommand=Ge,g.RemoveRowMutation=he,g.RemoveSheetCommand=At,g.RemoveSheetMutation=Ne,g.RemoveSheetUndoMutationFactory=$o,g.RemoveWorksheetMergeCommand=cs,g.RemoveWorksheetMergeMutation=G,g.ReorderRangeCommand=Wt,g.ReorderRangeMutation=gt,g.ReorderRangeUndoMutationFactory=ms,g.ResetBackgroundColorCommand=Os,g.ResetTextColorCommand=ks,g.SCOPE_WORKBOOK_VALUE_DEFINED_NAME=Da,g.SELECTIONS_ENABLED=xr,g.SELECTION_CONTROL_BORDER_BUFFER_COLOR=Bu,g.SELECTION_CONTROL_BORDER_BUFFER_WIDTH=Lu,g.ScrollToCellOperation=or,g.SelectionMoveType=X,g.SetBackgroundColorCommand=Ns,g.SetBoldCommand=qi,g.SetBorderBasicCommand=fs,g.SetBorderColorCommand=Cs,g.SetBorderCommand=Ye,g.SetBorderPositionCommand=gs,g.SetBorderStyleCommand=Rs,g.SetColDataCommand=vs,g.SetColDataMutation=ze,g.SetColDataMutationFactory=Ss,g.SetColHiddenCommand=qn,g.SetColHiddenMutation=Ke,g.SetColVisibleMutation=xe,g.SetColWidthCommand=Bt,g.SetDefinedNameCommand=Yn,g.SetFontFamilyCommand=Ji,g.SetFontSizeCommand=Xi,g.SetFrozenCommand=Ms,g.SetFrozenMutation=ye,g.SetFrozenMutationFactory=zn,g.SetGridlinesColorCommand=_s,g.SetGridlinesColorMutation=Je,g.SetHorizontalTextAlignCommand=As,g.SetItalicCommand=Yi,g.SetNumfmtMutation=Ht,g.SetOverlineCommand=xi,g.SetProtectionCommand=ys,g.SetRangeProtectionMutation=K,g.SetRangeValuesCommand=mt,g.SetRangeValuesMutation=B,g.SetRangeValuesUndoMutationFactory=ne,g.SetRowDataCommand=Us,g.SetRowDataMutation=Xe,g.SetRowDataMutationFactory=bs,g.SetRowHeightCommand=ao,g.SetRowHiddenCommand=Kn,g.SetRowHiddenMutation=Qe,g.SetRowVisibleMutation=Ze,g.SetSelectedColsVisibleCommand=Is,g.SetSelectedRowsVisibleCommand=Ts,g.SetSelectionsOperation=q,g.SetSpecificColsVisibleCommand=$t,g.SetSpecificRowsVisibleCommand=Lt,g.SetStrikeThroughCommand=Ki,g.SetStyleCommand=x,g.SetTabColorCommand=$s,g.SetTabColorMutation=Rt,g.SetTextColorCommand=Ps,g.SetTextRotationCommand=Vs,g.SetTextWrapCommand=Ws,g.SetUnderlineCommand=zi,g.SetVerticalTextAlignCommand=Ds,g.SetWorkbookNameCommand=Jn,g.SetWorkbookNameMutation=xn,g.SetWorksheetActivateCommand=Xn,g.SetWorksheetActiveOperation=et,g.SetWorksheetColWidthMutation=ve,g.SetWorksheetColWidthMutationFactory=Zn,g.SetWorksheetDefaultStyleCommand=Bs,g.SetWorksheetDefaultStyleMutation=tt,g.SetWorksheetDefaultStyleMutationFactory=Ls,g.SetWorksheetHideCommand=Fs,g.SetWorksheetHideMutation=be,g.SetWorksheetNameCommand=eo,g.SetWorksheetNameMutation=jt,g.SetWorksheetOrderCommand=Hs,g.SetWorksheetOrderMutation=Ct,g.SetWorksheetPermissionPointsCommand=qs,g.SetWorksheetPermissionPointsMutation=oo,g.SetWorksheetProtectionCommand=Ys,g.SetWorksheetProtectionMutation=De,g.SetWorksheetRightToLeftCommand=ll,g.SetWorksheetRightToLeftMutation=Zt,g.SetWorksheetRowAutoHeightMutation=ro,g.SetWorksheetRowAutoHeightMutationFactory=ma,g.SetWorksheetRowHeightMutation=pe,g.SetWorksheetRowIsAutoHeightCommand=uo,g.SetWorksheetRowIsAutoHeightMutation=re,g.SetWorksheetShowCommand=Ks,g.SplitTextToColumnsCommand=Js,g.ToggleCellCheckboxCommand=Xs,g.ToggleGridlinesCommand=Zs,g.ToggleGridlinesMutation=ot,g.UnitAction=y,g.UnitObject=D,g.ViewStateEnum=_o,g.WorkbookCommentPermission=rn,g.WorkbookCopyPermission=an,g.WorkbookCopySheetPermission=Fo,g.WorkbookCreateProtectPermission=un,g.WorkbookCreateSheetPermission=ln,g.WorkbookDeleteSheetPermission=dn,g.WorkbookDuplicatePermission=cn,g.WorkbookEditablePermission=Pt,g.WorkbookExportPermission=mn,g.WorkbookHideSheetPermission=hn,g.WorkbookHistoryPermission=Ho,g.WorkbookManageCollaboratorPermission=gn,g.WorkbookMoveSheetPermission=Rn,g.WorkbookPrintPermission=Cn,g.WorkbookRecoverHistoryPermission=fn,g.WorkbookRenameSheetPermission=Sn,g.WorkbookSelectionModel=Eo,g.WorkbookSharePermission=vn,g.WorkbookViewHistoryPermission=pn,g.WorkbookViewPermission=In,g.WorksheetCopyPermission=Mn,g.WorksheetDeleteColumnPermission=wn,g.WorksheetDeleteProtectionPermission=_n,g.WorksheetDeleteRowPermission=yn,g.WorksheetEditExtraObjectPermission=bn,g.WorksheetEditPermission=ct,g.WorksheetFilterPermission=Un,g.WorksheetInsertColumnPermission=Tn,g.WorksheetInsertHyperlinkPermission=En,g.WorksheetInsertRowPermission=Pn,g.WorksheetManageCollaboratorPermission=kn,g.WorksheetPivotTablePermission=Nn,g.WorksheetProtectionPointModel=ft,g.WorksheetProtectionRuleModel=Ee,g.WorksheetSelectProtectedCellsPermission=Go,g.WorksheetSelectUnProtectedCellsPermission=qo,g.WorksheetSetCellStylePermission=On,g.WorksheetSetCellValuePermission=Dn,g.WorksheetSetColumnStylePermission=An,g.WorksheetSetRowStylePermission=Wn,g.WorksheetSortPermission=Vn,g.WorksheetViewPermission=$n,g.addMergeCellsUtil=al,g.adjustRangeOnMutation=fr,g.alignToMergedCellsBorders=ut,g.baseProtectionActions=Gs,g.checkRangesEditablePermission=Qu,g.convertPrimaryWithCoordToPrimary=Nr,g.convertSelectionDataToRange=ju,g.copyRangeStyles=lt,g.createTopMatrixFromMatrix=tr,g.createTopMatrixFromRanges=er,g.defaultWorkbookPermissionPoints=sa,g.defaultWorksheetPermissionPoint=ra,g.expandToContinuousRange=xu,g.factoryRemoveNumfmtUndoMutation=pa,g.factorySetNumfmtUndoMutation=Ia,g.findAllRectangle=lo,g.followSelectionOperation=ce,g.generateNullCell=Qt,g.generateNullCellValue=To,g.getAddMergeMutationRangeByType=vo,g.getAllRangePermissionPoint=ge,g.getAllWorkbookPermissionPoint=Ft,g.getAllWorksheetPermissionPoint=Ie,g.getAllWorksheetPermissionPointByPointPanel=nt,g.getCellAtRowCol=Ri,g.getDefaultRangePermission=oa,g.getInsertRangeMutations=Ln,g.getMoveRangeUndoRedoMutations=Ut,g.getNextPrimaryCell=Xu,g.getPrimaryForRange=Q,g.getRemoveRangeMutations=Bn,g.getSelectionsService=Bo,g.getSeparateEffectedRangesOnCommand=Xa,g.getSheetCommandTarget=k,g.getSheetCommandTargetWorkbook=Vo,g.getSheetMutationTarget=at,g.handleBaseInsertRange=Ve,g.handleBaseMoveRowsCols=St,g.handleBaseRemoveRange=We,g.handleCommonDefaultRangeChangeWithEffectRefCommands=So,g.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests=xa,g.handleDefaultRangeChangeWithEffectRefCommands=fo,g.handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests=Ka,g.handleDeleteRangeMoveLeft=Rr,g.handleDeleteRangeMoveUp=Cr,g.handleDeleteRangeMutation=pi,g.handleIRemoveCol=Co,g.handleIRemoveRow=dr,g.handleInsertCol=mr,g.handleInsertRangeMoveDown=hr,g.handleInsertRangeMoveRight=gr,g.handleInsertRangeMutation=Ii,g.handleInsertRow=cr,g.handleMoveCols=Ro,g.handleMoveRange=lr,g.handleMoveRows=go,g.isSingleCellSelection=fi,g.rangeMerge=co,g.rotateRange=te,g.runRefRangeMutations=$e,g.setEndForRange=Ci,g.splitRangeText=xs,g.transformCellsToRange=Gt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
10
|
+
(function(g,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/rpc"),require("rxjs"),require("@univerjs/engine-numfmt"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula","@univerjs/rpc","rxjs","@univerjs/engine-numfmt","rxjs/operators"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g.UniverSheets={},g.UniverCore,g.UniverEngineFormula,g.UniverRpc,g.rxjs,g.UniverEngineNumfmt,g.rxjs.operators))})(this,function(g,i,Y,ii,W,Vo,mt){"use strict";var Qu=Object.defineProperty;var ed=(g,i,Y)=>i in g?Qu(g,i,{enumerable:!0,configurable:!0,writable:!0,value:Y}):g[i]=Y;var f=(g,i,Y)=>ed(g,typeof i!="symbol"?i+"":i,Y);var $o=(o=>(o.OthersCanView="othersCanView",o.NoOneElseCanView="noOneElseCanView",o))($o||{}),Lo=(o=>(o.DesignedUserCanEdit="designedUserCanEdit",o.OnlyMe="onlyMe",o))(Lo||{});class Z{constructor(){f(this,"_model",new Map);f(this,"_ruleChange",new W.Subject);f(this,"ruleChange$",this._ruleChange.asObservable());f(this,"_ruleRefresh",new W.Subject);f(this,"ruleRefresh$",this._ruleRefresh.asObservable());f(this,"_rangeRuleInitStateChange",new W.BehaviorSubject(!1));f(this,"rangeRuleInitStateChange$",this._rangeRuleInitStateChange.asObservable())}ruleRefresh(e){this._ruleRefresh.next(e)}getRangeRuleInitState(){return this._rangeRuleInitStateChange.value}changeRuleInitState(e){this._rangeRuleInitStateChange.next(e)}addRule(e,t,n){this._ensureRuleMap(e,t).set(n.id,n),this._ruleChange.next({unitId:e,subUnitId:t,rule:n,type:"add"})}deleteRule(e,t,n){var r,a,l,u;const s=(a=(r=this._model.get(e))==null?void 0:r.get(t))==null?void 0:a.get(n);s&&((u=(l=this._model.get(e))==null?void 0:l.get(t))==null||u.delete(n),this._ruleChange.next({unitId:e,subUnitId:t,rule:s,type:"delete"}))}setRule(e,t,n,s){var a,l;const r=this.getRule(e,t,n);r&&((l=(a=this._model.get(e))==null?void 0:a.get(t))==null||l.set(n,s),this._ruleChange.next({unitId:e,subUnitId:t,oldRule:r,rule:s,type:"set"}))}getRule(e,t,n){var s,r;return(r=(s=this._model.get(e))==null?void 0:s.get(t))==null?void 0:r.get(n)}getSubunitRuleList(e,t){var s;return[...(((s=this._model.get(e))==null?void 0:s.get(t))||new Map).values()]}getSubunitRuleListLength(e,t){var s;const n=(s=this._model.get(e))==null?void 0:s.get(t);return n?n.size:0}_ensureRuleMap(e,t){let n=this._model.get(e);n||(n=new Map,this._model.set(e,n));let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const s=this._model.get(n),r=[...s.keys()];e[n]={},r.forEach(a=>{const l=s.get(a);e[n][a]=[...l.values()]})}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const s=e[n],r=new Map;Object.keys(s).forEach(a=>{const l=s[a].reduce((u,d)=>(u.set(d.id,d),u),new Map);r.set(a,l)}),t.set(n,r)}),this._model=t}deleteUnitModel(e){this._model.delete(e)}createRuleId(e,t){let n=i.Tools.generateRandomId(4);const s=this._ensureRuleMap(e,t);for(;s.has(n);)n=i.Tools.generateRandomId(4);return n}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[s,r]of n)for(const a of r.values())if(a.permissionId===t)return[e,s];return null}}const ai=(o,e)=>{const t=o.get(Z),n=e.ruleIds.map(r=>t.getRule(e.unitId,e.subUnitId,r)).filter(r=>!!r);return{id:le.id,params:{subUnitId:e.subUnitId,unitId:e.unitId,rules:n}}},he={id:"sheet.mutation.delete-range-protection",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,ruleIds:s}=e,r=o.get(Z);return s.forEach(a=>{r.deleteRule(t,n,a)}),!0}},li=o=>{const e={...o,ruleIds:o.rules.map(t=>t.id)};return{id:he.id,params:e}},le={id:"sheet.mutation.add-range-protection",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,rules:s}=e,r=o.get(Z);return s.forEach(a=>{r.addRule(t,n,a)}),!0}},Bo={type:i.CommandType.COMMAND,id:"sheet.command.add-range-protection",async handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(Z),{rule:r,permissionId:a}=e,{unitId:l,subUnitId:u,ranges:d,description:c,viewState:m,editState:h}=r,R=[{ranges:d,permissionId:a,id:s.createRuleId(l,u),description:c,unitType:r.unitType,unitId:l,subUnitId:u,viewState:m,editState:h}];if(await t.executeCommand(le.id,{unitId:l,subUnitId:u,rules:R})){const S=[{id:le.id,params:{unitId:l,subUnitId:u,rules:R}}],v=[{id:he.id,params:{unitId:l,subUnitId:u,ruleIds:R.map(I=>I.id)}}];n.pushUndoRedo({unitID:l,redoMutations:S,undoMutations:v})}return!0}};class ke{constructor(){f(this,"_model",new Map);f(this,"_ruleChange",new W.Subject);f(this,"_ruleRefresh",new W.Subject);f(this,"_resetOrder",new W.Subject);f(this,"ruleChange$",this._ruleChange.asObservable());f(this,"ruleRefresh$",this._ruleRefresh.asObservable());f(this,"resetOrder$",this._resetOrder.asObservable());f(this,"_worksheetRuleInitStateChange",new W.BehaviorSubject(!1));f(this,"worksheetRuleInitStateChange$",this._worksheetRuleInitStateChange.asObservable())}changeRuleInitState(e){this._worksheetRuleInitStateChange.next(e)}getSheetRuleInitState(){return this._worksheetRuleInitStateChange.value}addRule(e,t){this._ensureSubUnitMap(e).set(t.subUnitId,t),this._ruleChange.next({unitId:e,rule:t,type:"add",subUnitId:t.subUnitId})}deleteRule(e,t){var s,r,a;const n=(r=(s=this._model)==null?void 0:s.get(e))==null?void 0:r.get(t);n&&((a=this._model.get(e))==null||a.delete(t),this._ruleChange.next({unitId:e,rule:n,type:"delete",subUnitId:t}))}setRule(e,t,n){var r,a;const s=this.getRule(e,t);s&&((a=(r=this._model)==null?void 0:r.get(e))==null||a.set(t,n),this._ruleChange.next({unitId:e,oldRule:s,rule:n,type:"set",subUnitId:t}))}getRule(e,t){var n,s;return(s=(n=this._model)==null?void 0:n.get(e))==null?void 0:s.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const s=this._model.get(n);s!=null&&s.size&&(e[n]=[],[...s.keys()].forEach(a=>{const l=s.get(a);l&&e[n].push(l)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const s=e[n];if(s!=null&&s.length){const r=new Map;s.forEach(a=>{r.set(a.subUnitId,a)}),t.set(n,r)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}ruleRefresh(e){this._ruleRefresh.next(e)}resetOrder(){this._resetOrder.next(Math.random())}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[s,r]of n)if(r.permissionId===t)return[e,s]}}const Oe={id:"sheet.mutation.add-worksheet-protection",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,rule:n}=e;return o.get(ke).addRule(t,n),!0}},De={id:"sheet.mutation.delete-worksheet-protection",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n}=e;return o.get(ke).deleteRule(t,n),!0}},Ho={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-protection",async handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{rule:s,unitId:r}=e,a=s.subUnitId;if(await t.executeCommand(Oe.id,{unitId:r,rule:s,subUnitId:s.subUnitId})){const u=[{id:Oe.id,params:{unitId:r,rule:s,subUnitId:s.subUnitId}}],d=[{id:De.id,params:{unitId:r,subUnitId:a}}];n.pushUndoRedo({unitID:r,redoMutations:u,undoMutations:d})}return!0}},ui=i.createInterceptorKey("CELL_CONTENT"),di=i.createInterceptorKey("ROW_FILTERED"),Ae={CELL_CONTENT:ui,ROW_FILTERED:di};var Fo=(o=>(o[o.DATA_VALIDATION=9]="DATA_VALIDATION",o[o.NUMFMT=10]="NUMFMT",o[o.CELL_IMAGE=11]="CELL_IMAGE",o))(Fo||{});const jo="sheet.interceptor.range-theme-id",Go="sheet.interceptor.ignore-range-theme";var ci=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,hi=(o,e,t,n)=>{for(var s=n>1?void 0:n?mi(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ci(e,t,s),s},gi=(o,e)=>(t,n)=>e(t,n,o);const ln=i.createInterceptorKey("BEFORE_CELL_EDIT"),Et=i.createInterceptorKey("AFTER_CELL_EDIT"),Pt=i.createInterceptorKey("AFTER_CELL_EDIT_ASYNC");g.SheetInterceptorService=class extends i.Disposable{constructor(t){super();f(this,"_interceptorsByName",new Map);f(this,"_commandInterceptors",[]);f(this,"_rangeInterceptors",[]);f(this,"_beforeCommandInterceptor",[]);f(this,"_afterCommandInterceptors",[]);f(this,"_workbookDisposables",new Map);f(this,"_worksheetDisposables",new Map);f(this,"_interceptorsDirty",!1);f(this,"_composedInterceptorByKey",new Map);f(this,"writeCellInterceptor",new i.InterceptorManager({BEFORE_CELL_EDIT:ln,AFTER_CELL_EDIT:Et,AFTER_CELL_EDIT_ASYNC:Pt}));this._univerInstanceService=t,this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._interceptWorkbook(n)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>this._disposeWorkbookInterceptor(n))),this.intercept(Ae.CELL_CONTENT,{priority:-1,effect:i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value,handler(n,s){const r=s.worksheet.getCellRaw(s.row,s.col);return n?{...r,...n}:r}}),this.disposeWithMe(this.writeCellInterceptor.intercept(Et,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(ln,{priority:-1,handler:n=>n})),this.disposeWithMe(this.writeCellInterceptor.intercept(Pt,{priority:-1,handler:n=>n}))}dispose(){super.dispose(),this._workbookDisposables.forEach(t=>t.dispose()),this._workbookDisposables.clear(),this._worksheetDisposables.clear(),this._interceptorsByName.clear()}interceptCommand(t){if(this._commandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._commandInterceptors.push(t),this._commandInterceptors.sort((n,s)=>{var r,a;return((r=s.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._commandInterceptors,t)))}onCommandExecute(t){const n=this._commandInterceptors.map(s=>s.getMutations(t));return{preUndos:n.map(s=>{var r;return(r=s.preUndos)!=null?r:[]}).flat(),undos:n.map(s=>s.undos).flat(),preRedos:n.map(s=>{var r;return(r=s.preRedos)!=null?r:[]}).flat(),redos:n.map(s=>s.redos).flat()}}interceptAfterCommand(t){if(this._afterCommandInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._afterCommandInterceptors.push(t),this._afterCommandInterceptors.sort((n,s)=>{var r,a;return((r=s.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._afterCommandInterceptors,t)))}afterCommandExecute(t){const n=this._afterCommandInterceptors.map(s=>s.getMutations(t));return{undos:n.map(s=>s.undos).flat(),redos:n.map(s=>s.redos).flat()}}interceptBeforeCommand(t){if(this._beforeCommandInterceptor.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._beforeCommandInterceptor.push(t),this._beforeCommandInterceptor.sort((n,s)=>{var r,a;return((r=s.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._beforeCommandInterceptor,t)))}async beforeCommandExecute(t){return(await Promise.all(this._beforeCommandInterceptor.map(s=>s.performCheck(t)))).every(s=>s)}interceptRanges(t){if(this._rangeInterceptors.includes(t))throw new Error("[SheetInterceptorService]: Interceptor already exists!");return this._rangeInterceptors.push(t),this._rangeInterceptors.sort((n,s)=>{var r,a;return((r=s.priority)!=null?r:0)-((a=n.priority)!=null?a:0)}),this.disposeWithMe(i.toDisposable(()=>i.remove(this._rangeInterceptors,t)))}generateMutationsByRanges(t){const n=this._rangeInterceptors.map(s=>s.getMutations(t));return{preUndos:n.map(s=>{var r;return(r=s.preUndos)!=null?r:[]}).flat(),undos:n.map(s=>s.undos).flat(),preRedos:n.map(s=>{var r;return(r=s.preRedos)!=null?r:[]}).flat(),redos:n.map(s=>s.redos).flat()}}async onWriteCell(t,n,s,r,a){const l={subUnitId:n.getSheetId(),unitId:t.getUnitId(),workbook:t,worksheet:n,row:s,col:r,origin:i.Tools.deepClone(a)},u=this.writeCellInterceptor.fetchThroughInterceptors(Et)(a,l);return await this.writeCellInterceptor.fetchThroughInterceptors(Pt)(Promise.resolve(u),l)}intercept(t,n){const s=t;this._interceptorsByName.has(s)||this._interceptorsByName.set(s,[]);const r=this._interceptorsByName.get(s);r.push(n);const a=r.sort((l,u)=>{var d,c;return((d=u.priority)!=null?d:0)-((c=l.priority)!=null?c:0)});if(s===Ae.CELL_CONTENT){this._interceptorsByName.set(`${s}-${i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value}`,a);const l=i.InterceptorEffectEnum.Style|i.InterceptorEffectEnum.Value;this._interceptorsByName.set(`${s}-${i.InterceptorEffectEnum.Style}`,a.filter(u=>((u.effect||l)&i.InterceptorEffectEnum.Style)>0)),this._interceptorsByName.set(`${s}-${i.InterceptorEffectEnum.Value}`,a.filter(u=>((u.effect||l)&i.InterceptorEffectEnum.Value)>0))}else this._interceptorsByName.set(s,a);return this._interceptorsDirty=!0,this.disposeWithMe(i.toDisposable(()=>i.remove(this._interceptorsByName.get(s),n)))}fetchThroughInterceptors(t,n,s,r){const a=n===void 0?t:`${t}-${n}`,l=s!=null?s:a;let u=this._composedInterceptorByKey.get(l);if(!u||this._interceptorsDirty){let d=this._interceptorsByName.get(a);d&&r&&(d=d.filter(r)),u=i.composeInterceptors(d||[]),this._composedInterceptorByKey.set(l,u)}return u}_interceptWorkbook(t){const n=new i.DisposableCollection,s=t.getUnitId(),r=this,a=l=>{const u=l.getSheetId();l.__interceptViewModel(d=>{const c=new i.DisposableCollection;r._worksheetDisposables.set(qo(s,l),c),c.add(d.registerCellContentInterceptor({getCell(m,h,R,C,S){const v=l.getCellRaw(m,h);return r.fetchThroughInterceptors(Ae.CELL_CONTENT,R,C,S)(v,{unitId:s,subUnitId:u,row:m,col:h,worksheet:l,workbook:t,rawData:v})}})),c.add(d.registerRowFilteredInterceptor({getRowFiltered(m){return!!r.fetchThroughInterceptors(Ae.ROW_FILTERED)(!1,{unitId:s,subUnitId:u,row:m,workbook:t,worksheet:l})}}))})};t.getSheets().forEach(l=>a(l)),n.add(t.sheetCreated$.subscribe(l=>a(l))),n.add(i.toDisposable(()=>t.getSheets().forEach(l=>this._disposeSheetInterceptor(s,l)))),n.add(t.sheetDisposed$.subscribe(l=>this._disposeSheetInterceptor(s,l))),this._workbookDisposables.set(s,n)}_disposeWorkbookInterceptor(t){const n=t.getUnitId(),s=this._workbookDisposables.get(n);s&&(s.dispose(),this._workbookDisposables.delete(n))}_disposeSheetInterceptor(t,n){const s=qo(t,n),r=this._worksheetDisposables.get(s);r&&(r.dispose(),this._worksheetDisposables.delete(s))}},g.SheetInterceptorService=hi([gi(0,i.IUniverInstanceService)],g.SheetInterceptorService);function qo(o,e){return`${o}|${e.getSheetId()}`}const K=o=>{const e={};return o.bg&&(e.bg={...o.bg}),o.ol&&(e.ol={...o.ol}),o.bd&&(e.bd={...o.bd}),o.cl&&(e.cl={...o.cl}),o.ht&&(e.ht=o.ht),o.vt&&(e.vt=o.vt),o.bl!==void 0&&(e.bl=o.bl),e};function Ri(o){const e={};if(o.length===1)return o[0];for(const t of o)t.bg&&(e.bg=t.bg),t.ol&&(e.ol=t.ol),t.bd&&(e.bd={...e.bd,...t.bd}),t.cl&&(e.cl=t.cl),t.ht&&(e.ht=t.ht),t.vt&&(e.vt=t.vt),t.bl!==void 0&&(e.bl=t.bl);return e}const J={wholeStyle:1,headerRowStyle:2,headerColumnStyle:4,firstRowStyle:8,secondRowStyle:16,lastRowStyle:32,firstColumnStyle:128,secondColumnStyle:256,lastColumnStyle:512};class We{constructor(e,t){f(this,"_name");f(this,"wholeStyle",null);f(this,"headerRowStyle",null);f(this,"headerColumnStyle",null);f(this,"firstRowStyle",null);f(this,"secondRowStyle",null);f(this,"lastRowStyle",null);f(this,"firstColumnStyle",null);f(this,"secondColumnStyle",null);f(this,"lastColumnStyle",null);f(this,"_mergeCacheMap",new Map);t&&this.fromJson({...t,name:e}),this._name=e}getName(){return this._name}getWholeStyle(){return this.wholeStyle}setWholeStyle(e){this.wholeStyle=e}getFirstRowStyle(){return this.firstRowStyle}setFirstRowStyle(e){this.firstRowStyle=e}getSecondRowStyle(){return this.secondRowStyle}setSecondRowStyle(e){this.secondRowStyle=e}getLastRowStyle(){return this.lastRowStyle}setLastRowStyle(e){this.lastRowStyle=e}getFirstColumnStyle(){return this.firstColumnStyle}setFirstColumnStyle(e){this.firstColumnStyle=e}getSecondColumnStyle(){return this.secondColumnStyle}setSecondColumnStyle(e){this.secondColumnStyle=e}getLastColumnStyle(){return this.lastColumnStyle}setLastColumnStyle(e){this.lastColumnStyle=e}getHeaderRowStyle(){return this.headerRowStyle}setHeaderRowStyle(e){this.headerRowStyle=e}getHeaderColumnStyle(){return this.headerColumnStyle}setHeaderColumnStyle(e){this.headerColumnStyle=e}getStyle(e,t,n,s){let r=0;return n&&(r=r|J.lastRowStyle),s&&(r=r|J.lastColumnStyle),e>=0&&t>=0&&(r=r|J.wholeStyle),e%2===1&&(r=r|J.firstRowStyle),e%2===0&&(r=r|J.secondRowStyle),e===0&&(r=r|J.headerRowStyle),t===0&&(r=r|J.headerColumnStyle),t%2===1&&(r=r|J.firstColumnStyle),t%2===0&&(r=r|J.secondColumnStyle),r===0?null:this._getMergeStyle(r)}_getMergeStyle(e){let t=this._mergeCacheMap.get(e);return t||(t=this._mergeStyle(e),this._mergeCacheMap.set(e,t)),t}_mergeStyle(e){const t=[];return this.wholeStyle&&e&J.wholeStyle&&t.push(this.wholeStyle),this.firstColumnStyle&&e&J.firstColumnStyle&&t.push(this.firstColumnStyle),this.secondColumnStyle&&e&J.secondColumnStyle&&t.push(this.secondColumnStyle),this.firstRowStyle&&e&J.firstRowStyle&&t.push(this.firstRowStyle),this.secondRowStyle&&e&J.secondRowStyle&&t.push(this.secondRowStyle),this.headerColumnStyle&&e&J.headerColumnStyle&&t.push(this.headerColumnStyle),this.lastColumnStyle&&e&J.lastColumnStyle&&t.push(this.lastColumnStyle),this.headerRowStyle&&e&J.headerRowStyle&&t.push(this.headerRowStyle),this.lastRowStyle&&e&J.lastRowStyle&&t.push(this.lastRowStyle),Ri(t)}toJson(){const e={name:this._name};return this.wholeStyle&&(e.wholeStyle=K(this.wholeStyle)),this.headerRowStyle&&(e.headerRowStyle=K(this.headerRowStyle)),this.headerColumnStyle&&(e.headerColumnStyle=K(this.headerColumnStyle)),this.firstRowStyle&&(e.firstRowStyle=K(this.firstRowStyle)),this.secondRowStyle&&(e.secondRowStyle=K(this.secondRowStyle)),this.lastRowStyle&&(e.lastRowStyle=K(this.lastRowStyle)),this.firstColumnStyle&&(e.firstColumnStyle=K(this.firstColumnStyle)),this.secondColumnStyle&&(e.secondColumnStyle=K(this.secondColumnStyle)),this.lastColumnStyle&&(e.lastColumnStyle=K(this.lastColumnStyle)),e}fromJson(e){this._name=e.name,e.wholeStyle&&(this.wholeStyle=K(e.wholeStyle)),e.headerRowStyle&&(this.headerRowStyle=K(e.headerRowStyle)),e.headerColumnStyle&&(this.headerColumnStyle=K(e.headerColumnStyle)),e.firstRowStyle&&(this.firstRowStyle=K(e.firstRowStyle)),e.secondRowStyle&&(this.secondRowStyle=K(e.secondRowStyle)),e.lastRowStyle&&(this.lastRowStyle=K(e.lastRowStyle)),e.firstColumnStyle&&(this.firstColumnStyle=K(e.firstColumnStyle)),e.secondColumnStyle&&(this.secondColumnStyle=K(e.secondColumnStyle)),e.lastColumnStyle&&(this.lastColumnStyle=K(e.lastColumnStyle))}dispose(){this._mergeCacheMap.clear()}}const Ci=(o,e,t)=>new We(`light-${o}`,{headerRowStyle:{bg:{rgb:e}},firstColumnStyle:{bg:{rgb:"rgb(255, 255, 255)"}},secondColumnStyle:{bg:{rgb:t}},lastRowStyle:{bg:{rgb:e}}}),Si=(o,e,t)=>new We(`middle-${o}`,{headerRowStyle:{bg:{rgb:e}},headerColumnStyle:{bg:{rgb:t}},secondRowStyle:{bg:{rgb:t}},lastRowStyle:{bg:{rgb:e}},lastColumnStyle:{bg:{rgb:t}}}),fi=(o,e,t,n)=>new We(`dark-${o}`,{headerRowStyle:{bg:{rgb:e},cl:{rgb:"rgb(255, 255, 255)"},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE},firstRowStyle:{bg:{rgb:t}},secondRowStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:e}}}),vi=[{baseName:"blue",header:"rgb(164, 202, 254)",color:"rgb(225, 239, 254)"},{baseName:"grey",header:"rgb(205, 208, 216)",color:"rgb(238, 239, 241)"},{baseName:"red",header:"rgb(248, 180, 180)",color:"rgb(253, 232, 232)"},{baseName:"orange",header:"rgb(253, 186, 140)",color:"rgb(254, 236, 220)"},{baseName:"yellow",header:"rgb(250, 200, 21)",color:"rgb(255, 244, 185)"},{baseName:"green",header:"rgb(132, 225, 188)",color:"rgb(222, 247, 236)"},{baseName:"azure",header:"rgb(126, 220, 226)",color:"rgb(213, 245, 246)"},{baseName:"indigo",header:"rgb(186, 198, 248)",color:"rgb(233, 237, 255)"},{baseName:"purple",header:"rgb(202, 191, 253)",color:"rgb(237, 235, 254)"},{baseName:"magenta",header:"rgb(248, 180, 217)",color:"rgb(252, 232, 243)"}],Ii=[{baseName:"blue",rowHeader:"rgb(63, 131, 248)",colHeader:"rgb(195, 221, 253)"},{baseName:"grey",rowHeader:"rgb(95, 101, 116)",colHeader:"rgb(227, 229, 234)"},{baseName:"red",rowHeader:"rgb(240, 82, 82)",colHeader:"rgb(251, 213, 213)"},{baseName:"orange",rowHeader:"rgb(255, 90, 31)",colHeader:"rgb(252, 217, 189)"},{baseName:"yellow",rowHeader:"rgb(212, 157, 15)",colHeader:"rgb(252, 220, 106)"},{baseName:"green",rowHeader:"rgb(13, 164, 113)",colHeader:"rgb(188, 240, 218)"},{baseName:"azure",rowHeader:"rgb(6, 148, 162)",colHeader:"rgb(175, 236, 239)"},{baseName:"indigo",rowHeader:"rgb(70, 106, 247)",colHeader:"rgb(210, 218, 250)"},{baseName:"purple",rowHeader:"rgb(144, 97, 249)",colHeader:"rgb(220, 215, 254)"},{baseName:"magenta",rowHeader:"rgb(231, 70, 148)",colHeader:"rgb(250, 209, 232)"}],pi=[{baseName:"blue",rowHeader:"rgb(30, 66, 159)",firstRow:"rgb(195, 221, 253)",secondRow:"rgb(118, 169, 250)"},{baseName:"grey",rowHeader:"rgb(44, 48, 64)",firstRow:"rgb(227, 229, 234)",secondRow:"rgb(151, 157, 172)"},{baseName:"red",rowHeader:"rgb(155, 28, 28)",firstRow:"rgb(251, 213, 213)",secondRow:"rgb(249, 128, 128)"},{baseName:"orange",rowHeader:"rgb(180, 52, 3)",firstRow:"rgb(252, 217, 189)",secondRow:"rgb(255, 138, 76)"},{baseName:"yellow",rowHeader:"rgb(154, 109, 21)",firstRow:"rgb(252, 220, 106)",secondRow:"rgb(212, 157, 15)"},{baseName:"green",rowHeader:"rgb(4, 108, 78)",firstRow:"rgb(188, 240, 218)",secondRow:"rgb(49, 196, 141)"},{baseName:"azure",rowHeader:"rgb(3, 102, 114)",firstRow:"rgb(175, 236, 239)",secondRow:"rgb(22, 189, 202)"},{baseName:"indigo",rowHeader:"rgb(16, 51, 191)",firstRow:"rgb(210, 218, 250)",secondRow:"rgb(98, 128, 249)"},{baseName:"purple",rowHeader:"rgb(74, 29, 150)",firstRow:"rgb(220, 215, 254)",secondRow:"rgb(172, 148, 250)"},{baseName:"magenta",rowHeader:"rgb(153, 21, 75)",firstRow:"rgb(250, 209, 232)",secondRow:"rgb(241, 126, 184)"}],Mi=vi.map(({baseName:o,header:e,color:t})=>Ci(o,e,t)),wi=Ii.map(({baseName:o,rowHeader:e,colHeader:t})=>Si(o,e,t)),yi=pi.map(({baseName:o,rowHeader:e,firstRow:t,secondRow:n})=>fi(o,e,t,n)),_i=[...Mi,...wi,...yi],bi={headerRowStyle:{bg:{rgb:"rgb(68,114,196)"},cl:{rgb:"rgb(255,255,255)"},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE},firstRowStyle:{bg:{rgb:"rgb(217,225,242)"}},lastRowStyle:{bd:{t:{s:i.BorderStyleTypes.THIN,cl:{rgb:"rgb(68,114,196)"}}},ht:i.HorizontalAlign.CENTER,bl:i.BooleanNumber.TRUE}},Ti=new We("default",bi);var Ui=Object.defineProperty,Ei=Object.getOwnPropertyDescriptor,Pi=(o,e,t,n)=>{for(var s=n>1?void 0:n?Ei(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Ui(e,t,s),s},zo=(o,e)=>(t,n)=>e(t,n,o);const Ni="SHEET_RANGE_THEME_MODEL_PLUGIN";let ge=class extends i.Disposable{constructor(e,t){super();f(this,"_rangeThemeStyleMap",new Map);f(this,"_rangeThemeStyleRuleMap",new Map);f(this,"_rTreeCollection",new Map);f(this,"_defaultRangeThemeMap",new Map);this._sheetInterceptorService=e,this._resourceManagerService=t,this._registerIntercept(),this._initSnapshot(),this._initDefaultTheme()}_initDefaultTheme(){this.registerDefaultRangeTheme(Ti);for(const e of _i)this.registerDefaultRangeTheme(e)}_ensureRangeThemeStyleMap(e){return this._rangeThemeStyleMap.has(e)||this._rangeThemeStyleMap.set(e,new Map),this._rangeThemeStyleMap.get(e)}_ensureRangeThemeStyleRuleMap(e){return this._rangeThemeStyleRuleMap.has(e)||this._rangeThemeStyleRuleMap.set(e,new Map),this._rangeThemeStyleRuleMap.get(e)}_ensureRTreeCollection(e){return this._rTreeCollection.has(e)||this._rTreeCollection.set(e,new i.RTree),this._rTreeCollection.get(e)}getDefaultRangeThemeStyle(e){return this._defaultRangeThemeMap.get(e)}registerRangeThemeRule(e,t){const{unitId:n,subUnitId:s,range:r}=t,a=i.generateRandomId(),l=this._ensureRangeThemeStyleRuleMap(n),u=this._ensureRTreeCollection(n);l.set(a,{rangeInfo:t,themeName:e}),u.insert({unitId:n,sheetId:s,range:r,id:a})}getRegisteredRangeThemeStyle(e){const{unitId:t,subUnitId:n,range:s}=e,r=this._ensureRTreeCollection(t),a=Array.from(r.bulkSearch([{unitId:t,sheetId:n,range:s}]));if(a[0]){const u=this._ensureRangeThemeStyleRuleMap(t).get(a[0]);if(u)return u.themeName}}removeRangeThemeRule(e,t){const{unitId:n,subUnitId:s,range:r}=t,a=this._ensureRTreeCollection(n),l=Array.from(a.bulkSearch([{unitId:n,sheetId:s,range:r}]));if(l[0]){const u=this._ensureRangeThemeStyleRuleMap(n),d=u.get(l[0]);d&&d.themeName===e&&(u.delete(l[0]),a.remove({unitId:n,sheetId:s,range:r,id:l[0]}))}}registerDefaultRangeTheme(e){this._defaultRangeThemeMap.set(e.getName(),e)}getRegisteredRangeThemes(){return Array.from(this._defaultRangeThemeMap.keys())}registerRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).set(t.getName(),t)}unregisterRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).delete(t)}getALLRegisteredTheme(){return Array.from(this._rangeThemeStyleMap.keys())}getRangeThemeStyle(e,t){return this._defaultRangeThemeMap.has(t)?this._defaultRangeThemeMap.get(t):this._ensureRangeThemeStyleMap(e).get(t)}getCellStyle(e,t,n,s){const r={startRow:n,startColumn:s,endRow:n,endColumn:s},a=this._ensureRTreeCollection(e),l=Array.from(a.bulkSearch([{unitId:e,sheetId:t,range:r}]));if(l[0]){const d=this._ensureRangeThemeStyleRuleMap(e).get(l[0]);if(d){const{rangeInfo:c,themeName:m}=d,h=n-c.range.startRow,R=s-c.range.startColumn;return this.getRangeThemeStyle(e,m).getStyle(h,R,n===c.range.endRow,s===c.range.endColumn)}}}_registerIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ae.CELL_CONTENT,{id:jo,effect:i.InterceptorEffectEnum.Style,handler:(e,t,n)=>{const{row:s,col:r,unitId:a,subUnitId:l}=t,u=this.getCellStyle(a,l,s,r);if(u){const d={...e};return d.themeStyle=u,n(d)}return n(e)}}))}toJson(e){const t=this._ensureRangeThemeStyleRuleMap(e),n=this._ensureRangeThemeStyleMap(e);if(n.size===0&&t.size===0)return"{}";const s={};t.forEach((a,l)=>{s[l]=a});const r={};return n.forEach((a,l)=>{r[l]=a.toJson()}),JSON.stringify({rangeThemeStyleRuleMap:s,rangeThemeStyleMapJson:r})}fromJSON(e){const{rangeThemeStyleRuleMap:t,rangeThemeStyleMapJson:n}=e;this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._rTreeCollection.clear(),!(!t||!n)&&(Object.keys(t).forEach(s=>{const r=t[s],{themeName:a,rangeInfo:l}=r;this.registerRangeThemeRule(a,l),this._ensureRTreeCollection(l.unitId).insert({unitId:s,sheetId:l.subUnitId,range:l.range,id:s})}),Object.keys(n).forEach(s=>{const r=n[s],a=new We(r.name);a.fromJson(r),this._ensureRangeThemeStyleMap(s).set(a.getName(),a)}))}deleteUnitId(e){this._rangeThemeStyleMap.delete(e),this._rangeThemeStyleRuleMap.delete(e),this._rTreeCollection.delete(e)}_initSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e=>this.toJson(e),parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},businesses:[i.UniverInstanceType.UNIVER_SHEET],pluginName:Ni,onLoad:(e,t)=>{this.fromJSON(t)},onUnLoad:e=>{this.deleteUnitId(e)}}))}dispose(){super.dispose(),this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._defaultRangeThemeMap.clear(),this._rTreeCollection.clear()}};ge=Pi([zo(0,i.Inject(g.SheetInterceptorService)),zo(1,i.Inject(i.IResourceManagerService))],ge);function Yo(o,e){const{unitId:t}=e,n=t?o.getUniverSheetInstance(t):o.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);return n?{workbook:n,unitId:n.getUnitId()}:null}function E(o,e={}){const{unitId:t,subUnitId:n}=e,s=t?o.getUniverSheetInstance(t):o.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!s)return null;const r=n?s.getSheetBySheetId(n):s.getActiveSheet(!0);return r?{worksheet:r,workbook:s,unitId:s.getUnitId(),subUnitId:r.getSheetId()}:null}function Ve(o,e){const{unitId:t,subUnitId:n}=e,s=o.getUniverSheetInstance(t);if(!s)return null;const r=s.getSheetBySheetId(n);return r?{worksheet:r,workbook:s}:null}const qe={id:"sheet.mutation.set-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,range:s,themeName:r}=e,a=o.get(i.IUniverInstanceService),l=E(a),u=o.get(ge);return l?(u.registerRangeThemeRule(r,{range:s,unitId:t,subUnitId:n}),!0):!1}},Ko=(o,e)=>{const t=Ve(o.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetRangeThemeStyleMutation]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),range:e.range,themeName:e.themeName}},ze={id:"sheet.mutation.remove-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,range:s,themeName:r}=e,a=o.get(i.IUniverInstanceService),l=E(a),u=o.get(ge);return l?(u.removeRangeThemeRule(r,{range:s,unitId:t,subUnitId:n}),!0):!1}},Jo=(o,e)=>{const t=Ve(o.get(i.IUniverInstanceService),e);if(!t)throw new Error("[DeleteWorksheetRangeThemeStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),range:e.range,themeName:e.themeName}},xo={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-range-theme-style",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{unitId:s}=e,r=Ko(o,e);return t.syncExecuteCommand(qe.id,e)?(n.pushUndoRedo({unitID:s,undoMutations:[{id:ze.id,params:r}],redoMutations:[{id:qe.id,params:e}]}),!0):!1}},ki=(o,e,t="")=>o.reduce((n,s)=>{const r=s&&s[e];return typeof r!="string"?(console.warn(s,`${e} is not string`),n):(r?(n[r]||(n[r]=[]),n[r].push(s)):n[t].push(s),n)},{}),Oi=(o=0)=>{let e=o;return function(){return e++}};function un(o){const e=new i.ObjectMatrix;return o.forEach(t=>{const{startRow:n,startColumn:s,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=s;u<=a;u++)e.setValue(l,u,null)}),e.clone()}function Xo(o){const e=new i.ObjectMatrix;return o.forEach(t=>{const{startRow:n,startColumn:s,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=s;u<=a;u++)e.setValue(l,u,{v:null,p:null,f:null,si:null,custom:null})}),e.clone()}function Di(o){const e=new i.ObjectMatrix;return o.forEach(t=>{const{startRow:n,startColumn:s,endRow:r,endColumn:a}=t;for(let l=n;l<=r;l++)for(let u=s;u<=a;u++)e.setValue(l,u,{s:null})}),e.clone()}var Q=(o=>(o[o.MOVE_START=0]="MOVE_START",o[o.MOVING=1]="MOVING",o[o.MOVE_END=2]="MOVE_END",o[o.ONLY_SET=3]="ONLY_SET",o))(Q||{});class Zo extends i.Disposable{constructor(t){super();f(this,"_worksheetSelections",new Map);f(this,"_selectionMoveStart$",new W.Subject);f(this,"selectionMoveStart$",this._selectionMoveStart$.asObservable());f(this,"_selectionMoving$",new W.Subject);f(this,"selectionMoving$",this._selectionMoving$.asObservable());f(this,"_selectionMoveEnd$",new W.BehaviorSubject([]));f(this,"selectionMoveEnd$",this._selectionMoveEnd$.asObservable());f(this,"_selectionSet$",new W.BehaviorSubject([]));f(this,"selectionSet$",this._selectionSet$.asObservable());f(this,"_beforeSelectionMoveEnd$",new W.BehaviorSubject([]));f(this,"beforeSelectionMoveEnd$",this._beforeSelectionMoveEnd$.asObservable());this._workbook=t}dispose(){super.dispose(),this._beforeSelectionMoveEnd$.complete(),this._selectionMoveEnd$.complete(),this._selectionMoving$.complete(),this._selectionMoveStart$.complete(),this._selectionSet$.complete()}addSelections(t,n){const s=this.getSelectionsOfWorksheet(t);s.push(...n),this._selectionSet$.next(s)}setSelections(t,n=[],s){switch(this.setSelectionsOfWorksheet(t,n),s){case Q.MOVE_START:this._selectionMoveStart$.next(n);break;case Q.MOVING:this._selectionMoving$.next(n);break;case Q.MOVE_END:this._beforeSelectionMoveEnd$.next(n),this._selectionMoveEnd$.next(n);break;case Q.ONLY_SET:{this._selectionSet$.next(n);break}default:this._selectionSet$.next(n);break}}getCurrentSelections(){return this._getCurrentSelections()}getSelectionOfWorksheet(t){return this.getSelectionsOfWorksheet(t)}getSelectionsOfWorksheet(t){return this._worksheetSelections.has(t)||this._worksheetSelections.set(t,[]),this._worksheetSelections.get(t)}setSelectionsOfWorksheet(t,n){this._worksheetSelections.set(t,[...n])}deleteSheetSelection(t){this._worksheetSelections.set(t,[])}clear(){this._worksheetSelections.clear(),this._eventAfterSetSelections([])}_getCurrentSelections(){return this.getSelectionsOfWorksheet(this._workbook.getActiveSheet().getSheetId())}getCurrentLastSelection(){const t=this._getCurrentSelections();return t[t.length-1]}_eventAfterSetSelections(t){this._selectionSet$.next(t)}}var Ai=Object.defineProperty,Wi=Object.getOwnPropertyDescriptor,Vi=(o,e,t,n)=>{for(var s=n>1?void 0:n?Wi(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Ai(e,t,s),s},$i=(o,e)=>(t,n)=>e(t,n,o);g.SheetsSelectionsService=class extends i.RxDisposable{constructor(t){super();f(this,"selectionMoveStart$");f(this,"selectionMoving$");f(this,"selectionMoveEnd$");f(this,"selectionSet$");f(this,"_workbookSelections",new Map);this._instanceSrv=t,this._init()}get _currentSelectionPos(){const t=this._instanceSrv.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const n=t.getActiveSheet();return{unitId:t.getUnitId(),sheetId:n.getSheetId()}}get currentSelectionParam(){return this._currentSelectionPos}_init(){const t=this._instanceSrv.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).pipe(W.shareReplay(1),W.takeUntil(this.dispose$));this.selectionMoveStart$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveStart$:W.of())),this.selectionMoving$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoving$:W.of())),this.selectionMoveEnd$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionMoveEnd$:W.of([]))),this.selectionSet$=t.pipe(W.switchMap(n=>n?this._ensureWorkbookSelection(n.getUnitId()).selectionSet$:W.of([]))),this._instanceSrv.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).pipe(W.takeUntil(this.dispose$)).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId())})}clear(){this._workbookSelections.forEach(t=>t.clear())}getCurrentSelections(){return this._getCurrentSelections()}getCurrentLastSelection(){const t=this._getCurrentSelections();return t==null?void 0:t[t.length-1]}addSelections(t,n,s){if(typeof t=="string"){this._ensureWorkbookSelection(t).addSelections(n,s);return}const r=this._currentSelectionPos;if(!r)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:a,sheetId:l}=r;this._ensureWorkbookSelection(a).addSelections(l,t)}setSelections(t,n,s,r){if(typeof t=="string"&&typeof n=="string"){const d=t;this.getWorkbookSelections(d).setSelections(n,s||[],r!=null?r:Q.ONLY_SET);return}const a=this._currentSelectionPos;if(!a)throw new Error("[SheetsSelectionsService]: cannot find current selection position!");const{unitId:l,sheetId:u}=a;if(typeof t=="object"){const d=t!=null?t:s,c=n!=null?n:Q.ONLY_SET;this._ensureWorkbookSelection(l).setSelections(u,d,c)}}clearCurrentSelections(){this._getCurrentSelections().splice(0)}isOverlapping(){const t=this.getCurrentSelections();return t==null?!1:t.some(({range:n},s)=>t.some(({range:r},a)=>s===a?!1:n.startRow<=r.endRow&&n.endRow>=r.startRow&&n.startColumn<=r.endColumn&&n.endColumn>=r.startColumn))}_getCurrentSelections(){const t=this._currentSelectionPos;if(!t)return[];const{unitId:n,sheetId:s}=t;return this._ensureWorkbookSelection(n).getSelectionsOfWorksheet(s)}getWorkbookSelections(t){return this._ensureWorkbookSelection(t)}_ensureWorkbookSelection(t){let n=this._workbookSelections.get(t);if(!n){const s=this._instanceSrv.getUnit(t);if(!s)throw new Error(`[SheetsSelectionsService]: cannot resolve unit with id "${t}"!`);n=new Zo(s),this._workbookSelections.set(t,n)}return n}_removeWorkbookSelection(t){this._workbookSelections.delete(t)}},g.SheetsSelectionsService=Vi([$i(0,i.IUniverInstanceService)],g.SheetsSelectionsService);const Li="DISABLE_NORMAL_SELECTIONS",Bi="SELECTIONS_ENABLED",Qo="REF_SELECTIONS_ENABLED";function Hi(o,e,t){var a;const n=o.getStyleByCell(e);n==null&&delete e.s,typeof t.s=="string"&&(t.s=o.get(t.s));const s=Nt(n,t.s?t.s:null);s&&i.Tools.removeNull(s),i.Tools.isEmptyObject(s)?delete e.s:e.s=o.setValue(s);const r=t.v?`${t.v}\r
|
|
11
|
+
`:"";!t.p&&e.p&&(r&&r!==((a=e.p.body)==null?void 0:a.dataStream)?delete e.p:Gi(e.p,t.s?t.s:null))}function Fi(o,e){if(!e||!Object.keys(e).length)return o;const t=o||{};for(const n in e)n==="bd"?t[n]=ji(t[n]||{},e[n]):n in t||(t[n]=null);return t}function ji(o,e){if(!e||!Object.keys(e).length)return o;for(const t in e)t in o||(o[t]=null);return o}function Nt(o,e,t=!1){if(e===null)return e;if(e===void 0)return o;const n=i.Tools.deepClone(o)||{};for(const s in e)t&&["bd","tr","td","ht","vt","tb","pd","bg"].includes(s)||(s in n&&s==="bd"?n[s]=Object.assign(n[s],e[s]):n[s]=e[s]);return"cl"in n&&("ul"in n&&n.ul&&(n.ul.cl=n.cl),"ol"in n&&n.ol&&(n.ol.cl=n.cl),"st"in n&&n.st&&(n.st.cl=n.cl)),n}function es(o,e){return o.some(t=>t.startIndex===e)?es(o,e+1):e}function Gi(o,e){var a;if(o.body==null)return;Array.isArray(o.body.textRuns)||(o.body.textRuns=[]);let t=0;const n=[],s=((a=o.body)==null?void 0:a.paragraphs)||[];for(const l of o.body.textRuns){const{st:u,ed:d,ts:c={}}=l;if(t<u){const h={st:t,ed:u},R=Nt({},e,!0);R&&i.Tools.removeNull(R),i.Tools.isEmptyObject(R)||(h.ts=R),n.push(h)}const m=Nt(c,e,!0);m&&i.Tools.removeNull(m),i.Tools.isEmptyObject(m)?delete l.ts:l.ts=m,n.push(l),t=es(s,d)}const r=o.body.dataStream.endsWith(`\r
|
|
12
|
+
`)?o.body.dataStream.length-2:o.body.dataStream.length;if(t<r){const l={st:t,ed:r},u=Nt({},e,!0);u&&i.Tools.removeNull(u),i.Tools.isEmptyObject(u)||(l.ts=u),n.push(l)}o.body.textRuns=i.normalizeTextRuns(n)}function qi(o,e,t){if(e.t)return e.t;if(e.v===null)return null;const n=o.getStyleByCell(e),s=o.getStyleByCell(t);if(t.t===i.CellValueType.FORCE_STRING){if(!dn(s)&&e.v!==void 0){if(i.isRealNum(e.v))return i.CellValueType.NUMBER;if(i.isBooleanString(`${e.v}`))return i.CellValueType.BOOLEAN}return i.CellValueType.FORCE_STRING}return zi(n)?dn(n)?i.CellValueType.STRING:ts(e,t):dn(s)?i.CellValueType.STRING:ts(e,t)}function ts(o,e){return o.v!==void 0?ns(o.v,o.t):ns(e.v,e.t)}function zi(o){var e;return!!((e=o==null?void 0:o.n)!=null&&e.pattern)}function dn(o){var e;return((e=o==null?void 0:o.n)==null?void 0:e.pattern)===Vo.DEFAULT_TEXT_FORMAT}function ns(o,e){return o===null?null:typeof o=="string"?i.isRealNum(o)?(+o==0||+o==1)&&e===i.CellValueType.BOOLEAN?i.CellValueType.BOOLEAN:i.CellValueType.NUMBER:i.isBooleanString(o)?i.CellValueType.BOOLEAN:i.CellValueType.STRING:typeof o=="number"?(o===0||o===1)&&e===i.CellValueType.BOOLEAN?i.CellValueType.BOOLEAN:i.CellValueType.NUMBER:typeof o=="boolean"?i.CellValueType.BOOLEAN:i.CellValueType.FORCE_STRING}function os(o,e){return o===i.CellValueType.NUMBER?Number(e.v):o===i.CellValueType.BOOLEAN?Yi(e.v)?1:0:o===i.CellValueType.STRING||o===i.CellValueType.FORCE_STRING?`${e.v}`:e.v}function Yi(o){if(typeof o=="string"){if(o.toUpperCase()==="TRUE")return!0;if(o.toUpperCase()==="FALSE")return!1;if(i.isSafeNumeric(o)){if(Number(o)===0)return!1;if(Number(o)===1)return!0}}if(typeof o=="number"){if(o===0)return!1;if(o===1)return!0}return typeof o=="boolean"?o:null}function Ki(o){return o==null?null:(o.f===void 0&&(o.f=null),o.si===void 0&&(o.si=null),o.p===void 0&&(o.p=null),o.v===void 0&&(o.v=null),o.t===void 0&&(o.t=null),o.s===void 0&&(o.s=null),o.custom===void 0&&(o.custom=null),o)}const se=(o,e)=>{const{unitId:t,subUnitId:n,cellValue:s}=e,a=o.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(a==null)throw new Error("workbook is null error!");const l=a.getSheetBySheetId(n);if(l==null)throw new Error("worksheet is null error!");const u=l.getCellMatrix(),d=a.getStyles(),c=new i.ObjectMatrix;return new i.ObjectMatrix(s).forValue((h,R,C)=>{const S=i.Tools.deepClone(u==null?void 0:u.getValue(h,R))||{},v=d.getStyleByCell(S),I=d.getStyleByCell(C);S.s=Fi(v,I),c.setValue(h,R,Ki(S))}),{...e,options:{},cellValue:c.getMatrix()}},B={id:"sheet.mutation.set-range-values",type:i.CommandType.MUTATION,handler:(o,e)=>{const{cellValue:t,subUnitId:n,unitId:s}=e,a=o.get(i.IUniverInstanceService).getUnit(s);if(!a)return!1;const l=a.getSheetBySheetId(n);if(!l)return!1;const u=l.getCellMatrix(),d=a.getStyles();return new i.ObjectMatrix(t).forValue((m,h,R)=>{if(!R)u==null||u.setValue(m,h,{});else{const C=u.getValue(m,h)||{},S=qi(d,R,C);R.f!==void 0&&(C.f=R.f),R.si!==void 0&&(C.si=R.si),R.p!==void 0&&(C.p=R.p),R.v!==void 0&&(C.v=os(S,R)),C.v!==void 0&&(C.t=S,C.v=os(S,C)),R.s!==void 0&&Hi(d,C,R),R.custom!==void 0&&(C.custom=R.custom),u.setValue(m,h,i.Tools.removeNull(C))}}),!0}},kt={id:"sheet.command.clear-selection-all",type:i.CommandType.COMMAND,handler:(o,e)=>{var p;const t=o.get(i.IUniverInstanceService),n=o.get(i.ICommandService),s=o.get(g.SheetsSelectionsService),r=o.get(i.IUndoRedoService),a=o.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=s.getCurrentSelections())==null?void 0:p.map(M=>M.range));if(!(m!=null&&m.length))return!1;const h=[],R=[],C={subUnitId:c,unitId:u,cellValue:un(m)},S=se(o,C);h.push({id:B.id,params:C}),R.push({id:B.id,params:S});const v=a.onCommandExecute({id:kt.id});return h.push(...v.redos),R.unshift(...v.undos),i.sequenceExecute(h,n)?(r.pushUndoRedo({unitID:u,undoMutations:R,redoMutations:h}),!0):!1}},cn={id:"sheet.command.clear-selection-content",type:i.CommandType.COMMAND,handler:(o,e)=>{var p;const t=o.get(i.IUniverInstanceService),n=o.get(i.ICommandService),s=o.get(g.SheetsSelectionsService),r=o.get(i.IUndoRedoService),a=o.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=s.getCurrentSelections())==null?void 0:p.map(M=>M.range));if(!(m!=null&&m.length))return!1;const h={subUnitId:c,unitId:u,cellValue:Xo(m)},R=se(o,h),C=a.onCommandExecute({id:cn.id}),S=[{id:B.id,params:h},...C.redos],v=[...C.undos,{id:B.id,params:R}];return i.sequenceExecute(S,n).result?(r.pushUndoRedo({unitID:u,undoMutations:v,redoMutations:S}),!0):!1}},Ot={id:"sheet.command.clear-selection-format",type:i.CommandType.COMMAND,handler:(o,e)=>{var p;const t=o.get(i.IUniverInstanceService),n=o.get(i.ICommandService),s=o.get(g.SheetsSelectionsService),r=o.get(i.IUndoRedoService),a=o.get(g.SheetInterceptorService),l=t.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const u=(e==null?void 0:e.unitId)||l.getUnitId(),d=l.getActiveSheet();if(!d)return!1;const c=(e==null?void 0:e.subUnitId)||d.getSheetId(),m=(e==null?void 0:e.ranges)||((p=s.getCurrentSelections())==null?void 0:p.map(M=>M.range));if(!(m!=null&&m.length))return!1;const h=[],R=[],C={subUnitId:c,unitId:u,cellValue:Di(m)},S=se(o,C);h.push({id:B.id,params:C}),R.push({id:B.id,params:S});const v=a.onCommandExecute({id:Ot.id});return h.push(...v.redos),R.unshift(...v.undos),i.sequenceExecute(h,n)?(r.pushUndoRedo({unitID:u,undoMutations:R,redoMutations:h}),!0):!1}},mn=(o,e)=>({subUnitId:e.sheet.id,unitId:e.unitId,subUnitName:e.sheet.name}),Ye={id:"sheet.mutation.insert-sheet",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService),{sheet:n,index:s,unitId:r}=e,a=t.getUniverSheetInstance(r);return a?a.addWorksheet(n.id,s,n):!1}},ss=(o,e)=>{const t=o.get(i.IUniverInstanceService),{subUnitId:n,unitId:s}=e,r=Ve(t,e);if(!r)throw new Error("[RemoveSheetUndoMutationFactory]: Worksheet is null error!");const{workbook:a,worksheet:l}=r,u=l.getConfig();return{index:a.getConfig().sheetOrder.findIndex(m=>m===n),sheet:u,unitId:s}},$e={id:"sheet.mutation.remove-sheet",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService),{subUnitId:n,unitId:s}=e,r=t.getUniverSheetInstance(s);return r?r.removeSheet(n):!1}},hn={type:i.CommandType.COMMAND,id:"sheet.command.copy-sheet",handler:(o,e)=>{var w,y;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetInterceptorService),a=o.get(i.LocaleService),l=E(s,e);if(!l)return!1;const{workbook:u,worksheet:d,unitId:c,subUnitId:m}=l,h=i.Tools.deepClone(d.getConfig());h.name=Ji(u,a,h.name),h.id=i.Tools.generateRandomId();const C={index:u.getSheetIndex(d)+1,sheet:h,unitId:c},S=mn(o,C),v=r.onCommandExecute({id:hn.id,params:{unitId:c,subUnitId:m,targetSubUnitId:h.id}}),I=[...(w=v.preRedos)!=null?w:[],{id:Ye.id,params:C},...v.redos],p=[...(y=v.preUndos)!=null?y:[],{id:$e.id,params:S},...v.undos];return i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:c,undoMutations:p,redoMutations:I}),!0):!1}};function Ji(o,e,t){let n=t+e.t("sheets.tabs.sheetCopy",""),s=2;for(;o.checkSheetName(n);)n=t+e.t("sheets.tabs.sheetCopy",`${s}`),s++;return n}const _e={id:"sheet.mutation.move-range",type:i.CommandType.MUTATION,handler:(o,e)=>{const{from:t,to:n}=e;if(!t||!n)return!1;const r=o.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getSheetBySheetId(e.from.subUnitId),l=r.getSheetBySheetId(e.to.subUnitId);if(!a||!l)return!1;const u=a.getCellMatrix(),d=l.getCellMatrix();return new i.ObjectMatrix(t.value).forValue((c,m,h)=>{u.setValue(c,m,h)}),new i.ObjectMatrix(n.value).forValue((c,m,h)=>{d.setValue(c,m,h)}),!0}};var xi=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,Zi=(o,e,t,n)=>{for(var s=n>1?void 0:n?Xi(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&xi(e,t,s),s},Qi=(o,e)=>(t,n)=>e(t,n,o);const rs=i.createIdentifier("sheets-formula.ref-selections.service");g.RefSelectionsService=class extends g.SheetsSelectionsService{constructor(e){super(e)}_init(){const e=this._getAliveWorkbooks$().pipe(W.takeUntil(this.dispose$));this.selectionMoveStart$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionMoveStart$)))),this.selectionMoving$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionMoving$)))),this.selectionMoveEnd$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionMoveEnd$)))),this.selectionSet$=e.pipe(W.switchMap(t=>W.merge(...t.map(n=>n.selectionSet$))))}_getAliveWorkbooks$(){const e=this._instanceSrv.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET);e.forEach(n=>this._ensureWorkbookSelection(n.getUnitId()));const t=new W.BehaviorSubject(e);return this.disposeWithMe(this._instanceSrv.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._ensureWorkbookSelection(n.getUnitId()),t.next([...t.getValue(),n])})),this.disposeWithMe(this._instanceSrv.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{this._removeWorkbookSelection(n.getUnitId()),t.next(t.getValue().filter(s=>s!==n))})),t.pipe(W.map(n=>n.map(s=>this._ensureWorkbookSelection(s.getUnitId()))))}},g.RefSelectionsService=Zi([Qi(0,i.IUniverInstanceService)],g.RefSelectionsService);function is(o){const t=o.get(i.IContextService).getContextValue(Qo);return o.get(t?rs:g.SheetsSelectionsService)}const q={id:"sheet.operation.set-selections",type:i.CommandType.OPERATION,handler:(o,e)=>{if(!e)return!1;const{selections:t,type:n,unitId:s,subUnitId:r}=e;return is(o).setSelections(s,r,[...t],n),!0}};function ht(o,e,t=!0){const n=e.getMatrixWithMergedCells(...i.selectionToArray(o)),s=[];if(n.forValue((a,l,u)=>{if(u.colSpan!==void 0&&u.rowSpan!==void 0){const d={startRow:a,startColumn:l,endRow:a+u.rowSpan-1,endColumn:l+u.colSpan-1};i.Rectangle.contains(o,d)||s.push(d)}}),s.length===0)return o;const r=i.Rectangle.union(o,...s);return t?ht(r,e,t):r}function ea(o,e,t){let n=null;return t.getMatrixWithMergedCells(o,e,o,e).forValue((r,a,l)=>(n={actualRow:r,actualColumn:a,startRow:r,startColumn:a,isMerged:l.rowSpan!==void 0||l.colSpan!==void 0,isMergedMainCell:l.rowSpan!==void 0&&l.colSpan!==void 0,endRow:r+(l.rowSpan!==void 0?l.rowSpan-1:0),endColumn:a+(l.colSpan!==void 0?l.colSpan-1:0),rangeType:i.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:o,startRow:o,startColumn:e,endRow:o,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:i.RANGE_TYPE.NORMAL}}function ta(o,e,t){const{startRow:n,startColumn:s,endRow:r,endColumn:a}=o;return Number.isNaN(n)&&(o.startRow=0),Number.isNaN(r)&&(o.endRow=e-1),Number.isNaN(s)&&(o.startColumn=0),Number.isNaN(a)&&(o.endColumn=t-1),o}function te(o,e){const t=Number.isNaN(o.startRow)?0:o.startRow,n=Number.isNaN(o.startColumn)?0:o.startColumn,s=e.getMergedCell(t,n);return s?{...s,actualRow:t,actualColumn:n,rangeType:i.RANGE_TYPE.NORMAL,isMerged:!0,isMergedMainCell:!0}:{startRow:t,startColumn:n,endRow:o.startRow,endColumn:o.startColumn,actualRow:t,actualColumn:n,rangeType:i.RANGE_TYPE.NORMAL,isMerged:!1,isMergedMainCell:!1}}const Re=(o,e,t)=>({id:q.id,params:{unitId:e.getUnitId(),subUnitId:t.getSheetId(),reveal:!0,selections:[{range:o,primary:te(o,t)}]}});function na(o){if(!o)return!1;const{range:e,primary:t}=o;return i.Rectangle.equals(e,t)}function oa(o){function e(t,n){function s(r){for(let a=r.startRow;a<=r.endRow;a++)if(!o.getRowFiltered(a))for(let l=r.startColumn;l<=r.endColumn;l++)n(a,l,r)}s(t)}return{forOperableEach:e}}const as=o=>o.id!==jo;function gt(o,e,t,n,s,r,a){const l={};for(let u=e;u<=t;u++)for(let d=n;d<=s;d++){const c=r?o.getCellWithFilteredInterceptors(a,d,Go,as):o.getCellWithFilteredInterceptors(u,a,Go,as);!c||!c.s||(l[u]||(l[u]={}),l[u][d]={s:c.s})}return l}const ls="sheet.command.move-range",Ke={type:i.CommandType.COMMAND,id:ls,handler:async(o,e)=>{var M,w;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(i.ErrorService),a=o.get(i.LocaleService),l=o.get(g.SheetInterceptorService),u=E(s);if(!u||!await l.beforeCommandExecute({id:Ke.id,params:e}))return!1;const{worksheet:c,subUnitId:m,unitId:h}=u,R=Dt(o,{unitId:h,subUnitId:m,range:e.fromRange},{unitId:h,subUnitId:m,range:e.toRange});if(R===null)return r.emit(a.t("sheets.info.acrossMergedCell")),!1;const C=l.onCommandExecute({id:Ke.id,params:{...e}}),S=[...(M=C.preRedos)!=null?M:[],...R.redos,...C.redos,{id:q.id,params:{unitId:h,subUnitId:m,selections:[{range:e.toRange,primary:sa(e.fromRange,e.toRange,c)}],type:Q.MOVE_END}}],v=[...(w=C.preUndos)!=null?w:[],...R.undos,...C.undos,{id:q.id,params:{unitId:h,subUnitId:m,selections:[{range:e.fromRange,primary:te(e.fromRange,c)}],type:Q.MOVE_END}}],I=i.sequenceExecute(S,t).result,p=l.afterCommandExecute({id:Ke.id,params:{...e}});return I?(i.sequenceExecute(p.redos,t),n.pushUndoRedo({unitID:h,undoMutations:[...v,...p.undos],redoMutations:[...S,...p.redos]}),!0):!1}};function Dt(o,e,t,n=!1){const s=[],r=[],{range:a,subUnitId:l,unitId:u}=e,{range:d,subUnitId:c}=t,h=o.get(i.IUniverInstanceService).getUniverSheetInstance(u),R=h==null?void 0:h.getSheetBySheetId(c),C=h==null?void 0:h.getSheetBySheetId(l),S=R==null?void 0:R.getCellMatrix(),v=C==null?void 0:C.getCellMatrix();if(R&&C&&S&&v){const I=ht(d,R,!1);if(!i.Rectangle.equals(d,I)&&!n)return null;const p=new i.ObjectMatrix,M=new i.ObjectMatrix,w=new i.ObjectMatrix;i.Range.foreach(a,(T,P)=>{const O=v.getValue(T,P);if(p.setValue(T,P,i.Tools.deepClone(O)),O){const A=h==null?void 0:h.getStyles().get(O.s);w.setValue(T,P,i.Tools.deepClone(A))}M.setValue(T,P,null)});const y=new i.ObjectMatrix,b=new i.ObjectMatrix;i.Range.foreach(d,(T,P)=>{y.setValue(T,P,i.Tools.deepClone(S.getValue(T,P)))}),i.Range.foreach(a,(T,P)=>{const O=i.cellToRange(T,P),A=i.Rectangle.getRelativeRange(O,a),H=i.Rectangle.getPositionRange(A,d),$=i.Tools.deepClone(w.getValue(T,P)),F=i.Tools.deepClone(p.getValue(T,P));F&&$&&(F.s=$),b.setValue(H.startRow,H.startColumn,F)});const N={fromRange:e.range,toRange:t.range,from:{value:M.getMatrix(),subUnitId:l},to:{value:b.getMatrix(),subUnitId:c},unitId:u},U={fromRange:t.range,toRange:e.range,from:{value:p.getMatrix(),subUnitId:l},to:{value:y.getMatrix(),subUnitId:c},unitId:u};s.push({id:_e.id,params:N}),r.push({id:_e.id,params:U})}return{redos:s,undos:r}}function sa(o,e,t){const n=o.startRow,s=o.startColumn,r=t.getMergedCell(n,s),a=te(e,t);if(r){const l=r.endRow-r.startRow+1,u=r.endColumn-r.startColumn+1;a.endRow=a.startRow+l-1,a.endColumn=a.startColumn+u-1,a.actualRow=a.startRow,a.actualColumn=a.startColumn,a.isMerged=!1,a.isMergedMainCell=!0}return a}var At=(o=>(o[o.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",o[o.UNIVER_DOC=1]="UNIVER_DOC",o[o.UNIVER_SHEET=2]="UNIVER_SHEET",o[o.UNIVER_SLIDE=3]="UNIVER_SLIDE",o[o.UNIVER_PROJECT=4]="UNIVER_PROJECT",o[o.UNRECOGNIZED=-1]="UNRECOGNIZED",o))(At||{}),_=(o=>(o[o.View=0]="View",o[o.Edit=1]="Edit",o[o.ManageCollaborator=2]="ManageCollaborator",o[o.Print=3]="Print",o[o.Duplicate=4]="Duplicate",o[o.Comment=5]="Comment",o[o.Copy=6]="Copy",o[o.Share=7]="Share",o[o.Export=8]="Export",o[o.MoveWorksheet=9]="MoveWorksheet",o[o.DeleteWorksheet=10]="DeleteWorksheet",o[o.HideWorksheet=11]="HideWorksheet",o[o.RenameWorksheet=12]="RenameWorksheet",o[o.CreateWorksheet=13]="CreateWorksheet",o[o.SetWorksheetStyle=14]="SetWorksheetStyle",o[o.EditWorksheetCell=15]="EditWorksheetCell",o[o.InsertHyperlink=16]="InsertHyperlink",o[o.Sort=17]="Sort",o[o.Filter=18]="Filter",o[o.PivotTable=19]="PivotTable",o[o.FloatImg=20]="FloatImg",o[o.History=21]="History",o[o.RwHgtClWdt=22]="RwHgtClWdt",o[o.ViemRwHgtClWdt=23]="ViemRwHgtClWdt",o[o.ViewFilter=24]="ViewFilter",o[o.MoveSheet=25]="MoveSheet",o[o.DeleteSheet=26]="DeleteSheet",o[o.HideSheet=27]="HideSheet",o[o.CopySheet=28]="CopySheet",o[o.RenameSheet=29]="RenameSheet",o[o.CreateSheet=30]="CreateSheet",o[o.SelectProtectedCells=31]="SelectProtectedCells",o[o.SelectUnProtectedCells=32]="SelectUnProtectedCells",o[o.SetCellStyle=33]="SetCellStyle",o[o.SetCellValue=34]="SetCellValue",o[o.SetRowStyle=35]="SetRowStyle",o[o.SetColumnStyle=36]="SetColumnStyle",o[o.InsertRow=37]="InsertRow",o[o.InsertColumn=38]="InsertColumn",o[o.DeleteRow=39]="DeleteRow",o[o.DeleteColumn=40]="DeleteColumn",o[o.EditExtraObject=41]="EditExtraObject",o[o.Delete=42]="Delete",o[o.RecoverHistory=43]="RecoverHistory",o[o.ViewHistory=44]="ViewHistory",o[o.CreatePermissionObject=45]="CreatePermissionObject",o[o.UNRECOGNIZED=-1]="UNRECOGNIZED",o))(_||{}),D=(o=>(o[o.Unkonwn=0]="Unkonwn",o[o.Workbook=1]="Workbook",o[o.Worksheet=2]="Worksheet",o[o.SelectRange=3]="SelectRange",o[o.Document=4]="Document",o[o.Slide=5]="Slide",o[o.UNRECOGNIZED=-1]="UNRECOGNIZED",o))(D||{});class Rt{constructor(e,t,n){f(this,"type",D.SelectRange);f(this,"subType",_.Edit);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${_.Edit}.${n}`}}class Wt{constructor(e,t,n){f(this,"type",D.SelectRange);f(this,"subType",_.View);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${_.View}.${n}`}}class gn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Comment);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Comment}_${e}`}}class Rn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Copy);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Copy}_${e}`}}class us{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"subType",_.CopySheet);f(this,"status",i.PermissionStatus.INIT);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CopySheet}_${e}`}}class Cn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.CreatePermissionObject);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CreatePermissionObject}_${e}`}}class Sn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.CreateSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.CreateSheet}_${e}`}}class fn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.DeleteSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.DeleteSheet}_${e}`}}class vn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Duplicate);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Duplicate}_${e}`}}class Vt{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Edit);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Edit}_${e}`}}class In{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Export);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Export}_${e}`}}class pn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.HideSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.HideSheet}_${e}`}}class ds{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.History);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.History}_${e}`}}class Mn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.ManageCollaborator);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.ManageCollaborator}_${e}`}}class wn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.MoveSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.MoveSheet}_${e}`}}class yn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Print);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Print}_${e}`}}class _n{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.RecoverHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.RecoverHistory}_${e}`}}class bn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.RenameSheet);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.RenameSheet}_${e}`}}class Tn{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.Share);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.Share}_${e}`}}class Un{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.View);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.View}_${e}`}}class En{constructor(e){f(this,"id");f(this,"value",!0);f(this,"type",D.Workbook);f(this,"status",i.PermissionStatus.INIT);f(this,"subType",_.ViewHistory);this.unitId=e,this.unitId=e,this.id=`${this.type}.${_.ViewHistory}_${e}`}}class Pn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Copy);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Copy}_${e}_${t}`}}class Nn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.DeleteColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.DeleteColumn}_${e}_${t}`}}class kn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Delete);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Delete}_${e}_${t}`}}class On{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.DeleteRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.DeleteRow}_${e}_${t}`}}class Ct{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Edit);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Edit}_${e}_${t}`}}class Dn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.EditExtraObject);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.EditExtraObject}_${e}_${t}`}}class An{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Filter);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Filter}_${e}_${t}`}}class Wn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertColumn);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertColumn}_${e}_${t}`}}class Vn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertHyperlink);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertHyperlink}_${e}_${t}`}}class $n{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.InsertRow);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.InsertRow}_${e}_${t}`}}class Ln{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.ManageCollaborator);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.ManageCollaborator}_${e}_${t}`}}class Bn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.PivotTable);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.PivotTable}_${e}_${t}`}}class cs{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SelectProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SelectProtectedCells}_${e}_${t}`}}class ms{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SelectUnProtectedCells);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SelectUnProtectedCells}_${e}_${t}`}}class Hn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetCellStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetCellStyle}_${e}_${t}`}}class Fn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetCellValue);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetCellValue}_${e}_${t}`}}class jn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetColumnStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetColumnStyle}_${e}_${t}`}}class Gn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.SetRowStyle);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.SetRowStyle}_${e}_${t}`}}class qn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.Sort);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.Sort}_${e}_${t}`}}class zn{constructor(e,t){f(this,"value",!0);f(this,"type",D.Worksheet);f(this,"status",i.PermissionStatus.INIT);f(this,"id");f(this,"subType",_.View);this.unitId=e,this.subUnitId=t,this.id=`${this.type}.${_.View}_${e}_${t}`}}const St={id:"sheet.command.set-range-values",type:i.CommandType.COMMAND,handler:(o,e)=>{var U;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),l=o.get(i.IPermissionService),u=E(s,e);if(!u)return!1;const{subUnitId:d,unitId:c,workbook:m,worksheet:h}=u,{value:R,range:C}=e,S=C?[C]:(U=r.getCurrentSelections())==null?void 0:U.map(T=>T.range);if(!S||!S.length||!l.getPermissionPoint(new Ct(c,d).id))return!1;const v=new i.ObjectMatrix;let I;if(i.Tools.isArray(R))for(let T=0;T<S.length;T++){const{startRow:P,startColumn:O,endRow:A,endColumn:H}=S[T];for(let $=0;$<=A-P;$++)for(let F=0;F<=H-O;F++)v.setValue($+P,F+O,R[$][F])}else if(i.isICellData(R))for(let T=0;T<S.length;T++){const{startRow:P,startColumn:O,endRow:A,endColumn:H}=S[T];for(let $=P;$<=A;$++)for(let F=O;F<=H;F++)v.setValue($,F,R)}else I=R;const p={subUnitId:d,unitId:c,cellValue:I!=null?I:v.getMatrix()},M=se(o,p);if(!t.syncExecuteCommand(B.id,p))return!1;const{undos:y,redos:b}=a.onCommandExecute({id:St.id,params:{...p,range:S}});if(i.sequenceExecute([...b],t).result){const T=Re(C!=null?C:v.getRange(),m,h);return n.pushUndoRedo({unitID:c,undoMutations:[{id:B.id,params:M},...y,T],redoMutations:[{id:B.id,params:p},...b,i.Tools.deepClone(T)]}),!0}return!1}};function Yn(o,e){const t=[],n=[],{unitId:s,subUnitId:r,range:a,shiftDimension:l,cellValue:u={}}=e,d=o.get(i.IUniverInstanceService),c=o.get(g.SheetInterceptorService),m=d.getUniverSheetInstance(s),h=m==null?void 0:m.getSheetBySheetId(r);if(h){const R=h.getCellMatrix(),C=R.getDataRange();if(a.startColumn<=C.endColumn||a.startRow<=C.endRow){let M,w;if(l===i.Dimension.COLUMNS){const b=Math.min(a.endRow,C.endRow);let N=0;for(let T=a.startRow;T<=b;T++){const P=R.getRow(T),O=P?i.getArrayLength(P)-1:0;N=Math.max(N,O)}M={startRow:a.startRow,startColumn:a.startColumn,endRow:b,endColumn:N};const U=a.endColumn-a.startColumn+1;w={startRow:a.startRow,startColumn:M.startColumn+U,endRow:b,endColumn:M.endColumn+U}}else{const b=Math.min(a.endColumn,C.endColumn),N=C.endRow;M={startRow:a.startRow,startColumn:a.startColumn,endRow:N,endColumn:b};const U=a.endRow-a.startRow+1;w={startRow:M.startRow+U,startColumn:a.startColumn,endRow:M.endRow+U,endColumn:b}}const y=Dt(o,{unitId:s,subUnitId:r,range:M},{unitId:s,subUnitId:r,range:w},!0);y&&(t.push(...y.redos),n.push(...y.undos))}if(Object.entries(u).length===0)for(let M=a.startRow;M<=a.endRow;M++){u[M]||(u[M]={});for(let w=a.startColumn;w<=a.endColumn;w++)u[M][w]=null}const S={subUnitId:r,unitId:s,cellValue:u},v=se(o,S),{undos:I,redos:p}=c.onCommandExecute({id:St.id,params:{...S,range:a}});t.push({id:B.id,params:S},...p),n.push({id:B.id,params:v},...I)}return{redo:t,undo:n}}function Kn(o,e){const t=[],n=[],{unitId:s,subUnitId:r,range:a,shiftDimension:l}=e,u=o.get(i.IUniverInstanceService),d=o.get(g.SheetInterceptorService),c=u.getUniverSheetInstance(s),m=c==null?void 0:c.getSheetBySheetId(r);if(m){const h=m.getCellMatrix(),R=h.getDataRange(),C={subUnitId:r,unitId:s,cellValue:un([a])},S=se(o,C),v=d.onCommandExecute({id:St.id,params:C});if(t.push({id:B.id,params:C},...v.redos),n.push(...v.undos,{id:B.id,params:S}),a.startColumn<=R.endColumn||a.startRow<=R.endRow){let I=null,p=null;if(l===i.Dimension.COLUMNS&&a.endColumn<R.endColumn){const M=Math.min(a.endRow,R.endRow);let w=0;for(let b=a.startRow;b<=M;b++){const N=h.getRow(b),U=N?i.getArrayLength(N)-1:0;w=Math.max(w,U)}I={startRow:a.startRow,startColumn:a.endColumn+1,endRow:M,endColumn:w};const y=a.endColumn-a.startColumn+1;p={startRow:a.startRow,startColumn:I.startColumn-y,endRow:M,endColumn:I.endColumn-y}}if(l===i.Dimension.ROWS&&a.endRow<R.endRow){const M=Math.min(a.endColumn,R.endColumn),w=R.endRow;I={startRow:a.endRow+1,startColumn:a.startColumn,endRow:w,endColumn:M};const y=a.endRow-a.startRow+1;p={startRow:I.startRow-y,startColumn:a.startColumn,endRow:I.endRow-y,endColumn:M}}if(I&&p){const M=Dt(o,{unitId:s,subUnitId:r,range:I},{unitId:s,subUnitId:r,range:p},!0);M&&(t.push(...M.redos),n.push(...M.undos))}}}return{redo:t,undo:n}}function ra(o,e,t,n,s,r){const{startRow:a,endRow:l,startColumn:u,endColumn:d}=e;if(s===i.Dimension.ROWS){const c=l-a+1;for(let m=t;m>=a;m--)for(let h=u;h<=d;h++){const R=o.getValue(m,h);R==null?o.realDeleteValue(m+c,h):o.setValue(m+c,h,R)}for(let m=l;m>=a;m--)for(let h=u;h<=d;h++)r&&r[m]&&r[m][h]?o.setValue(m,h,r[m][h]):o.realDeleteValue(m,h)}else if(s===i.Dimension.COLUMNS){const c=d-u+1;for(let m=a;m<=l;m++)for(let h=n;h>=u;h--){const R=o.getValue(m,h);R==null?o.realDeleteValue(m,h+c):o.setValue(m,h+c,R)}for(let m=a;m<=l;m++)for(let h=d;h>=u;h--)r&&r[m]&&r[m][h]?o.setValue(m,h,r[m][h]):o.realDeleteValue(m,h)}}function ia(o,e,t,n,s){const{startRow:r,endRow:a,startColumn:l,endColumn:u}=e,d=a-r+1,c=u-l+1;if(s===i.Dimension.ROWS)for(let m=r;m<=t;m++)for(let h=l;h<=u;h++){const R=o.getValue(m+d,h);R==null?o.realDeleteValue(m,h):o.setValue(m,h,R)}else if(s===i.Dimension.COLUMNS)for(let m=r;m<=a;m++)for(let h=l;h<=n;h++){const R=o.getValue(m,h+c);R==null?o.realDeleteValue(m,h):o.setValue(m,h,R)}}const hs="sheet.command.delete-range-move-left",Je={type:i.CommandType.COMMAND,id:hs,handler:async(o,e)=>{var w,y,b;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),l=E(s);if(!l)return!1;const{worksheet:u,workbook:d,subUnitId:c,unitId:m}=l;let h=e==null?void 0:e.range;if(h||(h=(w=r.getCurrentLastSelection())==null?void 0:w.range),!h)return!1;const R={range:h,subUnitId:c,unitId:m,shiftDimension:i.Dimension.COLUMNS},C=a.onCommandExecute({id:Je.id,params:{range:h}}),{redo:S,undo:v}=Kn(o,R),I=[...(y=C.preRedos)!=null?y:[],...S],p=[...C.undos,...v];return I.push(...C.redos),I.push(Re(h,d,u)),p.push(...(b=C.preUndos)!=null?b:[]),i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:m,undoMutations:p.reverse(),redoMutations:I}),!0):!1}},gs="sheet.command.delete-range-move-up",xe={type:i.CommandType.COMMAND,id:gs,handler:async(o,e)=>{var w,y,b;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),l=E(s);if(!l)return!1;const{unitId:u,subUnitId:d,workbook:c,worksheet:m}=l;let h=e==null?void 0:e.range;if(h||(h=(w=r.getCurrentLastSelection())==null?void 0:w.range),!h)return!1;const R={range:h,subUnitId:d,unitId:u,shiftDimension:i.Dimension.ROWS},C=a.onCommandExecute({id:xe.id,params:{range:h}}),{redo:S,undo:v}=Kn(o,R),I=[...(y=C.preRedos)!=null?y:[],...S],p=[...C.undos,...v];return I.push(...C.redos),I.push(Re(h,c,m)),p.push(...(b=C.preUndos)!=null?b:[]),i.sequenceExecute(I,t).result?(n.pushUndoRedo({unitID:u,undoMutations:p.reverse(),redoMutations:I}),!0):!1}},Rs={type:i.CommandType.COMMAND,id:"sheet.command.delete-range-protection",async handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{unitId:s,subUnitId:r,rule:a}=e,l={unitId:s,subUnitId:r,ruleIds:[a.id]};return await t.executeCommand(he.id,l)&&n.pushUndoRedo({unitID:s,redoMutations:[{id:he.id,params:l}],undoMutations:[{id:le.id,params:{unitId:s,subUnitId:r,rules:[a]}}]}),!0}},Cs={type:i.CommandType.COMMAND,id:"sheet.command.delete-worksheet-protection",handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{rule:s,unitId:r,subUnitId:a}=e;t.executeCommand(De.id,{unitId:r,subUnitId:a});const l=[{id:De.id,params:{unitId:r,subUnitId:a}}],u=[{id:Oe.id,params:{unitId:r,rule:s,subUnitId:a}}];return n.pushUndoRedo({unitID:r,redoMutations:l,undoMutations:u}),!0}},Ss={type:i.CommandType.COMMAND,id:"sheet.command.remove-worksheet-range-theme-style",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{unitId:s}=e,r=Jo(o,e);return t.syncExecuteCommand(ze.id,e)?(n.pushUndoRedo({unitID:s,undoMutations:[{id:qe.id,params:r}],redoMutations:[{id:ze.id,params:e}]}),!0):!1}},fs={id:"sheet.command.insert-defined-name",type:i.CommandType.COMMAND,handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService);if(!e)return!1;const s={...e};return t.syncExecuteCommand(Y.SetDefinedNameMutation.id,s)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:[{id:Y.RemoveDefinedNameMutation.id,params:s}],redoMutations:[{id:Y.SetDefinedNameMutation.id,params:s}]}),!0):!1}},Jn=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},Ce={id:"sheet.mutation.insert-row",type:i.CommandType.MUTATION,handler:(o,e)=>{var C;const{unitId:t,subUnitId:n,range:s,rowInfo:r}=e,l=o.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(l==null)throw new Error("universheet is null error!");const u=l.getSheetBySheetId(n);if(u==null)throw new Error("worksheet is null error!");const d=u.getRowManager().getRowData(),c={h:u.getConfig().defaultRowHeight,hd:0},m=s.startRow,h=s.endRow-s.startRow+1;for(let S=m;S<m+h;S++)r?i.insertMatrixArray(S,(C=r[S-s.startRow])!=null?C:c,d):i.insertMatrixArray(S,c,d);return u.setRowCount(u.getRowCount()+s.endRow-s.startRow+1),u.getCellMatrix().insertRows(s.startRow,h),!0}},$t=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}},ue={id:"sheet.mutation.insert-col",type:i.CommandType.MUTATION,handler:(o,e)=>{var C;const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const r=s.getColumnManager(),{range:a,colInfo:l}=e,d=r.getColumnData(),c=a.startColumn,m=a.endColumn-a.startColumn+1,h=s.getConfig().defaultColumnWidth;for(let S=c;S<c+m;S++){const v={w:h,hd:0};l?i.insertMatrixArray(S,(C=l[S-a.startColumn])!=null?C:v,d):i.insertMatrixArray(S,v,d)}return s.setColumnCount(s.getColumnCount()+a.endColumn-a.startColumn+1),s.getCellMatrix().insertColumns(a.startColumn,m),!0}},aa=(o,e)=>{const s=e.getRowManager().getRowData(),r={},a=o.range,l=i.sliceMatrixArray(a.startRow,a.endRow,s),u=i.concatMatrixArray(r,l);return{unitId:o.unitId,subUnitId:o.subUnitId,range:o.range,rowInfo:u}},de={id:"sheet.mutation.remove-rows",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const r=e.range,l=s.getRowManager().getRowData();for(let c=r.startRow;c<=r.endRow;c++)s.getRowFiltered(c);const u=r.endRow-r.startRow+1;return i.spliceArray(r.startRow,u,l),s.getCellMatrix().removeRows(r.startRow,u),s.setRowCount(s.getRowCount()-u),!0}},la=(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(s==null)throw new Error("worksheet is null error!");const l=s.getColumnManager().getColumnData(),u={},d=e.range,c=i.sliceMatrixArray(d.startColumn,d.endColumn,l),m=i.concatMatrixArray(u,c);return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,colInfo:m}},re={id:"sheet.mutation.remove-col",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const r=e.range,l=s.getColumnManager().getColumnData(),u=r.endColumn-r.startColumn+1;return i.spliceArray(r.startColumn,u,l),s.setColumnCount(s.getColumnCount()-u),s.getCellMatrix().removeColumns(r.startColumn,u),!0}},ua="sheet.command.insert-range-move-down",ft={type:i.CommandType.COMMAND,id:"sheet.command.insert-range-move-down",handler:async(o,e)=>{var A,H,$;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),l=o.get(i.ErrorService),u=o.get(i.LocaleService);if(r.isOverlapping())return l.emit(u.t("sheets.info.overlappingSelections")),!1;const d=E(s);if(!d)return!1;const{unitId:c,subUnitId:m,worksheet:h,workbook:R}=d;let C=e==null?void 0:e.range;if(C||(C=(A=r.getCurrentLastSelection())==null?void 0:A.range),!C)return!1;const S=[],v=[],I=h.getCellMatrix(),p=I.getDataRange(),w=I.getSlice(p.startRow,p.endRow,C.startColumn,C.endColumn).getDataRange().endRow,y=Math.max(w+(C.endRow-C.startRow+1)-p.endRow,0);if(y>0){const F=C.startRow-1,ee=h.getRowHeight(F),z={unitId:c,subUnitId:m,range:{startRow:p.endRow+1,endRow:p.endRow+y,startColumn:p.startColumn,endColumn:p.endColumn},rowInfo:new Array(y).fill(void 0).map(()=>({h:ee,hd:i.BooleanNumber.FALSE}))};S.push({id:Ce.id,params:z});const ve=Jn(o,z);v.push({id:de.id,params:ve})}const b={};i.Range.foreach(C,(F,ee)=>{const z=h.getCell(F,ee);z&&(b[F]||(b[F]={}),b[F][ee]={s:z.s})});const N={range:C,subUnitId:m,unitId:c,shiftDimension:i.Dimension.ROWS,cellValue:b},{redo:U,undo:T}=Yn(o,N);S.push(...U),v.push(...T);const P=a.onCommandExecute({id:ft.id,params:{range:C}});return S.push(...P.redos),S.push(Re(C,R,h)),v.push(...(H=P.preUndos)!=null?H:[]),S.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),i.sequenceExecute(S,t)?(n.pushUndoRedo({unitID:c,undoMutations:v.reverse(),redoMutations:S}),!0):!1}},xn="sheet.command.insert-range-move-right",Lt={type:i.CommandType.COMMAND,id:xn,handler:async(o,e)=>{var A,H,$;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetsSelectionsService),a=o.get(g.SheetInterceptorService),l=o.get(i.ErrorService),u=o.get(i.LocaleService);if(r.isOverlapping())return l.emit(u.t("sheets.info.overlappingSelections")),!1;const d=E(s);if(!d)return!1;const{workbook:c,worksheet:m,unitId:h,subUnitId:R}=d;let C=e==null?void 0:e.range;if(C||(C=(A=r.getCurrentLastSelection())==null?void 0:A.range),!C)return!1;const S=[],v=[],I=m.getCellMatrix(),p=I.getDataRange(),w=I.getSlice(C.startRow,C.endRow,p.startColumn,p.endColumn).getDataRange().endColumn,y=Math.max(w+(C.endColumn-C.startColumn+1)-p.endColumn,0);if(y>0){const F=C.startColumn-1,ee=m.getColumnWidth(F),z={unitId:h,subUnitId:R,range:{startRow:p.startRow+1,endRow:p.endRow,startColumn:p.endColumn+1,endColumn:p.endColumn+y},colInfo:new Array(y).fill(void 0).map(()=>({w:ee,hd:i.BooleanNumber.FALSE}))};S.push({id:ue.id,params:z});const ve=$t(o,z);v.push({id:re.id,params:ve})}const b={};i.Range.foreach(C,(F,ee)=>{const z=m.getCell(F,ee);!z||!z.s||(b[F]||(b[F]={}),b[F][ee]={s:z.s})});const N={range:C,subUnitId:R,unitId:h,shiftDimension:i.Dimension.COLUMNS,cellValue:b},{redo:U,undo:T}=Yn(o,N);S.push(...U),v.push(...T);const P=a.onCommandExecute({id:Lt.id,params:{range:C}});return S.push(...P.redos),S.push(Re(C,c,m)),v.push(...(H=P.preUndos)!=null?H:[]),S.unshift(...($=P.preRedos)!=null?$:[]),v.unshift(...P.undos),i.sequenceExecute(S,t).result?(n.pushUndoRedo({unitID:h,undoMutations:v.reverse(),redoMutations:S}),!0):!1}},vs="sheet.command.insert-row",be={type:i.CommandType.COMMAND,id:vs,handler:async(o,e)=>{const t=o.get(i.ICommandService),n=o.get(g.SheetInterceptorService),{range:s,direction:r,unitId:a,subUnitId:l,cellValue:u}=e;return await n.beforeCommandExecute({id:be.id,params:e})?t.syncExecuteCommand(Xn.id,{range:s,direction:r,unitId:a,subUnitId:l,cellValue:u}):!1}},Xn={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-by-range",handler:(o,e)=>{var U,T,P,O;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetInterceptorService),a=E(s,e);if(!a)return!1;const{workbook:l,worksheet:u}=a,{range:d,direction:c,unitId:m,subUnitId:h,cellValue:R}=e,{startRow:C,endRow:S}=d;d.rangeType=i.RANGE_TYPE.ROW;const v=c===i.Direction.UP?C:C-1,I=u.getRowHeight(v),p={unitId:m,subUnitId:h,range:d,rowInfo:new Array(S-C+1).fill(void 0).map(()=>({h:I,hd:i.BooleanNumber.FALSE}))},M=Jn(o,p),w=[{id:Ce.id,params:p}],y=[{id:de.id,params:M}];R&&w.push({id:B.id,params:{unitId:m,subUnitId:h,cellValue:R}});const b=r.onCommandExecute({id:be.id,params:e});return w.unshift(...(U=b.preRedos)!=null?U:[]),w.push(...(T=b.redos)!=null?T:[]),w.push(Re(d,l,u)),y.unshift(...(P=b.preUndos)!=null?P:[]),y.push(...(O=b.undos)!=null?O:[]),i.sequenceExecute(w,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:y,redoMutations:w}),!0):!1}},Is={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-before",handler:async o=>{var C;const t=(C=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:C.map(S=>S.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const s=o.get(i.IUniverInstanceService),r=E(s);if(!r)return!1;const{worksheet:a,subUnitId:l,unitId:u}=r,{startRow:d,endRow:c}=n,m=0,h=a.getColumnCount()-1,R={unitId:u,subUnitId:l,direction:i.Direction.UP,range:{startRow:d,endRow:c,startColumn:m,endColumn:h},cellValue:gt(a,d,c,m,h,!0,d-1)};return o.get(i.ICommandService).executeCommand(be.id,R)}},ps={type:i.CommandType.COMMAND,id:"sheet.command.insert-row-after",handler:async o=>{var S;const t=(S=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:S.map(v=>v.range);let n;if((t==null?void 0:t.length)===1)n=t[0];else return!1;const s=o.get(i.IUniverInstanceService),r=E(s);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=n.endRow-n.startRow+1,c=n.endRow+1,m=n.endRow+d,h=0,R=a.getColumnCount()-1,C={unitId:l,subUnitId:u,direction:i.Direction.DOWN,range:{startRow:c,endRow:m,startColumn:h,endColumn:R,rangeType:i.RANGE_TYPE.ROW},cellValue:gt(a,c,m,h,R,!0,n.endRow)};return o.get(i.ICommandService).executeCommand(be.id,C)}},Ms="sheet.command.insert-col",Te={type:i.CommandType.COMMAND,id:Ms,handler:async(o,e)=>{const t=o.get(i.ICommandService),n=o.get(g.SheetInterceptorService),{range:s,direction:r,subUnitId:a,unitId:l,cellValue:u}=e;return await n.beforeCommandExecute({id:Te.id,params:e})?t.syncExecuteCommand(Zn.id,{range:s,direction:r,unitId:l,subUnitId:a,cellValue:u}):!1}},Zn={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-by-range",handler:(o,e)=>{var N,U,T,P;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetInterceptorService),{range:a,direction:l,subUnitId:u,unitId:d,cellValue:c}=e,{startColumn:m,endColumn:h}=e.range;a.rangeType=i.RANGE_TYPE.COLUMN;const R=s.getUniverSheetInstance(e.unitId),C=R.getSheetBySheetId(e.subUnitId),S=l===i.Direction.LEFT?m:m-1,v=C.getColumnWidth(S),I={unitId:d,subUnitId:u,range:a,colInfo:new Array(h-m+1).fill(void 0).map(()=>({w:v,hd:i.BooleanNumber.FALSE}))},p=$t(o,I),M=[{id:ue.id,params:I}],w=[{id:re.id,params:p}];c&&M.push({id:B.id,params:{unitId:d,subUnitId:u,cellValue:c}});const y=r.onCommandExecute({id:Te.id,params:e});return M.unshift(...(N=y.preRedos)!=null?N:[]),M.push(...(U=y.redos)!=null?U:[]),M.push(Re(a,R,C)),w.unshift(...(T=y.preUndos)!=null?T:[]),w.push(...(P=y.undos)!=null?P:[]),i.sequenceExecute(M,t).result?(n.pushUndoRedo({unitID:e.unitId,undoMutations:w.filter(Boolean),redoMutations:M.filter(Boolean)}),!0):!1}},ws={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-before",handler:async o=>{const t=o.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const s=o.get(i.IUniverInstanceService),r=E(s);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,{startColumn:d,endColumn:c}=n,m=0,h=a.getRowCount()-1,R={unitId:l,subUnitId:u,direction:i.Direction.LEFT,range:{startColumn:d,endColumn:c,startRow:m,endRow:h,rangeType:i.RANGE_TYPE.COLUMN},cellValue:gt(a,m,h,d,c,!1,d-1)};return o.get(i.ICommandService).executeCommand(Te.id,R)}},ys={type:i.CommandType.COMMAND,id:"sheet.command.insert-col-after",handler:async o=>{const t=o.get(g.SheetsSelectionsService).getCurrentSelections();let n;if((t==null?void 0:t.length)===1)n=t[0].range;else return!1;const s=o.get(i.IUniverInstanceService),r=E(s);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=n.endColumn-n.startColumn+1,c=n.endColumn+1,m=n.endColumn+d,h=0,R=a.getRowCount()-1,C={unitId:l,subUnitId:u,direction:i.Direction.RIGHT,range:{startColumn:c,endColumn:m,startRow:h,endRow:R},cellValue:gt(a,h,R,c,m,!1,n.endColumn)};return o.get(i.ICommandService).executeCommand(Te.id,C)}},_s={id:"sheet.command.insert-sheet",type:i.CommandType.COMMAND,handler:(o,e)=>{var v;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(i.LocaleService),a=Yo(s,{unitId:e==null?void 0:e.unitId});if(!a)return!1;const{unitId:l,workbook:u}=a;let d=u.getSheets().length;const c=e==null?void 0:e.sheet,m=c==null?void 0:c.id,h=i.mergeWorksheetSnapshotWithDefault(c||{});e?(d=(v=e.index)!=null?v:d,h.id=m||i.Tools.generateRandomId(),h.name=(c==null?void 0:c.name)||u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`)):(h.id=i.Tools.generateRandomId(),h.name=u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`));const R={index:d,sheet:h,unitId:l},C=mn(o,R);return t.syncExecuteCommand(Ye.id,R)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:$e.id,params:C}],redoMutations:[{id:Ye.id,params:R}]}),!0):!1}};function bs(o,e){const{unitId:t,subUnitId:n,sourceRange:s,targetRange:r}=e,a=s.startRow>r.startRow,l=s.endRow-s.startRow+1;return a?{unitId:t,subUnitId:n,sourceRange:i.Rectangle.clone(r),targetRange:{...s,endRow:s.endRow+l,startRow:s.startRow+l}}:{unitId:t,subUnitId:n,targetRange:i.Rectangle.clone(s),sourceRange:{...r,endRow:r.endRow-l,startRow:r.startRow-l}}}const Ie={id:"sheet.mutation.move-rows",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,sourceRange:s,targetRange:r}=e,l=o.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(!l)throw new Error("[MoveRowMutation] univerSheet is null!");const u=l.getSheetBySheetId(n);if(!u)throw new Error("[MoveRowMutation] worksheet is null!");const d=s.startRow,c=s.endRow-s.startRow+1,m=r.startRow,h=u.getRowManager().getRowData();return i.moveMatrixArray(d,c,m,h),u.getCellMatrix().moveRows(d,c,m),!0}};function Ts(o,e){const{unitId:t,subUnitId:n,sourceRange:s,targetRange:r}=e,a=s.startColumn>r.startColumn,l=s.endColumn-s.startColumn+1;return a?{unitId:t,subUnitId:n,sourceRange:i.Rectangle.clone(r),targetRange:{...s,endColumn:s.endColumn+l,startColumn:s.startColumn+l}}:{unitId:t,subUnitId:n,targetRange:i.Rectangle.clone(s),sourceRange:{...r,startColumn:r.startColumn-l,endColumn:r.endColumn-l}}}const pe={id:"sheet.mutation.move-columns",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,sourceRange:s,targetRange:r}=e,l=o.get(i.IUniverInstanceService).getUniverSheetInstance(t);if(!l)throw new Error("[MoveColumnMutation] univerSheet is null!");const u=l.getSheetBySheetId(n);if(!u)throw new Error("[MoveColumnMutation] worksheet is null!");const d=s.startColumn,c=s.endColumn-s.startColumn+1,m=r.startColumn,h=u.getColumnManager().getColumnData();return i.moveMatrixArray(d,c,m,h),u.getCellMatrix().moveColumns(d,c,m),!0}};function da(o,e){return e.getMergeData().some(t=>t.startRow<o&&o<=t.endRow)}function ca(o,e){return e.getMergeData().some(t=>t.startColumn<o&&o<=t.endColumn)}const Us="sheet.command.move-rows",Bt={id:Us,type:i.CommandType.COMMAND,handler:(o,e)=>{var A,H;const t=o.get(g.SheetsSelectionsService),{fromRange:{startRow:n},toRange:{startRow:s},range:r}=e,a=r?[Ps(r)]:t.getCurrentSelections(),l=a==null?void 0:a.filter($=>$.range.rangeType===i.RANGE_TYPE.ROW&&$.range.startRow<=n&&n<=$.range.endRow);if((l==null?void 0:l.length)!==1)return!1;const u=o.get(g.SheetInterceptorService),d=o.get(i.IUniverInstanceService),c=E(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),C=h.getSheetId(),S=o.get(i.ErrorService),v=o.get(i.LocaleService),I=l[0].range,p=l[0].primary,M=ht(I,h,!1);if(!i.Rectangle.equals(I,M))return S.emit(v.t("sheets.info.partOfCell")),!1;if(da(s,h))return S.emit(v.t("sheets.info.acrossMergedCell")),!1;const w={...I,startRow:s,endRow:s+I.endRow-I.startRow},y={unitId:R,subUnitId:C,sourceRange:I,targetRange:w},b=bs(o,y),N=o.get(i.ICommandService),U=u.onCommandExecute({id:Bt.id,params:e}),T=[...(A=U.preRedos)!=null?A:[],{id:Ie.id,params:y}],P=[...(H=U.preUndos)!=null?H:[],{id:Ie.id,params:b}];if(p){const F=s-n<0,ee=I.endRow-I.startRow+1,z=F?w:{...w,startRow:w.startRow-ee,endRow:w.endRow-ee},ve={unitId:R,subUnitId:C,type:Q.MOVE_END,selections:[{range:z,primary:te(z,h),style:null}]},ct={unitId:R,subUnitId:C,type:Q.MOVE_END,selections:[{range:I,primary:p,style:null}]};T.push({id:q.id,params:ve}),P.push({id:q.id,params:ct})}return T.push(...U.redos),P.push(...U.undos),i.sequenceExecute(T,N).result?(o.get(i.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:T}),!0):!1}},Es="sheet.command.move-cols",Ht={id:Es,type:i.CommandType.COMMAND,handler:(o,e)=>{var A,H;const t=o.get(g.SheetsSelectionsService),{fromRange:{startColumn:n},toRange:{startColumn:s},range:r}=e,a=r?[Ps(r)]:t.getCurrentSelections(),l=a==null?void 0:a.filter($=>$.range.rangeType===i.RANGE_TYPE.COLUMN&&$.range.startColumn<=n&&n<=$.range.endColumn);if((l==null?void 0:l.length)!==1)return!1;const u=o.get(g.SheetInterceptorService),d=o.get(i.IUniverInstanceService),c=E(d,e);if(!c)return!1;const{workbook:m,worksheet:h}=c,R=m.getUnitId(),C=h.getSheetId(),S=o.get(i.ErrorService),v=o.get(i.LocaleService),I=l[0].range,p=l[0].primary,M=ht(I,h,!1);if(!i.Rectangle.equals(I,M))return S.emit(v.t("sheets.info.partOfCell")),!1;if(ca(s,h))return S.emit(v.t("sheets.info.acrossMergedCell")),!1;const w={...I,startColumn:s,endColumn:s+I.endColumn-I.startColumn},y={unitId:R,subUnitId:C,sourceRange:I,targetRange:w},b=Ts(o,y),N=o.get(i.ICommandService),U=u.onCommandExecute({id:Ht.id,params:e}),T=[...(A=U.preRedos)!=null?A:[],{id:pe.id,params:y}],P=[...(H=U.preUndos)!=null?H:[],{id:pe.id,params:b}];if(p){const $=I.endColumn-I.startColumn+1,z=s-n<0?w:{...w,startColumn:w.startColumn-$,endColumn:w.endColumn-$},ve={unitId:R,subUnitId:C,type:Q.MOVE_END,selections:[{range:z,primary:te(z,h),style:null}]},ct={unitId:R,subUnitId:C,type:Q.MOVE_END,selections:[{range:I,primary:p,style:null}]};T.push({id:q.id,params:ve}),P.push({id:q.id,params:ct})}return T.push(...U.redos),P.push(...U.undos),i.sequenceExecute(T,N).result&&o.get(i.IUndoRedoService).pushUndoRedo({unitID:R,undoMutations:P,redoMutations:T}),!0}};function Ps(o){return{range:o,primary:null,style:null}}const Xe={id:"sheet.mutation.register-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,rangeThemeStyleJson:n,themeName:s}=e,r=o.get(i.IUniverInstanceService),a=E(r),l=o.get(ge);if(!a)return!1;const u=new We(s,n);return l.registerRangeThemeStyle(t,u),!0}},Ft={id:"sheet.mutation.unregister-worksheet-range-theme-style",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,themeName:n}=e,s=o.get(i.IUniverInstanceService),r=E(s),a=o.get(ge);return r?(a.unregisterRangeThemeStyle(t,n),!0):!1}},Ns={id:"sheet.command.register-worksheet-range-theme-style",type:i.CommandType.COMMAND,handler:(o,e)=>{if(!e)return!1;const{unitId:t,rangeThemeStyle:n}=e,s=o.get(i.IUniverInstanceService),r=o.get(i.ICommandService),a=o.get(i.IUndoRedoService);if(!E(s))return!1;const u={unitId:t,themeName:n.getName(),rangeThemeStyleJson:n.toJson()},d={unitId:t,themeName:n.getName()};return r.syncExecuteCommand(Xe.id,e)&&a.pushUndoRedo({unitID:t,undoMutations:[{id:Ft.id,params:d}],redoMutations:[{id:Xe.id,params:u}]}),!0}},Qn={id:"sheet.command.remove-defined-name",type:i.CommandType.COMMAND,handler:(o,e)=>{var c,m;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(g.SheetInterceptorService);if(!e)return!1;const r={...e},a=s.onCommandExecute({id:Qn.id,params:e}),l=[...(c=a.preRedos)!=null?c:[],{id:Y.RemoveDefinedNameMutation.id,params:r},...a.redos],u=[...(m=a.preUndos)!=null?m:[],{id:Y.SetDefinedNameMutation.id,params:r},...a.undos];return i.sequenceExecute(l,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:u.filter(Boolean),redoMutations:l.filter(Boolean)}),!0):!1}},eo="sheet.command.remove-row",to={type:i.CommandType.COMMAND,id:"sheet.command.remove-row-by-range",handler:(o,e)=>{var I,p,M;if(!e)return!1;const t=o.get(i.IUniverInstanceService),n=E(t,e);if(!n)return!1;const{workbook:s,worksheet:r}=n,a=o.get(g.SheetInterceptorService),{range:l,unitId:u,subUnitId:d}=e,c={unitId:u,subUnitId:d,range:l},m=aa(c,r),h=r.getCellMatrix().getSlice(l.startRow,l.endRow,0,r.getColumnCount()-1),R={unitId:u,subUnitId:d,cellValue:h.getMatrix()},C=a.onCommandExecute({id:eo,params:{range:l}}),S=o.get(i.ICommandService);return i.sequenceExecute([...(I=C.preRedos)!=null?I:[],{id:de.id,params:c},...C.redos,Re(l,s,r)],S).result?(o.get(i.IUndoRedoService).pushUndoRedo({unitID:u,undoMutations:[...(p=C.preUndos)!=null?p:[],{id:Ce.id,params:m},{id:B.id,params:R},...C.undos],redoMutations:[...(M=C.preRedos)!=null?M:[],{id:de.id,params:c},...C.redos]}),!0):!1}},vt={type:i.CommandType.COMMAND,id:eo,handler:async(o,e)=>{var h;const t=o.get(g.SheetsSelectionsService),n=o.get(g.SheetInterceptorService),s=o.get(i.ICommandService);let r=e==null?void 0:e.range;if(r||(r=(h=t.getCurrentLastSelection())==null?void 0:h.range),!r)return!1;const a=o.get(i.IUniverInstanceService),l=E(a);if(!l)return!1;const{worksheet:u,subUnitId:d,unitId:c}=l;return r={...r,startColumn:0,endColumn:Math.max(u.getMaxColumns()-1,0)},await n.beforeCommandExecute({id:vt.id,params:{range:r}})?s.syncExecuteCommand(to.id,{range:r,unitId:c,subUnitId:d}):!1}},no="sheet.command.remove-col",oo={type:i.CommandType.COMMAND,id:"sheet.command.remove-col-by-range",handler:(o,e)=>{var I,p,M;if(!e)return!1;const t=o.get(i.IUniverInstanceService),n=E(t,e);if(!n)return!1;const{workbook:s,worksheet:r}=n,a=o.get(g.SheetInterceptorService),{range:l,unitId:u,subUnitId:d}=e,c={unitId:u,subUnitId:d,range:l},m=la(o,c),h=r.getCellMatrix().getSlice(0,r.getRowCount()-1,l.startColumn,l.endColumn),R={unitId:u,subUnitId:d,cellValue:h.getMatrix()},C=a.onCommandExecute({id:no,params:{range:l}}),S=o.get(i.ICommandService);return i.sequenceExecute([...(I=C.preRedos)!=null?I:[],{id:re.id,params:c},...C.redos,Re(l,s,r)],S).result?(o.get(i.IUndoRedoService).pushUndoRedo({unitID:u,undoMutations:[...(p=C.preUndos)!=null?p:[],{id:ue.id,params:m},{id:B.id,params:R},...C.undos],redoMutations:[...(M=C.preRedos)!=null?M:[],{id:re.id,params:c},...C.redos]}),!0):!1}},It={type:i.CommandType.COMMAND,id:no,handler:async(o,e)=>{var h;const t=o.get(g.SheetsSelectionsService),n=o.get(g.SheetInterceptorService),s=o.get(i.ICommandService);let r=e==null?void 0:e.range;if(r||(r=(h=t.getCurrentLastSelection())==null?void 0:h.range),!r)return!1;const a=o.get(i.IUniverInstanceService),l=E(a);if(!l)return!1;const{worksheet:u,subUnitId:d,unitId:c}=l;return r={...r,startRow:0,endRow:Math.max(u.getMaxRows()-1,0)},await n.beforeCommandExecute({id:It.id,params:{range:r}})?s.syncExecuteCommand(oo.id,{range:r,unitId:c,subUnitId:d}):!1}},jt={id:"sheet.command.remove-sheet",type:i.CommandType.COMMAND,handler:(o,e)=>{var I,p;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetInterceptorService),a=E(s,e);if(!a)return!1;const{unitId:l,subUnitId:u,workbook:d,worksheet:c}=a;if(d.getSheets().length<=1)return!1;const m={subUnitId:u,unitId:l,subUnitName:c.getName()},h=ss(o,m),R=r.onCommandExecute({id:jt.id,params:{unitId:l,subUnitId:u}}),C=[...(I=R.preRedos)!=null?I:[],{id:$e.id,params:m},...R.redos],S=[...(p=R.preUndos)!=null?p:[],{id:Ye.id,params:h},...R.undos];return i.sequenceExecute(C,t).result?(n.pushUndoRedo({unitID:l,undoMutations:S,redoMutations:C}),!0):!1}},ie=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:i.Tools.deepClone(e.ranges)}},j={id:"sheet.mutation.add-worksheet-merge",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const a=s.getConfig().mergeData,l=e.ranges;for(let u=0;u<l.length;u++)a.push(l[u]);return s.getSpanModel().rebuild(a),!0}},ne=(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(s==null)throw new Error("worksheet is null error!");const a=s.getConfig().mergeData,l=e.ranges,u=[];for(let d=0;d<l.length;d++)for(let c=a.length-1;c>=0;c--){const m=a[c],h=l[d];i.Rectangle.intersects(m,h)&&u.push(a[c])}return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:u}},G={id:"sheet.mutation.remove-worksheet-merge",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const a=s.getConfig().mergeData,l=e.ranges;for(let u=0;u<l.length;u++)for(let d=a.length-1;d>=0;d--){const c=a[d],m=l[u];i.Rectangle.intersects(c,m)&&a.splice(d,1)}return s.getSpanModel().rebuild(a),!0}},ks={type:i.CommandType.COMMAND,id:"sheet.command.remove-worksheet-merge",handler:async(o,e)=>{var O;const t=o.get(g.SheetsSelectionsService),n=o.get(i.ICommandService),s=o.get(i.IUndoRedoService),r=o.get(i.IUniverInstanceService),a=(e==null?void 0:e.ranges)||((O=t.getCurrentSelections())==null?void 0:O.map(A=>A.range));if(!(a!=null&&a.length))return!1;const l=E(r);if(!l)return!1;const{subUnitId:u,unitId:d,worksheet:c}=l,m={unitId:d,subUnitId:u,ranges:a},R=c.getConfig().mergeData.filter(A=>a.some(H=>i.Rectangle.intersects(H,A)));if(!R.length)return!1;const C=ne(o,m),S=t.getCurrentSelections();if(!(S!=null&&S.length))return!1;const v=i.Tools.deepClone(S),I=i.Tools.deepClone(S),p=I[I.length-1],{startRow:M,startColumn:w}=p.range;p.primary={startRow:M,startColumn:w,endRow:M,endColumn:w,actualRow:M,actualColumn:w,isMerged:!1,isMergedMainCell:!1};const y=ma(c,R),b={unitId:d,subUnitId:u,cellValue:y.redoParams.getMatrix()},N={unitId:d,subUnitId:u,cellValue:y.undoParams.getMatrix()},U=[{id:G.id,params:C},{id:B.id,params:b},{id:q.id,params:{selections:I}}],T=[{id:j.id,params:C},{id:B.id,params:N},{id:q.id,params:{selections:v}}];return i.sequenceExecute(U,n)?(s.pushUndoRedo({unitID:d,undoMutations:T,redoMutations:U}),!0):!1}};function ma(o,e){const t=new i.ObjectMatrix,n=new i.ObjectMatrix;return e.forEach(s=>{const{startRow:r,startColumn:a,endColumn:l,endRow:u}=s,d=o.getCellMatrix().getValue(r,a);if(d!=null&&d.s)for(let c=r;c<=u;c++)for(let m=a;m<=l;m++)(c!==r||m!==a)&&(t.setValue(c,m,{s:d.s}),n.setValue(c,m,null))}),{redoParams:t,undoParams:n}}const Os=o=>{const{order:e}=o,t={};return Object.keys(e).forEach(n=>{t[e[Number(n)]]=Number(n)}),{...o,order:t}},pt={id:"sheet.mutation.reorder-range",type:i.CommandType.MUTATION,handler:(o,e)=>{const{subUnitId:t,unitId:n,range:s,order:r}=e,u=o.get(i.IUniverInstanceService).getUnit(n).getSheetBySheetId(t);if(!u)return!1;const d=new i.ObjectMatrix;i.Range.foreach(s,(m,h)=>{if(r.hasOwnProperty(m)){const R=r[m],C=i.Tools.deepClone(u.getCellRaw(R,h));d.setValue(m,h,C)}});const c=u.getCellMatrix();return d.forValue((m,h,R)=>{c.setValue(m,h,R)}),!0}},Ds="sheet.command.reorder-range",Gt={id:Ds,type:i.CommandType.COMMAND,handler:(o,e)=>{var S,v;const{subUnitId:t,unitId:n,range:s,order:r}=e,a=o.get(i.ICommandService),l={id:pt.id,params:{unitId:n,subUnitId:t,order:r,range:s}},u={id:pt.id,params:Os(l.params)},d=o.get(g.SheetInterceptorService),c=d.onCommandExecute({id:Gt.id,params:e}),m=[...(S=c.preRedos)!=null?S:[],l,...c.redos],h=[...(v=c.preUndos)!=null?v:[],u,...c.undos],R=i.sequenceExecute(m,a),C=d.afterCommandExecute({id:Gt.id,params:e});return R.result?(i.sequenceExecute(C.redos,a),o.get(i.IUndoRedoService).pushUndoRedo({unitID:n,undoMutations:[...h,...C.undos],redoMutations:[...m,...C.redos]}),!0):!1}};class Le{constructor(){f(this,"_borderInfo",{type:i.BorderType.ALL,color:"#000000",style:i.BorderStyleTypes.THIN,activeBorderType:!1});f(this,"_borderInfo$",new W.BehaviorSubject(this._borderInfo));f(this,"borderInfo$",this._borderInfo$.asObservable())}dispose(){this._borderInfo$.complete()}setType(e){this._borderInfo.type=e,this.setActiveBorderType(!0),this._refresh()}setColor(e){this._borderInfo.color=e,this._refresh()}setStyle(e){this._borderInfo.style=e,this._refresh()}setActiveBorderType(e){this._borderInfo.activeBorderType=e}getBorderInfo(){return this._borderInfo}_refresh(){this._borderInfo$.next(this._borderInfo)}}function qt(o,e){const{startRow:t,startColumn:n,endRow:s,endColumn:r}=o;for(let a=t;a<=s;a++)for(let l=n;l<=r;l++)e(a,l)}const so=(o,e,t,n)=>{const{mr:s,worksheet:r}=o;e.startRow<0||e.startColumn<0||qt(e,(a,l)=>{var c,m;const u=r.getMergedCell(a,l);let d=t;if(u&&(t.bc_tr||t.ml_tr||t.bl_tr||t.tl_mr||t.tl_bc||t.tl_br)){if(n){const h=i.Tools.deepClone((c=s.getValue(u.startRow,u.startColumn))==null?void 0:c.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}s.setValue(u.startRow,u.startColumn,{s:{bd:d}})}else{if(n){const h=i.Tools.deepClone((m=s.getValue(a,l))==null?void 0:m.s);d=h!=null&&h.bd?Object.assign(h.bd,t):t}s.setValue(a,l,{s:{bd:d}})}})},ha=o=>{const e={startRow:o.startRow-1,startColumn:o.startColumn,endRow:o.startRow-1,endColumn:o.endColumn},t={startRow:o.startRow,startColumn:o.startColumn-1,endRow:o.endRow,endColumn:o.startColumn-1},n={startRow:o.endRow+1,startColumn:o.startColumn,endRow:o.endRow+1,endColumn:o.endColumn},s={startRow:o.startRow,startColumn:o.endColumn+1,endRow:o.endRow,endColumn:o.endColumn+1},r={startRow:o.startRow,startColumn:o.startColumn,endRow:o.startRow,endColumn:o.endColumn},a={startRow:o.startRow,startColumn:o.startColumn,endRow:o.endRow,endColumn:o.startColumn},l={startRow:o.endRow,startColumn:o.startColumn,endRow:o.endRow,endColumn:o.endColumn},u={startRow:o.startRow,startColumn:o.endColumn,endRow:o.endRow,endColumn:o.endColumn};return{topRangeOut:e,leftRangeOut:t,bottomRangeOut:n,rightRangeOut:s,topRange:r,leftRange:a,bottomRange:l,rightRange:u}};function ga(o,e,t){const{style:n,color:s,type:r}=o.getBorderInfo(),a=r===i.BorderType.TOP||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,l=r===i.BorderType.LEFT||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,u=r===i.BorderType.BOTTOM||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,d=r===i.BorderType.RIGHT||r===i.BorderType.ALL||r===i.BorderType.OUTSIDE,c=r===i.BorderType.VERTICAL||r===i.BorderType.ALL||r===i.BorderType.INSIDE,m=r===i.BorderType.HORIZONTAL||r===i.BorderType.ALL||r===i.BorderType.INSIDE,h=r.indexOf("tlbr")>-1,R=r.indexOf("tlbc")>-1,C=r.indexOf("tlmr")>-1,S=r.indexOf("bltr")>-1,v=r.indexOf("mltr")>-1,I=r.indexOf("bctr")>-1,p=t[0],{topRangeOut:M,leftRangeOut:w,bottomRangeOut:y,rightRangeOut:b,topRange:N,leftRange:U,bottomRange:T,rightRange:P}=ha(p),O=new i.ObjectMatrix,{worksheet:A,unitId:H,subUnitId:$}=e;return{worksheet:A,unitId:H,subUnitId:$,style:n,color:s,type:r,top:a,left:l,right:d,bottom:u,vertical:c,horizontal:m,tl_br:h,tl_bc:R,tl_mr:C,bl_tr:S,ml_tr:v,bc_tr:I,topRangeOut:M,leftRangeOut:w,bottomRangeOut:y,rightRangeOut:b,topRange:N,leftRange:U,bottomRange:T,rightRange:P,range:p,mr:O,borderStyle:{s:n,cl:{rgb:s}}}}const Ra=o=>{const{range:e,mr:t,borderStyle:n,vertical:s,horizontal:r,worksheet:a}=o;s&&qt(e,(l,u)=>{var c,m,h;const d=a.getMergedCell(l,u);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startColumn!==e.startColumn&&t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:i.Tools.deepClone(n)}):{l:i.Tools.deepClone(n)}}})}else{if(u!==e.endColumn){const R=(m=t.getValue(l,u))==null?void 0:m.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{r:i.Tools.deepClone(n)}):{r:i.Tools.deepClone(n)}}})}if(u!==e.startColumn){const R=(h=t.getValue(l,u))==null?void 0:h.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{l:i.Tools.deepClone(n)}):{l:i.Tools.deepClone(n)}}})}}}),r&&qt(e,(l,u)=>{var c,m,h;const d=a.getMergedCell(l,u);if(d){const R=(c=t.getValue(d.startRow,d.startColumn))==null?void 0:c.s;d.startRow!==e.startRow&&t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:i.Tools.deepClone(n)}):{t:i.Tools.deepClone(n)}}})}else{if(l!==e.endRow){const R=(m=t.getValue(l,u))==null?void 0:m.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{b:i.Tools.deepClone(n)}):{b:i.Tools.deepClone(n)}}})}if(l!==e.startRow){const R=(h=t.getValue(l,u))==null?void 0:h.s;t.setValue(l,u,{s:{bd:R!=null&&R.bd?Object.assign(R.bd,{t:i.Tools.deepClone(n)}):{t:i.Tools.deepClone(n)}}})}}})};function Ca(o){const{borderStyle:e,tl_br:t,tl_bc:n,tl_mr:s,bl_tr:r,ml_tr:a,bc_tr:l}=o,u=(d,c,m)=>{so(o,d,c,m)};t&&u(o.range,{tl_br:i.Tools.deepClone(e)},!0),n&&u(o.range,{tl_bc:i.Tools.deepClone(e)},!0),s&&u(o.range,{tl_mr:i.Tools.deepClone(e)},!0),r&&u(o.range,{bl_tr:i.Tools.deepClone(e)},!0),a&&u(o.range,{ml_tr:i.Tools.deepClone(e)},!0),l&&u(o.range,{bc_tr:i.Tools.deepClone(e)},!0)}const Sa=o=>{const{top:e,left:t,right:n,bottom:s,borderStyle:r,bottomRange:a,topRange:l,leftRange:u,rightRange:d,bottomRangeOut:c,topRangeOut:m,leftRangeOut:h,rightRangeOut:R}=o,C=(S,v,I)=>{so(o,S,v,I)};e&&(C(m,{b:null}),C(l,{t:i.Tools.deepClone(r)},!0)),s&&(C(c,{t:null}),C(a,{b:i.Tools.deepClone(r)},!0)),t&&(C(h,{r:null}),C(u,{l:i.Tools.deepClone(r)},!0)),n&&(C(R,{l:null}),C(d,{r:i.Tools.deepClone(r)},!0))},fa=o=>{const{range:e,worksheet:t,mr:n,top:s,bottom:r,left:a,right:l,vertical:u,horizontal:d,tl_br:c,tl_bc:m,tl_mr:h,bl_tr:R,ml_tr:C,bc_tr:S,topRange:v,bottomRange:I,leftRange:p,rightRange:M,topRangeOut:w,bottomRangeOut:y,leftRangeOut:b,rightRangeOut:N}=o,U=(T,P,O)=>{so(o,T,P,O)};!s&&!r&&!a&&!l&&!u&&!d&&!c&&!m&&!h&&!R&&!C&&!S&&(qt(e,(T,P)=>{var A,H,$,F,ee,z,ve,ct;const O=t.getMergedCell(T,P);if(O){if(O.endColumn!==e.endColumn){const L=(A=n.getValue(O.startRow,O.startColumn))==null?void 0:A.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{r:null}):{r:null}}})}if(O.startColumn!==e.startColumn){const L=(H=n.getValue(O.startRow,O.startColumn))==null?void 0:H.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{l:null}):{l:null}}})}if(O.endRow!==e.endRow){const L=($=n.getValue(O.startRow,O.startColumn))==null?void 0:$.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{b:null}):{b:null}}})}if(O.startRow!==e.startRow){const L=(F=n.getValue(O.startRow,O.startColumn))==null?void 0:F.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{t:null}):{t:null}}})}}else{if(P!==e.endColumn){const L=(ee=n.getValue(T,P))==null?void 0:ee.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{r:null}):{r:null}}})}if(P!==e.startColumn){const L=(z=n.getValue(T,P))==null?void 0:z.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{l:null}):{l:null}}})}if(T!==e.endRow){const L=(ve=n.getValue(T,P))==null?void 0:ve.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{b:null}):{b:null}}})}if(T!==e.startRow){const L=(ct=n.getValue(T,P))==null?void 0:ct.s;n.setValue(T,P,{s:{bd:L!=null&&L.bd?Object.assign(L.bd,{t:null}):{t:null}}})}}}),U(w,{b:null}),U(v,{t:null},!0),U(y,{t:null}),U(I,{b:null},!0),U(b,{r:null}),U(p,{l:null},!0),U(N,{l:null}),U(M,{r:null},!0),U(e,{tl_br:null},!0),U(e,{tl_bc:null},!0),U(e,{tl_mr:null},!0),U(e,{bl_tr:null},!0),U(e,{ml_tr:null},!0),U(e,{bc_tr:null},!0))},Ze={id:"sheet.command.set-border",type:i.CommandType.COMMAND,handler:async(o,e)=>{var I;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=o.get(g.SheetsSelectionsService),a=o.get(Le),l=E(s,e);if(!l)return!1;const u=(I=r.getCurrentSelections())==null?void 0:I.map(p=>p.range);if(!(u!=null&&u.length))return!1;const{activeBorderType:d}=a.getBorderInfo();if(!d)return!1;const c=ga(a,l,u);Ra(c),Sa(c),Ca(c),fa(c);const{unitId:m,subUnitId:h,mr:R}=c,C={unitId:m,subUnitId:h,cellValue:R.getData()},S=se(o,C);return t.syncExecuteCommand(B.id,C)?(n.pushUndoRedo({unitID:m,undoMutations:[{id:B.id,params:S}],redoMutations:[{id:B.id,params:C}]}),!0):!1}},As={id:"sheet.command.set-border-position",type:i.CommandType.COMMAND,handler:async(o,e)=>{if(!e.value)return!1;const t=o.get(i.ICommandService);return o.get(Le).setType(e.value),t.executeCommand(Ze.id)}},Ws={id:"sheet.command.set-border-style",type:i.CommandType.COMMAND,handler:async(o,e)=>{const t=o.get(i.ICommandService);return o.get(Le).setStyle(e.value),t.executeCommand(Ze.id)}},Vs={id:"sheet.command.set-border-color",type:i.CommandType.COMMAND,handler:async(o,e)=>{const t=o.get(i.ICommandService);return o.get(Le).setColor(e.value),t.executeCommand(Ze.id)}},$s={id:"sheet.command.set-border-basic",type:i.CommandType.COMMAND,handler:async(o,e)=>{const{unitId:t,subUnitId:n,value:s}=e,{type:r,color:a,style:l}=s,u=o.get(i.ICommandService),d=o.get(Le);return d.setType(r),a&&d.setColor(a),d.setStyle(l),u.executeCommand(Ze.id,{unitId:t,subUnitId:n})}};function va(o,e){if(o==null)return o;const t=i.Tools.deepClone(o);if(e==null)return t;const n={};return"h"in e&&(n.h=t.h),"ia"in e&&(n.ia=t.ia),"ah"in e&&(n.ah=t.ah),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}function Ia(o,e){if(o==null)return o;const t=i.Tools.deepClone(o);if(e==null)return t;const n={};return"w"in e&&(n.w=t.w),"hd"in e&&(n.hd=t.hd),"s"in e&&(n.s=t.s),"custom"in e&&(n.custom=t.custom),n}const Ls=(o,e)=>{const{unitId:t,subUnitId:n,columnData:s}=o,r={},a=e.getColumnManager();for(const l in s){const u=s[l],d=a.getColumn(Number(l));r[l]=Ia(d,u)}return{unitId:t,subUnitId:n,columnData:r}},Qe={id:"sheet.mutation.set-col-data",type:i.CommandType.MUTATION,handler:(o,e)=>{const{columnData:t}=e,n=o.get(i.IUniverInstanceService),s=E(n,e);if(!s)return!1;const{worksheet:r}=s,a=r.getColumnManager();for(const l in t){const u=t[l];if(u==null){a.removeColumn(Number(l));continue}const d=a.getColumnOrCreate(Number(l));Object.assign(d,u)}return!0}},Bs={type:i.CommandType.COMMAND,id:"sheet.command.set-col-data",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=E(s,e);if(!r)return!1;const{columnData:a}=e,{unitId:l,subUnitId:u,worksheet:d}=r,c={subUnitId:u,unitId:l,columnData:a},m=Ls(c,d);return t.syncExecuteCommand(Qe.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:Qe.id,params:m}],redoMutations:[{id:Qe.id,params:c}]}),!0):!1}},pa=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},et={id:"sheet.mutation.set-col-hidden",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const s=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startColumn;l<a.endColumn+1;l++){const u=s.getColumnOrCreate(l);u!=null&&(u.hd=i.BooleanNumber.TRUE)}}return!0}},Ma=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},tt={id:"sheet.mutation.set-col-visible",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!n)return!1;const s=n.getSheetBySheetId(e.subUnitId).getColumnManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startColumn;l<a.endColumn+1;l++){const u=s.getColumnOrCreate(l);u!=null&&(u.hd=i.BooleanNumber.FALSE)}}return!0}},zt={type:i.CommandType.COMMAND,id:"sheet.command.set-col-visible-on-cols",handler:(o,e)=>{var I,p;const{unitId:t,subUnitId:n,ranges:s}=e,r=o.get(g.SheetInterceptorService),a=o.get(i.ICommandService),l=o.get(i.IUniverInstanceService),u=E(l,{unitId:t,subUnitId:n});if(!u)return!1;const{worksheet:d}=u,c={unitId:t,subUnitId:n,ranges:s},m={unitId:t,subUnitId:n,reveal:!0,selections:s.map(M=>({range:M,primary:te(M,d),style:null}))},h=Ma(o,c),R={unitId:t,subUnitId:n,selections:Fs(s).map(M=>({range:M,primary:te(M,d),style:null}))},C=i.sequenceExecute([{id:tt.id,params:c},{id:q.id,params:m}],a),S=r.onCommandExecute({id:zt.id,params:e}),v=i.sequenceExecute([...S.redos],a);return C.result&&v.result&&o.get(i.IUndoRedoService).pushUndoRedo({unitID:t,undoMutations:[{id:et.id,params:h},{id:q.id,params:R},...(I=S.undos)!=null?I:[]],redoMutations:[...(p=S.preRedos)!=null?p:[],{id:tt.id,params:c},{id:q.id,params:m},...S.redos]}),!0}},Hs={type:i.CommandType.COMMAND,id:"sheet.command.set-selected-cols-visible",handler:o=>{var d;const e=o.get(g.SheetsSelectionsService),t=o.get(i.ICommandService),n=(d=e.getCurrentSelections())==null?void 0:d.map(c=>c.range).filter(c=>c.rangeType===i.RANGE_TYPE.COLUMN);if(!(n!=null&&n.length))return!1;const s=E(o.get(i.IUniverInstanceService));if(!s)return!1;const{worksheet:r,unitId:a,subUnitId:l}=s,u=n.map(c=>r.getHiddenCols(c.startColumn,c.endColumn)).flat();return t.executeCommand(zt.id,{unitId:a,subUnitId:l,ranges:u})}},ro={type:i.CommandType.COMMAND,id:"sheet.command.set-col-hidden",handler:(o,e)=>{var p,M,w,y;const t=o.get(g.SheetsSelectionsService),n=o.get(g.SheetInterceptorService),s=o.get(i.IUniverInstanceService),r=o.get(i.ICommandService);let a=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(M=t.getCurrentSelections())==null?void 0:M.map(b=>b.range).filter(b=>b.rangeType===i.RANGE_TYPE.COLUMN);if(!(a!=null&&a.length))return!1;const l=E(s,e);if(!l)return!1;const{worksheet:u,unitId:d,subUnitId:c}=l;a=wa(l.worksheet,a);const m={unitId:d,subUnitId:c,ranges:a},h={unitId:d,subUnitId:c,selections:Fs(a).map(b=>({range:b,primary:te(b,u),style:null}))},R=pa(o,m),C={unitId:d,subUnitId:c,reveal:!0,selections:a.map(b=>({range:b,primary:te(b,u),style:null}))},S=i.sequenceExecute([{id:et.id,params:m},{id:q.id,params:h}],r),v=n.onCommandExecute({id:ro.id,params:m}),I=i.sequenceExecute([...v.redos],r);return S.result&&I.result?(o.get(i.IUndoRedoService).pushUndoRedo({unitID:d,undoMutations:[{id:tt.id,params:R},{id:q.id,params:C},...(w=v.undos)!=null?w:[]],redoMutations:[...(y=v.preRedos)!=null?y:[],{id:et.id,params:m},{id:q.id,params:h},...v.redos]}),!0):!1}};function wa(o,e){const t=o.getRowCount()-1,n=o.getHiddenCols(),s=[];return e.forEach(r=>{const a=n.filter(l=>l.startColumn>=r.startColumn&&l.endColumn<=r.endColumn);if(a.length){let l=r.startColumn;a.forEach(u=>{u.startColumn>l&&(s.push({startColumn:l,endColumn:u.startColumn-1,startRow:0,endRow:t}),l=u.endColumn+1)}),l<=r.endColumn&&s.push({startColumn:l,endColumn:r.endColumn,startRow:0,endRow:t})}else s.push(r)}),s}function Fs(o){return ya(o).map(t=>{const n=t.startColumn===0?t.endColumn+1:t.startColumn-1;return{...t,startColumn:n,endColumn:n}})}function ya(o){const e=[];let t;return o.sort((n,s)=>n.startColumn-s.startColumn).forEach(n=>{if(!t){t=n;return}t.endColumn===n.startColumn-1?t.endColumn=n.endColumn:(e.push(t),t=n)}),e.push(t),e}const io={id:"sheet.command.set-defined-name",type:i.CommandType.COMMAND,handler:(o,e)=>{var m,h;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(g.SheetInterceptorService);if(!e)return!1;const r={...e},a=Y.SetDefinedNameMutationFactory(o,e),l=s.onCommandExecute({id:io.id,params:e}),u=[...(m=l.preRedos)!=null?m:[],{id:Y.RemoveDefinedNameMutation.id,params:a},{id:Y.SetDefinedNameMutation.id,params:r},...l.redos],d=[...(h=l.preUndos)!=null?h:[],{id:Y.RemoveDefinedNameMutation.id,params:r},{id:Y.SetDefinedNameMutation.id,params:a},...l.undos];return i.sequenceExecute(u,t)?(n.pushUndoRedo({unitID:e.unitId,undoMutations:d.filter(Boolean),redoMutations:u.filter(Boolean)}),!0):!1}},ao=(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(s==null)throw new Error("worksheet is null error!");const a=s.getConfig().freeze;return{unitId:e.unitId,subUnitId:e.subUnitId,...a}},Ue={id:"sheet.mutation.set-frozen",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId);if(!s)return!1;const r=s.getConfig(),{startRow:a,startColumn:l,ySplit:u,xSplit:d}=e;return r.freeze={startRow:a,startColumn:l,ySplit:u,xSplit:d},!0}},js={type:i.CommandType.COMMAND,id:"sheet.command.set-frozen",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=E(s,{unitId:e.unitId,subUnitId:e.subUnitId});if(!r)return!1;const{unitId:a,subUnitId:l,worksheet:u}=r,{startColumn:d,startRow:c,xSplit:m,ySplit:h}=e;if(c>=u.getRowCount()||d>=u.getColumnCount()||m>=u.getColumnCount()||h>=u.getRowCount())return!1;const R={unitId:a,subUnitId:l,...e},C=ao(o,R);return t.syncExecuteCommand(Ue.id,R)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:Ue.id,params:C}],redoMutations:[{id:Ue.id,params:R}]}),!0):!1}},Gs={type:i.CommandType.COMMAND,id:"sheet.command.cancel-frozen",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUniverInstanceService),s=o.get(i.IUndoRedoService),r=E(n,{unitId:e==null?void 0:e.unitId,subUnitId:e==null?void 0:e.subUnitId});if(!r)return!1;const{unitId:a,subUnitId:l}=r,u={unitId:a,subUnitId:l,startRow:-1,startColumn:-1,xSplit:0,ySplit:0},d=ao(o,u);return t.syncExecuteCommand(Ue.id,u)&&s.pushUndoRedo({unitID:a,undoMutations:[{id:Ue.id,params:d}],redoMutations:[{id:Ue.id,params:u}]}),!0}},nt={id:"sheet.mutation.set-gridlines-color",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=E(o.get(i.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,s=n.getConfig();return s.gridlinesColor=e.color,!0}},qs={type:i.CommandType.COMMAND,id:"sheet.command.set-gridlines-color",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=E(s);if(!r)return!1;const{worksheet:a}=r,l=a.getConfig().gridlinesColor;if(l===(e==null?void 0:e.color))return!1;const{unitId:u,subUnitId:d}=r,c={color:e==null?void 0:e.color,unitId:u,subUnitId:d},m={color:l,unitId:u,subUnitId:d};return t.syncExecuteCommand(nt.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:nt.id,params:m}],redoMutations:[{id:nt.id,params:c}]}),!0):!1}},x={id:"sheet.mutation.set-range-protection",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,rule:s,ruleId:r}=e;return o.get(Z).setRule(t,n,r,s),!0}},_a=(o,e)=>{const{unitId:t,subUnitId:n,ruleId:s}=e,a=o.get(Z).getRule(t,n,s);return a?{id:x.id,params:{...e,rule:a}}:null},Be={id:"sheet.mutation.set-worksheet-protection",type:i.CommandType.MUTATION,handler:(o,e)=>{const{unitId:t,subUnitId:n,rule:s}=e;return o.get(ke).setRule(t,n,s),!0}},zs={type:i.CommandType.COMMAND,id:"sheet.command.set-protection",async handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(Z),{rule:r,oldRule:a}=e,{unitId:l,subUnitId:u}=r,d=[],c=[];return(a==null?void 0:a.unitType)===r.unitType?r.unitType===D.Worksheet?(d.push({id:Be.id,params:{unitId:l,subUnitId:u,rule:r}}),c.push({id:Be.id,params:{unitId:l,subUnitId:u,rule:a}})):(d.push({id:x.id,params:{unitId:l,subUnitId:u,rule:r,ruleId:r.id}}),c.push({id:x.id,params:{unitId:l,subUnitId:u,ruleId:a.id,rule:a}})):(a&&(a.unitType===D.Worksheet?(d.push({id:De.id,params:{unitId:l,subUnitId:u}}),c.push({id:Oe.id,params:{unitId:l,rule:a,subUnitId:a.subUnitId}})):a.unitType===D.SelectRange&&(d.push({id:he.id,params:{unitId:l,subUnitId:u,ruleIds:[a.id]}}),c.push({id:le.id,params:{unitId:l,subUnitId:u,rules:[a]}}))),r.unitType===D.Worksheet?(d.push({id:Oe.id,params:{unitId:l,rule:r,subUnitId:r.subUnitId}}),c.unshift({id:De.id,params:{unitId:l,subUnitId:u}})):r.unitType===D.SelectRange&&(r.id=s.createRuleId(l,u),d.push({id:le.id,params:{unitId:l,subUnitId:u,rules:[r]}}),c.unshift({id:he.id,params:{unitId:l,subUnitId:u,ruleIds:[r.id]}}))),i.sequenceExecute(d,t)&&n.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:d}),!0}},Ys=(o,e)=>{const{unitId:t,subUnitId:n,rowData:s}=o,r={},a=e.getRowManager();for(const l in s){const u=s[l],d=a.getRow(Number(l));r[l]=va(d,u)}return{unitId:t,subUnitId:n,rowData:r}},ot={id:"sheet.mutation.set-row-data",type:i.CommandType.MUTATION,handler:(o,e)=>{const{rowData:t}=e,n=o.get(i.IUniverInstanceService),s=E(n,e);if(!s)return!1;const{worksheet:r}=s,a=r.getRowManager();for(const l in t){const u=t[l];if(u==null){a.removeRow(Number(l));continue}const d=a.getRowOrCreate(Number(l));Object.assign(d,u)}return!0}},Ks={type:i.CommandType.COMMAND,id:"sheet.command.set-row-data",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=E(s,e);if(!r)return!1;const{rowData:a}=e,{unitId:l,subUnitId:u,worksheet:d}=r,c={subUnitId:u,unitId:l,rowData:a},m=Ys(c,d);return t.syncExecuteCommand(ot.id,c)?(n.pushUndoRedo({unitID:l,undoMutations:[{id:ot.id,params:m}],redoMutations:[{id:ot.id,params:c}]}),!0):!1}},ba=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},st={id:"sheet.mutation.set-row-visible",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startRow;l<a.endRow+1;l++){const u=s.getRowOrCreate(l);u!=null&&(u.hd=0)}}return!0}},Ta=(o,e)=>{if(o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId)==null)throw new Error("universheet is null error!");return{unitId:e.unitId,subUnitId:e.subUnitId,ranges:e.ranges}},rt={id:"sheet.mutation.set-row-hidden",type:i.CommandType.MUTATION,handler:(o,e)=>{const n=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(n==null)throw new Error("universheet is null error!");const s=n.getSheetBySheetId(e.subUnitId).getRowManager();for(let r=0;r<e.ranges.length;r++){const a=e.ranges[r];for(let l=a.startRow;l<a.endRow+1;l++){const u=s.getRowOrCreate(l);u!=null&&(u.hd=1)}}return!0}},Yt={type:i.CommandType.COMMAND,id:"sheet.command.set-specific-rows-visible",handler:(o,e)=>{var I,p,M;const{unitId:t,subUnitId:n,ranges:s}=e,r=o.get(i.ICommandService),a=o.get(i.IUndoRedoService),l=o.get(g.SheetInterceptorService),u=E(o.get(i.IUniverInstanceService),{unitId:t,subUnitId:n});if(!u)return!1;const{worksheet:d}=u,c={unitId:t,subUnitId:n,ranges:s},m={unitId:t,subUnitId:n,reveal:!0,selections:s.map(w=>({range:w,primary:te(w,d),style:null}))},h=ba(o,c),R={unitId:t,subUnitId:n,selections:xs(s).map(w=>({range:w,primary:te(w,d),style:null}))},C=i.sequenceExecute([{id:st.id,params:c},{id:q.id,params:m}],r),S=l.onCommandExecute({id:Yt.id,params:e}),v=i.sequenceExecute([...S.redos],r);return C.result&&v.result&&a.pushUndoRedo({unitID:t,undoMutations:[...(I=S.preUndos)!=null?I:[],{id:rt.id,params:h},{id:q.id,params:R},...(p=S.undos)!=null?p:[]],redoMutations:[...(M=S.preRedos)!=null?M:[],{id:st.id,params:c},{id:q.id,params:m},...S.redos]}),!0}},Js={type:i.CommandType.COMMAND,id:"sheet.command.set-selected-rows-visible",handler:async o=>{var c;const e=o.get(g.SheetsSelectionsService),t=o.get(i.IUniverInstanceService),n=o.get(i.ICommandService),s=(c=e.getCurrentSelections())==null?void 0:c.map(m=>m.range).filter(m=>m.rangeType===i.RANGE_TYPE.ROW);if(!(s!=null&&s.length))return!1;const r=E(t);if(!r)return!1;const{worksheet:a,unitId:l,subUnitId:u}=r,d=s.map(m=>a.getHiddenRows(m.startRow,m.endRow)).flat();return n.executeCommand(Yt.id,{unitId:l,subUnitId:u,ranges:d})}},lo={type:i.CommandType.COMMAND,id:"sheet.command.set-rows-hidden",handler:(o,e)=>{var p,M,w,y,b,N;const t=o.get(g.SheetsSelectionsService),n=o.get(i.ICommandService),s=o.get(i.IUndoRedoService),r=o.get(i.IUniverInstanceService),a=o.get(g.SheetInterceptorService);let l=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(M=t.getCurrentSelections())==null?void 0:M.map(U=>U.range).filter(U=>U.rangeType===i.RANGE_TYPE.ROW);if(!(l!=null&&l.length))return!1;const u=E(r,e);if(!u)return!1;l=Ua(u.worksheet,l);const{unitId:d,subUnitId:c,worksheet:m}=u,h={unitId:d,subUnitId:c,ranges:l},R={unitId:d,subUnitId:c,selections:xs(l).map(U=>({range:U,primary:te(U,m),style:null}))},C=Ta(o,h),S={unitId:d,subUnitId:c,reveal:!0,selections:l.map(U=>({range:U,primary:te(U,m),style:null}))},v=a.onCommandExecute({id:lo.id,params:h});return i.sequenceExecute([...(w=v.preRedos)!=null?w:[],{id:rt.id,params:h},{id:q.id,params:R},...v.redos],n).result&&s.pushUndoRedo({unitID:d,undoMutations:[...(y=v.preUndos)!=null?y:[],{id:st.id,params:C},{id:q.id,params:S},...(b=v.undos)!=null?b:[]],redoMutations:[...(N=v.preRedos)!=null?N:[],{id:rt.id,params:h},{id:q.id,params:R},...v.redos]}),!0}};function Ua(o,e){const t=o.getMaxColumns()-1,n=o.getHiddenRows(),s=[];return e.forEach(r=>{const a=n.filter(l=>l.startRow>=r.startRow&&l.endRow<=r.endRow);if(a.length){let l=r.startRow;a.forEach(u=>{u.startRow>l&&(s.push({startRow:l,endRow:u.startRow-1,startColumn:0,endColumn:t}),l=u.endRow+1)}),l<=r.endRow&&s.push({startRow:l,endRow:r.endRow,startColumn:0,endColumn:t})}else s.push(r)}),s}function xs(o){return Ea(o).map(t=>{const n=t.startRow===0?t.endRow+1:t.startRow-1;return{...t,startRow:n,endRow:n}})}function Ea(o){const e=[];let t;return o.sort((n,s)=>n.startRow-s.startRow).forEach(n=>{if(!t){t=n;return}n.startRow===t.endRow+1?t.endRow=n.endRow:(e.push(t),t=n)}),e.push(t),e}const X={type:i.CommandType.COMMAND,id:"sheet.command.set-style",handler:(o,e)=>{var y;const t=o.get(i.IUniverInstanceService),n=E(t,e);if(!n)return!1;const{unitId:s,subUnitId:r,worksheet:a}=n,{range:l,style:u}=e,d=o.get(i.ICommandService),c=o.get(i.IUndoRedoService),m=o.get(g.SheetsSelectionsService),h=l?[l]:(y=m.getCurrentSelections())==null?void 0:y.map(b=>b.range);if(!(h!=null&&h.length))return!1;const R=new i.ObjectMatrix,C=oa(a);if(i.Tools.isArray(u.value))for(let b=0;b<h.length;b++)C.forOperableEach(h[b],(N,U,T)=>{R.setValue(N,U,{s:{[u.type]:u.value[N-T.startRow][U-T.startColumn]}})});else for(let b=0;b<h.length;b++){const N={s:{[u.type]:u.value}};C.forOperableEach(h[b],(U,T)=>R.setValue(U,T,N))}const S={subUnitId:r,unitId:s,cellValue:R.getMatrix()},v=se(o,S),I=d.syncExecuteCommand(B.id,S),{undos:p,redos:M}=o.get(g.SheetInterceptorService).onCommandExecute({id:X.id,params:e}),w=i.sequenceExecute([...M],d);return I&&w.result?(c.pushUndoRedo({unitID:S.unitId,undoMutations:[{id:B.id,params:v},...p],redoMutations:[{id:B.id,params:S},...M]}),!0):!1}},Pa={type:i.CommandType.COMMAND,id:"sheet.command.set-bold",handler:o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=E(o.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t,{actualRow:s,actualColumn:r}=e.primary,l={style:{type:"bl",value:n.getRange(s,r).getFontWeight()===i.FontWeight.BOLD?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}};return o.get(i.ICommandService).syncExecuteCommand(X.id,l)}},Na={type:i.CommandType.COMMAND,id:"sheet.command.set-italic",handler:o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=E(o.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;if(e.primary){const{startRow:a,startColumn:l}=e.primary;s=n.getRange(a,l).getFontStyle()===i.FontItalic.ITALIC}const r={style:{type:"it",value:s?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}};return o.get(i.ICommandService).syncExecuteCommand(X.id,r)}},ka={type:i.CommandType.COMMAND,id:"sheet.command.set-underline",handler:o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=E(o.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;e.primary&&(s=!!n.getRange(e.primary.startRow,e.primary.startColumn).getUnderline().s);const r={style:{type:"ul",value:{s:s?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return o.get(i.ICommandService).syncExecuteCommand(X.id,r)}},Oa={type:i.CommandType.COMMAND,id:"sheet.command.set-stroke",handler:o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=E(o.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;e.primary&&(s=!!n.getRange(e.primary.actualRow,e.primary.actualColumn).getStrikeThrough().s);const r={style:{type:"st",value:{s:s?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return o.get(i.ICommandService).syncExecuteCommand(X.id,r)}},Da={type:i.CommandType.COMMAND,id:"sheet.command.set-overline",handler:o=>{const e=o.get(g.SheetsSelectionsService).getCurrentLastSelection();if(!e)return!1;const t=E(o.get(i.IUniverInstanceService));if(!t)return!1;const{worksheet:n}=t;let s=!0;e.primary&&(s=!!n.getRange(e.primary.startRow,e.primary.startColumn).getOverline().s);const r={style:{type:"ol",value:{s:s?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE}}};return o.get(i.ICommandService).syncExecuteCommand(X.id,r)}},Aa={type:i.CommandType.COMMAND,id:"sheet.command.set-font-family",handler:(o,e)=>{if(!e)return!1;const t=o.get(i.ICommandService),n={style:{type:"ff",value:e.value}};return t.syncExecuteCommand(X.id,n)}},Wa={type:i.CommandType.COMMAND,id:"sheet.command.set-font-size",handler:(o,e)=>{if(!e)return!1;const t=o.get(i.ICommandService),n={style:{type:"fs",value:e.value}};return t.syncExecuteCommand(X.id,n)}},Xs={type:i.CommandType.COMMAND,id:"sheet.command.set-text-color",handler:(o,e)=>{if(!e)return!1;const t=o.get(i.ICommandService),n={style:{type:"cl",value:{rgb:e.value}}};return t.syncExecuteCommand(X.id,n)}},Zs={type:i.CommandType.COMMAND,id:"sheet.command.reset-text-color",handler:o=>{const e=o.get(i.ICommandService),t={style:{type:"cl",value:{rgb:null}}};return e.syncExecuteCommand(X.id,t)}},Qs={type:i.CommandType.COMMAND,id:"sheet.command.set-background-color",handler:(o,e)=>{if(!e||!e.value)return!1;const t=o.get(i.ICommandService),n={style:{type:"bg",value:{rgb:e.value}}};return t.syncExecuteCommand(X.id,n)}},er={type:i.CommandType.COMMAND,id:"sheet.command.reset-background-color",handler:o=>{const e=o.get(i.ICommandService),t={style:{type:"bg",value:{rgb:null}}};return e.syncExecuteCommand(X.id,t)}},tr={type:i.CommandType.COMMAND,id:"sheet.command.set-vertical-text-align",handler:(o,e)=>{if(!e)return!1;const t=o.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"vt",value:e.value}};return t.syncExecuteCommand(X.id,n)}},nr={type:i.CommandType.COMMAND,id:"sheet.command.set-horizontal-text-align",handler:(o,e)=>{if(!e)return!1;const t=o.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"ht",value:e.value}};return t.syncExecuteCommand(X.id,n)}},or={type:i.CommandType.COMMAND,id:"sheet.command.set-text-wrap",handler:(o,e)=>{if(!e)return!1;const t=o.get(i.ICommandService),n={unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,style:{type:"tb",value:e.value}};return t.syncExecuteCommand(X.id,n)}},sr={type:i.CommandType.COMMAND,id:"sheet.command.set-text-rotation",handler:(o,e)=>{if(!e)return!1;const t=typeof e.value=="number"?{a:e.value}:{a:0,v:i.BooleanNumber.TRUE},n=o.get(i.ICommandService),s={style:{type:"tr",value:t}};return n.syncExecuteCommand(X.id,s)}},Va=(o,e)=>{const r=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().tabColor;return{...i.Tools.deepClone(e),color:r}},Mt={id:"sheet.mutation.set-tab-color",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().tabColor=e.color,!0):!1}},rr={type:i.CommandType.COMMAND,id:"sheet.command.set-tab-color",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=E(o.get(i.IUniverInstanceService));if(!s)return!1;const{unitId:r,subUnitId:a}=s,l={color:e.value,unitId:r,subUnitId:a},u=Va(o,l);return t.syncExecuteCommand(Mt.id,l)?(n.pushUndoRedo({unitID:r,undoMutations:[{id:Mt.id,params:u}],redoMutations:[{id:Mt.id,params:l}]}),!0):!1}},uo={id:"sheet.mutation.set-workbook-name",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUnit(e.unitId,i.UniverInstanceType.UNIVER_SHEET);return t?(t.setName(e.name),!0):!1}},co={type:i.CommandType.COMMAND,id:"sheet.command.set-workbook-name",handler:async(o,e)=>{var d;if(!o.get(i.IUniverInstanceService).getUnit(e.unitId,i.UniverInstanceType.UNIVER_SHEET))return!1;const r=o.get(g.SheetInterceptorService).onCommandExecute({id:co.id,params:e}),a={name:e.name,unitId:e.unitId},l=[...(d=r.preRedos)!=null?d:[],{id:uo.id,params:a},...r.redos],u=o.get(i.ICommandService);return i.sequenceExecute(l,u).result}},it={id:"sheet.operation.set-worksheet-active",type:i.CommandType.OPERATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getWorksheets();for(const[,s]of n)if(s.getSheetId()===e.subUnitId)return t.setActiveSheet(s),!0;return!1}},$a=4,mo={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-activate",handler:(o,e,t)=>{const n=o.get(i.ICommandService),s=E(o.get(i.IUniverInstanceService),e);if(!s)return!1;const{unitId:r,subUnitId:a}=s;return new Promise(l=>{setTimeout(()=>{const u=n.syncExecuteCommand(it.id,{unitId:r,subUnitId:a},t);l(u)},$a)})}},ho=(o,e)=>{const{unitId:t,subUnitId:n,ranges:s}=o,r={},a=e.getColumnManager();for(let l=0;l<s.length;l++){const u=s[l];for(let d=u.startColumn;d<u.endColumn+1;d++){const c=a.getColumnOrCreate(d);r[d]=c.w}}return{unitId:t,subUnitId:n,ranges:s,colWidth:r}},Me={id:"sheet.mutation.set-worksheet-col-width",type:i.CommandType.MUTATION,handler:(o,e)=>{var u;const t=o.get(i.IUniverInstanceService),n=E(t,e);if(!n)return!1;const{worksheet:s}=n,r=s.getConfig().defaultColumnWidth,a=s.getColumnManager(),l=e.ranges;for(let d=0;d<l.length;d++){const c=l[d];for(let m=c.startColumn;m<c.endColumn+1;m++){if(!s.getColVisible(m))continue;const R=a.getColumnOrCreate(m);typeof e.colWidth=="number"?R.w=e.colWidth:R.w=(u=e.colWidth[m])!=null?u:r}}return!0}},go={type:i.CommandType.COMMAND,id:"sheet.command.delta-column-width",handler:async(o,e)=>{const n=o.get(g.SheetsSelectionsService).getCurrentSelections();if(!(n!=null&&n.length))return!1;const s=o.get(i.ICommandService),r=o.get(i.IUndoRedoService),a=E(o.get(i.IUniverInstanceService));if(!a)return!1;const{worksheet:l,unitId:u,subUnitId:d}=a,{anchorCol:c,deltaX:m}=e,R=l.getColumnWidth(c)+m,C=n.length===1&&n[0].range.rangeType===i.RANGE_TYPE.ALL,S=n.filter(N=>N.range.rangeType===i.RANGE_TYPE.COLUMN),v=C?i.RANGE_TYPE.ALL:S.some(({range:N})=>{const{startColumn:U,endColumn:T}=N;return U<=c&&c<=T})?i.RANGE_TYPE.COLUMN:i.RANGE_TYPE.NORMAL;let I;if(v===i.RANGE_TYPE.ALL){const N=l.getRowCount(),U=new Array(l.getColumnCount()).fill(void 0).map((T,P)=>({startRow:0,endRow:N-1,startColumn:P,endColumn:P}));I={subUnitId:d,unitId:u,colWidth:R,ranges:U}}else v===i.RANGE_TYPE.COLUMN?I={subUnitId:d,unitId:u,ranges:S.map(N=>i.Rectangle.clone(N.range)),colWidth:R}:I={subUnitId:d,unitId:u,colWidth:R,ranges:[{startRow:0,endRow:l.getMaxRows()-1,startColumn:c,endColumn:c}]};const{undos:p,redos:M}=o.get(g.SheetInterceptorService).onCommandExecute({id:go.id,params:I}),w=ho(I,l),y=s.syncExecuteCommand(Me.id,I),b=i.sequenceExecute([...M],s);return y&&b.result&&r.pushUndoRedo({unitID:u,undoMutations:[{id:Me.id,params:w},...p],redoMutations:[{id:Me.id,params:I},...M]}),!0}},Kt={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-col-width",handler:(o,e)=>{var p,M,w,y;const t=o.get(g.SheetsSelectionsService),n=o.get(i.ICommandService),s=o.get(i.IUndoRedoService),r=o.get(g.SheetInterceptorService),a=(p=e==null?void 0:e.ranges)!=null&&p.length?e.ranges:(M=t.getCurrentSelections())==null?void 0:M.map(b=>b.range);if(!(a!=null&&a.length))return!1;const l=E(o.get(i.IUniverInstanceService),e);if(!l)return!1;const{subUnitId:u,unitId:d,worksheet:c}=l,m={subUnitId:u,unitId:d,ranges:a,colWidth:e.value},h=ho(m,c),R=n.syncExecuteCommand(Me.id,m),{undos:C,redos:S}=o.get(g.SheetInterceptorService).onCommandExecute({id:Kt.id,params:m}),v=r.onCommandExecute({id:Kt.id,params:m}),I=i.sequenceExecute([...S,...v.redos],n);return R&&I.result?(s.pushUndoRedo({unitID:d,undoMutations:[...(w=v.preUndos)!=null?w:[],{id:Me.id,params:h},...C],redoMutations:[...(y=v.preRedos)!=null?y:[],{id:Me.id,params:m},...S]}),!0):!1}},La={type:i.CommandType.COMMAND,id:"sheet.command.set-col-is-auto-width",handler:async(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(g.SheetsSelectionsService),r=o.get(i.IUniverInstanceService),a=E(r,e);if(!a)return!1;const{unitId:l,subUnitId:u}=a;let d=[];if(e!=null&&e.ranges)d=[...e.ranges];else{const C=s.getCurrentSelections();for(let S=0;S<C.length;S++)d.push(C[S].range)}if(!(d!=null&&d.length))return!1;const c={unitId:l,subUnitId:u,ranges:d},{undos:m,redos:h}=o.get(g.SheetInterceptorService).onCommandExecute({id:La.id,params:c});return i.sequenceExecute([...h],t).result?(n.pushUndoRedo({unitID:l,undoMutations:[...m],redoMutations:[...h]}),!0):!1}},at={id:"sheet.mutation.set-worksheet-default-style",type:i.CommandType.MUTATION,handler:(o,e)=>{const{defaultStyle:t}=e,n=o.get(i.IUniverInstanceService),s=E(n);if(!s)return!1;const{worksheet:r}=s;return r?(r.setDefaultCellStyle(t),!0):!1}},ir=(o,e)=>{const t=Ve(o.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetDefaultStyleMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,subUnitId:n.getSheetId(),defaultStyle:n.getDefaultCellStyle()}},ar={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-default-style",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{unitId:s}=e,r=ir(o,e);return t.syncExecuteCommand(at.id,e)?(n.pushUndoRedo({unitID:s,undoMutations:[{id:at.id,params:r}],redoMutations:[{id:at.id,params:e}]}),!0):!1}},lr=(o,e)=>{const t=Ve(o.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetHideMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{hidden:n.isSheetHidden(),unitId:e.unitId,subUnitId:n.getSheetId()}},Ee={id:"sheet.mutation.set-worksheet-hidden",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().hidden=e.hidden,!0):!1}},ur={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-hidden",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.ErrorService),r=o.get(i.LocaleService),a=E(o.get(i.IUniverInstanceService),e);if(!a)return!1;const{workbook:l,worksheet:u,unitId:d,subUnitId:c}=a;if(u.getConfig().hidden===i.BooleanNumber.TRUE)return!1;const h={unitId:d,subUnitId:c,hidden:i.BooleanNumber.TRUE},R=lr(o,h);return l.getSheets().filter(I=>I.getConfig().hidden===i.BooleanNumber.FALSE).length===1?(s.emit(r.t("sheets.info.hideSheet")),!1):t.syncExecuteCommand(Ee.id,h)?(n.pushUndoRedo({unitID:d,undoMutations:[{id:Ee.id,params:R}],redoMutations:[{id:Ee.id,params:h}]}),!0):!1}},Ba=(o,e)=>{const t=Ve(o.get(i.IUniverInstanceService),e);if(!t)throw new Error("[SetWorksheetNameMutationFactory]: worksheet is null error!");const{worksheet:n}=t;return{unitId:e.unitId,name:n.getName(),subUnitId:n.getSheetId()}},Jt={id:"sheet.mutation.set-worksheet-name",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(t==null)return!1;const n=t.getSheetBySheetId(e.subUnitId);return n?(n.getConfig().name=e.name,!0):!1}},Ro={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-name",handler:(o,e)=>{var C,S;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(g.SheetInterceptorService),r=E(o.get(i.IUniverInstanceService),e);if(!r)return!1;const{unitId:a,subUnitId:l}=r,u={subUnitId:l,name:e.name,unitId:a},d=Ba(o,u),c=s.onCommandExecute({id:Ro.id,params:e}),m=[...(C=c.preRedos)!=null?C:[],{id:Jt.id,params:u},...c.redos],h=[...(S=c.preUndos)!=null?S:[],{id:Jt.id,params:d},...c.undos];return i.sequenceExecute(m,t).result?(n.pushUndoRedo({unitID:a,undoMutations:h,redoMutations:m}),!0):!1}},Ha=(o,e)=>({...i.Tools.deepClone(e),toOrder:e.fromOrder,fromOrder:e.toOrder}),wt={id:"sheet.mutation.set-worksheet-order",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getConfig();return n.sheetOrder.splice(e.fromOrder,1),n.sheetOrder.splice(e.toOrder,0,e.subUnitId),!0}},dr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-order",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=E(o.get(i.IUniverInstanceService),e);if(!s)return!1;const{workbook:r,unitId:a,subUnitId:l}=s,d={fromOrder:r.getConfig().sheetOrder.indexOf(l),toOrder:e.order,unitId:a,subUnitId:l},c=Ha(o,d);return t.syncExecuteCommand(wt.id,d)?(n.pushUndoRedo({unitID:a,undoMutations:[{id:wt.id,params:c}],redoMutations:[{id:wt.id,params:d}]}),!0):!1}};class yt{constructor(){f(this,"_model",new Map);f(this,"_pointChange",new W.Subject);f(this,"pointChange$",this._pointChange.asObservable())}addRule(e){this._ensureSubUnitMap(e.unitId).set(e.subUnitId,e),this._pointChange.next(e)}deleteRule(e,t){var s,r,a;const n=(s=this._model.get(e))==null?void 0:s.get(t);n&&((a=(r=this._model)==null?void 0:r.get(e))==null||a.delete(t),this._pointChange.next(n))}getRule(e,t){var n,s;return(s=(n=this._model)==null?void 0:n.get(e))==null?void 0:s.get(t)}toObject(){const e={};return[...this._model.keys()].forEach(n=>{const s=this._model.get(n);s!=null&&s.size&&(e[n]=[],[...s.keys()].forEach(a=>{const l=s.get(a);l&&e[n].push(l)}))}),e}fromObject(e){const t=new Map;Object.keys(e).forEach(n=>{const s=e[n];if(s!=null&&s.length){const r=new Map;s.forEach(a=>{r.set(a.subUnitId,a)}),t.set(n,r)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}getTargetByPermissionId(e,t){const n=this._model.get(e);if(!n)return null;for(const[s,r]of n)if(r.permissionId===t)return[e,s]}}class Co{constructor(e,t,n){f(this,"type",D.SelectRange);f(this,"subType",_.Delete);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${_.Delete}.${n}`}}class So{constructor(e,t,n){f(this,"type",D.SelectRange);f(this,"subType",_.ManageCollaborator);f(this,"status",i.PermissionStatus.INIT);f(this,"value",!0);f(this,"id");f(this,"unitId");f(this,"subUnitId");f(this,"permissionId");this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${D.SelectRange}.${_.ManageCollaborator}.${n}`}}const Se=()=>[Wt,Rt,So,Co],cr=[_.Edit,_.View,_.ManageCollaborator,_.Delete],Fa=(o="unitId",e="subUnitId",t="permissionId")=>Se().reduce((n,s)=>{const r=new s(o,e,t);return n[r.subType]=r.value,n},{}),xt=()=>[Vt,yn,gn,Un,Rn,In,Mn,Sn,fn,bn,pn,vn,Tn,wn,us,En,_n,Cn],ja=[_.Edit,_.Print,_.Comment,_.View,_.Copy,_.Export,_.ManageCollaborator,_.CreateSheet,_.DeleteSheet,_.RenameSheet,_.HideSheet,_.Duplicate,_.Share,_.MoveSheet,_.CopySheet,_.RecoverHistory,_.ViewHistory,_.CreatePermissionObject],we=()=>[Ct,zn,Ln,kn],lt=()=>[Pn,Nn,On,Dn,An,Wn,$n,Vn,Bn,Hn,Fn,jn,Gn,qn],Ga=[_.Copy,_.DeleteColumn,_.DeleteRow,_.EditExtraObject,_.Filter,_.InsertColumn,_.InsertRow,_.InsertHyperlink,_.PivotTable,_.SetCellStyle,_.SetCellValue,_.SetColumnStyle,_.SetRowStyle,_.Sort];var qa=Object.defineProperty,za=Object.getOwnPropertyDescriptor,Ya=(o,e,t,n)=>{for(var s=n>1?void 0:n?za(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&qa(e,t,s),s},Pe=(o,e)=>(t,n)=>e(t,n,o);const Ka="SHEET_WORKSHEET_PROTECTION_PLUGIN",Ja="SHEET_WORKSHEET_PROTECTION_POINT_PLUGIN";g.WorksheetPermissionService=class extends i.RxDisposable{constructor(e,t,n,s,r,a,l,u){super(),this._permissionService=e,this._univerInstanceService=t,this._injector=n,this._worksheetProtectionRuleModel=s,this._worksheetProtectionPointRuleModel=r,this._resourceManagerService=a,this._rangeProtectionRuleModel=l,this._logService=u,this._init(),this._initRuleChange(),this._initRuleSnapshot(),this._initPointSnapshot()}_init(){const e=t=>{const n=t.getUnitId(),s=r=>{const a=r.getSheetId();[...we(),...lt()].forEach(l=>{const u=new l(n,a);this._permissionService.addPermissionPoint(u)}),this._logService.debug("[WorksheetPermissionService]","Initialization completed",n,a)};t.getSheets().forEach(r=>{s(r)}),t.sheetCreated$.subscribe(r=>{s(r)}),t.sheetDisposed$.subscribe(r=>{const a=r.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,a).forEach(u=>{[...Se()].forEach(d=>{const c=new d(n,a,u.permissionId);this._permissionService.deletePermissionPoint(c.id)})}),[...we(),...lt()].forEach(u=>{const d=new u(n,a);this._permissionService.deletePermissionPoint(d.id)})})};this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).pipe(mt.takeUntil(this.dispose$)).subscribe(e),this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).pipe(mt.takeUntil(this.dispose$)).subscribe(t=>{t.getSheets().forEach(n=>{const s=t.getUnitId(),r=n.getSheetId();we().forEach(a=>{const l=new a(s,r);this._permissionService.deletePermissionPoint(l.id)})})})}_initRuleChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":break;case"delete":{we().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)});break}case"set":{we().forEach(t=>{const n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,e.rule)});break}}}))}_initRuleSnapshot(){const e=()=>{const n=this._worksheetProtectionRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Ka,businesses:[At.UNIVER_SHEET],onLoad:(n,s)=>{this._worksheetProtectionRuleModel.fromObject(s),Object.keys(s).forEach(r=>{we().forEach(a=>{const l=new a(n,r);l.value=!1,this._permissionService.addPermissionPoint(l)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)},onUnLoad:n=>{const s=this._univerInstanceService.getUnit(n);s&&(s.getSheets().forEach(r=>{const a=r.getSheetId();[...we(),...lt()].forEach(l=>{const u=new l(n,a);this._permissionService.deletePermissionPoint(u.id)})}),xt().forEach(r=>{const a=new r(n);this._permissionService.deletePermissionPoint(a.id)})),this._worksheetProtectionRuleModel.deleteUnitModel(n)}}))}_initPointSnapshot(){const e=()=>{const n=this._worksheetProtectionPointRuleModel.toObject();return JSON.stringify(n)},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:Ja,businesses:[At.UNIVER_SHEET],onLoad:(n,s)=>{this._worksheetProtectionPointRuleModel.fromObject(s),Object.keys(s).forEach(r=>{lt().forEach(a=>{const l=new a(n,r);this._permissionService.addPermissionPoint(l)})})},onUnLoad:n=>{this._worksheetProtectionPointRuleModel.deleteUnitModel(n)}}))}},g.WorksheetPermissionService=Ya([Pe(0,i.Inject(i.IPermissionService)),Pe(1,i.Inject(i.IUniverInstanceService)),Pe(2,i.Inject(i.Injector)),Pe(3,i.Inject(ke)),Pe(4,i.Inject(yt)),Pe(5,i.Inject(i.IResourceManagerService)),Pe(6,i.Inject(Z)),Pe(7,i.Inject(i.ILogService))],g.WorksheetPermissionService);const fo={id:"sheet.mutation.set-worksheet-permission-points",type:i.CommandType.MUTATION,handler:(o,e)=>{const{rule:t}=e;return o.get(yt).addRule(t),!0}},mr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-permission-points",async handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),{rule:n}=e;return t.executeCommand(fo.id,{rule:n,unitId:n.unitId,subUnitId:n.subUnitId}),!0}},hr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-protection",async handler(o,e){if(!e)return!1;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),{rule:s,permissionId:r,oldRule:a}=e,{unitId:l,subUnitId:u}=s,d={...s,permissionId:r};if(await t.executeCommand(Be.id,{unitId:l,subUnitId:u,newRule:d})){const m=[{id:Be.id,params:{unitId:l,subUnitId:u,newRule:d}}],h=[{id:Be.id,params:{unitId:l,subUnitId:u,rule:a}}];n.pushUndoRedo({unitID:l,redoMutations:m,undoMutations:h})}return!0}},xa=2e3,gr=(o,e)=>{const{unitId:t,subUnitId:n,ranges:s}=o,r={},a=e.getRowManager();for(const{startRow:l,endRow:u}of s)for(let d=l;d<u+1;d++){const c=a.getRowOrCreate(d);r[d]=c.h}return{unitId:t,subUnitId:n,ranges:s,rowHeight:r}},vo=(o,e)=>{const{unitId:t,subUnitId:n,ranges:s}=o,r={},a=e.getRowManager();for(const{startRow:l,endRow:u}of s)for(let d=l;d<=u;d++){const c=a.getRowOrCreate(d);r[d]=c.ia}return{unitId:t,subUnitId:n,ranges:s,autoHeightInfo:r}},Xa=(o,e)=>{const{unitId:t,subUnitId:n,rowsAutoHeightInfo:s}=o,r=[],a=e.getRowManager();for(const l of s){const{row:u}=l,{ah:d}=a.getRowOrCreate(u);r.push({row:u,autoHeight:d})}return{unitId:t,subUnitId:n,rowsAutoHeightInfo:r}},ye={id:"sheet.mutation.set-worksheet-row-height",type:i.CommandType.MUTATION,handler:(o,e)=>{var d;const{ranges:t,rowHeight:n}=e,s=o.get(i.IUniverInstanceService),r=E(s,e);if(!r)return!1;const{worksheet:a}=r,l=a.getRowManager(),u=a.getConfig().defaultRowHeight;for(const{startRow:c,endRow:m}of t)for(let h=c;h<=m;h++){const R=l.getRowOrCreate(h);typeof n=="number"?R.h=n:R.h=(d=n[h])!=null?d:u,R.h=Math.min(xa,R.h)}return!0}},ae={id:"sheet.mutation.set-worksheet-row-is-auto-height",type:i.CommandType.MUTATION,handler:(o,e)=>{var l;const{ranges:t,autoHeightInfo:n}=e,s=o.get(i.IUniverInstanceService),r=E(s,e);if(!r)return!1;const a=r.worksheet.getRowManager();for(const{startRow:u,endRow:d}of t)for(let c=u;c<=d;c++){const m=a.getRowOrCreate(c);typeof n=="number"?m.ia=n:m.ia=(l=n[c])!=null?l:void 0}return!0}},Io={id:"sheet.mutation.set-worksheet-row-auto-height",type:i.CommandType.MUTATION,handler:(o,e)=>{const{rowsAutoHeightInfo:t}=e,n=o.get(i.IUniverInstanceService),s=E(n,e);if(!s)return!1;const r=s.worksheet.getRowManager();for(const{row:a,autoHeight:l}of t){const u=r.getRowOrCreate(a);u.ah=l}return!0}},po={type:i.CommandType.COMMAND,id:"sheet.command.delta-row-height",handler:async(o,e)=>{var T,P;const n=o.get(g.SheetsSelectionsService).getCurrentSelections(),s=o.get(g.SheetInterceptorService);if(!(n!=null&&n.length))return!1;const r=E(o.get(i.IUniverInstanceService));if(!r)return!1;const{worksheet:a,subUnitId:l,unitId:u}=r,{anchorRow:d,deltaY:c}=e,h=a.getRowHeight(d)+c,R=n.length===1&&n[0].range.rangeType===i.RANGE_TYPE.ALL,C=n.filter(O=>O.range.rangeType===i.RANGE_TYPE.ROW),S=R?i.RANGE_TYPE.ALL:C.some(({range:O})=>{const{startRow:A,endRow:H}=O;return A<=d&&d<=H})?i.RANGE_TYPE.ROW:i.RANGE_TYPE.NORMAL;let v;if(S===i.RANGE_TYPE.ALL){const O=a.getRowCount(),A=new Array(a.getColumnCount()).fill(void 0).map((H,$)=>({startRow:$,endRow:$,startColumn:0,endColumn:O-1}));v={subUnitId:l,unitId:u,rowHeight:h,ranges:A}}else S===i.RANGE_TYPE.ROW?v={subUnitId:l,unitId:u,ranges:C.map(O=>i.Rectangle.clone(O.range)),rowHeight:h}:v={subUnitId:l,unitId:u,rowHeight:h,ranges:[{startRow:d,endRow:d,startColumn:0,endColumn:a.getMaxColumns()-1}]};const I=gr(v,a),p={unitId:u,subUnitId:l,ranges:v.ranges,autoHeightInfo:i.BooleanNumber.FALSE},M=vo(p,a),w=o.get(i.ICommandService),y=o.get(i.IUndoRedoService),b=s.onCommandExecute({id:po.id,params:v}),N=i.sequenceExecute([{id:ye.id,params:v},{id:ae.id,params:p}],w),U=i.sequenceExecute([...b.redos],w);return N.result&&U.result?(y.pushUndoRedo({unitID:u,undoMutations:[...(T=b.preUndos)!=null?T:[],{id:ye.id,params:I},{id:ae.id,params:M},...b.undos],redoMutations:[...(P=b.preRedos)!=null?P:[],{id:ye.id,params:v},{id:ae.id,params:p},...b.redos]}),!0):!1}},Mo={type:i.CommandType.COMMAND,id:"sheet.command.set-row-height",handler:(o,e)=>{var M,w,y,b;const t=o.get(g.SheetsSelectionsService),n=o.get(i.ICommandService),s=o.get(i.IUndoRedoService),r=o.get(i.IUniverInstanceService),a=o.get(g.SheetInterceptorService),l=(M=e==null?void 0:e.ranges)!=null&&M.length?e.ranges:(w=t.getCurrentSelections())==null?void 0:w.map(N=>N.range);if(!(l!=null&&l.length))return!1;const u=E(r,e);if(!u)return!1;const{unitId:d,subUnitId:c,worksheet:m}=u,h={subUnitId:c,unitId:d,ranges:l,rowHeight:e.value},R=gr(h,m),C={unitId:d,subUnitId:c,ranges:h.ranges,autoHeightInfo:i.BooleanNumber.FALSE},S=vo(C,m),v=i.sequenceExecute([{id:ye.id,params:h},{id:ae.id,params:C}],n),I=a.onCommandExecute({id:Mo.id,params:h}),p=i.sequenceExecute([...I.redos],n);return v.result&&p.result?(s.pushUndoRedo({unitID:d,undoMutations:[...(y=I.preRedos)!=null?y:[],{id:ye.id,params:R},{id:ae.id,params:S},...I.undos],redoMutations:[...(b=I.preRedos)!=null?b:[],{id:ye.id,params:h},{id:ae.id,params:C},...I.redos]}),!0):!1}},wo={type:i.CommandType.COMMAND,id:"sheet.command.set-row-is-auto-height",handler:(o,e)=>{var I,p;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(g.SheetsSelectionsService),r=o.get(i.IUniverInstanceService),a=E(r,e);if(!a)return!1;const{unitId:l,subUnitId:u,worksheet:d}=a,c=(I=e==null?void 0:e.ranges)!=null&&I.length?e.ranges:(p=s.getCurrentSelections())==null?void 0:p.map(M=>M.range);if(!(c!=null&&c.length))return!1;const m={unitId:l,subUnitId:u,ranges:c,autoHeightInfo:i.BooleanNumber.TRUE},h=vo(m,d),R=t.syncExecuteCommand(ae.id,m),{undos:C,redos:S}=o.get(g.SheetInterceptorService).onCommandExecute({id:wo.id,params:m}),v=i.sequenceExecute([...S],t);return R&&v.result?(n.pushUndoRedo({unitID:l,undoMutations:[{id:ae.id,params:h},...C],redoMutations:[{id:ae.id,params:m},...S]}),!0):!1}},Rr={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-show",handler:(o,e)=>{const{unitId:t,subUnitId:n}=e,s=o.get(i.ICommandService),r=o.get(i.IUndoRedoService),a=o.get(i.IUniverInstanceService);if(!E(o.get(i.IUniverInstanceService)))return!1;const u=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!u)return!1;const d=u.getSheetBySheetId(n);if(!d||d.getConfig().hidden===i.BooleanNumber.FALSE)return!1;const m={unitId:t,subUnitId:n,hidden:i.BooleanNumber.FALSE},h=lr(o,m),R=s.syncExecuteCommand(Ee.id,m),C={unitId:t,subUnitId:n},S=s.syncExecuteCommand(it.id,C);return R&&S?(r.pushUndoRedo({unitID:t,undoMutations:[{id:Ee.id,params:h}],redoMutations:[{id:Ee.id,params:m}]}),!0):!1}};class Za{constructor(){f(this,"_tabCount",0);f(this,"_commaCount",0);f(this,"_semicolonCount",0);f(this,"_spaceCount",0)}add(e){switch(e){case" ":this._tabCount++;break;case",":this._commaCount++;break;case";":this._semicolonCount++;break;case" ":this._spaceCount++;break}}update(e){e&&typeof e=="string"&&(e.includes(" ")&&this._tabCount++,e.includes(",")&&this._commaCount++,e.includes(";")&&this._semicolonCount++,e.trim().includes(" ")&&this._spaceCount++)}getDelimiter(){const e=Math.max(this._tabCount,this._commaCount,this._semicolonCount,this._spaceCount);return e===0||e===this._tabCount?1:e===this._commaCount?2:e===this._semicolonCount?4:e===this._spaceCount?8:1}}function Qa(o,e,t){const n=[];t!==void 0&&(o&16)>0&&n.push(t),(o&1)>0&&n.push(" "),(o&2)>0&&n.push(","),(o&4)>0&&n.push(";"),(o&8)>0&&n.push(" ");let s="";for(const a of n)s+=el(a);let r="[".concat(s,"]");return e&&(r+="+"),new RegExp(r)}function el(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const tl=o=>{var t;return((t=o.body)==null?void 0:t.dataStream.replace(/\r\n$/,""))||""};function nl(o){if(o!=null){if(o.p)return tl(o.p);if(o.v&&typeof o.v=="string")return o.v;if(o.t&&(o.t===i.CellValueType.FORCE_STRING||o.t===i.CellValueType.STRING))return String(o.v)}}function Cr(o,e,t,n,s=!1){const r=i.Range.transformRange(e,o),{startColumn:a,startRow:l,endColumn:u,endRow:d}=r;if(a!==u)throw new Error("The range must be in the same column.");if(t&&(t&16)>0&&(n===void 0||n.length!==1))throw new Error("The custom delimiter must a character.");const c=t===void 0,m=c?new Za:null,h=[];for(let M=l;M<=d;M++){const w=o.getCell(M,a),y=nl(w);h.push(y),m&&m.update(y)}const R=c?m.getDelimiter():t,C=Qa(R,s,n);let S=-1,v=0,I=0;const p=[];for(const M of h){if(M!==void 0){const w=String(M).split(C);S<0?S=w.length:S=Math.max(S,w.length),p.push(w),v=I}else p.push(void 0);I++}return{rs:p,maxLength:S===-1?0:S,lastRow:v}}const Sr={type:i.CommandType.COMMAND,id:"sheet.command.split-text-to-columns",handler:async(o,e)=>{const{unitId:t,subUnitId:n,range:s,delimiter:r,customDelimiter:a,treatMultipleDelimitersAsOne:l}=e,u=o.get(i.ICommandService),d=o.get(i.IUniverInstanceService),c=o.get(i.IUndoRedoService);if(!E(o.get(i.IUniverInstanceService)))return!1;const h=d.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!h)return!1;const R=h.getSheetBySheetId(n);if(!R)return!1;const{lastRow:C,rs:S,maxLength:v}=Cr(R,s,r,a,l),I=R.getColumnCount(),{startColumn:p}=i.Range.transformRange(s,R);if(s.startColumn!==s.endColumn)return!1;const M=[],w=[],y=p+v+1-I;if(y>0){const O={unitId:t,subUnitId:n,range:{startRow:0,endRow:R.getRowCount()-1,startColumn:I-1,endColumn:I-1+y}};M.push({id:ue.id,params:O});const A=$t(o,O);w.push({id:re.id,params:A})}const b={startRow:s.startRow,endRow:C,startColumn:p,endColumn:p+v},N=new i.ObjectMatrix;for(let O=b.startRow;O<=b.endRow;O++)for(let A=b.startColumn;A<=b.endColumn;A++){const H=S[O-b.startRow];A===0&&(H==null?void 0:H.length)===1?N.setValue(O,A,R.getCell(O,A)):N.setValue(O,A,{v:(H==null?void 0:H[A-b.startColumn])||null,p:null,f:null,si:null,custom:null})}const U={unitId:t,subUnitId:n,cellValue:N.clone()},T=se(o,U);return M.push({id:B.id,params:U}),w.unshift({id:B.id,params:T}),i.sequenceExecute(M,u).result?(c.pushUndoRedo({unitID:t,undoMutations:w,redoMutations:M}),!0):!1}},fr={id:"sheet.command.toggle-cell-checkbox",type:i.CommandType.COMMAND,handler:(o,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,row:s,col:r,paragraphIndex:a}=e,u=o.get(i.IUniverInstanceService).getUnit(t,i.UniverInstanceType.UNIVER_SHEET),d=u==null?void 0:u.getSheetBySheetId(n),c=o.get(i.IUndoRedoService),m=o.get(i.ICommandService);if(!d)return!1;const h=d.getCell(s,r);if(!(h!=null&&h.p))return!1;const R=i.Tools.deepClone(h.p),C=new i.DocumentDataModel(R),S=i.BuildTextUtils.paragraph.bullet.toggleChecklist({document:C,paragraphIndex:a});if(!S)return!1;i.TextX.apply(C.getBody(),S.serialize());const v={unitId:t,subUnitId:n,cellValue:{[s]:{[r]:{p:R,t:i.CellValueType.STRING}}}},I={id:B.id,params:v},p=se(o,v),M={id:B.id,params:p},w=[I],y=[M];return c.pushUndoRedo({redoMutations:w,undoMutations:y,unitID:t}),m.syncExecuteCommand(I.id,I.params)}},ut={id:"sheet.mutation.toggle-gridlines",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=E(o.get(i.IUniverInstanceService),e);if(!t)return!1;const{worksheet:n}=t,s=n.getConfig();return s.showGridlines=e.showGridlines,!0}},vr={type:i.CommandType.COMMAND,id:"sheet.command.toggle-gridlines",handler:async(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=E(s);if(!r)return!1;const{worksheet:a}=r,l=a.getConfig().showGridlines;if(l===(e==null?void 0:e.showGridlines))return!1;const{unitId:u,subUnitId:d}=r,c={showGridlines:l===i.BooleanNumber.TRUE?i.BooleanNumber.FALSE:i.BooleanNumber.TRUE,unitId:u,subUnitId:d},m={showGridlines:l,unitId:u,subUnitId:d};return t.syncExecuteCommand(ut.id,c)?(n.pushUndoRedo({unitID:u,undoMutations:[{id:ut.id,params:m}],redoMutations:[{id:ut.id,params:c}]}),!0):!1}},Ir={id:"sheet.command.unregister-worksheet-range-theme-style",type:i.CommandType.COMMAND,handler:(o,e)=>{var h;if(!e)return!1;const{unitId:t,themeName:n}=e,s=o.get(i.IUniverInstanceService),r=o.get(i.ICommandService),a=o.get(i.IUndoRedoService),l=o.get(ge);if(!E(s))return!1;const d={unitId:t,themeName:n},c={unitId:t,themeName:n,rangeThemeStyleJson:(h=l.getRangeThemeStyle(t,n))==null?void 0:h.toJson()};return r.syncExecuteCommand(Xe.id,e)&&a.pushUndoRedo({unitID:t,undoMutations:[{id:Xe.id,params:c}],redoMutations:[{id:Ft.id,params:d}]}),!0}},pr={id:"sheet.mutation.empty",type:i.CommandType.MUTATION,handler:()=>!0},Mr=o=>{const e=new i.ObjectMatrix;return o.forEach(t=>{i.Range.foreach(t,(n,s)=>{e.setValue(n,s,1)})}),e.forValue((t,n)=>{const s=e.getValue(t-1,n);s&&e.setValue(t,n,s+1)}),e},wr=o=>{const e=o;return e.forValue((t,n)=>{const s=o.getValue(t-1,n);s&&e.setValue(t,n,s+1)}),e},yr=o=>{const e={area:0},t=(n,s)=>e.area<n?(e.area=n,e.range=s,!0):!1;return o.forValue((n,s,r)=>{let a=1,l=r;t(a*l,{startRow:n-l+1,endRow:n,startColumn:s,endColumn:s});const u={startRow:n-l+1,endRow:n,startColumn:0,endColumn:s};for(let d=s-1;d>=0&&o.getValue(n,d);d--){l=Math.min(o.getValue(n,d)||0,l),a++;const c=l*a;u.startColumn=d,u.startRow=n-l+1,t(c,u)}}),e},ol=(o,e)=>{i.Range.foreach(e,(t,n)=>{o.realDeleteValue(t,n)});for(let t=e.startColumn;t<=e.endColumn;t++){const n=e.endRow+1;if(o.getValue(n,t)>0){o.setValue(n,t,1);let r=n+1;for(;o.getValue(r,t)>0;)o.setValue(r,t,o.getValue(r-1,t)+1),r++}}return o},yo=o=>{const e=[];let t=yr(o);for(;t.area>0;)t.range&&(e.push(t.range),ol(o,t.range)),t=yr(o);return e},_o=o=>{const e=Mr(o);return yo(e)};class sl{constructor(){f(this,"_matrix",new i.ObjectMatrix)}add(...e){return e.forEach(t=>{i.Range.foreach(t,(n,s)=>{this._matrix.setValue(n,s,1)})}),this}subtract(...e){return e.forEach(t=>{i.Range.foreach(t,(n,s)=>{this._matrix.realDeleteValue(n,s)})}),this}merge(){const e=wr(this._matrix);return yo(e)}}const He=i.createIdentifier("INumfmtService"),rl=(o,e)=>{const t=o.get(He),{values:n,unitId:s,subUnitId:r}=e,a=[],l=[];Object.keys(n).forEach(d=>{n[d].ranges.forEach(m=>{i.Range.foreach(m,(h,R)=>{const C=t.getValue(s,r,h,R);C?a.push({pattern:C.pattern,row:h,col:R}):l.push({startColumn:R,endColumn:R,startRow:h,endRow:h})})})});const u=[];if(a.length){const d=Zt(s,r,a);Object.keys(d.values).forEach(c=>{const m=d.values[c];m.ranges=_o(m.ranges)}),u.push({id:Xt.id,params:Zt(s,r,a)})}return l.length&&u.push({id:bo.id,params:{unitId:s,subUnitId:r,ranges:l}}),u},Xt={id:"sheet.mutation.set.numfmt",type:i.CommandType.MUTATION,handler:(o,e)=>{if(!e)return!1;const{values:t,refMap:n}=e,s=o.get(He),r=e.unitId,a=e.subUnitId,l=Object.keys(t).reduce((u,d)=>{const c=n[d],m=t[d].ranges;return c&&u.push({...c,ranges:m}),u},[]);return s.setValues(r,a,l),!0}},bo={id:"sheet.mutation.remove.numfmt",type:i.CommandType.MUTATION,handler:(o,e)=>{if(!e)return!1;const{unitId:t,subUnitId:n,ranges:s}=e;return o.get(He).deleteValues(t,n,s),!0}},il=(o,e)=>{const t=o.get(He),{ranges:n,unitId:s,subUnitId:r}=e,a=[];if(n.forEach(u=>{i.Range.foreach(u,(d,c)=>{const m=t.getValue(s,r,d,c);m&&a.push({pattern:m.pattern,row:d,col:c})})}),!a.length)return[];const l=Zt(s,r,a);return Object.keys(l.values).forEach(u=>{const d=l.values[u];d.ranges=_o(d.ranges)}),[{id:Xt.id,params:l}]},Zt=(o,e,t)=>{const n=ki(t,"pattern"),s={},r={},a=Oi();return Object.keys(n).forEach(l=>{const u=n[l],d=a();s[d]={pattern:l},u.forEach(c=>{r[d]||(r[d]={ranges:[]}),r[d].ranges.push(i.cellToRange(c.row,c.col))})}),{unitId:o,subUnitId:e,refMap:s,values:r}},_r={id:"sheet.operation.scroll-to-cell",type:i.CommandType.OPERATION,handler:()=>!0},br="ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY",Tr="maxCellsPerSheet",al=3e6;var ll=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,dl=(o,e,t,n)=>{for(var s=n>1?void 0:n?ul(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ll(e,t,s),s},To=(o,e)=>(t,n)=>e(t,n,o);let Qt=class extends i.Disposable{constructor(o,e,t){var s;super(),this._commandService=o,this._configService=e,this._dataSyncPrimaryController=t,[B,ue,Ce,Ye,_e,Ie,pe,re,de,$e,G,bo,j,uo,Jt,Xt,pt,pr].forEach(r=>{var a;this._commandService.registerCommand(r),(a=this._dataSyncPrimaryController)==null||a.registerSyncingMutations(r)}),((s=this._configService.getConfig(br))!=null?s:!1)||[kt,cn,Ot,hn,Je,xe,go,po,ys,ws,Zn,Te,ft,Lt,ps,Is,Xn,be,_s,Ht,Ke,Bt,to,It,oo,vt,jt,Gt,ks,er,Zs,Qs,$s,Vs,Ze,As,Ws,ro,et,tt,Kt,Bs,Qe,js,Ue,Gs,nr,St,Mo,lo,rt,st,Ks,ot,Hs,Js,zt,Yt,X,rr,Mt,Xs,sr,or,tr,co,mo,it,ur,Ee,Ro,dr,wt,Io,ye,wo,ae,Me,q,_r,fs,Qn,io,Rr,vr,ut,qs,nt,mr,Oe,Be,De,fo,Bo,zs,Rs,Ho,Cs,hr,le,he,x,fr,at,ar,Sr,ze,qe,Ft,Xe,Ir,Ns,xo,Ss].forEach(r=>this.disposeWithMe(this._commandService.registerCommand(r))),this._configService.setConfig(Tr,al)}};Qt=dl([To(0,i.ICommandService),To(1,i.IConfigService),To(2,i.Optional(ii.DataSyncPrimaryController))],Qt);var cl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,hl=(o,e,t,n)=>{for(var s=n>1?void 0:n?ml(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&cl(e,t,s),s},Ur=(o,e)=>(t,n)=>e(t,n,o);let en=class extends i.Disposable{constructor(o,e){super(),this._univerInstanceService=o,this._commandService=e,this._initialize()}_initialize(){this.disposeWithMe(this._commandService.onCommandExecuted(o=>{if(o.id!==Y.SetFormulaCalculationResultMutation.id)return;const e=o.params,{unitData:t}=e,n=Object.keys(t),s=[];for(let a=0;a<n.length;a++){const l=n[a],u=t[l];if(u==null)continue;const d=Object.keys(u);for(let c=0;c<d.length;c++){const m=d[c],h=u[m];if(h==null)continue;const R=this._getMergedCellData(l,m,h),C={subUnitId:m,unitId:l,cellValue:R};s.push({id:B.id,params:C})}}return s.every(a=>this._commandService.executeCommand(a.id,a.params,{onlyLocal:!0}))}))}_getMergedCellData(o,e,t){const n=this._univerInstanceService.getUniverSheetInstance(o),s=n==null?void 0:n.getStyles(),r=n==null?void 0:n.getSheetBySheetId(e),a=r==null?void 0:r.getCellMatrix(),l=new i.ObjectMatrix(t);return l.forValue((u,d,c)=>{const m=a==null?void 0:a.getValue(u,d),h=Y.handleNumfmtInCell(m,c,s);l.setValue(u,d,h)}),l.getMatrix()}};en=hl([Ur(0,i.Inject(i.IUniverInstanceService)),Ur(1,i.ICommandService)],en);const gl="sheets.config",Er={};var Rl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Sl=(o,e,t,n)=>{for(var s=n>1?void 0:n?Cl(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Rl(e,t,s),s},Pr=(o,e)=>(t,n)=>e(t,n,o);const fl="SHEET_DEFINED_NAME_PLUGIN",vl="AllDefaultWorkbook";g.DefinedNameDataController=class extends i.Disposable{constructor(e,t){super(),this._definedNamesService=e,this._resourceManagerService=t,this._initialize()}_initialize(){this._initSnapshot()}_initSnapshot(){const e=n=>{const s=this._definedNamesService.getDefinedNameMap(n);return s?JSON.stringify(s):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:fl,businesses:[i.UniverInstanceType.UNIVER_SHEET],toJson:n=>e(n),parseJson:n=>t(n),onUnLoad:n=>{this._definedNamesService.removeUnitDefinedName(n)},onLoad:(n,s)=>{this._definedNamesService.registerDefinedNames(n,s)}}))}},g.DefinedNameDataController=Sl([Pr(0,Y.IDefinedNamesService),Pr(1,i.IResourceManagerService)],g.DefinedNameDataController);const k={MoveRangeCommandId:ls,InsertRowCommandId:vs,InsertColCommandId:Ms,RemoveColCommandId:no,RemoveRowCommandId:eo,DeleteRangeMoveLeftCommandId:hs,DeleteRangeMoveUpCommandId:gs,InsertRangeMoveDownCommandId:ua,InsertRangeMoveRightCommandId:xn,MoveColsCommandId:Es,MoveRowsCommandId:Us,ReorderRangeCommandId:Ds};var V=(o=>(o[o.Set=0]="Set",o[o.Delete=1]="Delete",o[o.HorizontalMove=2]="HorizontalMove",o[o.VerticalMove=3]="VerticalMove",o[o.Unknown=4]="Unknown",o))(V||{});const tn=Number.MAX_SAFE_INTEGER,fe=o=>{const e={...o},t=Number.isNaN(e.startRow)&&Number.isNaN(e.endRow)&&!Number.isNaN(e.startColumn)&&!Number.isNaN(e.endColumn),n=Number.isNaN(e.startColumn)&&Number.isNaN(e.endColumn)&&!Number.isNaN(e.startRow)&&!Number.isNaN(e.endRow);return(e.rangeType===i.RANGE_TYPE.COLUMN||t)&&(e.startRow=0,e.endRow=tn),(e.rangeType===i.RANGE_TYPE.ROW||n)&&(e.startColumn=0,e.endColumn=tn),e.rangeType===i.RANGE_TYPE.ALL&&(e.startColumn=0,e.endColumn=tn,e.startRow=0,e.endRow=tn),e},oe=o=>{let e=o.rangeType;return o.rangeType===i.RANGE_TYPE.COLUMN?e=i.RANGE_TYPE.ROW:o.rangeType===i.RANGE_TYPE.ROW&&(e=i.RANGE_TYPE.COLUMN),{startRow:o.startColumn,endRow:o.endColumn,startColumn:o.startRow,endColumn:o.endRow,rangeType:e}},_t=(o,e,t)=>{const n={...t},s={...e},r=(S,v)=>{const I=Math.max(S.start,v.start),p=Math.min(S.end,v.end);return p<I?null:{start:I,end:p}},a=S=>S.end-S.start+1,l=(S,v)=>({start:S.start-v.start,end:S.start-v.start+S.end-S.start}),u=(S,v)=>({start:v.start+S.start,end:v.start+S.start+S.end-S.start}),d=e.start>o.start;if(d){const S=Math.min(o.end,e.start)-o.start+1;s.start-=S,s.end-=S}const c=a(o),m=c,h=r(o,n),R=h&&a(h)>=a(n);if(o.end<n.start)n.start-=c,n.end-=c;else if(h){const S=a(h);if(R){const v=l(n,o),I=u(v,s);n.start=I.start,n.end=I.end}else h.start>o.start?d?(n.end-=S+c,n.start-=c):n.end-=S:d?n.end-=S:n.start>o.start&&n.end>o.end?(n.start-=c,n.end-=c+S):n.end-=S}const C=r(s,n);return R||(s.start<=n.start?(n.start+=m,n.end+=m):C&&(d?s.end<=n.start||s.start<=n.start&&s.end>=n.start?(n.start+=m,n.end+=m):s.start>=n.start&&s.start<=n.end&&(n.end+=m):n.start<s.start&&n.end>s.start?n.end+=m:(n.start>=s.end||n.start>=s.start&&n.start<=s.end)&&(n.end+=m,n.start+=m))),{step:n.start-t.start,length:a(n)-a(t)}},Uo=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!n||!t)return[];const s=fe(t),r=fe(n),a=fe(e),l=_t({start:s.startRow,end:s.endRow},{start:r.startRow,end:r.endRow},{start:a.startRow,end:a.endRow});return l===null?[{type:V.Delete}]:[{type:V.VerticalMove,step:l.step||0,length:l.length||0}]},Il=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!t||!n)return[e];const s=t.startRow,r=t.endRow-t.startRow+1,a=n.startRow,l=new i.ObjectMatrix;return i.Range.foreach(e,(d,c)=>{l.setValue(d,c,1)}),l.moveRows(s,r,a),i.queryObjectMatrix(l,d=>d===1)},pl=(o,e)=>{const{range:t,order:n}=o.params||{};if(!t||!n)return[e];const s=new i.ObjectMatrix;i.Range.foreach(e,(l,u)=>{s.setValue(l,u,1)});const r=new i.ObjectMatrix;return i.Range.foreach(t,(l,u)=>{var d;if(n.hasOwnProperty(l)){const c=n[l],m=(d=s.getValue(c,u))!=null?d:0;r.setValue(l,u,m)}}),r.forValue((l,u,d)=>{s.setValue(l,u,d)}),i.queryObjectMatrix(s,l=>l===1)},Eo=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!n||!t)return[];const s=fe(t),r=fe(n),a=fe(e),l=_t({start:s.startColumn,end:s.endColumn},{start:r.startColumn,end:r.endColumn},{start:a.startColumn,end:a.endColumn});return l===null?[{type:V.Delete}]:[{type:V.HorizontalMove,step:l.step||0,length:l.length||0}]},Ml=(o,e)=>{const{fromRange:t,toRange:n}=o.params||{};if(!t||!n)return[e];const s=t.startColumn,r=t.endColumn-t.startColumn+1,a=n.startColumn,l=new i.ObjectMatrix;return i.Range.foreach(e,(u,d)=>{l.setValue(u,d,1)}),l.moveColumns(s,r,a),i.queryObjectMatrix(l,u=>u===1)},Nr=(o,e)=>{var r,a;const t=(r=o.params)==null?void 0:r.toRange,n=(a=o.params)==null?void 0:a.fromRange;if(!t||!n)return[];const s=[];if(i.Rectangle.contains(t,e)&&s.push({type:V.Delete}),i.Rectangle.contains(n,e)){s.push({type:V.Delete});const l=i.Rectangle.getRelativeRange(e,n),u=i.Rectangle.getPositionRange(l,t);return[{type:V.Set,range:u}]}return s},wl=(o,e)=>{var m,h;const t=(m=o.params)==null?void 0:m.toRange,n=(h=o.params)==null?void 0:h.fromRange;if(!t||!n)return[e];if(!i.Rectangle.intersects(n,e)&&!i.Rectangle.intersects(t,e))return[e];if(i.Rectangle.contains(n,e)){const R=i.Rectangle.getRelativeRange(e,n);return[i.Rectangle.getPositionRange(R,t)]}const s=new i.ObjectMatrix;i.Range.foreach(e,(R,C)=>{s.setValue(R,C,1)});const r=new i.ObjectMatrix,a=i.Rectangle.getIntersects(n,e);a&&i.Range.foreach(a,(R,C)=>{s.getValue(R,C)&&(s.setValue(R,C,void 0),r.setValue(R,C,1))});const l=t.startColumn-n.startColumn,u=t.startRow-n.startRow,d={startColumn:t.startColumn-l,endColumn:t.endColumn-l,startRow:t.startRow-u,endRow:t.endRow-u};return i.Range.foreach(d,(R,C)=>{var I;const S=R+u,v=C+l;s.setValue(S,v,(I=r.getValue(R,C))!=null?I:0)}),i.queryObjectMatrix(s,R=>R===1)},Fe=(o,e)=>{const t=fe(o),n=fe(e),s=a=>a.endColumn-a.startColumn+1,r=a=>a.endRow-a.startRow+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn){const a=i.Rectangle.getIntersects(n,t);if(a)return{step:0,length:-s(a)}}if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn&&r(t)>=r(n))return null;if(n.startColumn>=t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn){const a=i.Rectangle.getIntersects(n,t);if(a){const l=-s(a);return{step:-(s(t)-s(a)),length:l}}}if(n.startColumn>t.endColumn)return{step:-s(t),length:0}}return{step:0,length:0}},Po=(o,e)=>{var r;const t=(r=o.params)==null?void 0:r.range;if(!t)return[];const n=[],s=Fe(t,e);if(!s)n.push({type:V.Delete});else{const{step:a,length:l}=s;n.push({type:V.HorizontalMove,step:a,length:l})}return n},kr=(o,e)=>{var r;const t=(r=o.params)==null?void 0:r.range;if(!t)return[];const n=[],s=Fe(oe(t),oe(e));if(!s)n.push({type:V.Delete});else{const{step:a,length:l}=s;n.push({type:V.VerticalMove,step:a,length:l})}return n},yl=(o,e)=>{const{range:t,order:n}=o.params||{};if(!t||!n)return[];if(i.Rectangle.contains(t,e)&&e.endRow===e.startRow){const s=[],r=e.startRow;for(const a in n)if(n[a]===r){const l=Number(a);return s.push({type:V.VerticalMove,step:l-r,length:0}),s}return[]}return[]},je=(o,e)=>{const t=fe(o),n=fe(e),s=r=>r.endColumn-r.startColumn+1;if(t.startRow<=n.startRow&&t.endRow>=n.endRow){if(n.startColumn<t.startColumn&&n.endColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn<t.startColumn&&n.endColumn>=t.endColumn)return{step:0,length:s(t)};if(n.startColumn>=t.startColumn&&n.endColumn<=t.endColumn||n.startColumn>t.startColumn&&n.startColumn<=t.endColumn&&n.endColumn>t.endColumn||n.startColumn>=t.endColumn)return{step:s(t),length:0}}return{step:0,length:0}};function _l(o,e,t){const n=[];if(i.Rectangle.contains(e,t)&&n.push({type:V.Delete}),i.Rectangle.contains(o,t)){n.push({type:V.Delete});const s=i.Rectangle.getRelativeRange(t,o),r=i.Rectangle.getPositionRange(s,e);return[{type:V.Set,range:r}]}return n}const Or=(o,e)=>{var l;const t=(l=o.params)==null?void 0:l.range;if(!t)return[];const n=[],s=je(oe(t),oe(e)),{step:r,length:a}=s;return n.push({type:V.VerticalMove,step:r,length:a}),n},Dr=(o,e)=>{var l;const t=(l=o.params)==null?void 0:l.range;if(!t)return[];const n=[],s=je(t,e),{step:r,length:a}=s;return n.push({type:V.HorizontalMove,step:r,length:a}),n},Ar=(o,e)=>{var l;const t=(l=o.params)==null?void 0:l.range;if(!t)return[];const n=[],s=je(oe(t),oe(e)),{step:r,length:a}=s;return n.push({type:V.VerticalMove,step:r,length:a}),n},bl=(o,e)=>{var u;const t=(u=o.params)==null?void 0:u.range;if(!t)return[e];const n=t.endRow-t.startRow+1,s={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},r=i.Rectangle.subtract(e,s),a=i.Rectangle.getIntersects(s,e);if(!a)return[e];const l=new i.ObjectMatrix;return r.forEach(d=>{i.Range.foreach(d,(c,m)=>{l.setValue(c,m,1)})}),a&&i.Range.foreach(a,(d,c)=>{l.setValue(d+n,c,1)}),i.queryObjectMatrix(l,d=>d===1)},Wr=(o,e)=>{var l;const t=(l=o.params)==null?void 0:l.range;if(!t)return[];const n=[],s=je(t,e),{step:r,length:a}=s;return n.push({type:V.HorizontalMove,step:r,length:a}),n},Tl=(o,e)=>{var u;const t=(u=o.params)==null?void 0:u.range;if(!t)return[e];const n=t.endColumn-t.startColumn+1,s={...t,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},r=i.Rectangle.subtract(e,s),a=i.Rectangle.getIntersects(s,e);if(!a)return[e];const l=new i.ObjectMatrix;return r.forEach(d=>{i.Range.foreach(d,(c,m)=>{l.setValue(c,m,1)})}),a&&i.Range.foreach(a,(d,c)=>{l.setValue(d,c+n,1)}),i.queryObjectMatrix(l,d=>d===1)},Vr=(o,e)=>{var r;const t=(r=o.params)==null?void 0:r.range;if(!t)return[];const n=[],s=Fe(t,e);if(!s)n.push({type:V.Delete});else{const{step:a,length:l}=s;n.push({type:V.HorizontalMove,step:a,length:l})}return n},Ul=(o,e)=>{var d;const t=(d=o.params)==null?void 0:d.range;if(!t)return[e];const n={startRow:t.startRow,endRow:t.endRow,startColumn:t.startColumn,endColumn:Number.POSITIVE_INFINITY},s=t.endColumn-t.startColumn+1,r=i.Rectangle.getIntersects(t,e),a=i.Rectangle.subtract(e,n),l=i.Rectangle.getIntersects(n,e);if(!r&&!l)return[e];const u=new i.ObjectMatrix;return l&&i.Range.foreach(l,(c,m)=>{u.setValue(c,m-s,1)}),r&&i.Range.foreach(r,(c,m)=>{u.setValue(c,m-s,0)}),a.forEach(c=>{i.Range.foreach(c,(m,h)=>{u.setValue(m,h,1)})}),i.queryObjectMatrix(u,c=>c===1)},$r=(o,e)=>{var r;const t=(r=o.params)==null?void 0:r.range;if(!t)return[];const n=[],s=Fe(oe(t),oe(e));if(!s)n.push({type:V.Delete});else{const{step:a,length:l}=s;n.push({type:V.VerticalMove,step:a,length:l})}return n},El=(o,e)=>{var d;const t=(d=o.params)==null?void 0:d.range;if(!t)return[e];const n={...t,startRow:t.startRow,endRow:Number.POSITIVE_INFINITY},s=t.endRow-t.startRow+1,r=i.Rectangle.getIntersects(t,e),a=i.Rectangle.subtract(e,n),l=i.Rectangle.getIntersects(n,e);if(!r&&!l)return[e];const u=new i.ObjectMatrix;return l&&i.Range.foreach(l,(c,m)=>{u.setValue(c-s,m,1)}),r&&i.Range.foreach(r,(c,m)=>{u.setValue(c-s,m,0)}),a.forEach(c=>{i.Range.foreach(c,(m,h)=>{u.setValue(m,h,1)})}),i.queryObjectMatrix(u,c=>c===1)},Pl=(o,e)=>{var s;const t=(s=o.ranges)!=null?s:[o.range],n=new i.ObjectMatrix;return i.Range.foreach(e,(r,a)=>{n.setValue(r,a,1)}),t.forEach(r=>{const a=r.startRow,u=r.endRow-a+1;n.removeRows(a,u)}),i.queryObjectMatrix(n,r=>r===1)},Nl=(o,e)=>{const t=o.params,n=t.range.startRow,s=t.range.endRow-t.range.startRow+1,r=t.direction;return r===i.Direction.UP&&n===e.startRow||r===i.Direction.DOWN&&n-1===e.endRow?[{startRow:e.startRow,endRow:e.endRow+s,startColumn:e.startColumn,endColumn:e.endColumn}]:e.startRow>=n?[{startRow:e.startRow+s,endRow:e.endRow+s,startColumn:e.startColumn,endColumn:e.endColumn}]:e.endRow<=n?[e]:[{startRow:e.startRow,endRow:e.endRow+s,startColumn:e.startColumn,endColumn:e.endColumn}]},kl=(o,e)=>{const t=o.params,n=t.range.startColumn,s=t.range.endColumn-t.range.startColumn+1,r=t.direction;return r===i.Direction.LEFT&&n===e.startColumn||r===i.Direction.RIGHT&&n-1===e.endColumn?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+s}]:e.startColumn>=n?[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn+s,endColumn:e.endColumn+s}]:e.endColumn<=n?[e]:[{startRow:e.startRow,endRow:e.endRow,startColumn:e.startColumn,endColumn:e.endColumn+s}]},Ge=(o,e)=>{let t={...e};return o.forEach(n=>{switch(n.type){case V.Delete:{t=null;break}case V.HorizontalMove:{if(!t)return;t.startColumn+=n.step,t.endColumn+=n.step+(n.length||0);break}case V.VerticalMove:{if(!t)return;t.startRow+=n.step,t.endRow+=n.step+(n.length||0);break}case V.Set:{t=n.range;break}}}),t&&(t.endColumn<t.startColumn||t.endRow<t.startRow)?null:t},No=(o,e)=>{let t=[];switch(e.id){case k.DeleteRangeMoveLeftCommandId:{t=Vr(e,o);break}case k.DeleteRangeMoveUpCommandId:{t=$r(e,o);break}case k.InsertColCommandId:{t=Dr(e,o);break}case k.InsertRangeMoveDownCommandId:{t=Ar(e,o);break}case k.InsertRangeMoveRightCommandId:{t=Wr(e,o);break}case k.InsertRowCommandId:{t=Or(e,o);break}case k.MoveColsCommandId:{t=Eo(e,o);break}case k.MoveRangeCommandId:{t=Nr(e,o);break}case k.MoveRowsCommandId:{t=Uo(e,o);break}case k.RemoveColCommandId:{t=Po(e,o);break}case k.RemoveRowCommandId:{t=kr(e,o);break}case k.ReorderRangeCommandId:{t=yl(e,o);break}}return Ge(t,o)},Ol=(o,e,t)=>[Je.id,xe.id].includes(e.id)||Br(e,t).some(r=>i.Rectangle.intersects(r,o))?No(o,e):o,ko=(o,e)=>{let t=[];switch(e.id){case k.DeleteRangeMoveLeftCommandId:return Ul(e,o);case k.DeleteRangeMoveUpCommandId:return El(e,o);case k.InsertRangeMoveDownCommandId:return bl(e,o);case k.InsertRangeMoveRightCommandId:return Tl(e,o);case k.InsertColCommandId:return kl(e,o);case k.InsertRowCommandId:return Nl(e,o);case k.MoveColsCommandId:return Ml(e,o);case k.MoveRangeCommandId:return wl(e,o);case k.MoveRowsCommandId:return Il(e,o);case k.ReorderRangeCommandId:return pl(e,o);case k.RemoveColCommandId:{t=Po(e,o);break}case k.RemoveRowCommandId:return Pl(e.params,o)}const n=Ge(t,o);return n?[n]:[]},Dl=(o,e,t)=>[Je.id,xe.id,ft.id,xn].includes(e.id)||Br(e,t).some(r=>i.Rectangle.intersects(r,o))?ko(o,e):o;function Lr(o,e){const{id:t,params:n}=e;let s={length:0,step:0,type:V.Unknown};switch(t){case $e.id:s.type=V.Delete;break;case Ie.id:s=_t({start:n.sourceRange.startRow,end:n.sourceRange.endRow},{start:n.targetRange.startRow,end:n.targetRange.endRow},{start:o.startRow,end:o.endRow}),s.type=V.VerticalMove;break;case pe.id:s=_t({start:n.sourceRange.startColumn,end:n.sourceRange.endColumn},{start:n.targetRange.startColumn,end:n.targetRange.endColumn},{start:o.startColumn,end:o.endColumn}),s.type=V.HorizontalMove;break;case re.id:s=Fe(n.range,o),s?s.type=V.HorizontalMove:s={step:0,length:0,type:V.Delete};break;case de.id:s=Fe(oe(n.range),oe(o)),s?s.type=V.VerticalMove:s={step:0,length:0,type:V.Delete};break;case Ce.id:s=je(oe(n.range),oe(o)),s.type=V.VerticalMove;break;case ue.id:s=je(n.range,o),s.type=V.HorizontalMove;break;case _e.id:{const r=n.fromRange||new i.ObjectMatrix(n.from).getRange(),a=n.toRange||new i.ObjectMatrix(n.to).getRange();s=_l(r,a,o)}break}return s?Array.isArray(s)?Ge(s,o):Ge([s],o):o}function Br(o,e){var n,s,r,a,l,u;const{selectionManagerService:t}=e;switch(o.id){case k.MoveColsCommandId:{const d=o.params;return[d.fromRange,{...d.toRange,startColumn:d.toRange.startColumn-.5,endColumn:d.toRange.endColumn-.5}]}case k.MoveRowsCommandId:{const d=o.params;return[d.fromRange,{...d.toRange,startRow:d.toRange.startRow-.5,endRow:d.toRange.startRow-.5}]}case k.MoveRangeCommandId:{const d=o;return[d.params.fromRange,d.params.toRange]}case k.InsertRowCommandId:{const c=o.params.range;return[{...c,startRow:c.startRow-.5,endRow:c.endRow-.5}]}case k.InsertColCommandId:{const c=o.params.range;return[{...c,startColumn:c.startColumn-.5,endColumn:c.endColumn-.5}]}case k.RemoveRowCommandId:return[o.params.range];case k.RemoveColCommandId:return[o.params.range];case k.DeleteRangeMoveUpCommandId:case k.InsertRangeMoveDownCommandId:{const c=((n=o.params)==null?void 0:n.range)||((r=(s=t.getCurrentSelections())==null?void 0:s.map(m=>m.range))==null?void 0:r[0]);return c?[c]:[]}case k.DeleteRangeMoveLeftCommandId:case k.InsertRangeMoveRightCommandId:{const c=((a=o.params)==null?void 0:a.range)||((u=(l=t.getCurrentSelections())==null?void 0:l.map(m=>m.range))==null?void 0:u[0]);return c?[c]:[]}case k.ReorderRangeCommandId:{const d=o,{range:c,order:m}=d.params,h=[];for(let R=c.startRow;R<=c.endRow;R++)R in m&&h.push({startRow:R,endRow:R,startColumn:c.startColumn,endColumn:c.endColumn});return h}}}function Al(o){switch(o.id){case pe.id:{const e=o.params;return[e.sourceRange,{...e.targetRange,startColumn:e.targetRange.startColumn-.5,endColumn:e.targetRange.startColumn-.5}]}case Ie.id:{const e=o.params;return[e.sourceRange,{...e.targetRange,startRow:e.targetRange.startRow-.5,endRow:e.targetRange.startRow-.5}]}case _e.id:{const e=o.params;return[new i.ObjectMatrix(e.from.value).getRange(),new i.ObjectMatrix(e.to.value).getRange()]}case ue.id:{const t=o.params.range;return[{...t,startColumn:t.startColumn-.5,endColumn:t.startColumn-.5}]}case Ce.id:{const t=o.params.range;return[{...t,startRow:t.startRow-.5,endRow:t.startRow-.5}]}case re.id:return[o.params.range];case de.id:return[o.params.range]}}function Wl(o,e){var s,r,a,l,u,d;const t=o.get(i.IUniverInstanceService),n=o.get(g.SheetsSelectionsService);switch(e.id){case k.MoveColsCommandId:{const c=e.params,m=E(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startColumn:c.fromRange.startColumn<c.toRange.startColumn?c.fromRange.endColumn+1:c.toRange.startColumn,endColumn:c.fromRange.startColumn<c.toRange.startColumn?c.toRange.endColumn-1:c.fromRange.startColumn-1}]}}case k.MoveRowsCommandId:{const c=e.params,m=E(t,{unitId:c.unitId,subUnitId:c.subUnitId});return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,{...c.toRange,startRow:c.fromRange.startRow<c.toRange.startRow?c.fromRange.endRow+1:c.toRange.startRow,endRow:c.fromRange.startRow<c.toRange.startRow?c.toRange.endRow-1:c.fromRange.startRow-1}]}}case k.MoveRangeCommandId:{const c=e.params,m=E(t);return{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[c.fromRange,c.toRange]}}case k.InsertRowCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startRow>0?[{...m,startRow:m.startRow-1,endRow:m.endRow-1}]:[],{...m,startRow:m.startRow,endRow:Number.MAX_SAFE_INTEGER}]}}case k.InsertColCommandId:{const c=e.params,m=c.range;return{unitId:c.unitId,subUnitId:c.subUnitId,ranges:[...m.startColumn>0?[{...m,startColumn:m.startColumn-1,endColumn:m.endColumn-1}]:[],{...m,startColumn:m.startColumn,endColumn:Number.MAX_SAFE_INTEGER}]}}case k.RemoveRowCommandId:{const m=e.params.range,h=E(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startRow:m.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}}case k.RemoveColCommandId:{const m=e.params.range,h=E(t);return{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}}case k.DeleteRangeMoveUpCommandId:case k.InsertRangeMoveDownCommandId:{const c=e,m=E(t),h=((s=c.params)==null?void 0:s.range)||((a=(r=n.getCurrentSelections())==null?void 0:r.map(R=>R.range))==null?void 0:a[0]);return h?{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[h,{...h,startRow:h.endRow+1,endRow:Number.MAX_SAFE_INTEGER}]}:{unitId:m.unitId,subUnitId:m.subUnitId,ranges:[]}}case k.DeleteRangeMoveLeftCommandId:case k.InsertRangeMoveRightCommandId:{const m=((l=e.params)==null?void 0:l.range)||((d=(u=n.getCurrentSelections())==null?void 0:u.map(R=>R.range))==null?void 0:d[0]),h=E(t);return m?{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[m,{...m,startColumn:m.endColumn+1,endColumn:Number.MAX_SAFE_INTEGER}]}:{unitId:h.unitId,subUnitId:h.subUnitId,ranges:[]}}case k.ReorderRangeCommandId:{const c=e,{range:m,order:h}=c.params,R=[];for(let S=m.startRow;S<=m.endRow;S++)S in h&&R.push({startRow:S,endRow:S,startColumn:m.startColumn,endColumn:m.endColumn});const C=E(t);return{unitId:C.unitId,subUnitId:C.subUnitId,ranges:R}}}}var Vl=Object.defineProperty,$l=Object.getOwnPropertyDescriptor,Ll=(o,e,t,n)=>{for(var s=n>1?void 0:n?$l(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Vl(e,t,s),s},nn=(o,e)=>(t,n)=>e(t,n,o);const Bl=i.createInterceptorKey("MERGE_REDO"),Hl=i.createInterceptorKey("MERGE_UNDO"),Hr=Math.floor(Number.MAX_SAFE_INTEGER/10);class Fl extends i.Disposable{constructor(e,t,n,s,r=!1){super(),this._unitId=e,this._subUnitId=t,this._range=n,this._callback=s,this._skipIntersects=r}onMutation(e){var s,r;if(((s=e.params)==null?void 0:s.unitId)!==this._unitId)return;if(e.id===_e.id){const a=e.params;if(a.from.subUnitId!==this._subUnitId||a.to.subUnitId!==this._subUnitId)return}else if(((r=e.params)==null?void 0:r.subUnitId)!==this._subUnitId)return;if(!this._range)return;if(this._skipIntersects){if(e.id===$e.id)return;const a=Al(e);if(a!=null&&a.some(l=>i.Rectangle.intersects(l,this._range)))return}const t=Lr(this._range,e);if(t&&i.Rectangle.equals(t,this._range))return!1;const n=this._range;this._range=t,this._callback(n,t)}}g.RefRangeService=class extends i.Disposable{constructor(t,n,s,r){super();f(this,"interceptor",new i.InterceptorManager({MERGE_REDO:Bl,MERGE_UNDO:Hl}));f(this,"_watchRanges",new Set);f(this,"_refRangeManagerMap",new Map);f(this,"_serializer",jl());f(this,"_onRefRangeChange",()=>{this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet(),s=Fr(this._univerInstanceService),r=jr(this._univerInstanceService);if(!n||!s||!r)return{redos:[],undos:[],preRedos:[],preUndos:[]};const u=((()=>{switch(t.id){case k.MoveColsCommandId:{const R=t.params,C=Math.min(R.fromRange.startColumn,R.toRange.startColumn);return this._checkRange([{...R.fromRange,startColumn:C,endColumn:n.getColumnCount()-1}],s,r)}case k.MoveRowsCommandId:{const R=t.params,C=Math.min(R.fromRange.startRow,R.toRange.startRow);return this._checkRange([{...R.fromRange,startRow:C,endRow:n.getRowCount()-1}],s,r)}case k.MoveRangeCommandId:{const R=t;return this._checkRange([R.params.fromRange,R.params.toRange],s,r)}case k.InsertRowCommandId:{const S={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.ROW};return this._checkRange([S],s,r)}case k.InsertColCommandId:{const C=t.params.range.startColumn,S={startRow:0,endRow:n.getRowCount()-1,startColumn:C,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.COLUMN};return this._checkRange([S],s,r)}case k.RemoveRowCommandId:{const S={startRow:t.params.range.startRow,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.ROW};return this._checkRange([S],s,r)}case k.RemoveColCommandId:{const C=t.params.range.startColumn,S={startRow:0,endRow:n.getRowCount()-1,startColumn:C,endColumn:n.getColumnCount()-1,rangeType:i.RANGE_TYPE.COLUMN};return this._checkRange([S],s,r)}case k.DeleteRangeMoveUpCommandId:case k.InsertRangeMoveDownCommandId:{const C=t.params.range||Gr(this._selectionManagerService)[0],S={startRow:C.startRow,startColumn:C.startColumn,endColumn:C.endColumn,endRow:Hr};return this._checkRange([S],s,r)}case k.DeleteRangeMoveLeftCommandId:case k.InsertRangeMoveRightCommandId:{const C=t.params.range||Gr(this._selectionManagerService)[0],S={startRow:C.startRow,startColumn:C.startColumn,endColumn:Hr,endRow:C.endRow};return this._checkRange([S],s,r)}case k.ReorderRangeCommandId:{const R=t,{range:C,order:S}=R.params,v=[];for(let I=C.startRow;I<=C.endRow;I++)I in S&&v.push({startRow:I,endRow:I,startColumn:C.startColumn,endColumn:C.endColumn});return this._checkRange(v,s,r)}}})()||[]).reduce((R,C)=>{const S=C(t);return R.push(S),R},[]).reduce((R,C)=>{var S,v;return R.redos.push(...C.redos),R.undos.push(...C.undos),R.preRedos.push(...(S=C.preRedos)!=null?S:[]),R.preUndos.push(...(v=C.preUndos)!=null?v:[]),R},{redos:[],undos:[],preUndos:[],preRedos:[]}),d=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(u.preRedos,null)||[],c=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(u.redos,null)||[],m=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(u.preUndos,null)||[],h=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(u.undos,null)||[];return{redos:c,undos:h,preRedos:d,preUndos:m}}})});f(this,"_checkRange",(t,n,s)=>{const r=qr(n,s),a=this._refRangeManagerMap.get(r);if(a){const l=new Set;return[...a.keys()].forEach(d=>{const c=a.get(d),m=this._serializer.deserialize(d),h={...m,startRow:+m.startRow,endRow:+m.endRow,startColumn:+m.startColumn,endColumn:+m.endColumn,rangeType:m.rangeType&&+m.rangeType};t.some(R=>i.Rectangle.intersects(R,h))&&c&&c.forEach(R=>{l.add(R)})}),[...l]}return[]});f(this,"registerRefRange",(t,n,s,r)=>{const a=s||Fr(this._univerInstanceService),l=r||jr(this._univerInstanceService);if(!a||!l)return i.toDisposable(()=>{});const u=qr(a,l),d=this._serializer.serialize(t);let c=this._refRangeManagerMap.get(u);c||(c=new Map,this._refRangeManagerMap.set(u,c));const m=c.get(d);return m?m.add(n):c.set(d,new Set([n])),i.toDisposable(()=>{const h=c.get(d);h&&(h.delete(n),h.size||(c.delete(d),c.size||this._refRangeManagerMap.delete(u)))})});this._commandService=t,this._sheetInterceptorService=n,this._univerInstanceService=s,this._selectionManagerService=r,this._onRefRangeChange(),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_REDO,{priority:-1,handler:a=>a}),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_UNDO,{priority:-1,handler:a=>a})}watchRange(t,n,s,r,a){let l;this._watchRanges.size===0&&(l=this._commandService.onCommandExecuted(m=>{if(m.type!==i.CommandType.MUTATION)return!1;for(const h of this._watchRanges)h.onMutation(m)}));const u=new Fl(t,n,s,r,a);this._watchRanges.add(u);const d=i.toDisposable(()=>{this._watchRanges.delete(u),this._watchRanges.size===0&&(l==null||l.dispose(),l=null)}),c=this.disposeWithMe(d);return i.toDisposable(()=>{c.dispose(),d.dispose()})}},g.RefRangeService=Ll([nn(0,i.ICommandService),nn(1,i.Inject(g.SheetInterceptorService)),nn(2,i.Inject(i.IUniverInstanceService)),nn(3,i.Inject(g.SheetsSelectionsService))],g.RefRangeService);function Fr(o){return o.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId()}function jr(o){var e;return(e=o.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()}function Gr(o){var e;return((e=o.getCurrentSelections())==null?void 0:e.map(t=>t.range))||[]}function qr(o,e){return`${o}_${e}`}function jl(){const o=["startRow","startColumn","endRow","endColumn","rangeType"],e="_";return{deserialize:t=>{const n=o.reduce((r,a,l)=>(r[String(l)]=a,r),{});return t.split(e).reduce((r,a,l)=>{const u=String(l);return a&&n[u]&&(r[n[u]]=a),r},{})},serialize:t=>o.reduce((n,s,r)=>{const a=t[s];return a!==void 0?`${n}${r>0?e:""}${a}`:`${n}`},"")}}var Gl=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,zl=(o,e,t,n)=>{for(var s=n>1?void 0:n?ql(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Gl(e,t,s),s},dt=(o,e)=>(t,n)=>e(t,n,o);const Yl=[ue.id,Ce.id,re.id,de.id],Kl=[Ie.id,pe.id];function Oo(o,e){let t=o;if(e!==void 0){const n=[];for(let s=0;s<t.length;s++){const{startRow:r,endRow:a,startColumn:l,endColumn:u}=t[s];if(e===i.Dimension.ROWS)for(let d=r;d<=a;d++){const c={startRow:d,endRow:d,startColumn:l,endColumn:u};n.push(c)}else if(e===i.Dimension.COLUMNS)for(let d=l;d<=u;d++){const c={startRow:r,endRow:a,startColumn:d,endColumn:d};n.push(c)}}t=n}return t}const zr=i.createInterceptorKey("mergeCellPermissionCheck");g.MergeCellController=class extends i.Disposable{constructor(t,n,s,r,a,l){super();f(this,"disposableCollection",new i.DisposableCollection);f(this,"interceptor",new i.InterceptorManager({MERGE_CELL_INTERCEPTOR_CHECK:zr}));this._commandService=t,this._refRangeService=n,this._univerInstanceService=s,this._injector=r,this._sheetInterceptorService=a,this._selectionManagerService=l,this._onRefRangeChange(),this._initCommandInterceptor(),this._commandExecutedListener()}_initCommandInterceptor(){const t=this;this._sheetInterceptorService.interceptCommand({getMutations(n){var s;switch(n.id){case kt.id:case Ot.id:{const r=t._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),a=r.getUnitId(),l=r==null?void 0:r.getActiveSheet();if(!l)return{redos:[],undos:[]};const u=l.getSheetId(),d=l.getConfig().mergeData,c=(s=t._selectionManagerService.getCurrentSelections())==null?void 0:s.map(m=>m.range);if(c&&c.length>0&&c.some(h=>d.some(R=>i.Rectangle.intersects(R,h)))){const h={unitId:a,subUnitId:u,ranges:c},R=ne(t._injector,h),C=[{id:G.id,params:h}],S=[{id:j.id,params:R}];return{redos:C,undos:S}}}}return{redos:[],undos:[]}}}),this._sheetInterceptorService.interceptRanges({getMutations:({unitId:n,subUnitId:s,ranges:r})=>{const a=[],l=[],u={redos:a,undos:l};if(!r||!r.length)return u;const d=E(this._univerInstanceService,{unitId:n,subUnitId:s});if(!d)return u;const{worksheet:c}=d,h=c.getMergeData().filter(R=>r.some(C=>i.Rectangle.intersects(R,C)));return h.length?(a.push({id:G.id,params:{unitId:n,subUnitId:s,ranges:h}}),l.push({id:j.id,params:{unitId:n,subUnitId:s,ranges:h}}),{undos:l,redos:a}):u}})}refRangeHandle(t,n,s){switch(t.id){case k.MoveColsCommandId:{const r=t.params;return this._handleMoveColsCommand(r,n,s)}case k.MoveRowsCommandId:{const r=t.params;return this._handleMoveRowsCommand(r,n,s)}case be.id:{const r=t.params,a=r.unitId||n,l=r.subUnitId||s;return this._handleInsertRowCommand(r,a,l)}case Te.id:{const r=t.params,a=r.unitId||n,l=r.subUnitId||s;return this._handleInsertColCommand(r,a,l)}case It.id:{const r=t.params;return this._handleRemoveColCommand(r,n,s)}case vt.id:{const r=t.params;return this._handleRemoveRowCommand(r,n,s)}case Ke.id:{const r=t.params;return this._handleMoveRangeCommand(r,n,s)}case Lt.id:{const r=t.params;return this._handleInsertRangeMoveRightCommand(r,n,s)}case ft.id:{const r=t.params;return this._handleInsertRangeMoveDownCommand(r,n,s)}case xe.id:{const r=t.params;return this._handleDeleteRangeMoveUpCommand(r,n,s)}case Je.id:{const r=t.params;return this._handleDeleteRangeMoveLeftCommand(r,n,s)}}return{redos:[],undos:[]}}_onRefRangeChange(){const t=(n,s)=>{const r=this._univerInstanceService.getUniverSheetInstance(n);if(!r)return;const a=r==null?void 0:r.getSheetBySheetId(s);if(!a)return;this.disposableCollection.dispose();const l=a.getMergeData(),u=d=>this.refRangeHandle(d,n,s);l.forEach(d=>{this.disposableCollection.add(this._refRangeService.registerRefRange(d,u,n,s))})};this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===it.id){const s=n.params,r=s.subUnitId,a=s.unitId;if(!r||!a)return;t(a,r)}if(n.id===j.id){const s=n.params,r=s.subUnitId,a=s.unitId;if(!r||!a)return;t(s.unitId,s.subUnitId)}})),this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).pipe(W.first(n=>!!n)).subscribe(n=>{const s=n.getActiveSheet();s&&t(n.getUnitId(),s.getSheetId())})}_handleMoveRowsCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=[...a.getMergeData()],u={unitId:n,subUnitId:s,ranges:[]},d={unitId:n,subUnitId:s,ranges:[]},{fromRange:c}=t,{startRow:m,endRow:h}=c;if(l.forEach(S=>{if(m<=S.startRow&&h>=S.endRow){u.ranges.push(S);const v=Uo({id:k.MoveRowsCommandId,params:t},S),I=Ge(v,S);I&&d.ranges.push(I)}}),u.ranges.length===0)return this._handleNull();const R=ne(this._injector,u),C=ie(this._injector,d);return{preRedos:[{id:G.id,params:u}],redos:[{id:j.id,params:d}],preUndos:[{id:G.id,params:C}],undos:[{id:j.id,params:R}]}}_handleMoveColsCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=[...a.getMergeData()],u={unitId:n,subUnitId:s,ranges:[]},d={unitId:n,subUnitId:s,ranges:[]},{fromRange:c}=t,{startColumn:m,endColumn:h}=c;if(l.forEach(S=>{if(m<=S.startColumn&&h>=S.endColumn){u.ranges.push(S);const v=Eo({id:k.MoveColsCommandId,params:t},S),I=Ge(v,S);I&&d.ranges.push(I)}}),u.ranges.length===0)return this._handleNull();const R=ne(this._injector,u),C=ie(this._injector,d);return{preRedos:[{id:G.id,params:u}],redos:[{id:j.id,params:d}],preUndos:[{id:G.id,params:C}],undos:[{id:j.id,params:R}]}}_handleMoveRangeCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=a.getMergeData(),u=l.filter(C=>i.Rectangle.intersects(C,t.fromRange)),d=l.filter(C=>i.Rectangle.intersects(C,t.toRange)),c=u.map(C=>i.Rectangle.getRelativeRange(C,t.fromRange)).map(C=>i.Rectangle.getPositionRange(C,t.toRange)),m=Oo(c).filter(C=>!l.some(S=>i.Rectangle.equals(C,S))),h=[{id:G.id,params:{unitId:n,subUnitId:s,ranges:u}},{id:G.id,params:{unitId:n,subUnitId:s,ranges:d}},{id:j.id,params:{unitId:n,subUnitId:s,ranges:m}}],R=[{id:G.id,params:{unitId:n,subUnitId:s,ranges:m}},{id:j.id,params:{unitId:n,subUnitId:s,ranges:d}},{id:j.id,params:{unitId:n,subUnitId:s,ranges:u}}];return{redos:h,undos:R}}_handleInsertRowCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const{range:l}=t,{startRow:u,endRow:d}=l,c=i.Tools.deepClone(a.getMergeData()).reduce((p,M)=>(u>M.startRow&&u<=M.endRow&&p.push(M),p),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(a.getMergeData()).reduce((p,M)=>{if(u>M.startRow&&u<=M.endRow){const w=d-u+1;M.endRow+=w,this._checkIsMergeCell(M)&&p.push(M)}return p},[]),h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C),v=[{id:G.id,params:h},{id:j.id,params:C}],I=[{id:G.id,params:S},{id:j.id,params:R}];return{redos:v,undos:I}}_handleInsertColCommand(t,n,s){const{range:r}=t,a=ce(this._univerInstanceService,n);if(!a)return this._handleNull();const l=me(a,s);if(!l)return this._handleNull();const{startColumn:u,endColumn:d}=r,c=i.Tools.deepClone(l.getMergeData()).reduce((p,M)=>(u>M.startColumn&&u<=M.endColumn&&p.push(M),p),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(l.getMergeData()).reduce((p,M)=>{if(u>M.startColumn&&u<=M.endColumn){const w=d-u+1;M.endColumn+=w,this._checkIsMergeCell(M)&&p.push(M)}return p},[]),h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C),v=[{id:G.id,params:h},{id:j.id,params:C}],I=[{id:G.id,params:S},{id:j.id,params:R}];return{redos:v,undos:I}}_handleRemoveColCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const{range:l}=t,{startColumn:u,endColumn:d}=l,c=i.Tools.deepClone(a.getMergeData()).reduce((w,y)=>(i.Rectangle.intersects(l,y)&&w.push(y),w),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(a.getMergeData()).reduce((w,y)=>{if(i.Rectangle.intersects(l,y)){if(u<=y.startColumn&&d>=y.endColumn)return w;u>=y.startColumn&&d<=y.endColumn?y.endColumn-=d-u+1:u<y.startColumn?(y.startColumn=u,y.endColumn-=d-u+1):d>y.endColumn&&(y.endColumn=u-1),this._checkIsMergeCell(y)&&w.push(y)}return w},[]),h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C),v=[{id:G.id,params:h}],I=[{id:j.id,params:C}],p=[{id:G.id,params:S}],M=[{id:j.id,params:R}];return{preUndos:p,undos:M,preRedos:v,redos:I}}_handleRemoveRowCommand(t,n,s){const{range:r}=t,a=ce(this._univerInstanceService,n);if(!a)return this._handleNull();const l=me(a,s);if(!l)return this._handleNull();const{startRow:u,endRow:d}=r,c=i.Tools.deepClone(l.getMergeData()).reduce((w,y)=>(i.Rectangle.intersects(r,y)&&w.push(y),w),[]);if(c.length===0)return this._handleNull();const m=i.Tools.deepClone(l.getMergeData()).reduce((w,y)=>{if(i.Rectangle.intersects(r,y)){if(u<=y.startRow&&d>=y.endRow)return w;u>=y.startRow&&d<=y.endRow?y.endRow-=d-u+1:u<y.startRow?(y.startRow=u,y.endRow-=d-u+1):d>y.endRow&&(y.endRow=u-1),this._checkIsMergeCell(y)&&w.push(y)}return w},[]),h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C),v=[{id:G.id,params:h}],I=[{id:j.id,params:C}],p=[{id:G.id,params:S}],M=[{id:j.id,params:R}];return{preUndos:p,undos:M,preRedos:v,redos:I}}_handleInsertRangeMoveRightCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=t.range,u=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:p,startColumn:M,endColumn:w}=l;if(i.Rectangle.intersects({startRow:I,startColumn:M,endRow:p,endColumn:u},v)&&(c.push(v),i.Rectangle.contains({startRow:I,startColumn:M,endRow:p,endColumn:u},v))){const N=w-M+1;m.push({startRow:v.startRow,startColumn:v.startColumn+N,endRow:v.endRow,endColumn:v.endColumn+N})}});const h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C);return{preRedos:[{id:G.id,params:h}],redos:[{id:j.id,params:C}],preUndos:[{id:G.id,params:S}],undos:[{id:j.id,params:R}]}}_handleInsertRangeMoveDownCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=t.range,u=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(w=>{const{startRow:y,startColumn:b,endColumn:N,endRow:U}=l;if(i.Rectangle.intersects({startRow:y,startColumn:b,endRow:u,endColumn:N},w)&&(c.push(w),i.Rectangle.contains({startRow:y,startColumn:b,endRow:u,endColumn:N},w))){const O=U-y+1;m.push({startRow:w.startRow+O,startColumn:w.startColumn,endRow:w.endRow+O,endColumn:w.endColumn})}});const h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C),v=[{id:G.id,params:h}],I=[{id:j.id,params:C}],p=[{id:G.id,params:S}],M=[{id:j.id,params:R}];return{redos:I,undos:M,preRedos:v,preUndos:p}}_handleDeleteRangeMoveUpCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=t.range,u=a.getMaxRows()-1,d=a.getMergeData(),c=[],m=[];d.forEach(w=>{const{startRow:y,startColumn:b,endColumn:N,endRow:U}=l;if(i.Rectangle.intersects({startRow:y,startColumn:b,endRow:u,endColumn:N},w)&&(c.push(w),i.Rectangle.contains({startRow:y,startColumn:b,endRow:u,endColumn:N},w))){const O=U-y+1,A=i.Rectangle.moveVertical(w,-O);m.push(A)}});const h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C),v=[{id:G.id,params:h}],I=[{id:j.id,params:C}],p=[{id:G.id,params:S}],M=[{id:j.id,params:R}];return{redos:I,undos:M,preRedos:v,preUndos:p}}_handleDeleteRangeMoveLeftCommand(t,n,s){const r=ce(this._univerInstanceService,n);if(!r)return this._handleNull();const a=me(r,s);if(!a)return this._handleNull();const l=t.range,u=a.getMaxColumns()-1,d=a.getMergeData(),c=[],m=[];d.forEach(v=>{const{startRow:I,endRow:p,startColumn:M,endColumn:w}=l;if(i.Rectangle.intersects({startRow:I,startColumn:M,endRow:p,endColumn:u},v)&&(c.push(v),i.Rectangle.contains({startRow:I,startColumn:M,endRow:p,endColumn:u},v))){const N=w-M+1;m.push({startRow:v.startRow,startColumn:v.startColumn-N,endRow:v.endRow,endColumn:v.endColumn-N})}});const h={unitId:n,subUnitId:s,ranges:c},R=ne(this._injector,h),C={unitId:n,subUnitId:s,ranges:m},S=ie(this._injector,C);return{preRedos:[{id:G.id,params:h}],redos:[{id:j.id,params:C}],undos:[{id:j.id,params:R}],preUndos:[{id:G.id,params:S}]}}_checkIsMergeCell(t){return!(t.startRow===t.endRow&&t.startColumn===t.endColumn)}_handleNull(){return{redos:[],undos:[]}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(Kl.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const{sourceRange:r,targetRange:a}=t.params,l=r.startColumn===a.startColumn&&r.endColumn===a.endColumn,u=l?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,d=l?r.startRow:r.startColumn,c=l?a.startRow:a.startColumn,m=s.getConfig().mergeData,h=[];m.forEach(v=>{let{startRow:I,endRow:p,startColumn:M,endColumn:w,rangeType:y}=v;i.Rectangle.intersects(v,r)||(l?d<I&&c>p?(I-=u,p-=u):d>p&&c<=I&&(I+=u,p+=u):d<M&&c>w?(M-=u,w-=u):d>w&&c<=M&&(M+=u,w+=u)),v.startRow===v.endRow&&v.startColumn===v.endColumn||h.push({startRow:I,endRow:p,startColumn:M,endColumn:w,rangeType:y})}),s.setMergeData(h),this.disposableCollection.dispose();const{unitId:R,subUnitId:C}=t.params,S=v=>this.refRangeHandle(v,R,C);h.forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,S,R,C))})}if(Yl.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const r=s.getConfig().mergeData,a=t.params;if(!a)return;const{range:l}=a,u=t.id.includes("row"),d=t.id.includes("insert"),c=u?l.startRow:l.startColumn,m=u?l.endRow:l.endColumn,h=m-c+1,R=[];r.forEach(I=>{let{startRow:p,endRow:M,startColumn:w,endColumn:y,rangeType:b}=I;d?u?c<=p&&(p+=h,M+=h):c<=w&&(w+=h,y+=h):u?m<p&&(p-=h,M-=h):m<w&&(w-=h,y-=h),I.startRow===I.endRow&&I.startColumn===I.endColumn||R.push({startRow:p,endRow:M,startColumn:w,endColumn:y,rangeType:b})}),s.setMergeData(R),this.disposableCollection.dispose();const{unitId:C,subUnitId:S}=t.params,v=I=>this.refRangeHandle(I,C,S);R.forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,v,C,S))})}}))}},g.MergeCellController=zl([dt(0,i.Inject(i.ICommandService)),dt(1,i.Inject(g.RefRangeService)),dt(2,i.Inject(i.IUniverInstanceService)),dt(3,i.Inject(i.Injector)),dt(4,i.Inject(g.SheetInterceptorService)),dt(5,i.Inject(g.SheetsSelectionsService))],g.MergeCellController);function ce(o,e){return e?o.getUniverSheetInstance(e):o.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET)}function me(o,e){return e?o.getSheetBySheetId(e):o.getActiveSheet()}var Jl=Object.defineProperty,xl=Object.getOwnPropertyDescriptor,Xl=(o,e,t,n)=>{for(var s=n>1?void 0:n?xl(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Jl(e,t,s),s},Zl=(o,e)=>(t,n)=>e(t,n,o);let on=class extends i.Disposable{constructor(o){super(),this._sheetInterceptorService=o,this._initialize()}_initialize(){this._initInterceptorCellContent()}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(Ae.CELL_CONTENT,{priority:11,effect:i.InterceptorEffectEnum.Value|i.InterceptorEffectEnum.Style,handler:(o,e,t)=>{var s;const n=e.workbook.getStyles().getStyleByCell(o);return(s=n==null?void 0:n.n)!=null&&s.pattern?t({...o}):(o==null?void 0:o.t)===i.CellValueType.NUMBER&&typeof(o==null?void 0:o.v)=="number"?t({...o,v:Y.stripErrorMargin(o.v)}):t({...o})}}))}};on=Xl([Zl(0,i.Inject(g.SheetInterceptorService))],on);var Ql=Object.defineProperty,eu=Object.getOwnPropertyDescriptor,tu=(o,e,t,n)=>{for(var s=n>1?void 0:n?eu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Ql(e,t,s),s},Yr=(o,e)=>(t,n)=>e(t,n,o);g.RangeProtectionRenderModel=class{constructor(e,t){f(this,"_cache",new i.LRUMap(1e4));this._selectionProtectionRuleModel=e,this._permissionService=t,this._init()}_init(){this._permissionService.permissionPointUpdate$.pipe(mt.filter(e=>e.type===D.SelectRange),mt.filter(e=>Se().some(t=>e instanceof t)),mt.map(e=>e)).subscribe(e=>{const t=this._selectionProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId);for(const n of t)n.permissionId===e.permissionId&&n.ranges.forEach(s=>{i.Range.foreach(s,(r,a)=>{const l=this._createKey(e.unitId,e.subUnitId,r,a);this._cache.delete(l)})})}),this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{var t;e.rule.ranges.forEach(n=>{i.Range.foreach(n,(s,r)=>{const a=this._createKey(e.unitId,e.subUnitId,s,r);this._cache.delete(a)})}),e.type==="set"&&((t=e.oldRule)==null||t.ranges.forEach(n=>{i.Range.foreach(n,(s,r)=>{const a=this._createKey(e.unitId,e.subUnitId,s,r);this._cache.delete(a)})}))})}_createKey(e,t,n,s){return`${e}_${t}_${n}_${s}`}getCellInfo(e,t,n,s){const r=this._selectionProtectionRuleModel.getSubunitRuleList(e,t),a=[];if(!r||!r.length)return a;const l=this._createKey(e,t,n,s),u=this._cache.get(l);if(u)return u;const d=[];for(const c of r)if(c.ranges.some(m=>m.startRow<=n&&m.endRow>=n&&m.startColumn<=s&&m.endColumn>=s)){const m=Se().reduce((h,R)=>{var v;const C=new R(e,t,c.permissionId),S=this._permissionService.getPermissionPoint(C.id);return h[C.subType]=(v=S==null?void 0:S.value)!=null?v:C.value,h},{});d.push({...m,ruleId:c.id,ranges:c.ranges})}return this._cache.set(l,d),d}clear(){this._cache.clear()}},g.RangeProtectionRenderModel=tu([Yr(0,i.Inject(Z)),Yr(1,i.Inject(i.IPermissionService))],g.RangeProtectionRenderModel);var nu=Object.defineProperty,ou=Object.getOwnPropertyDescriptor,su=(o,e,t,n)=>{for(var s=n>1?void 0:n?ou(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&nu(e,t,s),s},Do=(o,e)=>(t,n)=>e(t,n,o);g.RangeProtectionCache=class extends i.Disposable{constructor(t,n,s){super();f(this,"_cellRuleCache",new Map);f(this,"_permissionIdCache",new Map);f(this,"_cellInfoCache",new Map);f(this,"_rowInfoCache",new Map);f(this,"_colInfoCache",new Map);this._ruleModel=t,this._permissionService=n,this._univerInstanceService=s,this._initUpdateCellRuleCache(),this._initUpdateCellInfoCache(),this._initUpdateRowColInfoCache(),this._initCache()}_initCache(){this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{t.getSheets().forEach(n=>{const s=t.getUnitId(),r=n.getSheetId();this.reBuildCache(s,r)})})}_initUpdateCellInfoCache(){this._permissionService.permissionPointUpdate$.pipe(W.filter(t=>t.type===D.SelectRange),W.map(t=>t)).subscribe(t=>{const{subUnitId:n,unitId:s,permissionId:r}=t,a=this._permissionIdCache.get(r);if(!a)return;const l=this._ruleModel.getRule(s,n,a);if(!l)return;const u=this._ensureCellInfoMap(s,n);l.ranges.forEach(d=>{const{startRow:c,endRow:m,startColumn:h,endColumn:R}=d;for(let C=c;C<=m;C++)for(let S=h;S<=R;S++)u.delete(`${C}-${S}`)})}),this._ruleModel.ruleChange$.subscribe(t=>{var a;const{unitId:n,subUnitId:s}=t,r=this._ensureCellInfoMap(n,s);t.rule.ranges.forEach(l=>{i.Range.foreach(l,(u,d)=>{r.delete(`${u}-${d}`)})}),t.type==="set"&&((a=t.oldRule)==null||a.ranges.forEach(l=>{i.Range.foreach(l,(u,d)=>{this._cellInfoCache.delete(`${u}-${d}`)})}))})}_initUpdateCellRuleCache(){this._ruleModel.ruleChange$.subscribe(t=>{const{type:n}=t;n==="add"?this._addCellRuleCache(t):n==="delete"?this._deleteCellRuleCache(t):(this._deleteCellRuleCache({...t,rule:t.oldRule}),this._addCellRuleCache(t))})}_ensureRuleMap(t,n){let s=this._cellRuleCache.get(t);s||(s=new Map,this._cellRuleCache.set(t,s));let r=s.get(n);return r||(r=new Map,s.set(n,r)),r}_ensureCellInfoMap(t,n){let s=this._cellInfoCache.get(t);s||(s=new Map,this._cellInfoCache.set(t,s));let r=s.get(n);return r||(r=new Map,s.set(n,r)),r}_ensureRowColInfoMap(t,n,s){let r=s==="row"?this._rowInfoCache.get(t):this._colInfoCache.get(t);r||(r=new Map,s==="row"?this._rowInfoCache.set(t,r):this._colInfoCache.set(t,r));let a=r.get(n);return a||(a=new Map,r.set(n,a)),a}_addCellRuleCache(t){const{subUnitId:n,unitId:s,rule:r}=t,a=this._ensureRuleMap(s,n);r.ranges.forEach(l=>{const{startRow:u,endRow:d,startColumn:c,endColumn:m}=l;for(let h=u;h<=d;h++)for(let R=c;R<=m;R++)a.set(`${h}-${R}`,r.id)}),this._permissionIdCache.set(r.permissionId,r.id)}_deleteCellRuleCache(t){const{subUnitId:n,unitId:s,rule:r}=t,a=this._ensureRuleMap(s,n),l=this._ensureCellInfoMap(s,n);r.ranges.forEach(u=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=u;for(let R=d;R<=c;R++)for(let C=m;C<=h;C++)a.delete(`${R}-${C}`),l.delete(`${R}-${C}`)}),this._permissionIdCache.delete(r.permissionId)}_getSelectionActions(t,n,s){var c,m,h,R,C,S,v,I,p,M,w,y;const r=(h=(m=this._permissionService.getPermissionPoint((c=new Rt(t,n,s.permissionId))==null?void 0:c.id))==null?void 0:m.value)!=null?h:!0,a=(S=(C=this._permissionService.getPermissionPoint((R=new Wt(t,n,s.permissionId))==null?void 0:R.id))==null?void 0:C.value)!=null?S:!0,l=(p=(I=this._permissionService.getPermissionPoint((v=new So(t,n,s.permissionId))==null?void 0:v.id))==null?void 0:I.value)!=null?p:!1,u=(y=(w=this._permissionService.getPermissionPoint((M=new Co(t,n,s.permissionId))==null?void 0:M.id))==null?void 0:w.value)!=null?y:!1;return{[_.Edit]:r,[_.View]:a,[_.ManageCollaborator]:l,[_.Delete]:u}}reBuildCache(t,n){const s=this._ensureRuleMap(t,n),r=this._ensureCellInfoMap(t,n);s.clear(),r.clear();const a=this._ensureRowColInfoMap(t,n,"row"),l=this._ensureRowColInfoMap(t,n,"col");a.clear(),l.clear(),this._ruleModel.getSubunitRuleList(t,n).forEach(u=>{const d=this._getSelectionActions(t,n,u),c={...d,ruleId:u.id,ranges:u.ranges};u.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:C,endColumn:S}=m;for(let v=h;v<=R;v++){const I=a.get(`${v}`);I?I.set(u.id,d):a.set(`${v}`,new Map([[u.id,d]]));for(let p=C;p<=S;p++){s.set(`${v}-${p}`,u.id),r.set(`${v}-${p}`,c);const M=l.get(`${p}`);M?M.set(u.id,d):l.set(`${p}`,new Map([[u.id,d]]))}}}),this._permissionIdCache.set(u.permissionId,u.id)})}getRowPermissionInfo(t,n,s,r){var u;const a=(u=this._rowInfoCache.get(t))==null?void 0:u.get(n);if(!a)return!0;const l=a.get(`${s}`);return l?r.every(d=>{for(const c of l.values())if(c[d]===!1)return!1;return!0}):!0}getColPermissionInfo(t,n,s,r){var u;const a=(u=this._colInfoCache.get(t))==null?void 0:u.get(n);if(!a)return!0;const l=a.get(`${s}`);return l?r.every(d=>{for(const c of l.values())if(c[d]===!1)return!1;return!0}):!0}_initUpdateRowColInfoCache(){this._permissionService.permissionPointUpdate$.pipe(W.filter(t=>t.type===D.SelectRange),W.map(t=>t)).subscribe({next:t=>{const{subUnitId:n,unitId:s,permissionId:r}=t,a=this._permissionIdCache.get(r);if(!a)return;const l=this._ruleModel.getRule(s,n,a);if(!l)return;const u=this._ensureRowColInfoMap(s,n,"row"),d=this._ensureRowColInfoMap(s,n,"col"),c=this._getSelectionActions(s,n,l);l.ranges.forEach(m=>{const{startRow:h,endRow:R,startColumn:C,endColumn:S}=m;for(let v=h;v<=R;v++){const I=u.get(`${v}`);I?I.set(a,c):u.set(`${v}`,new Map([[a,c]]));for(let p=C;p<=S;p++){const M=d.get(`${p}`);M?M.set(a,c):d.set(`${p}`,new Map([[a,c]]))}}})}}),this._ruleModel.ruleChange$.subscribe(t=>{if(t.type==="delete"){const{unitId:n,subUnitId:s,rule:r}=t,a=this._ensureRowColInfoMap(n,s,"row"),l=this._ensureRowColInfoMap(n,s,"col");r.ranges.forEach(u=>{const{startRow:d,endRow:c,startColumn:m,endColumn:h}=u;for(let R=d;R<=c;R++){const C=a.get(`${R}`);C==null||C.delete(r.id);for(let S=m;S<=h;S++){const v=l.get(`${S}`);v==null||v.delete(r.id)}}})}})}getCellInfo(t,n,s,r){var c,m;const a=this._ensureCellInfoMap(t,n),l=a.get(`${s}-${r}`);if(l)return l;const u=(m=(c=this._cellRuleCache.get(t))==null?void 0:c.get(n))==null?void 0:m.get(`${s}-${r}`);if(!u)return;const d=this._ruleModel.getRule(t,n,u);if(d){const R={...this._getSelectionActions(t,n,d),ruleId:u,ranges:d.ranges};return a.set(`${s}-${r}`,R),R}}deleteUnit(t){this._cellRuleCache.delete(t),this._cellInfoCache.delete(t),this._rowInfoCache.delete(t),this._colInfoCache.delete(t);const n=this._univerInstanceService.getUnit(t);n==null||n.getSheets().forEach(s=>{const r=s.getSheetId();this._ruleModel.getSubunitRuleList(t,r).forEach(a=>{this._permissionIdCache.delete(a.permissionId)})})}},g.RangeProtectionCache=su([Do(0,i.Inject(Z)),Do(1,i.Inject(i.IPermissionService)),Do(2,i.Inject(i.IUniverInstanceService))],g.RangeProtectionCache);const Ao=i.createIdentifier("univer.exclusive-range-service");class Kr extends i.Disposable{constructor(){super(...arguments);f(this,"_exclusiveRanges",new Map);f(this,"_exclusiveRangesChange$",new W.Subject);f(this,"exclusiveRangesChange$",this._exclusiveRangesChange$.asObservable())}_ensureUnitMap(t){return this._exclusiveRanges.has(t)||this._exclusiveRanges.set(t,new Map),this._exclusiveRanges.get(t)}_ensureSubunitMap(t,n){const s=this._ensureUnitMap(t);return s.has(n)||s.set(n,new Map),s.get(n)}_ensureFeature(t,n,s){const r=this._ensureSubunitMap(t,n);return r.has(s)||r.set(s,[]),r.get(s)}addExclusiveRange(t,n,s,r){const a=this._ensureFeature(t,n,s);a.push(...r),this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:a.map(l=>l.range)})}getExclusiveRanges(t,n,s){var r,a;return(a=(r=this._exclusiveRanges.get(t))==null?void 0:r.get(n))==null?void 0:a.get(s)}clearExclusiveRanges(t,n,s){const r=this.getExclusiveRanges(t,n,s);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(r==null?void 0:r.map(a=>a.range))||[]}),this._ensureFeature(t,n,s),this._exclusiveRanges.get(t).get(n).set(s,[])}clearExclusiveRangesByGroupId(t,n,s,r){const a=this.getExclusiveRanges(t,n,s);this._exclusiveRangesChange$.next({unitId:t,subUnitId:n,ranges:(a==null?void 0:a.map(u=>u.range))||[]});const l=this.getExclusiveRanges(t,n,s);if(l){const u=l.filter(d=>d.groupId!==r);this._exclusiveRanges.get(t).get(n).set(s,u)}}getInterestGroupId(t){const n=[];return t.forEach(s=>{var d;const r=s.range,{unitId:a,sheetId:l}=r;if(!a||!l)return;const u=(d=this._exclusiveRanges.get(a))==null?void 0:d.get(l);if(u)for(const c of u.keys()){const m=u.get(c);if(m){for(const h of m)if(i.Rectangle.intersects(r,h.range)){n.push(c);break}}}}),n}}var ru=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,au=(o,e,t,n)=>{for(var s=n>1?void 0:n?iu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&ru(e,t,s),s},Wo=(o,e)=>(t,n)=>e(t,n,o);g.NumfmtService=class extends i.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._logService=n}getValue(e,t,n,s){const r=this._univerInstanceService.getUniverSheetInstance(e);if(!r)return;const a=r==null?void 0:r.getSheetBySheetId(t);if(!a)return;const l=r.getStyles(),u=a.getCellRaw(n,s);if(u!=null&&u.s){const d=l.get(u.s);if(d!=null&&d.n)return d.n}return null}deleteValues(e,t,n){const s=this._univerInstanceService.getUniverSheetInstance(e);if(!s)return;const r=s==null?void 0:s.getSheetBySheetId(t);if(!r)return;const a=s.getStyles();n.forEach(l=>{i.Range.foreach(l,(u,d)=>{const c=r.getCellRaw(u,d);if(!c)return;const m=c==null?void 0:c.s,R={...m&&a.get(m)||{}};delete R.n;const C=a.setValue(R);c.s=C})})}setValues(e,t,n){const s=this._univerInstanceService.getUniverSheetInstance(e);if(!s)return;const r=s==null?void 0:s.getSheetBySheetId(t);if(!r)return;const a=s.getStyles(),l=r.getCellMatrix();n.forEach(u=>{u.ranges.forEach(d=>{i.Range.foreach(d,(c,m)=>{const h=r.getCellRaw(c,m);if(h){const C={...a.getStyleByCell(h)||{},n:{pattern:u.pattern}},S=a.setValue(C);h.s=S,u.pattern===Vo.DEFAULT_TEXT_FORMAT&&(h.t=i.CellValueType.STRING)}else{const R={n:{pattern:u.pattern}},C=a.setValue(R);C&&l.setValue(c,m,{s:C})}})})})}},g.NumfmtService=au([Wo(0,i.IResourceManagerService),Wo(1,i.IUniverInstanceService),Wo(2,i.ILogService)],g.NumfmtService);var lu=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,du=(o,e,t,n)=>{for(var s=n>1?void 0:n?uu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&lu(e,t,s),s},Ne=(o,e)=>(t,n)=>e(t,n,o);const Jr=[ue.id,Ce.id,re.id,de.id],xr=[Ie.id,pe.id];g.RangeProtectionRefRangeService=class extends i.Disposable{constructor(t,n,s,r,a,l,u,d){super();f(this,"disposableCollection",new i.DisposableCollection);this._selectionProtectionRuleModel=t,this._univerInstanceService=n,this._commandService=s,this._refRangeService=r,this._selectionProtectionRenderModel=a,this._rangeProtectionCache=l,this._sheetInterceptorService=u,this._rangeProtectionRuleModel=d,this._onRefRangeChange(),this._correctPermissionRange(),this._initReBuildCache(),this._initRemoveSheet()}_onRefRangeChange(){const t=(s,r)=>{const a=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!a||!(a==null?void 0:a.getSheetBySheetId(r)))return;this.disposableCollection.dispose();const u=c=>this.refRangeHandle(c,s,r);this._selectionProtectionRuleModel.getSubunitRuleList(s,r).reduce((c,m)=>[...c,...m.ranges],[]).forEach(c=>{this.disposableCollection.add(this._refRangeService.registerRefRange(c,u,s,r))})};this.disposeWithMe(this._commandService.onCommandExecuted(s=>{if(s.id===mo.id){const r=s.params,a=r.subUnitId,l=r.unitId;if(!a||!l)return;t(l,a)}if(s.id===x.id||s.id===le.id){const r=s.params,a=r.subUnitId,l=r.unitId;if(!a||!l)return;t(l,a)}}));const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(n){const s=n.getActiveSheet();if(!s)return;t(n.getUnitId(),s.getSheetId())}}refRangeHandle(t,n,s){switch(t.id){case Bt.id:return this._getRefRangeMutationsByMoveRows(t.params,n,s);case Ht.id:return this._getRefRangeMutationsByMoveCols(t.params,n,s);case be.id:return this._getRefRangeMutationsByInsertRows(t.params,n,s);case Te.id:return this._getRefRangeMutationsByInsertCols(t.params,n,s);case It.id:return this._getRefRangeMutationsByDeleteCols(t.params,n,s);case vt.id:return this._getRefRangeMutationsByDeleteRows(t.params,n,s)}return{redos:[],undos:[]}}_getRefRangeMutationsByDeleteCols(t,n,s){const r=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(l=>l.ranges.some(u=>i.Rectangle.intersects(u,t.range))),a=t.range;if(r.length){const l=[],u=[];return r.forEach(d=>{const c=i.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(i.Rectangle.intersects(R,a)){const C=i.Tools.deepClone(R),{startColumn:S,endColumn:v}=a;if(S<=C.startColumn&&v>=C.endColumn)return h;S>=C.startColumn&&v<=C.endColumn?C.endColumn-=v-S+1:S<C.startColumn?(C.startColumn=S,C.endColumn-=v-S+1):v>C.endColumn&&(C.endColumn=S-1),this._checkIsRightRange(C)&&h.push(C)}return h},[]);c.ranges=m,c.ranges.length?(l.push({id:x.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:d.id}}),u.push({id:x.id,params:{unitId:n,subUnitId:s,rule:d,ruleId:d.id}})):(l.push({id:he.id,params:{unitId:n,subUnitId:s,ruleIds:[d.id]}}),u.push({id:le.id,params:{unitId:n,subUnitId:s,name:"",rules:[d]}}))}),{redos:l,undos:u}}return{undos:[],redos:[]}}_getRefRangeMutationsByDeleteRows(t,n,s){const r=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(l=>l.ranges.some(u=>i.Rectangle.intersects(u,t.range))),a=t.range;if(r.length){const l=[],u=[];return r.forEach(d=>{const c=i.Tools.deepClone(d),m=c.ranges.reduce((h,R)=>{if(i.Rectangle.intersects(R,a)){const C=i.Tools.deepClone(R),{startRow:S,endRow:v}=a;if(S<=C.startRow&&v>=C.endRow)return h;S>=C.startRow&&v<=C.endRow?C.endRow-=v-S+1:S<C.startRow?(C.startRow=S,C.endRow-=v-S+1):v>C.endRow&&(C.endRow=S-1),this._checkIsRightRange(C)&&h.push(C)}return h},[]);c.ranges=m,l.push({id:x.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:d.id}}),u.push({id:x.id,params:{unitId:n,subUnitId:s,rule:d,ruleId:d.id}})}),{redos:l,undos:u}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertCols(t,n,s){const r=t.range.startColumn,a=t.range.endColumn-t.range.startColumn+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(u=>u.ranges.some(d=>r>d.startColumn&&r<=d.endColumn));if(l.length){const u=[],d=[];return l.forEach(c=>{const m=i.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{r>R.startColumn&&r<=R.endColumn&&(R.endColumn+=a,h=!0)}),h&&(u.push({id:x.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:c.id}}),d.push({id:x.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:c.id}}))}),{redos:u,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertRows(t,n,s){const r=t.range.startRow,a=t.range.endRow-t.range.startRow+1,l=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(u=>u.ranges.some(d=>r>d.startRow&&r<=d.endRow));if(l.length){const u=[],d=[];return l.forEach(c=>{const m=i.Tools.deepClone(c);let h=!1;m.ranges.forEach(R=>{r>R.startRow&&r<=R.endRow&&(R.endRow+=a,h=!0)}),h&&(u.push({id:x.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:c.id}}),d.push({id:x.id,params:{unitId:n,subUnitId:s,rule:c,ruleId:c.id}}))}),{redos:u,undos:d}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveRows(t,n,s){const r=t.toRange,a=r.startRow,l=r.endRow-r.startRow+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(d=>d.ranges.some(c=>a>c.startRow&&a<=c.endRow));if(u.length){const d=[],c=[];return u.forEach(m=>{const h=i.Tools.deepClone(m),C=t.fromRange.startRow;let S=!1;h.ranges.forEach(v=>{a>v.startRow&&a<=v.endRow&&(C<v.startRow&&(v.startRow=v.startRow-l,v.endRow=v.endRow-l),v.endRow+=l,S=!0)}),S&&(d.push({id:x.id,params:{unitId:n,subUnitId:s,rule:h,ruleId:m.id}}),c.push({id:x.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveCols(t,n,s){const r=t.toRange,a=r.startColumn,l=r.endColumn-r.startColumn+1,u=this._selectionProtectionRuleModel.getSubunitRuleList(n,s).filter(d=>d.ranges.some(c=>a>c.startColumn&&a<=c.endColumn));if(u.length){const d=[],c=[];return u.forEach(m=>{const h=i.Tools.deepClone(m),C=t.fromRange.startColumn;let S=!1;h.ranges.forEach(v=>{a>v.startColumn&&a<=v.endColumn&&(C<v.startColumn&&(v.startColumn=v.startColumn-l,v.endColumn=v.endColumn-l),v.endColumn+=l,S=!0)}),S&&(d.push({id:x.id,params:{unitId:n,subUnitId:s,rule:h,ruleId:m.id}}),c.push({id:x.id,params:{unitId:n,subUnitId:s,rule:m,ruleId:m.id}}))}),{redos:d,undos:c}}return{undos:[],redos:[]}}_correctPermissionRange(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(xr.includes(t.id)){if(!t.params)return;const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const{sourceRange:r,targetRange:a}=t.params,l=r.startColumn===a.startColumn&&r.endColumn===a.endColumn,u=l?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,d=l?r.startRow:r.startColumn,c=l?a.startRow:a.startColumn;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),s.getSheetId()).forEach(v=>{v.ranges.forEach(p=>{let{startRow:M,endRow:w,startColumn:y,endColumn:b}=p;i.Rectangle.intersects(p,r)||(l?d<M&&c>w?(M-=u,w-=u):d>w&&c<=M&&(M+=u,w+=u):d<y&&c>b?(y-=u,b-=u):d>b&&c<=y&&(y+=u,b+=u)),this._checkIsRightRange({startRow:M,endRow:w,startColumn:y,endColumn:b})&&(p.startColumn=y,p.endColumn=b,p.startRow=M,p.endRow=w)})}),this.disposableCollection.dispose();const{unitId:h,subUnitId:R}=t.params,C=v=>this.refRangeHandle(v,h,R);this._selectionProtectionRuleModel.getSubunitRuleList(h,R).reduce((v,I)=>[...v,...I.ranges],[]).forEach(v=>{this.disposableCollection.add(this._refRangeService.registerRefRange(v,C,h,R))}),this._selectionProtectionRenderModel.clear()}if(Jr.includes(t.id)){const n=this._univerInstanceService.getUniverSheetInstance(t.params.unitId);if(!n)return;const s=n.getSheetBySheetId(t.params.subUnitId);if(!s)return;const r=t.params;if(!r)return;const{range:a}=r,l=t.id.includes("row"),u=t.id.includes("insert"),d=l?a.startRow:a.startColumn,c=l?a.endRow:a.endColumn,m=c-d+1;this._selectionProtectionRuleModel.getSubunitRuleList(n.getUnitId(),s.getSheetId()).forEach(I=>{I.ranges.forEach(M=>{let{startRow:w,endRow:y,startColumn:b,endColumn:N}=M;u?l?d<=w&&(w+=m,y+=m):d<=b&&(b+=m,N+=m):l?c<w&&(w-=m,y-=m):c<b&&(b-=m,N-=m),this._checkIsRightRange({startRow:w,endRow:y,startColumn:b,endColumn:N})&&(M.startColumn=b,M.endColumn=N,M.startRow=w,M.endRow=y)})}),this.disposableCollection.dispose();const{unitId:R,subUnitId:C}=t.params,S=I=>this.refRangeHandle(I,R,C);this._selectionProtectionRuleModel.getSubunitRuleList(R,C).reduce((I,p)=>[...I,...p.ranges],[]).forEach(I=>{this.disposableCollection.add(this._refRangeService.registerRefRange(I,S,R,C))}),this._selectionProtectionRenderModel.clear()}}))}_checkIsRightRange(t){return t.startRow<=t.endRow&&t.startColumn<=t.endColumn}_initReBuildCache(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(Jr.includes(t.id)||xr.includes(t.id)){const{unitId:n,subUnitId:s}=t.params;this._rangeProtectionCache.reBuildCache(n,s)}}))}_initRemoveSheet(){this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=[],s=[],r=[],a=[];if(t.id===jt.id){const l=t.params,u=[],d=[];this._rangeProtectionRuleModel.getSubunitRuleList(l.unitId,l.subUnitId).forEach(c=>{u.push(c.id),d.push(c)}),u.length&&d.length&&(r.push({id:he.id,params:{unitId:l.unitId,subUnitId:l.subUnitId,ruleIds:u}}),n.push({id:le.id,params:{unitId:l.unitId,subUnitId:l.subUnitId,name:"",rules:d}}))}return{redos:s,undos:n,preRedos:r,preUndos:a}}})}},g.RangeProtectionRefRangeService=du([Ne(0,i.Inject(Z)),Ne(1,i.Inject(i.IUniverInstanceService)),Ne(2,i.ICommandService),Ne(3,i.Inject(g.RefRangeService)),Ne(4,i.Inject(g.RangeProtectionRenderModel)),Ne(5,i.Inject(g.RangeProtectionCache)),Ne(6,i.Inject(g.SheetInterceptorService)),Ne(7,i.Inject(Z))],g.RangeProtectionRefRangeService);var cu=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,hu=(o,e,t,n)=>{for(var s=n>1?void 0:n?mu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&cu(e,t,s),s},bt=(o,e)=>(t,n)=>e(t,n,o);const gu="SHEET_RANGE_PROTECTION_PLUGIN";g.RangeProtectionService=class extends i.Disposable{constructor(e,t,n,s,r){super(),this._selectionProtectionRuleModel=e,this._permissionService=t,this._resourceManagerService=n,this._selectionProtectionCache=s,this._univerInstanceService=r,this._initSnapshot(),this._initRuleChange()}_initRuleChange(){this.disposeWithMe(this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case"add":{Se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(n)});break}case"delete":{Se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.deletePermissionPoint(n.id)});break}case"set":{e.oldRule.permissionId!==e.rule.permissionId&&Se().forEach(t=>{const n=new t(e.unitId,e.subUnitId,e.oldRule.permissionId);this._permissionService.deletePermissionPoint(n.id);const s=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(s)});break}}}))}_initSnapshot(){const e=n=>{const r=this._selectionProtectionRuleModel.toObject()[n];return r?JSON.stringify(r):""},t=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e,parseJson:t,pluginName:gu,businesses:[At.UNIVER_SHEET],onLoad:(n,s)=>{const r=this._selectionProtectionRuleModel.toObject();r[n]=s,this._selectionProtectionRuleModel.fromObject(r);const a=[];Object.keys(s).forEach(l=>{const u=s[l];this._selectionProtectionRuleModel.getSubunitRuleList(n,l).forEach(d=>{a.push({objectID:d.permissionId,unitID:n,objectType:D.SelectRange,actions:cr})}),u.forEach(d=>{Se().forEach(c=>{const m=new c(n,l,d.permissionId);m.value=!1,this._permissionService.addPermissionPoint(m)})}),this._selectionProtectionCache.reBuildCache(n,l)})},onUnLoad:n=>{this._selectionProtectionCache.deleteUnit(n)}}))}},g.RangeProtectionService=hu([bt(0,i.Inject(Z)),bt(1,i.Inject(i.IPermissionService)),bt(2,i.Inject(i.IResourceManagerService)),bt(3,i.Inject(g.RangeProtectionCache)),bt(4,i.Inject(i.IUniverInstanceService))],g.RangeProtectionService);var Ru=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,Su=(o,e,t,n)=>{for(var s=n>1?void 0:n?Cu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Ru(e,t,s),s},Tt=(o,e)=>(t,n)=>e(t,n,o);g.WorkbookPermissionService=class extends i.Disposable{constructor(e,t,n,s,r){super(),this._permissionService=e,this._univerInstanceService=t,this._rangeProtectionRuleModel=n,this._worksheetProtectionRuleModel=s,this._worksheetProtectionPointModel=r,this._init()}_init(){const e=t=>{const n=t.getUnitId();xt().forEach(s=>{const r=new s(n);this._permissionService.addPermissionPoint(r)})};this._univerInstanceService.getAllUnitsForType(i.UniverInstanceType.UNIVER_SHEET).forEach(t=>{e(t)}),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(i.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{e(t)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(i.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=t.getUnitId();t.getSheets().forEach(s=>{const r=s.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,r).forEach(l=>{[...Se()].forEach(u=>{const d=new u(n,r,l.permissionId);this._permissionService.deletePermissionPoint(d.id)})}),[...we(),...lt()].forEach(l=>{const u=new l(n,r);this._permissionService.deletePermissionPoint(u.id)})}),xt().forEach(s=>{const r=new s(n);this._permissionService.deletePermissionPoint(r.id)}),this._rangeProtectionRuleModel.deleteUnitModel(n),this._worksheetProtectionPointModel.deleteUnitModel(n),this._worksheetProtectionRuleModel.deleteUnitModel(n)}))}},g.WorkbookPermissionService=Su([Tt(0,i.Inject(i.IPermissionService)),Tt(1,i.Inject(i.IUniverInstanceService)),Tt(2,i.Inject(Z)),Tt(3,i.Inject(ke)),Tt(4,i.Inject(yt))],g.WorkbookPermissionService);var fu=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,Iu=(o,e,t,n)=>{for(var s=n>1?void 0:n?vu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&fu(e,t,s),s},pu=(o,e)=>(t,n)=>e(t,n,o);g.SheetRangeThemeService=class extends i.Disposable{constructor(e){super(),this._sheetRangeThemeModel=e}registerRangeTheme(e,t){this._sheetRangeThemeModel.registerRangeThemeStyle(e,t)}getALLRegisterThemes(){return this._sheetRangeThemeModel.getALLRegisteredTheme()}registerRangeThemeStyle(e,t){this._sheetRangeThemeModel.registerRangeThemeRule(e,t)}getAppliedRangeThemeStyle(e){return this._sheetRangeThemeModel.getRegisteredRangeThemeStyle(e)}getRegisteredRangeThemes(){return this._sheetRangeThemeModel.getRegisteredRangeThemes()}},g.SheetRangeThemeService=Iu([pu(0,i.Inject(ge))],g.SheetRangeThemeService);var Xr=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,wu=(o,e,t)=>e in o?Xr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,yu=(o,e,t,n)=>{for(var s=n>1?void 0:n?Mu(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Xr(e,t,s),s},Zr=(o,e)=>(t,n)=>e(t,n,o),Qr=(o,e,t)=>wu(o,typeof e!="symbol"?e+"":e,t);const _u="SHEET_PLUGIN";g.UniverSheetsPlugin=class extends i.Plugin{constructor(e=Er,t,n){super(),this._config=e,this._injector=t,this._configService=n;const{...s}=i.merge({},Er,this._config);this._configService.setConfig(gl,s),this._initConfig(),this._initDependencies()}_initConfig(){var e,t;(e=this._config)!=null&&e.onlyRegisterFormulaRelatedMutations&&this._configService.setConfig(br,!0),(t=this._config)!=null&&t.isRowStylePrecedeColumnStyle&&this._configService.setConfig(i.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE,!0)}_initDependencies(){var t;const e=[[Le],[g.SheetsSelectionsService],[g.RefRangeService],[g.WorkbookPermissionService],[He,{useClass:g.NumfmtService}],[g.SheetInterceptorService],[g.SheetRangeThemeService],[Qt],[g.MergeCellController],[on],[g.DefinedNameDataController],[g.WorksheetPermissionService],[ke],[yt],[ge],[g.RangeProtectionRenderModel],[Z],[g.RangeProtectionCache],[g.RangeProtectionRefRangeService],[g.RangeProtectionService],[Ao,{useClass:Kr,deps:[g.SheetsSelectionsService]}]];(t=this._config)!=null&&t.notExecuteFormula||e.push([en]),i.registerDependencies(this._injector,i.mergeOverrideWithDependencies(e,this._config.override)),i.touchDependencies(this._injector,[[g.SheetInterceptorService],[g.RangeProtectionService],[Ao]])}onStarting(){i.touchDependencies(this._injector,[[Qt],[g.MergeCellController],[g.WorkbookPermissionService],[g.WorksheetPermissionService]])}onRendered(){i.touchDependencies(this._injector,[[He]])}onReady(){i.touchDependencies(this._injector,[[en],[g.DefinedNameDataController],[ge],[on],[g.RangeProtectionRenderModel],[g.RangeProtectionRefRangeService],[g.RefRangeService]])}},Qr(g.UniverSheetsPlugin,"pluginName",_u),Qr(g.UniverSheetsPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),g.UniverSheetsPlugin=yu([i.DependentOn(Y.UniverFormulaEnginePlugin),Zr(1,i.Inject(i.Injector)),Zr(2,i.IConfigService)],g.UniverSheetsPlugin);const bu=[ye.id,ae.id,Io.id,Me.id,it.id,Ie.id,pe.id,et.id,tt.id,rt.id,st.id,ue.id,Ce.id,re.id,de.id,ut.id,nt.id],Tu=[B.id,_e.id,G.id,j.id,pt.id,at.id,ot.id,Qe.id,qe.id,ze.id],Uu=1.5,Eu="rgba(255, 255, 255, 0.01)";function Pu(o){const{rangeWithCoord:e,primaryWithCoord:t,style:n}=o,s={range:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType,unitId:e.unitId,sheetId:e.sheetId},primary:null,style:n};return t!=null&&(s.primary=ei(t)),s}function ei(o){const{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:s}=o,{startRow:r,startColumn:a,endRow:l,endColumn:u}=o.mergeInfo;return{actualRow:e,actualColumn:t,isMerged:n,isMergedMainCell:s,startRow:r,startColumn:a,endRow:l,endColumn:u}}const Nu=(o,e,t)=>{const s=o.get(g.SheetsSelectionsService).getCurrentSelections(),{value:r,selections:a,unitId:l,subUnitId:u}=e;if(s){const c=s[(s==null?void 0:s.length)-1].primary;if(c){const{actualColumn:m,actualRow:h}=c;let{startRow:R,startColumn:C,endRow:S,endColumn:v}=a[a.length-1];if(r===i.Dimension.COLUMNS){const w=t.find(y=>y.startColumn===m&&y.endColumn===m&&h===y.startRow);w&&(v=w.endColumn,R=w.startRow,S=w.endRow)}else if(r===i.Dimension.ROWS){const w=t.find(y=>y.startRow===h&&y.endRow===h&&m===y.startColumn);w&&(S=w.endRow,C=w.startColumn,v=w.endColumn)}const I={startRow:R,startColumn:C,endRow:S,endColumn:v,actualRow:h,actualColumn:m,isMerged:!0,isMergedMainCell:R===h&&C===m},p=s.map((w,y,b)=>({range:w.range,style:null,primary:y===b.length-1?I:null})),M={unitId:l,subUnitId:u,type:Q.ONLY_SET,selections:p};return{id:q.id,params:M}}return null}return null},ku=(o,e)=>{const n=o.get(g.SheetsSelectionsService).getCurrentSelections(),{unitId:s,subUnitId:r}=e;if(n&&n[(n==null?void 0:n.length)-1].primary){const u={unitId:s,subUnitId:r,type:Q.ONLY_SET,selections:[...n]};return{id:q.id,params:u}}return null};function ti(o){return o==null?!1:o.v!==void 0&&o.v!==null&&o.v!==""||o.p!==void 0}function sn(o,e){return o&&o.spanAnchor?ti(e.getValue(o.spanAnchor.startRow,o.spanAnchor.startColumn)):ti(o)}function Ou(o,e,t,n,s){const r=o.getCellMatrix(),a=o.getSpanModel().getMergedCellRange(e,t,n,s),l=new i.ObjectMatrix;return r.forValue((u,d)=>{const c=r.getValue(u,d);c&&l.setValue(u,d,c)}),a.forEach(u=>{const{startColumn:d,startRow:c,endColumn:m,endRow:h}=u;i.createRowColIter(c,h,d,m).forEach((R,C)=>{R===c&&C===d&&l.setValue(R,C,{...r.getValue(R,C),spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}),(R!==c||C!==d)&&(l.realDeleteValue(R,C),l.setValue(R,C,{spanAnchor:{startRow:c,endRow:h,startColumn:d,endColumn:m}}))})}),l}function Du(o,e,t,n){const{startRow:s,startColumn:r,endRow:a}=o;let l=null,u=!1;for(let d=s;d<=a;d++){const c=e.getValue(d,r-t);if(u=u||sn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(o.startColumn=o.startColumn-t,{spanAnchor:l,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function Au(o,e,t,n){const{startRow:s,endColumn:r,endRow:a}=o;let l=null,u=!1;for(let d=s;d<=a;d++){const c=e.getValue(d,r+t);if(u=u||sn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(o.endColumn=o.endColumn+t,{spanAnchor:l,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function Wu(o,e,t,n){const{startRow:s,startColumn:r,endColumn:a}=o;let l=null,u=!1;for(let d=r;d<=a;d++){const c=e.getValue(s-t,d);if(u=u||sn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(o.startRow=o.startRow-t,{spanAnchor:l,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function Vu(o,e,t,n){const{startColumn:s,endColumn:r,endRow:a}=o;let l=null,u=!1;for(let d=s;d<=r;d++){const c=e.getValue(a+t,d);if(u=u||sn(c,e),!n&&u)break;c&&c.spanAnchor&&(l?l={startRow:Math.min(c.spanAnchor.startRow,l.startRow),startColumn:Math.min(c.spanAnchor.startColumn,l.startColumn),endRow:Math.max(c.spanAnchor.endRow,l.endRow),endColumn:Math.max(c.spanAnchor.endColumn,l.endColumn)}:l={startRow:c.spanAnchor.startRow,startColumn:c.spanAnchor.startColumn,endRow:c.spanAnchor.endRow,endColumn:c.spanAnchor.endColumn})}return u?(o.endRow=o.endRow+t,{spanAnchor:l,hasValue:!0,range:o}):{spanAnchor:null,hasValue:!1,range:o}}function $u(o,e,t){const n=t.getMaxRows(),s=t.getMaxColumns(),r=Ou(t,0,0,n-1,s-1),a=t.getSnapshot().mergeData.length>0,{left:l,right:u,up:d,down:c}=e;let m=!0,h={...o};const R=[];for(;m;){if(m=!1,d&&h.startRow!==0){const{hasValue:C,range:S,spanAnchor:v}=Wu(h,r,1,a);if(v&&R.push(v),C){h=S,m=!0;continue}}if(c&&h.endRow!==n-1){const{hasValue:C,range:S,spanAnchor:v}=Vu(h,r,1,a);if(v&&R.push(v),C){h=S,m=!0;continue}}if(l&&h.startColumn!==0){const{hasValue:C,range:S,spanAnchor:v}=Du(h,r,1,a);if(v&&R.push(v),C){h=S,m=!0;continue}}if(u&&h.endColumn!==s-1){const{hasValue:C,range:S,spanAnchor:v}=Au(h,r,1,a);if(v&&R.push(v),C){h=S,m=!0;continue}}}return R.length>0&&(h=i.Rectangle.union(h,...R)),h}const ni=(o,e,t,n=1,s=!0,r=!0)=>{const a=i.Range.transformRange(o,e),{startRow:l,endRow:u}=a;let d=t.startRow-n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d--,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d>=l)return{...t,startRow:d,endRow:d};if(r){const h={...t,startRow:u,endRow:u};return si(o,e,h,n,s,!1)}},oi=(o,e,t,n=1,s=!0,r=!0)=>{const a=i.Range.transformRange(o,e),{startRow:l,endRow:u}=a;let d=t.endRow+n,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;for(;!e.getRowVisible(d)||!m;)d++,c=e.getMergedCell(d,t.startColumn),m=!c||c.startRow===d&&c.startColumn===t.startColumn;if(d<=u)return{...t,startRow:d,endRow:d};if(r){const h={...t,startRow:l,endRow:l};return ri(o,e,h,n,s,!1)}},si=(o,e,t,n=1,s=!0,r=!0)=>{const a=i.Range.transformRange(o,e),{startColumn:l,endColumn:u}=a;let d=t.startColumn-n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d--,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d>=l)return{...t,startColumn:d,endColumn:d};if(r){const h={...t,startColumn:u,endColumn:u};return ni(o,e,h,n,s,!1)}},ri=(o,e,t,n=1,s=!0,r=!0)=>{const a=i.Range.transformRange(o,e),{startColumn:l,endColumn:u}=a;let d=t.endColumn+n,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;for(;!e.getColVisible(d)||!m;)d++,c=e.getMergedCell(t.startRow,d),m=!c||c.startRow===t.startRow&&c.startColumn===d;if(d<=u)return{...t,endColumn:d,startColumn:d};if(r){const h={...t,startColumn:l,endColumn:l};return oi(o,e,h,n,s,!1)}};function rn(o,e,t){let n=null;return t.getMatrixWithMergedCells(o,e,o,e).forValue((r,a,l)=>(n={actualRow:r,actualColumn:a,startRow:r,startColumn:a,isMerged:l.rowSpan!==void 0||l.colSpan!==void 0,isMergedMainCell:l.rowSpan!==void 0&&l.colSpan!==void 0,endRow:r+(l.rowSpan!==void 0?l.rowSpan-1:0),endColumn:a+(l.colSpan!==void 0?l.colSpan-1:0),rangeType:i.RANGE_TYPE.NORMAL},!1)),n||{actualColumn:e,actualRow:o,startRow:o,startColumn:e,endRow:o,endColumn:e,isMerged:!1,isMergedMainCell:!1,rangeType:i.RANGE_TYPE.NORMAL}}const Lu=(o,e,t,n,s=1)=>{switch(n){case i.Direction.UP:return ni(o,e,t,s);case i.Direction.DOWN:return oi(o,e,t,s);case i.Direction.LEFT:return si(o,e,t,s);case i.Direction.RIGHT:return ri(o,e,t,s)}},Bu=(o,e,t)=>{let n,s=-1,r;for(let I=0;I<o.length;I++)if(o[I].primary){n=o[I],s=I,r=n.primary;break}if(s===-1)return null;const a=e===i.Direction.LEFT||e===i.Direction.UP,l=a?s-1>=0?s-1:o.length-1:s+1<o.length?s+1:0,u=o[l];if(!n||!r)return null;const d={...r},{startRow:c,startColumn:m,endRow:h,endColumn:R}=n.range,C=a?d.startRow===c&&d.startColumn===m:d.endRow===h&&d.endColumn===R,S=C&&a;if(!i.Rectangle.equals(n.range,d)){const I=C?u.range:Lu(n.range,t,d,e);if(!I)return null;const p=S?rn(I.endRow,I.endColumn,t):rn(I.startRow,I.startColumn,t);return{startRow:p.startRow,startColumn:p.startColumn,endRow:p.endRow,endColumn:p.endColumn}}const v=S?rn(u.range.endRow,u.range.endColumn,t):rn(u.range.startRow,u.range.startColumn,t);return{startRow:v.startRow,startColumn:v.startColumn,endRow:v.endRow,endColumn:v.endColumn}},Hu={WorkbookCommentPermission:gn,WorkbookCopyPermission:Rn,WorkbookCreateProtectPermission:Cn,WorkbookCreateSheetPermission:Sn,WorkbookDeleteSheetPermission:fn,WorkbookDuplicatePermission:vn,WorkbookEditablePermission:Vt,WorkbookExportPermission:In,WorkbookHideSheetPermission:pn,WorkbookHistoryPermission:ds,WorkbookManageCollaboratorPermission:Mn,WorkbookMoveSheetPermission:wn,WorkbookPrintPermission:yn,WorkbookRecoverHistoryPermission:_n,WorkbookRenameSheetPermission:bn,WorkbookSharePermission:Tn,WorkbookViewHistoryPermission:En,WorkbookViewPermission:Un,WorksheetCopyPermission:Pn,WorksheetDeleteColumnPermission:Nn,WorksheetDeleteProtectionPermission:kn,WorksheetDeleteRowPermission:On,WorksheetEditExtraObjectPermission:Dn,WorksheetEditPermission:Ct,WorksheetFilterPermission:An,WorksheetInsertColumnPermission:Wn,WorksheetInsertHyperlinkPermission:Vn,WorksheetInsertRowPermission:$n,WorksheetManageCollaboratorPermission:Ln,WorksheetPivotTablePermission:Bn,WorksheetSelectProtectedCellsPermission:cs,WorksheetSelectUnProtectedCellsPermission:ms,WorksheetSetCellStylePermission:Hn,WorksheetSetCellValuePermission:Fn,WorksheetSetColumnStylePermission:jn,WorksheetSetRowStylePermission:Gn,WorksheetSortPermission:qn,WorksheetViewPermission:zn,RangeProtectionPermissionEditPoint:Rt,RangeProtectionPermissionViewPoint:Wt},Fu=(o,e,t,n)=>{const s=o.get(i.IPermissionService),r=o.get(Z),a=s.getPermissionPoint(new Vt(e).id);if(!(a!=null&&a.value))return!1;const l=s.getPermissionPoint(new Ct(e,t).id);if(!(l!=null&&l.value))return!1;const d=r.getSubunitRuleList(e,t).filter(c=>c.ranges.some(m=>n.some(h=>i.Rectangle.intersects(m,h))));return d.length?d.every(c=>{const m=c.permissionId,h=s.getPermissionPoint(new Rt(e,t,m).id);return!!(h!=null&&h.value)}):!0};function ju(o,e){return e.some(t=>Gu(o,t))}function Gu(o,e){const{startRow:t,startColumn:n,endColumn:s,endRow:r}=e,a=o.getMatrixWithMergedCells(t,n,r,s);let l=!1;return a.forValue((u,d,c)=>{if(c&&(u!==t||d!==n)&&o.cellHasValue(c))return l=!0,!1}),l}function qu(o,e,t,n){const s=[],r=[],a=t.getSheetId();return n.forEach(l=>{const u=zu(t,l),d={unitId:e,subUnitId:a,cellValue:u.getData()},c=se(o,d);s.push({id:B.id,params:c}),r.push({id:B.id,params:d})}),{undos:s,redos:r}}function zu(o,e){const{startRow:t,startColumn:n,endColumn:s,endRow:r}=e,a=o.getMatrixWithMergedCells(t,n,r,s,i.CellModeEnum.Intercepted),l=new i.ObjectMatrix;return a.forValue((u,d,c)=>{c&&(u!==t||d!==n)&&l.setValue(u,d,null)}),l}const Ut={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge",handler:(o,e)=>{const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=o.get(i.IUniverInstanceService),r=e.unitId,a=e.subUnitId,l=e.selections,u=Oo(l,e.value),d=s.getUniverSheetInstance(r).getSheetBySheetId(a),c=[],m=[],h=ju(d,u),R={unitId:r,subUnitId:a,ranges:u},C={unitId:r,subUnitId:a,ranges:u};c.push({id:G.id,params:R}),c.push({id:j.id,params:C});const S=ne(o,R),v=ie(o,C);if(m.push({id:G.id,params:v}),m.push({id:j.id,params:S}),h){const p=qu(o,r,d,u);c.unshift(...p.redos),m.push(...p.undos)}return i.sequenceExecute(c,t).result?(n.pushUndoRedo({unitID:r,undoMutations:m,redoMutations:c}),!0):!1}},Yu={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-all",handler:async o=>{var d;const e=o.get(i.ICommandService),n=(d=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=o.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(Ut.id,{selections:n,unitId:l,subUnitId:u})}},Ku={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-vertical",handler:async o=>{var d;const e=o.get(i.ICommandService),n=(d=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=o.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(Ut.id,{value:i.Dimension.COLUMNS,selections:n,unitId:l,subUnitId:u})}},Ju={type:i.CommandType.COMMAND,id:"sheet.command.add-worksheet-merge-horizontal",handler:async o=>{var d;const e=o.get(i.ICommandService),n=(d=o.get(g.SheetsSelectionsService).getCurrentSelections())==null?void 0:d.map(c=>c.range);if(!(n!=null&&n.length))return!1;const r=o.get(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const a=r.getActiveSheet();if(!a)return!1;const l=r.getUnitId(),u=a.getSheetId();return e.executeCommand(Ut.id,{value:i.Dimension.ROWS,selections:n,unitId:l,subUnitId:u})}};function xu(o,e,t,n,s){const r=o.get(i.IUniverInstanceService),a=E(r,{unitId:e,subUnitId:t});if(!a)return;const{worksheet:l}=a;if(l.getMergeData().some(m=>n.some(h=>i.Rectangle.intersects(h,m))))throw new Error("The ranges to be merged overlap with the existing merged cells");o.get(i.ICommandService).syncExecuteCommand(Ut.id,{unitId:e,subUnitId:t,selections:n,defaultMerge:s})}const Xu=(o,e)=>{const r=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().rightToLeft;return{...i.Tools.deepClone(e),rightToLeft:r}},an={id:"sheet.mutation.set-worksheet-right-to-left",type:i.CommandType.MUTATION,handler:(o,e)=>{const t=o.get(i.IUniverInstanceService).getUniverSheetInstance(e.unitId);if(!t)return!1;const n=t.getSheetBySheetId(e.subUnitId);if(!n)return!1;const s=n.getConfig();return s.rightToLeft=e.rightToLeft,!0}},Zu={type:i.CommandType.COMMAND,id:"sheet.command.set-worksheet-right-to-left",handler:async(o,e)=>{var m;const t=o.get(i.ICommandService),n=o.get(i.IUndoRedoService),s=E(o.get(i.IUniverInstanceService),e);if(!s)return!1;const{unitId:r,subUnitId:a}=s;let l=i.BooleanNumber.FALSE;e&&(l=(m=e.rightToLeft)!=null?m:i.BooleanNumber.FALSE);const u={rightToLeft:l,unitId:r,subUnitId:a},d=Xu(o,u);return t.syncExecuteCommand(an.id,u)?(n.pushUndoRedo({unitID:r,undoMutations:[{id:an.id,params:d}],redoMutations:[{id:an.id,params:u}]}),!0):!1}};g.AFTER_CELL_EDIT=Et,g.AFTER_CELL_EDIT_ASYNC=Pt,g.AddMergeRedoSelectionsOperationFactory=Nu,g.AddMergeUndoMutationFactory=ie,g.AddMergeUndoSelectionsOperationFactory=ku,g.AddRangeProtectionCommand=Bo,g.AddRangeProtectionMutation=le,g.AddWorksheetMergeAllCommand=Yu,g.AddWorksheetMergeCommand=Ut,g.AddWorksheetMergeHorizontalCommand=Ju,g.AddWorksheetMergeMutation=j,g.AddWorksheetMergeVerticalCommand=Ku,g.AddWorksheetProtectionCommand=Ho,g.AddWorksheetProtectionMutation=Oe,g.BEFORE_CELL_EDIT=ln,g.BorderStyleManagerService=Le,g.COMMAND_LISTENER_SKELETON_CHANGE=bu,g.COMMAND_LISTENER_VALUE_CHANGE=Tu,g.CancelFrozenCommand=Gs,g.ClearSelectionAllCommand=kt,g.ClearSelectionContentCommand=cn,g.ClearSelectionFormatCommand=Ot,g.CopySheetCommand=hn,g.DISABLE_NORMAL_SELECTIONS=Li,g.DeleteRangeMoveLeftCommand=Je,g.DeleteRangeMoveUpCommand=xe,g.DeleteRangeProtectionCommand=Rs,g.DeleteRangeProtectionMutation=he,g.DeleteWorksheetProtectionCommand=Cs,g.DeleteWorksheetProtectionMutation=De,g.DeleteWorksheetRangeThemeStyleCommand=Ss,g.DeleteWorksheetRangeThemeStyleMutation=ze,g.DeleteWorksheetRangeThemeStyleMutationFactory=Jo,g.DeltaColumnWidthCommand=go,g.DeltaRowHeightCommand=po,g.EditStateEnum=Lo,g.EffectRefRangId=k,g.EmptyMutation=pr,g.ExclusiveRangeService=Kr,g.FactoryAddRangeProtectionMutation=li,g.FactoryDeleteRangeProtectionMutation=ai,g.FactorySetRangeProtectionMutation=_a,g.IExclusiveRangeService=Ao,g.INTERCEPTOR_POINT=Ae,g.INumfmtService=He,g.IRefSelectionsService=rs,g.InsertColAfterCommand=ys,g.InsertColBeforeCommand=ws,g.InsertColByRangeCommand=Zn,g.InsertColCommand=Te,g.InsertColMutation=ue,g.InsertColMutationUndoFactory=$t,g.InsertDefinedNameCommand=fs,g.InsertRangeMoveDownCommand=ft,g.InsertRangeMoveRightCommand=Lt,g.InsertRowAfterCommand=ps,g.InsertRowBeforeCommand=Is,g.InsertRowByRangeCommand=Xn,g.InsertRowCommand=be,g.InsertRowMutation=Ce,g.InsertRowMutationUndoFactory=Jn,g.InsertSheetCommand=_s,g.InsertSheetMutation=Ye,g.InsertSheetUndoMutationFactory=mn,g.InterceptCellContentPriority=Fo,g.MAX_CELL_PER_SHEET_KEY=Tr,g.MERGE_CELL_INTERCEPTOR_CHECK=zr,g.MoveColsCommand=Ht,g.MoveColsMutation=pe,g.MoveColsMutationUndoFactory=Ts,g.MoveRangeCommand=Ke,g.MoveRangeMutation=_e,g.MoveRowsCommand=Bt,g.MoveRowsMutation=Ie,g.MoveRowsMutationUndoFactory=bs,g.OperatorType=V,g.PermissionPointsDefinitions=Hu,g.REF_SELECTIONS_ENABLED=Qo,g.RangeMergeUtil=sl,g.RangeProtectionPermissionDeleteProtectionPoint=Co,g.RangeProtectionPermissionEditPoint=Rt,g.RangeProtectionPermissionManageCollaPoint=So,g.RangeProtectionPermissionViewPoint=Wt,g.RangeProtectionRuleModel=Z,g.RangeThemeStyle=We,g.RegisterWorksheetRangeThemeStyleCommand=Ns,g.RegisterWorksheetRangeThemeStyleMutation=Xe,g.RemoveColByRangeCommand=oo,g.RemoveColCommand=It,g.RemoveColMutation=re,g.RemoveDefinedNameCommand=Qn,g.RemoveMergeUndoMutationFactory=ne,g.RemoveNumfmtMutation=bo,g.RemoveRowByRangeCommand=to,g.RemoveRowCommand=vt,g.RemoveRowMutation=de,g.RemoveSheetCommand=jt,g.RemoveSheetMutation=$e,g.RemoveSheetUndoMutationFactory=ss,g.RemoveWorksheetMergeCommand=ks,g.RemoveWorksheetMergeMutation=G,g.ReorderRangeCommand=Gt,g.ReorderRangeMutation=pt,g.ReorderRangeUndoMutationFactory=Os,g.ResetBackgroundColorCommand=er,g.ResetTextColorCommand=Zs,g.SCOPE_WORKBOOK_VALUE_DEFINED_NAME=vl,g.SELECTIONS_ENABLED=Bi,g.SELECTION_CONTROL_BORDER_BUFFER_COLOR=Eu,g.SELECTION_CONTROL_BORDER_BUFFER_WIDTH=Uu,g.ScrollToCellOperation=_r,g.SelectionMoveType=Q,g.SetBackgroundColorCommand=Qs,g.SetBoldCommand=Pa,g.SetBorderBasicCommand=$s,g.SetBorderColorCommand=Vs,g.SetBorderCommand=Ze,g.SetBorderPositionCommand=As,g.SetBorderStyleCommand=Ws,g.SetColDataCommand=Bs,g.SetColDataMutation=Qe,g.SetColDataMutationFactory=Ls,g.SetColHiddenCommand=ro,g.SetColHiddenMutation=et,g.SetColVisibleMutation=tt,g.SetColWidthCommand=Kt,g.SetDefinedNameCommand=io,g.SetFontFamilyCommand=Aa,g.SetFontSizeCommand=Wa,g.SetFrozenCommand=js,g.SetFrozenMutation=Ue,g.SetFrozenMutationFactory=ao,g.SetGridlinesColorCommand=qs,g.SetGridlinesColorMutation=nt,g.SetHorizontalTextAlignCommand=nr,g.SetItalicCommand=Na,g.SetNumfmtMutation=Xt,g.SetOverlineCommand=Da,g.SetProtectionCommand=zs,g.SetRangeProtectionMutation=x,g.SetRangeValuesCommand=St,g.SetRangeValuesMutation=B,g.SetRangeValuesUndoMutationFactory=se,g.SetRowDataCommand=Ks,g.SetRowDataMutation=ot,g.SetRowDataMutationFactory=Ys,g.SetRowHeightCommand=Mo,g.SetRowHiddenCommand=lo,g.SetRowHiddenMutation=rt,g.SetRowVisibleMutation=st,g.SetSelectedColsVisibleCommand=Hs,g.SetSelectedRowsVisibleCommand=Js,g.SetSelectionsOperation=q,g.SetSpecificColsVisibleCommand=zt,g.SetSpecificRowsVisibleCommand=Yt,g.SetStrikeThroughCommand=Oa,g.SetStyleCommand=X,g.SetTabColorCommand=rr,g.SetTabColorMutation=Mt,g.SetTextColorCommand=Xs,g.SetTextRotationCommand=sr,g.SetTextWrapCommand=or,g.SetUnderlineCommand=ka,g.SetVerticalTextAlignCommand=tr,g.SetWorkbookNameCommand=co,g.SetWorkbookNameMutation=uo,g.SetWorksheetActivateCommand=mo,g.SetWorksheetActiveOperation=it,g.SetWorksheetColWidthMutation=Me,g.SetWorksheetColWidthMutationFactory=ho,g.SetWorksheetDefaultStyleCommand=ar,g.SetWorksheetDefaultStyleMutation=at,g.SetWorksheetDefaultStyleMutationFactory=ir,g.SetWorksheetHideCommand=ur,g.SetWorksheetHideMutation=Ee,g.SetWorksheetNameCommand=Ro,g.SetWorksheetNameMutation=Jt,g.SetWorksheetOrderCommand=dr,g.SetWorksheetOrderMutation=wt,g.SetWorksheetPermissionPointsCommand=mr,g.SetWorksheetPermissionPointsMutation=fo,g.SetWorksheetProtectionCommand=hr,g.SetWorksheetProtectionMutation=Be,g.SetWorksheetRangeThemeStyleCommand=xo,g.SetWorksheetRangeThemeStyleMutation=qe,g.SetWorksheetRangeThemeStyleMutationFactory=Ko,g.SetWorksheetRightToLeftCommand=Zu,g.SetWorksheetRightToLeftMutation=an,g.SetWorksheetRowAutoHeightMutation=Io,g.SetWorksheetRowAutoHeightMutationFactory=Xa,g.SetWorksheetRowHeightMutation=ye,g.SetWorksheetRowIsAutoHeightCommand=wo,g.SetWorksheetRowIsAutoHeightMutation=ae,g.SetWorksheetShowCommand=Rr,g.SplitTextToColumnsCommand=Sr,g.ToggleCellCheckboxCommand=fr,g.ToggleGridlinesCommand=vr,g.ToggleGridlinesMutation=ut,g.UnitAction=_,g.UnitObject=D,g.UnregisterWorksheetRangeThemeStyleCommand=Ir,g.UnregisterWorksheetRangeThemeStyleMutation=Ft,g.ViewStateEnum=$o,g.WorkbookCommentPermission=gn,g.WorkbookCopyPermission=Rn,g.WorkbookCopySheetPermission=us,g.WorkbookCreateProtectPermission=Cn,g.WorkbookCreateSheetPermission=Sn,g.WorkbookDeleteSheetPermission=fn,g.WorkbookDuplicatePermission=vn,g.WorkbookEditablePermission=Vt,g.WorkbookExportPermission=In,g.WorkbookHideSheetPermission=pn,g.WorkbookHistoryPermission=ds,g.WorkbookManageCollaboratorPermission=Mn,g.WorkbookMoveSheetPermission=wn,g.WorkbookPrintPermission=yn,g.WorkbookRecoverHistoryPermission=_n,g.WorkbookRenameSheetPermission=bn,g.WorkbookSelectionModel=Zo,g.WorkbookSharePermission=Tn,g.WorkbookViewHistoryPermission=En,g.WorkbookViewPermission=Un,g.WorksheetCopyPermission=Pn,g.WorksheetDeleteColumnPermission=Nn,g.WorksheetDeleteProtectionPermission=kn,g.WorksheetDeleteRowPermission=On,g.WorksheetEditExtraObjectPermission=Dn,g.WorksheetEditPermission=Ct,g.WorksheetFilterPermission=An,g.WorksheetInsertColumnPermission=Wn,g.WorksheetInsertHyperlinkPermission=Vn,g.WorksheetInsertRowPermission=$n,g.WorksheetManageCollaboratorPermission=Ln,g.WorksheetPivotTablePermission=Bn,g.WorksheetProtectionPointModel=yt,g.WorksheetProtectionRuleModel=ke,g.WorksheetSelectProtectedCellsPermission=cs,g.WorksheetSelectUnProtectedCellsPermission=ms,g.WorksheetSetCellStylePermission=Hn,g.WorksheetSetCellValuePermission=Fn,g.WorksheetSetColumnStylePermission=jn,g.WorksheetSetRowStylePermission=Gn,g.WorksheetSortPermission=qn,g.WorksheetViewPermission=zn,g.addMergeCellsUtil=xu,g.adjustRangeOnMutation=Lr,g.alignToMergedCellsBorders=ht,g.baseProtectionActions=cr,g.checkRangesEditablePermission=Fu,g.convertPrimaryWithCoordToPrimary=ei,g.convertSelectionDataToRange=Pu,g.copyRangeStyles=gt,g.createTopMatrixFromMatrix=wr,g.createTopMatrixFromRanges=Mr,g.defaultWorkbookPermissionPoints=ja,g.defaultWorksheetPermissionPoint=Ga,g.expandToContinuousRange=$u,g.factoryRemoveNumfmtUndoMutation=il,g.factorySetNumfmtUndoMutation=rl,g.findAllRectangle=yo,g.followSelectionOperation=Re,g.generateNullCell=un,g.generateNullCellValue=Xo,g.getAddMergeMutationRangeByType=Oo,g.getAllRangePermissionPoint=Se,g.getAllWorkbookPermissionPoint=xt,g.getAllWorksheetPermissionPoint=we,g.getAllWorksheetPermissionPointByPointPanel=lt,g.getCellAtRowCol=ea,g.getDefaultRangePermission=Fa,g.getInsertRangeMutations=Yn,g.getMoveRangeUndoRedoMutations=Dt,g.getNextPrimaryCell=Bu,g.getPrimaryForRange=te,g.getRemoveRangeMutations=Kn,g.getSelectionsService=is,g.getSeparateEffectedRangesOnCommand=Wl,g.getSheetCommandTarget=E,g.getSheetCommandTargetWorkbook=Yo,g.getSheetMutationTarget=Ve,g.handleBaseInsertRange=je,g.handleBaseMoveRowsCols=_t,g.handleBaseRemoveRange=Fe,g.handleCommonDefaultRangeChangeWithEffectRefCommands=ko,g.handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests=Dl,g.handleDefaultRangeChangeWithEffectRefCommands=No,g.handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests=Ol,g.handleDeleteRangeMoveLeft=Vr,g.handleDeleteRangeMoveUp=$r,g.handleDeleteRangeMutation=ia,g.handleIRemoveCol=Po,g.handleIRemoveRow=kr,g.handleInsertCol=Dr,g.handleInsertRangeMoveDown=Ar,g.handleInsertRangeMoveRight=Wr,g.handleInsertRangeMutation=ra,g.handleInsertRow=Or,g.handleMoveCols=Eo,g.handleMoveRange=Nr,g.handleMoveRows=Uo,g.isSingleCellSelection=na,g.rangeMerge=_o,g.rotateRange=oe,g.runRefRangeMutations=Ge,g.setEndForRange=ta,g.splitRangeText=Cr,g.transformCellsToRange=Zt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
// @univerjs/sheets/facade
|
|
16
|
-
(function(m,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula","@univerjs/sheets"],r):(m=typeof globalThis<"u"?globalThis:m||self,r(m.UniverSheetsFacade={},m.UniverCore,m.UniverEngineFormula,m.UniverSheets))})(this,function(m,r,_,a){"use strict";var re=Object.defineProperty;var se=(m,r,_)=>r in m?re(m,r,{enumerable:!0,configurable:!0,writable:!0,value:_}):m[r]=_;var C=(m,r,_)=>se(m,typeof r!="symbol"?r+"":r,_);var N=Object.defineProperty,E=Object.getOwnPropertyDescriptor,F=(h,i,e,t)=>{for(var n=t>1?void 0:t?E(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&N(i,e,n),n},w=(h,i)=>(e,t)=>i(e,t,h);function j(h,i,e){const t=e.getDefinedNameMap(h);if(t==null)return i.t("definedName.defaultName")+1;const o=Array.from(Object.values(t)).length+1,s=i.t("definedName.defaultName")+o;if(e.getValueByName(h,s)==null)return s;let d=o+1;for(;;){const c=i.t("definedName.defaultName")+d;if(e.getValueByName(h,c)==null)return c;d++}}class I{constructor(){C(this,"_definedNameParam");this._definedNameParam={id:r.generateRandomId(10),unitId:"",name:"",formulaOrRefString:""}}setName(i){return this._definedNameParam.name=i,this}setFormula(i){return this._definedNameParam.formulaOrRefString=`=${i}`,this}setRef(i){return this._definedNameParam.formulaOrRefString=i,this}setRefByRange(i,e,t,n){return this._definedNameParam.formulaOrRefString=_.serializeRange({startRow:i,endRow:i+(t!=null?t:1)-1,startColumn:e,endColumn:e+(n!=null?n:1)-1}),this}setComment(i){return this._definedNameParam.comment=i,this}setHidden(i){return this._definedNameParam.hidden=i,this}build(){return this._definedNameParam}load(i){return this._definedNameParam=i,this}}let f=class extends r.FBase{constructor(h,i,e,t,n,o,s,d,c,u){super(),this._definedNameParam=h,this._injector=i,this._commandService=e,this._permissionService=t,this._worksheetProtectionRuleModel=n,this._rangeProtectionRuleModel=o,this._worksheetProtectionPointRuleModel=s,this._authzIoService=d,this._localeService=c,this._definedNamesService=u}_apply(){this._definedNameParam.name===""&&(this._definedNameParam.name=j(this._definedNameParam.unitId,this._localeService,this._definedNamesService)),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,this._definedNameParam)}getName(){return this._definedNameParam.name}setName(h){this._definedNameParam.name=h,this._apply()}setFormula(h){this._definedNameParam.formulaOrRefString=`=${h}`,this._apply()}setRef(h){this._definedNameParam.formulaOrRefString=h,this._apply()}getFormulaOrRefString(){return this._definedNameParam.formulaOrRefString}setRefByRange(h,i,e,t){this._definedNameParam.formulaOrRefString=_.serializeRange({startRow:h,endRow:h+(e!=null?e:1)-1,startColumn:i,endColumn:i+(t!=null?t:1)-1}),this._apply()}getComment(){return this._definedNameParam.comment}setComment(h){this._definedNameParam.comment=h,this._apply()}setScopeToWorksheet(h){this._definedNameParam.localSheetId=h.getSheetId(),this._apply()}setScopeToWorkbook(){this._definedNameParam.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this._apply()}setHidden(h){this._definedNameParam.hidden=h,this._apply()}delete(){this._commandService.syncExecuteCommand(a.RemoveDefinedNameCommand.id,this._definedNameParam)}getLocalSheetId(){return this._definedNameParam.localSheetId}isWorkbookScope(){return this._definedNameParam.localSheetId===a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}toBuilder(){const h=this._injector.createInstance(I);return h.load(this._definedNameParam),h}};f=F([w(1,r.Inject(r.Injector)),w(2,r.ICommandService),w(3,r.IPermissionService),w(4,r.Inject(a.WorksheetProtectionRuleModel)),w(5,r.Inject(a.RangeProtectionRuleModel)),w(6,r.Inject(a.WorksheetProtectionPointModel)),w(7,r.Inject(r.IAuthzIoService)),w(8,r.Inject(r.LocaleService)),w(9,_.IDefinedNamesService)],f);var W=Object.defineProperty,A=Object.getOwnPropertyDescriptor,D=(h,i,e,t)=>{for(var n=t>1?void 0:t?A(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&W(i,e,n),n},k=(h,i)=>(e,t)=>i(e,t,h);m.FPermission=class extends r.FBase{constructor(e,t,n,o,s,d,c){super();C(this,"permissionPointsDefinition",a.PermissionPointsDefinitions);this._injector=e,this._commandService=t,this._permissionService=n,this._worksheetProtectionRuleModel=o,this._rangeProtectionRuleModel=s,this._worksheetProtectionPointRuleModel=d,this._authzIoService=c}setWorkbookPermissionPoint(e,t,n){const o=new t(e);this._permissionService.getPermissionPoint(o.id)||this._permissionService.addPermissionPoint(o),this._permissionService.updatePermissionPoint(o.id,n)}setWorkbookEditPermission(e,t){this.setWorkbookPermissionPoint(e,a.WorkbookEditablePermission,t)}async addWorksheetBasePermission(e,t){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");const o=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}});if(this._commandService.syncExecuteCommand(a.AddWorksheetProtectionMutation.id,{unitId:e,subUnitId:t,rule:{permissionId:o,unitType:a.UnitObject.Worksheet,unitId:e,subUnitId:t}}))return o}removeWorksheetPermission(e,t){this._commandService.syncExecuteCommand(a.DeleteWorksheetProtectionMutation.id,{unitId:e,subUnitId:t}),[...a.getAllWorksheetPermissionPoint(),...a.getAllWorksheetPermissionPointByPointPanel()].forEach(n=>{const o=new n(e,t);this._permissionService.updatePermissionPoint(o.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e,t)}async setWorksheetPermissionPoint(e,t,n,o){const s=this._worksheetProtectionRuleModel.getRule(e,t);let d;if(n===a.WorksheetEditPermission||n===a.WorksheetViewPermission)if(s)d=s.permissionId;else{if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");d=await this.addWorksheetBasePermission(e,t)}else{const g=this._worksheetProtectionPointRuleModel.getRule(e,t);g?d=g.permissionId:(d=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}}),this._commandService.executeCommand(a.SetWorksheetPermissionPointsMutation.id,{unitId:e,subUnitId:t,permissionId:d}))}const u=new n(e,t);return this._permissionService.getPermissionPoint(u.id)||this._permissionService.addPermissionPoint(u),this._permissionService.updatePermissionPoint(u.id,o),d}async addRangeBaseProtection(e,t,n){const o=await this._authzIoService.create({objectType:a.UnitObject.SelectRange,selectRangeObject:{collaborators:[],unitID:e,name:"",scope:void 0}}),s=`ruleId_${r.generateRandomId(6)}`;if(this._worksheetProtectionRuleModel.getRule(e,t))throw new Error("sheet protection cannot intersect with range protection");if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).some(g=>g.ranges.some(U=>n.some(R=>r.Rectangle.intersects(R,U)))))throw new Error("range protection cannot intersect");if(this._commandService.syncExecuteCommand(a.AddRangeProtectionMutation.id,{unitId:e,subUnitId:t,rules:[{permissionId:o,unitType:a.UnitObject.SelectRange,unitId:e,subUnitId:t,ranges:n,id:s}]}))return{permissionId:o,ruleId:s}}removeRangeProtection(e,t,n){this._commandService.syncExecuteCommand(a.DeleteRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleIds:n})&&this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e,t),[...a.getAllWorksheetPermissionPointByPointPanel()].forEach(d=>{const c=new d(e,t);this._permissionService.updatePermissionPoint(c.id,c.value)}))}setRangeProtectionPermissionPoint(e,t,n,o,s){const d=new o(e,t,n);this._permissionService.getPermissionPoint(d.id)||this._permissionService.addPermissionPoint(d),this._permissionService.updatePermissionPoint(d.id,s)}setRangeProtectionRanges(e,t,n,o){const s=this._rangeProtectionRuleModel.getRule(e,t,n);if(s){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).filter(u=>u.id!==n).some(u=>u.ranges.some(l=>o.some(g=>r.Rectangle.intersects(g,l)))))throw new Error("range protection cannot intersect");this._commandService.syncExecuteCommand(a.SetRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleId:n,rule:{...s,ranges:o}})}}setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}},m.FPermission=D([k(0,r.Inject(r.Injector)),k(1,r.ICommandService),k(2,r.IPermissionService),k(3,r.Inject(a.WorksheetProtectionRuleModel)),k(4,r.Inject(a.RangeProtectionRuleModel)),k(5,r.Inject(a.WorksheetProtectionPointModel)),k(6,r.Inject(r.IAuthzIoService))],m.FPermission);function O(h){switch(h){case"left":return r.HorizontalAlign.LEFT;case"center":return r.HorizontalAlign.CENTER;case"normal":return r.HorizontalAlign.RIGHT;default:throw new Error(`Invalid horizontal alignment: ${h}`)}}function M(h){switch(h){case r.HorizontalAlign.LEFT:return"left";case r.HorizontalAlign.CENTER:return"center";case r.HorizontalAlign.RIGHT:return"normal";default:throw new Error(`Invalid horizontal alignment: ${h}`)}}function T(h){switch(h){case"top":return r.VerticalAlign.TOP;case"middle":return r.VerticalAlign.MIDDLE;case"bottom":return r.VerticalAlign.BOTTOM;default:throw new Error(`Invalid vertical alignment: ${h}`)}}function x(h){switch(h){case r.VerticalAlign.TOP:return"top";case r.VerticalAlign.MIDDLE:return"middle";case r.VerticalAlign.BOTTOM:return"bottom";default:throw new Error(`Invalid vertical alignment: ${h}`)}}function b(h){return r.isFormulaString(h)?{f:h}:r.isCellV(h)?{v:h}:(r.isICellData(h),h)}function B(h,i){const e=new r.ObjectMatrix,{startRow:t,startColumn:n,endRow:o,endColumn:s}=i;if(r.Tools.isArray(h))for(let d=0;d<=o-t;d++)for(let c=0;c<=s-n;c++)e.setValue(d+t,c+n,b(h[d][c]));else new r.ObjectMatrix(h).forValue((c,u,l)=>{e.setValue(c,u,b(l))});return e.getMatrix()}function P(h,i){return{startRow:h.startRow,endRow:h.endRow,startColumn:0,endColumn:i.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW}}function y(h,i){return{startRow:0,endRow:i.getRowCount()-1,startColumn:h.startColumn,endColumn:h.endColumn,rangeType:r.RANGE_TYPE.COLUMN}}var L=Object.defineProperty,V=Object.getOwnPropertyDescriptor,z=(h,i,e,t)=>{for(var n=t>1?void 0:t?V(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&L(i,e,n),n},p=(h,i)=>(e,t)=>i(e,t,h);m.FRange=class extends r.FBase{constructor(i,e,t,n,o,s){super(),this._workbook=i,this._worksheet=e,this._range=t,this._injector=n,this._commandService=o,this._formulaDataModel=s}getUnitId(){return this._workbook.getUnitId()}getSheetName(){return this._worksheet.getName()}getRange(){return this._range}getRow(){return this._range.startRow}getColumn(){return this._range.startColumn}getWidth(){return this._range.endColumn-this._range.startColumn+1}getHeight(){return this._range.endRow-this._range.startRow+1}getCellData(){var i;return(i=this._worksheet.getCell(this._range.startRow,this._range.startColumn))!=null?i:null}isMerged(){const{startColumn:i,startRow:e,endColumn:t,endRow:n}=this._range;return this._worksheet.getMergedCellRange(e,i,n,t).some(s=>r.Rectangle.equals(s,this._range))}getCellStyleData(){var t;const i=this.getCellData(),e=this._workbook.getStyles();return i&&e&&(t=e.getStyleByCell(i))!=null?t:null}getValue(){var i,e;return(e=(i=this._worksheet.getCell(this._range.startRow,this._range.startColumn))==null?void 0:i.v)!=null?e:null}getValues(){var s,d;const{startRow:i,endRow:e,startColumn:t,endColumn:n}=this._range,o=[];for(let c=i;c<=e;c++){const u=[];for(let l=t;l<=n;l++)u.push((d=(s=this._worksheet.getCell(c,l))==null?void 0:s.v)!=null?d:null);o.push(u)}return o}getCellDataGrid(){const{startRow:i,endRow:e,startColumn:t,endColumn:n}=this._range,o=[];for(let s=i;s<=e;s++){const d=[];for(let c=t;c<=n;c++)d.push(this._worksheet.getCellRaw(s,c));o.push(d)}return o}getFormulas(){const i=[],{startRow:e,endRow:t,startColumn:n,endColumn:o}=this._range,s=this._worksheet.getSheetId(),d=this._workbook.getUnitId();for(let c=e;c<=t;c++){const u=[];for(let l=n;l<=o;l++){const g=this._formulaDataModel.getFormulaStringByCell(c,l,s,d);u.push(g||"")}i.push(u)}return i}getWrap(){return this._worksheet.getRange(this._range).getWrap()===r.BooleanNumber.TRUE}getWrapStrategy(){return this._worksheet.getRange(this._range).getWrapStrategy()}getHorizontalAlignment(){return M(this._worksheet.getRange(this._range).getHorizontalAlignment())}getVerticalAlignment(){return x(this._worksheet.getRange(this._range).getVerticalAlignment())}setBackgroundColor(i){return this._commandService.executeCommand(a.SetStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:{type:"bg",value:{rgb:i}}})}setBackground(i){return this.setBackgroundColor(i)}setValue(i){const e=b(i);if(!e)throw new Error("Invalid value");return this._commandService.executeCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e})}setWrap(i){return this._commandService.executeCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:i?r.WrapStrategy.WRAP:r.WrapStrategy.UNSPECIFIED})}setWrapStrategy(i){return this._commandService.executeCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:i})}setVerticalAlignment(i){return this._commandService.executeCommand(a.SetVerticalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:T(i)})}setHorizontalAlignment(i){return this._commandService.executeCommand(a.SetHorizontalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:O(i)})}setValues(i){const e=B(i,this._range);return this._commandService.executeCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e})}setFontWeight(i){let e;if(i==="bold")e=r.BooleanNumber.TRUE;else if(i==="normal")e=r.BooleanNumber.FALSE;else if(i===null)e=null;else throw new Error("Invalid fontWeight");const t={type:"bl",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.executeCommand(a.SetStyleCommand.id,n),this}setFontStyle(i){let e;if(i==="italic")e=r.BooleanNumber.TRUE;else if(i==="normal")e=r.BooleanNumber.FALSE;else if(i===null)e=null;else throw new Error("Invalid fontStyle");const t={type:"it",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.executeCommand(a.SetStyleCommand.id,n),this}setFontLine(i){if(i==="underline")this._setFontUnderline({s:r.BooleanNumber.TRUE});else if(i==="line-through")this._setFontStrikethrough({s:r.BooleanNumber.TRUE});else if(i==="none")this._setFontUnderline({s:r.BooleanNumber.FALSE}),this._setFontStrikethrough({s:r.BooleanNumber.FALSE});else if(i===null)this._setFontUnderline(null),this._setFontStrikethrough(null);else throw new Error("Invalid fontLine");return this}_setFontUnderline(i){const e={type:"ul",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.executeCommand(a.SetStyleCommand.id,t)}_setFontStrikethrough(i){const e={type:"st",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.executeCommand(a.SetStyleCommand.id,t)}setFontFamily(i){const e={type:"ff",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.executeCommand(a.SetStyleCommand.id,t),this}setFontSize(i){const e={type:"fs",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.executeCommand(a.SetStyleCommand.id,t),this}setFontColor(i){const t={type:"cl",value:i===null?null:{rgb:i}},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.executeCommand(a.SetStyleCommand.id,n),this}async merge(i=!0){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId();return await a.addMergeCellsUtil(this._injector,e,t,[this._range],i),this}async mergeAcross(i=!0){const e=a.getAddMergeMutationRangeByType([this._range],r.Dimension.ROWS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return await a.addMergeCellsUtil(this._injector,t,n,e,i),this}async mergeVertically(i=!0){const e=a.getAddMergeMutationRangeByType([this._range],r.Dimension.COLUMNS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return await a.addMergeCellsUtil(this._injector,t,n,e,i),this}isPartOfMerge(){const{startRow:i,startColumn:e,endRow:t,endColumn:n}=this._range;return this._worksheet.getMergedCellRange(i,e,t,n).length>0}breakApart(){return this._commandService.executeCommand(a.RemoveWorksheetMergeCommand.id,{ranges:[this._range]}),this}forEach(i){const{startColumn:e,startRow:t,endColumn:n,endRow:o}=this._range;this._worksheet.getMatrixWithMergedCells(t,e,o,n).forValue((s,d,c)=>{i(s,d,c)})}getA1Notation(i){return i?_.serializeRangeWithSheet(this._worksheet.getName(),this._range):_.serializeRange(this._range)}activate(){return this._injector.createInstance(m.FWorkbook,this._workbook).setActiveRange(this),this}activateAsCurrentCell(){const i=this._worksheet.getMergedCell(this._range.startRow,this._range.startColumn);if(i&&r.Rectangle.equals(i,this._range)||!i&&this._range.startRow===this._range.endRow&&this._range.startColumn===this._range.endColumn)return this.activate();throw new Error("The range is not a single cell")}splitTextToColumns(i,e,t){this._commandService.executeCommand(a.SplitTextToColumnsCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,delimiter:e,customDelimiter:t,treatMultipleDelimitersAsOne:i})}},m.FRange=z([p(3,r.Inject(r.Injector)),p(4,r.ICommandService),p(5,r.Inject(_.FormulaDataModel))],m.FRange);var H=Object.defineProperty,$=Object.getOwnPropertyDescriptor,G=(h,i,e,t)=>{for(var n=t>1?void 0:t?$(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&H(i,e,n),n},Y=(h,i)=>(e,t)=>i(e,t,h);m.FSelection=class{constructor(i,e,t,n){this._workbook=i,this._worksheet=e,this._selections=t,this._injector=n}getActiveRange(){const i=this._selections.find(e=>!!e.primary);return i?this._injector.createInstance(m.FRange,this._workbook,this._worksheet,i.range):null}getActiveRangeList(){return this._selections.map(i=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,i.range))}getCurrentCell(){const i=this._selections.find(e=>!!e.primary);return i?i.primary:null}getActiveSheet(){const i=this._injector.createInstance(m.FWorkbook,this._workbook);return this._injector.createInstance(m.FWorksheet,i,this._workbook,this._worksheet)}async updatePrimaryCell(i){const e=this._injector.get(r.ICommandService);let t=[],n=!1;for(const{range:s,style:d}of this._selections)r.Rectangle.contains(s,i.getRange())?(t.push({range:s,primary:a.getPrimaryForRange(i.getRange(),this._worksheet),style:d}),n=!0):t.push({range:s,primary:null,style:d});n||(t=[{range:i.getRange(),primary:a.getPrimaryForRange(i.getRange(),this._worksheet)}]);const o={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),selections:t};return await e.syncExecuteCommand(a.SetSelectionsOperation.id,o),new m.FSelection(this._workbook,this._worksheet,t,this._injector)}getNextDataRange(i){if(!this._selections.find(n=>!!n.primary))return null;const t=a.getNextPrimaryCell(this._selections.concat(),i,this._worksheet);return t?this._injector.createInstance(m.FRange,this._workbook,this._worksheet,t):null}},m.FSelection=G([Y(3,r.Inject(r.Injector))],m.FSelection);var q=Object.defineProperty,K=Object.getOwnPropertyDescriptor,J=(h,i,e,t)=>{for(var n=t>1?void 0:t?K(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&q(i,e,n),n},v=(h,i)=>(e,t)=>i(e,t,h);m.FWorksheet=class extends r.FBase{constructor(e,t,n,o,s,d,c){super();C(this,"setActiveSelection",this.setActiveRange);this._fWorkbook=e,this._workbook=t,this._worksheet=n,this._injector=o,this._selectionManagerService=s,this._logService=d,this._commandService=c}getInject(){return this._injector}getWorkbook(){return this._workbook}getSheetId(){return this._worksheet.getSheetId()}getSheetName(){return this._worksheet.getName()}getSelection(){const e=this._selectionManagerService.getCurrentSelections();return e?this._injector.createInstance(m.FSelection,this._workbook,this._worksheet,e):null}getDefaultStyle(){return this._worksheet.getDefaultCellStyle()}getRowDefaultStyle(e,t=!1){return this._worksheet.getRowStyle(e,t)}getColumnDefaultStyle(e,t=!1){return this._worksheet.getColumnStyle(e,t)}async setDefaultStyle(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return await this._commandService.executeCommand(a.SetWorksheetDefaultStyleMutation.id,{unitId:t,subUnitId:n,defaultStyle:e}),this._worksheet.setDefaultCellStyle(e),this}async setColumnDefaultStyle(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={unitId:n,subUnitId:o,columnData:{[e]:{s:t}}};return await this._commandService.executeCommand(a.SetColDataCommand.id,s),this}async setRowDefaultStyle(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={unitId:n,subUnitId:o,rowData:{[e]:{s:t}}};return await this._commandService.executeCommand(a.SetRowDataCommand.id,s),this}getRange(e,t,n,o){let s,d;if(typeof e=="string"){const{range:c,sheetName:u}=_.deserializeRangeWithSheet(e),l=u?this._workbook.getSheetBySheetName(u):this._worksheet;if(!l)throw new Error("Range not found");d=l,s={...c,unitId:this._workbook.getUnitId(),sheetId:d.getSheetId(),rangeType:r.RANGE_TYPE.NORMAL,startRow:c.rangeType===r.RANGE_TYPE.COLUMN?0:c.startRow,endRow:c.rangeType===r.RANGE_TYPE.COLUMN?d.getMaxRows()-1:c.endRow,startColumn:c.rangeType===r.RANGE_TYPE.ROW?0:c.startColumn,endColumn:c.rangeType===r.RANGE_TYPE.ROW?d.getMaxColumns()-1:c.endColumn}}else if(typeof e=="number"&&t!==void 0)d=this._worksheet,s={startRow:e,endRow:e+(n!=null?n:1)-1,startColumn:t,endColumn:t+(o!=null?o:1)-1,unitId:this._workbook.getUnitId(),sheetId:this._worksheet.getSheetId()};else throw new Error("Invalid range specification");return this._injector.createInstance(m.FRange,this._workbook,d,s)}getMaxColumns(){return this._worksheet.getMaxColumns()}getMaxRows(){return this._worksheet.getMaxRows()}async insertRowAfter(e){return this.insertRowsAfter(e,1)}async insertRowBefore(e){return this.insertRowsBefore(e,1)}async insertRows(e,t=1){return this.insertRowsBefore(e,t)}async insertRowsAfter(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.DOWN,d=e+1,c=e+t,u=0,l=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!0,e);return await this._commandService.executeCommand(a.InsertRowCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}async insertRowsBefore(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.UP,d=e,c=e+t-1,u=0,l=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!0,e-1);return await this._commandService.executeCommand(a.InsertRowCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}async deleteRow(e){return this.deleteRows(e,1)}async deleteRows(e,t){const n={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return await this._commandService.executeCommand(a.RemoveRowCommand.id,{range:n}),this}async moveRows(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=P(e.getRange(),this._worksheet),d=s,c={startRow:t,endRow:t,startColumn:s.startColumn,endColumn:s.endColumn};return await this._commandService.executeCommand(a.MoveRowsCommand.id,{unitId:n,subUnitId:o,range:s,fromRange:d,toRange:c}),this}async hideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=P(e.getRange(),this._worksheet);return await this._commandService.executeCommand(a.SetRowHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}async hideRows(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW};return await this._commandService.executeCommand(a.SetRowHiddenCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}async unhideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=P(e.getRange(),this._worksheet);return await this._commandService.executeCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}async showRows(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW};return await this._commandService.executeCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}async setRowHeight(e,t){return this.setRowHeights(e,1,t)}async setRowHeights(e,t,n){var l;const o=this._workbook.getUnitId(),s=this._worksheet.getSheetId(),d=this._worksheet.getRowManager(),c=[],u=[];for(let g=e;g<e+t;g++){const U=((l=d.getRow(g))==null?void 0:l.ah)||this._worksheet.getConfig().defaultRowHeight,R={startRow:g,endRow:g,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};n<=U?c.push(R):u.push(R)}return u.length>0&&await this._commandService.executeCommand(a.SetRowHeightCommand.id,{unitId:o,subUnitId:s,ranges:u,value:n}),c.length>0&&await this._commandService.executeCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:o,subUnitId:s,ranges:c}),this}async setRowHeightsForced(e,t,n){const o=this._workbook.getUnitId(),s=this._worksheet.getSheetId(),d=[{startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return await this._commandService.executeCommand(a.SetRowHeightCommand.id,{unitId:o,subUnitId:s,ranges:d,value:n}),this}async setRowCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o={};for(const[d,c]of Object.entries(e))o[Number(d)]={custom:c};const s={unitId:t,subUnitId:n,rowData:o};return await this._commandService.executeCommand(a.SetRowDataCommand.id,s),this}async insertColumnAfter(e){return this.insertColumnsAfter(e,1)}async insertColumnBefore(e){return this.insertColumnsBefore(e,1)}async insertColumns(e,t=1){return this.insertColumnsBefore(e,t)}async insertColumnsAfter(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.RIGHT,d=0,c=this._worksheet.getRowCount()-1,u=e+1,l=e+t,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!1,e);return await this._commandService.executeCommand(a.InsertColCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}async insertColumnsBefore(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.LEFT,d=0,c=this._worksheet.getRowCount()-1,u=e,l=e+t-1,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!1,e-1);return await this._commandService.executeCommand(a.InsertColCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}async deleteColumn(e){return this.deleteColumns(e,1)}async deleteColumns(e,t){const n={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1};return await this._commandService.executeCommand(a.RemoveColCommand.id,{range:n}),this}async moveColumns(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=y(e.getRange(),this._worksheet),d=s,c={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:t,endColumn:t};return await this._commandService.executeCommand(a.MoveColsCommand.id,{unitId:n,subUnitId:o,range:s,fromRange:d,toRange:c}),this}async hideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=y(e.getRange(),this._worksheet);return await this._commandService.executeCommand(a.SetColHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}async hideColumns(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:r.RANGE_TYPE.COLUMN};return await this._commandService.executeCommand(a.SetColHiddenCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}async unhideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=y(e.getRange(),this._worksheet);return await this._commandService.executeCommand(a.SetSpecificColsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}async showColumns(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:r.RANGE_TYPE.COLUMN};return await this._commandService.executeCommand(a.SetSpecificColsVisibleCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}async setColumnWidth(e,t){return this.setColumnWidths(e,1,t)}async setColumnWidths(e,t,n){const o=this._workbook.getUnitId(),s=this._worksheet.getSheetId(),d=[{startColumn:e,endColumn:e+t-1,startRow:0,endRow:this._worksheet.getRowCount()-1}];return await this._commandService.executeCommand(a.SetColWidthCommand.id,{unitId:o,subUnitId:s,ranges:d,value:n}),this}async setColumnCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o={};for(const[d,c]of Object.entries(e))o[Number(d)]={custom:c};const s={unitId:t,subUnitId:n,columnData:o};return await this._commandService.executeCommand(a.SetColDataCommand.id,s),this}getMergedRanges(){return this._worksheet.getSnapshot().mergeData.map(t=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,t))}getCellMergeData(e,t){const o=this._worksheet.getMergedCell(e,t);if(o)return this._injector.createInstance(m.FRange,this._workbook,this._worksheet,o)}getActiveRange(){return this._fWorkbook.getActiveRange()}setActiveRange(e){const{unitId:t,sheetId:n}=e.getRange();if(t!==this._workbook.getUnitId()||n!==this._worksheet.getSheetId())throw new Error("Specified range must be part of the sheet.");this._fWorkbook.setActiveRange(e)}setFreeze(e){return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{...e,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}cancelFreeze(){return this._commandService.syncExecuteCommand(a.CancelFrozenCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}getFreeze(){return this._worksheet.getFreeze()}setFrozenColumns(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startColumn:n>0?n:-1,xSplit:n})}else if(arguments.length===2){let[n=0,o=0]=e;n>o&&([n,o]=[o,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startColumn:o+1,xSplit:o-n+1,startRow:t.startRow,ySplit:t.ySplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}}setFrozenRows(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startRow:n>0?n:-1,ySplit:n})}else if(arguments.length===2){let[n=0,o=0]=e;n>o&&([n,o]=[o,n]),this._commandService.syncExecuteCommand,this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startRow:o+1,ySplit:o-n+1,startColumn:t.startColumn,xSplit:t.xSplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}}getFrozenColumns(){const e=this.getFreeze();return e.startColumn===-1?0:e.startColumn}getFrozenRows(){const e=this.getFreeze();return e.startRow===-1?0:e.startRow}getFrozenRowRange(){const e=this._worksheet.getFreeze();return{startRow:e.startRow-e.ySplit,endRow:e.startRow-1}}getFrozenColumnRange(){const e=this._worksheet.getFreeze();return{startColumn:e.startColumn-e.xSplit,endColumn:e.startColumn-1}}hasHiddenGridLines(){return this._worksheet.getConfig().showGridlines===r.BooleanNumber.FALSE}setHiddenGridlines(e){return this._commandService.executeCommand(a.ToggleGridlinesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),showGridlines:e?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE})}setGridLinesColor(e){return this._commandService.executeCommand(a.SetGridlinesColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),color:e})}getGridLinesColor(){return this._worksheet.getGridlinesColor()}setTabColor(e){return this._commandService.executeCommand(a.SetTabColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),color:e})}getTabColor(){return this._worksheet.getTabColor()}onCellDataChange(e){return this._injector.get(r.ICommandService).onCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const o=n.params;o.unitId===this._workbook.getUnitId()&&o.subUnitId===this._worksheet.getSheetId()&&o.cellValue&&e(new r.ObjectMatrix(o.cellValue))}})}onBeforeCellDataChange(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const o=n.params;o.unitId===this._workbook.getUnitId()&&o.subUnitId===this._worksheet.getSheetId()&&o.cellValue&&e(new r.ObjectMatrix(o.cellValue))}})}hideSheet(){const e=this._injector.get(r.ICommandService);if(this._workbook.getSheets().filter(s=>s.isSheetHidden()!==r.BooleanNumber.TRUE).length<=1)throw new Error("Cannot hide the only visible sheet");e.executeCommand(a.SetWorksheetHideCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()})}showSheet(){return this._injector.get(r.ICommandService).executeCommand(a.SetWorksheetShowCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()})}isSheetHidden(){return this._worksheet.isSheetHidden()===r.BooleanNumber.TRUE}setName(e){return this._commandService.executeCommand(a.SetWorksheetNameCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),name:e})}activate(){return this._fWorkbook.setActiveSheet(this),this}getIndex(){return this._workbook.getSheetIndex(this._worksheet)}clear(e){if(e&&e.contentsOnly&&!e.formatOnly)return this.clearContents();if(e&&e.formatOnly&&!e.contentsOnly)return this.clearFormats();const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=this._injector.get(r.ICommandService),s={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return o.executeCommand(a.ClearSelectionAllCommand.id,{unitId:t,subUnitId:n,ranges:[s],options:e})}clearContents(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(r.ICommandService),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.executeCommand(a.ClearSelectionContentCommand.id,{unitId:e,subUnitId:t,ranges:[o]})}clearFormats(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(r.ICommandService),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.executeCommand(a.ClearSelectionFormatCommand.id,{unitId:e,subUnitId:t,ranges:[o]})}getDataRange(){const e=this.getLastRows(),t=this.getLastColumns();return this.getRange(0,0,e+1,t+1)}getLastColumns(){return this._worksheet.getLastColumnWithContent()}getLastColumn(){return this._worksheet.getLastColumnWithContent()}getLastRows(){return this._worksheet.getLastRowWithContent()}getLastRow(){return this._worksheet.getLastRowWithContent()}equalTo(e){return e instanceof m.FWorksheet?this._worksheet.getSheetId()===e.getSheetId()&&this._workbook.getUnitId()===e.getWorkbook().getUnitId():!1}insertDefinedName(e,t){const o=this._injector.createInstance(I).setName(e).setRef(t).build();o.localSheetId=this.getSheetId(),this._fWorkbook.insertDefinedNameBuilder(o)}getDefinedNames(){return this._fWorkbook.getDefinedNames().filter(t=>t.getLocalSheetId()===this.getSheetId())}},m.FWorksheet=J([v(3,r.Inject(r.Injector)),v(4,r.Inject(a.SheetsSelectionsService)),v(5,r.Inject(r.ILogService)),v(6,r.ICommandService)],m.FWorksheet);var Q=Object.defineProperty,X=Object.getOwnPropertyDescriptor,Z=(h,i,e,t)=>{for(var n=t>1?void 0:t?X(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&Q(i,e,n),n},S=(h,i)=>(e,t)=>i(e,t,h);m.FWorkbook=class extends r.FBase{constructor(e,t,n,o,s,d,c,u,l,g){super();C(this,"id");this._workbook=e,this._injector=t,this._resourceLoaderService=n,this._selectionManagerService=o,this._univerInstanceService=s,this._commandService=d,this._permissionService=c,this._logService=u,this._localeService=l,this._definedNamesService=g,this.id=this._workbook.getUnitId()}getId(){return this.id}getName(){return this._workbook.name}setName(e){this._workbook.setName(e)}save(){return this._resourceLoaderService.saveUnit(this._workbook.getUnitId())}getSnapshot(){return this._logService.warn("use 'save' instead of 'getSnapshot'"),this.save()}getActiveSheet(){const e=this._workbook.getActiveSheet();return this._injector.createInstance(m.FWorksheet,this,this._workbook,e)}getSheets(){return this._workbook.getSheets().map(e=>this._injector.createInstance(m.FWorksheet,this,this._workbook,e))}create(e,t,n){const o=r.mergeWorksheetSnapshotWithDefault({});o.rowCount=t,o.columnCount=n,o.name=e,o.id=e.toLowerCase().replace(/ /g,"-"),this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{unitId:this.id,index:this._workbook.getSheets().length,sheet:o}),this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId()});const s=this._workbook.getActiveSheet();if(!s)throw new Error("No active sheet found");return this._injector.createInstance(m.FWorksheet,this,this._workbook,s)}getSheetBySheetId(e){const t=this._workbook.getSheetBySheetId(e);return t?this._injector.createInstance(m.FWorksheet,this,this._workbook,t):null}getSheetByName(e){const t=this._workbook.getSheetBySheetName(e);return t?this._injector.createInstance(m.FWorksheet,this,this._workbook,t):null}setActiveSheet(e){return this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:e.getSheetId()}),e}insertSheet(e){e!=null?this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{sheet:{name:e}}):this._commandService.syncExecuteCommand(a.InsertSheetCommand.id);const t=this.id,n=this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId();this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:t,subUnitId:n});const o=this._workbook.getActiveSheet();if(!o)throw new Error("No active sheet found");return this._injector.createInstance(m.FWorksheet,this,this._workbook,o)}deleteSheet(e){const t=this.id,n=e.getSheetId();return this._commandService.executeCommand(a.RemoveSheetCommand.id,{unitId:t,subUnitId:n})}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(r.UndoCommand.id)}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(r.RedoCommand.id)}onBeforeCommandExecute(e){return this._commandService.beforeCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onCommandExecuted(e){return this._commandService.onCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onSelectionChange(e){return r.toDisposable(this._selectionManagerService.selectionMoveEnd$.subscribe(t=>{this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET).getUnitId()===this.id&&(t!=null&&t.length?e(t.map(n=>n.range)):e([]))}))}setEditable(e){const t=new a.WorkbookEditablePermission(this._workbook.getUnitId());this._permissionService.getPermissionPoint(t.id)||this._permissionService.addPermissionPoint(t),this._permissionService.updatePermissionPoint(t.id,e)}setActiveRange(e){const t=this.getActiveSheet(),n=e.getRange().sheetId||t.getSheetId(),o=n?this._workbook.getSheetBySheetId(n):this._workbook.getActiveSheet(!0);if(!o)throw new Error("No active sheet found");o.getSheetId()!==t.getSheetId()&&this.setActiveSheet(this._injector.createInstance(m.FWorksheet,this,this._workbook,o));const s={unitId:this.getId(),subUnitId:n,selections:[e].map(d=>({range:d.getRange(),primary:a.getPrimaryForRange(d.getRange(),o),style:null}))};this._commandService.syncExecuteCommand(a.SetSelectionsOperation.id,s)}getActiveRange(){const e=this._workbook.getActiveSheet(),n=this._selectionManagerService.getCurrentSelections().find(o=>!!o.primary);return n?this._injector.createInstance(m.FRange,this._workbook,e,n.range):null}deleteActiveSheet(){const e=this.getActiveSheet();return this.deleteSheet(e)}duplicateSheet(e){return this._commandService.executeCommand(a.CopySheetCommand.id,{unitId:e.getWorkbook().getUnitId(),subUnitId:e.getSheetId()})}duplicateActiveSheet(){const e=this.getActiveSheet();return this.duplicateSheet(e)}getNumSheets(){return this._workbook.getSheets().length}getLocale(){return this._localeService.getCurrentLocale()}setLocale(e){this._localeService.setLocale(e)}getUrl(){return location.href}moveSheet(e,t){let n=t;return n<0?n=0:n>this._workbook.getSheets().length-1&&(n=this._workbook.getSheets().length-1),this._commandService.executeCommand(a.SetWorksheetOrderCommand.id,{unitId:e.getWorkbook().getUnitId(),order:n,subUnitId:e.getSheetId()})}moveActiveSheet(e){const t=this.getActiveSheet();return this.moveSheet(t,e)}getPermission(){return this._injector.createInstance(m.FPermission)}getDefinedName(e){const t=this._definedNamesService.getValueByName(this.id,e);return t?this._injector.createInstance(f,{...t,unitId:this.id}):null}getDefinedNames(){const e=this._definedNamesService.getDefinedNameMap(this.id);return e?Object.values(e).map(t=>this._injector.createInstance(f,{...t,unitId:this.id})):[]}insertDefinedName(e,t){const o=this._injector.createInstance(I).setName(e).setRef(t).build();o.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this.insertDefinedNameBuilder(o)}deleteDefinedName(e){const t=this.getDefinedName(e);return t?(t.delete(),!0):!1}insertDefinedNameBuilder(e){e.unitId=this.getId(),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}updateDefinedNameBuilder(e){this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}},m.FWorkbook=Z([S(1,r.Inject(r.Injector)),S(2,r.Inject(r.IResourceLoaderService)),S(3,r.Inject(a.SheetsSelectionsService)),S(4,r.IUniverInstanceService),S(5,r.ICommandService),S(6,r.IPermissionService),S(7,r.ILogService),S(8,r.Inject(r.LocaleService)),S(9,_.IDefinedNamesService)],m.FWorkbook);class ee extends r.FUniver{createUniverSheet(i){const t=this._injector.get(r.IUniverInstanceService).createUnit(r.UniverInstanceType.UNIVER_SHEET,i);return this._injector.createInstance(m.FWorkbook,t)}getActiveWorkbook(){const i=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);return i?this._injector.createInstance(m.FWorkbook,i):null}getUniverSheet(i){const e=this._univerInstanceService.getUnit(i,r.UniverInstanceType.UNIVER_SHEET);return e?this._injector.createInstance(m.FWorkbook,e):null}getPermission(){return this._injector.createInstance(m.FPermission)}onUniverSheetCreated(i){const e=this._univerInstanceService.getTypeOfUnitAdded$(r.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=this._injector.createInstance(m.FWorkbook,t);i(n)});return r.toDisposable(e)}newDefinedName(){return this._injector.createInstance(I)}}r.FUniver.extend(ee);var te=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ie=(h,i,e,t)=>{for(var n=t>1?void 0:t?ne(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&te(i,e,n),n},oe=(h,i)=>(e,t)=>i(e,t,h);m.FSheetHooks=class extends r.FBase{constructor(i){super(),this._injector=i}},m.FSheetHooks=ie([oe(0,r.Inject(r.Injector))],m.FSheetHooks),Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
16
|
+
(function(m,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula"],r):(m=typeof globalThis<"u"?globalThis:m||self,r(m.UniverSheetsFacade={},m.UniverCore,m.UniverSheets,m.UniverEngineFormula))})(this,function(m,r,a,w){"use strict";var se=Object.defineProperty;var ae=(m,r,a)=>r in m?se(m,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):m[r]=a;var I=(m,r,a)=>ae(m,typeof r!="symbol"?r+"":r,a);var N=Object.defineProperty,F=Object.getOwnPropertyDescriptor,j=(h,i,e,t)=>{for(var n=t>1?void 0:t?F(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&N(i,e,n),n},_=(h,i)=>(e,t)=>i(e,t,h);function W(h,i,e){const t=e.getDefinedNameMap(h);if(t==null)return i.t("definedName.defaultName")+1;const o=Array.from(Object.values(t)).length+1,s=i.t("definedName.defaultName")+o;if(e.getValueByName(h,s)==null)return s;let d=o+1;for(;;){const c=i.t("definedName.defaultName")+d;if(e.getValueByName(h,c)==null)return c;d++}}class C{constructor(){I(this,"_definedNameParam");this._definedNameParam={id:r.generateRandomId(10),unitId:"",name:"",formulaOrRefString:""}}setName(i){return this._definedNameParam.name=i,this}setFormula(i){return this._definedNameParam.formulaOrRefString=`=${i}`,this}setRef(i){return this._definedNameParam.formulaOrRefString=i,this}setRefByRange(i,e,t,n){return this._definedNameParam.formulaOrRefString=w.serializeRange({startRow:i,endRow:i+(t!=null?t:1)-1,startColumn:e,endColumn:e+(n!=null?n:1)-1}),this}setComment(i){return this._definedNameParam.comment=i,this}setHidden(i){return this._definedNameParam.hidden=i,this}build(){return this._definedNameParam}load(i){return this._definedNameParam=i,this}}let v=class extends r.FBase{constructor(h,i,e,t,n,o,s,d,c,u){super(),this._definedNameParam=h,this._injector=i,this._commandService=e,this._permissionService=t,this._worksheetProtectionRuleModel=n,this._rangeProtectionRuleModel=o,this._worksheetProtectionPointRuleModel=s,this._authzIoService=d,this._localeService=c,this._definedNamesService=u}_apply(){this._definedNameParam.name===""&&(this._definedNameParam.name=W(this._definedNameParam.unitId,this._localeService,this._definedNamesService)),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,this._definedNameParam)}getName(){return this._definedNameParam.name}setName(h){this._definedNameParam.name=h,this._apply()}setFormula(h){this._definedNameParam.formulaOrRefString=`=${h}`,this._apply()}setRef(h){this._definedNameParam.formulaOrRefString=h,this._apply()}getFormulaOrRefString(){return this._definedNameParam.formulaOrRefString}setRefByRange(h,i,e,t){this._definedNameParam.formulaOrRefString=w.serializeRange({startRow:h,endRow:h+(e!=null?e:1)-1,startColumn:i,endColumn:i+(t!=null?t:1)-1}),this._apply()}getComment(){return this._definedNameParam.comment}setComment(h){this._definedNameParam.comment=h,this._apply()}setScopeToWorksheet(h){this._definedNameParam.localSheetId=h.getSheetId(),this._apply()}setScopeToWorkbook(){this._definedNameParam.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this._apply()}setHidden(h){this._definedNameParam.hidden=h,this._apply()}delete(){this._commandService.syncExecuteCommand(a.RemoveDefinedNameCommand.id,this._definedNameParam)}getLocalSheetId(){return this._definedNameParam.localSheetId}isWorkbookScope(){return this._definedNameParam.localSheetId===a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}toBuilder(){const h=this._injector.createInstance(C);return h.load(this._definedNameParam),h}};v=j([_(1,r.Inject(r.Injector)),_(2,r.ICommandService),_(3,r.IPermissionService),_(4,r.Inject(a.WorksheetProtectionRuleModel)),_(5,r.Inject(a.RangeProtectionRuleModel)),_(6,r.Inject(a.WorksheetProtectionPointModel)),_(7,r.Inject(r.IAuthzIoService)),_(8,r.Inject(r.LocaleService)),_(9,w.IDefinedNamesService)],v);var A=Object.defineProperty,T=Object.getOwnPropertyDescriptor,D=(h,i,e,t)=>{for(var n=t>1?void 0:t?T(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&A(i,e,n),n},k=(h,i)=>(e,t)=>i(e,t,h);m.FPermission=class extends r.FBase{constructor(e,t,n,o,s,d,c){super();I(this,"permissionPointsDefinition",a.PermissionPointsDefinitions);this._injector=e,this._commandService=t,this._permissionService=n,this._worksheetProtectionRuleModel=o,this._rangeProtectionRuleModel=s,this._worksheetProtectionPointRuleModel=d,this._authzIoService=c}setWorkbookPermissionPoint(e,t,n){const o=new t(e);this._permissionService.getPermissionPoint(o.id)||this._permissionService.addPermissionPoint(o),this._permissionService.updatePermissionPoint(o.id,n)}setWorkbookEditPermission(e,t){this.setWorkbookPermissionPoint(e,a.WorkbookEditablePermission,t)}async addWorksheetBasePermission(e,t){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");const o=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}});if(this._commandService.syncExecuteCommand(a.AddWorksheetProtectionMutation.id,{unitId:e,subUnitId:t,rule:{permissionId:o,unitType:a.UnitObject.Worksheet,unitId:e,subUnitId:t}}))return o}removeWorksheetPermission(e,t){this._commandService.syncExecuteCommand(a.DeleteWorksheetProtectionMutation.id,{unitId:e,subUnitId:t}),[...a.getAllWorksheetPermissionPoint(),...a.getAllWorksheetPermissionPointByPointPanel()].forEach(n=>{const o=new n(e,t);this._permissionService.updatePermissionPoint(o.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e,t)}async setWorksheetPermissionPoint(e,t,n,o){const s=this._worksheetProtectionRuleModel.getRule(e,t);let d;if(n===a.WorksheetEditPermission||n===a.WorksheetViewPermission)if(s)d=s.permissionId;else{if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length>0)throw new Error("sheet protection cannot intersect with range protection");d=await this.addWorksheetBasePermission(e,t)}else{const g=this._worksheetProtectionPointRuleModel.getRule(e,t);g?d=g.permissionId:(d=await this._authzIoService.create({objectType:a.UnitObject.Worksheet,worksheetObject:{collaborators:[],unitID:e,strategies:[],name:"",scope:void 0}}),this._commandService.executeCommand(a.SetWorksheetPermissionPointsMutation.id,{unitId:e,subUnitId:t,permissionId:d}))}const u=new n(e,t);return this._permissionService.getPermissionPoint(u.id)||this._permissionService.addPermissionPoint(u),this._permissionService.updatePermissionPoint(u.id,o),d}async addRangeBaseProtection(e,t,n){const o=await this._authzIoService.create({objectType:a.UnitObject.SelectRange,selectRangeObject:{collaborators:[],unitID:e,name:"",scope:void 0}}),s=`ruleId_${r.generateRandomId(6)}`;if(this._worksheetProtectionRuleModel.getRule(e,t))throw new Error("sheet protection cannot intersect with range protection");if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).some(g=>g.ranges.some(U=>n.some(R=>r.Rectangle.intersects(R,U)))))throw new Error("range protection cannot intersect");if(this._commandService.syncExecuteCommand(a.AddRangeProtectionMutation.id,{unitId:e,subUnitId:t,rules:[{permissionId:o,unitType:a.UnitObject.SelectRange,unitId:e,subUnitId:t,ranges:n,id:s}]}))return{permissionId:o,ruleId:s}}removeRangeProtection(e,t,n){this._commandService.syncExecuteCommand(a.DeleteRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleIds:n})&&this._rangeProtectionRuleModel.getSubunitRuleList(e,t).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e,t),[...a.getAllWorksheetPermissionPointByPointPanel()].forEach(d=>{const c=new d(e,t);this._permissionService.updatePermissionPoint(c.id,c.value)}))}setRangeProtectionPermissionPoint(e,t,n,o,s){const d=new o(e,t,n);this._permissionService.getPermissionPoint(d.id)||this._permissionService.addPermissionPoint(d),this._permissionService.updatePermissionPoint(d.id,s)}setRangeProtectionRanges(e,t,n,o){const s=this._rangeProtectionRuleModel.getRule(e,t,n);if(s){if(this._rangeProtectionRuleModel.getSubunitRuleList(e,t).filter(u=>u.id!==n).some(u=>u.ranges.some(l=>o.some(g=>r.Rectangle.intersects(g,l)))))throw new Error("range protection cannot intersect");this._commandService.syncExecuteCommand(a.SetRangeProtectionMutation.id,{unitId:e,subUnitId:t,ruleId:n,rule:{...s,ranges:o}})}}setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}},m.FPermission=D([k(0,r.Inject(r.Injector)),k(1,r.ICommandService),k(2,r.IPermissionService),k(3,r.Inject(a.WorksheetProtectionRuleModel)),k(4,r.Inject(a.RangeProtectionRuleModel)),k(5,r.Inject(a.WorksheetProtectionPointModel)),k(6,r.Inject(r.IAuthzIoService))],m.FPermission);function M(h){switch(h){case"left":return r.HorizontalAlign.LEFT;case"center":return r.HorizontalAlign.CENTER;case"normal":return r.HorizontalAlign.RIGHT;default:throw new Error(`Invalid horizontal alignment: ${h}`)}}function O(h){switch(h){case r.HorizontalAlign.LEFT:return"left";case r.HorizontalAlign.CENTER:return"center";case r.HorizontalAlign.RIGHT:return"normal";default:throw new Error(`Invalid horizontal alignment: ${h}`)}}function x(h){switch(h){case"top":return r.VerticalAlign.TOP;case"middle":return r.VerticalAlign.MIDDLE;case"bottom":return r.VerticalAlign.BOTTOM;default:throw new Error(`Invalid vertical alignment: ${h}`)}}function B(h){switch(h){case r.VerticalAlign.TOP:return"top";case r.VerticalAlign.MIDDLE:return"middle";case r.VerticalAlign.BOTTOM:return"bottom";default:throw new Error(`Invalid vertical alignment: ${h}`)}}function b(h){return r.isFormulaString(h)?{f:h}:r.isCellV(h)?{v:h}:(r.isICellData(h),h)}function L(h,i){const e=new r.ObjectMatrix,{startRow:t,startColumn:n,endRow:o,endColumn:s}=i;if(r.Tools.isArray(h))for(let d=0;d<=o-t;d++)for(let c=0;c<=s-n;c++)e.setValue(d+t,c+n,b(h[d][c]));else new r.ObjectMatrix(h).forValue((c,u,l)=>{e.setValue(c,u,b(l))});return e.getMatrix()}function y(h,i){return{startRow:h.startRow,endRow:h.endRow,startColumn:0,endColumn:i.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW}}function P(h,i){return{startRow:0,endRow:i.getRowCount()-1,startColumn:h.startColumn,endColumn:h.endColumn,rangeType:r.RANGE_TYPE.COLUMN}}var z=Object.defineProperty,V=Object.getOwnPropertyDescriptor,H=(h,i,e,t)=>{for(var n=t>1?void 0:t?V(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&z(i,e,n),n},p=(h,i)=>(e,t)=>i(e,t,h);m.FRange=class extends r.FBaseInitialable{constructor(i,e,t,n,o,s){super(n),this._workbook=i,this._worksheet=e,this._range=t,this._injector=n,this._commandService=o,this._formulaDataModel=s}getUnitId(){return this._workbook.getUnitId()}getSheetName(){return this._worksheet.getName()}getRange(){return this._range}getRow(){return this._range.startRow}getColumn(){return this._range.startColumn}getWidth(){return this._range.endColumn-this._range.startColumn+1}getHeight(){return this._range.endRow-this._range.startRow+1}getCellData(){var i;return(i=this._worksheet.getCell(this._range.startRow,this._range.startColumn))!=null?i:null}isMerged(){const{startColumn:i,startRow:e,endColumn:t,endRow:n}=this._range;return this._worksheet.getMergedCellRange(e,i,n,t).some(s=>r.Rectangle.equals(s,this._range))}getCellStyleData(){var t;const i=this.getCellData(),e=this._workbook.getStyles();return i&&e&&(t=e.getStyleByCell(i))!=null?t:null}getValue(){var i,e;return(e=(i=this._worksheet.getCell(this._range.startRow,this._range.startColumn))==null?void 0:i.v)!=null?e:null}getValues(){var s,d;const{startRow:i,endRow:e,startColumn:t,endColumn:n}=this._range,o=[];for(let c=i;c<=e;c++){const u=[];for(let l=t;l<=n;l++)u.push((d=(s=this._worksheet.getCell(c,l))==null?void 0:s.v)!=null?d:null);o.push(u)}return o}getCellDataGrid(){const{startRow:i,endRow:e,startColumn:t,endColumn:n}=this._range,o=[];for(let s=i;s<=e;s++){const d=[];for(let c=t;c<=n;c++)d.push(this._worksheet.getCellRaw(s,c));o.push(d)}return o}getFormulas(){const i=[],{startRow:e,endRow:t,startColumn:n,endColumn:o}=this._range,s=this._worksheet.getSheetId(),d=this._workbook.getUnitId();for(let c=e;c<=t;c++){const u=[];for(let l=n;l<=o;l++){const g=this._formulaDataModel.getFormulaStringByCell(c,l,s,d);u.push(g||"")}i.push(u)}return i}getWrap(){return this._worksheet.getRange(this._range).getWrap()===r.BooleanNumber.TRUE}getWrapStrategy(){return this._worksheet.getRange(this._range).getWrapStrategy()}getHorizontalAlignment(){return O(this._worksheet.getRange(this._range).getHorizontalAlignment())}getVerticalAlignment(){return B(this._worksheet.getRange(this._range).getVerticalAlignment())}setBackgroundColor(i){return this._commandService.syncExecuteCommand(a.SetStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:{type:"bg",value:{rgb:i}}}),this}setBackground(i){return this.setBackgroundColor(i),this}setValue(i){const e=b(i);if(!e)throw new Error("Invalid value");return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e}),this}setWrap(i){return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:i?r.WrapStrategy.WRAP:r.WrapStrategy.UNSPECIFIED}),this}setWrapStrategy(i){return this._commandService.syncExecuteCommand(a.SetTextWrapCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:i}),this}setVerticalAlignment(i){return this._commandService.syncExecuteCommand(a.SetVerticalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:x(i)}),this}setHorizontalAlignment(i){return this._commandService.syncExecuteCommand(a.SetHorizontalTextAlignCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:M(i)}),this}setValues(i){const e=L(i,this._range);return this._commandService.syncExecuteCommand(a.SetRangeValuesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,value:e}),this}setFontWeight(i){let e;if(i==="bold")e=r.BooleanNumber.TRUE;else if(i==="normal")e=r.BooleanNumber.FALSE;else if(i===null)e=null;else throw new Error("Invalid fontWeight");const t={type:"bl",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.executeCommand(a.SetStyleCommand.id,n),this}setFontStyle(i){let e;if(i==="italic")e=r.BooleanNumber.TRUE;else if(i==="normal")e=r.BooleanNumber.FALSE;else if(i===null)e=null;else throw new Error("Invalid fontStyle");const t={type:"it",value:e},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.executeCommand(a.SetStyleCommand.id,n),this}setFontLine(i){if(i==="underline")this._setFontUnderline({s:r.BooleanNumber.TRUE});else if(i==="line-through")this._setFontStrikethrough({s:r.BooleanNumber.TRUE});else if(i==="none")this._setFontUnderline({s:r.BooleanNumber.FALSE}),this._setFontStrikethrough({s:r.BooleanNumber.FALSE});else if(i===null)this._setFontUnderline(null),this._setFontStrikethrough(null);else throw new Error("Invalid fontLine");return this}_setFontUnderline(i){const e={type:"ul",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.executeCommand(a.SetStyleCommand.id,t)}_setFontStrikethrough(i){const e={type:"st",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};this._commandService.executeCommand(a.SetStyleCommand.id,t)}setFontFamily(i){const e={type:"ff",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.executeCommand(a.SetStyleCommand.id,t),this}setFontSize(i){const e={type:"fs",value:i},t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:e};return this._commandService.executeCommand(a.SetStyleCommand.id,t),this}setFontColor(i){const t={type:"cl",value:i===null?null:{rgb:i}},n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:t};return this._commandService.executeCommand(a.SetStyleCommand.id,n),this}merge(i=!0){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,e,t,[this._range],i),this}mergeAcross(i=!0){const e=a.getAddMergeMutationRangeByType([this._range],r.Dimension.ROWS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,t,n,e,i),this}mergeVertically(i=!0){const e=a.getAddMergeMutationRangeByType([this._range],r.Dimension.COLUMNS),t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return a.addMergeCellsUtil(this._injector,t,n,e,i),this}isPartOfMerge(){const{startRow:i,startColumn:e,endRow:t,endColumn:n}=this._range;return this._worksheet.getMergedCellRange(i,e,t,n).length>0}breakApart(){return this._commandService.executeCommand(a.RemoveWorksheetMergeCommand.id,{ranges:[this._range]}),this}forEach(i){const{startColumn:e,startRow:t,endColumn:n,endRow:o}=this._range;this._worksheet.getMatrixWithMergedCells(t,e,o,n).forValue((s,d,c)=>{i(s,d,c)})}getA1Notation(i){return i?w.serializeRangeWithSheet(this._worksheet.getName(),this._range):w.serializeRange(this._range)}activate(){return this._injector.createInstance(m.FWorkbook,this._workbook).setActiveRange(this),this}activateAsCurrentCell(){const i=this._worksheet.getMergedCell(this._range.startRow,this._range.startColumn);if(i&&r.Rectangle.equals(i,this._range)||!i&&this._range.startRow===this._range.endRow&&this._range.startColumn===this._range.endColumn)return this.activate();throw new Error("The range is not a single cell")}splitTextToColumns(i,e,t){this._commandService.executeCommand(a.SplitTextToColumnsCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,delimiter:e,customDelimiter:t,treatMultipleDelimitersAsOne:i})}useThemeStyle(i){if(i==null){const e=this.getUsedThemeStyle();e&&this.removeThemeStyle(e)}else this._commandService.executeCommand(a.SetWorksheetRangeThemeStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,themeName:i})}removeThemeStyle(i){this._commandService.executeCommand(a.DeleteWorksheetRangeThemeStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,themeName:i})}getUsedThemeStyle(){return this._injector.get(a.SheetRangeThemeService).getAppliedRangeThemeStyle({unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range})}},m.FRange=H([p(3,r.Inject(r.Injector)),p(4,r.ICommandService),p(5,r.Inject(w.FormulaDataModel))],m.FRange);var $=Object.defineProperty,G=Object.getOwnPropertyDescriptor,Y=(h,i,e,t)=>{for(var n=t>1?void 0:t?G(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&$(i,e,n),n},q=(h,i)=>(e,t)=>i(e,t,h);m.FSelection=class{constructor(i,e,t,n){this._workbook=i,this._worksheet=e,this._selections=t,this._injector=n}getActiveRange(){const i=this._selections.find(e=>!!e.primary);return i?this._injector.createInstance(m.FRange,this._workbook,this._worksheet,i.range):null}getActiveRangeList(){return this._selections.map(i=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,i.range))}getCurrentCell(){const i=this._selections.find(e=>!!e.primary);return i?i.primary:null}getActiveSheet(){const i=this._injector.createInstance(m.FWorkbook,this._workbook);return this._injector.createInstance(m.FWorksheet,i,this._workbook,this._worksheet)}updatePrimaryCell(i){const e=this._injector.get(r.ICommandService);let t=[],n=!1;for(const{range:s,style:d}of this._selections)r.Rectangle.contains(s,i.getRange())?(t.push({range:s,primary:a.getPrimaryForRange(i.getRange(),this._worksheet),style:d}),n=!0):t.push({range:s,primary:null,style:d});n||(t=[{range:i.getRange(),primary:a.getPrimaryForRange(i.getRange(),this._worksheet)}]);const o={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),selections:t};return e.syncExecuteCommand(a.SetSelectionsOperation.id,o),new m.FSelection(this._workbook,this._worksheet,t,this._injector)}getNextDataRange(i){if(!this._selections.find(n=>!!n.primary))return null;const t=a.getNextPrimaryCell(this._selections.concat(),i,this._worksheet);return t?this._injector.createInstance(m.FRange,this._workbook,this._worksheet,t):null}},m.FSelection=Y([q(3,r.Inject(r.Injector))],m.FSelection);var K=Object.defineProperty,J=Object.getOwnPropertyDescriptor,Q=(h,i,e,t)=>{for(var n=t>1?void 0:t?J(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&K(i,e,n),n},f=(h,i)=>(e,t)=>i(e,t,h);m.FWorksheet=class extends r.FBaseInitialable{constructor(e,t,n,o,s,d,c){super(o);I(this,"setActiveSelection",this.setActiveRange);this._fWorkbook=e,this._workbook=t,this._worksheet=n,this._injector=o,this._selectionManagerService=s,this._logService=d,this._commandService=c}getInject(){return this._injector}getWorkbook(){return this._workbook}getSheetId(){return this._worksheet.getSheetId()}getSheetName(){return this._worksheet.getName()}getSelection(){const e=this._selectionManagerService.getCurrentSelections();return e?this._injector.createInstance(m.FSelection,this._workbook,this._worksheet,e):null}getDefaultStyle(){return this._worksheet.getDefaultCellStyle()}getRowDefaultStyle(e,t=!1){return this._worksheet.getRowStyle(e,t)}getColumnDefaultStyle(e,t=!1){return this._worksheet.getColumnStyle(e,t)}setDefaultStyle(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId();return this._commandService.syncExecuteCommand(a.SetWorksheetDefaultStyleMutation.id,{unitId:t,subUnitId:n,defaultStyle:e}),this._worksheet.setDefaultCellStyle(e),this}setColumnDefaultStyle(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={unitId:n,subUnitId:o,columnData:{[e]:{s:t}}};return this._commandService.syncExecuteCommand(a.SetColDataCommand.id,s),this}setRowDefaultStyle(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={unitId:n,subUnitId:o,rowData:{[e]:{s:t}}};return this._commandService.syncExecuteCommand(a.SetRowDataCommand.id,s),this}getRange(e,t,n,o){let s,d;if(typeof e=="string"){const{range:c,sheetName:u}=w.deserializeRangeWithSheet(e),l=u?this._workbook.getSheetBySheetName(u):this._worksheet;if(!l)throw new Error("Range not found");d=l,s={...c,unitId:this._workbook.getUnitId(),sheetId:d.getSheetId(),rangeType:r.RANGE_TYPE.NORMAL,startRow:c.rangeType===r.RANGE_TYPE.COLUMN?0:c.startRow,endRow:c.rangeType===r.RANGE_TYPE.COLUMN?d.getMaxRows()-1:c.endRow,startColumn:c.rangeType===r.RANGE_TYPE.ROW?0:c.startColumn,endColumn:c.rangeType===r.RANGE_TYPE.ROW?d.getMaxColumns()-1:c.endColumn}}else if(typeof e=="number"&&t!==void 0)d=this._worksheet,s={startRow:e,endRow:e+(n!=null?n:1)-1,startColumn:t,endColumn:t+(o!=null?o:1)-1,unitId:this._workbook.getUnitId(),sheetId:this._worksheet.getSheetId()};else throw new Error("Invalid range specification");return this._injector.createInstance(m.FRange,this._workbook,d,s)}getMaxColumns(){return this._worksheet.getMaxColumns()}getMaxRows(){return this._worksheet.getMaxRows()}insertRowAfter(e){return this.insertRowsAfter(e,1)}insertRowBefore(e){return this.insertRowsBefore(e,1)}insertRows(e,t=1){return this.insertRowsBefore(e,t)}insertRowsAfter(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.DOWN,d=e+1,c=e+t,u=0,l=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!0,e);return this._commandService.syncExecuteCommand(a.InsertRowByRangeCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}insertRowsBefore(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.UP,d=e,c=e+t-1,u=0,l=this._worksheet.getColumnCount()-1,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!0,e-1);return this._commandService.syncExecuteCommand(a.InsertRowByRangeCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}deleteRow(e){return this.deleteRows(e,1)}deleteRows(e,t){const n={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return this._commandService.syncExecuteCommand(a.RemoveRowByRangeCommand.id,{range:n,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}moveRows(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=y(e.getRange(),this._worksheet),d=s,c={startRow:t,endRow:t,startColumn:s.startColumn,endColumn:s.endColumn};return this._commandService.syncExecuteCommand(a.MoveRowsCommand.id,{unitId:n,subUnitId:o,range:s,fromRange:d,toRange:c}),this}hideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=y(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetRowHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}hideRows(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW};return this._commandService.syncExecuteCommand(a.SetRowHiddenCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}unhideRow(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=y(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}showRows(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1,rangeType:r.RANGE_TYPE.ROW};return this._commandService.syncExecuteCommand(a.SetSpecificRowsVisibleCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}setRowHeight(e,t){return this.setRowHeights(e,1,t)}setRowHeights(e,t,n){var l;const o=this._workbook.getUnitId(),s=this._worksheet.getSheetId(),d=this._worksheet.getRowManager(),c=[],u=[];for(let g=e;g<e+t;g++){const U=((l=d.getRow(g))==null?void 0:l.ah)||this._worksheet.getConfig().defaultRowHeight,R={startRow:g,endRow:g,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};n<=U?c.push(R):u.push(R)}return u.length>0&&this._commandService.syncExecuteCommand(a.SetRowHeightCommand.id,{unitId:o,subUnitId:s,ranges:u,value:n}),c.length>0&&this._commandService.syncExecuteCommand(a.SetWorksheetRowIsAutoHeightCommand.id,{unitId:o,subUnitId:s,ranges:c}),this}setRowHeightsForced(e,t,n){const o=this._workbook.getUnitId(),s=this._worksheet.getSheetId(),d=[{startRow:e,endRow:e+t-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1}];return this._commandService.syncExecuteCommand(a.SetRowHeightCommand.id,{unitId:o,subUnitId:s,ranges:d,value:n}),this}setRowCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o={};for(const[d,c]of Object.entries(e))o[Number(d)]={custom:c};const s={unitId:t,subUnitId:n,rowData:o};return this._commandService.syncExecuteCommand(a.SetRowDataCommand.id,s),this}insertColumnAfter(e){return this.insertColumnsAfter(e,1)}insertColumnBefore(e){return this.insertColumnsBefore(e,1)}insertColumns(e,t=1){return this.insertColumnsBefore(e,t)}insertColumnsAfter(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.RIGHT,d=0,c=this._worksheet.getRowCount()-1,u=e+1,l=e+t,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!1,e);return this._commandService.syncExecuteCommand(a.InsertColByRangeCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}insertColumnsBefore(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=r.Direction.LEFT,d=0,c=this._worksheet.getRowCount()-1,u=e,l=e+t-1,g=a.copyRangeStyles(this._worksheet,d,c,u,l,!1,e-1);return this._commandService.syncExecuteCommand(a.InsertColByRangeCommand.id,{unitId:n,subUnitId:o,direction:s,range:{startRow:d,endRow:c,startColumn:u,endColumn:l},cellValue:g}),this}deleteColumn(e){return this.deleteColumns(e,1)}deleteColumns(e,t){const n={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1};return this._commandService.syncExecuteCommand(a.RemoveColByRangeCommand.id,{range:n,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}moveColumns(e,t){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s=P(e.getRange(),this._worksheet),d=s,c={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:t,endColumn:t};return this._commandService.syncExecuteCommand(a.MoveColsCommand.id,{unitId:n,subUnitId:o,range:s,fromRange:d,toRange:c}),this}hideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=P(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetColHiddenCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}hideColumns(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:r.RANGE_TYPE.COLUMN};return this._commandService.syncExecuteCommand(a.SetColHiddenCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}unhideColumn(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=P(e.getRange(),this._worksheet);return this._commandService.syncExecuteCommand(a.SetSpecificColsVisibleCommand.id,{unitId:t,subUnitId:n,ranges:[o]}),this}showColumns(e,t=1){const n=this._workbook.getUnitId(),o=this._worksheet.getSheetId(),s={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:e,endColumn:e+t-1,rangeType:r.RANGE_TYPE.COLUMN};return this._commandService.syncExecuteCommand(a.SetSpecificColsVisibleCommand.id,{unitId:n,subUnitId:o,ranges:[s]}),this}setColumnWidth(e,t){return this.setColumnWidths(e,1,t)}setColumnWidths(e,t,n){const o=this._workbook.getUnitId(),s=this._worksheet.getSheetId(),d=[{startColumn:e,endColumn:e+t-1,startRow:0,endRow:this._worksheet.getRowCount()-1}];return this._commandService.syncExecuteCommand(a.SetColWidthCommand.id,{unitId:o,subUnitId:s,ranges:d,value:n}),this}setColumnCustom(e){const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o={};for(const[d,c]of Object.entries(e))o[Number(d)]={custom:c};const s={unitId:t,subUnitId:n,columnData:o};return this._commandService.syncExecuteCommand(a.SetColDataCommand.id,s),this}getMergedRanges(){return this._worksheet.getSnapshot().mergeData.map(t=>this._injector.createInstance(m.FRange,this._workbook,this._worksheet,t))}getCellMergeData(e,t){const o=this._worksheet.getMergedCell(e,t);if(o)return this._injector.createInstance(m.FRange,this._workbook,this._worksheet,o)}getActiveRange(){return this._fWorkbook.getActiveRange()}setActiveRange(e){const{unitId:t,sheetId:n}=e.getRange();if(t!==this._workbook.getUnitId()||n!==this._worksheet.getSheetId())throw new Error("Specified range must be part of the sheet.");this._fWorkbook.setActiveRange(e)}setFreeze(e){return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{...e,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()}),this}cancelFreeze(){return this._commandService.syncExecuteCommand(a.CancelFrozenCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()}),this}getFreeze(){return this._worksheet.getFreeze()}setFrozenColumns(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startColumn:n>0?n:-1,xSplit:n})}else if(arguments.length===2){let[n=0,o=0]=e;n>o&&([n,o]=[o,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startColumn:o+1,xSplit:o-n+1,startRow:t.startRow,ySplit:t.ySplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}return this}setFrozenRows(...e){const t=this.getFreeze();if(arguments.length===1){const n=e[0];this.setFreeze({...t,startRow:n>0?n:-1,ySplit:n})}else if(arguments.length===2){let[n=0,o=0]=e;n>o&&([n,o]=[o,n]),this._commandService.syncExecuteCommand(a.SetFrozenCommand.id,{startRow:o+1,ySplit:o-n+1,startColumn:t.startColumn,xSplit:t.xSplit,unitId:this._workbook.getUnitId(),subUnitId:this.getSheetId()})}return this}getFrozenColumns(){const e=this.getFreeze();return e.startColumn===-1?0:e.startColumn}getFrozenRows(){const e=this.getFreeze();return e.startRow===-1?0:e.startRow}getFrozenRowRange(){const e=this._worksheet.getFreeze();return{startRow:e.startRow-e.ySplit,endRow:e.startRow-1}}getFrozenColumnRange(){const e=this._worksheet.getFreeze();return{startColumn:e.startColumn-e.xSplit,endColumn:e.startColumn-1}}hasHiddenGridLines(){return this._worksheet.getConfig().showGridlines===r.BooleanNumber.FALSE}setHiddenGridlines(e){return this._commandService.executeCommand(a.ToggleGridlinesCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),showGridlines:e?r.BooleanNumber.FALSE:r.BooleanNumber.TRUE}),this}setGridLinesColor(e){return this._commandService.syncExecuteCommand(a.SetGridlinesColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),color:e}),this}getGridLinesColor(){return this._worksheet.getGridlinesColor()}setTabColor(e){return this._commandService.executeCommand(a.SetTabColorCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),color:e}),this}getTabColor(){return this._worksheet.getTabColor()}onCellDataChange(e){return this._injector.get(r.ICommandService).onCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const o=n.params;o.unitId===this._workbook.getUnitId()&&o.subUnitId===this._worksheet.getSheetId()&&o.cellValue&&e(new r.ObjectMatrix(o.cellValue))}})}onBeforeCellDataChange(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(n=>{if(n.id===a.SetRangeValuesMutation.id){const o=n.params;o.unitId===this._workbook.getUnitId()&&o.subUnitId===this._worksheet.getSheetId()&&o.cellValue&&e(new r.ObjectMatrix(o.cellValue))}})}hideSheet(){const e=this._injector.get(r.ICommandService);if(this._workbook.getSheets().filter(s=>s.isSheetHidden()!==r.BooleanNumber.TRUE).length<=1)throw new Error("Cannot hide the only visible sheet");return e.syncExecuteCommand(a.SetWorksheetHideCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}showSheet(){return this._injector.get(r.ICommandService).syncExecuteCommand(a.SetWorksheetShowCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}isSheetHidden(){return this._worksheet.isSheetHidden()===r.BooleanNumber.TRUE}setName(e){return this._commandService.syncExecuteCommand(a.SetWorksheetNameCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),name:e}),this}activate(){return this._fWorkbook.setActiveSheet(this),this}getIndex(){return this._workbook.getSheetIndex(this._worksheet)}clear(e){if(e&&e.contentsOnly&&!e.formatOnly)return this.clearContents();if(e&&e.formatOnly&&!e.contentsOnly)return this.clearFormats();const t=this._workbook.getUnitId(),n=this._worksheet.getSheetId(),o=this._injector.get(r.ICommandService),s={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return o.syncExecuteCommand(a.ClearSelectionAllCommand.id,{unitId:t,subUnitId:n,ranges:[s],options:e}),this}clearContents(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(r.ICommandService),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.syncExecuteCommand(a.ClearSelectionContentCommand.id,{unitId:e,subUnitId:t,ranges:[o]}),this}clearFormats(){const e=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),n=this._injector.get(r.ICommandService),o={startRow:0,endRow:this._worksheet.getRowCount()-1,startColumn:0,endColumn:this._worksheet.getColumnCount()-1};return n.syncExecuteCommand(a.ClearSelectionFormatCommand.id,{unitId:e,subUnitId:t,ranges:[o]}),this}getDataRange(){const e=this.getLastRows(),t=this.getLastColumns();return this.getRange(0,0,e+1,t+1)}getLastColumns(){return this._worksheet.getLastColumnWithContent()}getLastColumn(){return this._worksheet.getLastColumnWithContent()}getLastRows(){return this._worksheet.getLastRowWithContent()}getLastRow(){return this._worksheet.getLastRowWithContent()}equalTo(e){return e instanceof m.FWorksheet?this._worksheet.getSheetId()===e.getSheetId()&&this._workbook.getUnitId()===e.getWorkbook().getUnitId():!1}insertDefinedName(e,t){const o=this._injector.createInstance(C).setName(e).setRef(t).build();o.localSheetId=this.getSheetId(),this._fWorkbook.insertDefinedNameBuilder(o)}getDefinedNames(){return this._fWorkbook.getDefinedNames().filter(t=>t.getLocalSheetId()===this.getSheetId())}},m.FWorksheet=Q([f(3,r.Inject(r.Injector)),f(4,r.Inject(a.SheetsSelectionsService)),f(5,r.Inject(r.ILogService)),f(6,r.ICommandService)],m.FWorksheet);var X=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,ee=(h,i,e,t)=>{for(var n=t>1?void 0:t?Z(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&X(i,e,n),n},S=(h,i)=>(e,t)=>i(e,t,h);m.FWorkbook=class extends r.FBaseInitialable{constructor(e,t,n,o,s,d,c,u,l,g){super(t);I(this,"id");this._workbook=e,this._injector=t,this._resourceLoaderService=n,this._selectionManagerService=o,this._univerInstanceService=s,this._commandService=d,this._permissionService=c,this._logService=u,this._localeService=l,this._definedNamesService=g,this.id=this._workbook.getUnitId()}getId(){return this.id}getName(){return this._workbook.name}setName(e){this._workbook.setName(e)}save(){return this._resourceLoaderService.saveUnit(this._workbook.getUnitId())}getSnapshot(){return this._logService.warn("use 'save' instead of 'getSnapshot'"),this.save()}getActiveSheet(){const e=this._workbook.getActiveSheet();return this._injector.createInstance(m.FWorksheet,this,this._workbook,e)}getSheets(){return this._workbook.getSheets().map(e=>this._injector.createInstance(m.FWorksheet,this,this._workbook,e))}create(e,t,n){const o=r.mergeWorksheetSnapshotWithDefault({});o.rowCount=t,o.columnCount=n,o.name=e,o.id=e.toLowerCase().replace(/ /g,"-"),this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{unitId:this.id,index:this._workbook.getSheets().length,sheet:o}),this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId()});const s=this._workbook.getActiveSheet();if(!s)throw new Error("No active sheet found");return this._injector.createInstance(m.FWorksheet,this,this._workbook,s)}getSheetBySheetId(e){const t=this._workbook.getSheetBySheetId(e);return t?this._injector.createInstance(m.FWorksheet,this,this._workbook,t):null}getSheetByName(e){const t=this._workbook.getSheetBySheetName(e);return t?this._injector.createInstance(m.FWorksheet,this,this._workbook,t):null}setActiveSheet(e){return this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:this.id,subUnitId:e.getSheetId()}),e}insertSheet(e){e!=null?this._commandService.syncExecuteCommand(a.InsertSheetCommand.id,{sheet:{name:e}}):this._commandService.syncExecuteCommand(a.InsertSheetCommand.id);const t=this.id,n=this._workbook.getSheets()[this._workbook.getSheets().length-1].getSheetId();this._commandService.syncExecuteCommand(a.SetWorksheetActiveOperation.id,{unitId:t,subUnitId:n});const o=this._workbook.getActiveSheet();if(!o)throw new Error("No active sheet found");return this._injector.createInstance(m.FWorksheet,this,this._workbook,o)}deleteSheet(e){const t=this.id,n=e.getSheetId();return this._commandService.syncExecuteCommand(a.RemoveSheetCommand.id,{unitId:t,subUnitId:n})}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.syncExecuteCommand(r.UndoCommand.id),this}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.syncExecuteCommand(r.RedoCommand.id),this}onBeforeCommandExecute(e){return this._commandService.beforeCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onCommandExecuted(e){return this._commandService.onCommandExecuted(t=>{var n;((n=t.params)==null?void 0:n.unitId)===this.id&&e(t)})}onSelectionChange(e){return r.toDisposable(this._selectionManagerService.selectionMoveEnd$.subscribe(t=>{this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET).getUnitId()===this.id&&(t!=null&&t.length?e(t.map(n=>n.range)):e([]))}))}setEditable(e){const t=new a.WorkbookEditablePermission(this._workbook.getUnitId());this._permissionService.getPermissionPoint(t.id)||this._permissionService.addPermissionPoint(t),this._permissionService.updatePermissionPoint(t.id,e)}setActiveRange(e){const t=this.getActiveSheet(),n=e.getRange().sheetId||t.getSheetId(),o=n?this._workbook.getSheetBySheetId(n):this._workbook.getActiveSheet(!0);if(!o)throw new Error("No active sheet found");o.getSheetId()!==t.getSheetId()&&this.setActiveSheet(this._injector.createInstance(m.FWorksheet,this,this._workbook,o));const s={unitId:this.getId(),subUnitId:n,selections:[e].map(d=>({range:d.getRange(),primary:a.getPrimaryForRange(d.getRange(),o),style:null}))};this._commandService.syncExecuteCommand(a.SetSelectionsOperation.id,s)}getActiveRange(){const e=this._workbook.getActiveSheet(),n=this._selectionManagerService.getCurrentSelections().find(o=>!!o.primary);return n?this._injector.createInstance(m.FRange,this._workbook,e,n.range):null}deleteActiveSheet(){const e=this.getActiveSheet();return this.deleteSheet(e)}duplicateSheet(e){return this._commandService.syncExecuteCommand(a.CopySheetCommand.id,{unitId:e.getWorkbook().getUnitId(),subUnitId:e.getSheetId()}),this._injector.createInstance(m.FWorksheet,this,this._workbook,this._workbook.getActiveSheet())}duplicateActiveSheet(){const e=this.getActiveSheet();return this.duplicateSheet(e)}getNumSheets(){return this._workbook.getSheets().length}getLocale(){return this._localeService.getCurrentLocale()}setLocale(e){this._localeService.setLocale(e)}getUrl(){return location.href}moveSheet(e,t){let n=t;return n<0?n=0:n>this._workbook.getSheets().length-1&&(n=this._workbook.getSheets().length-1),this._commandService.syncExecuteCommand(a.SetWorksheetOrderCommand.id,{unitId:e.getWorkbook().getUnitId(),order:n,subUnitId:e.getSheetId()}),this}moveActiveSheet(e){const t=this.getActiveSheet();return this.moveSheet(t,e)}getPermission(){return this._injector.createInstance(m.FPermission)}getDefinedName(e){const t=this._definedNamesService.getValueByName(this.id,e);return t?this._injector.createInstance(v,{...t,unitId:this.id}):null}getDefinedNames(){const e=this._definedNamesService.getDefinedNameMap(this.id);return e?Object.values(e).map(t=>this._injector.createInstance(v,{...t,unitId:this.id})):[]}insertDefinedName(e,t){const o=this._injector.createInstance(C).setName(e).setRef(t).build();o.localSheetId=a.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,this.insertDefinedNameBuilder(o)}deleteDefinedName(e){const t=this.getDefinedName(e);return t?(t.delete(),!0):!1}insertDefinedNameBuilder(e){e.unitId=this.getId(),this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}updateDefinedNameBuilder(e){this._commandService.syncExecuteCommand(a.SetDefinedNameCommand.id,e)}getRegisteredRangeThemes(){return this._injector.get(a.SheetRangeThemeService).getRegisteredRangeThemes()}registerRangeTheme(e){this._commandService.syncExecuteCommand(a.RegisterWorksheetRangeThemeStyleCommand.id,{unitId:this.getId(),rangeThemeStyle:e})}unregisterRangeTheme(e){this._commandService.syncExecuteCommand(a.UnregisterWorksheetRangeThemeStyleCommand.id,{unitId:this.getId(),themeName:e})}},m.FWorkbook=ee([S(1,r.Inject(r.Injector)),S(2,r.Inject(r.IResourceLoaderService)),S(3,r.Inject(a.SheetsSelectionsService)),S(4,r.IUniverInstanceService),S(5,r.ICommandService),S(6,r.IPermissionService),S(7,r.ILogService),S(8,r.Inject(r.LocaleService)),S(9,w.IDefinedNamesService)],m.FWorkbook);class te extends r.FUniver{_initialize(i){const e=i.get(r.ICommandService);this.disposeWithMe(e.beforeCommandExecuted(t=>{var n;switch(t.id){case a.InsertSheetCommand.id:{const o=t.params,{unitId:s,index:d,sheet:c}=o||{},u=s?this.getUniverSheet(s):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!u)return;const l={workbook:u,index:d,sheet:c};if(this.fireEvent(this.Event.BeforeSheetCreate,l),l.cancel)throw new Error("Sheet create canceled by facade api.");break}}})),this.disposeWithMe(e.onCommandExecuted(t=>{var n;switch(t.id){case a.InsertSheetCommand.id:{const o=t.params,{unitId:s}=o||{},d=s?this.getUniverSheet(s):(n=this.getActiveWorkbook)==null?void 0:n.call(this);if(!d)return;const c=d.getActiveSheet();if(!c)return;const u={workbook:d,worksheet:c};this.fireEvent(this.Event.SheetCreated,u);break}}}))}createUniverSheet(i){const t=this._injector.get(r.IUniverInstanceService).createUnit(r.UniverInstanceType.UNIVER_SHEET,i);return this._injector.createInstance(m.FWorkbook,t)}getActiveUniverSheet(){const i=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);return i?this._injector.createInstance(m.FWorkbook,i):null}getActiveWorkbook(){return this.getActiveUniverSheet()}getUniverSheet(i){const e=this._univerInstanceService.getUnit(i,r.UniverInstanceType.UNIVER_SHEET);return e?this._injector.createInstance(m.FWorkbook,e):null}getPermission(){return this._injector.createInstance(m.FPermission)}onUniverSheetCreated(i){const e=this._univerInstanceService.getTypeOfUnitAdded$(r.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{const n=this._injector.createInstance(m.FWorkbook,t);i(n)});return r.toDisposable(e)}newDefinedName(){return this._injector.createInstance(C)}}r.FUniver.extend(te);class E extends r.FEventName{get SheetCreated(){return"SheetCreated"}get BeforeSheetCreate(){return"BeforeSheetCreate"}}r.FEventName.extend(E);var ne=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,oe=(h,i,e,t)=>{for(var n=t>1?void 0:t?ie(i,e):i,o=h.length-1,s;o>=0;o--)(s=h[o])&&(n=(t?s(i,e,n):s(n))||n);return t&&n&&ne(i,e,n),n},re=(h,i)=>(e,t)=>i(e,t,h);m.FSheetHooks=class extends r.FBase{constructor(i){super(),this._injector=i}},m.FSheetHooks=oe([re(0,r.Inject(r.Injector))],m.FSheetHooks),m.FSheetEventName=E,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
// @univerjs/sheets-numfmt/index
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
// @univerjs/sheets-numfmt/facade
|
|
24
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(require("@univerjs/sheets-numfmt"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-numfmt","@univerjs/sheets/facade"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.UniverSheetsNumfmt,e.UniverSheetsFacade))})(this,function(e,t){"use strict";class
|
|
24
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(require("@univerjs/sheets-numfmt"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-numfmt","@univerjs/sheets/facade"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.UniverSheetsNumfmt,e.UniverSheetsFacade))})(this,function(e,t){"use strict";class n extends t.FRange{setNumberFormat(i){const s=[];return this.forEach((u,d)=>s.push({row:u,col:d,pattern:i})),this._commandService.syncExecuteCommand(e.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:s}),this}}t.FRange.extend(n)});
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
// @univerjs/sheets-data-validation/index
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
// @univerjs/sheets-data-validation/facade
|
|
32
|
-
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/sheets-data-validation"),require("@univerjs/sheets/facade"),require("@univerjs/core"),require("@univerjs/data-validation"),require("@univerjs/engine-formula"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-data-validation","@univerjs/sheets/facade","@univerjs/core","@univerjs/data-validation","@univerjs/engine-formula","rxjs"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.UniverSheetsDataValidationFacade={},n.UniverSheetsDataValidation,n.UniverSheetsFacade,n.UniverCore,n.UniverDataValidation,n.UniverEngineFormula,n.rxjs))})(this,function(n,a,s,i,_,p,m){"use strict";var V=Object.defineProperty;var I=(n,a,s)=>a in n?V(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var d=(n,a,s)=>I(n,typeof a!="symbol"?a+"":a,s);class l{constructor(t){d(this,"_rule");this._rule=t!=null?t:{uid:i.generateRandomId(),ranges:void 0,type:i.DataValidationType.CUSTOM}}build(){return new u(this._rule)}copy(){return new l({...this._rule,uid:i.generateRandomId()})}getAllowInvalid(){return this._rule.errorStyle!==i.DataValidationErrorStyle.STOP}getCriteriaType(){return this._rule.type}getCriteriaValues(){return[this._rule.operator,this._rule.formula1,this._rule.formula2]}getHelpText(){return this._rule.error}requireCheckbox(t,e){return this._rule.type=i.DataValidationType.CHECKBOX,this._rule.formula1=t,this._rule.formula2=e,this}requireDateAfter(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.operator=i.DataValidationOperator.GREATER_THAN,this}requireDateBefore(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN,this}requireDateBetween(t,e){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=e.toLocaleDateString(),this._rule.operator=i.DataValidationOperator.BETWEEN,this}requireDateEqualTo(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.EQUAL,this}requireDateNotBetween(t,e){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=e.toLocaleDateString(),this._rule.operator=i.DataValidationOperator.NOT_BETWEEN,this}requireDateOnOrAfter(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.GREATER_THAN_OR_EQUAL,this}requireDateOnOrBefore(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN_OR_EQUAL,this}requireFormulaSatisfied(t){return this._rule.type=i.DataValidationType.CUSTOM,this._rule.formula1=t,this._rule.formula2=void 0,this}requireNumberBetween(t,e,r){return this._rule.formula1=`${t}`,this._rule.formula2=`${e}`,this._rule.operator=i.DataValidationOperator.BETWEEN,this._rule.type=r?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberGreaterThan(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.GREATER_THAN,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberGreaterThanOrEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.GREATER_THAN_OR_EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberLessThan(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberLessThanOrEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN_OR_EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberNotBetween(t,e,r){return this._rule.formula1=`${t}`,this._rule.formula2=`${e}`,this._rule.operator=i.DataValidationOperator.NOT_BETWEEN,this._rule.type=r?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberNotEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.NOT_EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireValueInList(t,e,r){return this._rule.type=e?i.DataValidationType.LIST_MULTIPLE:i.DataValidationType.LIST,this._rule.formula1=t.join(","),this._rule.formula2=void 0,this._rule.showDropDown=r!=null?r:!0,this}requireValueInRange(t,e,r){return this._rule.type=e?i.DataValidationType.LIST_MULTIPLE:i.DataValidationType.LIST,this._rule.formula1=`=${p.serializeRangeToRefString({unitId:t.getUnitId(),sheetName:t.getSheetName(),range:t.getRange()})}`,this._rule.formula2=void 0,this._rule.showDropDown=r!=null?r:!0,this}setAllowInvalid(t){return this._rule.errorStyle=t?i.DataValidationErrorStyle.WARNING:i.DataValidationErrorStyle.STOP,this}setHelpText(t){return this._rule.error=t,this._rule.showErrorMessage=!0,this}withCriteriaValues(t,e){return this._rule.type=t,this._rule.operator=e[0],this._rule.formula1=e[1],this._rule.formula2=e[2],this}setOptions(t){return Object.assign(this._rule,t),this}}class u{constructor(t,e,r){d(this,"rule");d(this,"_worksheet");d(this,"_injector");this._injector=r,this.rule=t,this._worksheet=e}getAllowInvalid(){return this.rule.errorStyle!==i.DataValidationErrorStyle.STOP}getCriteriaType(){return this.rule.type}getCriteriaValues(){return[this.rule.operator,this.rule.formula1,this.rule.formula2]}getHelpText(){return this.rule.error}copy(){return new l(this.rule)}getApplied(){if(!this._worksheet)return!1;const e=this._injector.get(_.DataValidationModel).getRuleById(this._worksheet.getUnitId(),this._worksheet.getSheetId(),this.rule.uid);return!!(e&&e.ranges.length)}getRanges(){if(!this.getApplied())return[];const t=this._injector.get(i.IUniverInstanceService).getUnit(this._worksheet.getUnitId());return this.rule.ranges.map(e=>this._injector.createInstance(s.FRange,t,this._worksheet,e))}getUnitId(){var t;return(t=this._worksheet)==null?void 0:t.getUnitId()}getSheetId(){var t;return(t=this._worksheet)==null?void 0:t.getSheetId()}setCriteria(t,e){return this.getApplied()&&!this._injector.get(i.ICommandService).syncExecuteCommand(a.UpdateSheetDataValidationSettingCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid,setting:{operator:e[0],formula1:e[1],formula2:e[2],type:this.rule.type}})?!1:(this.rule.operator=e[0],this.rule.formula1=e[1],this.rule.formula2=e[2],this.rule.type=t,!0)}setOptions(t){return this.getApplied()&&!this._injector.get(i.ICommandService).syncExecuteCommand(a.UpdateSheetDataValidationOptionsCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid,options:{..._.getRuleOptions(this.rule),...t}})?!1:(Object.assign(this.rule,t),!0)}setRanges(t){return this.getApplied()&&!this._injector.get(i.ICommandService).syncExecuteCommand(a.UpdateSheetDataValidationRangeCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid,ranges:t.map(o=>o.getRange())})?!1:(this.rule.ranges=t.map(e=>e.getRange()),!0)}delete(){return this.getApplied()?this._injector.get(i.ICommandService).syncExecuteCommand(a.RemoveSheetDataValidationCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid}):!1}}class g extends s.FRange{async setDataValidation(t){if(!t)return this._commandService.executeCommand(a.ClearRangeDataValidationCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]}),this;const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:{...t.rule,ranges:[this._range]}};return await this._commandService.executeCommand(a.AddSheetDataValidationCommand.id,e),this}getDataValidation(){const e=this._injector.get(a.SheetsDataValidationValidatorService).getDataValidation(this._workbook.getUnitId(),this._worksheet.getSheetId(),[this._range]);return e&&new u(e,this._worksheet,this._injector)}getDataValidations(){return this._injector.get(a.SheetsDataValidationValidatorService).getDataValidations(this._workbook.getUnitId(),this._worksheet.getSheetId(),[this._range]).map(e=>new u(e,this._worksheet,this._injector))}async getValidatorStatus(){return this._injector.get(a.SheetsDataValidationValidatorService).validatorRanges(this._workbook.getUnitId(),this._worksheet.getSheetId(),[this._range])}}s.FRange.extend(g);class D{static newDataValidation(){return new l}newDataValidation(){return new l}}i.FUniver.extend(D);class f extends s.FWorkbook{_initialize(){Object.defineProperty(this,"_dataValidationModel",{get(){return this._injector.get(a.SheetDataValidationModel)}})}getValidatorStatus(){return this._injector.get(a.SheetsDataValidationValidatorService).validatorWorkbook(this._workbook.getUnitId())}onDataValidationChange(t){return i.toDisposable(this._dataValidationModel.ruleChange$.pipe(m.filter(e=>e.unitId===this._workbook.getUnitId())).subscribe(t))}onDataValidationStatusChange(t){return i.toDisposable(this._dataValidationModel.validStatusChange$.pipe(m.filter(e=>e.unitId===this._workbook.getUnitId())).subscribe(t))}onBeforeAddDataValidation(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.AddSheetDataValidationCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeAddDataValidation")}}))}onBeforeUpdateDataValidationCriteria(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.UpdateSheetDataValidationSettingCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationCriteria")}}))}onBeforeUpdateDataValidationRange(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.UpdateSheetDataValidationRangeCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationRange")}}))}onBeforeUpdateDataValidationOptions(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.UpdateSheetDataValidationOptionsCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationOptions")}}))}onBeforeDeleteDataValidation(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.RemoveSheetDataValidationCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeDeleteDataValidation")}}))}onBeforeDeleteAllDataValidation(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.RemoveSheetAllDataValidationCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeDeleteAllDataValidation")}}))}}s.FWorkbook.extend(f);class S extends s.FWorksheet{getDataValidations(){return this._injector.get(_.DataValidationModel).getRules(this._workbook.getUnitId(),this._worksheet.getSheetId()).map(e=>new u(e,this._worksheet,this._injector))}getValidatorStatus(){return this._injector.get(a.SheetsDataValidationValidatorService).validatorWorksheet(this._workbook.getUnitId(),this._worksheet.getSheetId())}}s.FWorksheet.extend(S),n.FDataValidation=u,n.FDataValidationBuilder=l,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
32
|
+
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/sheets-data-validation"),require("@univerjs/sheets/facade"),require("@univerjs/core"),require("@univerjs/data-validation"),require("@univerjs/engine-formula"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-data-validation","@univerjs/sheets/facade","@univerjs/core","@univerjs/data-validation","@univerjs/engine-formula","rxjs"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.UniverSheetsDataValidationFacade={},n.UniverSheetsDataValidation,n.UniverSheetsFacade,n.UniverCore,n.UniverDataValidation,n.UniverEngineFormula,n.rxjs))})(this,function(n,a,s,i,_,p,m){"use strict";var V=Object.defineProperty;var E=(n,a,s)=>a in n?V(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var d=(n,a,s)=>E(n,typeof a!="symbol"?a+"":a,s);class l{constructor(t){d(this,"_rule");this._rule=t!=null?t:{uid:i.generateRandomId(),ranges:void 0,type:i.DataValidationType.CUSTOM}}build(){return new u(this._rule)}copy(){return new l({...this._rule,uid:i.generateRandomId()})}getAllowInvalid(){return this._rule.errorStyle!==i.DataValidationErrorStyle.STOP}getCriteriaType(){return this._rule.type}getCriteriaValues(){return[this._rule.operator,this._rule.formula1,this._rule.formula2]}getHelpText(){return this._rule.error}requireCheckbox(t,e){return this._rule.type=i.DataValidationType.CHECKBOX,this._rule.formula1=t,this._rule.formula2=e,this}requireDateAfter(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.operator=i.DataValidationOperator.GREATER_THAN,this}requireDateBefore(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN,this}requireDateBetween(t,e){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=e.toLocaleDateString(),this._rule.operator=i.DataValidationOperator.BETWEEN,this}requireDateEqualTo(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.EQUAL,this}requireDateNotBetween(t,e){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=e.toLocaleDateString(),this._rule.operator=i.DataValidationOperator.NOT_BETWEEN,this}requireDateOnOrAfter(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.GREATER_THAN_OR_EQUAL,this}requireDateOnOrBefore(t){return this._rule.type=i.DataValidationType.DATE,this._rule.formula1=t.toLocaleDateString(),this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN_OR_EQUAL,this}requireFormulaSatisfied(t){return this._rule.type=i.DataValidationType.CUSTOM,this._rule.formula1=t,this._rule.formula2=void 0,this}requireNumberBetween(t,e,r){return this._rule.formula1=`${t}`,this._rule.formula2=`${e}`,this._rule.operator=i.DataValidationOperator.BETWEEN,this._rule.type=r?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberGreaterThan(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.GREATER_THAN,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberGreaterThanOrEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.GREATER_THAN_OR_EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberLessThan(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberLessThanOrEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.LESS_THAN_OR_EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberNotBetween(t,e,r){return this._rule.formula1=`${t}`,this._rule.formula2=`${e}`,this._rule.operator=i.DataValidationOperator.NOT_BETWEEN,this._rule.type=r?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireNumberNotEqualTo(t,e){return this._rule.formula1=`${t}`,this._rule.formula2=void 0,this._rule.operator=i.DataValidationOperator.NOT_EQUAL,this._rule.type=e?i.DataValidationType.WHOLE:i.DataValidationType.DECIMAL,this}requireValueInList(t,e,r){return this._rule.type=e?i.DataValidationType.LIST_MULTIPLE:i.DataValidationType.LIST,this._rule.formula1=t.join(","),this._rule.formula2=void 0,this._rule.showDropDown=r!=null?r:!0,this}requireValueInRange(t,e,r){return this._rule.type=e?i.DataValidationType.LIST_MULTIPLE:i.DataValidationType.LIST,this._rule.formula1=`=${p.serializeRangeToRefString({unitId:t.getUnitId(),sheetName:t.getSheetName(),range:t.getRange()})}`,this._rule.formula2=void 0,this._rule.showDropDown=r!=null?r:!0,this}setAllowInvalid(t){return this._rule.errorStyle=t?i.DataValidationErrorStyle.WARNING:i.DataValidationErrorStyle.STOP,this}setHelpText(t){return this._rule.error=t,this._rule.showErrorMessage=!0,this}withCriteriaValues(t,e){return this._rule.type=t,this._rule.operator=e[0],this._rule.formula1=e[1],this._rule.formula2=e[2],this}setAllowBlank(t){return this._rule.allowBlank=t,this}setOptions(t){return Object.assign(this._rule,t),this}}class u{constructor(t,e,r){d(this,"rule");d(this,"_worksheet");d(this,"_injector");this._injector=r,this.rule=t,this._worksheet=e}getAllowInvalid(){return this.rule.errorStyle!==i.DataValidationErrorStyle.STOP}getCriteriaType(){return this.rule.type}getCriteriaValues(){return[this.rule.operator,this.rule.formula1,this.rule.formula2]}getHelpText(){return this.rule.error}copy(){return new l(this.rule)}getApplied(){if(!this._worksheet)return!1;const e=this._injector.get(_.DataValidationModel).getRuleById(this._worksheet.getUnitId(),this._worksheet.getSheetId(),this.rule.uid);return!!(e&&e.ranges.length)}getRanges(){if(!this.getApplied())return[];const t=this._injector.get(i.IUniverInstanceService).getUnit(this._worksheet.getUnitId());return this.rule.ranges.map(e=>this._injector.createInstance(s.FRange,t,this._worksheet,e))}getUnitId(){var t;return(t=this._worksheet)==null?void 0:t.getUnitId()}getSheetId(){var t;return(t=this._worksheet)==null?void 0:t.getSheetId()}setCriteria(t,e,r=!0){if(this.getApplied()&&!this._injector.get(i.ICommandService).syncExecuteCommand(a.UpdateSheetDataValidationSettingCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid,setting:{operator:e[0],formula1:e[1],formula2:e[2],type:this.rule.type,allowBlank:r}}))throw new Error("setCriteria failed");return this.rule.operator=e[0],this.rule.formula1=e[1],this.rule.formula2=e[2],this.rule.type=t,this.rule.allowBlank=r,this}setOptions(t){if(this.getApplied()&&!this._injector.get(i.ICommandService).syncExecuteCommand(a.UpdateSheetDataValidationOptionsCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid,options:{..._.getRuleOptions(this.rule),...t}}))throw new Error("setOptions failed");return Object.assign(this.rule,t),this}setRanges(t){if(this.getApplied()&&!this._injector.get(i.ICommandService).syncExecuteCommand(a.UpdateSheetDataValidationRangeCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid,ranges:t.map(o=>o.getRange())}))throw new Error("setRanges failed");return this.rule.ranges=t.map(e=>e.getRange()),this}delete(){return this.getApplied()?this._injector.get(i.ICommandService).syncExecuteCommand(a.RemoveSheetDataValidationCommand.id,{unitId:this.getUnitId(),subUnitId:this.getSheetId(),ruleId:this.rule.uid}):!1}}class g extends s.FRange{setDataValidation(t){if(!t)return this._commandService.syncExecuteCommand(a.ClearRangeDataValidationCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]}),this;const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:{...t.rule,ranges:[this._range]}};return this._commandService.syncExecuteCommand(a.AddSheetDataValidationCommand.id,e),this}getDataValidation(){const e=this._injector.get(a.SheetsDataValidationValidatorService).getDataValidation(this._workbook.getUnitId(),this._worksheet.getSheetId(),[this._range]);return e&&new u(e,this._worksheet,this._injector)}getDataValidations(){return this._injector.get(a.SheetsDataValidationValidatorService).getDataValidations(this._workbook.getUnitId(),this._worksheet.getSheetId(),[this._range]).map(e=>new u(e,this._worksheet,this._injector))}async getValidatorStatus(){return this._injector.get(a.SheetsDataValidationValidatorService).validatorRanges(this._workbook.getUnitId(),this._worksheet.getSheetId(),[this._range])}}s.FRange.extend(g);class D{static newDataValidation(){return new l}newDataValidation(){return new l}}i.FUniver.extend(D);class f extends s.FWorkbook{_initialize(){Object.defineProperty(this,"_dataValidationModel",{get(){return this._injector.get(a.SheetDataValidationModel)}})}getValidatorStatus(){return this._injector.get(a.SheetsDataValidationValidatorService).validatorWorkbook(this._workbook.getUnitId())}onDataValidationChange(t){return i.toDisposable(this._dataValidationModel.ruleChange$.pipe(m.filter(e=>e.unitId===this._workbook.getUnitId())).subscribe(t))}onDataValidationStatusChange(t){return i.toDisposable(this._dataValidationModel.validStatusChange$.pipe(m.filter(e=>e.unitId===this._workbook.getUnitId())).subscribe(t))}onBeforeAddDataValidation(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.AddSheetDataValidationCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeAddDataValidation")}}))}onBeforeUpdateDataValidationCriteria(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.UpdateSheetDataValidationSettingCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationCriteria")}}))}onBeforeUpdateDataValidationRange(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.UpdateSheetDataValidationRangeCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationRange")}}))}onBeforeUpdateDataValidationOptions(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.UpdateSheetDataValidationOptionsCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationOptions")}}))}onBeforeDeleteDataValidation(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.RemoveSheetDataValidationCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeDeleteDataValidation")}}))}onBeforeDeleteAllDataValidation(t){return i.toDisposable(this._commandService.beforeCommandExecuted((e,r)=>{const o=e.params;if(e.id===a.RemoveSheetAllDataValidationCommand.id){if(o.unitId!==this._workbook.getUnitId())return;if(t(o,r)===!1)throw new Error("Command is stopped by the hook onBeforeDeleteAllDataValidation")}}))}}s.FWorkbook.extend(f);class S extends s.FWorksheet{getDataValidations(){return this._injector.get(_.DataValidationModel).getRules(this._workbook.getUnitId(),this._worksheet.getSheetId()).map(e=>new u(e,this._worksheet,this._injector))}getValidatorStatus(){return this._injector.get(a.SheetsDataValidationValidatorService).validatorWorksheet(this._workbook.getUnitId(),this._worksheet.getSheetId())}}s.FWorksheet.extend(S),n.FDataValidation=u,n.FDataValidationBuilder=l,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
// @univerjs/sheets-drawing/index
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
// @univerjs/sheets-filter/index
|
|
40
|
-
(function(g,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","rxjs"],u):(g=typeof globalThis<"u"?globalThis:g||self,u(g.UniverSheetsFilter={},g.UniverCore,g.UniverSheets,g.rxjs))})(this,function(g,u,R,T){"use strict";var We=Object.defineProperty;var qe=(g,u,R)=>u in g?We(g,u,{enumerable:!0,configurable:!0,writable:!0,value:R}):g[u]=R;var M=(g,u,R)=>qe(g,typeof u!="symbol"?u+"":u,R);var x;const fe="sheets-filter.config",q={},Q="sheet.mutation.set-filter-range",G="sheet.mutation.set-filter-criteria",J="sheet.mutation.remove-filter",Y="sheet.mutation.re-calc-filter",K=new Set([Q,G,J,Y]);var I=(i=>(i.EQUAL="equal",i.GREATER_THAN="greaterThan",i.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",i.LESS_THAN="lessThan",i.LESS_THAN_OR_EQUAL="lessThanOrEqual",i.NOT_EQUALS="notEqual",i))(I||{});const X={operator:I.GREATER_THAN,fn:(i,n)=>U(i)?i>n:!1},Z={operator:I.GREATER_THAN_OR_EQUAL,fn:(i,n)=>U(i)?i>=n:!1},k={operator:I.LESS_THAN,fn:(i,n)=>U(i)?i<n:!1},ee={operator:I.LESS_THAN_OR_EQUAL,fn:(i,n)=>U(i)?i<=n:!1},te={operator:I.EQUAL,fn:(i,n)=>U(i)?i===n:!1},H={operator:I.NOT_EQUALS,fn:(i,n)=>{if(typeof n=="string"){if(n===" ")return i!=null;const e=ie(i);return e&&_e(n)?!se(n).test(e):e!==n}return U(i)?i!==n:!0}},re=new Map([]);[X,Z,k,ee,te,H].forEach(i=>{re.set(i.operator,i)});function ge(i){return!!i}const Ce={fn:(i,n)=>{const e=ie(i);return e===null?n==="":se(n).test(e)}};function z(i){return i?re.get(i):Ce}function U(i){return typeof i=="number"}function ne(i){return!!(typeof i=="number"||typeof i=="string"&&u.isNumeric(i))}function ie(i){return typeof i=="boolean"||i==null?null:typeof i=="string"?i:i.toString()}function _e(i){return typeof i=="number"?!1:i.indexOf("*")!==-1||i.indexOf("?")!==-1}function se(i){const n=i.replace(/[.+^${}()|[\]\\]/g,"\\$&").replaceAll("?",".").replace(/[*]/g,".$&");return new RegExp(`^${n}$`)}const D=()=>new Set;class P extends u.Disposable{constructor(e,t,r){super();M(this,"_filteredOutRows$",new T.BehaviorSubject(D()));M(this,"filteredOutRows$",this._filteredOutRows$.asObservable());M(this,"_hasCriteria$",new T.BehaviorSubject(!1));M(this,"hasCriteria$",this._hasCriteria$.asObservable());M(this,"_filterColumnByIndex",new Map);M(this,"_alreadyFilteredOutRows",D());M(this,"_range");this.unitId=e,this.subUnitId=t,this._worksheet=r}get filteredOutRows(){return this._filteredOutRows$.getValue()}set filteredOutRows(e){this._alreadyFilteredOutRows=e,this._filteredOutRows$.next(e)}dispose(){super.dispose(),this._filteredOutRows$.complete(),this._hasCriteria$.complete()}serialize(){const e={ref:u.Rectangle.clone(this._range),filterColumns:this._getAllFilterColumns(!0).sort(([t],[r])=>t-r).map(([t,r])=>r.serialize())};return this._alreadyFilteredOutRows&&(e.cachedFilteredOut=Array.from(this._alreadyFilteredOutRows).sort()),e}static deserialize(e,t,r,s){const o=new P(e,t,r);return o._dump(s),o}_dump(e){var t;this.setRange(e.ref),(t=e.filterColumns)==null||t.forEach(r=>this._setCriteriaWithoutReCalc(r.colId,r)),e.cachedFilteredOut&&(this._alreadyFilteredOutRows=new Set(e.cachedFilteredOut),this._emit()),this._emitHasCriteria()}isRowFiltered(e){return this._alreadyFilteredOutRows.has(e)}getRange(){if(!this._range)throw new Error("[FilterModel] could not get range before a range is set!");return this._range}getFilteredOutRowsExceptCol(e){return this._getAllFilterColumns(!0).filter(([t])=>t!==e).reduce((t,[,r])=>{const s=r.calc({getAlreadyFilteredOutRows:()=>t});return s?u.mergeSets(t,s):t},new Set)}setRange(e){this._range=e,this._getAllFilterColumns(!0).forEach(([t,r])=>{r.setRangeAndColumn({startRow:e.startRow,endRow:e.endRow,startColumn:t,endColumn:t},t)})}setCriteria(e,t,r=!1){if(!this._range)throw new Error("[FilterModel] could not set criteria before a range is set!");if(!t){this._removeCriteria(e),this._rebuildAlreadyFilteredOutRowsWithCache(),r&&this._reCalcAllColumns(),this._emit(),this._emitHasCriteria();return}this._setCriteriaWithoutReCalc(e,t),r&&(this._rebuildAlreadyFilteredOutRowsWithCache(),this._reCalcWithNoCacheColumns(),this._emit(),this._emitHasCriteria())}getAllFilterColumns(){return this._getAllFilterColumns(!0)}getFilterColumn(e){var t;return(t=this._filterColumnByIndex.get(e))!=null?t:null}reCalc(){this._reCalcAllColumns(),this._emit()}_getAllFilterColumns(e=!1){const t=Array.from(this._filterColumnByIndex.entries());return e?t:t.map(([r,s])=>s)}_reCalcAllColumns(){this._alreadyFilteredOutRows=D(),this._getAllFilterColumns().forEach(e=>e.__clearCache()),this._reCalcWithNoCacheColumns()}_setCriteriaWithoutReCalc(e,t){const r=this._range;if(!r)throw new Error("[FilterModel] could not set criteria before a range is set!");const{startColumn:s,endColumn:o}=r;if(e>o||e<s)throw new Error(`[FilterModel] could not set criteria on column ${e} which is out of range!`);let l;this._filterColumnByIndex.has(e)?l=this._filterColumnByIndex.get(e):(l=new oe(this.unitId,this.subUnitId,this._worksheet,t,{getAlreadyFilteredOutRows:()=>this._alreadyFilteredOutRows}),l.setRangeAndColumn(r,e),this._filterColumnByIndex.set(e,l)),l.setCriteria(t)}_removeCriteria(e){const t=this._filterColumnByIndex.get(e);t&&(t.dispose(),this._filterColumnByIndex.delete(e))}_emit(){this._filteredOutRows$.next(this._alreadyFilteredOutRows)}_emitHasCriteria(){this._hasCriteria$.next(this._filterColumnByIndex.size>0)}_rebuildAlreadyFilteredOutRowsWithCache(){const e=this._getAllFilterColumns().filter(t=>t.hasCache()).reduce((t,r)=>u.mergeSets(t,r.filteredOutRows),new Set);this._alreadyFilteredOutRows=e}_reCalcWithNoCacheColumns(){const e=this._getAllFilterColumns().filter(t=>!t.hasCache());for(const t of e){const r=t.reCalc();r&&(this._alreadyFilteredOutRows=u.mergeSets(this._alreadyFilteredOutRows,r))}}}class oe extends u.Disposable{constructor(e,t,r,s,o){super();M(this,"_filteredOutRows",null);M(this,"_filterFn",null);M(this,"_range",null);M(this,"_column",0);M(this,"_filterByValues",!1);this.unitId=e,this.subUnitId=t,this._worksheet=r,this._criteria=s,this._filterColumnContext=o}get filteredOutRows(){return this._filteredOutRows}dispose(){super.dispose(),this._filteredOutRows=null}__clearCache(){this._filteredOutRows=null}serialize(){if(!this._criteria)throw new Error("[FilterColumn]: could not serialize without a filter column!");return u.Tools.deepClone({...this._criteria,colId:this._column})}hasCache(){return this._filteredOutRows!==null}setRangeAndColumn(e,t){this._range=e,this._column=t}setCriteria(e){this._criteria=e,this._generateFilterFn(),this._filteredOutRows=null}getColumnData(){return u.Tools.deepClone(this._criteria)}reCalc(){return this._filteredOutRows=this.calc(this._filterColumnContext),this._filteredOutRows}calc(e){if(!this._filterFn)throw new Error("[FilterColumn] cannot calculate without a filter fn!");if(!this._range)throw new Error("[FilterColumn] cannot calculate without a range!");if(typeof this._column!="number")throw new TypeError("[FilterColumn] cannot calculate without a column offset!");const t=this._column,r={startColumn:t,endColumn:t,startRow:this._range.startRow+1,endRow:this._range.endRow},s=new Set,o=e.getAlreadyFilteredOutRows();for(const l of this._worksheet.iterateByColumn(r,!1,!1)){const{row:a,rowSpan:d,col:m}=l;if(o.has(a)&&(!d||d===1))continue;const c=this._filterByValues?u.extractPureTextFromCell(this._worksheet.getCell(a,m)):Ee(this._worksheet,a,m);if(!this._filterFn(c)&&(s.add(a),d))for(let h=1;h<d;h++)s.add(a+h)}return s}_generateFilterFn(){this._criteria&&(this._filterFn=Re(this._criteria),this._filterByValues=!!this._criteria.filters)}}function Re(i){if(i.filters)return Se(i.filters);if(i.customFilters)return Fe(i.customFilters);throw new Error("[FilterModel]: other types of filters are not supported yet.")}function Se(i){const n=!!i.blank,e=new Set(i.filters);return t=>t===void 0||t===""?n:e.has(typeof t=="string"?t:`${t}`)}function Fe(i){const n=i.customFilters.map(e=>Me(e));return we(n)?i.and?pe(n):ve(n):n[0]}function pe(i){const[n,e]=i;return t=>n(t)&&e(t)}function ve(i){const[n,e]=i;return t=>n(t)||e(t)}function we(i){return i.length===2}function Me(i){const n=i.val;if(i.operator===I.NOT_EQUALS&&!ne(n))return r=>H.fn(r,n);if(ge(i.operator)){if(!ne(n))return()=>!1;const r=z(i.operator),s=Number(n);return o=>r.fn(o,s)}const e=z(i.operator);return t=>e.fn(t,n)}function Ee(i,n,e){const t=i.getCell(n,e);if(!t)return null;const r=i.getCellRaw(n,e);return t&&!r?le(t):r?t.t===u.CellValueType.NUMBER&&typeof t.v=="string"?r.v:le(r):null}function le(i){var t,r;const n=(r=(t=i.p)==null?void 0:t.body)==null?void 0:r.dataStream;if(n)return n.trimEnd();const e=i.v;return typeof e=="string"?i.t===u.CellValueType.BOOLEAN?e.toUpperCase():e:typeof e=="number"?i.t===u.CellValueType.BOOLEAN?e?"TRUE":"FALSE":e:typeof e=="boolean"?e?"TRUE":"FALSE":""}var ye=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(i,n,e,t)=>{for(var r=t>1?void 0:t?Oe(n,e):n,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(t?o(n,e,r):o(r))||r);return t&&r&&ye(n,e,r),r},j=(i,n)=>(e,t)=>n(e,t,i);const V="SHEET_FILTER_PLUGIN";g.SheetsFilterService=class extends u.Disposable{constructor(e,t,r){super();M(this,"_filterModels",new Map);M(this,"_loadedUnitId$",new T.BehaviorSubject(null));M(this,"loadedUnitId$",this._loadedUnitId$.asObservable());M(this,"_errorMsg$",new T.BehaviorSubject(null));M(this,"errorMsg$",this._errorMsg$.asObservable());M(this,"_activeFilterModel$",new T.BehaviorSubject(null));M(this,"activeFilterModel$",this._activeFilterModel$.asObservable());this._resourcesManagerService=e,this._univerInstanceService=t,this._commandService=r,this._initModel(),this._initActiveFilterModel()}get activeFilterModel(){return this._activeFilterModel$.getValue()}ensureFilterModel(e,t){const r=this.getFilterModel(e,t);if(r)return r;const s=this._univerInstanceService.getUniverSheetInstance(e);if(!s)throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing workbook ${e}!`);const o=s.getSheetBySheetId(t);if(!o)throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing worksheet ${t}!`);const l=new P(e,t,o);return this._cacheFilterModel(e,t,l),l}getFilterModel(e,t){var r,s;return(s=(r=this._filterModels.get(e))==null?void 0:r.get(t))!=null?s:null}removeFilterModel(e,t){const r=this.getFilterModel(e,t);return r?(r.dispose(),this._filterModels.get(e).delete(t),!0):!1}setFilterErrorMsg(e){this._errorMsg$.next(e)}_updateActiveFilterModel(){let e;try{if(e=this._univerInstanceService.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET),!e){this._activeFilterModel$.next(null);return}}catch(l){console.error("[SheetsFilterService]: could not get active workbook!",l);return}const t=e.getActiveSheet(!0);if(!t){this._activeFilterModel$.next(null);return}const r=t.getUnitId(),s=t.getSheetId(),o=this.getFilterModel(r,s);this._activeFilterModel$.next(o)}_initActiveFilterModel(){this.disposeWithMe(T.merge(u.fromCallback(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(T.filter(([e])=>e.type===u.CommandType.MUTATION&&K.has(e.id))),this._univerInstanceService.getCurrentTypeOfUnit$(u.UniverInstanceType.UNIVER_SHEET).pipe(T.switchMap(e=>{var t;return(t=e==null?void 0:e.activeSheet$)!=null?t:T.of(null)}))).subscribe(()=>this._updateActiveFilterModel()))}_serializeAutoFiltersForUnit(e){const t=this._filterModels.get(e);if(!t)return"{}";const r={};return t.forEach((s,o)=>{r[o]=s.serialize()}),JSON.stringify(r)}_deserializeAutoFiltersForUnit(e,t){const r=this._univerInstanceService.getUniverSheetInstance(e);Object.keys(t).forEach(s=>{const o=t[s],l=P.deserialize(e,s,r.getSheetBySheetId(s),o);this._cacheFilterModel(e,s,l)})}_initModel(){this._resourcesManagerService.registerPluginResource({pluginName:V,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>this._serializeAutoFiltersForUnit(e),parseJson:e=>JSON.parse(e),onLoad:(e,t)=>{this._deserializeAutoFiltersForUnit(e,t),this._loadedUnitId$.next(e),this._updateActiveFilterModel()},onUnLoad:e=>{const t=this._filterModels.get(e);t&&(t.forEach(r=>r.dispose()),this._filterModels.delete(e))}})}_cacheFilterModel(e,t,r){this._filterModels.has(e)||this._filterModels.set(e,new Map),this._filterModels.get(e).set(t,r)}},g.SheetsFilterService=Te([j(0,u.IResourceManagerService),j(1,u.IUniverInstanceService),j(2,u.ICommandService)],g.SheetsFilterService);const F={id:Q,type:u.CommandType.MUTATION,handler:(i,n)=>{const{subUnitId:e,unitId:t,range:r}=n;return i.get(g.SheetsFilterService).ensureFilterModel(t,e).setRange(r),!0}},p={id:G,type:u.CommandType.MUTATION,handler:(i,n)=>{const{subUnitId:e,unitId:t,criteria:r,col:s,reCalc:o=!0}=n,a=i.get(g.SheetsFilterService).getFilterModel(t,e);return a?(a.setCriteria(s,r,o),!0):!1}},O={id:J,type:u.CommandType.MUTATION,handler:(i,n)=>{const{unitId:e,subUnitId:t}=n;return i.get(g.SheetsFilterService).removeFilterModel(e,t)}},b={id:Y,type:u.CommandType.MUTATION,handler:(i,n)=>{const{unitId:e,subUnitId:t}=n,s=i.get(g.SheetsFilterService).getFilterModel(e,t);return s?(s.reCalc(),!0):!1}};function Ie(i,n){for(let e=0;e<i.length;e++){let t=e;if(i[e])for(let r=e+1;r<i.length;r++)i[t]&&i[r]&&n(i[t],i[r])&&(i[t]=null,t=r)}return i.filter(e=>e!==null)}function $(i){return Ie(i,(n,e)=>n.id===p.id&&e.id===p.id&&n.params.unitId===e.params.unitId&&n.params.subUnitId===e.params.subUnitId&&n.params.col===e.params.col)}var Ae=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ue=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ne(n,e):n,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(t?o(n,e,r):o(r))||r);return t&&r&&Ae(n,e,r),r},L=(i,n)=>(e,t)=>n(e,t,i);let B=class extends u.Disposable{constructor(n,e,t,r,s){super();M(this,"_disposableCollection",new u.DisposableCollection);this._commandService=n,this._sheetInterceptorService=e,this._sheetsFilterService=t,this._univerInstanceService=r,this._refRangeService=s,this._initCommands(),this._initRowFilteredInterceptor(),this._initInterceptors(),this._commandExecutedListener(),this._initErrorHandling()}_initCommands(){[p,F,b,O].forEach(n=>this.disposeWithMe(this._commandService.registerCommand(n)))}_initInterceptors(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:n=>this._getUpdateFilter(n)})),this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===R.SetWorksheetActiveOperation.id){const e=n.params,t=e.subUnitId,r=e.unitId;if(!t||!r)return;this._registerRefRange(r,t)}if(n.id===F.id){const e=n.params,t=e.subUnitId,r=e.unitId;if(!t||!r)return;this._registerRefRange(e.unitId,e.subUnitId)}})),this.disposeWithMe(this._sheetsFilterService.loadedUnitId$.subscribe(n=>{if(n){const e=this._univerInstanceService.getUniverSheetInstance(n),t=e==null?void 0:e.getActiveSheet();t&&this._registerRefRange(n,t.getSheetId())}}))}_registerRefRange(n,e){var l;this._disposableCollection.dispose();const t=this._univerInstanceService.getUniverSheetInstance(n),r=t==null?void 0:t.getSheetBySheetId(e);if(!t||!r)return;const s=(l=this._sheetsFilterService.getFilterModel(n,e))==null?void 0:l.getRange(),o=a=>{switch(a.id){case R.InsertRowCommand.id:{const d=a.params,m=d.unitId||n,c=d.subUnitId||e;return this._handleInsertRowCommand(d,m,c)}case R.InsertColCommand.id:{const d=a.params,m=d.unitId||n,c=d.subUnitId||e;return this._handleInsertColCommand(d,m,c)}case R.RemoveColCommand.id:{const d=a.params;return this._handleRemoveColCommand(d,n,e)}case R.RemoveRowCommand.id:{const d=a.params;return this._handleRemoveRowCommand(d,n,e)}case R.EffectRefRangId.MoveColsCommandId:{const d=a.params;return this._handleMoveColsCommand(d,n,e)}case R.EffectRefRangId.MoveRowsCommandId:{const d=a.params;return this._handleMoveRowsCommand(d,n,e)}case R.MoveRangeCommand.id:{const d=a.params;return this._handleMoveRangeCommand(d,n,e)}}return{redos:[],undos:[]}};s&&this._disposableCollection.add(this._refRangeService.registerRefRange(s,o,n,e))}_getUpdateFilter(n){const{id:e}=n;switch(e){case R.RemoveSheetCommand.id:{const t=n.params;return this._handleRemoveSheetCommand(t,t.unitId,t.subUnitId)}case R.CopySheetCommand.id:{const t=n.params,{targetSubUnitId:r,unitId:s,subUnitId:o}=t;return!s||!o||!r?this._handleNull():this._handleCopySheetCommand(s,o,r)}}return{redos:[],undos:[]}}_handleInsertColCommand(n,e,t){var S;const r=this._sheetsFilterService.getFilterModel(e,t),s=(S=r==null?void 0:r.getRange())!=null?S:null;if(!r||!s)return this._handleNull();const{startColumn:o,endColumn:l}=s,{startColumn:a,endColumn:d}=n.range,m=d-a+1;if(d>l)return this._handleNull();const c=[],h=[],C=a,_={unitId:e,subUnitId:t,range:{...s,startColumn:a<=o?o+m:o,endColumn:l+m}},v={unitId:e,subUnitId:t,range:s};c.push({id:F.id,params:_}),h.push({id:F.id,params:v});const w=r.getAllFilterColumns().filter(f=>f[0]>=C);if(w.length!==0){const{newRange:f,oldRange:y}=this.moveCriteria(e,t,w,m);c.push(...f.redos,...y.redos),h.push(...f.undos,...y.undos)}return{redos:$(c),undos:$(h)}}_handleInsertRowCommand(n,e,t){var v;const r=this._sheetsFilterService.getFilterModel(e,t),s=(v=r==null?void 0:r.getRange())!=null?v:null;if(!r||!s)return this._handleNull();const{startRow:o,endRow:l}=s,{startRow:a,endRow:d}=n.range,m=d-a+1;if(d>l)return this._handleNull();const c=[],h=[],C={unitId:e,subUnitId:t,range:{...s,startRow:a<=o?o+m:o,endRow:l+m}},_={unitId:e,subUnitId:t,range:s};return c.push({id:F.id,params:C}),h.push({id:F.id,params:_}),{redos:$(c),undos:$(h)}}_handleRemoveColCommand(n,e,t){var w;const r=this._sheetsFilterService.getFilterModel(e,t),s=(w=r==null?void 0:r.getRange())!=null?w:null;if(!r||!s)return this._handleNull();const{startColumn:o,endColumn:l}=s,{startColumn:a,endColumn:d}=n.range;if(a>l)return this._handleNull();const m=[],c=[],h=d<o?0:Math.min(d,l)-Math.max(a,o)+1,C=d-a+1,_=r.getAllFilterColumns();_.forEach(S=>{const[f,y]=S;f<=d&&f>=a&&(m.push({id:p.id,params:{unitId:e,subUnitId:t,col:f,criteria:null}}),c.push({id:p.id,params:{unitId:e,subUnitId:t,col:f,criteria:{...y.serialize(),colId:f}}}))});const v=_.filter(S=>{const[f,y]=S;return f>d});let E={undos:[],redos:[]};if(v.length>0){const{oldRange:S,newRange:f}=this.moveCriteria(e,t,v,-C);E=f,m.push(...S.redos),c.unshift(...S.undos)}if(h===l-o+1){const S={unitId:e,subUnitId:t};m.push({id:O.id,params:S}),c.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}})}else{const S=o<=a?o:h===0?o-C:a,f=o<=a?l-h:l-C,y={unitId:e,subUnitId:t,range:{...s,startColumn:S,endColumn:f}};m.push({id:F.id,params:y}),c.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}}),m.push(...E.redos),c.unshift(...E.undos)}return{undos:c,redos:m}}_handleRemoveRowCommand(n,e,t){var v;const r=this._sheetsFilterService.getFilterModel(e,t);if(!r)return this._handleNull();const s=r.getRange(),{startRow:o,endRow:l}=s,{startRow:a,endRow:d}=n.range;if(a>l)return this._handleNull();if(d<o)return{undos:[{id:F.id,params:{range:s,unitId:e,subUnitId:t}}],redos:[{id:F.id,params:{range:{...s,startRow:o-(d-a+1),endRow:l-(d-a+1)},unitId:e,subUnitId:t}}]};const m=[],c=[],h=r.getAllFilterColumns(),C=o<=d&&o>=a;c.push({id:F.id,params:{range:s,unitId:e,subUnitId:t}});const _=Math.min(d,l)-Math.max(a,o)+1;if(_===l-o+1||C){const E={unitId:e,subUnitId:t};m.push({id:O.id,params:E}),h.forEach(w=>{const[S,f]=w,y={unitId:e,subUnitId:t,col:S,criteria:{...f.serialize(),colId:S}};c.push({id:p.id,params:y})})}else{const E=(v=this._univerInstanceService.getUniverSheetInstance(e))==null?void 0:v.getSheetBySheetId(t);if(!E)return this._handleNull();const w=[];for(let A=a;A<=d;A++)E.getRowFiltered(A)&&w.push(A);const S=Math.min(o,a),f=S+(l-o)-_+w.length,y={unitId:e,subUnitId:t,range:{...s,startRow:S,endRow:f}};m.push({id:F.id,params:y})}return{undos:$(c),redos:$(m)}}_handleMoveColsCommand(n,e,t){var S;const r=this._sheetsFilterService.getFilterModel(e,t),s=(S=r==null?void 0:r.getRange())!=null?S:null;if(!r||!s)return this._handleNull();const{startColumn:o,endColumn:l}=s,{fromRange:a,toRange:d}=n;if(a.endColumn<o&&d.startColumn<=o||a.startColumn>l&&d.endColumn>l)return this._handleNull();const m=[],c=[],h={};for(let f=o;f<=l;f++)h[f]={colIndex:f,filter:r.getFilterColumn(f)};u.moveMatrixArray(a.startColumn,a.endColumn-a.startColumn+1,d.startColumn,h);let C=s.startColumn,_=s.endColumn;o>=a.startColumn&&o<=a.endColumn&&d.startColumn>a.startColumn&&a.endColumn<l&&(C=a.endColumn+1),l>=a.startColumn&&l<=a.endColumn&&d.startColumn<a.startColumn&&a.startColumn>o&&(_=a.startColumn-1);const v=Object.keys(h).map(f=>Number(f)),E=v.find(f=>h[f].colIndex===_),w=v.find(f=>h[f].colIndex===C);if(v.forEach(f=>{var he,me;const{colIndex:y,filter:A}=h[f],N=f;if(A){if(N>=w&&N<=E){const W={unitId:e,subUnitId:t,col:N,criteria:{...A.serialize(),colId:N}},Ve={unitId:e,subUnitId:t,col:N,criteria:r.getFilterColumn(N)?{...(he=r.getFilterColumn(N))==null?void 0:he.serialize(),colId:N}:null};m.push({id:p.id,params:W}),c.push({id:p.id,params:Ve})}if(!((me=h[y])!=null&&me.filter)){const W={unitId:e,subUnitId:t,col:y,criteria:null};m.push({id:p.id,params:W}),c.push({id:p.id,params:{unitId:e,subUnitId:t,col:y,criteria:{...A.serialize(),colId:y}}})}}}),o!==w||l!==E){const f={unitId:e,subUnitId:t,range:{...s,startColumn:w,endColumn:E}};m.unshift({id:F.id,params:f}),c.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}})}return{undos:c,redos:m}}_handleMoveRowsCommand(n,e,t){var S;const r=this._sheetsFilterService.getFilterModel(e,t),s=(S=r==null?void 0:r.getRange())!=null?S:null;if(!r||!s)return this._handleNull();const{startRow:o,endRow:l}=s,{fromRange:a,toRange:d}=n;if(a.endRow<o&&d.startRow<=o||a.startRow>l&&d.endRow>l)return this._handleNull();const m=[],c=[],h={};for(let f=o;f<=l;f++)h[f]={oldIndex:f};const C=o;let _=l;l>=a.startRow&&l<=a.endRow&&d.startRow<a.startRow&&a.startRow>o&&(_=a.startRow-1),u.moveMatrixArray(a.startRow,a.endRow-a.startRow+1,d.startRow,h);const v=Object.keys(h).map(f=>Number(f)),E=v.find(f=>h[f].oldIndex===_),w=v.find(f=>h[f].oldIndex===C);if(o!==w||l!==E){const f={unitId:e,subUnitId:t,range:{...s,startRow:w,endRow:E}};m.push({id:F.id,params:f},{id:b.id,params:{unitId:e,subUnitId:t}}),c.push({id:F.id,params:{range:s,unitId:e,subUnitId:t}},{id:b.id,params:{unitId:e,subUnitId:t}})}return{redos:m,undos:c}}_handleMoveRangeCommand(n,e,t){const{fromRange:r,toRange:s}=n,o=this._sheetsFilterService.getFilterModel(e,t);if(!o)return this._handleNull();const l=o.getRange();if(!l)return this._handleNull();const a=[],d=[];if(u.Rectangle.contains(r,l)){const m=l.startRow-r.startRow,c=l.startColumn-r.startColumn,h={startRow:s.startRow+m,startColumn:s.startColumn+c,endRow:s.startRow+m+(l.endRow-l.startRow),endColumn:s.startColumn+c+(l.endColumn-l.startColumn)},C={id:O.id,params:{unitId:e,subUnitId:t}},_={id:F.id,params:{unitId:e,subUnitId:t,range:h}},v={id:F.id,params:{unitId:e,subUnitId:t,range:l}};a.push(C,_),d.push(C,v);const E=o.getAllFilterColumns(),w=s.startColumn-r.startColumn;E.forEach(S=>{const[f,y]=S;y&&(a.push({id:p.id,params:{unitId:e,subUnitId:t,col:f+w,criteria:{...y.serialize(),colId:f+w}}}),d.push({id:p.id,params:{unitId:e,subUnitId:t,col:f,criteria:{...y.serialize(),colId:f}}}))})}else if(u.Rectangle.intersects(s,l)){const m={...l,endRow:Math.max(l.endRow,s.endRow)};a.push({id:F.id,params:{unitId:e,subUnitId:t,range:m}}),d.push({id:F.id,params:{unitId:e,subUnitId:t,range:l}})}return{redos:a,undos:d}}_handleRemoveSheetCommand(n,e,t){const r=this._sheetsFilterService.getFilterModel(e,t);if(!r)return this._handleNull();const s=r.getRange();if(!s)return this._handleNull();const o=[],l=[];return r.getAllFilterColumns().forEach(([d,m])=>{l.push({id:p.id,params:{unitId:e,subUnitId:t,col:d,criteria:{...m.serialize(),colId:d}}})}),o.push({id:O.id,params:{unitId:e,subUnitId:t,range:s}}),l.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}}),{undos:l,redos:o}}_handleCopySheetCommand(n,e,t){const r=this._sheetsFilterService.getFilterModel(n,e);if(!r)return this._handleNull();const s=r.getRange();if(!s)return this._handleNull();const o=[],l=[],a=[],d=[];return r.getAllFilterColumns().forEach(([c,h])=>{o.push({id:p.id,params:{unitId:n,subUnitId:t,col:c,criteria:{...h.serialize(),colId:c}}}),a.push({id:p.id,params:{unitId:n,subUnitId:t,col:c,criteria:null}})}),a.push({id:O.id,params:{unitId:n,subUnitId:t,range:s}}),o.unshift({id:F.id,params:{range:s,unitId:n,subUnitId:t}}),{undos:l,redos:o,preUndos:a,preRedos:d}}_handleNull(){return{redos:[],undos:[]}}_initRowFilteredInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(R.INTERCEPTOR_POINT.ROW_FILTERED,{handler:(n,e)=>{var t,r;return n?!0:(r=(t=this._sheetsFilterService.getFilterModel(e.unitId,e.subUnitId))==null?void 0:t.isRowFiltered(e.row))!=null?r:!1}}))}moveCriteria(n,e,t,r){const s={unitId:n,subUnitId:e,criteria:null,col:-1},o=[],l=[],a=[],d=[];return t.forEach(m=>{const[c,h]=m;l.push({id:p.id,params:{...s,col:c}}),o.push({id:p.id,params:{...s,col:c,criteria:{...h.serialize(),colId:c}}})}),t.forEach(m=>{const[c,h]=m;d.push({id:p.id,params:{...s,col:c+r,criteria:{...h.serialize(),colId:c+r}}}),a.push({id:p.id,params:{...s,col:c+r,criteria:null}})}),{newRange:{redos:d,undos:a},oldRange:{redos:l,undos:o}}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted((n,e)=>{var d,m;const{unitId:t,subUnitId:r}=n.params||{},s=this._sheetsFilterService.getFilterModel(t,r);if(!s)return;const o=Array.from(s.filteredOutRows).sort((c,h)=>c-h),l=[];let a=!1;if(n.id===R.RemoveRowMutation.id){const{startRow:c,endRow:h}=n.params.range,C=o.filter(_=>_>=c&&_<=h);o.forEach(_=>{if(_<c)l.push(_);else if(a=!0,_<=h){const v=Math.max(c,l.length?l[l.length-1]+1:c);l.push(v)}else l.push(_-(h-c+1-C.length))})}if(n.id===R.InsertRowMutation.id){const{startRow:c,endRow:h}=n.params.range;o.forEach(C=>{C>=c?(a=!0,l.push(C+(h-c+1))):l.push(C)})}if(a&&(s.filteredOutRows=new Set(l)),n.id===R.SetRangeValuesMutation.id&&!(e!=null&&e.onlyLocal)){const c=this._getExtendRegion(t,r);if(c){const h=n.params.cellValue;if(h)for(let C=c.startColumn;C<=c.endColumn;C++){const _=(d=h==null?void 0:h[c.startRow])==null?void 0:d[C];if(_&&this._cellHasValue(_)){const v=(m=this._univerInstanceService.getUnit(t))==null?void 0:m.getSheetBySheetId(r);if(v){const E=R.expandToContinuousRange(c,{down:!0},v),w=this._sheetsFilterService.getFilterModel(t,r),S=w.getRange();w.setRange({...S,endRow:E.endRow}),this._registerRefRange(t,r)}}}}}}))}_getExtendRegion(n,e){var a;const t=this._sheetsFilterService.getFilterModel(n,e);if(!t)return null;const r=(a=this._univerInstanceService.getUnit(n))==null?void 0:a.getSheetBySheetId(e);if(!r)return null;const s=t.getRange();if(!s)return null;const o=r.getRowCount()-1,l=r.getRowManager();for(let d=s.endRow+1;d<=o;d++)if(l.getRowRawVisible(d))return{startRow:d,endRow:d,startColumn:s.startColumn,endColumn:s.endColumn};return null}_initErrorHandling(){this.disposeWithMe(this._commandService.beforeCommandExecuted(n=>{const e=n.params,t=R.getSheetCommandTarget(this._univerInstanceService);if(!t)return;const{subUnitId:r,unitId:s}=t,o=this._sheetsFilterService.getFilterModel(s,r);if(!o)return;const l=o.getRange();if(n.id===R.MoveRowsCommand.id&&e.fromRange.startRow<=l.startRow&&e.fromRange.endRow<l.endRow&&e.fromRange.endRow>=l.startRow)throw this._sheetsFilterService.setFilterErrorMsg("sheets-filter.msg.filter-header-forbidden"),new Error("[SheetsFilterController]: Cannot move header row of filter")}))}_cellHasValue(n){const e=Object.values(n);return!(e.length===0||e.every(t=>t==null))}};B=Ue([L(0,u.ICommandService),L(1,u.Inject(R.SheetInterceptorService)),L(2,u.Inject(g.SheetsFilterService)),L(3,u.IUniverInstanceService),L(4,u.Inject(R.RefRangeService))],B);var $e=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,be=(i,n,e,t)=>{for(var r=t>1?void 0:t?Pe(n,e):n,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(t?o(n,e,r):o(r))||r);return t&&r&&$e(n,e,r),r},ae=(i,n)=>(e,t)=>n(e,t,i);g.UniverSheetsFilterPlugin=(x=class extends u.Plugin{constructor(n=q,e,t){super(),this._config=n,this._injector=e,this._configService=t;const{...r}=u.merge({},q,this._config);this._configService.setConfig(fe,r)}onStarting(){[[g.SheetsFilterService],[B]].forEach(n=>this._injector.add(n))}onReady(){this._injector.get(B)}},M(x,"type",u.UniverInstanceType.UNIVER_SHEET),M(x,"pluginName",V),x),g.UniverSheetsFilterPlugin=be([ae(1,u.Inject(u.Injector)),ae(2,u.IConfigService)],g.UniverSheetsFilterPlugin);const de={id:"sheet.command.set-filter-range",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=i.get(u.IUndoRedoService),s=i.get(u.IUniverInstanceService),{unitId:o,subUnitId:l,range:a}=n;if(!R.getSheetCommandTarget(s,n)||e.getFilterModel(o,l))return!1;if(a.endRow===a.startRow){const C=i.get(u.ErrorService),_=i.get(u.LocaleService);return C.emit(_.t("sheets-filter.command.not-valid-filter-range")),!1}const c={id:F.id,params:{unitId:o,subUnitId:l,range:a}},h=t.syncExecuteCommand(c.id,c.params);return h&&r.pushUndoRedo({unitID:o,undoMutations:[{id:O.id,params:{unitId:o,subUnitId:l}}],redoMutations:[c]}),h}},ue={id:"sheet.command.remove-sheet-filter",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(u.IUniverInstanceService),t=i.get(g.SheetsFilterService),r=i.get(u.ICommandService),s=i.get(u.IUndoRedoService),o=R.getSheetCommandTarget(e,n);if(!o)return!1;const{unitId:l,subUnitId:a}=o,d=t.getFilterModel(l,a);if(!d)return!1;const m=d==null?void 0:d.serialize(),c=ze(l,a,m),h=r.syncExecuteCommand(O.id,{unitId:l,subUnitId:a});return h&&s.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:[{id:O.id,params:{unitId:l,subUnitId:a}}]}),h}},Le={id:"sheet.command.smart-toggle-filter",type:u.CommandType.COMMAND,handler:async i=>{const n=i.get(u.IUniverInstanceService),e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=n.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET),s=r==null?void 0:r.getActiveSheet();if(!s||!r)return!1;const o=r.getUnitId(),l=s.getSheetId();if(e.getFilterModel(o,l))return t.executeCommand(ue.id,{unitId:o,subUnitId:l});const m=i.get(R.SheetsSelectionsService).getCurrentLastSelection();if(!m)return!1;const c=m.range,h=R.isSingleCellSelection(m)?R.expandToContinuousRange(c,{left:!0,right:!0,up:!0,down:!0},s):c;return t.executeCommand(de.id,{unitId:o,subUnitId:l,range:h})}},Be={id:"sheet.command.set-filter-criteria",type:u.CommandType.COMMAND,handler:async(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=i.get(u.IUndoRedoService),{unitId:s,subUnitId:o,col:l,criteria:a}=n,d=e.getFilterModel(s,o);if(!d)return!1;const m=d.getRange();if(!m||l<m.startColumn||l>m.endColumn)return!1;const c=d.getFilterColumn(l),h=je(s,o,l,c),C={id:p.id,params:{unitId:s,subUnitId:o,col:l,criteria:a}},_=t.syncExecuteCommand(C.id,C.params);return _&&r.pushUndoRedo({unitID:s,undoMutations:[h],redoMutations:[C]}),_}},xe={id:"sheet.command.clear-filter-criteria",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.IUndoRedoService),r=i.get(u.ICommandService),s=i.get(u.IUniverInstanceService),o=R.getSheetCommandTarget(s,n);if(!o)return!1;const{unitId:l,subUnitId:a}=o,d=e.getFilterModel(o.unitId,o.subUnitId);if(!d)return!1;const m=d.serialize(),c=ce(l,a,m),h=De(l,a,m);return u.sequenceExecute(h,r).result?(t.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:h}),!0):!1}},He={id:"sheet.command.re-calc-filter",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=i.get(u.IUniverInstanceService),s=R.getSheetCommandTarget(r,n);if(!s)return!1;const{unitId:o,subUnitId:l}=s;return e.getFilterModel(s.unitId,s.subUnitId)?t.executeCommand(b.id,{unitId:o,subUnitId:l}):!1}};function ze(i,n,e){const t=[],r={id:F.id,params:{unitId:i,subUnitId:n,range:e.ref}};return t.push(r),ce(i,n,e).forEach(o=>t.push(o)),t}function ce(i,n,e){var r;const t=[];return(r=e.filterColumns)==null||r.forEach(s=>{const o={id:p.id,params:{unitId:i,subUnitId:n,col:s.colId,criteria:s}};t.push(o)}),t}function De(i,n,e){var r;const t=[];return(r=e.filterColumns)==null||r.forEach(s=>{const o={id:p.id,params:{unitId:i,subUnitId:n,col:s.colId,criteria:null}};t.push(o)}),t}function je(i,n,e,t){if(!t)return{id:p.id,params:{unitId:i,subUnitId:n,col:e,criteria:null}};const r=t.serialize();return{id:p.id,params:{unitId:i,subUnitId:n,col:e,criteria:r}}}g.ClearSheetsFilterCriteriaCommand=xe,g.CustomFilterOperator=I,g.FILTER_MUTATIONS=K,g.FilterColumn=oe,g.FilterModel=P,g.ReCalcSheetsFilterCommand=He,g.ReCalcSheetsFilterMutation=b,g.RemoveSheetFilterCommand=ue,g.RemoveSheetsFilterMutation=O,g.SHEET_FILTER_SNAPSHOT_ID=V,g.SetSheetFilterRangeCommand=de,g.SetSheetsFilterCriteriaCommand=Be,g.SetSheetsFilterCriteriaMutation=p,g.SetSheetsFilterRangeMutation=F,g.SmartToggleSheetsFilterCommand=Le,g.equals=te,g.getCustomFilterFn=z,g.greaterThan=X,g.greaterThanOrEqualTo=Z,g.lessThan=k,g.lessThanOrEqualTo=ee,g.notEquals=H,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
40
|
+
(function(g,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","rxjs"],u):(g=typeof globalThis<"u"?globalThis:g||self,u(g.UniverSheetsFilter={},g.UniverCore,g.UniverSheets,g.rxjs))})(this,function(g,u,R,T){"use strict";var We=Object.defineProperty;var qe=(g,u,R)=>u in g?We(g,u,{enumerable:!0,configurable:!0,writable:!0,value:R}):g[u]=R;var M=(g,u,R)=>qe(g,typeof u!="symbol"?u+"":u,R);var x;const fe="sheets-filter.config",q={},Q="sheet.mutation.set-filter-range",G="sheet.mutation.set-filter-criteria",J="sheet.mutation.remove-filter",Y="sheet.mutation.re-calc-filter",K=new Set([Q,G,J,Y]);var I=(i=>(i.EQUAL="equal",i.GREATER_THAN="greaterThan",i.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",i.LESS_THAN="lessThan",i.LESS_THAN_OR_EQUAL="lessThanOrEqual",i.NOT_EQUALS="notEqual",i))(I||{});const X={operator:I.GREATER_THAN,fn:(i,n)=>U(i)?i>n:!1},Z={operator:I.GREATER_THAN_OR_EQUAL,fn:(i,n)=>U(i)?i>=n:!1},k={operator:I.LESS_THAN,fn:(i,n)=>U(i)?i<n:!1},ee={operator:I.LESS_THAN_OR_EQUAL,fn:(i,n)=>U(i)?i<=n:!1},te={operator:I.EQUAL,fn:(i,n)=>U(i)?i===n:!1},H={operator:I.NOT_EQUALS,fn:(i,n)=>{if(typeof n=="string"){if(n===" ")return i!=null;const e=ie(i);return e&&_e(n)?!se(n).test(e):e!==n}return U(i)?i!==n:!0}},re=new Map([]);[X,Z,k,ee,te,H].forEach(i=>{re.set(i.operator,i)});function ge(i){return!!i}const Ce={fn:(i,n)=>{const e=ie(i);return e===null?n==="":se(n).test(e)}};function z(i){return i?re.get(i):Ce}function U(i){return typeof i=="number"}function ne(i){return!!(typeof i=="number"||typeof i=="string"&&u.isNumeric(i))}function ie(i){return typeof i=="boolean"||i==null?null:typeof i=="string"?i:i.toString()}function _e(i){return typeof i=="number"?!1:i.indexOf("*")!==-1||i.indexOf("?")!==-1}function se(i){const n=i.replace(/[.+^${}()|[\]\\]/g,"\\$&").replaceAll("?",".").replace(/[*]/g,".$&");return new RegExp(`^${n}$`)}const D=()=>new Set;class P extends u.Disposable{constructor(e,t,r){super();M(this,"_filteredOutRows$",new T.BehaviorSubject(D()));M(this,"filteredOutRows$",this._filteredOutRows$.asObservable());M(this,"_hasCriteria$",new T.BehaviorSubject(!1));M(this,"hasCriteria$",this._hasCriteria$.asObservable());M(this,"_filterColumnByIndex",new Map);M(this,"_alreadyFilteredOutRows",D());M(this,"_range");this.unitId=e,this.subUnitId=t,this._worksheet=r}get filteredOutRows(){return this._filteredOutRows$.getValue()}set filteredOutRows(e){this._alreadyFilteredOutRows=e,this._filteredOutRows$.next(e)}dispose(){super.dispose(),this._filteredOutRows$.complete(),this._hasCriteria$.complete()}serialize(){const e={ref:u.Rectangle.clone(this._range),filterColumns:this._getAllFilterColumns(!0).sort(([t],[r])=>t-r).map(([t,r])=>r.serialize())};return this._alreadyFilteredOutRows&&(e.cachedFilteredOut=Array.from(this._alreadyFilteredOutRows).sort()),e}static deserialize(e,t,r,s){const o=new P(e,t,r);return o._dump(s),o}_dump(e){var t;this.setRange(e.ref),(t=e.filterColumns)==null||t.forEach(r=>this._setCriteriaWithoutReCalc(r.colId,r)),e.cachedFilteredOut&&(this._alreadyFilteredOutRows=new Set(e.cachedFilteredOut),this._emit()),this._emitHasCriteria()}isRowFiltered(e){return this._alreadyFilteredOutRows.has(e)}getRange(){if(!this._range)throw new Error("[FilterModel] could not get range before a range is set!");return this._range}getFilteredOutRowsExceptCol(e){return this._getAllFilterColumns(!0).filter(([t])=>t!==e).reduce((t,[,r])=>{const s=r.calc({getAlreadyFilteredOutRows:()=>t});return s?u.mergeSets(t,s):t},new Set)}setRange(e){this._range=e,this._getAllFilterColumns(!0).forEach(([t,r])=>{r.setRangeAndColumn({startRow:e.startRow,endRow:e.endRow,startColumn:t,endColumn:t},t)})}setCriteria(e,t,r=!1){if(!this._range)throw new Error("[FilterModel] could not set criteria before a range is set!");if(!t){this._removeCriteria(e),this._rebuildAlreadyFilteredOutRowsWithCache(),r&&this._reCalcAllColumns(),this._emit(),this._emitHasCriteria();return}this._setCriteriaWithoutReCalc(e,t),r&&(this._rebuildAlreadyFilteredOutRowsWithCache(),this._reCalcWithNoCacheColumns(),this._emit(),this._emitHasCriteria())}getAllFilterColumns(){return this._getAllFilterColumns(!0)}getFilterColumn(e){var t;return(t=this._filterColumnByIndex.get(e))!=null?t:null}reCalc(){this._reCalcAllColumns(),this._emit()}_getAllFilterColumns(e=!1){const t=Array.from(this._filterColumnByIndex.entries());return e?t:t.map(([r,s])=>s)}_reCalcAllColumns(){this._alreadyFilteredOutRows=D(),this._getAllFilterColumns().forEach(e=>e.__clearCache()),this._reCalcWithNoCacheColumns()}_setCriteriaWithoutReCalc(e,t){const r=this._range;if(!r)throw new Error("[FilterModel] could not set criteria before a range is set!");const{startColumn:s,endColumn:o}=r;if(e>o||e<s)throw new Error(`[FilterModel] could not set criteria on column ${e} which is out of range!`);let l;this._filterColumnByIndex.has(e)?l=this._filterColumnByIndex.get(e):(l=new oe(this.unitId,this.subUnitId,this._worksheet,t,{getAlreadyFilteredOutRows:()=>this._alreadyFilteredOutRows}),l.setRangeAndColumn(r,e),this._filterColumnByIndex.set(e,l)),l.setCriteria(t)}_removeCriteria(e){const t=this._filterColumnByIndex.get(e);t&&(t.dispose(),this._filterColumnByIndex.delete(e))}_emit(){this._filteredOutRows$.next(this._alreadyFilteredOutRows)}_emitHasCriteria(){this._hasCriteria$.next(this._filterColumnByIndex.size>0)}_rebuildAlreadyFilteredOutRowsWithCache(){const e=this._getAllFilterColumns().filter(t=>t.hasCache()).reduce((t,r)=>u.mergeSets(t,r.filteredOutRows),new Set);this._alreadyFilteredOutRows=e}_reCalcWithNoCacheColumns(){const e=this._getAllFilterColumns().filter(t=>!t.hasCache());for(const t of e){const r=t.reCalc();r&&(this._alreadyFilteredOutRows=u.mergeSets(this._alreadyFilteredOutRows,r))}}}class oe extends u.Disposable{constructor(e,t,r,s,o){super();M(this,"_filteredOutRows",null);M(this,"_filterFn",null);M(this,"_range",null);M(this,"_column",0);M(this,"_filterByValues",!1);this.unitId=e,this.subUnitId=t,this._worksheet=r,this._criteria=s,this._filterColumnContext=o}get filteredOutRows(){return this._filteredOutRows}dispose(){super.dispose(),this._filteredOutRows=null}__clearCache(){this._filteredOutRows=null}serialize(){if(!this._criteria)throw new Error("[FilterColumn]: could not serialize without a filter column!");return u.Tools.deepClone({...this._criteria,colId:this._column})}hasCache(){return this._filteredOutRows!==null}setRangeAndColumn(e,t){this._range=e,this._column=t}setCriteria(e){this._criteria=e,this._generateFilterFn(),this._filteredOutRows=null}getColumnData(){return u.Tools.deepClone(this._criteria)}reCalc(){return this._filteredOutRows=this.calc(this._filterColumnContext),this._filteredOutRows}calc(e){if(!this._filterFn)throw new Error("[FilterColumn] cannot calculate without a filter fn!");if(!this._range)throw new Error("[FilterColumn] cannot calculate without a range!");if(typeof this._column!="number")throw new TypeError("[FilterColumn] cannot calculate without a column offset!");const t=this._column,r={startColumn:t,endColumn:t,startRow:this._range.startRow+1,endRow:this._range.endRow},s=new Set,o=e.getAlreadyFilteredOutRows();for(const l of this._worksheet.iterateByColumn(r,!1,!1)){const{row:a,rowSpan:d,col:m}=l;if(o.has(a)&&(!d||d===1))continue;const c=this._filterByValues?u.extractPureTextFromCell(this._worksheet.getCell(a,m)):Ee(this._worksheet,a,m);if(!this._filterFn(c)&&(s.add(a),d))for(let h=1;h<d;h++)s.add(a+h)}return s}_generateFilterFn(){this._criteria&&(this._filterFn=Re(this._criteria),this._filterByValues=!!this._criteria.filters)}}function Re(i){if(i.filters)return Se(i.filters);if(i.customFilters)return Fe(i.customFilters);throw new Error("[FilterModel]: other types of filters are not supported yet.")}function Se(i){const n=!!i.blank,e=new Set(i.filters);return t=>t===void 0||t===""?n:e.has(typeof t=="string"?t:`${t}`)}function Fe(i){const n=i.customFilters.map(e=>Me(e));return we(n)?i.and?pe(n):ve(n):n[0]}function pe(i){const[n,e]=i;return t=>n(t)&&e(t)}function ve(i){const[n,e]=i;return t=>n(t)||e(t)}function we(i){return i.length===2}function Me(i){const n=i.val;if(i.operator===I.NOT_EQUALS&&!ne(n))return r=>H.fn(r,n);if(ge(i.operator)){if(!ne(n))return()=>!1;const r=z(i.operator),s=Number(n);return o=>r.fn(o,s)}const e=z(i.operator);return t=>e.fn(t,n)}function Ee(i,n,e){const t=i.getCell(n,e);if(!t)return null;const r=i.getCellRaw(n,e);return t&&!r?le(t):r?t.t===u.CellValueType.NUMBER&&typeof t.v=="string"?r.v:le(r):null}function le(i){var t,r;const n=(r=(t=i.p)==null?void 0:t.body)==null?void 0:r.dataStream;if(n)return n.trimEnd();const e=i.v;return typeof e=="string"?i.t===u.CellValueType.BOOLEAN?e.toUpperCase():e:typeof e=="number"?i.t===u.CellValueType.BOOLEAN?e?"TRUE":"FALSE":e:typeof e=="boolean"?e?"TRUE":"FALSE":""}var ye=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(i,n,e,t)=>{for(var r=t>1?void 0:t?Oe(n,e):n,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(t?o(n,e,r):o(r))||r);return t&&r&&ye(n,e,r),r},j=(i,n)=>(e,t)=>n(e,t,i);const V="SHEET_FILTER_PLUGIN";g.SheetsFilterService=class extends u.Disposable{constructor(e,t,r){super();M(this,"_filterModels",new Map);M(this,"_loadedUnitId$",new T.BehaviorSubject(null));M(this,"loadedUnitId$",this._loadedUnitId$.asObservable());M(this,"_errorMsg$",new T.BehaviorSubject(null));M(this,"errorMsg$",this._errorMsg$.asObservable());M(this,"_activeFilterModel$",new T.BehaviorSubject(null));M(this,"activeFilterModel$",this._activeFilterModel$.asObservable());this._resourcesManagerService=e,this._univerInstanceService=t,this._commandService=r,this._initModel(),this._initActiveFilterModel()}get activeFilterModel(){return this._activeFilterModel$.getValue()}ensureFilterModel(e,t){const r=this.getFilterModel(e,t);if(r)return r;const s=this._univerInstanceService.getUniverSheetInstance(e);if(!s)throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing workbook ${e}!`);const o=s.getSheetBySheetId(t);if(!o)throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing worksheet ${t}!`);const l=new P(e,t,o);return this._cacheFilterModel(e,t,l),l}getFilterModel(e,t){var r,s;return(s=(r=this._filterModels.get(e))==null?void 0:r.get(t))!=null?s:null}removeFilterModel(e,t){const r=this.getFilterModel(e,t);return r?(r.dispose(),this._filterModels.get(e).delete(t),!0):!1}setFilterErrorMsg(e){this._errorMsg$.next(e)}_updateActiveFilterModel(){let e;try{if(e=this._univerInstanceService.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET),!e){this._activeFilterModel$.next(null);return}}catch(l){console.error("[SheetsFilterService]: could not get active workbook!",l);return}const t=e.getActiveSheet(!0);if(!t){this._activeFilterModel$.next(null);return}const r=t.getUnitId(),s=t.getSheetId(),o=this.getFilterModel(r,s);this._activeFilterModel$.next(o)}_initActiveFilterModel(){this.disposeWithMe(T.merge(u.fromCallback(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(T.filter(([e])=>e.type===u.CommandType.MUTATION&&K.has(e.id))),this._univerInstanceService.getCurrentTypeOfUnit$(u.UniverInstanceType.UNIVER_SHEET).pipe(T.switchMap(e=>{var t;return(t=e==null?void 0:e.activeSheet$)!=null?t:T.of(null)}))).subscribe(()=>this._updateActiveFilterModel()))}_serializeAutoFiltersForUnit(e){const t=this._filterModels.get(e);if(!t)return"{}";const r={};return t.forEach((s,o)=>{r[o]=s.serialize()}),JSON.stringify(r)}_deserializeAutoFiltersForUnit(e,t){const r=this._univerInstanceService.getUniverSheetInstance(e);Object.keys(t).forEach(s=>{const o=t[s],l=P.deserialize(e,s,r.getSheetBySheetId(s),o);this._cacheFilterModel(e,s,l)})}_initModel(){this._resourcesManagerService.registerPluginResource({pluginName:V,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>this._serializeAutoFiltersForUnit(e),parseJson:e=>JSON.parse(e),onLoad:(e,t)=>{this._deserializeAutoFiltersForUnit(e,t),this._loadedUnitId$.next(e),this._updateActiveFilterModel()},onUnLoad:e=>{const t=this._filterModels.get(e);t&&(t.forEach(r=>r.dispose()),this._filterModels.delete(e))}})}_cacheFilterModel(e,t,r){this._filterModels.has(e)||this._filterModels.set(e,new Map),this._filterModels.get(e).set(t,r)}},g.SheetsFilterService=Te([j(0,u.IResourceManagerService),j(1,u.IUniverInstanceService),j(2,u.ICommandService)],g.SheetsFilterService);const F={id:Q,type:u.CommandType.MUTATION,handler:(i,n)=>{const{subUnitId:e,unitId:t,range:r}=n;return i.get(g.SheetsFilterService).ensureFilterModel(t,e).setRange(r),!0}},p={id:G,type:u.CommandType.MUTATION,handler:(i,n)=>{const{subUnitId:e,unitId:t,criteria:r,col:s,reCalc:o=!0}=n,a=i.get(g.SheetsFilterService).getFilterModel(t,e);return a?(a.setCriteria(s,r,o),!0):!1}},O={id:J,type:u.CommandType.MUTATION,handler:(i,n)=>{const{unitId:e,subUnitId:t}=n;return i.get(g.SheetsFilterService).removeFilterModel(e,t)}},b={id:Y,type:u.CommandType.MUTATION,handler:(i,n)=>{const{unitId:e,subUnitId:t}=n,s=i.get(g.SheetsFilterService).getFilterModel(e,t);return s?(s.reCalc(),!0):!1}};function Ie(i,n){for(let e=0;e<i.length;e++){let t=e;if(i[e])for(let r=e+1;r<i.length;r++)i[t]&&i[r]&&n(i[t],i[r])&&(i[t]=null,t=r)}return i.filter(e=>e!==null)}function $(i){return Ie(i,(n,e)=>n.id===p.id&&e.id===p.id&&n.params.unitId===e.params.unitId&&n.params.subUnitId===e.params.subUnitId&&n.params.col===e.params.col)}var Ae=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ue=(i,n,e,t)=>{for(var r=t>1?void 0:t?Ne(n,e):n,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(t?o(n,e,r):o(r))||r);return t&&r&&Ae(n,e,r),r},L=(i,n)=>(e,t)=>n(e,t,i);let B=class extends u.Disposable{constructor(n,e,t,r,s){super();M(this,"_disposableCollection",new u.DisposableCollection);this._commandService=n,this._sheetInterceptorService=e,this._sheetsFilterService=t,this._univerInstanceService=r,this._refRangeService=s,this._initCommands(),this._initRowFilteredInterceptor(),this._initInterceptors(),this._commandExecutedListener(),this._initErrorHandling()}_initCommands(){[p,F,b,O].forEach(n=>this.disposeWithMe(this._commandService.registerCommand(n)))}_initInterceptors(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:n=>this._getUpdateFilter(n)})),this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===R.SetWorksheetActiveOperation.id){const e=n.params,t=e.subUnitId,r=e.unitId;if(!t||!r)return;this._registerRefRange(r,t)}if(n.id===F.id){const e=n.params,t=e.subUnitId,r=e.unitId;if(!t||!r)return;this._registerRefRange(e.unitId,e.subUnitId)}})),this.disposeWithMe(this._sheetsFilterService.loadedUnitId$.subscribe(n=>{if(n){const e=this._univerInstanceService.getUniverSheetInstance(n),t=e==null?void 0:e.getActiveSheet();t&&this._registerRefRange(n,t.getSheetId())}}))}_registerRefRange(n,e){var l;this._disposableCollection.dispose();const t=this._univerInstanceService.getUniverSheetInstance(n),r=t==null?void 0:t.getSheetBySheetId(e);if(!t||!r)return;const s=(l=this._sheetsFilterService.getFilterModel(n,e))==null?void 0:l.getRange(),o=a=>{switch(a.id){case R.InsertRowCommand.id:{const d=a.params,m=d.unitId||n,c=d.subUnitId||e;return this._handleInsertRowCommand(d,m,c)}case R.InsertColCommand.id:{const d=a.params,m=d.unitId||n,c=d.subUnitId||e;return this._handleInsertColCommand(d,m,c)}case R.RemoveColCommand.id:{const d=a.params;return this._handleRemoveColCommand(d,n,e)}case R.RemoveRowCommand.id:{const d=a.params;return this._handleRemoveRowCommand(d,n,e)}case R.EffectRefRangId.MoveColsCommandId:{const d=a.params;return this._handleMoveColsCommand(d,n,e)}case R.EffectRefRangId.MoveRowsCommandId:{const d=a.params;return this._handleMoveRowsCommand(d,n,e)}case R.MoveRangeCommand.id:{const d=a.params;return this._handleMoveRangeCommand(d,n,e)}}return{redos:[],undos:[]}};s&&this._disposableCollection.add(this._refRangeService.registerRefRange(s,o,n,e))}_getUpdateFilter(n){const{id:e}=n;switch(e){case R.RemoveSheetCommand.id:{const t=n.params;return this._handleRemoveSheetCommand(t,t.unitId,t.subUnitId)}case R.CopySheetCommand.id:{const t=n.params,{targetSubUnitId:r,unitId:s,subUnitId:o}=t;return!s||!o||!r?this._handleNull():this._handleCopySheetCommand(s,o,r)}}return{redos:[],undos:[]}}_handleInsertColCommand(n,e,t){var S;const r=this._sheetsFilterService.getFilterModel(e,t),s=(S=r==null?void 0:r.getRange())!=null?S:null;if(!r||!s)return this._handleNull();const{startColumn:o,endColumn:l}=s,{startColumn:a,endColumn:d}=n.range,m=d-a+1;if(d>l)return this._handleNull();const c=[],h=[],C=a,_={unitId:e,subUnitId:t,range:{...s,startColumn:a<=o?o+m:o,endColumn:l+m}},v={unitId:e,subUnitId:t,range:s};c.push({id:F.id,params:_}),h.push({id:F.id,params:v});const w=r.getAllFilterColumns().filter(f=>f[0]>=C);if(w.length!==0){const{newRange:f,oldRange:y}=this.moveCriteria(e,t,w,m);c.push(...f.redos,...y.redos),h.push(...f.undos,...y.undos)}return{redos:$(c),undos:$(h)}}_handleInsertRowCommand(n,e,t){var v;const r=this._sheetsFilterService.getFilterModel(e,t),s=(v=r==null?void 0:r.getRange())!=null?v:null;if(!r||!s)return this._handleNull();const{startRow:o,endRow:l}=s,{startRow:a,endRow:d}=n.range,m=d-a+1;if(d>l)return this._handleNull();const c=[],h=[],C={unitId:e,subUnitId:t,range:{...s,startRow:a<=o?o+m:o,endRow:l+m}},_={unitId:e,subUnitId:t,range:s};return c.push({id:F.id,params:C}),h.push({id:F.id,params:_}),{redos:$(c),undos:$(h)}}_handleRemoveColCommand(n,e,t){var w;const r=this._sheetsFilterService.getFilterModel(e,t),s=(w=r==null?void 0:r.getRange())!=null?w:null;if(!r||!s)return this._handleNull();const{startColumn:o,endColumn:l}=s,{startColumn:a,endColumn:d}=n.range;if(a>l)return this._handleNull();const m=[],c=[],h=d<o?0:Math.min(d,l)-Math.max(a,o)+1,C=d-a+1,_=r.getAllFilterColumns();_.forEach(S=>{const[f,y]=S;f<=d&&f>=a&&(m.push({id:p.id,params:{unitId:e,subUnitId:t,col:f,criteria:null}}),c.push({id:p.id,params:{unitId:e,subUnitId:t,col:f,criteria:{...y.serialize(),colId:f}}}))});const v=_.filter(S=>{const[f,y]=S;return f>d});let E={undos:[],redos:[]};if(v.length>0){const{oldRange:S,newRange:f}=this.moveCriteria(e,t,v,-C);E=f,m.push(...S.redos),c.unshift(...S.undos)}if(h===l-o+1){const S={unitId:e,subUnitId:t};m.push({id:O.id,params:S}),c.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}})}else{const S=o<=a?o:h===0?o-C:a,f=o<=a?l-h:l-C,y={unitId:e,subUnitId:t,range:{...s,startColumn:S,endColumn:f}};m.push({id:F.id,params:y}),c.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}}),m.push(...E.redos),c.unshift(...E.undos)}return{undos:c,redos:m}}_handleRemoveRowCommand(n,e,t){var v;const r=this._sheetsFilterService.getFilterModel(e,t);if(!r)return this._handleNull();const s=r.getRange(),{startRow:o,endRow:l}=s,{startRow:a,endRow:d}=n.range;if(a>l)return this._handleNull();if(d<o)return{undos:[{id:F.id,params:{range:s,unitId:e,subUnitId:t}}],redos:[{id:F.id,params:{range:{...s,startRow:o-(d-a+1),endRow:l-(d-a+1)},unitId:e,subUnitId:t}}]};const m=[],c=[],h=r.getAllFilterColumns(),C=o<=d&&o>=a;c.push({id:F.id,params:{range:s,unitId:e,subUnitId:t}});const _=Math.min(d,l)-Math.max(a,o)+1;if(_===l-o+1||C){const E={unitId:e,subUnitId:t};m.push({id:O.id,params:E}),h.forEach(w=>{const[S,f]=w,y={unitId:e,subUnitId:t,col:S,criteria:{...f.serialize(),colId:S}};c.push({id:p.id,params:y})})}else{const E=(v=this._univerInstanceService.getUniverSheetInstance(e))==null?void 0:v.getSheetBySheetId(t);if(!E)return this._handleNull();const w=[];for(let A=a;A<=d;A++)E.getRowFiltered(A)&&w.push(A);const S=Math.min(o,a),f=S+(l-o)-_+w.length,y={unitId:e,subUnitId:t,range:{...s,startRow:S,endRow:f}};m.push({id:F.id,params:y})}return{undos:$(c),redos:$(m)}}_handleMoveColsCommand(n,e,t){var S;const r=this._sheetsFilterService.getFilterModel(e,t),s=(S=r==null?void 0:r.getRange())!=null?S:null;if(!r||!s)return this._handleNull();const{startColumn:o,endColumn:l}=s,{fromRange:a,toRange:d}=n;if(a.endColumn<o&&d.startColumn<=o||a.startColumn>l&&d.endColumn>l)return this._handleNull();const m=[],c=[],h={};for(let f=o;f<=l;f++)h[f]={colIndex:f,filter:r.getFilterColumn(f)};u.moveMatrixArray(a.startColumn,a.endColumn-a.startColumn+1,d.startColumn,h);let C=s.startColumn,_=s.endColumn;o>=a.startColumn&&o<=a.endColumn&&d.startColumn>a.startColumn&&a.endColumn<l&&(C=a.endColumn+1),l>=a.startColumn&&l<=a.endColumn&&d.startColumn<a.startColumn&&a.startColumn>o&&(_=a.startColumn-1);const v=Object.keys(h).map(f=>Number(f)),E=v.find(f=>h[f].colIndex===_),w=v.find(f=>h[f].colIndex===C);if(v.forEach(f=>{var he,me;const{colIndex:y,filter:A}=h[f],N=f;if(A){if(N>=w&&N<=E){const W={unitId:e,subUnitId:t,col:N,criteria:{...A.serialize(),colId:N}},Ve={unitId:e,subUnitId:t,col:N,criteria:r.getFilterColumn(N)?{...(he=r.getFilterColumn(N))==null?void 0:he.serialize(),colId:N}:null};m.push({id:p.id,params:W}),c.push({id:p.id,params:Ve})}if(!((me=h[y])!=null&&me.filter)){const W={unitId:e,subUnitId:t,col:y,criteria:null};m.push({id:p.id,params:W}),c.push({id:p.id,params:{unitId:e,subUnitId:t,col:y,criteria:{...A.serialize(),colId:y}}})}}}),o!==w||l!==E){const f={unitId:e,subUnitId:t,range:{...s,startColumn:w,endColumn:E}};m.unshift({id:F.id,params:f}),c.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}})}return{undos:c,redos:m}}_handleMoveRowsCommand(n,e,t){var S;const r=this._sheetsFilterService.getFilterModel(e,t),s=(S=r==null?void 0:r.getRange())!=null?S:null;if(!r||!s)return this._handleNull();const{startRow:o,endRow:l}=s,{fromRange:a,toRange:d}=n;if(a.endRow<o&&d.startRow<=o||a.startRow>l&&d.endRow>l)return this._handleNull();const m=[],c=[],h={};for(let f=o;f<=l;f++)h[f]={oldIndex:f};const C=o;let _=l;l>=a.startRow&&l<=a.endRow&&d.startRow<a.startRow&&a.startRow>o&&(_=a.startRow-1),u.moveMatrixArray(a.startRow,a.endRow-a.startRow+1,d.startRow,h);const v=Object.keys(h).map(f=>Number(f)),E=v.find(f=>h[f].oldIndex===_),w=v.find(f=>h[f].oldIndex===C);if(o!==w||l!==E){const f={unitId:e,subUnitId:t,range:{...s,startRow:w,endRow:E}};m.push({id:F.id,params:f},{id:b.id,params:{unitId:e,subUnitId:t}}),c.push({id:F.id,params:{range:s,unitId:e,subUnitId:t}},{id:b.id,params:{unitId:e,subUnitId:t}})}return{redos:m,undos:c}}_handleMoveRangeCommand(n,e,t){const{fromRange:r,toRange:s}=n,o=this._sheetsFilterService.getFilterModel(e,t);if(!o)return this._handleNull();const l=o.getRange();if(!l)return this._handleNull();const a=[],d=[];if(u.Rectangle.contains(r,l)){const m=l.startRow-r.startRow,c=l.startColumn-r.startColumn,h={startRow:s.startRow+m,startColumn:s.startColumn+c,endRow:s.startRow+m+(l.endRow-l.startRow),endColumn:s.startColumn+c+(l.endColumn-l.startColumn)},C={id:O.id,params:{unitId:e,subUnitId:t}},_={id:F.id,params:{unitId:e,subUnitId:t,range:h}},v={id:F.id,params:{unitId:e,subUnitId:t,range:l}};a.push(C,_),d.push(C,v);const E=o.getAllFilterColumns(),w=s.startColumn-r.startColumn;E.forEach(S=>{const[f,y]=S;y&&(a.push({id:p.id,params:{unitId:e,subUnitId:t,col:f+w,criteria:{...y.serialize(),colId:f+w}}}),d.push({id:p.id,params:{unitId:e,subUnitId:t,col:f,criteria:{...y.serialize(),colId:f}}}))})}else if(u.Rectangle.intersects(s,l)){const m={...l,endRow:Math.max(l.endRow,s.endRow)};a.push({id:F.id,params:{unitId:e,subUnitId:t,range:m}}),d.push({id:F.id,params:{unitId:e,subUnitId:t,range:l}})}return{redos:a,undos:d}}_handleRemoveSheetCommand(n,e,t){const r=this._sheetsFilterService.getFilterModel(e,t);if(!r)return this._handleNull();const s=r.getRange();if(!s)return this._handleNull();const o=[],l=[];return r.getAllFilterColumns().forEach(([d,m])=>{l.push({id:p.id,params:{unitId:e,subUnitId:t,col:d,criteria:{...m.serialize(),colId:d}}})}),o.push({id:O.id,params:{unitId:e,subUnitId:t,range:s}}),l.unshift({id:F.id,params:{range:s,unitId:e,subUnitId:t}}),{undos:l,redos:o}}_handleCopySheetCommand(n,e,t){const r=this._sheetsFilterService.getFilterModel(n,e);if(!r)return this._handleNull();const s=r.getRange();if(!s)return this._handleNull();const o=[],l=[],a=[],d=[];return r.getAllFilterColumns().forEach(([c,h])=>{o.push({id:p.id,params:{unitId:n,subUnitId:t,col:c,criteria:{...h.serialize(),colId:c}}}),a.push({id:p.id,params:{unitId:n,subUnitId:t,col:c,criteria:null}})}),a.push({id:O.id,params:{unitId:n,subUnitId:t,range:s}}),o.unshift({id:F.id,params:{range:s,unitId:n,subUnitId:t}}),{undos:l,redos:o,preUndos:a,preRedos:d}}_handleNull(){return{redos:[],undos:[]}}_initRowFilteredInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(R.INTERCEPTOR_POINT.ROW_FILTERED,{handler:(n,e)=>{var t,r;return n?!0:(r=(t=this._sheetsFilterService.getFilterModel(e.unitId,e.subUnitId))==null?void 0:t.isRowFiltered(e.row))!=null?r:!1}}))}moveCriteria(n,e,t,r){const s={unitId:n,subUnitId:e,criteria:null,col:-1},o=[],l=[],a=[],d=[];return t.forEach(m=>{const[c,h]=m;l.push({id:p.id,params:{...s,col:c}}),o.push({id:p.id,params:{...s,col:c,criteria:{...h.serialize(),colId:c}}})}),t.forEach(m=>{const[c,h]=m;d.push({id:p.id,params:{...s,col:c+r,criteria:{...h.serialize(),colId:c+r}}}),a.push({id:p.id,params:{...s,col:c+r,criteria:null}})}),{newRange:{redos:d,undos:a},oldRange:{redos:l,undos:o}}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted((n,e)=>{var d,m;const{unitId:t,subUnitId:r}=n.params||{},s=this._sheetsFilterService.getFilterModel(t,r);if(!s)return;const o=Array.from(s.filteredOutRows).sort((c,h)=>c-h),l=[];let a=!1;if(n.id===R.RemoveRowMutation.id){const{startRow:c,endRow:h}=n.params.range,C=o.filter(_=>_>=c&&_<=h);o.forEach(_=>{if(_<c)l.push(_);else if(a=!0,_<=h){const v=Math.max(c,l.length?l[l.length-1]+1:c);l.push(v)}else l.push(_-(h-c+1-C.length))})}if(n.id===R.InsertRowMutation.id){const{startRow:c,endRow:h}=n.params.range;o.forEach(C=>{C>=c?(a=!0,l.push(C+(h-c+1))):l.push(C)})}if(a&&(s.filteredOutRows=new Set(l)),n.id===R.SetRangeValuesMutation.id&&!(e!=null&&e.onlyLocal)){const c=this._getExtendRegion(t,r);if(c){const h=n.params.cellValue;if(h)for(let C=c.startColumn;C<=c.endColumn;C++){const _=(d=h==null?void 0:h[c.startRow])==null?void 0:d[C];if(_&&this._cellHasValue(_)){const v=(m=this._univerInstanceService.getUnit(t))==null?void 0:m.getSheetBySheetId(r);if(v){const E=R.expandToContinuousRange(c,{down:!0},v),w=this._sheetsFilterService.getFilterModel(t,r),S=w.getRange();w.setRange({...S,endRow:E.endRow}),this._registerRefRange(t,r)}}}}}}))}_getExtendRegion(n,e){var a;const t=this._sheetsFilterService.getFilterModel(n,e);if(!t)return null;const r=(a=this._univerInstanceService.getUnit(n))==null?void 0:a.getSheetBySheetId(e);if(!r)return null;const s=t.getRange();if(!s)return null;const o=r.getRowCount()-1,l=r.getRowManager();for(let d=s.endRow+1;d<=o;d++)if(l.getRowRawVisible(d))return{startRow:d,endRow:d,startColumn:s.startColumn,endColumn:s.endColumn};return null}_initErrorHandling(){this.disposeWithMe(this._commandService.beforeCommandExecuted(n=>{const e=n.params,t=R.getSheetCommandTarget(this._univerInstanceService);if(!t)return;const{subUnitId:r,unitId:s}=t,o=this._sheetsFilterService.getFilterModel(s,r);if(!o)return;const l=o.getRange();if(n.id===R.MoveRowsCommand.id&&e.fromRange.startRow<=l.startRow&&e.fromRange.endRow<l.endRow&&e.fromRange.endRow>=l.startRow)throw this._sheetsFilterService.setFilterErrorMsg("sheets-filter.msg.filter-header-forbidden"),new Error("[SheetsFilterController]: Cannot move header row of filter")}))}_cellHasValue(n){const e=Object.values(n);return!(e.length===0||e.every(t=>t==null))}};B=Ue([L(0,u.ICommandService),L(1,u.Inject(R.SheetInterceptorService)),L(2,u.Inject(g.SheetsFilterService)),L(3,u.IUniverInstanceService),L(4,u.Inject(R.RefRangeService))],B);var $e=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,be=(i,n,e,t)=>{for(var r=t>1?void 0:t?Pe(n,e):n,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(t?o(n,e,r):o(r))||r);return t&&r&&$e(n,e,r),r},ae=(i,n)=>(e,t)=>n(e,t,i);g.UniverSheetsFilterPlugin=(x=class extends u.Plugin{constructor(n=q,e,t){super(),this._config=n,this._injector=e,this._configService=t;const{...r}=u.merge({},q,this._config);this._configService.setConfig(fe,r)}onStarting(){[[g.SheetsFilterService],[B]].forEach(n=>this._injector.add(n))}onReady(){this._injector.get(B)}},M(x,"type",u.UniverInstanceType.UNIVER_SHEET),M(x,"pluginName",V),x),g.UniverSheetsFilterPlugin=be([ae(1,u.Inject(u.Injector)),ae(2,u.IConfigService)],g.UniverSheetsFilterPlugin);const de={id:"sheet.command.set-filter-range",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=i.get(u.IUndoRedoService),s=i.get(u.IUniverInstanceService),{unitId:o,subUnitId:l,range:a}=n;if(!R.getSheetCommandTarget(s,n)||e.getFilterModel(o,l))return!1;if(a.endRow===a.startRow){const C=i.get(u.ErrorService),_=i.get(u.LocaleService);return C.emit(_.t("sheets-filter.command.not-valid-filter-range")),!1}const c={id:F.id,params:{unitId:o,subUnitId:l,range:a}},h=t.syncExecuteCommand(c.id,c.params);return h&&r.pushUndoRedo({unitID:o,undoMutations:[{id:O.id,params:{unitId:o,subUnitId:l}}],redoMutations:[c]}),h}},ue={id:"sheet.command.remove-sheet-filter",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(u.IUniverInstanceService),t=i.get(g.SheetsFilterService),r=i.get(u.ICommandService),s=i.get(u.IUndoRedoService),o=R.getSheetCommandTarget(e,n);if(!o)return!1;const{unitId:l,subUnitId:a}=o,d=t.getFilterModel(l,a);if(!d)return!1;const m=d==null?void 0:d.serialize(),c=ze(l,a,m),h=r.syncExecuteCommand(O.id,{unitId:l,subUnitId:a});return h&&s.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:[{id:O.id,params:{unitId:l,subUnitId:a}}]}),h}},Le={id:"sheet.command.smart-toggle-filter",type:u.CommandType.COMMAND,handler:async i=>{const n=i.get(u.IUniverInstanceService),e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=n.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET),s=r==null?void 0:r.getActiveSheet();if(!s||!r)return!1;const o=r.getUnitId(),l=s.getSheetId();if(e.getFilterModel(o,l))return t.executeCommand(ue.id,{unitId:o,subUnitId:l});const m=i.get(R.SheetsSelectionsService).getCurrentLastSelection();if(!m)return!1;const c=m.range,h=R.isSingleCellSelection(m)?R.expandToContinuousRange(c,{left:!0,right:!0,up:!0,down:!0},s):c;return t.executeCommand(de.id,{unitId:o,subUnitId:l,range:h})}},Be={id:"sheet.command.set-filter-criteria",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=i.get(u.IUndoRedoService),{unitId:s,subUnitId:o,col:l,criteria:a}=n,d=e.getFilterModel(s,o);if(!d)return!1;const m=d.getRange();if(!m||l<m.startColumn||l>m.endColumn)return!1;const c=d.getFilterColumn(l),h=je(s,o,l,c),C={id:p.id,params:{unitId:s,subUnitId:o,col:l,criteria:a}},_=t.syncExecuteCommand(C.id,C.params);return _&&r.pushUndoRedo({unitID:s,undoMutations:[h],redoMutations:[C]}),_}},xe={id:"sheet.command.clear-filter-criteria",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.IUndoRedoService),r=i.get(u.ICommandService),s=i.get(u.IUniverInstanceService),o=R.getSheetCommandTarget(s,n);if(!o)return!1;const{unitId:l,subUnitId:a}=o,d=e.getFilterModel(o.unitId,o.subUnitId);if(!d)return!1;const m=d.serialize(),c=ce(l,a,m),h=De(l,a,m);return u.sequenceExecute(h,r).result?(t.pushUndoRedo({unitID:l,undoMutations:c,redoMutations:h}),!0):!1}},He={id:"sheet.command.re-calc-filter",type:u.CommandType.COMMAND,handler:(i,n)=>{const e=i.get(g.SheetsFilterService),t=i.get(u.ICommandService),r=i.get(u.IUniverInstanceService),s=R.getSheetCommandTarget(r,n);if(!s)return!1;const{unitId:o,subUnitId:l}=s;return e.getFilterModel(s.unitId,s.subUnitId)?t.executeCommand(b.id,{unitId:o,subUnitId:l}):!1}};function ze(i,n,e){const t=[],r={id:F.id,params:{unitId:i,subUnitId:n,range:e.ref}};return t.push(r),ce(i,n,e).forEach(o=>t.push(o)),t}function ce(i,n,e){var r;const t=[];return(r=e.filterColumns)==null||r.forEach(s=>{const o={id:p.id,params:{unitId:i,subUnitId:n,col:s.colId,criteria:s}};t.push(o)}),t}function De(i,n,e){var r;const t=[];return(r=e.filterColumns)==null||r.forEach(s=>{const o={id:p.id,params:{unitId:i,subUnitId:n,col:s.colId,criteria:null}};t.push(o)}),t}function je(i,n,e,t){if(!t)return{id:p.id,params:{unitId:i,subUnitId:n,col:e,criteria:null}};const r=t.serialize();return{id:p.id,params:{unitId:i,subUnitId:n,col:e,criteria:r}}}g.ClearSheetsFilterCriteriaCommand=xe,g.CustomFilterOperator=I,g.FILTER_MUTATIONS=K,g.FilterColumn=oe,g.FilterModel=P,g.ReCalcSheetsFilterCommand=He,g.ReCalcSheetsFilterMutation=b,g.RemoveSheetFilterCommand=ue,g.RemoveSheetsFilterMutation=O,g.SHEET_FILTER_SNAPSHOT_ID=V,g.SetSheetFilterRangeCommand=de,g.SetSheetsFilterCriteriaCommand=Be,g.SetSheetsFilterCriteriaMutation=p,g.SetSheetsFilterRangeMutation=F,g.SmartToggleSheetsFilterCommand=Le,g.equals=te,g.getCustomFilterFn=z,g.greaterThan=X,g.greaterThanOrEqualTo=Z,g.lessThan=k,g.lessThanOrEqualTo=ee,g.notEquals=H,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
// @univerjs/sheets-filter/facade
|
|
44
|
-
(function(
|
|
44
|
+
(function(o,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/sheets-filter"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-filter","@univerjs/sheets/facade"],i):(o=typeof globalThis<"u"?globalThis:o||self,i(o.UniverSheetsFilterFacade={},o.UniverCore,o.UniverSheetsFilter,o.UniverSheetsFacade))})(this,function(o,i,s,h){"use strict";var m=Object.defineProperty,u=Object.getOwnPropertyDescriptor,F=(a,e,t,r)=>{for(var n=r>1?void 0:r?u(e,t):e,l=a.length-1,d;l>=0;l--)(d=a[l])&&(n=(r?d(e,t,n):d(n))||n);return r&&n&&m(e,t,n),n},c=(a,e)=>(t,r)=>e(t,r,a);o.FFilter=class{constructor(e,t,r,n,l){this._workbook=e,this._worksheet=t,this._filterModel=r,this._injector=n,this._commandSrv=l}getFilteredOutRows(){return Array.from(this._filterModel.filteredOutRows).sort()}getColumnFilterCriteria(e){var t;return(t=this._filterModel.getFilterColumn(e))==null?void 0:t.getColumnData()}removeColumnFilterCriteria(e){return this._commandSrv.syncExecuteCommand(s.SetSheetsFilterCriteriaCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),col:e,criteria:null}),this}setColumnFilterCriteria(e,t){return this._commandSrv.syncExecuteCommand(s.SetSheetsFilterCriteriaCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),col:e,criteria:t}),this}getRange(){const e=this._filterModel.getRange();return this._injector.createInstance(h.FRange,this._workbook,this._worksheet,e)}removeFilterCriteria(){return this._commandSrv.syncExecuteCommand(s.ClearSheetsFilterCriteriaCommand.id),this}remove(){return this._commandSrv.syncExecuteCommand(s.RemoveSheetFilterCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()})}},o.FFilter=F([c(3,i.Inject(i.Injector)),c(4,i.ICommandService)],o.FFilter);class g extends h.FRange{createFilter(){return this._getFilterModel()||!this._commandService.syncExecuteCommand(s.SetSheetFilterRangeCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range})?null:this.getFilter()}getFilter(){const e=this._getFilterModel();return e?this._injector.createInstance(o.FFilter,this._workbook,this._worksheet,e):null}_getFilterModel(){return this._injector.get(s.SheetsFilterService).getFilterModel(this._workbook.getUnitId(),this._worksheet.getSheetId())}}h.FRange.extend(g);class S extends h.FWorksheet{getFilter(){const e=this._getFilterModel();return e?this._injector.createInstance(o.FFilter,this._workbook,this._worksheet,e):null}_getFilterModel(){return this._injector.get(s.SheetsFilterService).getFilterModel(this._workbook.getUnitId(),this._worksheet.getSheetId())}}h.FWorksheet.extend(S);class v extends i.FEnum{get CustomFilterOperation(){return s.CustomFilterOperator}}i.FEnum.extend(v);class C extends i.FEventName{get SheetBeforeRangeFilter(){return"SheetBeforeRangeFilter"}get SheetRangeFiltered(){return"SheetRangeFiltered"}get SheetRangeFilterCleared(){return"SheetRangeFilterCleared"}get SheetBeforeRangeFilterClear(){return"SheetBeforeRangeFilterClear"}}i.FEventName.extend(C),i.FEventName.extend(h.FSheetEventName);class _ extends i.FUniver{_initialize(e){const t=e.get(i.ICommandService);this.disposeWithMe(t.beforeCommandExecuted(r=>{switch(r.id){case s.SetSheetsFilterCriteriaCommand.id:this._beforeRangeFilter(r);break;case s.ClearSheetsFilterCriteriaCommand.id:this._beforeRangeFilterClear();break}})),this.disposeWithMe(t.onCommandExecuted(r=>{switch(r.id){case s.SetSheetsFilterCriteriaCommand.id:this._onRangeFiltered(r);break;case s.ClearSheetsFilterCriteriaCommand.id:this._onRangeFilterCleared();break}}))}_beforeRangeFilter(e){const t=e.params,r=this.getUniverSheet(t.unitId),n={workbook:r,worksheet:r.getSheetBySheetId(t.subUnitId),col:t.col,criteria:t.criteria};if(this.fireEvent(this.Event.SheetBeforeRangeFilter,n),n.cancel)throw new Error("SetSheetsFilterCriteriaCommand canceled.")}_onRangeFiltered(e){const t=e.params,r=this.getUniverSheet(t.unitId),n={workbook:r,worksheet:r.getSheetBySheetId(t.subUnitId),col:t.col,criteria:t.criteria};if(this.fireEvent(this.Event.SheetRangeFiltered,n),n.cancel)throw new Error("SetSheetsFilterCriteriaCommand canceled.")}_beforeRangeFilterClear(){const e=this.getActiveWorkbook();if(!e)return;const t={workbook:e,worksheet:e.getActiveSheet()};if(this.fireEvent(this.Event.SheetBeforeRangeFilterClear,t),t.cancel)throw new Error("SetSheetsFilterCriteriaCommand canceled.")}_onRangeFilterCleared(){const e=this.getActiveWorkbook();if(!e)return;const t={workbook:e,worksheet:e.getActiveSheet()};if(this.fireEvent(this.Event.SheetRangeFilterCleared,t),t.cancel)throw new Error("SetSheetsFilterCriteriaCommand canceled.")}}i.FUniver.extend(_),Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
// @univerjs/sheets-formula/index
|
|
48
|
-
(function(E,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula"),require("rxjs"),require("@univerjs/rpc")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula","rxjs","@univerjs/rpc"],f):(E=typeof globalThis<"u"?globalThis:E||self,f(E.UniverSheetsFormula={},E.UniverCore,E.UniverSheets,E.UniverEngineFormula,E.rxjs,E.UniverRpc))})(this,function(E,f,m,t,Y,it){"use strict";var Ua=Object.defineProperty;var qa=(E,f,m)=>f in E?Ua(E,f,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[f]=m;var h=(E,f,m)=>qa(E,typeof f!="symbol"?f+"":f,m);const Dt={id:"formula.command.insert-function",type:f.CommandType.COMMAND,handler:async(r,e)=>{const{list:a}=e,n=r.get(f.ICommandService),i=new f.ObjectMatrix;a.forEach(u=>{const{range:c,primary:s,formula:l}=u,{row:d,column:L}=s,T=f.Tools.generateRandomId(6);i.setValue(d,L,{f:l,si:T});const{startRow:A,startColumn:S,endRow:C,endColumn:p}=c;for(let N=A;N<=C;N++)for(let I=S;I<=p;I++)(N!==d||I!==L)&&i.setValue(N,I,{si:T})});const o={value:i.getData()};return n.executeCommand(m.SetRangeValuesCommand.id,o)}},tt={type:f.CommandType.MUTATION,id:"sheet.mutation.data-validation-formula-mark-dirty",handler(){return!0}};function Yt(r,e,a){var n;return r==null||r[e]==null||((n=r[e])==null?void 0:n[a])==null}function Pt(r,e,a){var n;if(a){if(r&&r[e]&&((n=r[e])!=null&&n[a]))return delete r[e][a],{[e]:{[a]:null}}}else if(r&&r[e])return delete r[e],{[e]:null}}var b=(r=>(r[r.MoveRange=0]="MoveRange",r[r.MoveRows=1]="MoveRows",r[r.MoveCols=2]="MoveCols",r[r.InsertRow=3]="InsertRow",r[r.InsertColumn=4]="InsertColumn",r[r.RemoveRow=5]="RemoveRow",r[r.RemoveColumn=6]="RemoveColumn",r[r.DeleteMoveLeft=7]="DeleteMoveLeft",r[r.DeleteMoveUp=8]="DeleteMoveUp",r[r.InsertMoveDown=9]="InsertMoveDown",r[r.InsertMoveRight=10]="InsertMoveRight",r[r.SetName=11]="SetName",r[r.RemoveSheet=12]="RemoveSheet",r[r.SetDefinedName=13]="SetDefinedName",r[r.RemoveDefinedName=14]="RemoveDefinedName",r))(b||{});const Xt=[11,12,13,14];function wt(r,e,a){const{type:n}=a;return Xt.includes(n)?Wt(r,e):Kt(r,e,a)}function Wt(r,e){const a=[],n=[];return Object.keys(e).forEach(i=>{const o=e[i],u=r[i];if(o==null||u==null)return!0;Object.keys(o).forEach(c=>{const s=new f.ObjectMatrix(o[c]||{}),l=new f.ObjectMatrix(u[c]||{}),d=new f.ObjectMatrix,L=new f.ObjectMatrix;if(s.forValue((p,N,I)=>{if(I==null)return!0;const P=rt(I);P!==null&&(d.setValue(p,N,P),L.setValue(p,N,l.getValue(p,N)))}),d.getSizeOf()===0)return;const T={subUnitId:c,unitId:i,cellValue:d.getMatrix()},A={id:m.SetRangeValuesMutation.id,params:T};n.push(A);const S={subUnitId:c,unitId:i,cellValue:L.getMatrix()},C={id:m.SetRangeValuesMutation.id,params:S};a.push(C)})}),{undos:a,redos:n}}function Kt(r,e,a){const{redoFormulaData:n,undoFormulaData:i}=gt(r,e,a);if(f.Tools.diffValue(n,i))return{undos:[],redos:[]};const o=[],u=[];return Object.keys(n).forEach(c=>{Object.keys(n[c]).forEach(s=>{if(Object.keys(n[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:n[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};o.push(d)}})}),Object.keys(i).forEach(c=>{Object.keys(i[c]).forEach(s=>{if(Object.keys(i[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:i[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};u.push(d)}})}),{undos:u,redos:o}}function gt(r,e,a){const n={},i={},{type:o,unitId:u,sheetId:c,range:s,from:l,to:d}=a;return new Set([...Object.keys(r),...Object.keys(e)]).forEach(T=>{if(Yt(r,T,c))return;new Set([...Object.keys(r[T]||{}),...Object.keys(e[T]||{})]).forEach(S=>{var x,q;const C=(x=r[T])==null?void 0:x[S],p=(q=e[T])==null?void 0:q[S],N=new f.ObjectMatrix(C||{}),I=new f.ObjectMatrix(p||{});let P=[];T!==u||S!==c?P=jt(I):P=Qt(N,o,l,d,s);const _=ce(P,N,I),R=fe(P,N);n[T]||(n[T]={}),i[T]||(i[T]={}),n[T][S]={...n[T][S],..._},i[T][S]={...i[T][S],...R}})}),{redoFormulaData:n,undoFormulaData:i}}function Qt(r,e,a,n,i){const o=[];return r.forValue((u,c,s)=>{if(s==null||!bt(s))return!0;const l=f.cellToRange(u,c);let d=null,L=!1;if([0,1,2].includes(e))d=kt(e,a,n,l);else if(i!=null){const T=$t(e,i,l);d=T.newCell,L=T.isReverse}L?o.unshift({oldCell:l,newCell:d}):o.push({oldCell:l,newCell:d})}),o}function jt(r){const e=[];return r.forValue((a,n,i)=>{if(i==null||!bt(i))return!0;const o=f.cellToRange(a,n);e.push({oldCell:o,newCell:o})}),e}function kt(r,e,a,n){if(e==null||a==null)return null;switch(r){case 0:return zt(e,a,n);case 1:return Zt(e,a,n);case 2:return Jt(e,a,n);default:return null}}function $t(r,e,a){let n=null,i=!1;switch(r){case 3:n=te(e,a),i=!0;break;case 4:n=ee(e,a),i=!0;break;case 5:n=ae(e,a);break;case 6:n=ne(e,a);break;case 7:n=ie(e,a);break;case 8:n=re(e,a);break;case 9:n=oe(e,a),i=!0;break;case 10:n=ue(e,a),i=!0;break}return{newCell:n,isReverse:i}}function zt(r,e,a){const n=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Zt(r,e,a){const n=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Jt(r,e,a){const n=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function te(r,e){const a=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},e);return m.runRefRangeMutations(a,e)}function ee(r,e){const a=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},e);return m.runRefRangeMutations(a,e)}function ae(r,e){const a=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ne(r,e){const a=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ie(r,e){const a=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function re(r,e){const a=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function oe(r,e){const a=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ue(r,e){const a=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ce(r,e,a){const n=new f.ObjectMatrix({});return r.forEach(i=>{const{oldCell:o,newCell:u}=i,{startRow:c,startColumn:s}=o,l=a.getValue(c,s)||e.getValue(c,s),d=rt(l);if(n.setValue(c,s,{f:null,si:null}),u){const{startRow:L,startColumn:T}=u;n.setValue(L,T,d)}}),n.getMatrix()}function fe(r,e){const a=new f.ObjectMatrix({});return r.reverse().forEach(n=>{const{oldCell:i,newCell:o}=n,{startRow:u,startColumn:c}=i,s=e.getValue(u,c),l=rt(s);if(o){const{startRow:d,startColumn:L}=o;a.setValue(d,L,{f:null,si:null})}a.setValue(u,c,l)}),a.getMatrix()}function rt(r){if(r==null)return;const{f:e,si:a,x:n=0,y:i=0}=r,o=f.isFormulaString(e),u=f.isFormulaId(a);if(!o&&!u)return{f:null,si:null};const c={};return u&&(c.si=a),o&&n===0&&i===0&&(c.f=e),c.f===void 0&&(c.f=null),c.si===void 0&&(c.si=null),c}function me(r){const e=new f.ObjectMatrix({});return new f.ObjectMatrix(r).forValue((n,i,o)=>{const u=rt(o);u&&e.setValue(n,i,u)}),e.getMatrix()}function bt(r){const e=(r==null?void 0:r.f)||"",a=(r==null?void 0:r.si)||"",n=f.isFormulaString(e),i=f.isFormulaId(a);return!!(n||i)}function yt(r,e,a,n,i,o){if((i==null||i.length===0)&&(o==null||o.length===0)){if(r===a&&e===n)return!0}else if((r===i||i==null||i.length===0)&&e===o)return!0;return!1}function xt(r,e,a=0,n=0){const i=[];for(let o=0,u=r.length;o<u;o++){const c=r[o];if(typeof c=="string"||c.nodeType!==t.sequenceNodeType.REFERENCE||e.includes(o)){i.push(c);continue}const{token:s}=c,l=t.deserializeRangeWithSheetWithCache(s),{range:d,sheetName:L,unitId:T}=l,A=f.Rectangle.moveOffset(d,a,n);i.push({...c,token:t.serializeRangeToRefString({range:A,unitId:T,sheetName:L})})}return i}function Ut(r,e,a,n){const{type:i,unitId:o,sheetId:u,range:c,from:s,to:l}=e,{range:d,sheetId:L,unitId:T,sheetName:A,refOffsetX:S,refOffsetY:C}=r;if(!yt(o,u,a,n,T,L))return;const p=f.Rectangle.moveOffset(d,S,C);let N=null;if(i===b.MoveRange){if(s==null||l==null)return;const I=It(p,s),P=f.getIntersectRange(p,s);if(P==null||I!==4)return;const _=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:l,fromRange:s}},P),R=m.runRefRangeMutations(_,P);if(R==null)return t.ErrorType.REF;N=Et(I,R,s,l,p,P)}else if(i===b.MoveRows){if(s==null||l==null)return;const I=It(p,s);let P=f.getIntersectRange(p,s);if(P==null&&(s.endRow<p.startRow&&l.endRow<p.startRow||s.startRow>p.endRow&&l.startRow>p.endRow))return;P==null&&(P={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:l,fromRange:s}},P),R=m.runRefRangeMutations(_,P);if(R==null)return t.ErrorType.REF;N=Et(I,R,s,l,p,P)}else if(i===b.MoveCols){if(s==null||l==null)return;const I=It(p,s);let P=f.getIntersectRange(p,s);if(P==null&&(s.endColumn<p.startColumn&&l.endColumn<p.startColumn||s.startColumn>p.endColumn&&l.startColumn>p.endColumn))return;P==null&&(P={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:l,fromRange:s}},P),R=m.runRefRangeMutations(_,P);if(R==null)return t.ErrorType.REF;N=Et(I,R,s,l,p,P)}if(c!=null){if(i===b.InsertRow){const I=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}else if(i===b.InsertColumn){const I=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}else if(i===b.RemoveRow){const I=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.RemoveColumn){const I=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.DeleteMoveLeft){const I=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.DeleteMoveUp){const I=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.InsertMoveDown){const I=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}else if(i===b.InsertMoveRight){const I=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}}if(N!=null)return t.serializeRangeToRefString({range:N,sheetName:A,unitId:T})}function Et(r,e,a,n,i,o){const{startRow:u,endRow:c,startColumn:s,endColumn:l,rangeType:d}=et(e),{startRow:L,startColumn:T,endRow:A,endColumn:S,rangeType:C=f.RANGE_TYPE.NORMAL}=et(a),{startRow:p,startColumn:N,endRow:I,endColumn:P}=et(n),{startRow:_,endRow:R,startColumn:x,endColumn:q}=et(o),{startRow:D,endRow:y,startColumn:M,endColumn:U,rangeType:F=f.RANGE_TYPE.NORMAL}=et(i),O={...i};function v(){return d===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?!0:s>=M&&l<=U}function $(){return d===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?!0:u>=D&&c<=y}if(r===0)if(v())if(u<D)O.startRow=u;else if(u>=y)O.endRow-=A+1-D;else return;else return;else if(r===1)if(v())if(c>y)O.endRow=c;else if(c<=D)O.startRow+=y-L+1;else return;else return;else if(r===2)if($())if(s<M)O.startColumn=s;else if(s>=U)O.endColumn-=S+1-M;else return;else return;else if(r===3)if($())if(l>U)O.endColumn=l;else if(l<=M)O.startColumn+=U-T+1;else return;else return;else r===4?(O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l):T<=M&&S>=U||C===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?a.endRow<D?(p>=D&&(O.startRow-=A-L+1),p>=y&&(O.endRow-=A-L+1)):a.startRow>y?(I<=y&&(O.endRow+=A-L+1),I<=D&&(O.startRow+=A-L+1)):a.startRow>=D&&a.endRow<=y&&(p<=D?O.startRow+=A-L+1:p>=y&&(O.endRow-=A-L+1)):L<=D&&A>=y||C===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?a.endColumn<M?(N>=M&&(O.startColumn-=S-T+1),N>=U&&(O.endColumn-=S-T+1)):a.startColumn>U?(P<=U&&(O.endColumn+=S-T+1),P<=M&&(O.startColumn+=S-T+1)):a.startColumn>=M&&a.endColumn<=U&&(N<=M?O.startColumn+=S-T+1:N>=U&&(O.endColumn-=S-T+1)):((N<=q+1&&P>=U||N<=M&&P>=x-1)&&p<=D&&I>=y||(p<=R+1&&I>=y||p<=D&&I>=_-1)&&N<=M&&P>=U,O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l);return O}function It(r,e){const a=j(r.startRow),n=k(r.endRow),i=j(r.startColumn),o=k(r.endColumn),u=j(e.startRow),c=k(e.endRow),s=j(e.startColumn),l=k(e.endColumn);function d(){return r.rangeType===f.RANGE_TYPE.COLUMN&&e.rangeType===f.RANGE_TYPE.COLUMN?!0:a>=u&&n<=c}function L(){return r.rangeType===f.RANGE_TYPE.ROW&&e.rangeType===f.RANGE_TYPE.ROW?!0:i>=s&&o<=l}function T(){return r.rangeType===f.RANGE_TYPE.ALL&&e.rangeType===f.RANGE_TYPE.ALL}return d()&&L()||T()?4:L()&&a>=u&&a<=c&&n>c?0:L()&&n>=u&&n<=c&&a<u?1:d()&&i>=s&&i<=l&&o>l?2:d()&&o>=s&&o<=l&&i<s?3:null}function j(r){return isNaN(r)?-1/0:r}function k(r){return isNaN(r)?1/0:r}function et(r){const{startRow:e,endRow:a,startColumn:n,endColumn:i}=r;return{...r,startRow:j(e),endRow:k(a),startColumn:j(n),endColumn:k(i)}}function qt(r,e){const{id:a}=e;let n=null;switch(a){case m.MoveRangeCommand.id:n=se(e,r);break;case m.MoveRowsCommand.id:n=le(e,r);break;case m.MoveColsCommand.id:n=pe(e,r);break;case m.InsertRowCommand.id:n=de(e);break;case m.InsertColCommand.id:n=Le(e);break;case m.InsertRangeMoveRightCommand.id:n=Te(e,r);break;case m.InsertRangeMoveDownCommand.id:n=Ne(e,r);break;case m.RemoveRowCommand.id:n=Pe(e,r);break;case m.RemoveColCommand.id:n=Ee(e,r);break;case m.DeleteRangeMoveUpCommand.id:n=Ie(e,r);break;case m.DeleteRangeMoveLeftCommand.id:n=Ae(e,r);break;case m.SetWorksheetNameCommand.id:n=Se(e,r);break;case m.RemoveSheetCommand.id:n=Ce(e,r);break;case m.SetDefinedNameCommand.id:n=Re(e,r);break;case m.RemoveDefinedNameCommand.id:n=Oe(e,r);break}return n}function V(r){var n;const e=r.getUnitId(),a=((n=r.getActiveSheet())==null?void 0:n.getSheetId())||"";return{unitId:e,sheetId:a}}function se(r,e){const{params:a}=r;if(!a)return null;const{fromRange:n,toRange:i}=a;if(!n||!i)return null;const{unitId:o,sheetId:u}=V(e);return{type:b.MoveRange,from:n,to:i,unitId:o,sheetId:u}}function le(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startRow:n,endRow:i},toRange:{startRow:o,endRow:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:n,startColumn:0,endRow:i,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW},L={startRow:o,startColumn:0,endRow:u,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW};return{type:b.MoveRows,from:d,to:L,unitId:c,sheetId:l}}function pe(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startColumn:n,endColumn:i},toRange:{startColumn:o,endColumn:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:0,startColumn:n,endRow:s.getRowCount()-1,endColumn:i,rangeType:f.RANGE_TYPE.COLUMN},L={startRow:0,startColumn:o,endRow:s.getRowCount()-1,endColumn:u,rangeType:f.RANGE_TYPE.COLUMN};return{type:b.MoveCols,from:d,to:L,unitId:c,sheetId:l}}function de(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertRow,range:a,unitId:n,sheetId:i}}function Le(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertColumn,range:a,unitId:n,sheetId:i}}function Te(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveRight,range:n,unitId:i,sheetId:o}}function Ne(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveDown,range:n,unitId:i,sheetId:o}}function Pe(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveRow,range:n,unitId:i,sheetId:o}}function Ee(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveColumn,range:n,unitId:i,sheetId:o}}function Ie(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveUp,range:n,unitId:i,sheetId:o}}function Ae(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveLeft,range:n,unitId:i,sheetId:o}}function Se(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i,name:o}=a,{unitId:u,sheetId:c}=V(e);return{type:b.SetName,unitId:n||u,sheetId:i||c,sheetName:o}}function Ce(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i}=a,{unitId:o,sheetId:u}=V(e);return{type:b.RemoveSheet,unitId:n||o,sheetId:i||u}}function Re(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.SetDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}function Oe(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.RemoveDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}var Me=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,De=(r,e,a,n)=>{for(var i=n>1?void 0:n?_e(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Me(e,a,i),i},ot=(r,e)=>(a,n)=>e(a,n,r);E.UpdateDefinedNameController=class extends f.Disposable{constructor(e,a,n,i){super(),this._definedNamesService=e,this._univerInstanceService=a,this._sheetInterceptorService=n,this._lexerTreeBuilder=i,this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===m.SetDefinedNameCommand.id||e.id===m.RemoveDefinedNameCommand.id)return{redos:[],undos:[]};const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(a==null)return{redos:[],undos:[]};const n=qt(a,e);return n?this._getUpdateDefinedNameMutations(a,n):{redos:[],undos:[]}}}))}_getUpdateDefinedNameMutations(e,a){const{type:n,unitId:i,sheetId:o}=a,u=this._definedNamesService.getDefinedNameMap(i);if(!u)return{redos:[],undos:[]};const c=[],s=[];return Object.values(u).forEach(l=>{var N;const{formulaOrRefString:d}=l,L=this._lexerTreeBuilder.sequenceNodesBuilder(d);if(L==null)return!0;let T=!1;const A=[];for(let I=0,P=L.length;I<P;I++){const _=L[I];if(typeof _=="string"||_.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:R}=_,x=t.deserializeRangeWithSheetWithCache(R),{range:q,sheetName:D,unitId:y}=x,M=((N=e.getSheetBySheetName(D))==null?void 0:N.getSheetId())||"",U={range:q,sheetId:M,unitId:y,sheetName:D,refOffsetX:0,refOffsetY:0};let F=null;if(n===b.RemoveSheet)F=this._removeSheet(l,i,o);else if(n===b.SetName){const{sheetId:O,sheetName:v}=a;if(v==null||M==null||M.length===0||O!==M)continue;F=t.serializeRangeToRefString({range:q,sheetName:v,unitId:y})}else F=Ut(U,a,i,o);F!=null&&(L[I]={..._,token:F},T=!0,A.push(I))}if(!T)return!0;const S=t.generateStringWithSequence(xt(L,A)),C={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l,formulaOrRefString:S}};c.push(C);const p={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l}};s.push(p)}),{redos:c,undos:s}}_removeSheet(e,a,n){var u;const{formulaOrRefString:i}=e;return((u=this._definedNamesService.getWorksheetByRef(a,i))==null?void 0:u.getSheetId())===n?t.ErrorType.REF:null}},E.UpdateDefinedNameController=De([ot(0,t.IDefinedNamesService),ot(1,f.IUniverInstanceService),ot(2,f.Inject(m.SheetInterceptorService)),ot(3,f.Inject(t.LexerTreeBuilder))],E.UpdateDefinedNameController);var at=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(at||{}),be=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,xe=(r,e,a,n)=>{for(var i=n>1?void 0:n?ye(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&be(e,a,i),i},At=(r,e)=>(a,n)=>e(a,n,r);E.RegisterOtherFormulaService=class extends f.Disposable{constructor(a,n,i){super();h(this,"_formulaCacheMap",new Map);h(this,"_formulaChangeWithRange$",new Y.Subject);h(this,"formulaChangeWithRange$",this._formulaChangeWithRange$.asObservable());h(this,"_formulaResult$",new Y.Subject);h(this,"formulaResult$",this._formulaResult$.asObservable());h(this,"calculateStarted$",new Y.BehaviorSubject(!1));this._commandService=a,this._activeDirtyManagerService=n,this._lifecycleService=i,this._initFormulaRegister(),this._initFormulaCalculationResultChange()}dispose(){super.dispose(),this._formulaChangeWithRange$.complete(),this._formulaResult$.complete(),this.calculateStarted$.complete()}_ensureCacheMap(a,n){let i=this._formulaCacheMap.get(a);i||(i=new Map,this._formulaCacheMap.set(a,i));let o=i.get(n);return o||(o=new Map,i.set(n,o)),o}_createFormulaId(a,n){return`formula.${a}_${n}_${f.Tools.generateRandomId(8)}`}_initFormulaRegister(){this._activeDirtyManagerService.register(tt.id,{commandId:tt.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}});const a=n=>{const{unitId:i,subUnitId:o,formulaText:u,formulaId:c,ranges:s}=n;if(!this._ensureCacheMap(i,o).has(c))return;const d={unitId:i,subUnitId:o,formulaMap:{[c]:{f:u,ranges:s}}};this._commandService.executeCommand(t.SetOtherFormulaMutation.id,d).then(()=>{this._commandService.executeCommand(tt.id,{[i]:{[o]:{[c]:!0}}})})};this.disposeWithMe(this._formulaChangeWithRange$.pipe(Y.bufferWhen(()=>this.calculateStarted$.pipe(Y.filter(n=>n)))).subscribe(n=>n.forEach(a))),this.disposeWithMe(this._formulaChangeWithRange$.pipe(Y.filter(()=>this.calculateStarted$.getValue())).subscribe(a))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{if(a.id===t.SetFormulaCalculationResultMutation.id){const n=a.params,{unitOtherData:i}=n,o={};for(const u in i){const c=i[u],s={};o[u]=s;for(const l in c){const d=this._ensureCacheMap(u,l),L=c[l],T=[];s[l]=T;for(const A in L){const S=L[A];if(d.has(A)){const C=d.get(A);if(!C)continue;C.result||(C.result={});const p=new f.ObjectMatrix(S),N=new f.ObjectMatrix(C.result);p.forValue((I,P,_)=>{N.setValue(I,P,_)}),C.status=at.SUCCESS,C.callbacks.forEach(I=>{I(S)}),C.callbacks.clear(),T.push(C)}}}}this._formulaResult$.next(o)}}))}registerFormulaWithRange(a,n,i,o=[{startRow:0,endRow:0,startColumn:0,endColumn:0}],u){const c=this._createFormulaId(a,n);return this._ensureCacheMap(a,n).set(c,{result:void 0,status:at.WAIT,formulaId:c,callbacks:new Set,extra:u}),this._formulaChangeWithRange$.next({unitId:a,subUnitId:n,formulaText:i,formulaId:c,ranges:o}),c}deleteFormula(a,n,i){const o={unitId:a,subUnitId:n,formulaIdList:i};this._commandService.executeCommand(t.RemoveOtherFormulaMutation.id,o);const u=this._ensureCacheMap(a,n);i.forEach(c=>u.delete(c))}getFormulaValue(a,n,i){const o=this._ensureCacheMap(a,n),u=o.get(i);return u?u.status===at.SUCCESS||u.status===at.ERROR?Promise.resolve(u):new Promise(c=>{u.callbacks.add(()=>{c(o.get(i))})}):Promise.resolve(null)}getFormulaValueSync(a,n,i){return this._ensureCacheMap(a,n).get(i)}},E.RegisterOtherFormulaService=xe([At(0,f.ICommandService),At(1,t.IActiveDirtyManagerService),At(2,f.Inject(f.LifecycleService))],E.RegisterOtherFormulaService);const nt="sheets-formula.base.config";var H=(r=>(r[r.FORCED=0]="FORCED",r[r.WHEN_EMPTY=1]="WHEN_EMPTY",r[r.NO_CALCULATION=2]="NO_CALCULATION",r))(H||{});const ht={},Ue="sheets-formula.remote.config",Ft={};var qe=Object.defineProperty,he=Object.getOwnPropertyDescriptor,Fe=(r,e,a,n)=>{for(var i=n>1?void 0:n?he(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&qe(e,a,i),i},g=(r,e)=>(a,n)=>e(a,n,r);const Bt={done:0,count:0},St={onlyLocal:!0};E.TriggerCalculationController=class extends f.Disposable{constructor(a,n,i,o,u,c,s){var d;super();h(this,"_waitingCommandQueue",[]);h(this,"_executingDirtyData",{forceCalculation:!1,dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}});h(this,"_setTimeoutKey",-1);h(this,"_startExecutionTime",0);h(this,"_totalCalculationTaskCount",0);h(this,"_doneCalculationTaskCount",0);h(this,"_executionInProgressParams",null);h(this,"_restartCalculation",!1);h(this,"_calculationMode",H.WHEN_EMPTY);h(this,"_forceCalculating",!1);h(this,"_progress$",new Y.BehaviorSubject(Bt));h(this,"progress$",this._progress$.asObservable());this._commandService=a,this._activeDirtyManagerService=n,this._logService=i,this._configService=o,this._formulaDataModel=u,this._localeService=c,this._registerOtherFormulaService=s;const l=this._configService.getConfig(nt);this._calculationMode=(d=l==null?void 0:l.initialFormulaComputing)!=null?d:H.WHEN_EMPTY,this._commandExecutedListener(),this._initialExecuteFormulaProcessListener(),this._initialExecuteFormula()}_emitProgress(a){this._progress$.next({done:this._doneCalculationTaskCount,count:this._totalCalculationTaskCount,label:a})}_startProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.analyzing");this._emitProgress(a)}_calculateProgress(a){if(this._executionInProgressParams){const{totalFormulasToCalculate:n,completedFormulasCount:i,totalArrayFormulasToCalculate:o,completedArrayFormulasCount:u}=this._executionInProgressParams;if(this._doneCalculationTaskCount=i+u,this._totalCalculationTaskCount=n+o,this._totalCalculationTaskCount===0)return;this._emitProgress(a)}}_completeProgress(){this._doneCalculationTaskCount=this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.done");this._emitProgress(a)}clearProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._emitProgress()}dispose(){super.dispose(),this._progress$.next(Bt),this._progress$.complete()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted((a,n)=>{if(this._activeDirtyManagerService.get(a.id)){if(a.id===m.SetRangeValuesMutation.id){const i=a.params;if(n&&n.onlyLocal===!0||i.trigger===m.SetStyleCommand.id||i.trigger===m.SetBorderCommand.id||i.trigger===m.ClearSelectionFormatCommand.id)return}this._waitingCommandQueue.push(a),clearTimeout(this._setTimeoutKey),this._setTimeoutKey=setTimeout(()=>{const i=this._generateDirty(this._waitingCommandQueue);this._executingDirtyData=this._mergeDirty(this._executingDirtyData,i),this._executionInProgressParams==null?this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St):(this._restartCalculation=!0,this._commandService.executeCommand(t.SetFormulaCalculationStopMutation.id,{})),this._waitingCommandQueue=[]},100)}}))}_generateDirty(a){const n=[],i={},o={},u={},c={},s={};for(const l of a){const d=this._activeDirtyManagerService.get(l.id);if(d==null)continue;const L=d.getDirtyData(l),{dirtyRanges:T,dirtyNameMap:A,dirtyDefinedNameMap:S,dirtyUnitFeatureMap:C,dirtyUnitOtherFormulaMap:p,clearDependencyTreeCache:N}=L;T!=null&&this._mergeDirtyRanges(n,T),A!=null&&this._mergeDirtyNameMap(i,A),S!=null&&this._mergeDirtyNameMap(o,S),C!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(u,C),p!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,p),N!=null&&this._mergeDirtyNameMap(s,N)}return{dirtyRanges:n,dirtyNameMap:i,dirtyDefinedNameMap:o,dirtyUnitFeatureMap:u,dirtyUnitOtherFormulaMap:c,forceCalculation:!1,clearDependencyTreeCache:s,maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}_mergeDirty(a,n){const i=[...a.dirtyRanges,...n.dirtyRanges],o={...a.dirtyNameMap},u={...a.dirtyDefinedNameMap},c={...a.dirtyUnitFeatureMap},s={...a.dirtyUnitOtherFormulaMap},l={...a.clearDependencyTreeCache};this._mergeDirtyNameMap(o,n.dirtyNameMap),this._mergeDirtyNameMap(u,n.dirtyDefinedNameMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,n.dirtyUnitFeatureMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(s,n.dirtyUnitOtherFormulaMap),this._mergeDirtyNameMap(l,n.clearDependencyTreeCache);const d=a.maxIteration||n.maxIteration;return{dirtyRanges:i,dirtyNameMap:o,dirtyDefinedNameMap:u,dirtyUnitFeatureMap:c,dirtyUnitOtherFormulaMap:s,forceCalculation:!!this._forceCalculating,clearDependencyTreeCache:l,maxIteration:d}}_mergeDirtyRanges(a,n){for(const i of n){let o=!1;for(const u of a)if(i.unitId===u.unitId&&i.sheetId===u.sheetId){const{startRow:c,startColumn:s,endRow:l,endColumn:d}=i.range,{startRow:L,startColumn:T,endRow:A,endColumn:S}=u.range;if(c===L&&s===T&&l===A&&d===S){o=!0;break}}o||a.push(i)}}_mergeDirtyNameMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{var u;(u=n[i])!=null&&u[o]&&(a[i][o]=n[i][o])})})}_mergeDirtyUnitFeatureOrOtherFormulaMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{a[i][o]==null&&(a[i][o]={}),Object.keys(n[i][o]).forEach(u=>{a[i][o][u]=n[i][o][u]||!1})})})}_initialExecuteFormulaProcessListener(){let a=null,n=0;this.disposeWithMe(this._commandService.onCommandExecuted(i=>{if(i.id===t.SetFormulaCalculationStartMutation.id){const{forceCalculation:u=!1}=i.params;u&&(this._forceCalculating=!0)}else i.id===t.SetFormulaCalculationStopMutation.id&&this.clearProgress();if(i.id!==t.SetFormulaCalculationNotificationMutation.id)return;const o=i.params;if(o.stageInfo!=null){const{stage:u}=o.stageInfo;if(u===t.FormulaExecuteStageType.START){if(this._calculationMode===H.NO_CALCULATION)return;n===0&&(this._startExecutionTime=performance.now()),n++,a!==null&&(clearTimeout(a),a=null),a=setTimeout(()=>{a=null,this._startProgress()},1e3)}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.calculating");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.START_DEPENDENCY_ARRAY_FORMULA){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.array-analysis");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING_ARRAY_FORMULA&&(this._executionInProgressParams=o.stageInfo,a===null)){const c=this._localeService.t("formula.progress.array-calculation");this._calculateProgress(c)}}else{const u=o.functionsExecutedState;let c="";switch(n--,u){case t.FormulaExecutedStateType.NOT_EXECUTED:c="No tasks are being executed anymore",this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.STOP_EXECUTION:c="The execution of the formula has been stopped",n=0;break;case t.FormulaExecutedStateType.SUCCESS:c="Formula calculation succeeded",(n===0||n===-1)&&(c+=`. Total time consumed: ${performance.now()-this._startExecutionTime} ms`),this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.INITIAL:c="Waiting for calculation",this._resetExecutingDirtyData();break}(n===0||n===-1)&&(a?(clearTimeout(a),a=null,this.clearProgress()):this._completeProgress(),n=0,this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._forceCalculating=!1),u===t.FormulaExecutedStateType.STOP_EXECUTION&&this._restartCalculation?(this._restartCalculation=!1,this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St)):this._executionInProgressParams=null,this._logService.debug("[TriggerCalculationController]",c)}}))}_resetExecutingDirtyData(){this._executingDirtyData={dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},forceCalculation:!1,clearDependencyTreeCache:{}}}_initialExecuteFormula(){const a=this._getDirtyDataByCalculationMode(this._calculationMode);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,a,St),this._registerOtherFormulaService.calculateStarted$.next(!0)}_getDirtyDataByCalculationMode(a){const n=a===H.FORCED,i=a===H.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:n,dirtyRanges:i,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{},maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}},E.TriggerCalculationController=Fe([g(0,f.ICommandService),g(1,t.IActiveDirtyManagerService),g(2,f.ILogService),g(3,f.IConfigService),g(4,f.Inject(t.FormulaDataModel)),g(5,f.Inject(f.LocaleService)),g(6,f.Inject(E.RegisterOtherFormulaService))],E.TriggerCalculationController);var Be=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,Ve=(r,e,a,n)=>{for(var i=n>1?void 0:n?ve(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Be(e,a,i),i},X=(r,e)=>(a,n)=>e(a,n,r);E.UpdateFormulaController=class extends f.Disposable{constructor(e,a,n,i,o,u,c,s){super(),this._univerInstanceService=e,this._commandService=a,this._lexerTreeBuilder=n,this._formulaDataModel=i,this._sheetInterceptorService=o,this._definedNamesService=u,this._configService=c,this._injector=s,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>this._getUpdateFormula(e)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.params)if(e.id===m.RemoveSheetMutation.id){const{subUnitId:a,unitId:n}=e.params;this._handleWorkbookDisposed(n,a)}else e.id===m.InsertSheetMutation.id&&this._handleInsertSheetMutation(e.params)})),this.disposeWithMe(this._commandService.beforeCommandExecuted((e,a)=>{if(e.id===m.SetRangeValuesMutation.id){const n=e.params;if(a&&a.onlyLocal===!0||n.trigger===m.SetStyleCommand.id||n.trigger===m.SetBorderCommand.id||n.trigger===m.ClearSelectionFormatCommand.id)return;this._handleSetRangeValuesMutation(n)}})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(f.UniverInstanceType.UNIVER_SHEET).subscribe(e=>this._handleWorkbookAdded(e))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(f.UniverInstanceType.UNIVER_SHEET).pipe(Y.map(e=>e.getUnitId())).subscribe(e=>this._handleWorkbookDisposed(e)))}_handleSetRangeValuesMutation(e){const{subUnitId:a,unitId:n,cellValue:i}=e;if(i==null)return;const o=this._formulaDataModel.updateFormulaData(n,a,i),u={[n]:{[a]:o}};this._commandService.executeCommand(m.SetRangeValuesMutation.id,{unitId:n,subUnitId:a,cellValue:me(o)},{onlyLocal:!0,fromFormula:!0}),this._formulaDataModel.updateArrayFormulaCellData(n,a,i),this._formulaDataModel.updateArrayFormulaRange(n,a,i),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:u},{onlyLocal:!0}),this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange(),arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData()},{onlyLocal:!0,remove:!0})}_handleWorkbookDisposed(e,a){const n=this._formulaDataModel.getFormulaData(),i=Pt(n,e,a),o=this._formulaDataModel.getArrayFormulaRange(),u=Pt(o,e,a),c=this._formulaDataModel.getArrayFormulaCellData(),s=Pt(c,e,a);i&&this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0}),u&&s&&this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:o,arrayFormulaCellData:c},{onlyLocal:!0})}_handleInsertSheetMutation(e){const{sheet:a,unitId:n}=e,i=this._formulaDataModel.getFormulaData(),{id:o,cellData:u}=a,c=new f.ObjectMatrix(u),s=t.initSheetFormulaData(i,n,o,c);this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:s},{onlyLocal:!0})}_handleWorkbookAdded(e){var l;const a={},n=e.getUnitId(),i={[n]:{}};e.getSheets().forEach(d=>{var S;const L=d.getCellMatrix(),T=d.getSheetId(),A=t.initSheetFormulaData(a,n,T,L);i[n][T]=(S=A[n])==null?void 0:S[T]}),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0});const u=this._configService.getConfig(nt),c=(l=u==null?void 0:u.initialFormulaComputing)!=null?l:H.WHEN_EMPTY,s=this._getDiryDataByCalculationMode(c);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,s,{onlyLocal:!0})}_getDiryDataByCalculationMode(e){const a=e===H.FORCED,n=e===H.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:a,dirtyRanges:n,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}}_getUpdateFormula(e){const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(!a)return{undos:[],redos:[]};const n=qt(a,e);if(n){const{unitSheetNameMap:i}=this._formulaDataModel.getCalculateData(),o=this._formulaDataModel.getFormulaData(),{newFormulaData:u}=this._getFormulaReferenceMoveInfo(o,i,n),{undos:c,redos:s}=wt(o,u,n);return{undos:c,redos:s}}return{undos:[],redos:[]}}_getFormulaReferenceMoveInfo(e,a,n){if(!f.Tools.isDefine(e))return{newFormulaData:{},oldFormulaData:{}};const i=Object.keys(e);if(i.length===0)return{newFormulaData:{},oldFormulaData:{}};const o={},u={};for(const c of i){const s=e[c];if(s==null)continue;const l=Object.keys(s);f.Tools.isDefine(o[c])||(o[c]={}),f.Tools.isDefine(u[c])||(u[c]={});for(const d of l){const L=new f.ObjectMatrix(s[d]||{}),T=new f.ObjectMatrix;L.forValue((A,S,C)=>{var D;if(!C)return!0;const{f:p,x:N,y:I,si:P}=C,_=this._lexerTreeBuilder.sequenceNodesBuilder(p);if(_==null)return!0;let R=!1;const x=[];for(let y=0,M=_.length;y<M;y++){const U=_[y];if(typeof U=="string")continue;const{token:F,nodeType:O}=U,{type:v}=n;if((v===b.SetDefinedName||v===b.RemoveDefinedName)&&(O===t.sequenceNodeType.DEFINED_NAME||O===t.sequenceNodeType.FUNCTION)){const{definedNameId:Z,definedName:J}=n;if(Z===void 0||J===void 0)continue;const Q=this._definedNamesService.getValueById(c,Z);if(Q==null||Q.name!==F)continue;_[y]={...U,token:v===b.SetDefinedName?J:t.ErrorType.REF},R=!0,x.push(y);continue}else if(O!==t.sequenceNodeType.REFERENCE)continue;const $=t.deserializeRangeWithSheetWithCache(F),{range:z,sheetName:w,unitId:B}=$,W=B==null||B.length===0?c:B,G=((D=a==null?void 0:a[W])==null?void 0:D[w])||"";if(!yt(n.unitId,n.sheetId,c,d,B,G))continue;const Nt={range:z,sheetId:G,unitId:B,sheetName:w,refOffsetX:N||0,refOffsetY:I||0};let K=null;if(v===b.SetName){const{unitId:Z,sheetId:J,sheetName:Q}=n;if(Q==null||G==null||G.length===0||J!==G)continue;K=t.serializeRangeToRefString({range:z,sheetName:Q,unitId:B})}else if(v===b.RemoveSheet){const{unitId:Z,sheetId:J,sheetName:Q}=n;if(G==null||G.length===0||J!==G)continue;K=t.ErrorType.REF}else v!==b.SetDefinedName&&(K=Ut(Nt,n,c,d));K!=null&&(_[y]={...U,token:K},R=!0,x.push(y))}if(!R)return!0;const q=xt(_,x,N,I);T.setValue(A,S,{f:`=${t.generateStringWithSequence(q)}`})}),u[c]&&(u[c][d]=T.getData())}}return{newFormulaData:u}}},E.UpdateFormulaController=Ve([X(0,f.IUniverInstanceService),X(1,f.ICommandService),X(2,f.Inject(t.LexerTreeBuilder)),X(3,f.Inject(t.FormulaDataModel)),X(4,f.Inject(m.SheetInterceptorService)),X(5,t.IDefinedNamesService),X(6,f.IConfigService),X(7,f.Inject(f.Injector))],E.UpdateFormulaController);const Ge=[{functionName:t.FUNCTION_NAMES_ARRAY.ARRAY_CONSTRAIN,functionType:t.FunctionType.Array,description:"formula.functionList.ARRAY_CONSTRAIN.description",abstract:"formula.functionList.ARRAY_CONSTRAIN.abstract",functionParameter:[{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ARRAY.FLATTEN,functionType:t.FunctionType.Array,description:"formula.functionList.FLATTEN.description",abstract:"formula.functionList.FLATTEN.abstract",functionParameter:[{name:"formula.functionList.FLATTEN.functionParameter.range1.name",detail:"formula.functionList.FLATTEN.functionParameter.range1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.FLATTEN.functionParameter.range2.name",detail:"formula.functionList.FLATTEN.functionParameter.range2.detail",example:"D1:F3",require:0,repeat:1}]}],He=[{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETADIST.description",abstract:"formula.functionList.BETADIST.abstract",functionParameter:[{name:"formula.functionList.BETADIST.functionParameter.x.name",detail:"formula.functionList.BETADIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.alpha.name",detail:"formula.functionList.BETADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.beta.name",detail:"formula.functionList.BETADIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.A.name",detail:"formula.functionList.BETADIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.B.name",detail:"formula.functionList.BETADIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETAINV.description",abstract:"formula.functionList.BETAINV.abstract",functionParameter:[{name:"formula.functionList.BETAINV.functionParameter.probability.name",detail:"formula.functionList.BETAINV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.alpha.name",detail:"formula.functionList.BETAINV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.beta.name",detail:"formula.functionList.BETAINV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.A.name",detail:"formula.functionList.BETAINV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.B.name",detail:"formula.functionList.BETAINV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BINOMDIST.description",abstract:"formula.functionList.BINOMDIST.abstract",functionParameter:[{name:"formula.functionList.BINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.BINOMDIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.trials.name",detail:"formula.functionList.BINOMDIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOMDIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOMDIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIDIST.description",abstract:"formula.functionList.CHIDIST.abstract",functionParameter:[{name:"formula.functionList.CHIDIST.functionParameter.x.name",detail:"formula.functionList.CHIDIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHIDIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHIDIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIINV.description",abstract:"formula.functionList.CHIINV.abstract",functionParameter:[{name:"formula.functionList.CHIINV.functionParameter.probability.name",detail:"formula.functionList.CHIINV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHIINV.functionParameter.degFreedom.name",detail:"formula.functionList.CHIINV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHITEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHITEST.description",abstract:"formula.functionList.CHITEST.abstract",functionParameter:[{name:"formula.functionList.CHITEST.functionParameter.actualRange.name",detail:"formula.functionList.CHITEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHITEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHITEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CONFIDENCE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CONFIDENCE.description",abstract:"formula.functionList.CONFIDENCE.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.COVAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.COVAR.description",abstract:"formula.functionList.COVAR.abstract",functionParameter:[{name:"formula.functionList.COVAR.functionParameter.array1.name",detail:"formula.functionList.COVAR.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVAR.functionParameter.array2.name",detail:"formula.functionList.COVAR.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CRITBINOM,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CRITBINOM.description",abstract:"formula.functionList.CRITBINOM.abstract",functionParameter:[{name:"formula.functionList.CRITBINOM.functionParameter.trials.name",detail:"formula.functionList.CRITBINOM.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.probabilityS.name",detail:"formula.functionList.CRITBINOM.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.alpha.name",detail:"formula.functionList.CRITBINOM.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.EXPONDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.EXPONDIST.description",abstract:"formula.functionList.EXPONDIST.abstract",functionParameter:[{name:"formula.functionList.EXPONDIST.functionParameter.x.name",detail:"formula.functionList.EXPONDIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.lambda.name",detail:"formula.functionList.EXPONDIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPONDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FDIST.description",abstract:"formula.functionList.FDIST.abstract",functionParameter:[{name:"formula.functionList.FDIST.functionParameter.x.name",detail:"formula.functionList.FDIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom1.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom2.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FINV.description",abstract:"formula.functionList.FINV.abstract",functionParameter:[{name:"formula.functionList.FINV.functionParameter.probability.name",detail:"formula.functionList.FINV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom1.name",detail:"formula.functionList.FINV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom2.name",detail:"formula.functionList.FINV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FTEST.description",abstract:"formula.functionList.FTEST.abstract",functionParameter:[{name:"formula.functionList.FTEST.functionParameter.array1.name",detail:"formula.functionList.FTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FTEST.functionParameter.array2.name",detail:"formula.functionList.FTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMADIST.description",abstract:"formula.functionList.GAMMADIST.abstract",functionParameter:[{name:"formula.functionList.GAMMADIST.functionParameter.x.name",detail:"formula.functionList.GAMMADIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.beta.name",detail:"formula.functionList.GAMMADIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMADIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMAINV.description",abstract:"formula.functionList.GAMMAINV.abstract",functionParameter:[{name:"formula.functionList.GAMMAINV.functionParameter.probability.name",detail:"formula.functionList.GAMMAINV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.alpha.name",detail:"formula.functionList.GAMMAINV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.beta.name",detail:"formula.functionList.GAMMAINV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.HYPGEOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.HYPGEOMDIST.description",abstract:"formula.functionList.HYPGEOMDIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGINV.description",abstract:"formula.functionList.LOGINV.abstract",functionParameter:[{name:"formula.functionList.LOGINV.functionParameter.probability.name",detail:"formula.functionList.LOGINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.mean.name",detail:"formula.functionList.LOGINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.standardDev.name",detail:"formula.functionList.LOGINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGNORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGNORMDIST.description",abstract:"formula.functionList.LOGNORMDIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORMDIST.functionParameter.x.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.MODE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.MODE.description",abstract:"formula.functionList.MODE.abstract",functionParameter:[{name:"formula.functionList.MODE.functionParameter.number1.name",detail:"formula.functionList.MODE.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE.functionParameter.number2.name",detail:"formula.functionList.MODE.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NEGBINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NEGBINOMDIST.description",abstract:"formula.functionList.NEGBINOMDIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMDIST.description",abstract:"formula.functionList.NORMDIST.abstract",functionParameter:[{name:"formula.functionList.NORMDIST.functionParameter.x.name",detail:"formula.functionList.NORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.mean.name",detail:"formula.functionList.NORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.NORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.cumulative.name",detail:"formula.functionList.NORMDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMINV.description",abstract:"formula.functionList.NORMINV.abstract",functionParameter:[{name:"formula.functionList.NORMINV.functionParameter.probability.name",detail:"formula.functionList.NORMINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.mean.name",detail:"formula.functionList.NORMINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.standardDev.name",detail:"formula.functionList.NORMINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSDIST.description",abstract:"formula.functionList.NORMSDIST.abstract",functionParameter:[{name:"formula.functionList.NORMSDIST.functionParameter.z.name",detail:"formula.functionList.NORMSDIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSINV.description",abstract:"formula.functionList.NORMSINV.abstract",functionParameter:[{name:"formula.functionList.NORMSINV.functionParameter.probability.name",detail:"formula.functionList.NORMSINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTILE.description",abstract:"formula.functionList.PERCENTILE.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE.functionParameter.array.name",detail:"formula.functionList.PERCENTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE.functionParameter.k.name",detail:"formula.functionList.PERCENTILE.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTRANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTRANK.description",abstract:"formula.functionList.PERCENTRANK.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.POISSON,functionType:t.FunctionType.Compatibility,description:"formula.functionList.POISSON.description",abstract:"formula.functionList.POISSON.abstract",functionParameter:[{name:"formula.functionList.POISSON.functionParameter.x.name",detail:"formula.functionList.POISSON.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.mean.name",detail:"formula.functionList.POISSON.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.cumulative.name",detail:"formula.functionList.POISSON.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.QUARTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.QUARTILE.description",abstract:"formula.functionList.QUARTILE.abstract",functionParameter:[{name:"formula.functionList.QUARTILE.functionParameter.array.name",detail:"formula.functionList.QUARTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE.functionParameter.quart.name",detail:"formula.functionList.QUARTILE.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.RANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.RANK.description",abstract:"formula.functionList.RANK.abstract",functionParameter:[{name:"formula.functionList.RANK.functionParameter.number.name",detail:"formula.functionList.RANK.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.ref.name",detail:"formula.functionList.RANK.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.order.name",detail:"formula.functionList.RANK.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEV.description",abstract:"formula.functionList.STDEV.abstract",functionParameter:[{name:"formula.functionList.STDEV.functionParameter.number1.name",detail:"formula.functionList.STDEV.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV.functionParameter.number2.name",detail:"formula.functionList.STDEV.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEVP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEVP.description",abstract:"formula.functionList.STDEVP.abstract",functionParameter:[{name:"formula.functionList.STDEVP.functionParameter.number1.name",detail:"formula.functionList.STDEVP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVP.functionParameter.number2.name",detail:"formula.functionList.STDEVP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TDIST.description",abstract:"formula.functionList.TDIST.abstract",functionParameter:[{name:"formula.functionList.TDIST.functionParameter.x.name",detail:"formula.functionList.TDIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.degFreedom.name",detail:"formula.functionList.TDIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.tails.name",detail:"formula.functionList.TDIST.functionParameter.tails.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TINV.description",abstract:"formula.functionList.TINV.abstract",functionParameter:[{name:"formula.functionList.TINV.functionParameter.probability.name",detail:"formula.functionList.TINV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.TINV.functionParameter.degFreedom.name",detail:"formula.functionList.TINV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TTEST.description",abstract:"formula.functionList.TTEST.abstract",functionParameter:[{name:"formula.functionList.TTEST.functionParameter.array1.name",detail:"formula.functionList.TTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.array2.name",detail:"formula.functionList.TTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.tails.name",detail:"formula.functionList.TTEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.type.name",detail:"formula.functionList.TTEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VAR.description",abstract:"formula.functionList.VAR.abstract",functionParameter:[{name:"formula.functionList.VAR.functionParameter.number1.name",detail:"formula.functionList.VAR.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR.functionParameter.number2.name",detail:"formula.functionList.VAR.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VARP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VARP.description",abstract:"formula.functionList.VARP.abstract",functionParameter:[{name:"formula.functionList.VARP.functionParameter.number1.name",detail:"formula.functionList.VARP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARP.functionParameter.number2.name",detail:"formula.functionList.VARP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.WEIBULL,functionType:t.FunctionType.Compatibility,description:"formula.functionList.WEIBULL.description",abstract:"formula.functionList.WEIBULL.abstract",functionParameter:[{name:"formula.functionList.WEIBULL.functionParameter.x.name",detail:"formula.functionList.WEIBULL.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.beta.name",detail:"formula.functionList.WEIBULL.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.ZTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.ZTEST.description",abstract:"formula.functionList.ZTEST.abstract",functionParameter:[{name:"formula.functionList.ZTEST.functionParameter.array.name",detail:"formula.functionList.ZTEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.x.name",detail:"formula.functionList.ZTEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.sigma.name",detail:"formula.functionList.ZTEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],Ye=[{functionName:t.FUNCTION_NAMES_CUBE.CUBEKPIMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEKPIMEMBER.description",abstract:"formula.functionList.CUBEKPIMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBER.description",abstract:"formula.functionList.CUBEMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBERPROPERTY,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBERPROPERTY.description",abstract:"formula.functionList.CUBEMEMBERPROPERTY.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBERANKEDMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBERANKEDMEMBER.description",abstract:"formula.functionList.CUBERANKEDMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESET,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESET.description",abstract:"formula.functionList.CUBESET.abstract",functionParameter:[{name:"formula.functionList.CUBESET.functionParameter.number1.name",detail:"formula.functionList.CUBESET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESET.functionParameter.number2.name",detail:"formula.functionList.CUBESET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESETCOUNT,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESETCOUNT.description",abstract:"formula.functionList.CUBESETCOUNT.abstract",functionParameter:[{name:"formula.functionList.CUBESETCOUNT.functionParameter.number1.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESETCOUNT.functionParameter.number2.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEVALUE,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEVALUE.description",abstract:"formula.functionList.CUBEVALUE.abstract",functionParameter:[{name:"formula.functionList.CUBEVALUE.functionParameter.number1.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEVALUE.functionParameter.number2.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],Xe=[{functionName:t.FUNCTION_NAMES_DATABASE.DAVERAGE,functionType:t.FunctionType.Database,description:"formula.functionList.DAVERAGE.description",abstract:"formula.functionList.DAVERAGE.abstract",functionParameter:[{name:"formula.functionList.DAVERAGE.functionParameter.database.name",detail:"formula.functionList.DAVERAGE.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.field.name",detail:"formula.functionList.DAVERAGE.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.criteria.name",detail:"formula.functionList.DAVERAGE.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNT,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNT.description",abstract:"formula.functionList.DCOUNT.abstract",functionParameter:[{name:"formula.functionList.DCOUNT.functionParameter.database.name",detail:"formula.functionList.DCOUNT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.field.name",detail:"formula.functionList.DCOUNT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.criteria.name",detail:"formula.functionList.DCOUNT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNTA,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNTA.description",abstract:"formula.functionList.DCOUNTA.abstract",functionParameter:[{name:"formula.functionList.DCOUNTA.functionParameter.database.name",detail:"formula.functionList.DCOUNTA.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.field.name",detail:"formula.functionList.DCOUNTA.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.criteria.name",detail:"formula.functionList.DCOUNTA.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DGET,functionType:t.FunctionType.Database,description:"formula.functionList.DGET.description",abstract:"formula.functionList.DGET.abstract",functionParameter:[{name:"formula.functionList.DGET.functionParameter.database.name",detail:"formula.functionList.DGET.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.field.name",detail:"formula.functionList.DGET.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.criteria.name",detail:"formula.functionList.DGET.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMAX,functionType:t.FunctionType.Database,description:"formula.functionList.DMAX.description",abstract:"formula.functionList.DMAX.abstract",functionParameter:[{name:"formula.functionList.DMAX.functionParameter.database.name",detail:"formula.functionList.DMAX.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.field.name",detail:"formula.functionList.DMAX.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.criteria.name",detail:"formula.functionList.DMAX.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMIN,functionType:t.FunctionType.Database,description:"formula.functionList.DMIN.description",abstract:"formula.functionList.DMIN.abstract",functionParameter:[{name:"formula.functionList.DMIN.functionParameter.database.name",detail:"formula.functionList.DMIN.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.field.name",detail:"formula.functionList.DMIN.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.criteria.name",detail:"formula.functionList.DMIN.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DPRODUCT,functionType:t.FunctionType.Database,description:"formula.functionList.DPRODUCT.description",abstract:"formula.functionList.DPRODUCT.abstract",functionParameter:[{name:"formula.functionList.DPRODUCT.functionParameter.database.name",detail:"formula.functionList.DPRODUCT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.field.name",detail:"formula.functionList.DPRODUCT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.criteria.name",detail:"formula.functionList.DPRODUCT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEV,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEV.description",abstract:"formula.functionList.DSTDEV.abstract",functionParameter:[{name:"formula.functionList.DSTDEV.functionParameter.database.name",detail:"formula.functionList.DSTDEV.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.field.name",detail:"formula.functionList.DSTDEV.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.criteria.name",detail:"formula.functionList.DSTDEV.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEVP,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEVP.description",abstract:"formula.functionList.DSTDEVP.abstract",functionParameter:[{name:"formula.functionList.DSTDEVP.functionParameter.database.name",detail:"formula.functionList.DSTDEVP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.field.name",detail:"formula.functionList.DSTDEVP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.criteria.name",detail:"formula.functionList.DSTDEVP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSUM,functionType:t.FunctionType.Database,description:"formula.functionList.DSUM.description",abstract:"formula.functionList.DSUM.abstract",functionParameter:[{name:"formula.functionList.DSUM.functionParameter.database.name",detail:"formula.functionList.DSUM.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.field.name",detail:"formula.functionList.DSUM.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.criteria.name",detail:"formula.functionList.DSUM.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVAR,functionType:t.FunctionType.Database,description:"formula.functionList.DVAR.description",abstract:"formula.functionList.DVAR.abstract",functionParameter:[{name:"formula.functionList.DVAR.functionParameter.database.name",detail:"formula.functionList.DVAR.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.field.name",detail:"formula.functionList.DVAR.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.criteria.name",detail:"formula.functionList.DVAR.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVARP,functionType:t.FunctionType.Database,description:"formula.functionList.DVARP.description",abstract:"formula.functionList.DVARP.abstract",functionParameter:[{name:"formula.functionList.DVARP.functionParameter.database.name",detail:"formula.functionList.DVARP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.field.name",detail:"formula.functionList.DVARP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.criteria.name",detail:"formula.functionList.DVARP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]}],we=[{functionName:t.FUNCTION_NAMES_DATE.DATE,functionType:t.FunctionType.Date,description:"formula.functionList.DATE.description",abstract:"formula.functionList.DATE.abstract",functionParameter:[{name:"formula.functionList.DATE.functionParameter.year.name",detail:"formula.functionList.DATE.functionParameter.year.detail",example:"2024",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.month.name",detail:"formula.functionList.DATE.functionParameter.month.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.day.name",detail:"formula.functionList.DATE.functionParameter.day.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEDIF,functionType:t.FunctionType.Date,description:"formula.functionList.DATEDIF.description",abstract:"formula.functionList.DATEDIF.abstract",functionParameter:[{name:"formula.functionList.DATEDIF.functionParameter.startDate.name",detail:"formula.functionList.DATEDIF.functionParameter.startDate.detail",example:'"2001-6-1"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.endDate.name",detail:"formula.functionList.DATEDIF.functionParameter.endDate.detail",example:'"2002-8-15"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.method.name",detail:"formula.functionList.DATEDIF.functionParameter.method.detail",example:'"D"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.DATEVALUE.description",abstract:"formula.functionList.DATEVALUE.abstract",functionParameter:[{name:"formula.functionList.DATEVALUE.functionParameter.dateText.name",detail:"formula.functionList.DATEVALUE.functionParameter.dateText.detail",example:'"2024-8-8"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAY,functionType:t.FunctionType.Date,description:"formula.functionList.DAY.description",abstract:"formula.functionList.DAY.abstract",functionParameter:[{name:"formula.functionList.DAY.functionParameter.serialNumber.name",detail:"formula.functionList.DAY.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS.description",abstract:"formula.functionList.DAYS.abstract",functionParameter:[{name:"formula.functionList.DAYS.functionParameter.endDate.name",detail:"formula.functionList.DAYS.functionParameter.endDate.detail",example:'"2021-12-31"',require:1,repeat:0},{name:"formula.functionList.DAYS.functionParameter.startDate.name",detail:"formula.functionList.DAYS.functionParameter.startDate.detail",example:'"2021-1-1"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS360,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS360.description",abstract:"formula.functionList.DAYS360.abstract",functionParameter:[{name:"formula.functionList.DAYS360.functionParameter.startDate.name",detail:"formula.functionList.DAYS360.functionParameter.startDate.detail",example:'"2021-1-29"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.endDate.name",detail:"formula.functionList.DAYS360.functionParameter.endDate.detail",example:'"2021-3-31"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.method.name",detail:"formula.functionList.DAYS360.functionParameter.method.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EDATE,functionType:t.FunctionType.Date,description:"formula.functionList.EDATE.description",abstract:"formula.functionList.EDATE.abstract",functionParameter:[{name:"formula.functionList.EDATE.functionParameter.startDate.name",detail:"formula.functionList.EDATE.functionParameter.startDate.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.EDATE.functionParameter.months.name",detail:"formula.functionList.EDATE.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EOMONTH,functionType:t.FunctionType.Date,description:"formula.functionList.EOMONTH.description",abstract:"formula.functionList.EOMONTH.abstract",functionParameter:[{name:"formula.functionList.EOMONTH.functionParameter.startDate.name",detail:"formula.functionList.EOMONTH.functionParameter.startDate.detail",example:'"2011-1-1"',require:1,repeat:0},{name:"formula.functionList.EOMONTH.functionParameter.months.name",detail:"formula.functionList.EOMONTH.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EPOCHTODATE,functionType:t.FunctionType.Date,description:"formula.functionList.EPOCHTODATE.description",abstract:"formula.functionList.EPOCHTODATE.abstract",functionParameter:[{name:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.detail",example:"1655906710",require:1,repeat:0},{name:"formula.functionList.EPOCHTODATE.functionParameter.unit.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.unit.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.HOUR,functionType:t.FunctionType.Date,description:"formula.functionList.HOUR.description",abstract:"formula.functionList.HOUR.abstract",functionParameter:[{name:"formula.functionList.HOUR.functionParameter.serialNumber.name",detail:"formula.functionList.HOUR.functionParameter.serialNumber.detail",example:'"2011-7-18 7:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.ISOWEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.ISOWEEKNUM.description",abstract:"formula.functionList.ISOWEEKNUM.abstract",functionParameter:[{name:"formula.functionList.ISOWEEKNUM.functionParameter.date.name",detail:"formula.functionList.ISOWEEKNUM.functionParameter.date.detail",example:'"2012-3-9"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MINUTE,functionType:t.FunctionType.Date,description:"formula.functionList.MINUTE.description",abstract:"formula.functionList.MINUTE.abstract",functionParameter:[{name:"formula.functionList.MINUTE.functionParameter.serialNumber.name",detail:"formula.functionList.MINUTE.functionParameter.serialNumber.detail",example:'"12:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MONTH,functionType:t.FunctionType.Date,description:"formula.functionList.MONTH.description",abstract:"formula.functionList.MONTH.abstract",functionParameter:[{name:"formula.functionList.MONTH.functionParameter.serialNumber.name",detail:"formula.functionList.MONTH.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS.description",abstract:"formula.functionList.NETWORKDAYS.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS_INTL.description",abstract:"formula.functionList.NETWORKDAYS_INTL.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NOW,functionType:t.FunctionType.Date,description:"formula.functionList.NOW.description",abstract:"formula.functionList.NOW.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.SECOND,functionType:t.FunctionType.Date,description:"formula.functionList.SECOND.description",abstract:"formula.functionList.SECOND.abstract",functionParameter:[{name:"formula.functionList.SECOND.functionParameter.serialNumber.name",detail:"formula.functionList.SECOND.functionParameter.serialNumber.detail",example:'"4:48:18"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIME,functionType:t.FunctionType.Date,description:"formula.functionList.TIME.description",abstract:"formula.functionList.TIME.abstract",functionParameter:[{name:"formula.functionList.TIME.functionParameter.hour.name",detail:"formula.functionList.TIME.functionParameter.hour.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.minute.name",detail:"formula.functionList.TIME.functionParameter.minute.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.second.name",detail:"formula.functionList.TIME.functionParameter.second.detail",example:"59",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIMEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.TIMEVALUE.description",abstract:"formula.functionList.TIMEVALUE.abstract",functionParameter:[{name:"formula.functionList.TIMEVALUE.functionParameter.timeText.name",detail:"formula.functionList.TIMEVALUE.functionParameter.timeText.detail",example:'"15:20:59"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TO_DATE,functionType:t.FunctionType.Date,description:"formula.functionList.TO_DATE.description",abstract:"formula.functionList.TO_DATE.abstract",functionParameter:[{name:"formula.functionList.TO_DATE.functionParameter.value.name",detail:"formula.functionList.TO_DATE.functionParameter.value.detail",example:"40826.4375",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TODAY,functionType:t.FunctionType.Date,description:"formula.functionList.TODAY.description",abstract:"formula.functionList.TODAY.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.WEEKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKDAY.description",abstract:"formula.functionList.WEEKDAY.abstract",functionParameter:[{name:"formula.functionList.WEEKDAY.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKDAY.functionParameter.serialNumber.detail",example:'"2008-2-14"',require:1,repeat:0},{name:"formula.functionList.WEEKDAY.functionParameter.returnType.name",detail:"formula.functionList.WEEKDAY.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKNUM.description",abstract:"formula.functionList.WEEKNUM.abstract",functionParameter:[{name:"formula.functionList.WEEKNUM.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKNUM.functionParameter.serialNumber.detail",example:'"2012-3-9"',require:1,repeat:0},{name:"formula.functionList.WEEKNUM.functionParameter.returnType.name",detail:"formula.functionList.WEEKNUM.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY.description",abstract:"formula.functionList.WORKDAY.abstract",functionParameter:[{name:"formula.functionList.WORKDAY.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.days.name",detail:"formula.functionList.WORKDAY.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY_INTL.description",abstract:"formula.functionList.WORKDAY_INTL.abstract",functionParameter:[{name:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.days.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEAR,functionType:t.FunctionType.Date,description:"formula.functionList.YEAR.description",abstract:"formula.functionList.YEAR.abstract",functionParameter:[{name:"formula.functionList.YEAR.functionParameter.serialNumber.name",detail:"formula.functionList.YEAR.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEARFRAC,functionType:t.FunctionType.Date,description:"formula.functionList.YEARFRAC.description",abstract:"formula.functionList.YEARFRAC.abstract",functionParameter:[{name:"formula.functionList.YEARFRAC.functionParameter.startDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.startDate.detail",example:'"2012-1-1"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.endDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.endDate.detail",example:'"2012-7-30"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.basis.name",detail:"formula.functionList.YEARFRAC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],We=[{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELI,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELI.description",abstract:"formula.functionList.BESSELI.abstract",functionParameter:[{name:"formula.functionList.BESSELI.functionParameter.x.name",detail:"formula.functionList.BESSELI.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELI.functionParameter.n.name",detail:"formula.functionList.BESSELI.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELJ,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELJ.description",abstract:"formula.functionList.BESSELJ.abstract",functionParameter:[{name:"formula.functionList.BESSELJ.functionParameter.x.name",detail:"formula.functionList.BESSELJ.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELJ.functionParameter.n.name",detail:"formula.functionList.BESSELJ.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELK,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELK.description",abstract:"formula.functionList.BESSELK.abstract",functionParameter:[{name:"formula.functionList.BESSELK.functionParameter.x.name",detail:"formula.functionList.BESSELK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELK.functionParameter.n.name",detail:"formula.functionList.BESSELK.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELY,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELY.description",abstract:"formula.functionList.BESSELY.abstract",functionParameter:[{name:"formula.functionList.BESSELY.functionParameter.x.name",detail:"formula.functionList.BESSELY.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELY.functionParameter.n.name",detail:"formula.functionList.BESSELY.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2DEC.description",abstract:"formula.functionList.BIN2DEC.abstract",functionParameter:[{name:"formula.functionList.BIN2DEC.functionParameter.number.name",detail:"formula.functionList.BIN2DEC.functionParameter.number.detail",example:"1100100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2HEX.description",abstract:"formula.functionList.BIN2HEX.abstract",functionParameter:[{name:"formula.functionList.BIN2HEX.functionParameter.number.name",detail:"formula.functionList.BIN2HEX.functionParameter.number.detail",example:"11111011",require:1,repeat:0},{name:"formula.functionList.BIN2HEX.functionParameter.places.name",detail:"formula.functionList.BIN2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2OCT.description",abstract:"formula.functionList.BIN2OCT.abstract",functionParameter:[{name:"formula.functionList.BIN2OCT.functionParameter.number.name",detail:"formula.functionList.BIN2OCT.functionParameter.number.detail",example:"1001",require:1,repeat:0},{name:"formula.functionList.BIN2OCT.functionParameter.places.name",detail:"formula.functionList.BIN2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITAND,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITAND.description",abstract:"formula.functionList.BITAND.abstract",functionParameter:[{name:"formula.functionList.BITAND.functionParameter.number1.name",detail:"formula.functionList.BITAND.functionParameter.number1.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITAND.functionParameter.number2.name",detail:"formula.functionList.BITAND.functionParameter.number2.detail",example:"25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITLSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITLSHIFT.description",abstract:"formula.functionList.BITLSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITLSHIFT.functionParameter.number.name",detail:"formula.functionList.BITLSHIFT.functionParameter.number.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITOR.description",abstract:"formula.functionList.BITOR.abstract",functionParameter:[{name:"formula.functionList.BITOR.functionParameter.number1.name",detail:"formula.functionList.BITOR.functionParameter.number1.detail",example:"23",require:1,repeat:0},{name:"formula.functionList.BITOR.functionParameter.number2.name",detail:"formula.functionList.BITOR.functionParameter.number2.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITRSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITRSHIFT.description",abstract:"formula.functionList.BITRSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITRSHIFT.functionParameter.number.name",detail:"formula.functionList.BITRSHIFT.functionParameter.number.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITXOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITXOR.description",abstract:"formula.functionList.BITXOR.abstract",functionParameter:[{name:"formula.functionList.BITXOR.functionParameter.number1.name",detail:"formula.functionList.BITXOR.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.BITXOR.functionParameter.number2.name",detail:"formula.functionList.BITXOR.functionParameter.number2.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.COMPLEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.COMPLEX.description",abstract:"formula.functionList.COMPLEX.abstract",functionParameter:[{name:"formula.functionList.COMPLEX.functionParameter.realNum.name",detail:"formula.functionList.COMPLEX.functionParameter.realNum.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.iNum.name",detail:"formula.functionList.COMPLEX.functionParameter.iNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.suffix.name",detail:"formula.functionList.COMPLEX.functionParameter.suffix.detail",example:'"i"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.CONVERT,functionType:t.FunctionType.Engineering,description:"formula.functionList.CONVERT.description",abstract:"formula.functionList.CONVERT.abstract",functionParameter:[{name:"formula.functionList.CONVERT.functionParameter.number.name",detail:"formula.functionList.CONVERT.functionParameter.number.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.fromUnit.name",detail:"formula.functionList.CONVERT.functionParameter.fromUnit.detail",example:'"lbm"',require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.toUnit.name",detail:"formula.functionList.CONVERT.functionParameter.toUnit.detail",example:'"kg"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2BIN.description",abstract:"formula.functionList.DEC2BIN.abstract",functionParameter:[{name:"formula.functionList.DEC2BIN.functionParameter.number.name",detail:"formula.functionList.DEC2BIN.functionParameter.number.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.DEC2BIN.functionParameter.places.name",detail:"formula.functionList.DEC2BIN.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2HEX.description",abstract:"formula.functionList.DEC2HEX.abstract",functionParameter:[{name:"formula.functionList.DEC2HEX.functionParameter.number.name",detail:"formula.functionList.DEC2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DEC2HEX.functionParameter.places.name",detail:"formula.functionList.DEC2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2OCT.description",abstract:"formula.functionList.DEC2OCT.abstract",functionParameter:[{name:"formula.functionList.DEC2OCT.functionParameter.number.name",detail:"formula.functionList.DEC2OCT.functionParameter.number.detail",example:"58",require:1,repeat:0},{name:"formula.functionList.DEC2OCT.functionParameter.places.name",detail:"formula.functionList.DEC2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DELTA,functionType:t.FunctionType.Engineering,description:"formula.functionList.DELTA.description",abstract:"formula.functionList.DELTA.abstract",functionParameter:[{name:"formula.functionList.DELTA.functionParameter.number1.name",detail:"formula.functionList.DELTA.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.DELTA.functionParameter.number2.name",detail:"formula.functionList.DELTA.functionParameter.number2.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF.description",abstract:"formula.functionList.ERF.abstract",functionParameter:[{name:"formula.functionList.ERF.functionParameter.lowerLimit.name",detail:"formula.functionList.ERF.functionParameter.lowerLimit.detail",example:"0.745",require:1,repeat:0},{name:"formula.functionList.ERF.functionParameter.upperLimit.name",detail:"formula.functionList.ERF.functionParameter.upperLimit.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF_PRECISE.description",abstract:"formula.functionList.ERF_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERF_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERF_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC.description",abstract:"formula.functionList.ERFC.abstract",functionParameter:[{name:"formula.functionList.ERFC.functionParameter.x.name",detail:"formula.functionList.ERFC.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC_PRECISE.description",abstract:"formula.functionList.ERFC_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERFC_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERFC_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.GESTEP,functionType:t.FunctionType.Engineering,description:"formula.functionList.GESTEP.description",abstract:"formula.functionList.GESTEP.abstract",functionParameter:[{name:"formula.functionList.GESTEP.functionParameter.number.name",detail:"formula.functionList.GESTEP.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GESTEP.functionParameter.step.name",detail:"formula.functionList.GESTEP.functionParameter.step.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2BIN.description",abstract:"formula.functionList.HEX2BIN.abstract",functionParameter:[{name:"formula.functionList.HEX2BIN.functionParameter.number.name",detail:"formula.functionList.HEX2BIN.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2BIN.functionParameter.places.name",detail:"formula.functionList.HEX2BIN.functionParameter.places.detail",example:"8",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2DEC.description",abstract:"formula.functionList.HEX2DEC.abstract",functionParameter:[{name:"formula.functionList.HEX2DEC.functionParameter.number.name",detail:"formula.functionList.HEX2DEC.functionParameter.number.detail",example:'"A5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2OCT.description",abstract:"formula.functionList.HEX2OCT.abstract",functionParameter:[{name:"formula.functionList.HEX2OCT.functionParameter.number.name",detail:"formula.functionList.HEX2OCT.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2OCT.functionParameter.places.name",detail:"formula.functionList.HEX2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMABS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMABS.description",abstract:"formula.functionList.IMABS.abstract",functionParameter:[{name:"formula.functionList.IMABS.functionParameter.inumber.name",detail:"formula.functionList.IMABS.functionParameter.inumber.detail",example:'"5+12i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMAGINARY,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMAGINARY.description",abstract:"formula.functionList.IMAGINARY.abstract",functionParameter:[{name:"formula.functionList.IMAGINARY.functionParameter.inumber.name",detail:"formula.functionList.IMAGINARY.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMARGUMENT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMARGUMENT.description",abstract:"formula.functionList.IMARGUMENT.abstract",functionParameter:[{name:"formula.functionList.IMARGUMENT.functionParameter.inumber.name",detail:"formula.functionList.IMARGUMENT.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCONJUGATE,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCONJUGATE.description",abstract:"formula.functionList.IMCONJUGATE.abstract",functionParameter:[{name:"formula.functionList.IMCONJUGATE.functionParameter.inumber.name",detail:"formula.functionList.IMCONJUGATE.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOS.description",abstract:"formula.functionList.IMCOS.abstract",functionParameter:[{name:"formula.functionList.IMCOS.functionParameter.inumber.name",detail:"formula.functionList.IMCOS.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOSH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOSH.description",abstract:"formula.functionList.IMCOSH.abstract",functionParameter:[{name:"formula.functionList.IMCOSH.functionParameter.inumber.name",detail:"formula.functionList.IMCOSH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOT.description",abstract:"formula.functionList.IMCOT.abstract",functionParameter:[{name:"formula.functionList.IMCOT.functionParameter.inumber.name",detail:"formula.functionList.IMCOT.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOTH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOTH.description",abstract:"formula.functionList.IMCOTH.abstract",functionParameter:[{name:"formula.functionList.IMCOTH.functionParameter.inumber.name",detail:"formula.functionList.IMCOTH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSC.description",abstract:"formula.functionList.IMCSC.abstract",functionParameter:[{name:"formula.functionList.IMCSC.functionParameter.inumber.name",detail:"formula.functionList.IMCSC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSCH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSCH.description",abstract:"formula.functionList.IMCSCH.abstract",functionParameter:[{name:"formula.functionList.IMCSCH.functionParameter.inumber.name",detail:"formula.functionList.IMCSCH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMDIV,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMDIV.description",abstract:"formula.functionList.IMDIV.abstract",functionParameter:[{name:"formula.functionList.IMDIV.functionParameter.inumber1.name",detail:"formula.functionList.IMDIV.functionParameter.inumber1.detail",example:'"-238+240i"',require:1,repeat:0},{name:"formula.functionList.IMDIV.functionParameter.inumber2.name",detail:"formula.functionList.IMDIV.functionParameter.inumber2.detail",example:'"10+24i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMEXP,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMEXP.description",abstract:"formula.functionList.IMEXP.abstract",functionParameter:[{name:"formula.functionList.IMEXP.functionParameter.inumber.name",detail:"formula.functionList.IMEXP.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLN.description",abstract:"formula.functionList.IMLN.abstract",functionParameter:[{name:"formula.functionList.IMLN.functionParameter.inumber.name",detail:"formula.functionList.IMLN.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG.description",abstract:"formula.functionList.IMLOG.abstract",functionParameter:[{name:"formula.functionList.IMLOG.functionParameter.inumber.name",detail:"formula.functionList.IMLOG.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMLOG.functionParameter.base.name",detail:"formula.functionList.IMLOG.functionParameter.base.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG10,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG10.description",abstract:"formula.functionList.IMLOG10.abstract",functionParameter:[{name:"formula.functionList.IMLOG10.functionParameter.inumber.name",detail:"formula.functionList.IMLOG10.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG2,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG2.description",abstract:"formula.functionList.IMLOG2.abstract",functionParameter:[{name:"formula.functionList.IMLOG2.functionParameter.inumber.name",detail:"formula.functionList.IMLOG2.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPOWER,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPOWER.description",abstract:"formula.functionList.IMPOWER.abstract",functionParameter:[{name:"formula.functionList.IMPOWER.functionParameter.inumber.name",detail:"formula.functionList.IMPOWER.functionParameter.inumber.detail",example:'"2+3i"',require:1,repeat:0},{name:"formula.functionList.IMPOWER.functionParameter.number.name",detail:"formula.functionList.IMPOWER.functionParameter.number.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPRODUCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPRODUCT.description",abstract:"formula.functionList.IMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.IMPRODUCT.functionParameter.inumber1.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMPRODUCT.functionParameter.inumber2.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMREAL,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMREAL.description",abstract:"formula.functionList.IMREAL.abstract",functionParameter:[{name:"formula.functionList.IMREAL.functionParameter.inumber.name",detail:"formula.functionList.IMREAL.functionParameter.inumber.detail",example:'"6-9i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSEC.description",abstract:"formula.functionList.IMSEC.abstract",functionParameter:[{name:"formula.functionList.IMSEC.functionParameter.inumber.name",detail:"formula.functionList.IMSEC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSECH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSECH.description",abstract:"formula.functionList.IMSECH.abstract",functionParameter:[{name:"formula.functionList.IMSECH.functionParameter.inumber.name",detail:"formula.functionList.IMSECH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSIN.description",abstract:"formula.functionList.IMSIN.abstract",functionParameter:[{name:"formula.functionList.IMSIN.functionParameter.inumber.name",detail:"formula.functionList.IMSIN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSINH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSINH.description",abstract:"formula.functionList.IMSINH.abstract",functionParameter:[{name:"formula.functionList.IMSINH.functionParameter.inumber.name",detail:"formula.functionList.IMSINH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSQRT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSQRT.description",abstract:"formula.functionList.IMSQRT.abstract",functionParameter:[{name:"formula.functionList.IMSQRT.functionParameter.inumber.name",detail:"formula.functionList.IMSQRT.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUB,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUB.description",abstract:"formula.functionList.IMSUB.abstract",functionParameter:[{name:"formula.functionList.IMSUB.functionParameter.inumber1.name",detail:"formula.functionList.IMSUB.functionParameter.inumber1.detail",example:'"13+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUB.functionParameter.inumber2.name",detail:"formula.functionList.IMSUB.functionParameter.inumber2.detail",example:'"5+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUM,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUM.description",abstract:"formula.functionList.IMSUM.abstract",functionParameter:[{name:"formula.functionList.IMSUM.functionParameter.inumber1.name",detail:"formula.functionList.IMSUM.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUM.functionParameter.inumber2.name",detail:"formula.functionList.IMSUM.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTAN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTAN.description",abstract:"formula.functionList.IMTAN.abstract",functionParameter:[{name:"formula.functionList.IMTAN.functionParameter.inumber.name",detail:"formula.functionList.IMTAN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTANH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTANH.description",abstract:"formula.functionList.IMTANH.abstract",functionParameter:[{name:"formula.functionList.IMTANH.functionParameter.inumber.name",detail:"formula.functionList.IMTANH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2BIN.description",abstract:"formula.functionList.OCT2BIN.abstract",functionParameter:[{name:"formula.functionList.OCT2BIN.functionParameter.number.name",detail:"formula.functionList.OCT2BIN.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.OCT2BIN.functionParameter.places.name",detail:"formula.functionList.OCT2BIN.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2DEC.description",abstract:"formula.functionList.OCT2DEC.abstract",functionParameter:[{name:"formula.functionList.OCT2DEC.functionParameter.number.name",detail:"formula.functionList.OCT2DEC.functionParameter.number.detail",example:"54",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2HEX.description",abstract:"formula.functionList.OCT2HEX.abstract",functionParameter:[{name:"formula.functionList.OCT2HEX.functionParameter.number.name",detail:"formula.functionList.OCT2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.OCT2HEX.functionParameter.places.name",detail:"formula.functionList.OCT2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]}],Ke=[{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINT,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINT.description",abstract:"formula.functionList.ACCRINT.abstract",functionParameter:[{name:"formula.functionList.ACCRINT.functionParameter.issue.name",detail:"formula.functionList.ACCRINT.functionParameter.issue.detail",example:"39508",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.firstInterest.name",detail:"formula.functionList.ACCRINT.functionParameter.firstInterest.detail",example:"39691",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.settlement.name",detail:"formula.functionList.ACCRINT.functionParameter.settlement.detail",example:"39569",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.rate.name",detail:"formula.functionList.ACCRINT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.par.name",detail:"formula.functionList.ACCRINT.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.frequency.name",detail:"formula.functionList.ACCRINT.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.basis.name",detail:"formula.functionList.ACCRINT.functionParameter.basis.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.calcMethod.name",detail:"formula.functionList.ACCRINT.functionParameter.calcMethod.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINTM,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINTM.description",abstract:"formula.functionList.ACCRINTM.abstract",functionParameter:[{name:"formula.functionList.ACCRINTM.functionParameter.issue.name",detail:"formula.functionList.ACCRINTM.functionParameter.issue.detail",example:'"2008-4-1"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.settlement.name",detail:"formula.functionList.ACCRINTM.functionParameter.settlement.detail",example:'"2008-6-15"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.rate.name",detail:"formula.functionList.ACCRINTM.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.par.name",detail:"formula.functionList.ACCRINTM.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.basis.name",detail:"formula.functionList.ACCRINTM.functionParameter.basis.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORDEGRC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORDEGRC.description",abstract:"formula.functionList.AMORDEGRC.abstract",functionParameter:[{name:"formula.functionList.AMORDEGRC.functionParameter.number1.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AMORDEGRC.functionParameter.number2.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORLINC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORLINC.description",abstract:"formula.functionList.AMORLINC.abstract",functionParameter:[{name:"formula.functionList.AMORLINC.functionParameter.cost.name",detail:"formula.functionList.AMORLINC.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.datePurchased.name",detail:"formula.functionList.AMORLINC.functionParameter.datePurchased.detail",example:"39679",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.firstPeriod.name",detail:"formula.functionList.AMORLINC.functionParameter.firstPeriod.detail",example:"39813",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.salvage.name",detail:"formula.functionList.AMORLINC.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.period.name",detail:"formula.functionList.AMORLINC.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.rate.name",detail:"formula.functionList.AMORLINC.functionParameter.rate.detail",example:"0.15",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.basis.name",detail:"formula.functionList.AMORLINC.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYBS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYBS.description",abstract:"formula.functionList.COUPDAYBS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYBS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYBS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYBS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYBS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYBS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYS.description",abstract:"formula.functionList.COUPDAYS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYSNC,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYSNC.description",abstract:"formula.functionList.COUPDAYSNC.abstract",functionParameter:[{name:"formula.functionList.COUPDAYSNC.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.basis.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNCD.description",abstract:"formula.functionList.COUPNCD.abstract",functionParameter:[{name:"formula.functionList.COUPNCD.functionParameter.settlement.name",detail:"formula.functionList.COUPNCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.maturity.name",detail:"formula.functionList.COUPNCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.frequency.name",detail:"formula.functionList.COUPNCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.basis.name",detail:"formula.functionList.COUPNCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNUM,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNUM.description",abstract:"formula.functionList.COUPNUM.abstract",functionParameter:[{name:"formula.functionList.COUPNUM.functionParameter.settlement.name",detail:"formula.functionList.COUPNUM.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.maturity.name",detail:"formula.functionList.COUPNUM.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.frequency.name",detail:"formula.functionList.COUPNUM.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.basis.name",detail:"formula.functionList.COUPNUM.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPPCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPPCD.description",abstract:"formula.functionList.COUPPCD.abstract",functionParameter:[{name:"formula.functionList.COUPPCD.functionParameter.settlement.name",detail:"formula.functionList.COUPPCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.maturity.name",detail:"formula.functionList.COUPPCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.frequency.name",detail:"formula.functionList.COUPPCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.basis.name",detail:"formula.functionList.COUPPCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMIPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMIPMT.description",abstract:"formula.functionList.CUMIPMT.abstract",functionParameter:[{name:"formula.functionList.CUMIPMT.functionParameter.rate.name",detail:"formula.functionList.CUMIPMT.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.nper.name",detail:"formula.functionList.CUMIPMT.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.pv.name",detail:"formula.functionList.CUMIPMT.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.startPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.endPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.type.name",detail:"formula.functionList.CUMIPMT.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMPRINC,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMPRINC.description",abstract:"formula.functionList.CUMPRINC.abstract",functionParameter:[{name:"formula.functionList.CUMPRINC.functionParameter.rate.name",detail:"formula.functionList.CUMPRINC.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.nper.name",detail:"formula.functionList.CUMPRINC.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.pv.name",detail:"formula.functionList.CUMPRINC.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.startPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.endPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.type.name",detail:"formula.functionList.CUMPRINC.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DB,functionType:t.FunctionType.Financial,description:"formula.functionList.DB.description",abstract:"formula.functionList.DB.abstract",functionParameter:[{name:"formula.functionList.DB.functionParameter.cost.name",detail:"formula.functionList.DB.functionParameter.cost.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.salvage.name",detail:"formula.functionList.DB.functionParameter.salvage.detail",example:"1000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.life.name",detail:"formula.functionList.DB.functionParameter.life.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.period.name",detail:"formula.functionList.DB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.month.name",detail:"formula.functionList.DB.functionParameter.month.detail",example:"7",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DDB,functionType:t.FunctionType.Financial,description:"formula.functionList.DDB.description",abstract:"formula.functionList.DDB.abstract",functionParameter:[{name:"formula.functionList.DDB.functionParameter.cost.name",detail:"formula.functionList.DDB.functionParameter.cost.detail",example:"24000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.salvage.name",detail:"formula.functionList.DDB.functionParameter.salvage.detail",example:"3000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.life.name",detail:"formula.functionList.DDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.period.name",detail:"formula.functionList.DDB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.factor.name",detail:"formula.functionList.DDB.functionParameter.factor.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DISC,functionType:t.FunctionType.Financial,description:"formula.functionList.DISC.description",abstract:"formula.functionList.DISC.abstract",functionParameter:[{name:"formula.functionList.DISC.functionParameter.settlement.name",detail:"formula.functionList.DISC.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.maturity.name",detail:"formula.functionList.DISC.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.pr.name",detail:"formula.functionList.DISC.functionParameter.pr.detail",example:"97.975",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.redemption.name",detail:"formula.functionList.DISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.basis.name",detail:"formula.functionList.DISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARDE,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARDE.description",abstract:"formula.functionList.DOLLARDE.abstract",functionParameter:[{name:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.name",detail:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.detail",example:"1.02",require:1,repeat:0},{name:"formula.functionList.DOLLARDE.functionParameter.fraction.name",detail:"formula.functionList.DOLLARDE.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARFR,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARFR.description",abstract:"formula.functionList.DOLLARFR.abstract",functionParameter:[{name:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.name",detail:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.detail",example:"1.125",require:1,repeat:0},{name:"formula.functionList.DOLLARFR.functionParameter.fraction.name",detail:"formula.functionList.DOLLARFR.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.DURATION.description",abstract:"formula.functionList.DURATION.abstract",functionParameter:[{name:"formula.functionList.DURATION.functionParameter.settlement.name",detail:"formula.functionList.DURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.maturity.name",detail:"formula.functionList.DURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.coupon.name",detail:"formula.functionList.DURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.yld.name",detail:"formula.functionList.DURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.frequency.name",detail:"formula.functionList.DURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.basis.name",detail:"formula.functionList.DURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.EFFECT,functionType:t.FunctionType.Financial,description:"formula.functionList.EFFECT.description",abstract:"formula.functionList.EFFECT.abstract",functionParameter:[{name:"formula.functionList.EFFECT.functionParameter.nominalRate.name",detail:"formula.functionList.EFFECT.functionParameter.nominalRate.detail",example:"0.0525",require:1,repeat:0},{name:"formula.functionList.EFFECT.functionParameter.npery.name",detail:"formula.functionList.EFFECT.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FV,functionType:t.FunctionType.Financial,description:"formula.functionList.FV.description",abstract:"formula.functionList.FV.abstract",functionParameter:[{name:"formula.functionList.FV.functionParameter.rate.name",detail:"formula.functionList.FV.functionParameter.rate.detail",example:"0.06/12",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.nper.name",detail:"formula.functionList.FV.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pmt.name",detail:"formula.functionList.FV.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pv.name",detail:"formula.functionList.FV.functionParameter.pv.detail",example:"-500",require:0,repeat:0},{name:"formula.functionList.FV.functionParameter.type.name",detail:"formula.functionList.FV.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FVSCHEDULE,functionType:t.FunctionType.Financial,description:"formula.functionList.FVSCHEDULE.description",abstract:"formula.functionList.FVSCHEDULE.abstract",functionParameter:[{name:"formula.functionList.FVSCHEDULE.functionParameter.principal.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.principal.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.FVSCHEDULE.functionParameter.schedule.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.schedule.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.INTRATE,functionType:t.FunctionType.Financial,description:"formula.functionList.INTRATE.description",abstract:"formula.functionList.INTRATE.abstract",functionParameter:[{name:"formula.functionList.INTRATE.functionParameter.settlement.name",detail:"formula.functionList.INTRATE.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.maturity.name",detail:"formula.functionList.INTRATE.functionParameter.maturity.detail",example:'"2008-5-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.investment.name",detail:"formula.functionList.INTRATE.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.redemption.name",detail:"formula.functionList.INTRATE.functionParameter.redemption.detail",example:"10144200",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.basis.name",detail:"formula.functionList.INTRATE.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.IPMT.description",abstract:"formula.functionList.IPMT.abstract",functionParameter:[{name:"formula.functionList.IPMT.functionParameter.rate.name",detail:"formula.functionList.IPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.per.name",detail:"formula.functionList.IPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.nper.name",detail:"formula.functionList.IPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.pv.name",detail:"formula.functionList.IPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.fv.name",detail:"formula.functionList.IPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.IPMT.functionParameter.type.name",detail:"formula.functionList.IPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IRR,functionType:t.FunctionType.Financial,description:"formula.functionList.IRR.description",abstract:"formula.functionList.IRR.abstract",functionParameter:[{name:"formula.functionList.IRR.functionParameter.values.name",detail:"formula.functionList.IRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.IRR.functionParameter.guess.name",detail:"formula.functionList.IRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ISPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.ISPMT.description",abstract:"formula.functionList.ISPMT.abstract",functionParameter:[{name:"formula.functionList.ISPMT.functionParameter.rate.name",detail:"formula.functionList.ISPMT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.per.name",detail:"formula.functionList.ISPMT.functionParameter.per.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.nper.name",detail:"formula.functionList.ISPMT.functionParameter.nper.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.pv.name",detail:"formula.functionList.ISPMT.functionParameter.pv.detail",example:"1000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.MDURATION.description",abstract:"formula.functionList.MDURATION.abstract",functionParameter:[{name:"formula.functionList.MDURATION.functionParameter.settlement.name",detail:"formula.functionList.MDURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.maturity.name",detail:"formula.functionList.MDURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.coupon.name",detail:"formula.functionList.MDURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.yld.name",detail:"formula.functionList.MDURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.frequency.name",detail:"formula.functionList.MDURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.basis.name",detail:"formula.functionList.MDURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.MIRR.description",abstract:"formula.functionList.MIRR.abstract",functionParameter:[{name:"formula.functionList.MIRR.functionParameter.values.name",detail:"formula.functionList.MIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.financeRate.name",detail:"formula.functionList.MIRR.functionParameter.financeRate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.reinvestRate.name",detail:"formula.functionList.MIRR.functionParameter.reinvestRate.detail",example:"0.12",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NOMINAL,functionType:t.FunctionType.Financial,description:"formula.functionList.NOMINAL.description",abstract:"formula.functionList.NOMINAL.abstract",functionParameter:[{name:"formula.functionList.NOMINAL.functionParameter.effectRate.name",detail:"formula.functionList.NOMINAL.functionParameter.effectRate.detail",example:"0.053543",require:1,repeat:0},{name:"formula.functionList.NOMINAL.functionParameter.npery.name",detail:"formula.functionList.NOMINAL.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPER,functionType:t.FunctionType.Financial,description:"formula.functionList.NPER.description",abstract:"formula.functionList.NPER.abstract",functionParameter:[{name:"formula.functionList.NPER.functionParameter.rate.name",detail:"formula.functionList.NPER.functionParameter.rate.detail",example:"0.12/12",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pmt.name",detail:"formula.functionList.NPER.functionParameter.pmt.detail",example:"-100",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pv.name",detail:"formula.functionList.NPER.functionParameter.pv.detail",example:"-1000",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.fv.name",detail:"formula.functionList.NPER.functionParameter.fv.detail",example:"10000",require:0,repeat:0},{name:"formula.functionList.NPER.functionParameter.type.name",detail:"formula.functionList.NPER.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPV,functionType:t.FunctionType.Financial,description:"formula.functionList.NPV.description",abstract:"formula.functionList.NPV.abstract",functionParameter:[{name:"formula.functionList.NPV.functionParameter.rate.name",detail:"formula.functionList.NPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value1.name",detail:"formula.functionList.NPV.functionParameter.value1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value2.name",detail:"formula.functionList.NPV.functionParameter.value2.detail",example:"-9000",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFPRICE.description",abstract:"formula.functionList.ODDFPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDFPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDFPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDFPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.issue.name",detail:"formula.functionList.ODDFPRICE.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDFPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDFPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDFPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDFPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDFPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFYIELD.description",abstract:"formula.functionList.ODDFYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDFYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDFYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDFYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.issue.name",detail:"formula.functionList.ODDFYIELD.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDFYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDFYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDFYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDFYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDFYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLPRICE.description",abstract:"formula.functionList.ODDLPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDLPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDLPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDLPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDLPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDLPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDLPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDLPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDLPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLYIELD.description",abstract:"formula.functionList.ODDLYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDLYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDLYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDLYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDLYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDLYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDLYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDLYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDLYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.PDURATION.description",abstract:"formula.functionList.PDURATION.abstract",functionParameter:[{name:"formula.functionList.PDURATION.functionParameter.rate.name",detail:"formula.functionList.PDURATION.functionParameter.rate.detail",example:"0.025",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.pv.name",detail:"formula.functionList.PDURATION.functionParameter.pv.detail",example:"2000",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.fv.name",detail:"formula.functionList.PDURATION.functionParameter.fv.detail",example:"2200",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PMT.description",abstract:"formula.functionList.PMT.abstract",functionParameter:[{name:"formula.functionList.PMT.functionParameter.rate.name",detail:"formula.functionList.PMT.functionParameter.rate.detail",example:"0.08/12",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.nper.name",detail:"formula.functionList.PMT.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.pv.name",detail:"formula.functionList.PMT.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.fv.name",detail:"formula.functionList.PMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PMT.functionParameter.type.name",detail:"formula.functionList.PMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PPMT.description",abstract:"formula.functionList.PPMT.abstract",functionParameter:[{name:"formula.functionList.PPMT.functionParameter.rate.name",detail:"formula.functionList.PPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.per.name",detail:"formula.functionList.PPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.nper.name",detail:"formula.functionList.PPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.pv.name",detail:"formula.functionList.PPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.fv.name",detail:"formula.functionList.PPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PPMT.functionParameter.type.name",detail:"formula.functionList.PPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICE.description",abstract:"formula.functionList.PRICE.abstract",functionParameter:[{name:"formula.functionList.PRICE.functionParameter.settlement.name",detail:"formula.functionList.PRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.maturity.name",detail:"formula.functionList.PRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.rate.name",detail:"formula.functionList.PRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.yld.name",detail:"formula.functionList.PRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.redemption.name",detail:"formula.functionList.PRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.frequency.name",detail:"formula.functionList.PRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.basis.name",detail:"formula.functionList.PRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEDISC.description",abstract:"formula.functionList.PRICEDISC.abstract",functionParameter:[{name:"formula.functionList.PRICEDISC.functionParameter.settlement.name",detail:"formula.functionList.PRICEDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.maturity.name",detail:"formula.functionList.PRICEDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.discount.name",detail:"formula.functionList.PRICEDISC.functionParameter.discount.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.redemption.name",detail:"formula.functionList.PRICEDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.basis.name",detail:"formula.functionList.PRICEDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEMAT.description",abstract:"formula.functionList.PRICEMAT.abstract",functionParameter:[{name:"formula.functionList.PRICEMAT.functionParameter.settlement.name",detail:"formula.functionList.PRICEMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.maturity.name",detail:"formula.functionList.PRICEMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.issue.name",detail:"formula.functionList.PRICEMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.rate.name",detail:"formula.functionList.PRICEMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.yld.name",detail:"formula.functionList.PRICEMAT.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.basis.name",detail:"formula.functionList.PRICEMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PV,functionType:t.FunctionType.Financial,description:"formula.functionList.PV.description",abstract:"formula.functionList.PV.abstract",functionParameter:[{name:"formula.functionList.PV.functionParameter.rate.name",detail:"formula.functionList.PV.functionParameter.rate.detail",example:"0.02",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.nper.name",detail:"formula.functionList.PV.functionParameter.nper.detail",example:"12",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.pmt.name",detail:"formula.functionList.PV.functionParameter.pmt.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.fv.name",detail:"formula.functionList.PV.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PV.functionParameter.type.name",detail:"formula.functionList.PV.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RATE,functionType:t.FunctionType.Financial,description:"formula.functionList.RATE.description",abstract:"formula.functionList.RATE.abstract",functionParameter:[{name:"formula.functionList.RATE.functionParameter.nper.name",detail:"formula.functionList.RATE.functionParameter.nper.detail",example:"4*12",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pmt.name",detail:"formula.functionList.RATE.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pv.name",detail:"formula.functionList.RATE.functionParameter.pv.detail",example:"8000",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.fv.name",detail:"formula.functionList.RATE.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.type.name",detail:"formula.functionList.RATE.functionParameter.type.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.guess.name",detail:"formula.functionList.RATE.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RECEIVED,functionType:t.FunctionType.Financial,description:"formula.functionList.RECEIVED.description",abstract:"formula.functionList.RECEIVED.abstract",functionParameter:[{name:"formula.functionList.RECEIVED.functionParameter.settlement.name",detail:"formula.functionList.RECEIVED.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.maturity.name",detail:"formula.functionList.RECEIVED.functionParameter.maturity.detail",example:'"2008-3-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.investment.name",detail:"formula.functionList.RECEIVED.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.discount.name",detail:"formula.functionList.RECEIVED.functionParameter.discount.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.basis.name",detail:"formula.functionList.RECEIVED.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RRI,functionType:t.FunctionType.Financial,description:"formula.functionList.RRI.description",abstract:"formula.functionList.RRI.abstract",functionParameter:[{name:"formula.functionList.RRI.functionParameter.nper.name",detail:"formula.functionList.RRI.functionParameter.nper.detail",example:"96",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.pv.name",detail:"formula.functionList.RRI.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.fv.name",detail:"formula.functionList.RRI.functionParameter.fv.detail",example:"11000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SLN,functionType:t.FunctionType.Financial,description:"formula.functionList.SLN.description",abstract:"formula.functionList.SLN.abstract",functionParameter:[{name:"formula.functionList.SLN.functionParameter.cost.name",detail:"formula.functionList.SLN.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.salvage.name",detail:"formula.functionList.SLN.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.life.name",detail:"formula.functionList.SLN.functionParameter.life.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SYD,functionType:t.FunctionType.Financial,description:"formula.functionList.SYD.description",abstract:"formula.functionList.SYD.abstract",functionParameter:[{name:"formula.functionList.SYD.functionParameter.cost.name",detail:"formula.functionList.SYD.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.salvage.name",detail:"formula.functionList.SYD.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.life.name",detail:"formula.functionList.SYD.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.per.name",detail:"formula.functionList.SYD.functionParameter.per.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLEQ,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLEQ.description",abstract:"formula.functionList.TBILLEQ.abstract",functionParameter:[{name:"formula.functionList.TBILLEQ.functionParameter.settlement.name",detail:"formula.functionList.TBILLEQ.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.maturity.name",detail:"formula.functionList.TBILLEQ.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.discount.name",detail:"formula.functionList.TBILLEQ.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLPRICE.description",abstract:"formula.functionList.TBILLPRICE.abstract",functionParameter:[{name:"formula.functionList.TBILLPRICE.functionParameter.settlement.name",detail:"formula.functionList.TBILLPRICE.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.maturity.name",detail:"formula.functionList.TBILLPRICE.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.discount.name",detail:"formula.functionList.TBILLPRICE.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLYIELD.description",abstract:"formula.functionList.TBILLYIELD.abstract",functionParameter:[{name:"formula.functionList.TBILLYIELD.functionParameter.settlement.name",detail:"formula.functionList.TBILLYIELD.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.maturity.name",detail:"formula.functionList.TBILLYIELD.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.pr.name",detail:"formula.functionList.TBILLYIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.VDB,functionType:t.FunctionType.Financial,description:"formula.functionList.VDB.description",abstract:"formula.functionList.VDB.abstract",functionParameter:[{name:"formula.functionList.VDB.functionParameter.cost.name",detail:"formula.functionList.VDB.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.salvage.name",detail:"formula.functionList.VDB.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.life.name",detail:"formula.functionList.VDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.startPeriod.name",detail:"formula.functionList.VDB.functionParameter.startPeriod.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.endPeriod.name",detail:"formula.functionList.VDB.functionParameter.endPeriod.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.factor.name",detail:"formula.functionList.VDB.functionParameter.factor.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.VDB.functionParameter.noSwitch.name",detail:"formula.functionList.VDB.functionParameter.noSwitch.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.XIRR.description",abstract:"formula.functionList.XIRR.abstract",functionParameter:[{name:"formula.functionList.XIRR.functionParameter.values.name",detail:"formula.functionList.XIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.dates.name",detail:"formula.functionList.XIRR.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.guess.name",detail:"formula.functionList.XIRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XNPV,functionType:t.FunctionType.Financial,description:"formula.functionList.XNPV.description",abstract:"formula.functionList.XNPV.abstract",functionParameter:[{name:"formula.functionList.XNPV.functionParameter.rate.name",detail:"formula.functionList.XNPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.values.name",detail:"formula.functionList.XNPV.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.dates.name",detail:"formula.functionList.XNPV.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELD.description",abstract:"formula.functionList.YIELD.abstract",functionParameter:[{name:"formula.functionList.YIELD.functionParameter.settlement.name",detail:"formula.functionList.YIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.maturity.name",detail:"formula.functionList.YIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.rate.name",detail:"formula.functionList.YIELD.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.pr.name",detail:"formula.functionList.YIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.redemption.name",detail:"formula.functionList.YIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.frequency.name",detail:"formula.functionList.YIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.basis.name",detail:"formula.functionList.YIELD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDDISC.description",abstract:"formula.functionList.YIELDDISC.abstract",functionParameter:[{name:"formula.functionList.YIELDDISC.functionParameter.settlement.name",detail:"formula.functionList.YIELDDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.maturity.name",detail:"formula.functionList.YIELDDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.pr.name",detail:"formula.functionList.YIELDDISC.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.redemption.name",detail:"formula.functionList.YIELDDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.basis.name",detail:"formula.functionList.YIELDDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDMAT.description",abstract:"formula.functionList.YIELDMAT.abstract",functionParameter:[{name:"formula.functionList.YIELDMAT.functionParameter.settlement.name",detail:"formula.functionList.YIELDMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.maturity.name",detail:"formula.functionList.YIELDMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.issue.name",detail:"formula.functionList.YIELDMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.rate.name",detail:"formula.functionList.YIELDMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.pr.name",detail:"formula.functionList.YIELDMAT.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.basis.name",detail:"formula.functionList.YIELDMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],ge=[{functionName:t.FUNCTION_NAMES_INFORMATION.CELL,functionType:t.FunctionType.Information,description:"formula.functionList.CELL.description",abstract:"formula.functionList.CELL.abstract",functionParameter:[{name:"formula.functionList.CELL.functionParameter.infoType.name",detail:"formula.functionList.CELL.functionParameter.infoType.detail",example:'"type"',require:1,repeat:0},{name:"formula.functionList.CELL.functionParameter.reference.name",detail:"formula.functionList.CELL.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ERROR_TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.ERROR_TYPE.description",abstract:"formula.functionList.ERROR_TYPE.abstract",functionParameter:[{name:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.name",detail:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.detail",example:'"#NULL!"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.INFO,functionType:t.FunctionType.Information,description:"formula.functionList.INFO.description",abstract:"formula.functionList.INFO.abstract",functionParameter:[{name:"formula.functionList.INFO.functionParameter.number1.name",detail:"formula.functionList.INFO.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INFO.functionParameter.number2.name",detail:"formula.functionList.INFO.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBETWEEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISBETWEEN.description",abstract:"formula.functionList.ISBETWEEN.abstract",functionParameter:[{name:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.name",detail:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.detail",example:"7.9",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.detail",example:"1.2",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValue.detail",example:"12.45",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBLANK,functionType:t.FunctionType.Information,description:"formula.functionList.ISBLANK.description",abstract:"formula.functionList.ISBLANK.abstract",functionParameter:[{name:"formula.functionList.ISBLANK.functionParameter.value.name",detail:"formula.functionList.ISBLANK.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISDATE,functionType:t.FunctionType.Information,description:"formula.functionList.ISDATE.description",abstract:"formula.functionList.ISDATE.abstract",functionParameter:[{name:"formula.functionList.ISDATE.functionParameter.value.name",detail:"formula.functionList.ISDATE.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEMAIL,functionType:t.FunctionType.Information,description:"formula.functionList.ISEMAIL.description",abstract:"formula.functionList.ISEMAIL.abstract",functionParameter:[{name:"formula.functionList.ISEMAIL.functionParameter.value.name",detail:"formula.functionList.ISEMAIL.functionParameter.value.detail",example:'"developer@univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERR.description",abstract:"formula.functionList.ISERR.abstract",functionParameter:[{name:"formula.functionList.ISERR.functionParameter.value.name",detail:"formula.functionList.ISERR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERROR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERROR.description",abstract:"formula.functionList.ISERROR.abstract",functionParameter:[{name:"formula.functionList.ISERROR.functionParameter.value.name",detail:"formula.functionList.ISERROR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEVEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISEVEN.description",abstract:"formula.functionList.ISEVEN.abstract",functionParameter:[{name:"formula.functionList.ISEVEN.functionParameter.value.name",detail:"formula.functionList.ISEVEN.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISFORMULA,functionType:t.FunctionType.Information,description:"formula.functionList.ISFORMULA.description",abstract:"formula.functionList.ISFORMULA.abstract",functionParameter:[{name:"formula.functionList.ISFORMULA.functionParameter.reference.name",detail:"formula.functionList.ISFORMULA.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISLOGICAL,functionType:t.FunctionType.Information,description:"formula.functionList.ISLOGICAL.description",abstract:"formula.functionList.ISLOGICAL.abstract",functionParameter:[{name:"formula.functionList.ISLOGICAL.functionParameter.value.name",detail:"formula.functionList.ISLOGICAL.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNA,functionType:t.FunctionType.Information,description:"formula.functionList.ISNA.description",abstract:"formula.functionList.ISNA.abstract",functionParameter:[{name:"formula.functionList.ISNA.functionParameter.value.name",detail:"formula.functionList.ISNA.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNONTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISNONTEXT.description",abstract:"formula.functionList.ISNONTEXT.abstract",functionParameter:[{name:"formula.functionList.ISNONTEXT.functionParameter.value.name",detail:"formula.functionList.ISNONTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNUMBER,functionType:t.FunctionType.Information,description:"formula.functionList.ISNUMBER.description",abstract:"formula.functionList.ISNUMBER.abstract",functionParameter:[{name:"formula.functionList.ISNUMBER.functionParameter.value.name",detail:"formula.functionList.ISNUMBER.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISODD,functionType:t.FunctionType.Information,description:"formula.functionList.ISODD.description",abstract:"formula.functionList.ISODD.abstract",functionParameter:[{name:"formula.functionList.ISODD.functionParameter.value.name",detail:"formula.functionList.ISODD.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISOMITTED,functionType:t.FunctionType.Information,description:"formula.functionList.ISOMITTED.description",abstract:"formula.functionList.ISOMITTED.abstract",functionParameter:[{name:"formula.functionList.ISOMITTED.functionParameter.number1.name",detail:"formula.functionList.ISOMITTED.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISOMITTED.functionParameter.number2.name",detail:"formula.functionList.ISOMITTED.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISREF,functionType:t.FunctionType.Information,description:"formula.functionList.ISREF.description",abstract:"formula.functionList.ISREF.abstract",functionParameter:[{name:"formula.functionList.ISREF.functionParameter.value.name",detail:"formula.functionList.ISREF.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISTEXT.description",abstract:"formula.functionList.ISTEXT.abstract",functionParameter:[{name:"formula.functionList.ISTEXT.functionParameter.value.name",detail:"formula.functionList.ISTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISURL,functionType:t.FunctionType.Information,description:"formula.functionList.ISURL.description",abstract:"formula.functionList.ISURL.abstract",functionParameter:[{name:"formula.functionList.ISURL.functionParameter.value.name",detail:"formula.functionList.ISURL.functionParameter.value.detail",example:'"univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.N,functionType:t.FunctionType.Information,description:"formula.functionList.N.description",abstract:"formula.functionList.N.abstract",functionParameter:[{name:"formula.functionList.N.functionParameter.value.name",detail:"formula.functionList.N.functionParameter.value.detail",example:"7",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.NA,functionType:t.FunctionType.Information,description:"formula.functionList.NA.description",abstract:"formula.functionList.NA.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEET,functionType:t.FunctionType.Information,description:"formula.functionList.SHEET.description",abstract:"formula.functionList.SHEET.abstract",functionParameter:[{name:"formula.functionList.SHEET.functionParameter.value.name",detail:"formula.functionList.SHEET.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEETS,functionType:t.FunctionType.Information,description:"formula.functionList.SHEETS.description",abstract:"formula.functionList.SHEETS.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.TYPE.description",abstract:"formula.functionList.TYPE.abstract",functionParameter:[{name:"formula.functionList.TYPE.functionParameter.value.name",detail:"formula.functionList.TYPE.functionParameter.value.detail",example:"A2",require:1,repeat:0}]}],Qe=[{functionName:t.FUNCTION_NAMES_LOGICAL.AND,functionType:t.FunctionType.Logical,description:"formula.functionList.AND.description",abstract:"formula.functionList.AND.abstract",functionParameter:[{name:"formula.functionList.AND.functionParameter.logical1.name",detail:"formula.functionList.AND.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.AND.functionParameter.logical2.name",detail:"formula.functionList.AND.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYCOL,functionType:t.FunctionType.Logical,description:"formula.functionList.BYCOL.description",abstract:"formula.functionList.BYCOL.abstract",functionParameter:[{name:"formula.functionList.BYCOL.functionParameter.array.name",detail:"formula.functionList.BYCOL.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYCOL.functionParameter.lambda.name",detail:"formula.functionList.BYCOL.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYROW,functionType:t.FunctionType.Logical,description:"formula.functionList.BYROW.description",abstract:"formula.functionList.BYROW.abstract",functionParameter:[{name:"formula.functionList.BYROW.functionParameter.array.name",detail:"formula.functionList.BYROW.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYROW.functionParameter.lambda.name",detail:"formula.functionList.BYROW.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.FALSE,functionType:t.FunctionType.Logical,description:"formula.functionList.FALSE.description",abstract:"formula.functionList.FALSE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.IF,functionType:t.FunctionType.Logical,description:"formula.functionList.IF.description",abstract:"formula.functionList.IF.abstract",functionParameter:[{name:"formula.functionList.IF.functionParameter.logicalTest.name",detail:"formula.functionList.IF.functionParameter.logicalTest.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfTrue.name",detail:"formula.functionList.IF.functionParameter.valueIfTrue.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfFalse.name",detail:"formula.functionList.IF.functionParameter.valueIfFalse.detail",example:'"A2 is not foo"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFERROR,functionType:t.FunctionType.Logical,description:"formula.functionList.IFERROR.description",abstract:"formula.functionList.IFERROR.abstract",functionParameter:[{name:"formula.functionList.IFERROR.functionParameter.value.name",detail:"formula.functionList.IFERROR.functionParameter.value.detail",example:"A2/B2",require:1,repeat:0},{name:"formula.functionList.IFERROR.functionParameter.valueIfError.name",detail:"formula.functionList.IFERROR.functionParameter.valueIfError.detail",example:"Error in calculation",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFNA,functionType:t.FunctionType.Logical,description:"formula.functionList.IFNA.description",abstract:"formula.functionList.IFNA.abstract",functionParameter:[{name:"formula.functionList.IFNA.functionParameter.value.name",detail:"formula.functionList.IFNA.functionParameter.value.detail",example:"VLOOKUP(C3,C6:D11,2,FALSE)",require:1,repeat:0},{name:"formula.functionList.IFNA.functionParameter.valueIfNa.name",detail:"formula.functionList.IFNA.functionParameter.valueIfNa.detail",example:'"Not Found"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFS,functionType:t.FunctionType.Logical,description:"formula.functionList.IFS.description",abstract:"formula.functionList.IFS.abstract",functionParameter:[{name:"formula.functionList.IFS.functionParameter.logicalTest1.name",detail:"formula.functionList.IFS.functionParameter.logicalTest1.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.valueIfTrue1.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue1.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.logicalTest2.name",detail:"formula.functionList.IFS.functionParameter.logicalTest2.detail",example:"F2=1",require:0,repeat:1},{name:"formula.functionList.IFS.functionParameter.valueIfTrue2.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue2.detail",example:"D2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LAMBDA,functionType:t.FunctionType.Logical,description:"formula.functionList.LAMBDA.description",abstract:"formula.functionList.LAMBDA.abstract",functionParameter:[{name:"formula.functionList.LAMBDA.functionParameter.parameter.name",detail:"formula.functionList.LAMBDA.functionParameter.parameter.detail",example:"[x, y, …,]",require:0,repeat:1},{name:"formula.functionList.LAMBDA.functionParameter.calculation.name",detail:"formula.functionList.LAMBDA.functionParameter.calculation.detail",example:"x+y",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LET,functionType:t.FunctionType.Logical,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.name1.name",detail:"formula.functionList.LET.functionParameter.name1.detail",example:"x",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue1.name",detail:"formula.functionList.LET.functionParameter.nameValue1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.calculationOrName2.name",detail:"formula.functionList.LET.functionParameter.calculationOrName2.detail",example:"y",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue2.name",detail:"formula.functionList.LET.functionParameter.nameValue2.detail",example:"6",require:0,repeat:1},{name:"formula.functionList.LET.functionParameter.calculationOrName3.name",detail:"formula.functionList.LET.functionParameter.calculationOrName3.detail",example:"SUM(x,y)",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAKEARRAY,aliasFunctionName:"formula.functionList.MAKEARRAY.aliasFunctionName",functionType:t.FunctionType.Logical,description:"formula.functionList.MAKEARRAY.description",abstract:"formula.functionList.MAKEARRAY.abstract",functionParameter:[{name:"formula.functionList.MAKEARRAY.functionParameter.number1.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number1.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.number2.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number2.detail",example:"7",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.value3.name",detail:"formula.functionList.MAKEARRAY.functionParameter.value3.detail",example:"LAMBDA(r,c, r*c)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAP,functionType:t.FunctionType.Logical,description:"formula.functionList.MAP.description",abstract:"formula.functionList.MAP.abstract",functionParameter:[{name:"formula.functionList.MAP.functionParameter.array1.name",detail:"formula.functionList.MAP.functionParameter.array1.detail",example:"D2:D11",require:1,repeat:0},{name:"formula.functionList.MAP.functionParameter.array2.name",detail:"formula.functionList.MAP.functionParameter.array2.detail",example:"E2:E11",require:0,repeat:1},{name:"formula.functionList.MAP.functionParameter.lambda.name",detail:"formula.functionList.MAP.functionParameter.lambda.detail",example:'LAMBDA(s,c,AND(s="Large",c="Red"))',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.NOT,functionType:t.FunctionType.Logical,description:"formula.functionList.NOT.description",abstract:"formula.functionList.NOT.abstract",functionParameter:[{name:"formula.functionList.NOT.functionParameter.logical.name",detail:"formula.functionList.NOT.functionParameter.logical.detail",example:"A2>100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.OR,functionType:t.FunctionType.Logical,description:"formula.functionList.OR.description",abstract:"formula.functionList.OR.abstract",functionParameter:[{name:"formula.functionList.OR.functionParameter.logical1.name",detail:"formula.functionList.OR.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.OR.functionParameter.logical2.name",detail:"formula.functionList.OR.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.REDUCE,functionType:t.FunctionType.Logical,description:"formula.functionList.REDUCE.description",abstract:"formula.functionList.REDUCE.abstract",functionParameter:[{name:"formula.functionList.REDUCE.functionParameter.initialValue.name",detail:"formula.functionList.REDUCE.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.array.name",detail:"formula.functionList.REDUCE.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.lambda.name",detail:"formula.functionList.REDUCE.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SCAN,functionType:t.FunctionType.Logical,description:"formula.functionList.SCAN.description",abstract:"formula.functionList.SCAN.abstract",functionParameter:[{name:"formula.functionList.SCAN.functionParameter.initialValue.name",detail:"formula.functionList.SCAN.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.array.name",detail:"formula.functionList.SCAN.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.lambda.name",detail:"formula.functionList.SCAN.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SWITCH,functionType:t.FunctionType.Logical,description:"formula.functionList.SWITCH.description",abstract:"formula.functionList.SWITCH.abstract",functionParameter:[{name:"formula.functionList.SWITCH.functionParameter.expression.name",detail:"formula.functionList.SWITCH.functionParameter.expression.detail",example:"WEEKDAY(A2)",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.value1.name",detail:"formula.functionList.SWITCH.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.result1.name",detail:"formula.functionList.SWITCH.functionParameter.result1.detail",example:'"Sunday"',require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.name",detail:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.detail",example:"2",require:0,repeat:1},{name:"formula.functionList.SWITCH.functionParameter.result2.name",detail:"formula.functionList.SWITCH.functionParameter.result2.detail",example:'"Monday"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.TRUE,functionType:t.FunctionType.Logical,description:"formula.functionList.TRUE.description",abstract:"formula.functionList.TRUE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.XOR,functionType:t.FunctionType.Logical,description:"formula.functionList.XOR.description",abstract:"formula.functionList.XOR.abstract",functionParameter:[{name:"formula.functionList.XOR.functionParameter.logical1.name",detail:"formula.functionList.XOR.functionParameter.logical1.detail",example:"3>0",require:1,repeat:0},{name:"formula.functionList.XOR.functionParameter.logical2.name",detail:"formula.functionList.XOR.functionParameter.logical2.detail",example:"2<9",require:0,repeat:1}]}],je=[{functionName:t.FUNCTION_NAMES_LOOKUP.ADDRESS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ADDRESS.description",abstract:"formula.functionList.ADDRESS.abstract",functionParameter:[{name:"formula.functionList.ADDRESS.functionParameter.row_num.name",detail:"formula.functionList.ADDRESS.functionParameter.row_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.column_num.name",detail:"formula.functionList.ADDRESS.functionParameter.column_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.abs_num.name",detail:"formula.functionList.ADDRESS.functionParameter.abs_num.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.a1.name",detail:"formula.functionList.ADDRESS.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.sheet_text.name",detail:"formula.functionList.ADDRESS.functionParameter.sheet_text.detail",example:'"Sheet2"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.AREAS,functionType:t.FunctionType.Lookup,description:"formula.functionList.AREAS.description",abstract:"formula.functionList.AREAS.abstract",functionParameter:[{name:"formula.functionList.AREAS.functionParameter.reference.name",detail:"formula.functionList.AREAS.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSE.description",abstract:"formula.functionList.CHOOSE.abstract",functionParameter:[{name:"formula.functionList.CHOOSE.functionParameter.indexNum.name",detail:"formula.functionList.CHOOSE.functionParameter.indexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value1.name",detail:"formula.functionList.CHOOSE.functionParameter.value1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value2.name",detail:"formula.functionList.CHOOSE.functionParameter.value2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSECOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSECOLS.description",abstract:"formula.functionList.CHOOSECOLS.abstract",functionParameter:[{name:"formula.functionList.CHOOSECOLS.functionParameter.array.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSEROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSEROWS.description",abstract:"formula.functionList.CHOOSEROWS.abstract",functionParameter:[{name:"formula.functionList.CHOOSEROWS.functionParameter.array.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMN,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMN.description",abstract:"formula.functionList.COLUMN.abstract",functionParameter:[{name:"formula.functionList.COLUMN.functionParameter.reference.name",detail:"formula.functionList.COLUMN.functionParameter.reference.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMNS,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMNS.description",abstract:"formula.functionList.COLUMNS.abstract",functionParameter:[{name:"formula.functionList.COLUMNS.functionParameter.array.name",detail:"formula.functionList.COLUMNS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.DROP,functionType:t.FunctionType.Lookup,description:"formula.functionList.DROP.description",abstract:"formula.functionList.DROP.abstract",functionParameter:[{name:"formula.functionList.DROP.functionParameter.array.name",detail:"formula.functionList.DROP.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.rows.name",detail:"formula.functionList.DROP.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.columns.name",detail:"formula.functionList.DROP.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.EXPAND,functionType:t.FunctionType.Lookup,description:"formula.functionList.EXPAND.description",abstract:"formula.functionList.EXPAND.abstract",functionParameter:[{name:"formula.functionList.EXPAND.functionParameter.array.name",detail:"formula.functionList.EXPAND.functionParameter.array.detail",example:"A2",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.rows.name",detail:"formula.functionList.EXPAND.functionParameter.rows.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.columns.name",detail:"formula.functionList.EXPAND.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.padWith.name",detail:"formula.functionList.EXPAND.functionParameter.padWith.detail",example:'"-"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FILTER,functionType:t.FunctionType.Lookup,description:"formula.functionList.FILTER.description",abstract:"formula.functionList.FILTER.abstract",functionParameter:[{name:"formula.functionList.FILTER.functionParameter.array.name",detail:"formula.functionList.FILTER.functionParameter.array.detail",example:"A5:D20",require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.include.name",detail:"formula.functionList.FILTER.functionParameter.include.detail",example:'(C5:C20="Apple")*(A5:A20="East")',require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.ifEmpty.name",detail:"formula.functionList.FILTER.functionParameter.ifEmpty.detail",example:'""',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FORMULATEXT,functionType:t.FunctionType.Lookup,description:"formula.functionList.FORMULATEXT.description",abstract:"formula.functionList.FORMULATEXT.abstract",functionParameter:[{name:"formula.functionList.FORMULATEXT.functionParameter.reference.name",detail:"formula.functionList.FORMULATEXT.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.GETPIVOTDATA,functionType:t.FunctionType.Lookup,description:"formula.functionList.GETPIVOTDATA.description",abstract:"formula.functionList.GETPIVOTDATA.abstract",functionParameter:[{name:"formula.functionList.GETPIVOTDATA.functionParameter.number1.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.GETPIVOTDATA.functionParameter.number2.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.HLOOKUP.description",abstract:"formula.functionList.HLOOKUP.abstract",functionParameter:[{name:"formula.functionList.HLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.HLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.HLOOKUP.functionParameter.tableArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.name",detail:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HSTACK.description",abstract:"formula.functionList.HSTACK.abstract",functionParameter:[{name:"formula.functionList.HSTACK.functionParameter.array1.name",detail:"formula.functionList.HSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.HSTACK.functionParameter.array2.name",detail:"formula.functionList.HSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HYPERLINK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HYPERLINK.description",abstract:"formula.functionList.HYPERLINK.abstract",functionParameter:[{name:"formula.functionList.HYPERLINK.functionParameter.number1.name",detail:"formula.functionList.HYPERLINK.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HYPERLINK.functionParameter.number2.name",detail:"formula.functionList.HYPERLINK.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.IMAGE,functionType:t.FunctionType.Lookup,description:"formula.functionList.IMAGE.description",abstract:"formula.functionList.IMAGE.abstract",functionParameter:[{name:"formula.functionList.IMAGE.functionParameter.number1.name",detail:"formula.functionList.IMAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.IMAGE.functionParameter.number2.name",detail:"formula.functionList.IMAGE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDEX,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDEX.description",abstract:"formula.functionList.INDEX.abstract",functionParameter:[{name:"formula.functionList.INDEX.functionParameter.reference.name",detail:"formula.functionList.INDEX.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INDEX.functionParameter.rowNum.name",detail:"formula.functionList.INDEX.functionParameter.rowNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.columnNum.name",detail:"formula.functionList.INDEX.functionParameter.columnNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.areaNum.name",detail:"formula.functionList.INDEX.functionParameter.areaNum.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDIRECT,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDIRECT.description",abstract:"formula.functionList.INDIRECT.abstract",functionParameter:[{name:"formula.functionList.INDIRECT.functionParameter.refText.name",detail:"formula.functionList.INDIRECT.functionParameter.refText.detail",example:'"A1"',require:1,repeat:0},{name:"formula.functionList.INDIRECT.functionParameter.a1.name",detail:"formula.functionList.INDIRECT.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.LOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.LOOKUP.description",abstract:"formula.functionList.LOOKUP.abstract",functionParameter:[{name:"formula.functionList.LOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.resultVector.name",detail:"formula.functionList.LOOKUP.functionParameter.resultVector.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.MATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.MATCH.description",abstract:"formula.functionList.MATCH.abstract",functionParameter:[{name:"formula.functionList.MATCH.functionParameter.lookupValue.name",detail:"formula.functionList.MATCH.functionParameter.lookupValue.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.lookupArray.name",detail:"formula.functionList.MATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.matchType.name",detail:"formula.functionList.MATCH.functionParameter.matchType.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.OFFSET,functionType:t.FunctionType.Lookup,description:"formula.functionList.OFFSET.description",abstract:"formula.functionList.OFFSET.abstract",functionParameter:[{name:"formula.functionList.OFFSET.functionParameter.reference.name",detail:"formula.functionList.OFFSET.functionParameter.reference.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.rows.name",detail:"formula.functionList.OFFSET.functionParameter.rows.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.cols.name",detail:"formula.functionList.OFFSET.functionParameter.cols.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.height.name",detail:"formula.functionList.OFFSET.functionParameter.height.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.width.name",detail:"formula.functionList.OFFSET.functionParameter.width.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROW.description",abstract:"formula.functionList.ROW.abstract",functionParameter:[{name:"formula.functionList.ROW.functionParameter.reference.name",detail:"formula.functionList.ROW.functionParameter.reference.detail",example:"A1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROWS.description",abstract:"formula.functionList.ROWS.abstract",functionParameter:[{name:"formula.functionList.ROWS.functionParameter.array.name",detail:"formula.functionList.ROWS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.RTD,functionType:t.FunctionType.Lookup,description:"formula.functionList.RTD.description",abstract:"formula.functionList.RTD.abstract",functionParameter:[{name:"formula.functionList.RTD.functionParameter.number1.name",detail:"formula.functionList.RTD.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.RTD.functionParameter.number2.name",detail:"formula.functionList.RTD.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORT,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORT.description",abstract:"formula.functionList.SORT.abstract",functionParameter:[{name:"formula.functionList.SORT.functionParameter.array.name",detail:"formula.functionList.SORT.functionParameter.array.detail",example:"A2:A17",require:1,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortIndex.name",detail:"formula.functionList.SORT.functionParameter.sortIndex.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortOrder.name",detail:"formula.functionList.SORT.functionParameter.sortOrder.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.byCol.name",detail:"formula.functionList.SORT.functionParameter.byCol.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORTBY,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORTBY.description",abstract:"formula.functionList.SORTBY.abstract",functionParameter:[{name:"formula.functionList.SORTBY.functionParameter.array.name",detail:"formula.functionList.SORTBY.functionParameter.array.detail",example:"D2:D9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray1.name",detail:"formula.functionList.SORTBY.functionParameter.byArray1.detail",example:"E2:E9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.sortOrder1.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray2.name",detail:"formula.functionList.SORTBY.functionParameter.byArray2.detail",example:"E2:E9",require:0,repeat:1},{name:"formula.functionList.SORTBY.functionParameter.sortOrder2.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder2.detail",example:"1",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TAKE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TAKE.description",abstract:"formula.functionList.TAKE.abstract",functionParameter:[{name:"formula.functionList.TAKE.functionParameter.array.name",detail:"formula.functionList.TAKE.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.rows.name",detail:"formula.functionList.TAKE.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.columns.name",detail:"formula.functionList.TAKE.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOCOL,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOCOL.description",abstract:"formula.functionList.TOCOL.abstract",functionParameter:[{name:"formula.functionList.TOCOL.functionParameter.array.name",detail:"formula.functionList.TOCOL.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.ignore.name",detail:"formula.functionList.TOCOL.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.scanByColumn.name",detail:"formula.functionList.TOCOL.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOROW.description",abstract:"formula.functionList.TOROW.abstract",functionParameter:[{name:"formula.functionList.TOROW.functionParameter.array.name",detail:"formula.functionList.TOROW.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOROW.functionParameter.ignore.name",detail:"formula.functionList.TOROW.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOROW.functionParameter.scanByColumn.name",detail:"formula.functionList.TOROW.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TRANSPOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TRANSPOSE.description",abstract:"formula.functionList.TRANSPOSE.abstract",functionParameter:[{name:"formula.functionList.TRANSPOSE.functionParameter.array.name",detail:"formula.functionList.TRANSPOSE.functionParameter.array.detail",example:"A2:F9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.UNIQUE,functionType:t.FunctionType.Lookup,description:"formula.functionList.UNIQUE.description",abstract:"formula.functionList.UNIQUE.abstract",functionParameter:[{name:"formula.functionList.UNIQUE.functionParameter.array.name",detail:"formula.functionList.UNIQUE.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.byCol.name",detail:"formula.functionList.UNIQUE.functionParameter.byCol.detail",example:"false",require:0,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.name",detail:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.VLOOKUP.description",abstract:"formula.functionList.VLOOKUP.abstract",functionParameter:[{name:"formula.functionList.VLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.VLOOKUP.functionParameter.lookupValue.detail",example:"B2",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.VLOOKUP.functionParameter.tableArray.detail",example:"C2:E7",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.name",detail:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.VSTACK.description",abstract:"formula.functionList.VSTACK.abstract",functionParameter:[{name:"formula.functionList.VSTACK.functionParameter.array1.name",detail:"formula.functionList.VSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.VSTACK.functionParameter.array2.name",detail:"formula.functionList.VSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPCOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPCOLS.description",abstract:"formula.functionList.WRAPCOLS.abstract",functionParameter:[{name:"formula.functionList.WRAPCOLS.functionParameter.vector.name",detail:"formula.functionList.WRAPCOLS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.padWith.name",detail:"formula.functionList.WRAPCOLS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPROWS.description",abstract:"formula.functionList.WRAPROWS.abstract",functionParameter:[{name:"formula.functionList.WRAPROWS.functionParameter.vector.name",detail:"formula.functionList.WRAPROWS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPROWS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.padWith.name",detail:"formula.functionList.WRAPROWS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.XLOOKUP.description",abstract:"formula.functionList.XLOOKUP.abstract",functionParameter:[{name:"formula.functionList.XLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.lookupArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.returnArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.returnArray.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.name",detail:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.detail",example:"default",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.matchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.searchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XMATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.XMATCH.description",abstract:"formula.functionList.XMATCH.abstract",functionParameter:[{name:"formula.functionList.XMATCH.functionParameter.lookupValue.name",detail:"formula.functionList.XMATCH.functionParameter.lookupValue.detail",example:"B1",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.lookupArray.name",detail:"formula.functionList.XMATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.matchMode.name",detail:"formula.functionList.XMATCH.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.searchMode.name",detail:"formula.functionList.XMATCH.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]}],ke=[{functionName:t.FUNCTION_NAMES_MATH.ABS,functionType:t.FunctionType.Math,description:"formula.functionList.ABS.description",abstract:"formula.functionList.ABS.abstract",functionParameter:[{name:"formula.functionList.ABS.functionParameter.number.name",detail:"formula.functionList.ABS.functionParameter.number.detail",example:"-2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOS,functionType:t.FunctionType.Math,description:"formula.functionList.ACOS.description",abstract:"formula.functionList.ACOS.abstract",functionParameter:[{name:"formula.functionList.ACOS.functionParameter.number.name",detail:"formula.functionList.ACOS.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOSH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOSH.description",abstract:"formula.functionList.ACOSH.abstract",functionParameter:[{name:"formula.functionList.ACOSH.functionParameter.number.name",detail:"formula.functionList.ACOSH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOT,functionType:t.FunctionType.Math,description:"formula.functionList.ACOT.description",abstract:"formula.functionList.ACOT.abstract",functionParameter:[{name:"formula.functionList.ACOT.functionParameter.number.name",detail:"formula.functionList.ACOT.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOTH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOTH.description",abstract:"formula.functionList.ACOTH.abstract",functionParameter:[{name:"formula.functionList.ACOTH.functionParameter.number.name",detail:"formula.functionList.ACOTH.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.AGGREGATE,functionType:t.FunctionType.Math,description:"formula.functionList.AGGREGATE.description",abstract:"formula.functionList.AGGREGATE.abstract",functionParameter:[{name:"formula.functionList.AGGREGATE.functionParameter.number1.name",detail:"formula.functionList.AGGREGATE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AGGREGATE.functionParameter.number2.name",detail:"formula.functionList.AGGREGATE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ARABIC,functionType:t.FunctionType.Math,description:"formula.functionList.ARABIC.description",abstract:"formula.functionList.ARABIC.abstract",functionParameter:[{name:"formula.functionList.ARABIC.functionParameter.text.name",detail:"formula.functionList.ARABIC.functionParameter.text.detail",example:'"LVII"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASIN,functionType:t.FunctionType.Math,description:"formula.functionList.ASIN.description",abstract:"formula.functionList.ASIN.abstract",functionParameter:[{name:"formula.functionList.ASIN.functionParameter.number.name",detail:"formula.functionList.ASIN.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASINH,functionType:t.FunctionType.Math,description:"formula.functionList.ASINH.description",abstract:"formula.functionList.ASINH.abstract",functionParameter:[{name:"formula.functionList.ASINH.functionParameter.number.name",detail:"formula.functionList.ASINH.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN.description",abstract:"formula.functionList.ATAN.abstract",functionParameter:[{name:"formula.functionList.ATAN.functionParameter.number.name",detail:"formula.functionList.ATAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN2,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN2.description",abstract:"formula.functionList.ATAN2.abstract",functionParameter:[{name:"formula.functionList.ATAN2.functionParameter.xNum.name",detail:"formula.functionList.ATAN2.functionParameter.xNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ATAN2.functionParameter.yNum.name",detail:"formula.functionList.ATAN2.functionParameter.yNum.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATANH,functionType:t.FunctionType.Math,description:"formula.functionList.ATANH.description",abstract:"formula.functionList.ATANH.abstract",functionParameter:[{name:"formula.functionList.ATANH.functionParameter.number.name",detail:"formula.functionList.ATANH.functionParameter.number.detail",example:"0.1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.BASE,functionType:t.FunctionType.Math,description:"formula.functionList.BASE.description",abstract:"formula.functionList.BASE.abstract",functionParameter:[{name:"formula.functionList.BASE.functionParameter.number.name",detail:"formula.functionList.BASE.functionParameter.number.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.radix.name",detail:"formula.functionList.BASE.functionParameter.radix.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.minLength.name",detail:"formula.functionList.BASE.functionParameter.minLength.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING.description",abstract:"formula.functionList.CEILING.abstract",functionParameter:[{name:"formula.functionList.CEILING.functionParameter.number.name",detail:"formula.functionList.CEILING.functionParameter.number.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CEILING.functionParameter.significance.name",detail:"formula.functionList.CEILING.functionParameter.significance.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_MATH.description",abstract:"formula.functionList.CEILING_MATH.abstract",functionParameter:[{name:"formula.functionList.CEILING_MATH.functionParameter.number.name",detail:"formula.functionList.CEILING_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.significance.name",detail:"formula.functionList.CEILING_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.mode.name",detail:"formula.functionList.CEILING_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_PRECISE.description",abstract:"formula.functionList.CEILING_PRECISE.abstract",functionParameter:[{name:"formula.functionList.CEILING_PRECISE.functionParameter.number.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.number.detail",example:"4.3",require:1,repeat:0},{name:"formula.functionList.CEILING_PRECISE.functionParameter.significance.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.significance.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBIN,functionType:t.FunctionType.Math,description:"formula.functionList.COMBIN.description",abstract:"formula.functionList.COMBIN.abstract",functionParameter:[{name:"formula.functionList.COMBIN.functionParameter.number.name",detail:"formula.functionList.COMBIN.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBIN.functionParameter.numberChosen.name",detail:"formula.functionList.COMBIN.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBINA,functionType:t.FunctionType.Math,description:"formula.functionList.COMBINA.description",abstract:"formula.functionList.COMBINA.abstract",functionParameter:[{name:"formula.functionList.COMBINA.functionParameter.number.name",detail:"formula.functionList.COMBINA.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBINA.functionParameter.numberChosen.name",detail:"formula.functionList.COMBINA.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COS,functionType:t.FunctionType.Math,description:"formula.functionList.COS.description",abstract:"formula.functionList.COS.abstract",functionParameter:[{name:"formula.functionList.COS.functionParameter.number.name",detail:"formula.functionList.COS.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COSH,functionType:t.FunctionType.Math,description:"formula.functionList.COSH.description",abstract:"formula.functionList.COSH.abstract",functionParameter:[{name:"formula.functionList.COSH.functionParameter.number.name",detail:"formula.functionList.COSH.functionParameter.number.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COT,functionType:t.FunctionType.Math,description:"formula.functionList.COT.description",abstract:"formula.functionList.COT.abstract",functionParameter:[{name:"formula.functionList.COT.functionParameter.number.name",detail:"formula.functionList.COT.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COTH,functionType:t.FunctionType.Math,description:"formula.functionList.COTH.description",abstract:"formula.functionList.COTH.abstract",functionParameter:[{name:"formula.functionList.COTH.functionParameter.number.name",detail:"formula.functionList.COTH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSC,functionType:t.FunctionType.Math,description:"formula.functionList.CSC.description",abstract:"formula.functionList.CSC.abstract",functionParameter:[{name:"formula.functionList.CSC.functionParameter.number.name",detail:"formula.functionList.CSC.functionParameter.number.detail",example:"15",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSCH,functionType:t.FunctionType.Math,description:"formula.functionList.CSCH.description",abstract:"formula.functionList.CSCH.abstract",functionParameter:[{name:"formula.functionList.CSCH.functionParameter.number.name",detail:"formula.functionList.CSCH.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DECIMAL,functionType:t.FunctionType.Math,description:"formula.functionList.DECIMAL.description",abstract:"formula.functionList.DECIMAL.abstract",functionParameter:[{name:"formula.functionList.DECIMAL.functionParameter.text.name",detail:"formula.functionList.DECIMAL.functionParameter.text.detail",example:'"FF"',require:1,repeat:0},{name:"formula.functionList.DECIMAL.functionParameter.radix.name",detail:"formula.functionList.DECIMAL.functionParameter.radix.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DEGREES,functionType:t.FunctionType.Math,description:"formula.functionList.DEGREES.description",abstract:"formula.functionList.DEGREES.abstract",functionParameter:[{name:"formula.functionList.DEGREES.functionParameter.angle.name",detail:"formula.functionList.DEGREES.functionParameter.angle.detail",example:"PI()",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EVEN,functionType:t.FunctionType.Math,description:"formula.functionList.EVEN.description",abstract:"formula.functionList.EVEN.abstract",functionParameter:[{name:"formula.functionList.EVEN.functionParameter.number.name",detail:"formula.functionList.EVEN.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EXP,functionType:t.FunctionType.Math,description:"formula.functionList.EXP.description",abstract:"formula.functionList.EXP.abstract",functionParameter:[{name:"formula.functionList.EXP.functionParameter.number.name",detail:"formula.functionList.EXP.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACT,functionType:t.FunctionType.Math,description:"formula.functionList.FACT.description",abstract:"formula.functionList.FACT.abstract",functionParameter:[{name:"formula.functionList.FACT.functionParameter.number.name",detail:"formula.functionList.FACT.functionParameter.number.detail",example:"5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACTDOUBLE,functionType:t.FunctionType.Math,description:"formula.functionList.FACTDOUBLE.description",abstract:"formula.functionList.FACTDOUBLE.abstract",functionParameter:[{name:"formula.functionList.FACTDOUBLE.functionParameter.number.name",detail:"formula.functionList.FACTDOUBLE.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR.description",abstract:"formula.functionList.FLOOR.abstract",functionParameter:[{name:"formula.functionList.FLOOR.functionParameter.number.name",detail:"formula.functionList.FLOOR.functionParameter.number.detail",example:"3.7",require:1,repeat:0},{name:"formula.functionList.FLOOR.functionParameter.significance.name",detail:"formula.functionList.FLOOR.functionParameter.significance.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_MATH.description",abstract:"formula.functionList.FLOOR_MATH.abstract",functionParameter:[{name:"formula.functionList.FLOOR_MATH.functionParameter.number.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.significance.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.mode.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_PRECISE.description",abstract:"formula.functionList.FLOOR_PRECISE.abstract",functionParameter:[{name:"formula.functionList.FLOOR_PRECISE.functionParameter.number.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.number.detail",example:"-3.2",require:1,repeat:0},{name:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.GCD,functionType:t.FunctionType.Math,description:"formula.functionList.GCD.description",abstract:"formula.functionList.GCD.abstract",functionParameter:[{name:"formula.functionList.GCD.functionParameter.number1.name",detail:"formula.functionList.GCD.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GCD.functionParameter.number2.name",detail:"formula.functionList.GCD.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.INT,functionType:t.FunctionType.Math,description:"formula.functionList.INT.description",abstract:"formula.functionList.INT.abstract",functionParameter:[{name:"formula.functionList.INT.functionParameter.number.name",detail:"formula.functionList.INT.functionParameter.number.detail",example:"8.9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ISO_CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.ISO_CEILING.description",abstract:"formula.functionList.ISO_CEILING.abstract",functionParameter:[{name:"formula.functionList.ISO_CEILING.functionParameter.number1.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISO_CEILING.functionParameter.number2.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LCM,functionType:t.FunctionType.Math,description:"formula.functionList.LCM.description",abstract:"formula.functionList.LCM.abstract",functionParameter:[{name:"formula.functionList.LCM.functionParameter.number1.name",detail:"formula.functionList.LCM.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LCM.functionParameter.number2.name",detail:"formula.functionList.LCM.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.LET,functionType:t.FunctionType.Math,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.number1.name",detail:"formula.functionList.LET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.number2.name",detail:"formula.functionList.LET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LN,functionType:t.FunctionType.Math,description:"formula.functionList.LN.description",abstract:"formula.functionList.LN.abstract",functionParameter:[{name:"formula.functionList.LN.functionParameter.number.name",detail:"formula.functionList.LN.functionParameter.number.detail",example:"EXP(3)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG,functionType:t.FunctionType.Math,description:"formula.functionList.LOG.description",abstract:"formula.functionList.LOG.abstract",functionParameter:[{name:"formula.functionList.LOG.functionParameter.number.name",detail:"formula.functionList.LOG.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.LOG.functionParameter.base.name",detail:"formula.functionList.LOG.functionParameter.base.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG10,functionType:t.FunctionType.Math,description:"formula.functionList.LOG10.description",abstract:"formula.functionList.LOG10.abstract",functionParameter:[{name:"formula.functionList.LOG10.functionParameter.number.name",detail:"formula.functionList.LOG10.functionParameter.number.detail",example:"100000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MDETERM,functionType:t.FunctionType.Math,description:"formula.functionList.MDETERM.description",abstract:"formula.functionList.MDETERM.abstract",functionParameter:[{name:"formula.functionList.MDETERM.functionParameter.array.name",detail:"formula.functionList.MDETERM.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MINVERSE,functionType:t.FunctionType.Math,description:"formula.functionList.MINVERSE.description",abstract:"formula.functionList.MINVERSE.abstract",functionParameter:[{name:"formula.functionList.MINVERSE.functionParameter.array.name",detail:"formula.functionList.MINVERSE.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MMULT,functionType:t.FunctionType.Math,description:"formula.functionList.MMULT.description",abstract:"formula.functionList.MMULT.abstract",functionParameter:[{name:"formula.functionList.MMULT.functionParameter.array1.name",detail:"formula.functionList.MMULT.functionParameter.array1.detail",example:"A2:B3",require:1,repeat:0},{name:"formula.functionList.MMULT.functionParameter.array2.name",detail:"formula.functionList.MMULT.functionParameter.array2.detail",example:"A5:B6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MOD,functionType:t.FunctionType.Math,description:"formula.functionList.MOD.description",abstract:"formula.functionList.MOD.abstract",functionParameter:[{name:"formula.functionList.MOD.functionParameter.number.name",detail:"formula.functionList.MOD.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.MOD.functionParameter.divisor.name",detail:"formula.functionList.MOD.functionParameter.divisor.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MROUND,functionType:t.FunctionType.Math,description:"formula.functionList.MROUND.description",abstract:"formula.functionList.MROUND.abstract",functionParameter:[{name:"formula.functionList.MROUND.functionParameter.number.name",detail:"formula.functionList.MROUND.functionParameter.number.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MROUND.functionParameter.multiple.name",detail:"formula.functionList.MROUND.functionParameter.multiple.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MULTINOMIAL,functionType:t.FunctionType.Math,description:"formula.functionList.MULTINOMIAL.description",abstract:"formula.functionList.MULTINOMIAL.abstract",functionParameter:[{name:"formula.functionList.MULTINOMIAL.functionParameter.number1.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.MULTINOMIAL.functionParameter.number2.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.MUNIT,functionType:t.FunctionType.Math,description:"formula.functionList.MUNIT.description",abstract:"formula.functionList.MUNIT.abstract",functionParameter:[{name:"formula.functionList.MUNIT.functionParameter.dimension.name",detail:"formula.functionList.MUNIT.functionParameter.dimension.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ODD,functionType:t.FunctionType.Math,description:"formula.functionList.ODD.description",abstract:"formula.functionList.ODD.abstract",functionParameter:[{name:"formula.functionList.ODD.functionParameter.number.name",detail:"formula.functionList.ODD.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PI,functionType:t.FunctionType.Math,description:"formula.functionList.PI.description",abstract:"formula.functionList.PI.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.POWER,functionType:t.FunctionType.Math,description:"formula.functionList.POWER.description",abstract:"formula.functionList.POWER.abstract",functionParameter:[{name:"formula.functionList.POWER.functionParameter.number.name",detail:"formula.functionList.POWER.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POWER.functionParameter.power.name",detail:"formula.functionList.POWER.functionParameter.power.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.PRODUCT.description",abstract:"formula.functionList.PRODUCT.abstract",functionParameter:[{name:"formula.functionList.PRODUCT.functionParameter.number1.name",detail:"formula.functionList.PRODUCT.functionParameter.number1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.PRODUCT.functionParameter.number2.name",detail:"formula.functionList.PRODUCT.functionParameter.number2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.QUOTIENT,functionType:t.FunctionType.Math,description:"formula.functionList.QUOTIENT.description",abstract:"formula.functionList.QUOTIENT.abstract",functionParameter:[{name:"formula.functionList.QUOTIENT.functionParameter.numerator.name",detail:"formula.functionList.QUOTIENT.functionParameter.numerator.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.QUOTIENT.functionParameter.denominator.name",detail:"formula.functionList.QUOTIENT.functionParameter.denominator.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RADIANS,functionType:t.FunctionType.Math,description:"formula.functionList.RADIANS.description",abstract:"formula.functionList.RADIANS.abstract",functionParameter:[{name:"formula.functionList.RADIANS.functionParameter.angle.name",detail:"formula.functionList.RADIANS.functionParameter.angle.detail",example:"270",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RAND,functionType:t.FunctionType.Math,description:"formula.functionList.RAND.description",abstract:"formula.functionList.RAND.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.RANDARRAY,functionType:t.FunctionType.Math,description:"formula.functionList.RANDARRAY.description",abstract:"formula.functionList.RANDARRAY.abstract",functionParameter:[{name:"formula.functionList.RANDARRAY.functionParameter.rows.name",detail:"formula.functionList.RANDARRAY.functionParameter.rows.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.columns.name",detail:"formula.functionList.RANDARRAY.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.min.name",detail:"formula.functionList.RANDARRAY.functionParameter.min.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.max.name",detail:"formula.functionList.RANDARRAY.functionParameter.max.detail",example:"100",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.name",detail:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RANDBETWEEN,functionType:t.FunctionType.Math,description:"formula.functionList.RANDBETWEEN.description",abstract:"formula.functionList.RANDBETWEEN.abstract",functionParameter:[{name:"formula.functionList.RANDBETWEEN.functionParameter.bottom.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.bottom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.RANDBETWEEN.functionParameter.top.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.top.detail",example:"100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROMAN,functionType:t.FunctionType.Math,description:"formula.functionList.ROMAN.description",abstract:"formula.functionList.ROMAN.abstract",functionParameter:[{name:"formula.functionList.ROMAN.functionParameter.number.name",detail:"formula.functionList.ROMAN.functionParameter.number.detail",example:"499",require:1,repeat:0},{name:"formula.functionList.ROMAN.functionParameter.form.name",detail:"formula.functionList.ROMAN.functionParameter.form.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUND,functionType:t.FunctionType.Math,description:"formula.functionList.ROUND.description",abstract:"formula.functionList.ROUND.abstract",functionParameter:[{name:"formula.functionList.ROUND.functionParameter.number.name",detail:"formula.functionList.ROUND.functionParameter.number.detail",example:"2.15",require:1,repeat:0},{name:"formula.functionList.ROUND.functionParameter.numDigits.name",detail:"formula.functionList.ROUND.functionParameter.numDigits.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDBANK,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDBANK.description",abstract:"formula.functionList.ROUNDBANK.abstract",functionParameter:[{name:"formula.functionList.ROUNDBANK.functionParameter.number.name",detail:"formula.functionList.ROUNDBANK.functionParameter.number.detail",example:"2.345",require:1,repeat:0},{name:"formula.functionList.ROUNDBANK.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDBANK.functionParameter.numDigits.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDDOWN,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDDOWN.description",abstract:"formula.functionList.ROUNDDOWN.abstract",functionParameter:[{name:"formula.functionList.ROUNDDOWN.functionParameter.number.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDUP,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDUP.description",abstract:"formula.functionList.ROUNDUP.abstract",functionParameter:[{name:"formula.functionList.ROUNDUP.functionParameter.number.name",detail:"formula.functionList.ROUNDUP.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDUP.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDUP.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEC,functionType:t.FunctionType.Math,description:"formula.functionList.SEC.description",abstract:"formula.functionList.SEC.abstract",functionParameter:[{name:"formula.functionList.SEC.functionParameter.number.name",detail:"formula.functionList.SEC.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SECH,functionType:t.FunctionType.Math,description:"formula.functionList.SECH.description",abstract:"formula.functionList.SECH.abstract",functionParameter:[{name:"formula.functionList.SECH.functionParameter.number.name",detail:"formula.functionList.SECH.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SERIESSUM,functionType:t.FunctionType.Math,description:"formula.functionList.SERIESSUM.description",abstract:"formula.functionList.SERIESSUM.abstract",functionParameter:[{name:"formula.functionList.SERIESSUM.functionParameter.x.name",detail:"formula.functionList.SERIESSUM.functionParameter.x.detail",example:"0.785398163",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.n.name",detail:"formula.functionList.SERIESSUM.functionParameter.n.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.m.name",detail:"formula.functionList.SERIESSUM.functionParameter.m.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.coefficients.name",detail:"formula.functionList.SERIESSUM.functionParameter.coefficients.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEQUENCE,functionType:t.FunctionType.Math,description:"formula.functionList.SEQUENCE.description",abstract:"formula.functionList.SEQUENCE.abstract",functionParameter:[{name:"formula.functionList.SEQUENCE.functionParameter.rows.name",detail:"formula.functionList.SEQUENCE.functionParameter.rows.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.columns.name",detail:"formula.functionList.SEQUENCE.functionParameter.columns.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.start.name",detail:"formula.functionList.SEQUENCE.functionParameter.start.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.step.name",detail:"formula.functionList.SEQUENCE.functionParameter.step.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIGN,functionType:t.FunctionType.Math,description:"formula.functionList.SIGN.description",abstract:"formula.functionList.SIGN.abstract",functionParameter:[{name:"formula.functionList.SIGN.functionParameter.number.name",detail:"formula.functionList.SIGN.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIN,functionType:t.FunctionType.Math,description:"formula.functionList.SIN.description",abstract:"formula.functionList.SIN.abstract",functionParameter:[{name:"formula.functionList.SIN.functionParameter.number.name",detail:"formula.functionList.SIN.functionParameter.number.detail",example:"30*PI()/180",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SINH,functionType:t.FunctionType.Math,description:"formula.functionList.SINH.description",abstract:"formula.functionList.SINH.abstract",functionParameter:[{name:"formula.functionList.SINH.functionParameter.number.name",detail:"formula.functionList.SINH.functionParameter.number.detail",example:"0.0342*1.03",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRT,functionType:t.FunctionType.Math,description:"formula.functionList.SQRT.description",abstract:"formula.functionList.SQRT.abstract",functionParameter:[{name:"formula.functionList.SQRT.functionParameter.number.name",detail:"formula.functionList.SQRT.functionParameter.number.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRTPI,functionType:t.FunctionType.Math,description:"formula.functionList.SQRTPI.description",abstract:"formula.functionList.SQRTPI.abstract",functionParameter:[{name:"formula.functionList.SQRTPI.functionParameter.number.name",detail:"formula.functionList.SQRTPI.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUBTOTAL,functionType:t.FunctionType.Math,description:"formula.functionList.SUBTOTAL.description",abstract:"formula.functionList.SUBTOTAL.abstract",functionParameter:[{name:"formula.functionList.SUBTOTAL.functionParameter.functionNum.name",detail:"formula.functionList.SUBTOTAL.functionParameter.functionNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref1.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref2.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUM,aliasFunctionName:"formula.functionList.SUM.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUM.description",abstract:"formula.functionList.SUM.abstract",functionParameter:[{name:"formula.functionList.SUM.functionParameter.number1.name",detail:"formula.functionList.SUM.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUM.functionParameter.number2.name",detail:"formula.functionList.SUM.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIF,aliasFunctionName:"formula.functionList.SUMIF.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUMIF.description",abstract:"formula.functionList.SUMIF.abstract",functionParameter:[{name:"formula.functionList.SUMIF.functionParameter.range.name",detail:"formula.functionList.SUMIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.criteria.name",detail:"formula.functionList.SUMIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.sumRange.name",detail:"formula.functionList.SUMIF.functionParameter.sumRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIFS,functionType:t.FunctionType.Math,description:"formula.functionList.SUMIFS.description",abstract:"formula.functionList.SUMIFS.abstract",functionParameter:[{name:"formula.functionList.SUMIFS.functionParameter.sumRange.name",detail:"formula.functionList.SUMIFS.functionParameter.sumRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteria1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.SUMIFS.functionParameter.criteria2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMPRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.SUMPRODUCT.description",abstract:"formula.functionList.SUMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.SUMPRODUCT.functionParameter.array1.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array1.detail",example:"C2:C5",require:1,repeat:0},{name:"formula.functionList.SUMPRODUCT.functionParameter.array2.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array2.detail",example:"D2:D5",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMSQ,functionType:t.FunctionType.Math,description:"formula.functionList.SUMSQ.description",abstract:"formula.functionList.SUMSQ.abstract",functionParameter:[{name:"formula.functionList.SUMSQ.functionParameter.number1.name",detail:"formula.functionList.SUMSQ.functionParameter.number1.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.SUMSQ.functionParameter.number2.name",detail:"formula.functionList.SUMSQ.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2MY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2MY2.description",abstract:"formula.functionList.SUMX2MY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2MY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2MY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2PY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2PY2.description",abstract:"formula.functionList.SUMX2PY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2PY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2PY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMXMY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMXMY2.description",abstract:"formula.functionList.SUMXMY2.abstract",functionParameter:[{name:"formula.functionList.SUMXMY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMXMY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TAN,functionType:t.FunctionType.Math,description:"formula.functionList.TAN.description",abstract:"formula.functionList.TAN.abstract",functionParameter:[{name:"formula.functionList.TAN.functionParameter.number.name",detail:"formula.functionList.TAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TANH,functionType:t.FunctionType.Math,description:"formula.functionList.TANH.description",abstract:"formula.functionList.TANH.abstract",functionParameter:[{name:"formula.functionList.TANH.functionParameter.number.name",detail:"formula.functionList.TANH.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TRUNC,functionType:t.FunctionType.Math,description:"formula.functionList.TRUNC.description",abstract:"formula.functionList.TRUNC.abstract",functionParameter:[{name:"formula.functionList.TRUNC.functionParameter.number.name",detail:"formula.functionList.TRUNC.functionParameter.number.detail",example:"0.45",require:1,repeat:0},{name:"formula.functionList.TRUNC.functionParameter.numDigits.name",detail:"formula.functionList.TRUNC.functionParameter.numDigits.detail",example:"1",require:0,repeat:0}]}],$e=[{functionName:t.FUNCTION_NAMES_STATISTICAL.AVEDEV,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVEDEV.description",abstract:"formula.functionList.AVEDEV.abstract",functionParameter:[{name:"formula.functionList.AVEDEV.functionParameter.number1.name",detail:"formula.functionList.AVEDEV.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVEDEV.functionParameter.number2.name",detail:"formula.functionList.AVEDEV.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE,aliasFunctionName:"formula.functionList.AVERAGE.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE.description",abstract:"formula.functionList.AVERAGE.abstract",functionParameter:[{name:"formula.functionList.AVERAGE.functionParameter.number1.name",detail:"formula.functionList.AVERAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGE.functionParameter.number2.name",detail:"formula.functionList.AVERAGE.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE_WEIGHTED,aliasFunctionName:"formula.functionList.AVERAGE_WEIGHTED.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE_WEIGHTED.description",abstract:"formula.functionList.AVERAGE_WEIGHTED.abstract",functionParameter:[{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.detail",example:"20",require:0,repeat:1},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.detail",example:"3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEA,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEA.description",abstract:"formula.functionList.AVERAGEA.abstract",functionParameter:[{name:"formula.functionList.AVERAGEA.functionParameter.value1.name",detail:"formula.functionList.AVERAGEA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEA.functionParameter.value2.name",detail:"formula.functionList.AVERAGEA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIF.description",abstract:"formula.functionList.AVERAGEIF.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIF.functionParameter.range.name",detail:"formula.functionList.AVERAGEIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.criteria.name",detail:"formula.functionList.AVERAGEIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIF.functionParameter.averageRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIFS.description",abstract:"formula.functionList.AVERAGEIFS.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_DIST.description",abstract:"formula.functionList.BETA_DIST.abstract",functionParameter:[{name:"formula.functionList.BETA_DIST.functionParameter.x.name",detail:"formula.functionList.BETA_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.alpha.name",detail:"formula.functionList.BETA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.beta.name",detail:"formula.functionList.BETA_DIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BETA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.A.name",detail:"formula.functionList.BETA_DIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.B.name",detail:"formula.functionList.BETA_DIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_INV.description",abstract:"formula.functionList.BETA_INV.abstract",functionParameter:[{name:"formula.functionList.BETA_INV.functionParameter.probability.name",detail:"formula.functionList.BETA_INV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.alpha.name",detail:"formula.functionList.BETA_INV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.beta.name",detail:"formula.functionList.BETA_INV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.A.name",detail:"formula.functionList.BETA_INV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.B.name",detail:"formula.functionList.BETA_INV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST.description",abstract:"formula.functionList.BINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOM_DIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST_RANGE.description",abstract:"formula.functionList.BINOM_DIST_RANGE.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.detail",example:"60",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.detail",example:"45",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.detail",example:"50",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_INV.description",abstract:"formula.functionList.BINOM_INV.abstract",functionParameter:[{name:"formula.functionList.BINOM_INV.functionParameter.trials.name",detail:"formula.functionList.BINOM_INV.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_INV.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.alpha.name",detail:"formula.functionList.BINOM_INV.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST.description",abstract:"formula.functionList.CHISQ_DIST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST_RT.description",abstract:"formula.functionList.CHISQ_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV.description",abstract:"formula.functionList.CHISQ_INV.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV_RT.description",abstract:"formula.functionList.CHISQ_INV_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_TEST.description",abstract:"formula.functionList.CHISQ_TEST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_NORM.description",abstract:"formula.functionList.CONFIDENCE_NORM.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_T.description",abstract:"formula.functionList.CONFIDENCE_T.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CORREL,functionType:t.FunctionType.Statistical,description:"formula.functionList.CORREL.description",abstract:"formula.functionList.CORREL.abstract",functionParameter:[{name:"formula.functionList.CORREL.functionParameter.array1.name",detail:"formula.functionList.CORREL.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CORREL.functionParameter.array2.name",detail:"formula.functionList.CORREL.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNT,aliasFunctionName:"formula.functionList.COUNT.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNT.description",abstract:"formula.functionList.COUNT.abstract",functionParameter:[{name:"formula.functionList.COUNT.functionParameter.value1.name",detail:"formula.functionList.COUNT.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNT.functionParameter.value2.name",detail:"formula.functionList.COUNT.functionParameter.value2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTA,aliasFunctionName:"formula.functionList.COUNTA.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTA.description",abstract:"formula.functionList.COUNTA.abstract",functionParameter:[{name:"formula.functionList.COUNTA.functionParameter.number1.name",detail:"formula.functionList.COUNTA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTA.functionParameter.number2.name",detail:"formula.functionList.COUNTA.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTBLANK,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTBLANK.description",abstract:"formula.functionList.COUNTBLANK.abstract",functionParameter:[{name:"formula.functionList.COUNTBLANK.functionParameter.range.name",detail:"formula.functionList.COUNTBLANK.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIF.description",abstract:"formula.functionList.COUNTIF.abstract",functionParameter:[{name:"formula.functionList.COUNTIF.functionParameter.range.name",detail:"formula.functionList.COUNTIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIF.functionParameter.criteria.name",detail:"formula.functionList.COUNTIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIFS.description",abstract:"formula.functionList.COUNTIFS.abstract",functionParameter:[{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteria1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.detail",example:"B1:B20",require:0,repeat:1},{name:"formula.functionList.COUNTIFS.functionParameter.criteria2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_P.description",abstract:"formula.functionList.COVARIANCE_P.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_P.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_P.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_S.description",abstract:"formula.functionList.COVARIANCE_S.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_S.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_S.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.DEVSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.DEVSQ.description",abstract:"formula.functionList.DEVSQ.abstract",functionParameter:[{name:"formula.functionList.DEVSQ.functionParameter.number1.name",detail:"formula.functionList.DEVSQ.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DEVSQ.functionParameter.number2.name",detail:"formula.functionList.DEVSQ.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.EXPON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.EXPON_DIST.description",abstract:"formula.functionList.EXPON_DIST.abstract",functionParameter:[{name:"formula.functionList.EXPON_DIST.functionParameter.x.name",detail:"formula.functionList.EXPON_DIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.lambda.name",detail:"formula.functionList.EXPON_DIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST.description",abstract:"formula.functionList.F_DIST.abstract",functionParameter:[{name:"formula.functionList.F_DIST.functionParameter.x.name",detail:"formula.functionList.F_DIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.cumulative.name",detail:"formula.functionList.F_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST_RT.description",abstract:"formula.functionList.F_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.F_DIST_RT.functionParameter.x.name",detail:"formula.functionList.F_DIST_RT.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV.description",abstract:"formula.functionList.F_INV.abstract",functionParameter:[{name:"formula.functionList.F_INV.functionParameter.probability.name",detail:"formula.functionList.F_INV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV_RT.description",abstract:"formula.functionList.F_INV_RT.abstract",functionParameter:[{name:"formula.functionList.F_INV_RT.functionParameter.probability.name",detail:"formula.functionList.F_INV_RT.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_TEST.description",abstract:"formula.functionList.F_TEST.abstract",functionParameter:[{name:"formula.functionList.F_TEST.functionParameter.array1.name",detail:"formula.functionList.F_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.F_TEST.functionParameter.array2.name",detail:"formula.functionList.F_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHER,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHER.description",abstract:"formula.functionList.FISHER.abstract",functionParameter:[{name:"formula.functionList.FISHER.functionParameter.x.name",detail:"formula.functionList.FISHER.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHERINV,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHERINV.description",abstract:"formula.functionList.FISHERINV.abstract",functionParameter:[{name:"formula.functionList.FISHERINV.functionParameter.y.name",detail:"formula.functionList.FISHERINV.functionParameter.y.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST.description",abstract:"formula.functionList.FORECAST.abstract",functionParameter:[{name:"formula.functionList.FORECAST.functionParameter.x.name",detail:"formula.functionList.FORECAST.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS.description",abstract:"formula.functionList.FORECAST_ETS.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_CONFINT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_CONFINT.description",abstract:"formula.functionList.FORECAST_ETS_CONFINT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_SEASONALITY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_SEASONALITY.description",abstract:"formula.functionList.FORECAST_ETS_SEASONALITY.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_STAT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_STAT.description",abstract:"formula.functionList.FORECAST_ETS_STAT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_LINEAR.description",abstract:"formula.functionList.FORECAST_LINEAR.abstract",functionParameter:[{name:"formula.functionList.FORECAST_LINEAR.functionParameter.x.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FREQUENCY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FREQUENCY.description",abstract:"formula.functionList.FREQUENCY.abstract",functionParameter:[{name:"formula.functionList.FREQUENCY.functionParameter.dataArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.dataArray.detail",example:"A2:A10",require:1,repeat:0},{name:"formula.functionList.FREQUENCY.functionParameter.binsArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.binsArray.detail",example:"B2:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA.description",abstract:"formula.functionList.GAMMA.abstract",functionParameter:[{name:"formula.functionList.GAMMA.functionParameter.number.name",detail:"formula.functionList.GAMMA.functionParameter.number.detail",example:"2.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_DIST.description",abstract:"formula.functionList.GAMMA_DIST.abstract",functionParameter:[{name:"formula.functionList.GAMMA_DIST.functionParameter.x.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.beta.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_INV.description",abstract:"formula.functionList.GAMMA_INV.abstract",functionParameter:[{name:"formula.functionList.GAMMA_INV.functionParameter.probability.name",detail:"formula.functionList.GAMMA_INV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_INV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.beta.name",detail:"formula.functionList.GAMMA_INV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN.description",abstract:"formula.functionList.GAMMALN.abstract",functionParameter:[{name:"formula.functionList.GAMMALN.functionParameter.x.name",detail:"formula.functionList.GAMMALN.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN_PRECISE.description",abstract:"formula.functionList.GAMMALN_PRECISE.abstract",functionParameter:[{name:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.name",detail:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAUSS,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAUSS.description",abstract:"formula.functionList.GAUSS.abstract",functionParameter:[{name:"formula.functionList.GAUSS.functionParameter.z.name",detail:"formula.functionList.GAUSS.functionParameter.z.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GEOMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GEOMEAN.description",abstract:"formula.functionList.GEOMEAN.abstract",functionParameter:[{name:"formula.functionList.GEOMEAN.functionParameter.number1.name",detail:"formula.functionList.GEOMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.GEOMEAN.functionParameter.number2.name",detail:"formula.functionList.GEOMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GROWTH,functionType:t.FunctionType.Statistical,description:"formula.functionList.GROWTH.description",abstract:"formula.functionList.GROWTH.abstract",functionParameter:[{name:"formula.functionList.GROWTH.functionParameter.knownYs.name",detail:"formula.functionList.GROWTH.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.knownXs.name",detail:"formula.functionList.GROWTH.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.newXs.name",detail:"formula.functionList.GROWTH.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.constb.name",detail:"formula.functionList.GROWTH.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HARMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.HARMEAN.description",abstract:"formula.functionList.HARMEAN.abstract",functionParameter:[{name:"formula.functionList.HARMEAN.functionParameter.number1.name",detail:"formula.functionList.HARMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HARMEAN.functionParameter.number2.name",detail:"formula.functionList.HARMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.HYPGEOM_DIST.description",abstract:"formula.functionList.HYPGEOM_DIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.INTERCEPT,functionType:t.FunctionType.Statistical,description:"formula.functionList.INTERCEPT.description",abstract:"formula.functionList.INTERCEPT.abstract",functionParameter:[{name:"formula.functionList.INTERCEPT.functionParameter.knownYs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.INTERCEPT.functionParameter.knownXs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.KURT,functionType:t.FunctionType.Statistical,description:"formula.functionList.KURT.description",abstract:"formula.functionList.KURT.abstract",functionParameter:[{name:"formula.functionList.KURT.functionParameter.number1.name",detail:"formula.functionList.KURT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.KURT.functionParameter.number2.name",detail:"formula.functionList.KURT.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LARGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.LARGE.description",abstract:"formula.functionList.LARGE.abstract",functionParameter:[{name:"formula.functionList.LARGE.functionParameter.array.name",detail:"formula.functionList.LARGE.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.LARGE.functionParameter.k.name",detail:"formula.functionList.LARGE.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LINEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LINEST.description",abstract:"formula.functionList.LINEST.abstract",functionParameter:[{name:"formula.functionList.LINEST.functionParameter.knownYs.name",detail:"formula.functionList.LINEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LINEST.functionParameter.knownXs.name",detail:"formula.functionList.LINEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.constb.name",detail:"formula.functionList.LINEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.stats.name",detail:"formula.functionList.LINEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGEST.description",abstract:"formula.functionList.LOGEST.abstract",functionParameter:[{name:"formula.functionList.LOGEST.functionParameter.knownYs.name",detail:"formula.functionList.LOGEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.knownXs.name",detail:"formula.functionList.LOGEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.constb.name",detail:"formula.functionList.LOGEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.stats.name",detail:"formula.functionList.LOGEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_DIST.description",abstract:"formula.functionList.LOGNORM_DIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_DIST.functionParameter.x.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_INV.description",abstract:"formula.functionList.LOGNORM_INV.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_INV.functionParameter.probability.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MARGINOFERROR,aliasFunctionName:"formula.functionList.MARGINOFERROR.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MARGINOFERROR.description",abstract:"formula.functionList.MARGINOFERROR.abstract",functionParameter:[{name:"formula.functionList.MARGINOFERROR.functionParameter.range.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.range.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MARGINOFERROR.functionParameter.confidence.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.confidence.detail",example:"0.95",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAX,aliasFunctionName:"formula.functionList.MAX.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MAX.description",abstract:"formula.functionList.MAX.abstract",functionParameter:[{name:"formula.functionList.MAX.functionParameter.number1.name",detail:"formula.functionList.MAX.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAX.functionParameter.number2.name",detail:"formula.functionList.MAX.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXA.description",abstract:"formula.functionList.MAXA.abstract",functionParameter:[{name:"formula.functionList.MAXA.functionParameter.value1.name",detail:"formula.functionList.MAXA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXA.functionParameter.value2.name",detail:"formula.functionList.MAXA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXIFS.description",abstract:"formula.functionList.MAXIFS.abstract",functionParameter:[{name:"formula.functionList.MAXIFS.functionParameter.maxRange.name",detail:"formula.functionList.MAXIFS.functionParameter.maxRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteria1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MAXIFS.functionParameter.criteria2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MEDIAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.MEDIAN.description",abstract:"formula.functionList.MEDIAN.abstract",functionParameter:[{name:"formula.functionList.MEDIAN.functionParameter.number1.name",detail:"formula.functionList.MEDIAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MEDIAN.functionParameter.number2.name",detail:"formula.functionList.MEDIAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MIN,aliasFunctionName:"formula.functionList.MIN.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MIN.description",abstract:"formula.functionList.MIN.abstract",functionParameter:[{name:"formula.functionList.MIN.functionParameter.number1.name",detail:"formula.functionList.MIN.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MIN.functionParameter.number2.name",detail:"formula.functionList.MIN.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINA.description",abstract:"formula.functionList.MINA.abstract",functionParameter:[{name:"formula.functionList.MINA.functionParameter.value1.name",detail:"formula.functionList.MINA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINA.functionParameter.value2.name",detail:"formula.functionList.MINA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINIFS.description",abstract:"formula.functionList.MINIFS.abstract",functionParameter:[{name:"formula.functionList.MINIFS.functionParameter.minRange.name",detail:"formula.functionList.MINIFS.functionParameter.minRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteria1.name",detail:"formula.functionList.MINIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MINIFS.functionParameter.criteria2.name",detail:"formula.functionList.MINIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_MULT,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_MULT.description",abstract:"formula.functionList.MODE_MULT.abstract",functionParameter:[{name:"formula.functionList.MODE_MULT.functionParameter.number1.name",detail:"formula.functionList.MODE_MULT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_MULT.functionParameter.number2.name",detail:"formula.functionList.MODE_MULT.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_SNGL,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_SNGL.description",abstract:"formula.functionList.MODE_SNGL.abstract",functionParameter:[{name:"formula.functionList.MODE_SNGL.functionParameter.number1.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_SNGL.functionParameter.number2.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NEGBINOM_DIST.description",abstract:"formula.functionList.NEGBINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_DIST.description",abstract:"formula.functionList.NORM_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_DIST.functionParameter.x.name",detail:"formula.functionList.NORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.mean.name",detail:"formula.functionList.NORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.NORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_INV.description",abstract:"formula.functionList.NORM_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.mean.name",detail:"formula.functionList.NORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.NORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_DIST.description",abstract:"formula.functionList.NORM_S_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_S_DIST.functionParameter.z.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0},{name:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_INV.description",abstract:"formula.functionList.NORM_S_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_S_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_S_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PEARSON,functionType:t.FunctionType.Statistical,description:"formula.functionList.PEARSON.description",abstract:"formula.functionList.PEARSON.abstract",functionParameter:[{name:"formula.functionList.PEARSON.functionParameter.array1.name",detail:"formula.functionList.PEARSON.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PEARSON.functionParameter.array2.name",detail:"formula.functionList.PEARSON.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_EXC.description",abstract:"formula.functionList.PERCENTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_EXC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_INC.description",abstract:"formula.functionList.PERCENTILE_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_INC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_EXC.description",abstract:"formula.functionList.PERCENTRANK_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_INC.description",abstract:"formula.functionList.PERCENTRANK_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUT,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUT.description",abstract:"formula.functionList.PERMUT.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUTATIONA.description",abstract:"formula.functionList.PERMUTATIONA.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PHI,functionType:t.FunctionType.Statistical,description:"formula.functionList.PHI.description",abstract:"formula.functionList.PHI.abstract",functionParameter:[{name:"formula.functionList.PHI.functionParameter.x.name",detail:"formula.functionList.PHI.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.POISSON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.POISSON_DIST.description",abstract:"formula.functionList.POISSON_DIST.abstract",functionParameter:[{name:"formula.functionList.POISSON_DIST.functionParameter.x.name",detail:"formula.functionList.POISSON_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.mean.name",detail:"formula.functionList.POISSON_DIST.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.POISSON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PROB,functionType:t.FunctionType.Statistical,description:"formula.functionList.PROB.description",abstract:"formula.functionList.PROB.abstract",functionParameter:[{name:"formula.functionList.PROB.functionParameter.xRange.name",detail:"formula.functionList.PROB.functionParameter.xRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.probRange.name",detail:"formula.functionList.PROB.functionParameter.probRange.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.lowerLimit.name",detail:"formula.functionList.PROB.functionParameter.lowerLimit.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.upperLimit.name",detail:"formula.functionList.PROB.functionParameter.upperLimit.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_EXC.description",abstract:"formula.functionList.QUARTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_EXC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_EXC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_INC.description",abstract:"formula.functionList.QUARTILE_INC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_INC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_INC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_AVG,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_AVG.description",abstract:"formula.functionList.RANK_AVG.abstract",functionParameter:[{name:"formula.functionList.RANK_AVG.functionParameter.number.name",detail:"formula.functionList.RANK_AVG.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.ref.name",detail:"formula.functionList.RANK_AVG.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.order.name",detail:"formula.functionList.RANK_AVG.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_EQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_EQ.description",abstract:"formula.functionList.RANK_EQ.abstract",functionParameter:[{name:"formula.functionList.RANK_EQ.functionParameter.number.name",detail:"formula.functionList.RANK_EQ.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.ref.name",detail:"formula.functionList.RANK_EQ.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.order.name",detail:"formula.functionList.RANK_EQ.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RSQ.description",abstract:"formula.functionList.RSQ.abstract",functionParameter:[{name:"formula.functionList.RSQ.functionParameter.array1.name",detail:"formula.functionList.RSQ.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.RSQ.functionParameter.array2.name",detail:"formula.functionList.RSQ.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW.description",abstract:"formula.functionList.SKEW.abstract",functionParameter:[{name:"formula.functionList.SKEW.functionParameter.number1.name",detail:"formula.functionList.SKEW.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW.functionParameter.number2.name",detail:"formula.functionList.SKEW.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW_P.description",abstract:"formula.functionList.SKEW_P.abstract",functionParameter:[{name:"formula.functionList.SKEW_P.functionParameter.number1.name",detail:"formula.functionList.SKEW_P.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW_P.functionParameter.number2.name",detail:"formula.functionList.SKEW_P.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SLOPE,functionType:t.FunctionType.Statistical,description:"formula.functionList.SLOPE.description",abstract:"formula.functionList.SLOPE.abstract",functionParameter:[{name:"formula.functionList.SLOPE.functionParameter.knownYs.name",detail:"formula.functionList.SLOPE.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.SLOPE.functionParameter.knownXs.name",detail:"formula.functionList.SLOPE.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SMALL,functionType:t.FunctionType.Statistical,description:"formula.functionList.SMALL.description",abstract:"formula.functionList.SMALL.abstract",functionParameter:[{name:"formula.functionList.SMALL.functionParameter.array.name",detail:"formula.functionList.SMALL.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.SMALL.functionParameter.k.name",detail:"formula.functionList.SMALL.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STANDARDIZE,functionType:t.FunctionType.Statistical,description:"formula.functionList.STANDARDIZE.description",abstract:"formula.functionList.STANDARDIZE.abstract",functionParameter:[{name:"formula.functionList.STANDARDIZE.functionParameter.x.name",detail:"formula.functionList.STANDARDIZE.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.mean.name",detail:"formula.functionList.STANDARDIZE.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.standardDev.name",detail:"formula.functionList.STANDARDIZE.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_P.description",abstract:"formula.functionList.STDEV_P.abstract",functionParameter:[{name:"formula.functionList.STDEV_P.functionParameter.number1.name",detail:"formula.functionList.STDEV_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_P.functionParameter.number2.name",detail:"formula.functionList.STDEV_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_S.description",abstract:"formula.functionList.STDEV_S.abstract",functionParameter:[{name:"formula.functionList.STDEV_S.functionParameter.number1.name",detail:"formula.functionList.STDEV_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_S.functionParameter.number2.name",detail:"formula.functionList.STDEV_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVA.description",abstract:"formula.functionList.STDEVA.abstract",functionParameter:[{name:"formula.functionList.STDEVA.functionParameter.value1.name",detail:"formula.functionList.STDEVA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVA.functionParameter.value2.name",detail:"formula.functionList.STDEVA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVPA.description",abstract:"formula.functionList.STDEVPA.abstract",functionParameter:[{name:"formula.functionList.STDEVPA.functionParameter.value1.name",detail:"formula.functionList.STDEVPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVPA.functionParameter.value2.name",detail:"formula.functionList.STDEVPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STEYX,functionType:t.FunctionType.Statistical,description:"formula.functionList.STEYX.description",abstract:"formula.functionList.STEYX.abstract",functionParameter:[{name:"formula.functionList.STEYX.functionParameter.knownYs.name",detail:"formula.functionList.STEYX.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.STEYX.functionParameter.knownXs.name",detail:"formula.functionList.STEYX.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST.description",abstract:"formula.functionList.T_DIST.abstract",functionParameter:[{name:"formula.functionList.T_DIST.functionParameter.x.name",detail:"formula.functionList.T_DIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.cumulative.name",detail:"formula.functionList.T_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_2T.description",abstract:"formula.functionList.T_DIST_2T.abstract",functionParameter:[{name:"formula.functionList.T_DIST_2T.functionParameter.x.name",detail:"formula.functionList.T_DIST_2T.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_RT.description",abstract:"formula.functionList.T_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.T_DIST_RT.functionParameter.x.name",detail:"formula.functionList.T_DIST_RT.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV.description",abstract:"formula.functionList.T_INV.abstract",functionParameter:[{name:"formula.functionList.T_INV.functionParameter.probability.name",detail:"formula.functionList.T_INV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV_2T.description",abstract:"formula.functionList.T_INV_2T.abstract",functionParameter:[{name:"formula.functionList.T_INV_2T.functionParameter.probability.name",detail:"formula.functionList.T_INV_2T.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV_2T.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_TEST.description",abstract:"formula.functionList.T_TEST.abstract",functionParameter:[{name:"formula.functionList.T_TEST.functionParameter.array1.name",detail:"formula.functionList.T_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.array2.name",detail:"formula.functionList.T_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.tails.name",detail:"formula.functionList.T_TEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.type.name",detail:"formula.functionList.T_TEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TREND,functionType:t.FunctionType.Statistical,description:"formula.functionList.TREND.description",abstract:"formula.functionList.TREND.abstract",functionParameter:[{name:"formula.functionList.TREND.functionParameter.knownYs.name",detail:"formula.functionList.TREND.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.TREND.functionParameter.knownXs.name",detail:"formula.functionList.TREND.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.newXs.name",detail:"formula.functionList.TREND.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.constb.name",detail:"formula.functionList.TREND.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TRIMMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.TRIMMEAN.description",abstract:"formula.functionList.TRIMMEAN.abstract",functionParameter:[{name:"formula.functionList.TRIMMEAN.functionParameter.array.name",detail:"formula.functionList.TRIMMEAN.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.TRIMMEAN.functionParameter.percent.name",detail:"formula.functionList.TRIMMEAN.functionParameter.percent.detail",example:"0.2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_P.description",abstract:"formula.functionList.VAR_P.abstract",functionParameter:[{name:"formula.functionList.VAR_P.functionParameter.number1.name",detail:"formula.functionList.VAR_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_P.functionParameter.number2.name",detail:"formula.functionList.VAR_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_S.description",abstract:"formula.functionList.VAR_S.abstract",functionParameter:[{name:"formula.functionList.VAR_S.functionParameter.number1.name",detail:"formula.functionList.VAR_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_S.functionParameter.number2.name",detail:"formula.functionList.VAR_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARA.description",abstract:"formula.functionList.VARA.abstract",functionParameter:[{name:"formula.functionList.VARA.functionParameter.value1.name",detail:"formula.functionList.VARA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARA.functionParameter.value2.name",detail:"formula.functionList.VARA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARPA.description",abstract:"formula.functionList.VARPA.abstract",functionParameter:[{name:"formula.functionList.VARPA.functionParameter.value1.name",detail:"formula.functionList.VARPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARPA.functionParameter.value2.name",detail:"formula.functionList.VARPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.WEIBULL_DIST.description",abstract:"formula.functionList.WEIBULL_DIST.abstract",functionParameter:[{name:"formula.functionList.WEIBULL_DIST.functionParameter.x.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.beta.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.Z_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.Z_TEST.description",abstract:"formula.functionList.Z_TEST.abstract",functionParameter:[{name:"formula.functionList.Z_TEST.functionParameter.array.name",detail:"formula.functionList.Z_TEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.x.name",detail:"formula.functionList.Z_TEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.sigma.name",detail:"formula.functionList.Z_TEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],ze=[{functionName:t.FUNCTION_NAMES_TEXT.ASC,functionType:t.FunctionType.Text,description:"formula.functionList.ASC.description",abstract:"formula.functionList.ASC.abstract",functionParameter:[{name:"formula.functionList.ASC.functionParameter.text.name",detail:"formula.functionList.ASC.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.ARRAYTOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.ARRAYTOTEXT.description",abstract:"formula.functionList.ARRAYTOTEXT.abstract",functionParameter:[{name:"formula.functionList.ARRAYTOTEXT.functionParameter.array.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.array.detail",example:"A2:B4",require:1,repeat:0},{name:"formula.functionList.ARRAYTOTEXT.functionParameter.format.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.format.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.BAHTTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.BAHTTEXT.description",abstract:"formula.functionList.BAHTTEXT.abstract",functionParameter:[{name:"formula.functionList.BAHTTEXT.functionParameter.number.name",detail:"formula.functionList.BAHTTEXT.functionParameter.number.detail",example:"1234",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CHAR,functionType:t.FunctionType.Text,description:"formula.functionList.CHAR.description",abstract:"formula.functionList.CHAR.abstract",functionParameter:[{name:"formula.functionList.CHAR.functionParameter.number.name",detail:"formula.functionList.CHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CLEAN,functionType:t.FunctionType.Text,description:"formula.functionList.CLEAN.description",abstract:"formula.functionList.CLEAN.abstract",functionParameter:[{name:"formula.functionList.CLEAN.functionParameter.text.name",detail:"formula.functionList.CLEAN.functionParameter.text.detail",example:'CHAR(1)&"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CODE,functionType:t.FunctionType.Text,description:"formula.functionList.CODE.description",abstract:"formula.functionList.CODE.abstract",functionParameter:[{name:"formula.functionList.CODE.functionParameter.text.name",detail:"formula.functionList.CODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCAT,functionType:t.FunctionType.Text,description:"formula.functionList.CONCAT.description",abstract:"formula.functionList.CONCAT.abstract",functionParameter:[{name:"formula.functionList.CONCAT.functionParameter.text1.name",detail:"formula.functionList.CONCAT.functionParameter.text1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CONCAT.functionParameter.text2.name",detail:"formula.functionList.CONCAT.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCATENATE,functionType:t.FunctionType.Text,description:"formula.functionList.CONCATENATE.description",abstract:"formula.functionList.CONCATENATE.abstract",functionParameter:[{name:"formula.functionList.CONCATENATE.functionParameter.text1.name",detail:"formula.functionList.CONCATENATE.functionParameter.text1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.CONCATENATE.functionParameter.text2.name",detail:"formula.functionList.CONCATENATE.functionParameter.text2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.DBCS,functionType:t.FunctionType.Text,description:"formula.functionList.DBCS.description",abstract:"formula.functionList.DBCS.abstract",functionParameter:[{name:"formula.functionList.DBCS.functionParameter.text.name",detail:"formula.functionList.DBCS.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.DOLLAR,functionType:t.FunctionType.Text,description:"formula.functionList.DOLLAR.description",abstract:"formula.functionList.DOLLAR.abstract",functionParameter:[{name:"formula.functionList.DOLLAR.functionParameter.number.name",detail:"formula.functionList.DOLLAR.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.DOLLAR.functionParameter.decimals.name",detail:"formula.functionList.DOLLAR.functionParameter.decimals.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EXACT,functionType:t.FunctionType.Text,description:"formula.functionList.EXACT.description",abstract:"formula.functionList.EXACT.abstract",functionParameter:[{name:"formula.functionList.EXACT.functionParameter.text1.name",detail:"formula.functionList.EXACT.functionParameter.text1.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.EXACT.functionParameter.text2.name",detail:"formula.functionList.EXACT.functionParameter.text2.detail",example:'"univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIND,functionType:t.FunctionType.Text,description:"formula.functionList.FIND.description",abstract:"formula.functionList.FIND.abstract",functionParameter:[{name:"formula.functionList.FIND.functionParameter.findText.name",detail:"formula.functionList.FIND.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.withinText.name",detail:"formula.functionList.FIND.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.startNum.name",detail:"formula.functionList.FIND.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FINDB,functionType:t.FunctionType.Text,description:"formula.functionList.FINDB.description",abstract:"formula.functionList.FINDB.abstract",functionParameter:[{name:"formula.functionList.FINDB.functionParameter.findText.name",detail:"formula.functionList.FINDB.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.withinText.name",detail:"formula.functionList.FINDB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.startNum.name",detail:"formula.functionList.FINDB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIXED,functionType:t.FunctionType.Text,description:"formula.functionList.FIXED.description",abstract:"formula.functionList.FIXED.abstract",functionParameter:[{name:"formula.functionList.FIXED.functionParameter.number.name",detail:"formula.functionList.FIXED.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.FIXED.functionParameter.decimals.name",detail:"formula.functionList.FIXED.functionParameter.decimals.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FIXED.functionParameter.noCommas.name",detail:"formula.functionList.FIXED.functionParameter.noCommas.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFT,functionType:t.FunctionType.Text,description:"formula.functionList.LEFT.description",abstract:"formula.functionList.LEFT.abstract",functionParameter:[{name:"formula.functionList.LEFT.functionParameter.text.name",detail:"formula.functionList.LEFT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFT.functionParameter.numChars.name",detail:"formula.functionList.LEFT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFTB,functionType:t.FunctionType.Text,description:"formula.functionList.LEFTB.description",abstract:"formula.functionList.LEFTB.abstract",functionParameter:[{name:"formula.functionList.LEFTB.functionParameter.text.name",detail:"formula.functionList.LEFTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFTB.functionParameter.numBytes.name",detail:"formula.functionList.LEFTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEN,functionType:t.FunctionType.Text,description:"formula.functionList.LEN.description",abstract:"formula.functionList.LEN.abstract",functionParameter:[{name:"formula.functionList.LEN.functionParameter.text.name",detail:"formula.functionList.LEN.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LENB,functionType:t.FunctionType.Text,description:"formula.functionList.LENB.description",abstract:"formula.functionList.LENB.abstract",functionParameter:[{name:"formula.functionList.LENB.functionParameter.text.name",detail:"formula.functionList.LENB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LOWER,functionType:t.FunctionType.Text,description:"formula.functionList.LOWER.description",abstract:"formula.functionList.LOWER.abstract",functionParameter:[{name:"formula.functionList.LOWER.functionParameter.text.name",detail:"formula.functionList.LOWER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MID,functionType:t.FunctionType.Text,description:"formula.functionList.MID.description",abstract:"formula.functionList.MID.abstract",functionParameter:[{name:"formula.functionList.MID.functionParameter.text.name",detail:"formula.functionList.MID.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.startNum.name",detail:"formula.functionList.MID.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.numChars.name",detail:"formula.functionList.MID.functionParameter.numChars.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MIDB,functionType:t.FunctionType.Text,description:"formula.functionList.MIDB.description",abstract:"formula.functionList.MIDB.abstract",functionParameter:[{name:"formula.functionList.MIDB.functionParameter.text.name",detail:"formula.functionList.MIDB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.startNum.name",detail:"formula.functionList.MIDB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.numBytes.name",detail:"formula.functionList.MIDB.functionParameter.numBytes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.NUMBERVALUE,functionType:t.FunctionType.Text,description:"formula.functionList.NUMBERVALUE.description",abstract:"formula.functionList.NUMBERVALUE.abstract",functionParameter:[{name:"formula.functionList.NUMBERVALUE.functionParameter.text.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.text.detail",example:'"2.500,27"',require:1,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.detail",example:'","',require:0,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.detail",example:'"."',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PHONETIC,functionType:t.FunctionType.Text,description:"formula.functionList.PHONETIC.description",abstract:"formula.functionList.PHONETIC.abstract",functionParameter:[{name:"formula.functionList.PHONETIC.functionParameter.number1.name",detail:"formula.functionList.PHONETIC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.PHONETIC.functionParameter.number2.name",detail:"formula.functionList.PHONETIC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PROPER,functionType:t.FunctionType.Text,description:"formula.functionList.PROPER.description",abstract:"formula.functionList.PROPER.abstract",functionParameter:[{name:"formula.functionList.PROPER.functionParameter.text.name",detail:"formula.functionList.PROPER.functionParameter.text.detail",example:'"hello univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXEXTRACT,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXEXTRACT.description",abstract:"formula.functionList.REGEXEXTRACT.abstract",functionParameter:[{name:"formula.functionList.REGEXEXTRACT.functionParameter.text.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.text.detail",example:'"abcdefg"',require:1,repeat:0},{name:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.detail",example:'"c.*f"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXMATCH,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXMATCH.description",abstract:"formula.functionList.REGEXMATCH.abstract",functionParameter:[{name:"formula.functionList.REGEXMATCH.functionParameter.text.name",detail:"formula.functionList.REGEXMATCH.functionParameter.text.detail",example:'"Spreadsheets"',require:1,repeat:0},{name:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.detail",example:'"S.r"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXREPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXREPLACE.description",abstract:"formula.functionList.REGEXREPLACE.abstract",functionParameter:[{name:"formula.functionList.REGEXREPLACE.functionParameter.text.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.text.detail",example:'"abcedfg"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.detail",example:'"a.*d"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.replacement.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.replacement.detail",example:'"xyz"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACE.description",abstract:"formula.functionList.REPLACE.abstract",functionParameter:[{name:"formula.functionList.REPLACE.functionParameter.oldText.name",detail:"formula.functionList.REPLACE.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.startNum.name",detail:"formula.functionList.REPLACE.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.numChars.name",detail:"formula.functionList.REPLACE.functionParameter.numChars.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.newText.name",detail:"formula.functionList.REPLACE.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACEB,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACEB.description",abstract:"formula.functionList.REPLACEB.abstract",functionParameter:[{name:"formula.functionList.REPLACEB.functionParameter.oldText.name",detail:"formula.functionList.REPLACEB.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.startNum.name",detail:"formula.functionList.REPLACEB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.numBytes.name",detail:"formula.functionList.REPLACEB.functionParameter.numBytes.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.newText.name",detail:"formula.functionList.REPLACEB.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPT,functionType:t.FunctionType.Text,description:"formula.functionList.REPT.description",abstract:"formula.functionList.REPT.abstract",functionParameter:[{name:"formula.functionList.REPT.functionParameter.text.name",detail:"formula.functionList.REPT.functionParameter.text.detail",example:'"*-"',require:1,repeat:0},{name:"formula.functionList.REPT.functionParameter.numberTimes.name",detail:"formula.functionList.REPT.functionParameter.numberTimes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHT,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHT.description",abstract:"formula.functionList.RIGHT.abstract",functionParameter:[{name:"formula.functionList.RIGHT.functionParameter.text.name",detail:"formula.functionList.RIGHT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHT.functionParameter.numChars.name",detail:"formula.functionList.RIGHT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHTB,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHTB.description",abstract:"formula.functionList.RIGHTB.abstract",functionParameter:[{name:"formula.functionList.RIGHTB.functionParameter.text.name",detail:"formula.functionList.RIGHTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHTB.functionParameter.numBytes.name",detail:"formula.functionList.RIGHTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCH,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCH.description",abstract:"formula.functionList.SEARCH.abstract",functionParameter:[{name:"formula.functionList.SEARCH.functionParameter.findText.name",detail:"formula.functionList.SEARCH.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.withinText.name",detail:"formula.functionList.SEARCH.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.startNum.name",detail:"formula.functionList.SEARCH.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCHB,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCHB.description",abstract:"formula.functionList.SEARCHB.abstract",functionParameter:[{name:"formula.functionList.SEARCHB.functionParameter.findText.name",detail:"formula.functionList.SEARCHB.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.withinText.name",detail:"formula.functionList.SEARCHB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.startNum.name",detail:"formula.functionList.SEARCHB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SUBSTITUTE,functionType:t.FunctionType.Text,description:"formula.functionList.SUBSTITUTE.description",abstract:"formula.functionList.SUBSTITUTE.abstract",functionParameter:[{name:"formula.functionList.SUBSTITUTE.functionParameter.text.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.text.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.oldText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.oldText.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.newText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.newText.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.T,functionType:t.FunctionType.Text,description:"formula.functionList.T.description",abstract:"formula.functionList.T.abstract",functionParameter:[{name:"formula.functionList.T.functionParameter.value.name",detail:"formula.functionList.T.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXT.description",abstract:"formula.functionList.TEXT.abstract",functionParameter:[{name:"formula.functionList.TEXT.functionParameter.value.name",detail:"formula.functionList.TEXT.functionParameter.value.detail",example:"1.23",require:1,repeat:0},{name:"formula.functionList.TEXT.functionParameter.formatText.name",detail:"formula.functionList.TEXT.functionParameter.formatText.detail",example:'"$0.00"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTAFTER,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTAFTER.description",abstract:"formula.functionList.TEXTAFTER.abstract",functionParameter:[{name:"formula.functionList.TEXTAFTER.functionParameter.text.name",detail:"formula.functionList.TEXTAFTER.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.delimiter.name",detail:"formula.functionList.TEXTAFTER.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchMode.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTBEFORE,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTBEFORE.description",abstract:"formula.functionList.TEXTBEFORE.abstract",functionParameter:[{name:"formula.functionList.TEXTBEFORE.functionParameter.text.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTJOIN,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTJOIN.description",abstract:"formula.functionList.TEXTJOIN.abstract",functionParameter:[{name:"formula.functionList.TEXTJOIN.functionParameter.delimiter.name",detail:"formula.functionList.TEXTJOIN.functionParameter.delimiter.detail",example:'", "',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text1.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text1.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text2.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTSPLIT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTSPLIT.description",abstract:"formula.functionList.TEXTSPLIT.abstract",functionParameter:[{name:"formula.functionList.TEXTSPLIT.functionParameter.text.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.text.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.detail",example:'","',require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.detail",example:'";"',require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.padWith.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.padWith.detail",example:"",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TRIM,functionType:t.FunctionType.Text,description:"formula.functionList.TRIM.description",abstract:"formula.functionList.TRIM.abstract",functionParameter:[{name:"formula.functionList.TRIM.functionParameter.text.name",detail:"formula.functionList.TRIM.functionParameter.text.detail",example:'" Hello Univer "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICHAR,functionType:t.FunctionType.Text,description:"formula.functionList.UNICHAR.description",abstract:"formula.functionList.UNICHAR.abstract",functionParameter:[{name:"formula.functionList.UNICHAR.functionParameter.number.name",detail:"formula.functionList.UNICHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICODE,functionType:t.FunctionType.Text,description:"formula.functionList.UNICODE.description",abstract:"formula.functionList.UNICODE.abstract",functionParameter:[{name:"formula.functionList.UNICODE.functionParameter.text.name",detail:"formula.functionList.UNICODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UPPER,functionType:t.FunctionType.Text,description:"formula.functionList.UPPER.description",abstract:"formula.functionList.UPPER.abstract",functionParameter:[{name:"formula.functionList.UPPER.functionParameter.text.name",detail:"formula.functionList.UPPER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUE,functionType:t.FunctionType.Text,description:"formula.functionList.VALUE.description",abstract:"formula.functionList.VALUE.abstract",functionParameter:[{name:"formula.functionList.VALUE.functionParameter.text.name",detail:"formula.functionList.VALUE.functionParameter.text.detail",example:'"123"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUETOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.VALUETOTEXT.description",abstract:"formula.functionList.VALUETOTEXT.abstract",functionParameter:[{name:"formula.functionList.VALUETOTEXT.functionParameter.value.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.VALUETOTEXT.functionParameter.format.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.format.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CALL,functionType:t.FunctionType.Text,description:"formula.functionList.CALL.description",abstract:"formula.functionList.CALL.abstract",functionParameter:[{name:"formula.functionList.CALL.functionParameter.number1.name",detail:"formula.functionList.CALL.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CALL.functionParameter.number2.name",detail:"formula.functionList.CALL.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EUROCONVERT,functionType:t.FunctionType.Text,description:"formula.functionList.EUROCONVERT.description",abstract:"formula.functionList.EUROCONVERT.abstract",functionParameter:[{name:"formula.functionList.EUROCONVERT.functionParameter.number1.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.EUROCONVERT.functionParameter.number2.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGISTER_ID,functionType:t.FunctionType.Text,description:"formula.functionList.REGISTER_ID.description",abstract:"formula.functionList.REGISTER_ID.abstract",functionParameter:[{name:"formula.functionList.REGISTER_ID.functionParameter.number1.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.REGISTER_ID.functionParameter.number2.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],Ze=[],Je=[{functionName:t.FUNCTION_NAMES_WEB.ENCODEURL,functionType:t.FunctionType.Web,description:"formula.functionList.ENCODEURL.description",abstract:"formula.functionList.ENCODEURL.abstract",functionParameter:[{name:"formula.functionList.ENCODEURL.functionParameter.text.name",detail:"formula.functionList.ENCODEURL.functionParameter.text.detail",example:'"https://univer.ai/"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.FILTERXML,functionType:t.FunctionType.Web,description:"formula.functionList.FILTERXML.description",abstract:"formula.functionList.FILTERXML.abstract",functionParameter:[{name:"formula.functionList.FILTERXML.functionParameter.number1.name",detail:"formula.functionList.FILTERXML.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FILTERXML.functionParameter.number2.name",detail:"formula.functionList.FILTERXML.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.WEBSERVICE,functionType:t.FunctionType.Web,description:"formula.functionList.WEBSERVICE.description",abstract:"formula.functionList.WEBSERVICE.abstract",functionParameter:[{name:"formula.functionList.WEBSERVICE.functionParameter.number1.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.WEBSERVICE.functionParameter.number2.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],ta=[...Ke,...we,...ke,...$e,...je,...Xe,...ze,...Qe,...ge,...We,...Ye,...He,...Je,...Ge,...Ze];function ea(r,e){let a="";return r.aliasFunctionName?(a=e.t(r.aliasFunctionName),a===r.aliasFunctionName&&(a=r.functionName)):a=r.functionName,a}var aa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,ia=(r,e,a,n)=>{for(var i=n>1?void 0:n?na(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&aa(e,a,i),i},Ct=(r,e)=>(a,n)=>e(a,n,r);const ut=f.createIdentifier("formula.description-service");E.DescriptionService=class{constructor(e,a,n){h(this,"_descriptions",[]);this._functionService=e,this._localeService=a,this._configService=n,this._initialize()}dispose(){this._localeService.localeChanged$.complete()}getDescriptions(){return this._functionService.getDescriptions()}hasFunction(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())!==void 0}getFunctionInfo(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())}getSearchListByName(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c,functionType:s}=o;u.toLocaleUpperCase().indexOf(i)>-1&&s!==t.FunctionType.DefinedName&&a.push({name:u,desc:c})}),a}getSearchListByNameFirstLetter(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c}=o;u.toLocaleUpperCase().indexOf(i)===0&&a.push({name:u,desc:c})}),a}getSearchListByType(e){const a=[];return this._functionService.getDescriptions().forEach(i=>{const{functionName:o,functionType:u,abstract:c}=i;(u===e||e===-1)&&u!==t.FunctionType.DefinedName&&a.push({name:o,desc:c})}),a}registerDescriptions(e){return this._descriptions=this._descriptions.concat(e),this._registerDescriptions(),f.toDisposable(()=>{const a=e.map(n=>n.functionName);this.unregisterDescriptions(a)})}unregisterDescriptions(e){this._descriptions=this._descriptions.filter(a=>!e.includes(a.functionName)),this._functionService.unregisterDescriptions(...e)}hasDescription(e){return this._descriptions.some(a=>a.functionName===e)}hasDefinedNameDescription(e){return this._descriptions.some(a=>a.functionName===e&&a.functionType===t.FunctionType.DefinedName)}isFormulaDefinedName(e){const a=this._descriptions.filter(i=>i.functionName===e&&i.functionType===t.FunctionType.DefinedName);if(a.length===0)return!1;const n=a[0].description;return!t.isReferenceStrings(n)}_initialize(){this._localeService.localeChanged$.subscribe(()=>{this._registerDescriptions()}),this._initDescription(),this._registerDescriptions()}_initDescription(){var i;const e=[...t.functionArray,...t.functionCompatibility,...t.functionCube,...t.functionDatabase,...t.functionDate,...t.functionEngineering,...t.functionFinancial,...t.functionInformation,...t.functionLogical,...t.functionLookup,...t.functionMath,...t.functionMeta,...t.functionStatistical,...t.functionText,...t.functionUniver,...t.functionWeb].map(o=>o[1]),a=ta.filter(o=>e.includes(o.functionName)),n=this._configService.getConfig(nt);this._descriptions=a.concat((i=n==null?void 0:n.description)!=null?i:[])}_registerDescriptions(){const e=this._localeService,a=this._descriptions.map(n=>({functionName:ea(n,e),functionType:n.functionType,description:e.t(n.description),abstract:e.t(n.abstract),functionParameter:n.functionParameter.map(i=>({name:e.t(i.name),detail:e.t(i.detail),example:i.example,require:i.require,repeat:i.repeat}))}));this._functionService.registerDescriptions(...a)}},E.DescriptionService=ia([Ct(0,t.IFunctionService),Ct(1,f.Inject(f.LocaleService)),Ct(2,f.IConfigService)],E.DescriptionService);var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,ua=(r,e,a,n)=>{for(var i=n>1?void 0:n?oa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&ra(e,a,i),i},ct=(r,e)=>(a,n)=>e(a,n,r);function vt(r,e,a,n){const i=r.sequenceNodesBuilder(e);if(i==null)return e;const o=[];for(let u=0,c=i.length;u<c;u++){const s=i[u];if(typeof s=="string"||s.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:l}=s,d=t.deserializeRangeWithSheetWithCache(l),{sheetName:L,unitId:T}=d;let A=d.range;A.startAbsoluteRefType===f.AbsoluteRefType.ALL&&A.endAbsoluteRefType===f.AbsoluteRefType.ALL||(A=f.moveRangeByOffset(A,a,n),o.push({unitId:T,sheetName:L,range:A}))}return o.map(u=>`${u.unitId}!${u.sheetName}!${u.range.startRow}!${u.range.endRow}!${u.range.startColumn}!${u.range.endColumn}`).join("|")}E.FormulaRefRangeService=class extends f.Disposable{constructor(e,a,n,i){super(),this._refRangeService=e,this._lexerTreeBuilder=a,this._univerInstanceService=n,this._injector=i}transformFormulaByEffectCommand(e,a,n,i){const o=this._lexerTreeBuilder.sequenceNodesBuilder(n),u=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),c=u.getActiveSheet(),s=u.getUnitId(),l=c.getSheetId(),d=o==null?void 0:o.map(L=>{if(typeof L=="object"&&L.nodeType===t.sequenceNodeType.REFERENCE){const T=t.deserializeRangeWithSheetWithCache(L.token),{range:A,unitId:S,sheetName:C}=T,p=this._univerInstanceService.getUnit(S||e),N=C?p==null?void 0:p.getSheetBySheetName(C):p==null?void 0:p.getSheetBySheetId(a);if(!N)throw new Error("Sheet not found");const I=p.getUnitId(),P=N.getSheetId();if(I!==s||P!==l)return L;const _=m.handleDefaultRangeChangeWithEffectRefCommands(A,i);let R="";if(_){const x=_.startColumn-A.startColumn,q=_.startRow-A.startRow,D=f.moveRangeByOffset(A,x,q);S&&C?R=t.serializeRangeWithSpreadsheet(S,C,D):C?R=t.serializeRangeWithSheet(C,D):R=t.serializeRange(D)}else R=t.ErrorType.REF;return{...L,token:R}}else return L});return d?`=${t.generateStringWithSequence(d)}`:""}registerFormula(e,a,n,i){const o=new Map,u=this._lexerTreeBuilder.sequenceNodesBuilder(n),c=new f.DisposableCollection,s=l=>{const d=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),L=d.getActiveSheet(),T=d.getUnitId(),A=L.getSheetId(),S=u==null?void 0:u.map(p=>{if(typeof p=="object"&&p.nodeType===t.sequenceNodeType.REFERENCE){const N=o.get(p.token);if(N.unitId!==T||N.subUnitId!==A)return p;const I=m.handleDefaultRangeChangeWithEffectRefCommands(N.range,l);let P="";if(I){const _=I.startColumn-N.range.startColumn,R=I.startRow-N.range.startRow,x=f.moveRangeByOffset(N.range,_,R);N.unitId&&N.sheetName?P=t.serializeRangeWithSpreadsheet(N.unitId,N.sheetName,x):N.sheetName?P=t.serializeRangeWithSheet(N.sheetName,x):P=t.serializeRange(x)}else P=t.ErrorType.REF;return{...p,token:P}}else return p}),C=S&&t.generateStringWithSequence(S);return i(`=${C}`)};return u==null||u.forEach(l=>{if(typeof l=="object"&&l.nodeType===t.sequenceNodeType.REFERENCE){const d=t.deserializeRangeWithSheetWithCache(l.token),{range:L,unitId:T,sheetName:A}=d,S=this._univerInstanceService.getUnit(T||e),C=A?S==null?void 0:S.getSheetBySheetName(A):S==null?void 0:S.getSheetBySheetId(a);if(!C)return;const p=S.getUnitId(),N=C.getSheetId(),I={unitId:p,subUnitId:N,range:L,sheetName:A};o.set(l.token,I),c.add(this._refRangeService.registerRefRange(L,s,p,N))}}),c}_getFormulaDependcy(e,a,n,i){const o=f.isFormulaString(n)?this._lexerTreeBuilder.sequenceNodesBuilder(n):null,u=[];return o==null||o.forEach(c=>{if(typeof c=="object"&&c.nodeType===t.sequenceNodeType.REFERENCE){const s=t.deserializeRangeWithSheetWithCache(c.token),{range:l,unitId:d,sheetName:L}=s;if(l.startAbsoluteRefType===f.AbsoluteRefType.ALL&&l.endAbsoluteRefType===f.AbsoluteRefType.ALL)return;const T=this._univerInstanceService.getUnit(d||e),A=L?T==null?void 0:T.getSheetBySheetName(L):T==null?void 0:T.getSheetBySheetId(a);if(!A)return;const S=T.getUnitId(),C=A.getSheetId(),p=i[0].startRow,N=i[0].startColumn,I=l.startRow,P=l.startColumn,_=i.map(R=>({startRow:R.startRow-p+I,endRow:R.endRow-p+I,startColumn:R.startColumn-N+P,endColumn:R.endColumn-N+P}));u.push({unitId:S,subUnitId:C,ranges:_})}}),u}registerRangeFormula(e,a,n,i,o){const u=new f.DisposableCollection,c=i.map(l=>this._getFormulaDependcy(e,a,l,n)),s=l=>{const d=n[0].startRow,L=n[0].startColumn,T=[{unitId:e,subUnitId:a,ranges:n},...c.flat()],A=[],S=m.getSeparateEffectedRangesOnCommand(this._injector,l);for(const{unitId:C,subUnitId:p,ranges:N}of T)if(C===S.unitId&&p===S.subUnitId){const I=[],P=N[0].startRow,_=N[0].startColumn,R=P-d,x=_-L;for(const q of S.ranges){const D=N.map(y=>f.getIntersectRange(q,y)).filter(Boolean);D.length>0&&I.push(...D)}I.length>0&&A.push(I.map(q=>({startRow:q.startRow-R,endRow:q.endRow-R,startColumn:q.startColumn-x,endColumn:q.endColumn-x})))}if(A.length>0){const C=f.Rectangle.splitIntoGrid([...A.flat()]),p=f.Rectangle.subtractMulti(n,C);p.sort((R,x)=>R.startRow-x.startRow||R.startColumn-x.startColumn);const N=new Map;for(let R=0;R<C.length;R++){const x=C[R],q=x.startRow,D=x.startColumn,y=q-d,M=D-L,U=m.handleCommonDefaultRangeChangeWithEffectRefCommands(x,l).sort((B,W)=>B.startRow-W.startRow||B.startColumn-W.startColumn);if(!U.length)continue;const F=U[0].startRow,O=U[0].startColumn,v=F-d,$=O-L,z=[];for(let B=0;B<i.length;B++){const W=i[B],G=f.isFormulaString(W),Nt=G?this._lexerTreeBuilder.moveFormulaRefOffset(W,M,y):W,K=G?this.transformFormulaByEffectCommand(e,a,Nt,l):Nt,Z=vt(this._lexerTreeBuilder,K,-$,-v);z.push({newFormula:K,orginFormula:Z})}const w={formulas:z,ranges:U,key:z.map(B=>B.orginFormula).join("_")};N.has(w.key)?N.get(w.key).push(w):N.set(w.key,[w])}const I=i.map(R=>vt(this._lexerTreeBuilder,R,0,0)).join("_");if(p.length>0){const R=p[0].startRow,x=p[0].startColumn,q=[];for(let y=0;y<i.length;y++){const M=i[y];q.push({newFormula:f.isFormulaString(M)?this._lexerTreeBuilder.moveFormulaRefOffset(M,x-L,R-d):M,orginFormula:M})}const D={formulas:q,ranges:p,key:I};N.has(D.key)?N.get(D.key).push(D):N.set(D.key,[D])}const P=[],_=Array.from(N.keys());for(let R=_.length-1;R>=0;R--){const x=_[R],q=N.get(x).sort((M,U)=>M.ranges[0].startRow-U.ranges[0].startRow||M.ranges[0].startColumn-U.ranges[0].startColumn),D=[];for(let M=0;M<q[0].formulas.length;M++)D.push(q[0].formulas[M].newFormula);const y=f.Rectangle.mergeRanges(q.map(M=>M.ranges).flat());y.sort((M,U)=>M.startRow-U.startRow||M.startColumn-U.startColumn),P.push({formulas:D,ranges:y})}return o(P)}return{undos:[],redos:[]}};return n.forEach(l=>{const d=this._refRangeService.registerRefRange(l,s,e,a);u.add(d)}),[...c.flat()].forEach(({unitId:l,subUnitId:d,ranges:L})=>{L.forEach(T=>{const A=this._refRangeService.registerRefRange(T,s,l,d);u.add(A)})}),u}},E.FormulaRefRangeService=ua([ct(0,f.Inject(m.RefRangeService)),ct(1,f.Inject(t.LexerTreeBuilder)),ct(2,f.IUniverInstanceService),ct(3,f.Inject(f.Injector))],E.FormulaRefRangeService);var ca=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,ma=(r,e,a,n)=>{for(var i=n>1?void 0:n?fa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&ca(e,a,i),i},sa=(r,e)=>(a,n)=>e(a,n,r);const Rt="sheets-formula.remote-register-function.service",Ot=f.createIdentifier(Rt);E.RemoteRegisterFunctionService=class{constructor(e){this._functionService=e}async registerFunctions(e){const a=e.map(([n,i])=>la(n,i));this._functionService.registerExecutors(...a)}async unregisterFunctions(e){this._functionService.unregisterDescriptions(...e)}},E.RemoteRegisterFunctionService=ma([sa(0,t.IFunctionService)],E.RemoteRegisterFunctionService);function la(r,e){const a=new t.CustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}var pa=Object.defineProperty,da=Object.getOwnPropertyDescriptor,La=(r,e,a,n)=>{for(var i=n>1?void 0:n?da(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&pa(e,a,i),i},ft=(r,e)=>(a,n)=>e(a,n,r);const Vt=f.createIdentifier("sheets-formula.register-function-service");E.RegisterFunctionService=class extends f.Disposable{constructor(e,a,n,i){super(),this._localeService=e,this._descriptionService=a,this._functionService=n,this._remoteRegisterFunctionService=i}registerFunctions(e){const{locales:a,description:n,calculate:i}=e;a&&this._localeService.load(a);const o=new f.DisposableCollection;if(n)o.add(this._descriptionService.registerDescriptions(n));else{const u=i.map(([c,s,l])=>({functionName:s,functionType:t.FunctionType.User,description:"",abstract:l||"",functionParameter:[]}));o.add(this._functionService.registerDescriptions(...u))}return o.add(this._registerLocalExecutors(i)),this._remoteRegisterFunctionService&&o.add(this._registerRemoteExecutors(i)),o}_registerLocalExecutors(e){const a=e.map(([i,o])=>o),n=e.map(([i,o])=>{const u=new t.CustomFunction(o);return u.calculateCustom=i,u});return this._functionService.registerExecutors(...n),f.toDisposable(()=>this._functionService.unregisterExecutors(...a))}_registerRemoteExecutors(e){const a=[],n=e.map(([i,o])=>(a.push(o),[i.toString(),o]));return this._remoteRegisterFunctionService.registerFunctions(n),f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions(a))}},E.RegisterFunctionService=La([ft(0,f.Inject(f.LocaleService)),ft(1,f.Inject(ut)),ft(2,t.IFunctionService),ft(3,f.Optional(Ot))],E.RegisterFunctionService);const Ta="SHEETS_FORMULA_PLUGIN";var Na=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,Ea=(r,e,a,n)=>{for(var i=n>1?void 0:n?Pa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Na(e,a,i),i},Mt=(r,e)=>(a,n)=>e(a,n,r);let mt=class extends f.Disposable{constructor(r,e,a){super(),this._activeDirtyManagerService=r,this._univerInstanceService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._initialConversion()}_initialConversion(){this._activeDirtyManagerService.register(m.SetRangeValuesMutation.id,{commandId:m.SetRangeValuesMutation.id,getDirtyData:r=>{const e=r.params;return e.trigger===m.SetStyleCommand.id?{}:{dirtyRanges:this._getSetRangeValuesMutationDirtyRange(e)}}}),this._initialMove(),this._initialRowAndColumn(),this._initialSheet(),this._initialDefinedName()}_initialMove(){this._activeDirtyManagerService.register(m.MoveRangeMutation.id,{commandId:m.MoveRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.to.subUnitId]:"1",[e.from.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveRowsMutation.id,{commandId:m.MoveRowsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveColsMutation.id,{commandId:m.MoveColsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.ReorderRangeMutation.id,{commandId:m.ReorderRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getReorderRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialRowAndColumn(){this._activeDirtyManagerService.register(m.RemoveRowMutation.id,{commandId:m.RemoveRowMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!0),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.RemoveColMutation.id,{commandId:m.RemoveColMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!1),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertColMutation.id,{commandId:m.InsertColMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertRowMutation.id,{commandId:m.InsertRowMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialSheet(){this._activeDirtyManagerService.register(m.RemoveSheetMutation.id,{commandId:m.RemoveSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getRemoveSheetMutation(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertSheetMutation.id,{commandId:m.InsertSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getInsertSheetMutation(e)}}})}_initialDefinedName(){this._activeDirtyManagerService.register(t.SetDefinedNameMutation.id,{commandId:t.SetDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}}),this._activeDirtyManagerService.register(t.RemoveDefinedNameMutation.id,{commandId:t.RemoveDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}})}_getDefinedNameMutation(r){const{unitId:e,name:a,formulaOrRefString:n}=r,i={};return r==null?{}:(i[e]={},i[e][a]=n,i)}_getSetRangeValuesMutationDirtyRange(r){const{subUnitId:e,unitId:a,cellValue:n}=r,i=[];return n==null||(i.push(...this._getDirtyRangesByCellValue(a,e,n)),i.push(...this._getDirtyRangesForArrayFormula(a,e,n))),i}_getMoveRangeMutationDirtyRange(r){const{unitId:e,from:a,to:n}=r,i=[];return i.push(...this._getDirtyRangesByCellValue(e,a.subUnitId,a.value)),i.push(...this._getDirtyRangesByCellValue(e,n.subUnitId,n.value)),i.push(...this._getDirtyRangesForArrayFormula(e,n.subUnitId,n.value)),i}_getMoveRowsMutationDirtyRange(r){const{subUnitId:e,unitId:a,sourceRange:n,targetRange:i}=r,o=[],u=this._rangeToMatrix(n).getData(),c=this._rangeToMatrix(i).getData();return o.push(...this._getDirtyRangesByCellValue(a,e,u)),o.push(...this._getDirtyRangesByCellValue(a,e,c)),o.push(...this._getDirtyRangesForArrayFormula(a,e,c)),o}_getReorderRangeMutationDirtyRange(r){const{unitId:e,subUnitId:a,range:n}=r,i=this._rangeToMatrix(n).getData(),o=[];return o.push(...this._getDirtyRangesByCellValue(e,a,i)),o.push(...this._getDirtyRangesForArrayFormula(e,a,i)),o}_getDeleteRangeMutationDirtyRange(r){const{subUnitId:e,unitId:a,range:n,shiftDimension:i}=r,o=[],u=this._univerInstanceService.getUniverSheetInstance(a),c=u==null?void 0:u.getSheetBySheetId(e),s=(c==null?void 0:c.getLastRowWithContent())||0,l=(c==null?void 0:c.getLastColumnWithContent())||0,d=new f.ObjectMatrix;let L=null;const{startRow:T,startColumn:A,endRow:S,endColumn:C}=n;i===f.Dimension.ROWS?L=this._rangeToMatrix({startRow:T,startColumn:A,endRow:s,endColumn:C}):i===f.Dimension.COLUMNS&&(L=this._rangeToMatrix({startRow:T,startColumn:A,endRow:S,endColumn:l})),L!=null&&d.merge(L);const p=d.getData();return o.push(...this._getDirtyRangesByCellValue(a,e,p)),o.push(...this._getDirtyRangesForArrayFormula(a,e,p)),o}_getRemoveRowOrColumnMutation(r,e=!0){const{subUnitId:a,unitId:n,range:i}=r,o=[],u=this._univerInstanceService.getUniverSheetInstance(n),c=u==null?void 0:u.getSheetBySheetId(a),s=(c==null?void 0:c.getRowCount())||0,l=(c==null?void 0:c.getColumnCount())||0,d=new f.ObjectMatrix;let L=null;const{startRow:T,endRow:A,startColumn:S,endColumn:C}=i;e===!0?L=this._rangeToMatrix({startRow:T,startColumn:0,endRow:A,endColumn:l-1}):L=this._rangeToMatrix({startRow:0,startColumn:S,endRow:s,endColumn:C}),L!=null&&d.merge(L);const p=d.getData();return o.push(...this._getDirtyRangesByCellValue(n,a,p)),o.push(...this._getDirtyRangesForArrayFormula(n,a,p)),o}_getRemoveSheetMutation(r){const e={},{subUnitId:a,unitId:n,subUnitName:i}=r;return e[n]==null&&(e[n]={}),e[n][a]=i,e}_getInsertSheetMutation(r){const e={},{sheet:a,unitId:n}=r;return e[n]==null&&(e[n]={}),e[n][a.id]=a.name,e}_rangeToMatrix(r){const e=new f.ObjectMatrix,{startRow:a,startColumn:n,endRow:i,endColumn:o}=r;for(let u=a;u<=i;u++)for(let c=n;c<=o;c++)e.setValue(u,c,{});return e}_getDirtyRangesByCellValue(r,e,a){const n=[];return a==null||new f.ObjectMatrix(a).getDiscreteRanges().forEach(u=>{n.push({unitId:r,sheetId:e,range:u})}),n}_getDirtyRangesForArrayFormula(r,e,a){var u,c;const n=[];if(a==null)return n;const i=new f.ObjectMatrix(a),o=this._formulaDataModel.getArrayFormulaRange();if((u=o==null?void 0:o[r])!=null&&u[e]){const s=new f.ObjectMatrix((c=o==null?void 0:o[r])==null?void 0:c[e]);i.forValue((l,d)=>{s.forValue((L,T,A)=>{if(A==null)return!0;const{startRow:S,startColumn:C,endRow:p,endColumn:N}=A;l>=S&&l<=p&&d>=C&&d<=N&&n.push({unitId:r,sheetId:e,range:{startRow:S,startColumn:C,endRow:S,endColumn:C}})})})}return n}};mt=Ea([Mt(0,t.IActiveDirtyManagerService),Mt(1,f.IUniverInstanceService),Mt(2,f.Inject(t.FormulaDataModel))],mt);var Ia=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,Sa=(r,e,a,n)=>{for(var i=n>1?void 0:n?Aa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Ia(e,a,i),i},_t=(r,e)=>(a,n)=>e(a,n,r);let st=class extends f.Disposable{constructor(r,e,a){super(),this._commandService=r,this._sheetInterceptorService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._commandExecutedListener(),this._initInterceptorCellContent()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{if(r.id!==t.SetArrayFormulaDataMutation.id)return;const e=r.params;if(e==null)return;const{arrayFormulaRange:a,arrayFormulaCellData:n}=e;this._formulaDataModel.setArrayFormulaRange(a),this._formulaDataModel.setArrayFormulaCellData(n)}))}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(m.INTERCEPTOR_POINT.CELL_CONTENT,{priority:100,effect:f.InterceptorEffectEnum.Value,handler:(r,e,a)=>{var l,d,L;const{unitId:n,subUnitId:i,row:o,col:u}=e,c=this._formulaDataModel.getArrayFormulaCellData(),s=(L=(d=(l=c==null?void 0:c[n])==null?void 0:l[i])==null?void 0:d[o])==null?void 0:L[u];return s==null?a(r):s.v==null&&s.t==null?a({...r,v:0,t:f.CellValueType.NUMBER}):(r==null?void 0:r.t)===f.CellValueType.NUMBER&&typeof(r==null?void 0:r.v)=="number"?a({...r,v:t.stripErrorMargin(r.v)}):a({...r,v:s.v,t:s.t})}}))}};st=Sa([_t(0,f.ICommandService),_t(1,f.Inject(m.SheetInterceptorService)),_t(2,f.Inject(t.FormulaDataModel))],st);var Ca=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Oa=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ra(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Ca(e,a,i),i},lt=(r,e)=>(a,n)=>e(a,n,r);let pt=class extends f.Disposable{constructor(e,a,n,i){super();h(this,"_preUnitId",null);this._descriptionService=e,this._definedNamesService=a,this._univerInstanceService=n,this._commandService=i,this._initialize()}_initialize(){this._descriptionListener(),this._changeUnitListener(),this._changeSheetListener()}_descriptionListener(){f.toDisposable(this._definedNamesService.update$.subscribe(()=>{this._registerDescriptions()}))}_changeUnitListener(){f.toDisposable(this._univerInstanceService.getCurrentTypeOfUnit$(f.UniverInstanceType.UNIVER_SHEET).subscribe(()=>{this._unRegisterDescriptions(),this._registerDescriptions()}))}_changeSheetListener(){this.disposeWithMe(this._commandService.onCommandExecuted((e,a)=>{if(!(a!=null&&a.fromCollab)){if(e.id===m.SetWorksheetActiveOperation.id)this._unregisterDescriptionsForNotInSheetId(),this._registerDescriptions();else if(e.id===t.SetDefinedNameMutation.id){const n=e.params;this._registerDescription(n)}else if(e.id===t.RemoveDefinedNameMutation.id){const n=e.params;this._unregisterDescription(n)}}}))}_registerDescription(e){const{unitId:a,sheetId:n}=this._getUnitIdAndSheetId();if(a==null||n==null)return;const{name:i,comment:o,formulaOrRefString:u,localSheetId:c}=e;!this._descriptionService.hasDescription(i)&&(c==null||c===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||c===n)&&this._descriptionService.registerDescriptions([{functionName:i,description:u+(o||""),abstract:u,functionType:t.FunctionType.DefinedName,functionParameter:[]}])}_unregisterDescription(e){const{name:a}=e;this._descriptionService.unregisterDescriptions([a])}_unRegisterDescriptions(){if(this._preUnitId==null)return;const e=this._definedNamesService.getDefinedNameMap(this._preUnitId);if(e==null)return;const a=[];Array.from(Object.values(e)).forEach(n=>{const{name:i}=n;a.push(i)}),this._descriptionService.unregisterDescriptions(a),this._preUnitId=null}_getUnitIdAndSheetId(){const e=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(e==null)return{};const a=e.getActiveSheet();return a==null?{}:{unitId:e.getUnitId(),sheetId:a.getSheetId()}}_registerDescriptions(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];this._preUnitId=e,Array.from(Object.values(n)).forEach(o=>{const{name:u,comment:c,formulaOrRefString:s,localSheetId:l}=o;!this._descriptionService.hasDescription(u)&&(l==null||l===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||l===a)&&i.push({functionName:u,description:s+(c||""),abstract:s,functionType:t.FunctionType.DefinedName,functionParameter:[]})}),this._descriptionService.registerDescriptions(i)}_unregisterDescriptionsForNotInSheetId(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];Array.from(Object.values(n)).forEach(o=>{const{name:u,localSheetId:c}=o;c!==m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME&&c!==a&&i.push(u)}),this._descriptionService.unregisterDescriptions(i)}};pt=Oa([lt(0,ut),lt(1,t.IDefinedNamesService),lt(2,f.IUniverInstanceService),lt(3,f.ICommandService)],pt);var Ma=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,Da=(r,e,a,n)=>{for(var i=n>1?void 0:n?_a(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Ma(e,a,i),i},ba=(r,e)=>(a,n)=>e(a,n,r);let dt=class extends f.Disposable{constructor(r){super(),this._commandService=r,[Dt,tt].forEach(e=>this._commandService.registerCommand(e))}};dt=Da([ba(0,f.ICommandService)],dt);var Gt=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,xa=(r,e,a)=>e in r?Gt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Ht=(r,e,a,n)=>{for(var i=n>1?void 0:n?ya(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Gt(e,a,i),i},Lt=(r,e)=>(a,n)=>e(a,n,r),Tt=(r,e,a)=>xa(r,typeof e!="symbol"?e+"":e,a);E.UniverRemoteSheetsFormulaPlugin=class extends f.Plugin{constructor(e=Ft,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},Ft,this._config);this._configService.setConfig(Ue,i)}onStarting(){this._injector.add([E.RemoteRegisterFunctionService]),this._injector.get(it.IRPCChannelService).registerChannel(Rt,it.fromModule(this._injector.get(E.RemoteRegisterFunctionService)))}},Tt(E.UniverRemoteSheetsFormulaPlugin,"pluginName","SHEET_FORMULA_REMOTE_PLUGIN"),Tt(E.UniverRemoteSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverRemoteSheetsFormulaPlugin=Ht([f.DependentOn(t.UniverFormulaEnginePlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverRemoteSheetsFormulaPlugin),E.UniverSheetsFormulaPlugin=class extends f.Plugin{constructor(e=ht,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},ht,this._config);this._configService.setConfig(nt,i)}onStarting(){const e=this._injector,a=[[Vt,{useClass:E.RegisterFunctionService}],[ut,{useClass:E.DescriptionService}],[dt],[E.FormulaRefRangeService],[E.RegisterOtherFormulaService],[st],[E.TriggerCalculationController],[E.UpdateFormulaController],[mt],[pt],[E.UpdateDefinedNameController]];if(this._config.notExecuteFormula){const n=e.get(it.IRPCChannelService);a.push([Ot,{useFactory:()=>it.toModule(n.requestChannel(Rt))}])}a.forEach(n=>e.add(n))}onReady(){f.touchDependencies(this._injector,[[dt],[mt],[st],[E.UpdateFormulaController],[E.UpdateDefinedNameController]]),f.isNodeEnv()&&f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}onRendered(){f.touchDependencies(this._injector,[[pt]]),f.isNodeEnv()||f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}},Tt(E.UniverSheetsFormulaPlugin,"pluginName",Ta),Tt(E.UniverSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverSheetsFormulaPlugin=Ht([f.DependentOn(t.UniverFormulaEnginePlugin,m.UniverSheetsPlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverSheetsFormulaPlugin),E.CalculationMode=H,E.IDescriptionService=ut,E.IRegisterFunctionService=Vt,E.IRemoteRegisterFunctionService=Ot,E.InsertFunctionCommand=Dt,E.OtherFormulaMarkDirty=tt,E.PLUGIN_CONFIG_KEY_BASE=nt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
48
|
+
(function(E,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula"),require("rxjs"),require("@univerjs/rpc")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula","rxjs","@univerjs/rpc"],f):(E=typeof globalThis<"u"?globalThis:E||self,f(E.UniverSheetsFormula={},E.UniverCore,E.UniverSheets,E.UniverEngineFormula,E.rxjs,E.UniverRpc))})(this,function(E,f,m,t,Y,it){"use strict";var qa=Object.defineProperty;var ha=(E,f,m)=>f in E?qa(E,f,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[f]=m;var h=(E,f,m)=>ha(E,typeof f!="symbol"?f+"":f,m);const Dt={id:"formula.command.insert-function",type:f.CommandType.COMMAND,handler:async(r,e)=>{const{list:a}=e,n=r.get(f.ICommandService),i=new f.ObjectMatrix;a.forEach(u=>{const{range:c,primary:s,formula:l}=u,{row:d,column:L}=s,T=f.Tools.generateRandomId(6);i.setValue(d,L,{f:l,si:T});const{startRow:A,startColumn:S,endRow:C,endColumn:p}=c;for(let N=A;N<=C;N++)for(let I=S;I<=p;I++)(N!==d||I!==L)&&i.setValue(N,I,{si:T})});const o={value:i.getData()};return n.executeCommand(m.SetRangeValuesCommand.id,o)}},tt={type:f.CommandType.MUTATION,id:"sheet.mutation.data-validation-formula-mark-dirty",handler(){return!0}};function Yt(r,e,a){var n;return r==null||r[e]==null||((n=r[e])==null?void 0:n[a])==null}function Pt(r,e,a){var n;if(a){if(r&&r[e]&&((n=r[e])!=null&&n[a]))return delete r[e][a],{[e]:{[a]:null}}}else if(r&&r[e])return delete r[e],{[e]:null}}var b=(r=>(r[r.MoveRange=0]="MoveRange",r[r.MoveRows=1]="MoveRows",r[r.MoveCols=2]="MoveCols",r[r.InsertRow=3]="InsertRow",r[r.InsertColumn=4]="InsertColumn",r[r.RemoveRow=5]="RemoveRow",r[r.RemoveColumn=6]="RemoveColumn",r[r.DeleteMoveLeft=7]="DeleteMoveLeft",r[r.DeleteMoveUp=8]="DeleteMoveUp",r[r.InsertMoveDown=9]="InsertMoveDown",r[r.InsertMoveRight=10]="InsertMoveRight",r[r.SetName=11]="SetName",r[r.RemoveSheet=12]="RemoveSheet",r[r.SetDefinedName=13]="SetDefinedName",r[r.RemoveDefinedName=14]="RemoveDefinedName",r))(b||{});const Xt=[11,12,13,14];function wt(r,e,a){const{type:n}=a;return Xt.includes(n)?Wt(r,e):Kt(r,e,a)}function Wt(r,e){const a=[],n=[];return Object.keys(e).forEach(i=>{const o=e[i],u=r[i];if(o==null||u==null)return!0;Object.keys(o).forEach(c=>{const s=new f.ObjectMatrix(o[c]||{}),l=new f.ObjectMatrix(u[c]||{}),d=new f.ObjectMatrix,L=new f.ObjectMatrix;if(s.forValue((p,N,I)=>{if(I==null)return!0;const P=rt(I);P!==null&&(d.setValue(p,N,P),L.setValue(p,N,l.getValue(p,N)))}),d.getSizeOf()===0)return;const T={subUnitId:c,unitId:i,cellValue:d.getMatrix()},A={id:m.SetRangeValuesMutation.id,params:T};n.push(A);const S={subUnitId:c,unitId:i,cellValue:L.getMatrix()},C={id:m.SetRangeValuesMutation.id,params:S};a.push(C)})}),{undos:a,redos:n}}function Kt(r,e,a){const{redoFormulaData:n,undoFormulaData:i}=gt(r,e,a);if(f.Tools.diffValue(n,i))return{undos:[],redos:[]};const o=[],u=[];return Object.keys(n).forEach(c=>{Object.keys(n[c]).forEach(s=>{if(Object.keys(n[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:n[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};o.push(d)}})}),Object.keys(i).forEach(c=>{Object.keys(i[c]).forEach(s=>{if(Object.keys(i[c][s]).length!==0){const l={subUnitId:s,unitId:c,cellValue:i[c][s]},d={id:m.SetRangeValuesMutation.id,params:l};u.push(d)}})}),{undos:u,redos:o}}function gt(r,e,a){const n={},i={},{type:o,unitId:u,sheetId:c,range:s,from:l,to:d}=a;return new Set([...Object.keys(r),...Object.keys(e)]).forEach(T=>{if(Yt(r,T,c))return;new Set([...Object.keys(r[T]||{}),...Object.keys(e[T]||{})]).forEach(S=>{var x,q;const C=(x=r[T])==null?void 0:x[S],p=(q=e[T])==null?void 0:q[S],N=new f.ObjectMatrix(C||{}),I=new f.ObjectMatrix(p||{});let P=[];T!==u||S!==c?P=jt(I):P=Qt(N,o,l,d,s);const _=ce(P,N,I),R=fe(P,N);n[T]||(n[T]={}),i[T]||(i[T]={}),n[T][S]={...n[T][S],..._},i[T][S]={...i[T][S],...R}})}),{redoFormulaData:n,undoFormulaData:i}}function Qt(r,e,a,n,i){const o=[];return r.forValue((u,c,s)=>{if(s==null||!bt(s))return!0;const l=f.cellToRange(u,c);let d=null,L=!1;if([0,1,2].includes(e))d=kt(e,a,n,l);else if(i!=null){const T=$t(e,i,l);d=T.newCell,L=T.isReverse}L?o.unshift({oldCell:l,newCell:d}):o.push({oldCell:l,newCell:d})}),o}function jt(r){const e=[];return r.forValue((a,n,i)=>{if(i==null||!bt(i))return!0;const o=f.cellToRange(a,n);e.push({oldCell:o,newCell:o})}),e}function kt(r,e,a,n){if(e==null||a==null)return null;switch(r){case 0:return zt(e,a,n);case 1:return Zt(e,a,n);case 2:return Jt(e,a,n);default:return null}}function $t(r,e,a){let n=null,i=!1;switch(r){case 3:n=te(e,a),i=!0;break;case 4:n=ee(e,a),i=!0;break;case 5:n=ae(e,a);break;case 6:n=ne(e,a);break;case 7:n=ie(e,a);break;case 8:n=re(e,a);break;case 9:n=oe(e,a),i=!0;break;case 10:n=ue(e,a),i=!0;break}return{newCell:n,isReverse:i}}function zt(r,e,a){const n=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Zt(r,e,a){const n=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function Jt(r,e,a){const n=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:e,fromRange:r}},a);return m.runRefRangeMutations(n,a)}function te(r,e){const a=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},e);return m.runRefRangeMutations(a,e)}function ee(r,e){const a=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:r,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},e);return m.runRefRangeMutations(a,e)}function ae(r,e){const a=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ne(r,e){const a=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ie(r,e){const a=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function re(r,e){const a=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function oe(r,e){const a=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ue(r,e){const a=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:r}},e);return m.runRefRangeMutations(a,e)}function ce(r,e,a){const n=new f.ObjectMatrix({});return r.forEach(i=>{const{oldCell:o,newCell:u}=i,{startRow:c,startColumn:s}=o,l=a.getValue(c,s)||e.getValue(c,s),d=rt(l);if(n.setValue(c,s,{f:null,si:null}),u){const{startRow:L,startColumn:T}=u;n.setValue(L,T,d)}}),n.getMatrix()}function fe(r,e){const a=new f.ObjectMatrix({});return r.reverse().forEach(n=>{const{oldCell:i,newCell:o}=n,{startRow:u,startColumn:c}=i,s=e.getValue(u,c),l=rt(s);if(o){const{startRow:d,startColumn:L}=o;a.setValue(d,L,{f:null,si:null})}a.setValue(u,c,l)}),a.getMatrix()}function rt(r){if(r==null)return;const{f:e,si:a,x:n=0,y:i=0}=r,o=f.isFormulaString(e),u=f.isFormulaId(a);if(!o&&!u)return{f:null,si:null};const c={};return u&&(c.si=a),o&&n===0&&i===0&&(c.f=e),c.f===void 0&&(c.f=null),c.si===void 0&&(c.si=null),c}function me(r){const e=new f.ObjectMatrix({});return new f.ObjectMatrix(r).forValue((n,i,o)=>{const u=rt(o);u&&e.setValue(n,i,u)}),e.getMatrix()}function bt(r){const e=(r==null?void 0:r.f)||"",a=(r==null?void 0:r.si)||"",n=f.isFormulaString(e),i=f.isFormulaId(a);return!!(n||i)}function yt(r,e,a,n,i,o){if((i==null||i.length===0)&&(o==null||o.length===0)){if(r===a&&e===n)return!0}else if((r===i||i==null||i.length===0)&&e===o)return!0;return!1}function xt(r,e,a=0,n=0){const i=[];for(let o=0,u=r.length;o<u;o++){const c=r[o];if(typeof c=="string"||c.nodeType!==t.sequenceNodeType.REFERENCE||e.includes(o)){i.push(c);continue}const{token:s}=c,l=t.deserializeRangeWithSheetWithCache(s),{range:d,sheetName:L,unitId:T}=l,A=f.Rectangle.moveOffset(d,a,n);i.push({...c,token:t.serializeRangeToRefString({range:A,unitId:T,sheetName:L})})}return i}function Ut(r,e,a,n){const{type:i,unitId:o,sheetId:u,range:c,from:s,to:l}=e,{range:d,sheetId:L,unitId:T,sheetName:A,refOffsetX:S,refOffsetY:C}=r;if(!yt(o,u,a,n,T,L))return;const p=f.Rectangle.moveOffset(d,S,C);let N=null;if(i===b.MoveRange){if(s==null||l==null)return;const I=It(p,s),P=f.getIntersectRange(p,s);if(P==null||I!==4)return;const _=m.handleMoveRange({id:m.EffectRefRangId.MoveRangeCommandId,params:{toRange:l,fromRange:s}},P),R=m.runRefRangeMutations(_,P);if(R==null)return t.ErrorType.REF;N=Et(I,R,s,l,p,P)}else if(i===b.MoveRows){if(s==null||l==null)return;const I=It(p,s);let P=f.getIntersectRange(p,s);if(P==null&&(s.endRow<p.startRow&&l.endRow<p.startRow||s.startRow>p.endRow&&l.startRow>p.endRow))return;P==null&&(P={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveRows({id:m.EffectRefRangId.MoveRowsCommandId,params:{toRange:l,fromRange:s}},P),R=m.runRefRangeMutations(_,P);if(R==null)return t.ErrorType.REF;N=Et(I,R,s,l,p,P)}else if(i===b.MoveCols){if(s==null||l==null)return;const I=It(p,s);let P=f.getIntersectRange(p,s);if(P==null&&(s.endColumn<p.startColumn&&l.endColumn<p.startColumn||s.startColumn>p.endColumn&&l.startColumn>p.endColumn))return;P==null&&(P={startRow:p.startRow,endRow:p.endRow,startColumn:p.startColumn,endColumn:p.endColumn,rangeType:f.RANGE_TYPE.NORMAL});const _=m.handleMoveCols({id:m.EffectRefRangId.MoveColsCommandId,params:{toRange:l,fromRange:s}},P),R=m.runRefRangeMutations(_,P);if(R==null)return t.ErrorType.REF;N=Et(I,R,s,l,p,P)}if(c!=null){if(i===b.InsertRow){const I=m.handleInsertRow({id:m.EffectRefRangId.InsertRowCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.DOWN}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}else if(i===b.InsertColumn){const I=m.handleInsertCol({id:m.EffectRefRangId.InsertColCommandId,params:{range:c,unitId:"",subUnitId:"",direction:f.Direction.RIGHT}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}else if(i===b.RemoveRow){const I=m.handleIRemoveRow({id:m.EffectRefRangId.RemoveRowCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.RemoveColumn){const I=m.handleIRemoveCol({id:m.EffectRefRangId.RemoveColCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.DeleteMoveLeft){const I=m.handleDeleteRangeMoveLeft({id:m.EffectRefRangId.DeleteRangeMoveLeftCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.DeleteMoveUp){const I=m.handleDeleteRangeMoveUp({id:m.EffectRefRangId.DeleteRangeMoveUpCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return t.ErrorType.REF;N={...p,...P}}else if(i===b.InsertMoveDown){const I=m.handleInsertRangeMoveDown({id:m.EffectRefRangId.InsertRangeMoveDownCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}else if(i===b.InsertMoveRight){const I=m.handleInsertRangeMoveRight({id:m.EffectRefRangId.InsertRangeMoveRightCommandId,params:{range:c}},p),P=m.runRefRangeMutations(I,p);if(P==null)return;N={...p,...P}}}if(N!=null)return t.serializeRangeToRefString({range:N,sheetName:A,unitId:T})}function Et(r,e,a,n,i,o){const{startRow:u,endRow:c,startColumn:s,endColumn:l,rangeType:d}=et(e),{startRow:L,startColumn:T,endRow:A,endColumn:S,rangeType:C=f.RANGE_TYPE.NORMAL}=et(a),{startRow:p,startColumn:N,endRow:I,endColumn:P}=et(n),{startRow:_,endRow:R,startColumn:x,endColumn:q}=et(o),{startRow:D,endRow:y,startColumn:M,endColumn:U,rangeType:F=f.RANGE_TYPE.NORMAL}=et(i),O={...i};function v(){return d===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?!0:s>=M&&l<=U}function $(){return d===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?!0:u>=D&&c<=y}if(r===0)if(v())if(u<D)O.startRow=u;else if(u>=y)O.endRow-=A+1-D;else return;else return;else if(r===1)if(v())if(c>y)O.endRow=c;else if(c<=D)O.startRow+=y-L+1;else return;else return;else if(r===2)if($())if(s<M)O.startColumn=s;else if(s>=U)O.endColumn-=S+1-M;else return;else return;else if(r===3)if($())if(l>U)O.endColumn=l;else if(l<=M)O.startColumn+=U-T+1;else return;else return;else r===4?(O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l):T<=M&&S>=U||C===f.RANGE_TYPE.ROW&&F===f.RANGE_TYPE.ROW?a.endRow<D?(p>=D&&(O.startRow-=A-L+1),p>=y&&(O.endRow-=A-L+1)):a.startRow>y?(I<=y&&(O.endRow+=A-L+1),I<=D&&(O.startRow+=A-L+1)):a.startRow>=D&&a.endRow<=y&&(p<=D?O.startRow+=A-L+1:p>=y&&(O.endRow-=A-L+1)):L<=D&&A>=y||C===f.RANGE_TYPE.COLUMN&&F===f.RANGE_TYPE.COLUMN?a.endColumn<M?(N>=M&&(O.startColumn-=S-T+1),N>=U&&(O.endColumn-=S-T+1)):a.startColumn>U?(P<=U&&(O.endColumn+=S-T+1),P<=M&&(O.startColumn+=S-T+1)):a.startColumn>=M&&a.endColumn<=U&&(N<=M?O.startColumn+=S-T+1:N>=U&&(O.endColumn-=S-T+1)):((N<=q+1&&P>=U||N<=M&&P>=x-1)&&p<=D&&I>=y||(p<=R+1&&I>=y||p<=D&&I>=_-1)&&N<=M&&P>=U,O.startRow=u,O.startColumn=s,O.endRow=c,O.endColumn=l);return O}function It(r,e){const a=j(r.startRow),n=k(r.endRow),i=j(r.startColumn),o=k(r.endColumn),u=j(e.startRow),c=k(e.endRow),s=j(e.startColumn),l=k(e.endColumn);function d(){return r.rangeType===f.RANGE_TYPE.COLUMN&&e.rangeType===f.RANGE_TYPE.COLUMN?!0:a>=u&&n<=c}function L(){return r.rangeType===f.RANGE_TYPE.ROW&&e.rangeType===f.RANGE_TYPE.ROW?!0:i>=s&&o<=l}function T(){return r.rangeType===f.RANGE_TYPE.ALL&&e.rangeType===f.RANGE_TYPE.ALL}return d()&&L()||T()?4:L()&&a>=u&&a<=c&&n>c?0:L()&&n>=u&&n<=c&&a<u?1:d()&&i>=s&&i<=l&&o>l?2:d()&&o>=s&&o<=l&&i<s?3:null}function j(r){return isNaN(r)?-1/0:r}function k(r){return isNaN(r)?1/0:r}function et(r){const{startRow:e,endRow:a,startColumn:n,endColumn:i}=r;return{...r,startRow:j(e),endRow:k(a),startColumn:j(n),endColumn:k(i)}}function qt(r,e){const{id:a}=e;let n=null;switch(a){case m.MoveRangeCommand.id:n=se(e,r);break;case m.MoveRowsCommand.id:n=le(e,r);break;case m.MoveColsCommand.id:n=pe(e,r);break;case m.InsertRowCommand.id:n=de(e);break;case m.InsertColCommand.id:n=Le(e);break;case m.InsertRangeMoveRightCommand.id:n=Te(e,r);break;case m.InsertRangeMoveDownCommand.id:n=Ne(e,r);break;case m.RemoveRowCommand.id:n=Pe(e,r);break;case m.RemoveColCommand.id:n=Ee(e,r);break;case m.DeleteRangeMoveUpCommand.id:n=Ie(e,r);break;case m.DeleteRangeMoveLeftCommand.id:n=Ae(e,r);break;case m.SetWorksheetNameCommand.id:n=Se(e,r);break;case m.RemoveSheetCommand.id:n=Ce(e,r);break;case m.SetDefinedNameCommand.id:n=Re(e,r);break;case m.RemoveDefinedNameCommand.id:n=Oe(e,r);break}return n}function V(r){var n;const e=r.getUnitId(),a=((n=r.getActiveSheet())==null?void 0:n.getSheetId())||"";return{unitId:e,sheetId:a}}function se(r,e){const{params:a}=r;if(!a)return null;const{fromRange:n,toRange:i}=a;if(!n||!i)return null;const{unitId:o,sheetId:u}=V(e);return{type:b.MoveRange,from:n,to:i,unitId:o,sheetId:u}}function le(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startRow:n,endRow:i},toRange:{startRow:o,endRow:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:n,startColumn:0,endRow:i,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW},L={startRow:o,startColumn:0,endRow:u,endColumn:s.getColumnCount()-1,rangeType:f.RANGE_TYPE.ROW};return{type:b.MoveRows,from:d,to:L,unitId:c,sheetId:l}}function pe(r,e){const{params:a}=r;if(!a)return null;const{fromRange:{startColumn:n,endColumn:i},toRange:{startColumn:o,endColumn:u}}=a,c=e.getUnitId(),s=e.getActiveSheet();if(!s)return null;const l=s.getSheetId(),d={startRow:0,startColumn:n,endRow:s.getRowCount()-1,endColumn:i,rangeType:f.RANGE_TYPE.COLUMN},L={startRow:0,startColumn:o,endRow:s.getRowCount()-1,endColumn:u,rangeType:f.RANGE_TYPE.COLUMN};return{type:b.MoveCols,from:d,to:L,unitId:c,sheetId:l}}function de(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertRow,range:a,unitId:n,sheetId:i}}function Le(r){const{params:e}=r;if(!e)return null;const{range:a,unitId:n,subUnitId:i}=e;return{type:b.InsertColumn,range:a,unitId:n,sheetId:i}}function Te(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveRight,range:n,unitId:i,sheetId:o}}function Ne(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.InsertMoveDown,range:n,unitId:i,sheetId:o}}function Pe(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveRow,range:n,unitId:i,sheetId:o}}function Ee(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.RemoveColumn,range:n,unitId:i,sheetId:o}}function Ie(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveUp,range:n,unitId:i,sheetId:o}}function Ae(r,e){const{params:a}=r;if(!a)return null;const{range:n}=a,{unitId:i,sheetId:o}=V(e);return{type:b.DeleteMoveLeft,range:n,unitId:i,sheetId:o}}function Se(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i,name:o}=a,{unitId:u,sheetId:c}=V(e);return{type:b.SetName,unitId:n||u,sheetId:i||c,sheetName:o}}function Ce(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,subUnitId:i}=a,{unitId:o,sheetId:u}=V(e);return{type:b.RemoveSheet,unitId:n||o,sheetId:i||u}}function Re(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.SetDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}function Oe(r,e){const{params:a}=r;if(!a)return null;const{unitId:n,name:i,id:o}=a,{sheetId:u}=V(e);return{type:b.RemoveDefinedName,unitId:n,sheetId:u,definedName:i,definedNameId:o}}var Me=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,De=(r,e,a,n)=>{for(var i=n>1?void 0:n?_e(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Me(e,a,i),i},ot=(r,e)=>(a,n)=>e(a,n,r);E.UpdateDefinedNameController=class extends f.Disposable{constructor(e,a,n,i){super(),this._definedNamesService=e,this._univerInstanceService=a,this._sheetInterceptorService=n,this._lexerTreeBuilder=i,this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===m.SetDefinedNameCommand.id||e.id===m.RemoveDefinedNameCommand.id)return{redos:[],undos:[]};const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(a==null)return{redos:[],undos:[]};const n=qt(a,e);return n?this._getUpdateDefinedNameMutations(a,n):{redos:[],undos:[]}}}))}_getUpdateDefinedNameMutations(e,a){const{type:n,unitId:i,sheetId:o}=a,u=this._definedNamesService.getDefinedNameMap(i);if(!u)return{redos:[],undos:[]};const c=[],s=[];return Object.values(u).forEach(l=>{var N;const{formulaOrRefString:d}=l,L=this._lexerTreeBuilder.sequenceNodesBuilder(d);if(L==null)return!0;let T=!1;const A=[];for(let I=0,P=L.length;I<P;I++){const _=L[I];if(typeof _=="string"||_.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:R}=_,x=t.deserializeRangeWithSheetWithCache(R),{range:q,sheetName:D,unitId:y}=x,M=((N=e.getSheetBySheetName(D))==null?void 0:N.getSheetId())||"",U={range:q,sheetId:M,unitId:y,sheetName:D,refOffsetX:0,refOffsetY:0};let F=null;if(n===b.RemoveSheet)F=this._removeSheet(l,i,o);else if(n===b.SetName){const{sheetId:O,sheetName:v}=a;if(v==null||M==null||M.length===0||O!==M)continue;F=t.serializeRangeToRefString({range:q,sheetName:v,unitId:y})}else F=Ut(U,a,i,o);F!=null&&(L[I]={..._,token:F},T=!0,A.push(I))}if(!T)return!0;const S=t.generateStringWithSequence(xt(L,A)),C={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l,formulaOrRefString:S}};c.push(C);const p={id:t.SetDefinedNameMutation.id,params:{unitId:i,...l}};s.push(p)}),{redos:c,undos:s}}_removeSheet(e,a,n){var u;const{formulaOrRefString:i}=e;return((u=this._definedNamesService.getWorksheetByRef(a,i))==null?void 0:u.getSheetId())===n?t.ErrorType.REF:null}},E.UpdateDefinedNameController=De([ot(0,t.IDefinedNamesService),ot(1,f.IUniverInstanceService),ot(2,f.Inject(m.SheetInterceptorService)),ot(3,f.Inject(t.LexerTreeBuilder))],E.UpdateDefinedNameController);var at=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(at||{}),be=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,xe=(r,e,a,n)=>{for(var i=n>1?void 0:n?ye(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&be(e,a,i),i},At=(r,e)=>(a,n)=>e(a,n,r);E.RegisterOtherFormulaService=class extends f.Disposable{constructor(a,n,i){super();h(this,"_formulaCacheMap",new Map);h(this,"_formulaChangeWithRange$",new Y.Subject);h(this,"formulaChangeWithRange$",this._formulaChangeWithRange$.asObservable());h(this,"_formulaResult$",new Y.Subject);h(this,"formulaResult$",this._formulaResult$.asObservable());h(this,"calculateStarted$",new Y.BehaviorSubject(!1));this._commandService=a,this._activeDirtyManagerService=n,this._lifecycleService=i,this._initFormulaRegister(),this._initFormulaCalculationResultChange()}dispose(){super.dispose(),this._formulaChangeWithRange$.complete(),this._formulaResult$.complete(),this.calculateStarted$.complete()}_ensureCacheMap(a,n){let i=this._formulaCacheMap.get(a);i||(i=new Map,this._formulaCacheMap.set(a,i));let o=i.get(n);return o||(o=new Map,i.set(n,o)),o}_createFormulaId(a,n){return`formula.${a}_${n}_${f.Tools.generateRandomId(8)}`}_initFormulaRegister(){this._activeDirtyManagerService.register(tt.id,{commandId:tt.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}});const a=n=>{const{unitId:i,subUnitId:o,formulaText:u,formulaId:c,ranges:s}=n;if(!this._ensureCacheMap(i,o).has(c))return;const d={unitId:i,subUnitId:o,formulaMap:{[c]:{f:u,ranges:s}}};this._commandService.executeCommand(t.SetOtherFormulaMutation.id,d).then(()=>{this._commandService.executeCommand(tt.id,{[i]:{[o]:{[c]:!0}}})})};this.disposeWithMe(this._formulaChangeWithRange$.pipe(Y.bufferWhen(()=>this.calculateStarted$.pipe(Y.filter(n=>n)))).subscribe(n=>n.forEach(a))),this.disposeWithMe(this._formulaChangeWithRange$.pipe(Y.filter(()=>this.calculateStarted$.getValue())).subscribe(a))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{if(a.id===t.SetFormulaCalculationResultMutation.id){const n=a.params,{unitOtherData:i}=n,o={};for(const u in i){const c=i[u],s={};o[u]=s;for(const l in c){const d=this._ensureCacheMap(u,l),L=c[l],T=[];s[l]=T;for(const A in L){const S=L[A];if(d.has(A)){const C=d.get(A);if(!C)continue;C.result||(C.result={});const p=new f.ObjectMatrix(S),N=new f.ObjectMatrix(C.result);p.forValue((I,P,_)=>{N.setValue(I,P,_)}),C.status=at.SUCCESS,C.callbacks.forEach(I=>{I(S)}),C.callbacks.clear(),T.push(C)}}}}this._formulaResult$.next(o)}}))}registerFormulaWithRange(a,n,i,o=[{startRow:0,endRow:0,startColumn:0,endColumn:0}],u){const c=this._createFormulaId(a,n);return this._ensureCacheMap(a,n).set(c,{result:void 0,status:at.WAIT,formulaId:c,callbacks:new Set,extra:u}),this._formulaChangeWithRange$.next({unitId:a,subUnitId:n,formulaText:i,formulaId:c,ranges:o}),c}deleteFormula(a,n,i){const o={unitId:a,subUnitId:n,formulaIdList:i};this._commandService.executeCommand(t.RemoveOtherFormulaMutation.id,o);const u=this._ensureCacheMap(a,n);i.forEach(c=>u.delete(c))}getFormulaValue(a,n,i){const o=this._ensureCacheMap(a,n),u=o.get(i);return u?u.status===at.SUCCESS||u.status===at.ERROR?Promise.resolve(u):new Promise(c=>{u.callbacks.add(()=>{c(o.get(i))})}):Promise.resolve(null)}getFormulaValueSync(a,n,i){return this._ensureCacheMap(a,n).get(i)}},E.RegisterOtherFormulaService=xe([At(0,f.ICommandService),At(1,t.IActiveDirtyManagerService),At(2,f.Inject(f.LifecycleService))],E.RegisterOtherFormulaService);const nt="sheets-formula.base.config";var H=(r=>(r[r.FORCED=0]="FORCED",r[r.WHEN_EMPTY=1]="WHEN_EMPTY",r[r.NO_CALCULATION=2]="NO_CALCULATION",r))(H||{});const ht={},Ue="sheets-formula.remote.config",Ft={};var qe=Object.defineProperty,he=Object.getOwnPropertyDescriptor,Fe=(r,e,a,n)=>{for(var i=n>1?void 0:n?he(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&qe(e,a,i),i},g=(r,e)=>(a,n)=>e(a,n,r);const Bt={done:0,count:0},St={onlyLocal:!0};E.TriggerCalculationController=class extends f.Disposable{constructor(a,n,i,o,u,c,s){var d;super();h(this,"_waitingCommandQueue",[]);h(this,"_executingDirtyData",{forceCalculation:!1,dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}});h(this,"_setTimeoutKey",-1);h(this,"_startExecutionTime",0);h(this,"_totalCalculationTaskCount",0);h(this,"_doneCalculationTaskCount",0);h(this,"_executionInProgressParams",null);h(this,"_restartCalculation",!1);h(this,"_calculationMode",H.WHEN_EMPTY);h(this,"_forceCalculating",!1);h(this,"_progress$",new Y.BehaviorSubject(Bt));h(this,"progress$",this._progress$.asObservable());this._commandService=a,this._activeDirtyManagerService=n,this._logService=i,this._configService=o,this._formulaDataModel=u,this._localeService=c,this._registerOtherFormulaService=s;const l=this._configService.getConfig(nt);this._calculationMode=(d=l==null?void 0:l.initialFormulaComputing)!=null?d:H.WHEN_EMPTY,this._commandExecutedListener(),this._initialExecuteFormulaProcessListener(),this._initialExecuteFormula()}_emitProgress(a){this._progress$.next({done:this._doneCalculationTaskCount,count:this._totalCalculationTaskCount,label:a})}_startProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.analyzing");this._emitProgress(a)}_calculateProgress(a){if(this._executionInProgressParams){const{totalFormulasToCalculate:n,completedFormulasCount:i,totalArrayFormulasToCalculate:o,completedArrayFormulasCount:u}=this._executionInProgressParams;if(this._doneCalculationTaskCount=i+u,this._totalCalculationTaskCount=n+o,this._totalCalculationTaskCount===0)return;this._emitProgress(a)}}_completeProgress(){this._doneCalculationTaskCount=this._totalCalculationTaskCount=1;const a=this._localeService.t("formula.progress.done");this._emitProgress(a)}clearProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._emitProgress()}dispose(){super.dispose(),this._progress$.next(Bt),this._progress$.complete()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted((a,n)=>{if(this._activeDirtyManagerService.get(a.id)){if(a.id===m.SetRangeValuesMutation.id){const i=a.params;if(n&&n.onlyLocal===!0||i.trigger===m.SetStyleCommand.id||i.trigger===m.SetBorderCommand.id||i.trigger===m.ClearSelectionFormatCommand.id)return}this._waitingCommandQueue.push(a),clearTimeout(this._setTimeoutKey),this._setTimeoutKey=setTimeout(()=>{const i=this._generateDirty(this._waitingCommandQueue);this._executingDirtyData=this._mergeDirty(this._executingDirtyData,i),this._executionInProgressParams==null?this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St):(this._restartCalculation=!0,this._commandService.executeCommand(t.SetFormulaCalculationStopMutation.id,{})),this._waitingCommandQueue=[]},100)}}))}_generateDirty(a){const n=[],i={},o={},u={},c={},s={};for(const l of a){const d=this._activeDirtyManagerService.get(l.id);if(d==null)continue;const L=d.getDirtyData(l),{dirtyRanges:T,dirtyNameMap:A,dirtyDefinedNameMap:S,dirtyUnitFeatureMap:C,dirtyUnitOtherFormulaMap:p,clearDependencyTreeCache:N}=L;T!=null&&this._mergeDirtyRanges(n,T),A!=null&&this._mergeDirtyNameMap(i,A),S!=null&&this._mergeDirtyNameMap(o,S),C!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(u,C),p!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,p),N!=null&&this._mergeDirtyNameMap(s,N)}return{dirtyRanges:n,dirtyNameMap:i,dirtyDefinedNameMap:o,dirtyUnitFeatureMap:u,dirtyUnitOtherFormulaMap:c,forceCalculation:!1,clearDependencyTreeCache:s,maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}_mergeDirty(a,n){const i=[...a.dirtyRanges,...n.dirtyRanges],o={...a.dirtyNameMap},u={...a.dirtyDefinedNameMap},c={...a.dirtyUnitFeatureMap},s={...a.dirtyUnitOtherFormulaMap},l={...a.clearDependencyTreeCache};this._mergeDirtyNameMap(o,n.dirtyNameMap),this._mergeDirtyNameMap(u,n.dirtyDefinedNameMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(c,n.dirtyUnitFeatureMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(s,n.dirtyUnitOtherFormulaMap),this._mergeDirtyNameMap(l,n.clearDependencyTreeCache);const d=a.maxIteration||n.maxIteration;return{dirtyRanges:i,dirtyNameMap:o,dirtyDefinedNameMap:u,dirtyUnitFeatureMap:c,dirtyUnitOtherFormulaMap:s,forceCalculation:!!this._forceCalculating,clearDependencyTreeCache:l,maxIteration:d}}_mergeDirtyRanges(a,n){for(const i of n){let o=!1;for(const u of a)if(i.unitId===u.unitId&&i.sheetId===u.sheetId){const{startRow:c,startColumn:s,endRow:l,endColumn:d}=i.range,{startRow:L,startColumn:T,endRow:A,endColumn:S}=u.range;if(c===L&&s===T&&l===A&&d===S){o=!0;break}}o||a.push(i)}}_mergeDirtyNameMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{var u;(u=n[i])!=null&&u[o]&&(a[i][o]=n[i][o])})})}_mergeDirtyUnitFeatureOrOtherFormulaMap(a,n){Object.keys(n).forEach(i=>{a[i]==null&&(a[i]={}),Object.keys(n[i]).forEach(o=>{a[i][o]==null&&(a[i][o]={}),Object.keys(n[i][o]).forEach(u=>{a[i][o][u]=n[i][o][u]||!1})})})}_initialExecuteFormulaProcessListener(){let a=null,n=0;this.disposeWithMe(this._commandService.onCommandExecuted(i=>{if(i.id===t.SetFormulaCalculationStartMutation.id){const{forceCalculation:u=!1}=i.params;u&&(this._forceCalculating=!0)}else i.id===t.SetFormulaCalculationStopMutation.id&&this.clearProgress();if(i.id!==t.SetFormulaCalculationNotificationMutation.id)return;const o=i.params;if(o.stageInfo!=null){const{stage:u}=o.stageInfo;if(u===t.FormulaExecuteStageType.START){if(this._calculationMode===H.NO_CALCULATION)return;n===0&&(this._startExecutionTime=performance.now()),n++,a!==null&&(clearTimeout(a),a=null),a=setTimeout(()=>{a=null,this._startProgress()},1e3)}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.calculating");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.START_DEPENDENCY_ARRAY_FORMULA){if(this._executionInProgressParams=o.stageInfo,a===null){const c=this._localeService.t("formula.progress.array-analysis");this._calculateProgress(c)}}else if(u===t.FormulaExecuteStageType.CURRENTLY_CALCULATING_ARRAY_FORMULA&&(this._executionInProgressParams=o.stageInfo,a===null)){const c=this._localeService.t("formula.progress.array-calculation");this._calculateProgress(c)}}else{const u=o.functionsExecutedState;let c="";switch(n--,u){case t.FormulaExecutedStateType.NOT_EXECUTED:c="No tasks are being executed anymore",this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.STOP_EXECUTION:c="The execution of the formula has been stopped",n=0;break;case t.FormulaExecutedStateType.SUCCESS:c="Formula calculation succeeded",(n===0||n===-1)&&(c+=`. Total time consumed: ${performance.now()-this._startExecutionTime} ms`),this._resetExecutingDirtyData();break;case t.FormulaExecutedStateType.INITIAL:c="Waiting for calculation",this._resetExecutingDirtyData();break}(n===0||n===-1)&&(a?(clearTimeout(a),a=null,this.clearProgress()):this._completeProgress(),n=0,this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._forceCalculating=!1),u===t.FormulaExecutedStateType.STOP_EXECUTION&&this._restartCalculation?(this._restartCalculation=!1,this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,{...this._executingDirtyData},St)):this._executionInProgressParams=null,this._logService.debug("[TriggerCalculationController]",c)}}))}_resetExecutingDirtyData(){this._executingDirtyData={dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},forceCalculation:!1,clearDependencyTreeCache:{}}}_initialExecuteFormula(){const a=this._getDirtyDataByCalculationMode(this._calculationMode);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,a,St),this._registerOtherFormulaService.calculateStarted$.next(!0)}_getDirtyDataByCalculationMode(a){const n=a===H.FORCED,i=a===H.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:n,dirtyRanges:i,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{},maxIteration:this._configService.getConfig(t.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT)}}},E.TriggerCalculationController=Fe([g(0,f.ICommandService),g(1,t.IActiveDirtyManagerService),g(2,f.ILogService),g(3,f.IConfigService),g(4,f.Inject(t.FormulaDataModel)),g(5,f.Inject(f.LocaleService)),g(6,f.Inject(E.RegisterOtherFormulaService))],E.TriggerCalculationController);var Be=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,Ve=(r,e,a,n)=>{for(var i=n>1?void 0:n?ve(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Be(e,a,i),i},X=(r,e)=>(a,n)=>e(a,n,r);E.UpdateFormulaController=class extends f.Disposable{constructor(e,a,n,i,o,u,c,s){super(),this._univerInstanceService=e,this._commandService=a,this._lexerTreeBuilder=n,this._formulaDataModel=i,this._sheetInterceptorService=o,this._definedNamesService=u,this._configService=c,this._injector=s,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>this._getUpdateFormula(e)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.params)if(e.id===m.RemoveSheetMutation.id){const{subUnitId:a,unitId:n}=e.params;this._handleWorkbookDisposed(n,a)}else e.id===m.InsertSheetMutation.id&&this._handleInsertSheetMutation(e.params)})),this.disposeWithMe(this._commandService.beforeCommandExecuted((e,a)=>{if(e.id===m.SetRangeValuesMutation.id){const n=e.params;if(a&&a.onlyLocal===!0||n.trigger===m.SetStyleCommand.id||n.trigger===m.SetBorderCommand.id||n.trigger===m.ClearSelectionFormatCommand.id)return;this._handleSetRangeValuesMutation(n)}})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(f.UniverInstanceType.UNIVER_SHEET).subscribe(e=>this._handleWorkbookAdded(e))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(f.UniverInstanceType.UNIVER_SHEET).pipe(Y.map(e=>e.getUnitId())).subscribe(e=>this._handleWorkbookDisposed(e)))}_handleSetRangeValuesMutation(e){const{subUnitId:a,unitId:n,cellValue:i}=e;if(i==null)return;const o=this._formulaDataModel.updateFormulaData(n,a,i),u={[n]:{[a]:o}};this._commandService.executeCommand(m.SetRangeValuesMutation.id,{unitId:n,subUnitId:a,cellValue:me(o)},{onlyLocal:!0,fromFormula:!0}),this._formulaDataModel.updateArrayFormulaCellData(n,a,i),this._formulaDataModel.updateArrayFormulaRange(n,a,i),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:u},{onlyLocal:!0}),this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange(),arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData()},{onlyLocal:!0,remove:!0})}_handleWorkbookDisposed(e,a){const n=this._formulaDataModel.getFormulaData(),i=Pt(n,e,a),o=this._formulaDataModel.getArrayFormulaRange(),u=Pt(o,e,a),c=this._formulaDataModel.getArrayFormulaCellData(),s=Pt(c,e,a);i&&this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0}),u&&s&&this._commandService.executeCommand(t.SetArrayFormulaDataMutation.id,{arrayFormulaRange:o,arrayFormulaCellData:c},{onlyLocal:!0})}_handleInsertSheetMutation(e){const{sheet:a,unitId:n}=e,i=this._formulaDataModel.getFormulaData(),{id:o,cellData:u}=a,c=new f.ObjectMatrix(u),s=t.initSheetFormulaData(i,n,o,c);this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:s},{onlyLocal:!0})}_handleWorkbookAdded(e){var l;const a={},n=e.getUnitId(),i={[n]:{}};e.getSheets().forEach(d=>{var S;const L=d.getCellMatrix(),T=d.getSheetId(),A=t.initSheetFormulaData(a,n,T,L);i[n][T]=(S=A[n])==null?void 0:S[T]}),this._commandService.executeCommand(t.SetFormulaDataMutation.id,{formulaData:i},{onlyLocal:!0});const u=this._configService.getConfig(nt),c=(l=u==null?void 0:u.initialFormulaComputing)!=null?l:H.WHEN_EMPTY,s=this._getDiryDataByCalculationMode(c);this._commandService.executeCommand(t.SetFormulaCalculationStartMutation.id,s,{onlyLocal:!0})}_getDiryDataByCalculationMode(e){const a=e===H.FORCED,n=e===H.WHEN_EMPTY?this._formulaDataModel.getFormulaDirtyRanges():[];return{forceCalculation:a,dirtyRanges:n,dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}}_getUpdateFormula(e){const a=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(!a)return{undos:[],redos:[]};const n=qt(a,e);if(n){const{unitSheetNameMap:i}=this._formulaDataModel.getCalculateData(),o=this._formulaDataModel.getFormulaData(),{newFormulaData:u}=this._getFormulaReferenceMoveInfo(o,i,n),{undos:c,redos:s}=wt(o,u,n);return{undos:c,redos:s}}return{undos:[],redos:[]}}_getFormulaReferenceMoveInfo(e,a,n){if(!f.Tools.isDefine(e))return{newFormulaData:{},oldFormulaData:{}};const i=Object.keys(e);if(i.length===0)return{newFormulaData:{},oldFormulaData:{}};const o={},u={};for(const c of i){const s=e[c];if(s==null)continue;const l=Object.keys(s);f.Tools.isDefine(o[c])||(o[c]={}),f.Tools.isDefine(u[c])||(u[c]={});for(const d of l){const L=new f.ObjectMatrix(s[d]||{}),T=new f.ObjectMatrix;L.forValue((A,S,C)=>{var D;if(!C)return!0;const{f:p,x:N,y:I,si:P}=C,_=this._lexerTreeBuilder.sequenceNodesBuilder(p);if(_==null)return!0;let R=!1;const x=[];for(let y=0,M=_.length;y<M;y++){const U=_[y];if(typeof U=="string")continue;const{token:F,nodeType:O}=U,{type:v}=n;if((v===b.SetDefinedName||v===b.RemoveDefinedName)&&(O===t.sequenceNodeType.DEFINED_NAME||O===t.sequenceNodeType.FUNCTION)){const{definedNameId:Z,definedName:J}=n;if(Z===void 0||J===void 0)continue;const Q=this._definedNamesService.getValueById(c,Z);if(Q==null||Q.name!==F)continue;_[y]={...U,token:v===b.SetDefinedName?J:t.ErrorType.REF},R=!0,x.push(y);continue}else if(O!==t.sequenceNodeType.REFERENCE)continue;const $=t.deserializeRangeWithSheetWithCache(F),{range:z,sheetName:w,unitId:B}=$,W=B==null||B.length===0?c:B,G=((D=a==null?void 0:a[W])==null?void 0:D[w])||"";if(!yt(n.unitId,n.sheetId,c,d,B,G))continue;const Nt={range:z,sheetId:G,unitId:B,sheetName:w,refOffsetX:N||0,refOffsetY:I||0};let K=null;if(v===b.SetName){const{unitId:Z,sheetId:J,sheetName:Q}=n;if(Q==null||G==null||G.length===0||J!==G)continue;K=t.serializeRangeToRefString({range:z,sheetName:Q,unitId:B})}else if(v===b.RemoveSheet){const{unitId:Z,sheetId:J,sheetName:Q}=n;if(G==null||G.length===0||J!==G)continue;K=t.ErrorType.REF}else v!==b.SetDefinedName&&(K=Ut(Nt,n,c,d));K!=null&&(_[y]={...U,token:K},R=!0,x.push(y))}if(!R)return!0;const q=xt(_,x,N,I);T.setValue(A,S,{f:`=${t.generateStringWithSequence(q)}`})}),u[c]&&(u[c][d]=T.getData())}}return{newFormulaData:u}}},E.UpdateFormulaController=Ve([X(0,f.IUniverInstanceService),X(1,f.ICommandService),X(2,f.Inject(t.LexerTreeBuilder)),X(3,f.Inject(t.FormulaDataModel)),X(4,f.Inject(m.SheetInterceptorService)),X(5,t.IDefinedNamesService),X(6,f.IConfigService),X(7,f.Inject(f.Injector))],E.UpdateFormulaController);const Ge=[{functionName:t.FUNCTION_NAMES_ARRAY.ARRAY_CONSTRAIN,functionType:t.FunctionType.Array,description:"formula.functionList.ARRAY_CONSTRAIN.description",abstract:"formula.functionList.ARRAY_CONSTRAIN.abstract",functionParameter:[{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.name",detail:"formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ARRAY.FLATTEN,functionType:t.FunctionType.Array,description:"formula.functionList.FLATTEN.description",abstract:"formula.functionList.FLATTEN.abstract",functionParameter:[{name:"formula.functionList.FLATTEN.functionParameter.range1.name",detail:"formula.functionList.FLATTEN.functionParameter.range1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.FLATTEN.functionParameter.range2.name",detail:"formula.functionList.FLATTEN.functionParameter.range2.detail",example:"D1:F3",require:0,repeat:1}]}],He=[{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETADIST.description",abstract:"formula.functionList.BETADIST.abstract",functionParameter:[{name:"formula.functionList.BETADIST.functionParameter.x.name",detail:"formula.functionList.BETADIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.alpha.name",detail:"formula.functionList.BETADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.beta.name",detail:"formula.functionList.BETADIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.A.name",detail:"formula.functionList.BETADIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETADIST.functionParameter.B.name",detail:"formula.functionList.BETADIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BETAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BETAINV.description",abstract:"formula.functionList.BETAINV.abstract",functionParameter:[{name:"formula.functionList.BETAINV.functionParameter.probability.name",detail:"formula.functionList.BETAINV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.alpha.name",detail:"formula.functionList.BETAINV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.beta.name",detail:"formula.functionList.BETAINV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.A.name",detail:"formula.functionList.BETAINV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETAINV.functionParameter.B.name",detail:"formula.functionList.BETAINV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.BINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.BINOMDIST.description",abstract:"formula.functionList.BINOMDIST.abstract",functionParameter:[{name:"formula.functionList.BINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.BINOMDIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.trials.name",detail:"formula.functionList.BINOMDIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOMDIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOMDIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOMDIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIDIST.description",abstract:"formula.functionList.CHIDIST.abstract",functionParameter:[{name:"formula.functionList.CHIDIST.functionParameter.x.name",detail:"formula.functionList.CHIDIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHIDIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHIDIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHIINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHIINV.description",abstract:"formula.functionList.CHIINV.abstract",functionParameter:[{name:"formula.functionList.CHIINV.functionParameter.probability.name",detail:"formula.functionList.CHIINV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHIINV.functionParameter.degFreedom.name",detail:"formula.functionList.CHIINV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CHITEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CHITEST.description",abstract:"formula.functionList.CHITEST.abstract",functionParameter:[{name:"formula.functionList.CHITEST.functionParameter.actualRange.name",detail:"formula.functionList.CHITEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHITEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHITEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CONFIDENCE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CONFIDENCE.description",abstract:"formula.functionList.CONFIDENCE.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.COVAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.COVAR.description",abstract:"formula.functionList.COVAR.abstract",functionParameter:[{name:"formula.functionList.COVAR.functionParameter.array1.name",detail:"formula.functionList.COVAR.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVAR.functionParameter.array2.name",detail:"formula.functionList.COVAR.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.CRITBINOM,functionType:t.FunctionType.Compatibility,description:"formula.functionList.CRITBINOM.description",abstract:"formula.functionList.CRITBINOM.abstract",functionParameter:[{name:"formula.functionList.CRITBINOM.functionParameter.trials.name",detail:"formula.functionList.CRITBINOM.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.probabilityS.name",detail:"formula.functionList.CRITBINOM.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CRITBINOM.functionParameter.alpha.name",detail:"formula.functionList.CRITBINOM.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.EXPONDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.EXPONDIST.description",abstract:"formula.functionList.EXPONDIST.abstract",functionParameter:[{name:"formula.functionList.EXPONDIST.functionParameter.x.name",detail:"formula.functionList.EXPONDIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.lambda.name",detail:"formula.functionList.EXPONDIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPONDIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPONDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FDIST.description",abstract:"formula.functionList.FDIST.abstract",functionParameter:[{name:"formula.functionList.FDIST.functionParameter.x.name",detail:"formula.functionList.FDIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom1.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FDIST.functionParameter.degFreedom2.name",detail:"formula.functionList.FDIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FINV.description",abstract:"formula.functionList.FINV.abstract",functionParameter:[{name:"formula.functionList.FINV.functionParameter.probability.name",detail:"formula.functionList.FINV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom1.name",detail:"formula.functionList.FINV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.FINV.functionParameter.degFreedom2.name",detail:"formula.functionList.FINV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.FTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.FTEST.description",abstract:"formula.functionList.FTEST.abstract",functionParameter:[{name:"formula.functionList.FTEST.functionParameter.array1.name",detail:"formula.functionList.FTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FTEST.functionParameter.array2.name",detail:"formula.functionList.FTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMADIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMADIST.description",abstract:"formula.functionList.GAMMADIST.abstract",functionParameter:[{name:"formula.functionList.GAMMADIST.functionParameter.x.name",detail:"formula.functionList.GAMMADIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMADIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.beta.name",detail:"formula.functionList.GAMMADIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMADIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMADIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.GAMMAINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.GAMMAINV.description",abstract:"formula.functionList.GAMMAINV.abstract",functionParameter:[{name:"formula.functionList.GAMMAINV.functionParameter.probability.name",detail:"formula.functionList.GAMMAINV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.alpha.name",detail:"formula.functionList.GAMMAINV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMAINV.functionParameter.beta.name",detail:"formula.functionList.GAMMAINV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.HYPGEOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.HYPGEOMDIST.description",abstract:"formula.functionList.HYPGEOMDIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOMDIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGINV.description",abstract:"formula.functionList.LOGINV.abstract",functionParameter:[{name:"formula.functionList.LOGINV.functionParameter.probability.name",detail:"formula.functionList.LOGINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.mean.name",detail:"formula.functionList.LOGINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGINV.functionParameter.standardDev.name",detail:"formula.functionList.LOGINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.LOGNORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.LOGNORMDIST.description",abstract:"formula.functionList.LOGNORMDIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORMDIST.functionParameter.x.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.MODE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.MODE.description",abstract:"formula.functionList.MODE.abstract",functionParameter:[{name:"formula.functionList.MODE.functionParameter.number1.name",detail:"formula.functionList.MODE.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE.functionParameter.number2.name",detail:"formula.functionList.MODE.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NEGBINOMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NEGBINOMDIST.description",abstract:"formula.functionList.NEGBINOMDIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMDIST.description",abstract:"formula.functionList.NORMDIST.abstract",functionParameter:[{name:"formula.functionList.NORMDIST.functionParameter.x.name",detail:"formula.functionList.NORMDIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.mean.name",detail:"formula.functionList.NORMDIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.standardDev.name",detail:"formula.functionList.NORMDIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORMDIST.functionParameter.cumulative.name",detail:"formula.functionList.NORMDIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMINV.description",abstract:"formula.functionList.NORMINV.abstract",functionParameter:[{name:"formula.functionList.NORMINV.functionParameter.probability.name",detail:"formula.functionList.NORMINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.mean.name",detail:"formula.functionList.NORMINV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORMINV.functionParameter.standardDev.name",detail:"formula.functionList.NORMINV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSDIST.description",abstract:"formula.functionList.NORMSDIST.abstract",functionParameter:[{name:"formula.functionList.NORMSDIST.functionParameter.z.name",detail:"formula.functionList.NORMSDIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.NORMSINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.NORMSINV.description",abstract:"formula.functionList.NORMSINV.abstract",functionParameter:[{name:"formula.functionList.NORMSINV.functionParameter.probability.name",detail:"formula.functionList.NORMSINV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTILE.description",abstract:"formula.functionList.PERCENTILE.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE.functionParameter.array.name",detail:"formula.functionList.PERCENTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE.functionParameter.k.name",detail:"formula.functionList.PERCENTILE.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.PERCENTRANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.PERCENTRANK.description",abstract:"formula.functionList.PERCENTRANK.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.POISSON,functionType:t.FunctionType.Compatibility,description:"formula.functionList.POISSON.description",abstract:"formula.functionList.POISSON.abstract",functionParameter:[{name:"formula.functionList.POISSON.functionParameter.x.name",detail:"formula.functionList.POISSON.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.mean.name",detail:"formula.functionList.POISSON.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON.functionParameter.cumulative.name",detail:"formula.functionList.POISSON.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.QUARTILE,functionType:t.FunctionType.Compatibility,description:"formula.functionList.QUARTILE.description",abstract:"formula.functionList.QUARTILE.abstract",functionParameter:[{name:"formula.functionList.QUARTILE.functionParameter.array.name",detail:"formula.functionList.QUARTILE.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE.functionParameter.quart.name",detail:"formula.functionList.QUARTILE.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.RANK,functionType:t.FunctionType.Compatibility,description:"formula.functionList.RANK.description",abstract:"formula.functionList.RANK.abstract",functionParameter:[{name:"formula.functionList.RANK.functionParameter.number.name",detail:"formula.functionList.RANK.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.ref.name",detail:"formula.functionList.RANK.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK.functionParameter.order.name",detail:"formula.functionList.RANK.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEV.description",abstract:"formula.functionList.STDEV.abstract",functionParameter:[{name:"formula.functionList.STDEV.functionParameter.number1.name",detail:"formula.functionList.STDEV.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV.functionParameter.number2.name",detail:"formula.functionList.STDEV.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.STDEVP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.STDEVP.description",abstract:"formula.functionList.STDEVP.abstract",functionParameter:[{name:"formula.functionList.STDEVP.functionParameter.number1.name",detail:"formula.functionList.STDEVP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVP.functionParameter.number2.name",detail:"formula.functionList.STDEVP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TDIST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TDIST.description",abstract:"formula.functionList.TDIST.abstract",functionParameter:[{name:"formula.functionList.TDIST.functionParameter.x.name",detail:"formula.functionList.TDIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.degFreedom.name",detail:"formula.functionList.TDIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.TDIST.functionParameter.tails.name",detail:"formula.functionList.TDIST.functionParameter.tails.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TINV,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TINV.description",abstract:"formula.functionList.TINV.abstract",functionParameter:[{name:"formula.functionList.TINV.functionParameter.probability.name",detail:"formula.functionList.TINV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.TINV.functionParameter.degFreedom.name",detail:"formula.functionList.TINV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.TTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.TTEST.description",abstract:"formula.functionList.TTEST.abstract",functionParameter:[{name:"formula.functionList.TTEST.functionParameter.array1.name",detail:"formula.functionList.TTEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.array2.name",detail:"formula.functionList.TTEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.tails.name",detail:"formula.functionList.TTEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TTEST.functionParameter.type.name",detail:"formula.functionList.TTEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VAR,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VAR.description",abstract:"formula.functionList.VAR.abstract",functionParameter:[{name:"formula.functionList.VAR.functionParameter.number1.name",detail:"formula.functionList.VAR.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR.functionParameter.number2.name",detail:"formula.functionList.VAR.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.VARP,functionType:t.FunctionType.Compatibility,description:"formula.functionList.VARP.description",abstract:"formula.functionList.VARP.abstract",functionParameter:[{name:"formula.functionList.VARP.functionParameter.number1.name",detail:"formula.functionList.VARP.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARP.functionParameter.number2.name",detail:"formula.functionList.VARP.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.WEIBULL,functionType:t.FunctionType.Compatibility,description:"formula.functionList.WEIBULL.description",abstract:"formula.functionList.WEIBULL.abstract",functionParameter:[{name:"formula.functionList.WEIBULL.functionParameter.x.name",detail:"formula.functionList.WEIBULL.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.beta.name",detail:"formula.functionList.WEIBULL.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_COMPATIBILITY.ZTEST,functionType:t.FunctionType.Compatibility,description:"formula.functionList.ZTEST.description",abstract:"formula.functionList.ZTEST.abstract",functionParameter:[{name:"formula.functionList.ZTEST.functionParameter.array.name",detail:"formula.functionList.ZTEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.x.name",detail:"formula.functionList.ZTEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ZTEST.functionParameter.sigma.name",detail:"formula.functionList.ZTEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],Ye=[{functionName:t.FUNCTION_NAMES_CUBE.CUBEKPIMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEKPIMEMBER.description",abstract:"formula.functionList.CUBEKPIMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEKPIMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBER.description",abstract:"formula.functionList.CUBEMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEMEMBERPROPERTY,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEMEMBERPROPERTY.description",abstract:"formula.functionList.CUBEMEMBERPROPERTY.abstract",functionParameter:[{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.name",detail:"formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBERANKEDMEMBER,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBERANKEDMEMBER.description",abstract:"formula.functionList.CUBERANKEDMEMBER.abstract",functionParameter:[{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.name",detail:"formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESET,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESET.description",abstract:"formula.functionList.CUBESET.abstract",functionParameter:[{name:"formula.functionList.CUBESET.functionParameter.number1.name",detail:"formula.functionList.CUBESET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESET.functionParameter.number2.name",detail:"formula.functionList.CUBESET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBESETCOUNT,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBESETCOUNT.description",abstract:"formula.functionList.CUBESETCOUNT.abstract",functionParameter:[{name:"formula.functionList.CUBESETCOUNT.functionParameter.number1.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBESETCOUNT.functionParameter.number2.name",detail:"formula.functionList.CUBESETCOUNT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_CUBE.CUBEVALUE,functionType:t.FunctionType.Cube,description:"formula.functionList.CUBEVALUE.description",abstract:"formula.functionList.CUBEVALUE.abstract",functionParameter:[{name:"formula.functionList.CUBEVALUE.functionParameter.number1.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CUBEVALUE.functionParameter.number2.name",detail:"formula.functionList.CUBEVALUE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],Xe=[{functionName:t.FUNCTION_NAMES_DATABASE.DAVERAGE,functionType:t.FunctionType.Database,description:"formula.functionList.DAVERAGE.description",abstract:"formula.functionList.DAVERAGE.abstract",functionParameter:[{name:"formula.functionList.DAVERAGE.functionParameter.database.name",detail:"formula.functionList.DAVERAGE.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.field.name",detail:"formula.functionList.DAVERAGE.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DAVERAGE.functionParameter.criteria.name",detail:"formula.functionList.DAVERAGE.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNT,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNT.description",abstract:"formula.functionList.DCOUNT.abstract",functionParameter:[{name:"formula.functionList.DCOUNT.functionParameter.database.name",detail:"formula.functionList.DCOUNT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.field.name",detail:"formula.functionList.DCOUNT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNT.functionParameter.criteria.name",detail:"formula.functionList.DCOUNT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DCOUNTA,functionType:t.FunctionType.Database,description:"formula.functionList.DCOUNTA.description",abstract:"formula.functionList.DCOUNTA.abstract",functionParameter:[{name:"formula.functionList.DCOUNTA.functionParameter.database.name",detail:"formula.functionList.DCOUNTA.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.field.name",detail:"formula.functionList.DCOUNTA.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DCOUNTA.functionParameter.criteria.name",detail:"formula.functionList.DCOUNTA.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DGET,functionType:t.FunctionType.Database,description:"formula.functionList.DGET.description",abstract:"formula.functionList.DGET.abstract",functionParameter:[{name:"formula.functionList.DGET.functionParameter.database.name",detail:"formula.functionList.DGET.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.field.name",detail:"formula.functionList.DGET.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DGET.functionParameter.criteria.name",detail:"formula.functionList.DGET.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMAX,functionType:t.FunctionType.Database,description:"formula.functionList.DMAX.description",abstract:"formula.functionList.DMAX.abstract",functionParameter:[{name:"formula.functionList.DMAX.functionParameter.database.name",detail:"formula.functionList.DMAX.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.field.name",detail:"formula.functionList.DMAX.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMAX.functionParameter.criteria.name",detail:"formula.functionList.DMAX.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DMIN,functionType:t.FunctionType.Database,description:"formula.functionList.DMIN.description",abstract:"formula.functionList.DMIN.abstract",functionParameter:[{name:"formula.functionList.DMIN.functionParameter.database.name",detail:"formula.functionList.DMIN.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.field.name",detail:"formula.functionList.DMIN.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DMIN.functionParameter.criteria.name",detail:"formula.functionList.DMIN.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DPRODUCT,functionType:t.FunctionType.Database,description:"formula.functionList.DPRODUCT.description",abstract:"formula.functionList.DPRODUCT.abstract",functionParameter:[{name:"formula.functionList.DPRODUCT.functionParameter.database.name",detail:"formula.functionList.DPRODUCT.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.field.name",detail:"formula.functionList.DPRODUCT.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DPRODUCT.functionParameter.criteria.name",detail:"formula.functionList.DPRODUCT.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEV,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEV.description",abstract:"formula.functionList.DSTDEV.abstract",functionParameter:[{name:"formula.functionList.DSTDEV.functionParameter.database.name",detail:"formula.functionList.DSTDEV.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.field.name",detail:"formula.functionList.DSTDEV.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEV.functionParameter.criteria.name",detail:"formula.functionList.DSTDEV.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSTDEVP,functionType:t.FunctionType.Database,description:"formula.functionList.DSTDEVP.description",abstract:"formula.functionList.DSTDEVP.abstract",functionParameter:[{name:"formula.functionList.DSTDEVP.functionParameter.database.name",detail:"formula.functionList.DSTDEVP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.field.name",detail:"formula.functionList.DSTDEVP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSTDEVP.functionParameter.criteria.name",detail:"formula.functionList.DSTDEVP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DSUM,functionType:t.FunctionType.Database,description:"formula.functionList.DSUM.description",abstract:"formula.functionList.DSUM.abstract",functionParameter:[{name:"formula.functionList.DSUM.functionParameter.database.name",detail:"formula.functionList.DSUM.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.field.name",detail:"formula.functionList.DSUM.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DSUM.functionParameter.criteria.name",detail:"formula.functionList.DSUM.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVAR,functionType:t.FunctionType.Database,description:"formula.functionList.DVAR.description",abstract:"formula.functionList.DVAR.abstract",functionParameter:[{name:"formula.functionList.DVAR.functionParameter.database.name",detail:"formula.functionList.DVAR.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.field.name",detail:"formula.functionList.DVAR.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVAR.functionParameter.criteria.name",detail:"formula.functionList.DVAR.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATABASE.DVARP,functionType:t.FunctionType.Database,description:"formula.functionList.DVARP.description",abstract:"formula.functionList.DVARP.abstract",functionParameter:[{name:"formula.functionList.DVARP.functionParameter.database.name",detail:"formula.functionList.DVARP.functionParameter.database.detail",example:"A4:E10",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.field.name",detail:"formula.functionList.DVARP.functionParameter.field.detail",example:"D4",require:1,repeat:0},{name:"formula.functionList.DVARP.functionParameter.criteria.name",detail:"formula.functionList.DVARP.functionParameter.criteria.detail",example:"A1:B2",require:1,repeat:0}]}],we=[{functionName:t.FUNCTION_NAMES_DATE.DATE,functionType:t.FunctionType.Date,description:"formula.functionList.DATE.description",abstract:"formula.functionList.DATE.abstract",functionParameter:[{name:"formula.functionList.DATE.functionParameter.year.name",detail:"formula.functionList.DATE.functionParameter.year.detail",example:"2024",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.month.name",detail:"formula.functionList.DATE.functionParameter.month.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DATE.functionParameter.day.name",detail:"formula.functionList.DATE.functionParameter.day.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEDIF,functionType:t.FunctionType.Date,description:"formula.functionList.DATEDIF.description",abstract:"formula.functionList.DATEDIF.abstract",functionParameter:[{name:"formula.functionList.DATEDIF.functionParameter.startDate.name",detail:"formula.functionList.DATEDIF.functionParameter.startDate.detail",example:'"2001-6-1"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.endDate.name",detail:"formula.functionList.DATEDIF.functionParameter.endDate.detail",example:'"2002-8-15"',require:1,repeat:0},{name:"formula.functionList.DATEDIF.functionParameter.method.name",detail:"formula.functionList.DATEDIF.functionParameter.method.detail",example:'"D"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DATEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.DATEVALUE.description",abstract:"formula.functionList.DATEVALUE.abstract",functionParameter:[{name:"formula.functionList.DATEVALUE.functionParameter.dateText.name",detail:"formula.functionList.DATEVALUE.functionParameter.dateText.detail",example:'"2024-8-8"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAY,functionType:t.FunctionType.Date,description:"formula.functionList.DAY.description",abstract:"formula.functionList.DAY.abstract",functionParameter:[{name:"formula.functionList.DAY.functionParameter.serialNumber.name",detail:"formula.functionList.DAY.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS.description",abstract:"formula.functionList.DAYS.abstract",functionParameter:[{name:"formula.functionList.DAYS.functionParameter.endDate.name",detail:"formula.functionList.DAYS.functionParameter.endDate.detail",example:'"2021-12-31"',require:1,repeat:0},{name:"formula.functionList.DAYS.functionParameter.startDate.name",detail:"formula.functionList.DAYS.functionParameter.startDate.detail",example:'"2021-1-1"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.DAYS360,functionType:t.FunctionType.Date,description:"formula.functionList.DAYS360.description",abstract:"formula.functionList.DAYS360.abstract",functionParameter:[{name:"formula.functionList.DAYS360.functionParameter.startDate.name",detail:"formula.functionList.DAYS360.functionParameter.startDate.detail",example:'"2021-1-29"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.endDate.name",detail:"formula.functionList.DAYS360.functionParameter.endDate.detail",example:'"2021-3-31"',require:1,repeat:0},{name:"formula.functionList.DAYS360.functionParameter.method.name",detail:"formula.functionList.DAYS360.functionParameter.method.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EDATE,functionType:t.FunctionType.Date,description:"formula.functionList.EDATE.description",abstract:"formula.functionList.EDATE.abstract",functionParameter:[{name:"formula.functionList.EDATE.functionParameter.startDate.name",detail:"formula.functionList.EDATE.functionParameter.startDate.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.EDATE.functionParameter.months.name",detail:"formula.functionList.EDATE.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EOMONTH,functionType:t.FunctionType.Date,description:"formula.functionList.EOMONTH.description",abstract:"formula.functionList.EOMONTH.abstract",functionParameter:[{name:"formula.functionList.EOMONTH.functionParameter.startDate.name",detail:"formula.functionList.EOMONTH.functionParameter.startDate.detail",example:'"2011-1-1"',require:1,repeat:0},{name:"formula.functionList.EOMONTH.functionParameter.months.name",detail:"formula.functionList.EOMONTH.functionParameter.months.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.EPOCHTODATE,functionType:t.FunctionType.Date,description:"formula.functionList.EPOCHTODATE.description",abstract:"formula.functionList.EPOCHTODATE.abstract",functionParameter:[{name:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.timestamp.detail",example:"1655906710",require:1,repeat:0},{name:"formula.functionList.EPOCHTODATE.functionParameter.unit.name",detail:"formula.functionList.EPOCHTODATE.functionParameter.unit.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.HOUR,functionType:t.FunctionType.Date,description:"formula.functionList.HOUR.description",abstract:"formula.functionList.HOUR.abstract",functionParameter:[{name:"formula.functionList.HOUR.functionParameter.serialNumber.name",detail:"formula.functionList.HOUR.functionParameter.serialNumber.detail",example:'"2011-7-18 7:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.ISOWEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.ISOWEEKNUM.description",abstract:"formula.functionList.ISOWEEKNUM.abstract",functionParameter:[{name:"formula.functionList.ISOWEEKNUM.functionParameter.date.name",detail:"formula.functionList.ISOWEEKNUM.functionParameter.date.detail",example:'"2012-3-9"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MINUTE,functionType:t.FunctionType.Date,description:"formula.functionList.MINUTE.description",abstract:"formula.functionList.MINUTE.abstract",functionParameter:[{name:"formula.functionList.MINUTE.functionParameter.serialNumber.name",detail:"formula.functionList.MINUTE.functionParameter.serialNumber.detail",example:'"12:45"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.MONTH,functionType:t.FunctionType.Date,description:"formula.functionList.MONTH.description",abstract:"formula.functionList.MONTH.abstract",functionParameter:[{name:"formula.functionList.MONTH.functionParameter.serialNumber.name",detail:"formula.functionList.MONTH.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS.description",abstract:"formula.functionList.NETWORKDAYS.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NETWORKDAYS_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.NETWORKDAYS_INTL.description",abstract:"formula.functionList.NETWORKDAYS_INTL.abstract",functionParameter:[{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.detail",example:'"2012-10-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.detail",example:'"2013-3-1"',require:1,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.name",detail:"formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.detail",example:'"2012-11-22"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.NOW,functionType:t.FunctionType.Date,description:"formula.functionList.NOW.description",abstract:"formula.functionList.NOW.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.SECOND,functionType:t.FunctionType.Date,description:"formula.functionList.SECOND.description",abstract:"formula.functionList.SECOND.abstract",functionParameter:[{name:"formula.functionList.SECOND.functionParameter.serialNumber.name",detail:"formula.functionList.SECOND.functionParameter.serialNumber.detail",example:'"4:48:18"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIME,functionType:t.FunctionType.Date,description:"formula.functionList.TIME.description",abstract:"formula.functionList.TIME.abstract",functionParameter:[{name:"formula.functionList.TIME.functionParameter.hour.name",detail:"formula.functionList.TIME.functionParameter.hour.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.minute.name",detail:"formula.functionList.TIME.functionParameter.minute.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.TIME.functionParameter.second.name",detail:"formula.functionList.TIME.functionParameter.second.detail",example:"59",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TIMEVALUE,functionType:t.FunctionType.Date,description:"formula.functionList.TIMEVALUE.description",abstract:"formula.functionList.TIMEVALUE.abstract",functionParameter:[{name:"formula.functionList.TIMEVALUE.functionParameter.timeText.name",detail:"formula.functionList.TIMEVALUE.functionParameter.timeText.detail",example:'"15:20:59"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TO_DATE,functionType:t.FunctionType.Date,description:"formula.functionList.TO_DATE.description",abstract:"formula.functionList.TO_DATE.abstract",functionParameter:[{name:"formula.functionList.TO_DATE.functionParameter.value.name",detail:"formula.functionList.TO_DATE.functionParameter.value.detail",example:"40826.4375",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.TODAY,functionType:t.FunctionType.Date,description:"formula.functionList.TODAY.description",abstract:"formula.functionList.TODAY.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_DATE.WEEKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKDAY.description",abstract:"formula.functionList.WEEKDAY.abstract",functionParameter:[{name:"formula.functionList.WEEKDAY.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKDAY.functionParameter.serialNumber.detail",example:'"2008-2-14"',require:1,repeat:0},{name:"formula.functionList.WEEKDAY.functionParameter.returnType.name",detail:"formula.functionList.WEEKDAY.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WEEKNUM,functionType:t.FunctionType.Date,description:"formula.functionList.WEEKNUM.description",abstract:"formula.functionList.WEEKNUM.abstract",functionParameter:[{name:"formula.functionList.WEEKNUM.functionParameter.serialNumber.name",detail:"formula.functionList.WEEKNUM.functionParameter.serialNumber.detail",example:'"2012-3-9"',require:1,repeat:0},{name:"formula.functionList.WEEKNUM.functionParameter.returnType.name",detail:"formula.functionList.WEEKNUM.functionParameter.returnType.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY.description",abstract:"formula.functionList.WORKDAY.abstract",functionParameter:[{name:"formula.functionList.WORKDAY.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.days.name",detail:"formula.functionList.WORKDAY.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.WORKDAY_INTL,functionType:t.FunctionType.Date,description:"formula.functionList.WORKDAY_INTL.description",abstract:"formula.functionList.WORKDAY_INTL.abstract",functionParameter:[{name:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.startDate.detail",example:'"2008-10-1"',require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.days.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.days.detail",example:"151",require:1,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.weekend.detail",example:"6",require:0,repeat:0},{name:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.name",detail:"formula.functionList.WORKDAY_INTL.functionParameter.holidays.detail",example:'"2008-11-26"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEAR,functionType:t.FunctionType.Date,description:"formula.functionList.YEAR.description",abstract:"formula.functionList.YEAR.abstract",functionParameter:[{name:"formula.functionList.YEAR.functionParameter.serialNumber.name",detail:"formula.functionList.YEAR.functionParameter.serialNumber.detail",example:'"1969-7-20"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_DATE.YEARFRAC,functionType:t.FunctionType.Date,description:"formula.functionList.YEARFRAC.description",abstract:"formula.functionList.YEARFRAC.abstract",functionParameter:[{name:"formula.functionList.YEARFRAC.functionParameter.startDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.startDate.detail",example:'"2012-1-1"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.endDate.name",detail:"formula.functionList.YEARFRAC.functionParameter.endDate.detail",example:'"2012-7-30"',require:1,repeat:0},{name:"formula.functionList.YEARFRAC.functionParameter.basis.name",detail:"formula.functionList.YEARFRAC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],We=[{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELI,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELI.description",abstract:"formula.functionList.BESSELI.abstract",functionParameter:[{name:"formula.functionList.BESSELI.functionParameter.x.name",detail:"formula.functionList.BESSELI.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELI.functionParameter.n.name",detail:"formula.functionList.BESSELI.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELJ,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELJ.description",abstract:"formula.functionList.BESSELJ.abstract",functionParameter:[{name:"formula.functionList.BESSELJ.functionParameter.x.name",detail:"formula.functionList.BESSELJ.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELJ.functionParameter.n.name",detail:"formula.functionList.BESSELJ.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELK,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELK.description",abstract:"formula.functionList.BESSELK.abstract",functionParameter:[{name:"formula.functionList.BESSELK.functionParameter.x.name",detail:"formula.functionList.BESSELK.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELK.functionParameter.n.name",detail:"formula.functionList.BESSELK.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BESSELY,functionType:t.FunctionType.Engineering,description:"formula.functionList.BESSELY.description",abstract:"formula.functionList.BESSELY.abstract",functionParameter:[{name:"formula.functionList.BESSELY.functionParameter.x.name",detail:"formula.functionList.BESSELY.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.BESSELY.functionParameter.n.name",detail:"formula.functionList.BESSELY.functionParameter.n.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2DEC.description",abstract:"formula.functionList.BIN2DEC.abstract",functionParameter:[{name:"formula.functionList.BIN2DEC.functionParameter.number.name",detail:"formula.functionList.BIN2DEC.functionParameter.number.detail",example:"1100100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2HEX.description",abstract:"formula.functionList.BIN2HEX.abstract",functionParameter:[{name:"formula.functionList.BIN2HEX.functionParameter.number.name",detail:"formula.functionList.BIN2HEX.functionParameter.number.detail",example:"11111011",require:1,repeat:0},{name:"formula.functionList.BIN2HEX.functionParameter.places.name",detail:"formula.functionList.BIN2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BIN2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BIN2OCT.description",abstract:"formula.functionList.BIN2OCT.abstract",functionParameter:[{name:"formula.functionList.BIN2OCT.functionParameter.number.name",detail:"formula.functionList.BIN2OCT.functionParameter.number.detail",example:"1001",require:1,repeat:0},{name:"formula.functionList.BIN2OCT.functionParameter.places.name",detail:"formula.functionList.BIN2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITAND,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITAND.description",abstract:"formula.functionList.BITAND.abstract",functionParameter:[{name:"formula.functionList.BITAND.functionParameter.number1.name",detail:"formula.functionList.BITAND.functionParameter.number1.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITAND.functionParameter.number2.name",detail:"formula.functionList.BITAND.functionParameter.number2.detail",example:"25",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITLSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITLSHIFT.description",abstract:"formula.functionList.BITLSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITLSHIFT.functionParameter.number.name",detail:"formula.functionList.BITLSHIFT.functionParameter.number.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITLSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITOR.description",abstract:"formula.functionList.BITOR.abstract",functionParameter:[{name:"formula.functionList.BITOR.functionParameter.number1.name",detail:"formula.functionList.BITOR.functionParameter.number1.detail",example:"23",require:1,repeat:0},{name:"formula.functionList.BITOR.functionParameter.number2.name",detail:"formula.functionList.BITOR.functionParameter.number2.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITRSHIFT,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITRSHIFT.description",abstract:"formula.functionList.BITRSHIFT.abstract",functionParameter:[{name:"formula.functionList.BITRSHIFT.functionParameter.number.name",detail:"formula.functionList.BITRSHIFT.functionParameter.number.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.name",detail:"formula.functionList.BITRSHIFT.functionParameter.shiftAmount.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.BITXOR,functionType:t.FunctionType.Engineering,description:"formula.functionList.BITXOR.description",abstract:"formula.functionList.BITXOR.abstract",functionParameter:[{name:"formula.functionList.BITXOR.functionParameter.number1.name",detail:"formula.functionList.BITXOR.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.BITXOR.functionParameter.number2.name",detail:"formula.functionList.BITXOR.functionParameter.number2.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.COMPLEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.COMPLEX.description",abstract:"formula.functionList.COMPLEX.abstract",functionParameter:[{name:"formula.functionList.COMPLEX.functionParameter.realNum.name",detail:"formula.functionList.COMPLEX.functionParameter.realNum.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.iNum.name",detail:"formula.functionList.COMPLEX.functionParameter.iNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.COMPLEX.functionParameter.suffix.name",detail:"formula.functionList.COMPLEX.functionParameter.suffix.detail",example:'"i"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.CONVERT,functionType:t.FunctionType.Engineering,description:"formula.functionList.CONVERT.description",abstract:"formula.functionList.CONVERT.abstract",functionParameter:[{name:"formula.functionList.CONVERT.functionParameter.number.name",detail:"formula.functionList.CONVERT.functionParameter.number.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.fromUnit.name",detail:"formula.functionList.CONVERT.functionParameter.fromUnit.detail",example:'"lbm"',require:1,repeat:0},{name:"formula.functionList.CONVERT.functionParameter.toUnit.name",detail:"formula.functionList.CONVERT.functionParameter.toUnit.detail",example:'"kg"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2BIN.description",abstract:"formula.functionList.DEC2BIN.abstract",functionParameter:[{name:"formula.functionList.DEC2BIN.functionParameter.number.name",detail:"formula.functionList.DEC2BIN.functionParameter.number.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.DEC2BIN.functionParameter.places.name",detail:"formula.functionList.DEC2BIN.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2HEX.description",abstract:"formula.functionList.DEC2HEX.abstract",functionParameter:[{name:"formula.functionList.DEC2HEX.functionParameter.number.name",detail:"formula.functionList.DEC2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DEC2HEX.functionParameter.places.name",detail:"formula.functionList.DEC2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DEC2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.DEC2OCT.description",abstract:"formula.functionList.DEC2OCT.abstract",functionParameter:[{name:"formula.functionList.DEC2OCT.functionParameter.number.name",detail:"formula.functionList.DEC2OCT.functionParameter.number.detail",example:"58",require:1,repeat:0},{name:"formula.functionList.DEC2OCT.functionParameter.places.name",detail:"formula.functionList.DEC2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.DELTA,functionType:t.FunctionType.Engineering,description:"formula.functionList.DELTA.description",abstract:"formula.functionList.DELTA.abstract",functionParameter:[{name:"formula.functionList.DELTA.functionParameter.number1.name",detail:"formula.functionList.DELTA.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.DELTA.functionParameter.number2.name",detail:"formula.functionList.DELTA.functionParameter.number2.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF.description",abstract:"formula.functionList.ERF.abstract",functionParameter:[{name:"formula.functionList.ERF.functionParameter.lowerLimit.name",detail:"formula.functionList.ERF.functionParameter.lowerLimit.detail",example:"0.745",require:1,repeat:0},{name:"formula.functionList.ERF.functionParameter.upperLimit.name",detail:"formula.functionList.ERF.functionParameter.upperLimit.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERF_PRECISE.description",abstract:"formula.functionList.ERF_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERF_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERF_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC.description",abstract:"formula.functionList.ERFC.abstract",functionParameter:[{name:"formula.functionList.ERFC.functionParameter.x.name",detail:"formula.functionList.ERFC.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,functionType:t.FunctionType.Engineering,description:"formula.functionList.ERFC_PRECISE.description",abstract:"formula.functionList.ERFC_PRECISE.abstract",functionParameter:[{name:"formula.functionList.ERFC_PRECISE.functionParameter.x.name",detail:"formula.functionList.ERFC_PRECISE.functionParameter.x.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.GESTEP,functionType:t.FunctionType.Engineering,description:"formula.functionList.GESTEP.description",abstract:"formula.functionList.GESTEP.abstract",functionParameter:[{name:"formula.functionList.GESTEP.functionParameter.number.name",detail:"formula.functionList.GESTEP.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GESTEP.functionParameter.step.name",detail:"formula.functionList.GESTEP.functionParameter.step.detail",example:"4",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2BIN.description",abstract:"formula.functionList.HEX2BIN.abstract",functionParameter:[{name:"formula.functionList.HEX2BIN.functionParameter.number.name",detail:"formula.functionList.HEX2BIN.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2BIN.functionParameter.places.name",detail:"formula.functionList.HEX2BIN.functionParameter.places.detail",example:"8",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2DEC.description",abstract:"formula.functionList.HEX2DEC.abstract",functionParameter:[{name:"formula.functionList.HEX2DEC.functionParameter.number.name",detail:"formula.functionList.HEX2DEC.functionParameter.number.detail",example:'"A5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.HEX2OCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.HEX2OCT.description",abstract:"formula.functionList.HEX2OCT.abstract",functionParameter:[{name:"formula.functionList.HEX2OCT.functionParameter.number.name",detail:"formula.functionList.HEX2OCT.functionParameter.number.detail",example:'"F"',require:1,repeat:0},{name:"formula.functionList.HEX2OCT.functionParameter.places.name",detail:"formula.functionList.HEX2OCT.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMABS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMABS.description",abstract:"formula.functionList.IMABS.abstract",functionParameter:[{name:"formula.functionList.IMABS.functionParameter.inumber.name",detail:"formula.functionList.IMABS.functionParameter.inumber.detail",example:'"5+12i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMAGINARY,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMAGINARY.description",abstract:"formula.functionList.IMAGINARY.abstract",functionParameter:[{name:"formula.functionList.IMAGINARY.functionParameter.inumber.name",detail:"formula.functionList.IMAGINARY.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMARGUMENT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMARGUMENT.description",abstract:"formula.functionList.IMARGUMENT.abstract",functionParameter:[{name:"formula.functionList.IMARGUMENT.functionParameter.inumber.name",detail:"formula.functionList.IMARGUMENT.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCONJUGATE,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCONJUGATE.description",abstract:"formula.functionList.IMCONJUGATE.abstract",functionParameter:[{name:"formula.functionList.IMCONJUGATE.functionParameter.inumber.name",detail:"formula.functionList.IMCONJUGATE.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOS,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOS.description",abstract:"formula.functionList.IMCOS.abstract",functionParameter:[{name:"formula.functionList.IMCOS.functionParameter.inumber.name",detail:"formula.functionList.IMCOS.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOSH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOSH.description",abstract:"formula.functionList.IMCOSH.abstract",functionParameter:[{name:"formula.functionList.IMCOSH.functionParameter.inumber.name",detail:"formula.functionList.IMCOSH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOT.description",abstract:"formula.functionList.IMCOT.abstract",functionParameter:[{name:"formula.functionList.IMCOT.functionParameter.inumber.name",detail:"formula.functionList.IMCOT.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCOTH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCOTH.description",abstract:"formula.functionList.IMCOTH.abstract",functionParameter:[{name:"formula.functionList.IMCOTH.functionParameter.inumber.name",detail:"formula.functionList.IMCOTH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSC.description",abstract:"formula.functionList.IMCSC.abstract",functionParameter:[{name:"formula.functionList.IMCSC.functionParameter.inumber.name",detail:"formula.functionList.IMCSC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMCSCH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMCSCH.description",abstract:"formula.functionList.IMCSCH.abstract",functionParameter:[{name:"formula.functionList.IMCSCH.functionParameter.inumber.name",detail:"formula.functionList.IMCSCH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMDIV,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMDIV.description",abstract:"formula.functionList.IMDIV.abstract",functionParameter:[{name:"formula.functionList.IMDIV.functionParameter.inumber1.name",detail:"formula.functionList.IMDIV.functionParameter.inumber1.detail",example:'"-238+240i"',require:1,repeat:0},{name:"formula.functionList.IMDIV.functionParameter.inumber2.name",detail:"formula.functionList.IMDIV.functionParameter.inumber2.detail",example:'"10+24i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMEXP,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMEXP.description",abstract:"formula.functionList.IMEXP.abstract",functionParameter:[{name:"formula.functionList.IMEXP.functionParameter.inumber.name",detail:"formula.functionList.IMEXP.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLN.description",abstract:"formula.functionList.IMLN.abstract",functionParameter:[{name:"formula.functionList.IMLN.functionParameter.inumber.name",detail:"formula.functionList.IMLN.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG.description",abstract:"formula.functionList.IMLOG.abstract",functionParameter:[{name:"formula.functionList.IMLOG.functionParameter.inumber.name",detail:"formula.functionList.IMLOG.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMLOG.functionParameter.base.name",detail:"formula.functionList.IMLOG.functionParameter.base.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG10,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG10.description",abstract:"formula.functionList.IMLOG10.abstract",functionParameter:[{name:"formula.functionList.IMLOG10.functionParameter.inumber.name",detail:"formula.functionList.IMLOG10.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMLOG2,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMLOG2.description",abstract:"formula.functionList.IMLOG2.abstract",functionParameter:[{name:"formula.functionList.IMLOG2.functionParameter.inumber.name",detail:"formula.functionList.IMLOG2.functionParameter.inumber.detail",example:'"3+4i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPOWER,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPOWER.description",abstract:"formula.functionList.IMPOWER.abstract",functionParameter:[{name:"formula.functionList.IMPOWER.functionParameter.inumber.name",detail:"formula.functionList.IMPOWER.functionParameter.inumber.detail",example:'"2+3i"',require:1,repeat:0},{name:"formula.functionList.IMPOWER.functionParameter.number.name",detail:"formula.functionList.IMPOWER.functionParameter.number.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMPRODUCT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMPRODUCT.description",abstract:"formula.functionList.IMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.IMPRODUCT.functionParameter.inumber1.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMPRODUCT.functionParameter.inumber2.name",detail:"formula.functionList.IMPRODUCT.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMREAL,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMREAL.description",abstract:"formula.functionList.IMREAL.abstract",functionParameter:[{name:"formula.functionList.IMREAL.functionParameter.inumber.name",detail:"formula.functionList.IMREAL.functionParameter.inumber.detail",example:'"6-9i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSEC.description",abstract:"formula.functionList.IMSEC.abstract",functionParameter:[{name:"formula.functionList.IMSEC.functionParameter.inumber.name",detail:"formula.functionList.IMSEC.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSECH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSECH.description",abstract:"formula.functionList.IMSECH.abstract",functionParameter:[{name:"formula.functionList.IMSECH.functionParameter.inumber.name",detail:"formula.functionList.IMSECH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSIN.description",abstract:"formula.functionList.IMSIN.abstract",functionParameter:[{name:"formula.functionList.IMSIN.functionParameter.inumber.name",detail:"formula.functionList.IMSIN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSINH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSINH.description",abstract:"formula.functionList.IMSINH.abstract",functionParameter:[{name:"formula.functionList.IMSINH.functionParameter.inumber.name",detail:"formula.functionList.IMSINH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSQRT,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSQRT.description",abstract:"formula.functionList.IMSQRT.abstract",functionParameter:[{name:"formula.functionList.IMSQRT.functionParameter.inumber.name",detail:"formula.functionList.IMSQRT.functionParameter.inumber.detail",example:'"1+i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUB,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUB.description",abstract:"formula.functionList.IMSUB.abstract",functionParameter:[{name:"formula.functionList.IMSUB.functionParameter.inumber1.name",detail:"formula.functionList.IMSUB.functionParameter.inumber1.detail",example:'"13+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUB.functionParameter.inumber2.name",detail:"formula.functionList.IMSUB.functionParameter.inumber2.detail",example:'"5+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMSUM,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMSUM.description",abstract:"formula.functionList.IMSUM.abstract",functionParameter:[{name:"formula.functionList.IMSUM.functionParameter.inumber1.name",detail:"formula.functionList.IMSUM.functionParameter.inumber1.detail",example:'"3+4i"',require:1,repeat:0},{name:"formula.functionList.IMSUM.functionParameter.inumber2.name",detail:"formula.functionList.IMSUM.functionParameter.inumber2.detail",example:'"5-3i"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTAN,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTAN.description",abstract:"formula.functionList.IMTAN.abstract",functionParameter:[{name:"formula.functionList.IMTAN.functionParameter.inumber.name",detail:"formula.functionList.IMTAN.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.IMTANH,functionType:t.FunctionType.Engineering,description:"formula.functionList.IMTANH.description",abstract:"formula.functionList.IMTANH.abstract",functionParameter:[{name:"formula.functionList.IMTANH.functionParameter.inumber.name",detail:"formula.functionList.IMTANH.functionParameter.inumber.detail",example:'"4+3i"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2BIN,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2BIN.description",abstract:"formula.functionList.OCT2BIN.abstract",functionParameter:[{name:"formula.functionList.OCT2BIN.functionParameter.number.name",detail:"formula.functionList.OCT2BIN.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.OCT2BIN.functionParameter.places.name",detail:"formula.functionList.OCT2BIN.functionParameter.places.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2DEC,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2DEC.description",abstract:"formula.functionList.OCT2DEC.abstract",functionParameter:[{name:"formula.functionList.OCT2DEC.functionParameter.number.name",detail:"formula.functionList.OCT2DEC.functionParameter.number.detail",example:"54",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_ENGINEERING.OCT2HEX,functionType:t.FunctionType.Engineering,description:"formula.functionList.OCT2HEX.description",abstract:"formula.functionList.OCT2HEX.abstract",functionParameter:[{name:"formula.functionList.OCT2HEX.functionParameter.number.name",detail:"formula.functionList.OCT2HEX.functionParameter.number.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.OCT2HEX.functionParameter.places.name",detail:"formula.functionList.OCT2HEX.functionParameter.places.detail",example:"4",require:0,repeat:0}]}],Ke=[{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINT,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINT.description",abstract:"formula.functionList.ACCRINT.abstract",functionParameter:[{name:"formula.functionList.ACCRINT.functionParameter.issue.name",detail:"formula.functionList.ACCRINT.functionParameter.issue.detail",example:"39508",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.firstInterest.name",detail:"formula.functionList.ACCRINT.functionParameter.firstInterest.detail",example:"39691",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.settlement.name",detail:"formula.functionList.ACCRINT.functionParameter.settlement.detail",example:"39569",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.rate.name",detail:"formula.functionList.ACCRINT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.par.name",detail:"formula.functionList.ACCRINT.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.frequency.name",detail:"formula.functionList.ACCRINT.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.basis.name",detail:"formula.functionList.ACCRINT.functionParameter.basis.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.ACCRINT.functionParameter.calcMethod.name",detail:"formula.functionList.ACCRINT.functionParameter.calcMethod.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ACCRINTM,functionType:t.FunctionType.Financial,description:"formula.functionList.ACCRINTM.description",abstract:"formula.functionList.ACCRINTM.abstract",functionParameter:[{name:"formula.functionList.ACCRINTM.functionParameter.issue.name",detail:"formula.functionList.ACCRINTM.functionParameter.issue.detail",example:'"2008-4-1"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.settlement.name",detail:"formula.functionList.ACCRINTM.functionParameter.settlement.detail",example:'"2008-6-15"',require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.rate.name",detail:"formula.functionList.ACCRINTM.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.par.name",detail:"formula.functionList.ACCRINTM.functionParameter.par.detail",example:"1000",require:1,repeat:0},{name:"formula.functionList.ACCRINTM.functionParameter.basis.name",detail:"formula.functionList.ACCRINTM.functionParameter.basis.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORDEGRC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORDEGRC.description",abstract:"formula.functionList.AMORDEGRC.abstract",functionParameter:[{name:"formula.functionList.AMORDEGRC.functionParameter.number1.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AMORDEGRC.functionParameter.number2.name",detail:"formula.functionList.AMORDEGRC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.AMORLINC,functionType:t.FunctionType.Financial,description:"formula.functionList.AMORLINC.description",abstract:"formula.functionList.AMORLINC.abstract",functionParameter:[{name:"formula.functionList.AMORLINC.functionParameter.cost.name",detail:"formula.functionList.AMORLINC.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.datePurchased.name",detail:"formula.functionList.AMORLINC.functionParameter.datePurchased.detail",example:"39679",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.firstPeriod.name",detail:"formula.functionList.AMORLINC.functionParameter.firstPeriod.detail",example:"39813",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.salvage.name",detail:"formula.functionList.AMORLINC.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.period.name",detail:"formula.functionList.AMORLINC.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.rate.name",detail:"formula.functionList.AMORLINC.functionParameter.rate.detail",example:"0.15",require:1,repeat:0},{name:"formula.functionList.AMORLINC.functionParameter.basis.name",detail:"formula.functionList.AMORLINC.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYBS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYBS.description",abstract:"formula.functionList.COUPDAYBS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYBS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYBS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYBS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYBS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYBS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYBS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYS,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYS.description",abstract:"formula.functionList.COUPDAYS.abstract",functionParameter:[{name:"formula.functionList.COUPDAYS.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYS.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYS.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYS.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYS.functionParameter.basis.name",detail:"formula.functionList.COUPDAYS.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPDAYSNC,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPDAYSNC.description",abstract:"formula.functionList.COUPDAYSNC.abstract",functionParameter:[{name:"formula.functionList.COUPDAYSNC.functionParameter.settlement.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.maturity.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.frequency.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPDAYSNC.functionParameter.basis.name",detail:"formula.functionList.COUPDAYSNC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNCD.description",abstract:"formula.functionList.COUPNCD.abstract",functionParameter:[{name:"formula.functionList.COUPNCD.functionParameter.settlement.name",detail:"formula.functionList.COUPNCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.maturity.name",detail:"formula.functionList.COUPNCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.frequency.name",detail:"formula.functionList.COUPNCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNCD.functionParameter.basis.name",detail:"formula.functionList.COUPNCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPNUM,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPNUM.description",abstract:"formula.functionList.COUPNUM.abstract",functionParameter:[{name:"formula.functionList.COUPNUM.functionParameter.settlement.name",detail:"formula.functionList.COUPNUM.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.maturity.name",detail:"formula.functionList.COUPNUM.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.frequency.name",detail:"formula.functionList.COUPNUM.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPNUM.functionParameter.basis.name",detail:"formula.functionList.COUPNUM.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.COUPPCD,functionType:t.FunctionType.Financial,description:"formula.functionList.COUPPCD.description",abstract:"formula.functionList.COUPPCD.abstract",functionParameter:[{name:"formula.functionList.COUPPCD.functionParameter.settlement.name",detail:"formula.functionList.COUPPCD.functionParameter.settlement.detail",example:'"2011-1-25"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.maturity.name",detail:"formula.functionList.COUPPCD.functionParameter.maturity.detail",example:'"2011-11-15"',require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.frequency.name",detail:"formula.functionList.COUPPCD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.COUPPCD.functionParameter.basis.name",detail:"formula.functionList.COUPPCD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMIPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMIPMT.description",abstract:"formula.functionList.CUMIPMT.abstract",functionParameter:[{name:"formula.functionList.CUMIPMT.functionParameter.rate.name",detail:"formula.functionList.CUMIPMT.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.nper.name",detail:"formula.functionList.CUMIPMT.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.pv.name",detail:"formula.functionList.CUMIPMT.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.startPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.endPeriod.name",detail:"formula.functionList.CUMIPMT.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMIPMT.functionParameter.type.name",detail:"formula.functionList.CUMIPMT.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.CUMPRINC,functionType:t.FunctionType.Financial,description:"formula.functionList.CUMPRINC.description",abstract:"formula.functionList.CUMPRINC.abstract",functionParameter:[{name:"formula.functionList.CUMPRINC.functionParameter.rate.name",detail:"formula.functionList.CUMPRINC.functionParameter.rate.detail",example:"0.09/12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.nper.name",detail:"formula.functionList.CUMPRINC.functionParameter.nper.detail",example:"30*12",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.pv.name",detail:"formula.functionList.CUMPRINC.functionParameter.pv.detail",example:"125000",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.startPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.startPeriod.detail",example:"13",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.endPeriod.name",detail:"formula.functionList.CUMPRINC.functionParameter.endPeriod.detail",example:"24",require:1,repeat:0},{name:"formula.functionList.CUMPRINC.functionParameter.type.name",detail:"formula.functionList.CUMPRINC.functionParameter.type.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DB,functionType:t.FunctionType.Financial,description:"formula.functionList.DB.description",abstract:"formula.functionList.DB.abstract",functionParameter:[{name:"formula.functionList.DB.functionParameter.cost.name",detail:"formula.functionList.DB.functionParameter.cost.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.salvage.name",detail:"formula.functionList.DB.functionParameter.salvage.detail",example:"1000000",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.life.name",detail:"formula.functionList.DB.functionParameter.life.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.period.name",detail:"formula.functionList.DB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DB.functionParameter.month.name",detail:"formula.functionList.DB.functionParameter.month.detail",example:"7",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DDB,functionType:t.FunctionType.Financial,description:"formula.functionList.DDB.description",abstract:"formula.functionList.DDB.abstract",functionParameter:[{name:"formula.functionList.DDB.functionParameter.cost.name",detail:"formula.functionList.DDB.functionParameter.cost.detail",example:"24000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.salvage.name",detail:"formula.functionList.DDB.functionParameter.salvage.detail",example:"3000",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.life.name",detail:"formula.functionList.DDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.period.name",detail:"formula.functionList.DDB.functionParameter.period.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DDB.functionParameter.factor.name",detail:"formula.functionList.DDB.functionParameter.factor.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DISC,functionType:t.FunctionType.Financial,description:"formula.functionList.DISC.description",abstract:"formula.functionList.DISC.abstract",functionParameter:[{name:"formula.functionList.DISC.functionParameter.settlement.name",detail:"formula.functionList.DISC.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.maturity.name",detail:"formula.functionList.DISC.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.pr.name",detail:"formula.functionList.DISC.functionParameter.pr.detail",example:"97.975",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.redemption.name",detail:"formula.functionList.DISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.DISC.functionParameter.basis.name",detail:"formula.functionList.DISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARDE,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARDE.description",abstract:"formula.functionList.DOLLARDE.abstract",functionParameter:[{name:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.name",detail:"formula.functionList.DOLLARDE.functionParameter.fractionalDollar.detail",example:"1.02",require:1,repeat:0},{name:"formula.functionList.DOLLARDE.functionParameter.fraction.name",detail:"formula.functionList.DOLLARDE.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DOLLARFR,functionType:t.FunctionType.Financial,description:"formula.functionList.DOLLARFR.description",abstract:"formula.functionList.DOLLARFR.abstract",functionParameter:[{name:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.name",detail:"formula.functionList.DOLLARFR.functionParameter.decimalDollar.detail",example:"1.125",require:1,repeat:0},{name:"formula.functionList.DOLLARFR.functionParameter.fraction.name",detail:"formula.functionList.DOLLARFR.functionParameter.fraction.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.DURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.DURATION.description",abstract:"formula.functionList.DURATION.abstract",functionParameter:[{name:"formula.functionList.DURATION.functionParameter.settlement.name",detail:"formula.functionList.DURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.maturity.name",detail:"formula.functionList.DURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.coupon.name",detail:"formula.functionList.DURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.yld.name",detail:"formula.functionList.DURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.frequency.name",detail:"formula.functionList.DURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DURATION.functionParameter.basis.name",detail:"formula.functionList.DURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.EFFECT,functionType:t.FunctionType.Financial,description:"formula.functionList.EFFECT.description",abstract:"formula.functionList.EFFECT.abstract",functionParameter:[{name:"formula.functionList.EFFECT.functionParameter.nominalRate.name",detail:"formula.functionList.EFFECT.functionParameter.nominalRate.detail",example:"0.0525",require:1,repeat:0},{name:"formula.functionList.EFFECT.functionParameter.npery.name",detail:"formula.functionList.EFFECT.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FV,functionType:t.FunctionType.Financial,description:"formula.functionList.FV.description",abstract:"formula.functionList.FV.abstract",functionParameter:[{name:"formula.functionList.FV.functionParameter.rate.name",detail:"formula.functionList.FV.functionParameter.rate.detail",example:"0.06/12",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.nper.name",detail:"formula.functionList.FV.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pmt.name",detail:"formula.functionList.FV.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.FV.functionParameter.pv.name",detail:"formula.functionList.FV.functionParameter.pv.detail",example:"-500",require:0,repeat:0},{name:"formula.functionList.FV.functionParameter.type.name",detail:"formula.functionList.FV.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.FVSCHEDULE,functionType:t.FunctionType.Financial,description:"formula.functionList.FVSCHEDULE.description",abstract:"formula.functionList.FVSCHEDULE.abstract",functionParameter:[{name:"formula.functionList.FVSCHEDULE.functionParameter.principal.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.principal.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.FVSCHEDULE.functionParameter.schedule.name",detail:"formula.functionList.FVSCHEDULE.functionParameter.schedule.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.INTRATE,functionType:t.FunctionType.Financial,description:"formula.functionList.INTRATE.description",abstract:"formula.functionList.INTRATE.abstract",functionParameter:[{name:"formula.functionList.INTRATE.functionParameter.settlement.name",detail:"formula.functionList.INTRATE.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.maturity.name",detail:"formula.functionList.INTRATE.functionParameter.maturity.detail",example:'"2008-5-15"',require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.investment.name",detail:"formula.functionList.INTRATE.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.redemption.name",detail:"formula.functionList.INTRATE.functionParameter.redemption.detail",example:"10144200",require:1,repeat:0},{name:"formula.functionList.INTRATE.functionParameter.basis.name",detail:"formula.functionList.INTRATE.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.IPMT.description",abstract:"formula.functionList.IPMT.abstract",functionParameter:[{name:"formula.functionList.IPMT.functionParameter.rate.name",detail:"formula.functionList.IPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.per.name",detail:"formula.functionList.IPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.nper.name",detail:"formula.functionList.IPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.pv.name",detail:"formula.functionList.IPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.IPMT.functionParameter.fv.name",detail:"formula.functionList.IPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.IPMT.functionParameter.type.name",detail:"formula.functionList.IPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.IRR,functionType:t.FunctionType.Financial,description:"formula.functionList.IRR.description",abstract:"formula.functionList.IRR.abstract",functionParameter:[{name:"formula.functionList.IRR.functionParameter.values.name",detail:"formula.functionList.IRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.IRR.functionParameter.guess.name",detail:"formula.functionList.IRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ISPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.ISPMT.description",abstract:"formula.functionList.ISPMT.abstract",functionParameter:[{name:"formula.functionList.ISPMT.functionParameter.rate.name",detail:"formula.functionList.ISPMT.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.per.name",detail:"formula.functionList.ISPMT.functionParameter.per.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.nper.name",detail:"formula.functionList.ISPMT.functionParameter.nper.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.ISPMT.functionParameter.pv.name",detail:"formula.functionList.ISPMT.functionParameter.pv.detail",example:"1000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.MDURATION.description",abstract:"formula.functionList.MDURATION.abstract",functionParameter:[{name:"formula.functionList.MDURATION.functionParameter.settlement.name",detail:"formula.functionList.MDURATION.functionParameter.settlement.detail",example:'"2018-7-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.maturity.name",detail:"formula.functionList.MDURATION.functionParameter.maturity.detail",example:'"2048-1-1"',require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.coupon.name",detail:"formula.functionList.MDURATION.functionParameter.coupon.detail",example:"0.08",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.yld.name",detail:"formula.functionList.MDURATION.functionParameter.yld.detail",example:"0.09",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.frequency.name",detail:"formula.functionList.MDURATION.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.MDURATION.functionParameter.basis.name",detail:"formula.functionList.MDURATION.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.MIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.MIRR.description",abstract:"formula.functionList.MIRR.abstract",functionParameter:[{name:"formula.functionList.MIRR.functionParameter.values.name",detail:"formula.functionList.MIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.financeRate.name",detail:"formula.functionList.MIRR.functionParameter.financeRate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.MIRR.functionParameter.reinvestRate.name",detail:"formula.functionList.MIRR.functionParameter.reinvestRate.detail",example:"0.12",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NOMINAL,functionType:t.FunctionType.Financial,description:"formula.functionList.NOMINAL.description",abstract:"formula.functionList.NOMINAL.abstract",functionParameter:[{name:"formula.functionList.NOMINAL.functionParameter.effectRate.name",detail:"formula.functionList.NOMINAL.functionParameter.effectRate.detail",example:"0.053543",require:1,repeat:0},{name:"formula.functionList.NOMINAL.functionParameter.npery.name",detail:"formula.functionList.NOMINAL.functionParameter.npery.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPER,functionType:t.FunctionType.Financial,description:"formula.functionList.NPER.description",abstract:"formula.functionList.NPER.abstract",functionParameter:[{name:"formula.functionList.NPER.functionParameter.rate.name",detail:"formula.functionList.NPER.functionParameter.rate.detail",example:"0.12/12",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pmt.name",detail:"formula.functionList.NPER.functionParameter.pmt.detail",example:"-100",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.pv.name",detail:"formula.functionList.NPER.functionParameter.pv.detail",example:"-1000",require:1,repeat:0},{name:"formula.functionList.NPER.functionParameter.fv.name",detail:"formula.functionList.NPER.functionParameter.fv.detail",example:"10000",require:0,repeat:0},{name:"formula.functionList.NPER.functionParameter.type.name",detail:"formula.functionList.NPER.functionParameter.type.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.NPV,functionType:t.FunctionType.Financial,description:"formula.functionList.NPV.description",abstract:"formula.functionList.NPV.abstract",functionParameter:[{name:"formula.functionList.NPV.functionParameter.rate.name",detail:"formula.functionList.NPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value1.name",detail:"formula.functionList.NPV.functionParameter.value1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.NPV.functionParameter.value2.name",detail:"formula.functionList.NPV.functionParameter.value2.detail",example:"-9000",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFPRICE.description",abstract:"formula.functionList.ODDFPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDFPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDFPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDFPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.issue.name",detail:"formula.functionList.ODDFPRICE.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFPRICE.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDFPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDFPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDFPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDFPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDFPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDFYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDFYIELD.description",abstract:"formula.functionList.ODDFYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDFYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDFYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDFYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.issue.name",detail:"formula.functionList.ODDFYIELD.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.name",detail:"formula.functionList.ODDFYIELD.functionParameter.firstCoupon.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDFYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDFYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDFYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDFYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDFYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDFYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLPRICE.description",abstract:"formula.functionList.ODDLPRICE.abstract",functionParameter:[{name:"formula.functionList.ODDLPRICE.functionParameter.settlement.name",detail:"formula.functionList.ODDLPRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.maturity.name",detail:"formula.functionList.ODDLPRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLPRICE.functionParameter.lastInterest.detail",example:'"2009-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.rate.name",detail:"formula.functionList.ODDLPRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.yld.name",detail:"formula.functionList.ODDLPRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.redemption.name",detail:"formula.functionList.ODDLPRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.frequency.name",detail:"formula.functionList.ODDLPRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLPRICE.functionParameter.basis.name",detail:"formula.functionList.ODDLPRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.ODDLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.ODDLYIELD.description",abstract:"formula.functionList.ODDLYIELD.abstract",functionParameter:[{name:"formula.functionList.ODDLYIELD.functionParameter.settlement.name",detail:"formula.functionList.ODDLYIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.maturity.name",detail:"formula.functionList.ODDLYIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.name",detail:"formula.functionList.ODDLYIELD.functionParameter.lastInterest.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.rate.name",detail:"formula.functionList.ODDLYIELD.functionParameter.rate.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.pr.name",detail:"formula.functionList.ODDLYIELD.functionParameter.pr.detail",example:"84.5",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.redemption.name",detail:"formula.functionList.ODDLYIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.frequency.name",detail:"formula.functionList.ODDLYIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ODDLYIELD.functionParameter.basis.name",detail:"formula.functionList.ODDLYIELD.functionParameter.basis.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PDURATION,functionType:t.FunctionType.Financial,description:"formula.functionList.PDURATION.description",abstract:"formula.functionList.PDURATION.abstract",functionParameter:[{name:"formula.functionList.PDURATION.functionParameter.rate.name",detail:"formula.functionList.PDURATION.functionParameter.rate.detail",example:"0.025",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.pv.name",detail:"formula.functionList.PDURATION.functionParameter.pv.detail",example:"2000",require:1,repeat:0},{name:"formula.functionList.PDURATION.functionParameter.fv.name",detail:"formula.functionList.PDURATION.functionParameter.fv.detail",example:"2200",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PMT.description",abstract:"formula.functionList.PMT.abstract",functionParameter:[{name:"formula.functionList.PMT.functionParameter.rate.name",detail:"formula.functionList.PMT.functionParameter.rate.detail",example:"0.08/12",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.nper.name",detail:"formula.functionList.PMT.functionParameter.nper.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.pv.name",detail:"formula.functionList.PMT.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.PMT.functionParameter.fv.name",detail:"formula.functionList.PMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PMT.functionParameter.type.name",detail:"formula.functionList.PMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PPMT,functionType:t.FunctionType.Financial,description:"formula.functionList.PPMT.description",abstract:"formula.functionList.PPMT.abstract",functionParameter:[{name:"formula.functionList.PPMT.functionParameter.rate.name",detail:"formula.functionList.PPMT.functionParameter.rate.detail",example:"0.1/12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.per.name",detail:"formula.functionList.PPMT.functionParameter.per.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.nper.name",detail:"formula.functionList.PPMT.functionParameter.nper.detail",example:"3*12",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.pv.name",detail:"formula.functionList.PPMT.functionParameter.pv.detail",example:"80000",require:1,repeat:0},{name:"formula.functionList.PPMT.functionParameter.fv.name",detail:"formula.functionList.PPMT.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PPMT.functionParameter.type.name",detail:"formula.functionList.PPMT.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICE.description",abstract:"formula.functionList.PRICE.abstract",functionParameter:[{name:"formula.functionList.PRICE.functionParameter.settlement.name",detail:"formula.functionList.PRICE.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.maturity.name",detail:"formula.functionList.PRICE.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.rate.name",detail:"formula.functionList.PRICE.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.yld.name",detail:"formula.functionList.PRICE.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.redemption.name",detail:"formula.functionList.PRICE.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.frequency.name",detail:"formula.functionList.PRICE.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.PRICE.functionParameter.basis.name",detail:"formula.functionList.PRICE.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEDISC.description",abstract:"formula.functionList.PRICEDISC.abstract",functionParameter:[{name:"formula.functionList.PRICEDISC.functionParameter.settlement.name",detail:"formula.functionList.PRICEDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.maturity.name",detail:"formula.functionList.PRICEDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.discount.name",detail:"formula.functionList.PRICEDISC.functionParameter.discount.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.redemption.name",detail:"formula.functionList.PRICEDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PRICEDISC.functionParameter.basis.name",detail:"formula.functionList.PRICEDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PRICEMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.PRICEMAT.description",abstract:"formula.functionList.PRICEMAT.abstract",functionParameter:[{name:"formula.functionList.PRICEMAT.functionParameter.settlement.name",detail:"formula.functionList.PRICEMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.maturity.name",detail:"formula.functionList.PRICEMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.issue.name",detail:"formula.functionList.PRICEMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.rate.name",detail:"formula.functionList.PRICEMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.yld.name",detail:"formula.functionList.PRICEMAT.functionParameter.yld.detail",example:"0.0625",require:1,repeat:0},{name:"formula.functionList.PRICEMAT.functionParameter.basis.name",detail:"formula.functionList.PRICEMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.PV,functionType:t.FunctionType.Financial,description:"formula.functionList.PV.description",abstract:"formula.functionList.PV.abstract",functionParameter:[{name:"formula.functionList.PV.functionParameter.rate.name",detail:"formula.functionList.PV.functionParameter.rate.detail",example:"0.02",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.nper.name",detail:"formula.functionList.PV.functionParameter.nper.detail",example:"12",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.pmt.name",detail:"formula.functionList.PV.functionParameter.pmt.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.PV.functionParameter.fv.name",detail:"formula.functionList.PV.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.PV.functionParameter.type.name",detail:"formula.functionList.PV.functionParameter.type.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RATE,functionType:t.FunctionType.Financial,description:"formula.functionList.RATE.description",abstract:"formula.functionList.RATE.abstract",functionParameter:[{name:"formula.functionList.RATE.functionParameter.nper.name",detail:"formula.functionList.RATE.functionParameter.nper.detail",example:"4*12",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pmt.name",detail:"formula.functionList.RATE.functionParameter.pmt.detail",example:"-200",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.pv.name",detail:"formula.functionList.RATE.functionParameter.pv.detail",example:"8000",require:1,repeat:0},{name:"formula.functionList.RATE.functionParameter.fv.name",detail:"formula.functionList.RATE.functionParameter.fv.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.type.name",detail:"formula.functionList.RATE.functionParameter.type.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.RATE.functionParameter.guess.name",detail:"formula.functionList.RATE.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RECEIVED,functionType:t.FunctionType.Financial,description:"formula.functionList.RECEIVED.description",abstract:"formula.functionList.RECEIVED.abstract",functionParameter:[{name:"formula.functionList.RECEIVED.functionParameter.settlement.name",detail:"formula.functionList.RECEIVED.functionParameter.settlement.detail",example:'"2008-2-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.maturity.name",detail:"formula.functionList.RECEIVED.functionParameter.maturity.detail",example:'"2008-3-15"',require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.investment.name",detail:"formula.functionList.RECEIVED.functionParameter.investment.detail",example:"10000000",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.discount.name",detail:"formula.functionList.RECEIVED.functionParameter.discount.detail",example:"0.0575",require:1,repeat:0},{name:"formula.functionList.RECEIVED.functionParameter.basis.name",detail:"formula.functionList.RECEIVED.functionParameter.basis.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.RRI,functionType:t.FunctionType.Financial,description:"formula.functionList.RRI.description",abstract:"formula.functionList.RRI.abstract",functionParameter:[{name:"formula.functionList.RRI.functionParameter.nper.name",detail:"formula.functionList.RRI.functionParameter.nper.detail",example:"96",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.pv.name",detail:"formula.functionList.RRI.functionParameter.pv.detail",example:"10000",require:1,repeat:0},{name:"formula.functionList.RRI.functionParameter.fv.name",detail:"formula.functionList.RRI.functionParameter.fv.detail",example:"11000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SLN,functionType:t.FunctionType.Financial,description:"formula.functionList.SLN.description",abstract:"formula.functionList.SLN.abstract",functionParameter:[{name:"formula.functionList.SLN.functionParameter.cost.name",detail:"formula.functionList.SLN.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.salvage.name",detail:"formula.functionList.SLN.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SLN.functionParameter.life.name",detail:"formula.functionList.SLN.functionParameter.life.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.SYD,functionType:t.FunctionType.Financial,description:"formula.functionList.SYD.description",abstract:"formula.functionList.SYD.abstract",functionParameter:[{name:"formula.functionList.SYD.functionParameter.cost.name",detail:"formula.functionList.SYD.functionParameter.cost.detail",example:"300000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.salvage.name",detail:"formula.functionList.SYD.functionParameter.salvage.detail",example:"75000",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.life.name",detail:"formula.functionList.SYD.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.SYD.functionParameter.per.name",detail:"formula.functionList.SYD.functionParameter.per.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLEQ,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLEQ.description",abstract:"formula.functionList.TBILLEQ.abstract",functionParameter:[{name:"formula.functionList.TBILLEQ.functionParameter.settlement.name",detail:"formula.functionList.TBILLEQ.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.maturity.name",detail:"formula.functionList.TBILLEQ.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLEQ.functionParameter.discount.name",detail:"formula.functionList.TBILLEQ.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLPRICE,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLPRICE.description",abstract:"formula.functionList.TBILLPRICE.abstract",functionParameter:[{name:"formula.functionList.TBILLPRICE.functionParameter.settlement.name",detail:"formula.functionList.TBILLPRICE.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.maturity.name",detail:"formula.functionList.TBILLPRICE.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLPRICE.functionParameter.discount.name",detail:"formula.functionList.TBILLPRICE.functionParameter.discount.detail",example:"0.0914",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.TBILLYIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.TBILLYIELD.description",abstract:"formula.functionList.TBILLYIELD.abstract",functionParameter:[{name:"formula.functionList.TBILLYIELD.functionParameter.settlement.name",detail:"formula.functionList.TBILLYIELD.functionParameter.settlement.detail",example:'"2008-3-31"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.maturity.name",detail:"formula.functionList.TBILLYIELD.functionParameter.maturity.detail",example:'"2008-6-1"',require:1,repeat:0},{name:"formula.functionList.TBILLYIELD.functionParameter.pr.name",detail:"formula.functionList.TBILLYIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.VDB,functionType:t.FunctionType.Financial,description:"formula.functionList.VDB.description",abstract:"formula.functionList.VDB.abstract",functionParameter:[{name:"formula.functionList.VDB.functionParameter.cost.name",detail:"formula.functionList.VDB.functionParameter.cost.detail",example:"2400",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.salvage.name",detail:"formula.functionList.VDB.functionParameter.salvage.detail",example:"300",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.life.name",detail:"formula.functionList.VDB.functionParameter.life.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.startPeriod.name",detail:"formula.functionList.VDB.functionParameter.startPeriod.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.endPeriod.name",detail:"formula.functionList.VDB.functionParameter.endPeriod.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.VDB.functionParameter.factor.name",detail:"formula.functionList.VDB.functionParameter.factor.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.VDB.functionParameter.noSwitch.name",detail:"formula.functionList.VDB.functionParameter.noSwitch.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XIRR,functionType:t.FunctionType.Financial,description:"formula.functionList.XIRR.description",abstract:"formula.functionList.XIRR.abstract",functionParameter:[{name:"formula.functionList.XIRR.functionParameter.values.name",detail:"formula.functionList.XIRR.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.dates.name",detail:"formula.functionList.XIRR.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.XIRR.functionParameter.guess.name",detail:"formula.functionList.XIRR.functionParameter.guess.detail",example:"0.1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.XNPV,functionType:t.FunctionType.Financial,description:"formula.functionList.XNPV.description",abstract:"formula.functionList.XNPV.abstract",functionParameter:[{name:"formula.functionList.XNPV.functionParameter.rate.name",detail:"formula.functionList.XNPV.functionParameter.rate.detail",example:"0.1",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.values.name",detail:"formula.functionList.XNPV.functionParameter.values.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.XNPV.functionParameter.dates.name",detail:"formula.functionList.XNPV.functionParameter.dates.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELD,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELD.description",abstract:"formula.functionList.YIELD.abstract",functionParameter:[{name:"formula.functionList.YIELD.functionParameter.settlement.name",detail:"formula.functionList.YIELD.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.maturity.name",detail:"formula.functionList.YIELD.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.rate.name",detail:"formula.functionList.YIELD.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.pr.name",detail:"formula.functionList.YIELD.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.redemption.name",detail:"formula.functionList.YIELD.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.frequency.name",detail:"formula.functionList.YIELD.functionParameter.frequency.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.YIELD.functionParameter.basis.name",detail:"formula.functionList.YIELD.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDDISC,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDDISC.description",abstract:"formula.functionList.YIELDDISC.abstract",functionParameter:[{name:"formula.functionList.YIELDDISC.functionParameter.settlement.name",detail:"formula.functionList.YIELDDISC.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.maturity.name",detail:"formula.functionList.YIELDDISC.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.pr.name",detail:"formula.functionList.YIELDDISC.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.redemption.name",detail:"formula.functionList.YIELDDISC.functionParameter.redemption.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.YIELDDISC.functionParameter.basis.name",detail:"formula.functionList.YIELDDISC.functionParameter.basis.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_FINANCIAL.YIELDMAT,functionType:t.FunctionType.Financial,description:"formula.functionList.YIELDMAT.description",abstract:"formula.functionList.YIELDMAT.abstract",functionParameter:[{name:"formula.functionList.YIELDMAT.functionParameter.settlement.name",detail:"formula.functionList.YIELDMAT.functionParameter.settlement.detail",example:'"2008-11-11"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.maturity.name",detail:"formula.functionList.YIELDMAT.functionParameter.maturity.detail",example:'"2021-3-1"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.issue.name",detail:"formula.functionList.YIELDMAT.functionParameter.issue.detail",example:'"2008-10-15"',require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.rate.name",detail:"formula.functionList.YIELDMAT.functionParameter.rate.detail",example:"0.0785",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.pr.name",detail:"formula.functionList.YIELDMAT.functionParameter.pr.detail",example:"98.45",require:1,repeat:0},{name:"formula.functionList.YIELDMAT.functionParameter.basis.name",detail:"formula.functionList.YIELDMAT.functionParameter.basis.detail",example:"1",require:0,repeat:0}]}],ge=[{functionName:t.FUNCTION_NAMES_INFORMATION.CELL,functionType:t.FunctionType.Information,description:"formula.functionList.CELL.description",abstract:"formula.functionList.CELL.abstract",functionParameter:[{name:"formula.functionList.CELL.functionParameter.infoType.name",detail:"formula.functionList.CELL.functionParameter.infoType.detail",example:'"type"',require:1,repeat:0},{name:"formula.functionList.CELL.functionParameter.reference.name",detail:"formula.functionList.CELL.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ERROR_TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.ERROR_TYPE.description",abstract:"formula.functionList.ERROR_TYPE.abstract",functionParameter:[{name:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.name",detail:"formula.functionList.ERROR_TYPE.functionParameter.errorVal.detail",example:'"#NULL!"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.INFO,functionType:t.FunctionType.Information,description:"formula.functionList.INFO.description",abstract:"formula.functionList.INFO.abstract",functionParameter:[{name:"formula.functionList.INFO.functionParameter.number1.name",detail:"formula.functionList.INFO.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INFO.functionParameter.number2.name",detail:"formula.functionList.INFO.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBETWEEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISBETWEEN.description",abstract:"formula.functionList.ISBETWEEN.abstract",functionParameter:[{name:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.name",detail:"formula.functionList.ISBETWEEN.functionParameter.valueToCompare.detail",example:"7.9",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValue.detail",example:"1.2",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValue.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValue.detail",example:"12.45",require:1,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.name",detail:"formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISBLANK,functionType:t.FunctionType.Information,description:"formula.functionList.ISBLANK.description",abstract:"formula.functionList.ISBLANK.abstract",functionParameter:[{name:"formula.functionList.ISBLANK.functionParameter.value.name",detail:"formula.functionList.ISBLANK.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISDATE,functionType:t.FunctionType.Information,description:"formula.functionList.ISDATE.description",abstract:"formula.functionList.ISDATE.abstract",functionParameter:[{name:"formula.functionList.ISDATE.functionParameter.value.name",detail:"formula.functionList.ISDATE.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEMAIL,functionType:t.FunctionType.Information,description:"formula.functionList.ISEMAIL.description",abstract:"formula.functionList.ISEMAIL.abstract",functionParameter:[{name:"formula.functionList.ISEMAIL.functionParameter.value.name",detail:"formula.functionList.ISEMAIL.functionParameter.value.detail",example:'"developer@univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERR.description",abstract:"formula.functionList.ISERR.abstract",functionParameter:[{name:"formula.functionList.ISERR.functionParameter.value.name",detail:"formula.functionList.ISERR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISERROR,functionType:t.FunctionType.Information,description:"formula.functionList.ISERROR.description",abstract:"formula.functionList.ISERROR.abstract",functionParameter:[{name:"formula.functionList.ISERROR.functionParameter.value.name",detail:"formula.functionList.ISERROR.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISEVEN,functionType:t.FunctionType.Information,description:"formula.functionList.ISEVEN.description",abstract:"formula.functionList.ISEVEN.abstract",functionParameter:[{name:"formula.functionList.ISEVEN.functionParameter.value.name",detail:"formula.functionList.ISEVEN.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISFORMULA,functionType:t.FunctionType.Information,description:"formula.functionList.ISFORMULA.description",abstract:"formula.functionList.ISFORMULA.abstract",functionParameter:[{name:"formula.functionList.ISFORMULA.functionParameter.reference.name",detail:"formula.functionList.ISFORMULA.functionParameter.reference.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISLOGICAL,functionType:t.FunctionType.Information,description:"formula.functionList.ISLOGICAL.description",abstract:"formula.functionList.ISLOGICAL.abstract",functionParameter:[{name:"formula.functionList.ISLOGICAL.functionParameter.value.name",detail:"formula.functionList.ISLOGICAL.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNA,functionType:t.FunctionType.Information,description:"formula.functionList.ISNA.description",abstract:"formula.functionList.ISNA.abstract",functionParameter:[{name:"formula.functionList.ISNA.functionParameter.value.name",detail:"formula.functionList.ISNA.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNONTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISNONTEXT.description",abstract:"formula.functionList.ISNONTEXT.abstract",functionParameter:[{name:"formula.functionList.ISNONTEXT.functionParameter.value.name",detail:"formula.functionList.ISNONTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISNUMBER,functionType:t.FunctionType.Information,description:"formula.functionList.ISNUMBER.description",abstract:"formula.functionList.ISNUMBER.abstract",functionParameter:[{name:"formula.functionList.ISNUMBER.functionParameter.value.name",detail:"formula.functionList.ISNUMBER.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISODD,functionType:t.FunctionType.Information,description:"formula.functionList.ISODD.description",abstract:"formula.functionList.ISODD.abstract",functionParameter:[{name:"formula.functionList.ISODD.functionParameter.value.name",detail:"formula.functionList.ISODD.functionParameter.value.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISOMITTED,functionType:t.FunctionType.Information,description:"formula.functionList.ISOMITTED.description",abstract:"formula.functionList.ISOMITTED.abstract",functionParameter:[{name:"formula.functionList.ISOMITTED.functionParameter.number1.name",detail:"formula.functionList.ISOMITTED.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISOMITTED.functionParameter.number2.name",detail:"formula.functionList.ISOMITTED.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISREF,functionType:t.FunctionType.Information,description:"formula.functionList.ISREF.description",abstract:"formula.functionList.ISREF.abstract",functionParameter:[{name:"formula.functionList.ISREF.functionParameter.value.name",detail:"formula.functionList.ISREF.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISTEXT,functionType:t.FunctionType.Information,description:"formula.functionList.ISTEXT.description",abstract:"formula.functionList.ISTEXT.abstract",functionParameter:[{name:"formula.functionList.ISTEXT.functionParameter.value.name",detail:"formula.functionList.ISTEXT.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.ISURL,functionType:t.FunctionType.Information,description:"formula.functionList.ISURL.description",abstract:"formula.functionList.ISURL.abstract",functionParameter:[{name:"formula.functionList.ISURL.functionParameter.value.name",detail:"formula.functionList.ISURL.functionParameter.value.detail",example:'"univer.ai"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.N,functionType:t.FunctionType.Information,description:"formula.functionList.N.description",abstract:"formula.functionList.N.abstract",functionParameter:[{name:"formula.functionList.N.functionParameter.value.name",detail:"formula.functionList.N.functionParameter.value.detail",example:"7",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.NA,functionType:t.FunctionType.Information,description:"formula.functionList.NA.description",abstract:"formula.functionList.NA.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEET,functionType:t.FunctionType.Information,description:"formula.functionList.SHEET.description",abstract:"formula.functionList.SHEET.abstract",functionParameter:[{name:"formula.functionList.SHEET.functionParameter.value.name",detail:"formula.functionList.SHEET.functionParameter.value.detail",example:"A1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_INFORMATION.SHEETS,functionType:t.FunctionType.Information,description:"formula.functionList.SHEETS.description",abstract:"formula.functionList.SHEETS.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_INFORMATION.TYPE,functionType:t.FunctionType.Information,description:"formula.functionList.TYPE.description",abstract:"formula.functionList.TYPE.abstract",functionParameter:[{name:"formula.functionList.TYPE.functionParameter.value.name",detail:"formula.functionList.TYPE.functionParameter.value.detail",example:"A2",require:1,repeat:0}]}],Qe=[{functionName:t.FUNCTION_NAMES_LOGICAL.AND,functionType:t.FunctionType.Logical,description:"formula.functionList.AND.description",abstract:"formula.functionList.AND.abstract",functionParameter:[{name:"formula.functionList.AND.functionParameter.logical1.name",detail:"formula.functionList.AND.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.AND.functionParameter.logical2.name",detail:"formula.functionList.AND.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYCOL,functionType:t.FunctionType.Logical,description:"formula.functionList.BYCOL.description",abstract:"formula.functionList.BYCOL.abstract",functionParameter:[{name:"formula.functionList.BYCOL.functionParameter.array.name",detail:"formula.functionList.BYCOL.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYCOL.functionParameter.lambda.name",detail:"formula.functionList.BYCOL.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.BYROW,functionType:t.FunctionType.Logical,description:"formula.functionList.BYROW.description",abstract:"formula.functionList.BYROW.abstract",functionParameter:[{name:"formula.functionList.BYROW.functionParameter.array.name",detail:"formula.functionList.BYROW.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.BYROW.functionParameter.lambda.name",detail:"formula.functionList.BYROW.functionParameter.lambda.detail",example:"LAMBDA(array, MAX(array))",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.FALSE,functionType:t.FunctionType.Logical,description:"formula.functionList.FALSE.description",abstract:"formula.functionList.FALSE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.IF,functionType:t.FunctionType.Logical,description:"formula.functionList.IF.description",abstract:"formula.functionList.IF.abstract",functionParameter:[{name:"formula.functionList.IF.functionParameter.logicalTest.name",detail:"formula.functionList.IF.functionParameter.logicalTest.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfTrue.name",detail:"formula.functionList.IF.functionParameter.valueIfTrue.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IF.functionParameter.valueIfFalse.name",detail:"formula.functionList.IF.functionParameter.valueIfFalse.detail",example:'"A2 is not foo"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFERROR,functionType:t.FunctionType.Logical,description:"formula.functionList.IFERROR.description",abstract:"formula.functionList.IFERROR.abstract",functionParameter:[{name:"formula.functionList.IFERROR.functionParameter.value.name",detail:"formula.functionList.IFERROR.functionParameter.value.detail",example:"A2/B2",require:1,repeat:0},{name:"formula.functionList.IFERROR.functionParameter.valueIfError.name",detail:"formula.functionList.IFERROR.functionParameter.valueIfError.detail",example:"Error in calculation",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFNA,functionType:t.FunctionType.Logical,description:"formula.functionList.IFNA.description",abstract:"formula.functionList.IFNA.abstract",functionParameter:[{name:"formula.functionList.IFNA.functionParameter.value.name",detail:"formula.functionList.IFNA.functionParameter.value.detail",example:"VLOOKUP(C3,C6:D11,2,FALSE)",require:1,repeat:0},{name:"formula.functionList.IFNA.functionParameter.valueIfNa.name",detail:"formula.functionList.IFNA.functionParameter.valueIfNa.detail",example:'"Not Found"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.IFS,functionType:t.FunctionType.Logical,description:"formula.functionList.IFS.description",abstract:"formula.functionList.IFS.abstract",functionParameter:[{name:"formula.functionList.IFS.functionParameter.logicalTest1.name",detail:"formula.functionList.IFS.functionParameter.logicalTest1.detail",example:'A2 = "foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.valueIfTrue1.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue1.detail",example:'"A2 is foo"',require:1,repeat:0},{name:"formula.functionList.IFS.functionParameter.logicalTest2.name",detail:"formula.functionList.IFS.functionParameter.logicalTest2.detail",example:"F2=1",require:0,repeat:1},{name:"formula.functionList.IFS.functionParameter.valueIfTrue2.name",detail:"formula.functionList.IFS.functionParameter.valueIfTrue2.detail",example:"D2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LAMBDA,functionType:t.FunctionType.Logical,description:"formula.functionList.LAMBDA.description",abstract:"formula.functionList.LAMBDA.abstract",functionParameter:[{name:"formula.functionList.LAMBDA.functionParameter.parameter.name",detail:"formula.functionList.LAMBDA.functionParameter.parameter.detail",example:"[x, y, …,]",require:0,repeat:1},{name:"formula.functionList.LAMBDA.functionParameter.calculation.name",detail:"formula.functionList.LAMBDA.functionParameter.calculation.detail",example:"x+y",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.LET,functionType:t.FunctionType.Logical,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.name1.name",detail:"formula.functionList.LET.functionParameter.name1.detail",example:"x",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue1.name",detail:"formula.functionList.LET.functionParameter.nameValue1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.calculationOrName2.name",detail:"formula.functionList.LET.functionParameter.calculationOrName2.detail",example:"y",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.nameValue2.name",detail:"formula.functionList.LET.functionParameter.nameValue2.detail",example:"6",require:0,repeat:1},{name:"formula.functionList.LET.functionParameter.calculationOrName3.name",detail:"formula.functionList.LET.functionParameter.calculationOrName3.detail",example:"SUM(x,y)",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAKEARRAY,aliasFunctionName:"formula.functionList.MAKEARRAY.aliasFunctionName",functionType:t.FunctionType.Logical,description:"formula.functionList.MAKEARRAY.description",abstract:"formula.functionList.MAKEARRAY.abstract",functionParameter:[{name:"formula.functionList.MAKEARRAY.functionParameter.number1.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number1.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.number2.name",detail:"formula.functionList.MAKEARRAY.functionParameter.number2.detail",example:"7",require:1,repeat:0},{name:"formula.functionList.MAKEARRAY.functionParameter.value3.name",detail:"formula.functionList.MAKEARRAY.functionParameter.value3.detail",example:"LAMBDA(r,c, r*c)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.MAP,functionType:t.FunctionType.Logical,description:"formula.functionList.MAP.description",abstract:"formula.functionList.MAP.abstract",functionParameter:[{name:"formula.functionList.MAP.functionParameter.array1.name",detail:"formula.functionList.MAP.functionParameter.array1.detail",example:"D2:D11",require:1,repeat:0},{name:"formula.functionList.MAP.functionParameter.array2.name",detail:"formula.functionList.MAP.functionParameter.array2.detail",example:"E2:E11",require:0,repeat:1},{name:"formula.functionList.MAP.functionParameter.lambda.name",detail:"formula.functionList.MAP.functionParameter.lambda.detail",example:'LAMBDA(s,c,AND(s="Large",c="Red"))',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.NOT,functionType:t.FunctionType.Logical,description:"formula.functionList.NOT.description",abstract:"formula.functionList.NOT.abstract",functionParameter:[{name:"formula.functionList.NOT.functionParameter.logical.name",detail:"formula.functionList.NOT.functionParameter.logical.detail",example:"A2>100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.OR,functionType:t.FunctionType.Logical,description:"formula.functionList.OR.description",abstract:"formula.functionList.OR.abstract",functionParameter:[{name:"formula.functionList.OR.functionParameter.logical1.name",detail:"formula.functionList.OR.functionParameter.logical1.detail",example:"A1=1",require:1,repeat:0},{name:"formula.functionList.OR.functionParameter.logical2.name",detail:"formula.functionList.OR.functionParameter.logical2.detail",example:"A2=2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.REDUCE,functionType:t.FunctionType.Logical,description:"formula.functionList.REDUCE.description",abstract:"formula.functionList.REDUCE.abstract",functionParameter:[{name:"formula.functionList.REDUCE.functionParameter.initialValue.name",detail:"formula.functionList.REDUCE.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.array.name",detail:"formula.functionList.REDUCE.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.REDUCE.functionParameter.lambda.name",detail:"formula.functionList.REDUCE.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SCAN,functionType:t.FunctionType.Logical,description:"formula.functionList.SCAN.description",abstract:"formula.functionList.SCAN.abstract",functionParameter:[{name:"formula.functionList.SCAN.functionParameter.initialValue.name",detail:"formula.functionList.SCAN.functionParameter.initialValue.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.array.name",detail:"formula.functionList.SCAN.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.SCAN.functionParameter.lambda.name",detail:"formula.functionList.SCAN.functionParameter.lambda.detail",example:"LAMBDA(a,b,a+b^2)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOGICAL.SWITCH,functionType:t.FunctionType.Logical,description:"formula.functionList.SWITCH.description",abstract:"formula.functionList.SWITCH.abstract",functionParameter:[{name:"formula.functionList.SWITCH.functionParameter.expression.name",detail:"formula.functionList.SWITCH.functionParameter.expression.detail",example:"WEEKDAY(A2)",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.value1.name",detail:"formula.functionList.SWITCH.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.result1.name",detail:"formula.functionList.SWITCH.functionParameter.result1.detail",example:'"Sunday"',require:1,repeat:0},{name:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.name",detail:"formula.functionList.SWITCH.functionParameter.defaultOrValue2.detail",example:"2",require:0,repeat:1},{name:"formula.functionList.SWITCH.functionParameter.result2.name",detail:"formula.functionList.SWITCH.functionParameter.result2.detail",example:'"Monday"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOGICAL.TRUE,functionType:t.FunctionType.Logical,description:"formula.functionList.TRUE.description",abstract:"formula.functionList.TRUE.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_LOGICAL.XOR,functionType:t.FunctionType.Logical,description:"formula.functionList.XOR.description",abstract:"formula.functionList.XOR.abstract",functionParameter:[{name:"formula.functionList.XOR.functionParameter.logical1.name",detail:"formula.functionList.XOR.functionParameter.logical1.detail",example:"3>0",require:1,repeat:0},{name:"formula.functionList.XOR.functionParameter.logical2.name",detail:"formula.functionList.XOR.functionParameter.logical2.detail",example:"2<9",require:0,repeat:1}]}],je=[{functionName:t.FUNCTION_NAMES_LOOKUP.ADDRESS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ADDRESS.description",abstract:"formula.functionList.ADDRESS.abstract",functionParameter:[{name:"formula.functionList.ADDRESS.functionParameter.row_num.name",detail:"formula.functionList.ADDRESS.functionParameter.row_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.column_num.name",detail:"formula.functionList.ADDRESS.functionParameter.column_num.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.abs_num.name",detail:"formula.functionList.ADDRESS.functionParameter.abs_num.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.a1.name",detail:"formula.functionList.ADDRESS.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0},{name:"formula.functionList.ADDRESS.functionParameter.sheet_text.name",detail:"formula.functionList.ADDRESS.functionParameter.sheet_text.detail",example:'"Sheet2"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.AREAS,functionType:t.FunctionType.Lookup,description:"formula.functionList.AREAS.description",abstract:"formula.functionList.AREAS.abstract",functionParameter:[{name:"formula.functionList.AREAS.functionParameter.reference.name",detail:"formula.functionList.AREAS.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSE.description",abstract:"formula.functionList.CHOOSE.abstract",functionParameter:[{name:"formula.functionList.CHOOSE.functionParameter.indexNum.name",detail:"formula.functionList.CHOOSE.functionParameter.indexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value1.name",detail:"formula.functionList.CHOOSE.functionParameter.value1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CHOOSE.functionParameter.value2.name",detail:"formula.functionList.CHOOSE.functionParameter.value2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSECOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSECOLS.description",abstract:"formula.functionList.CHOOSECOLS.abstract",functionParameter:[{name:"formula.functionList.CHOOSECOLS.functionParameter.array.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.name",detail:"formula.functionList.CHOOSECOLS.functionParameter.colNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.CHOOSEROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.CHOOSEROWS.description",abstract:"formula.functionList.CHOOSEROWS.abstract",functionParameter:[{name:"formula.functionList.CHOOSEROWS.functionParameter.array.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.array.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.name",detail:"formula.functionList.CHOOSEROWS.functionParameter.rowNum2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMN,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMN.description",abstract:"formula.functionList.COLUMN.abstract",functionParameter:[{name:"formula.functionList.COLUMN.functionParameter.reference.name",detail:"formula.functionList.COLUMN.functionParameter.reference.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.COLUMNS,functionType:t.FunctionType.Lookup,description:"formula.functionList.COLUMNS.description",abstract:"formula.functionList.COLUMNS.abstract",functionParameter:[{name:"formula.functionList.COLUMNS.functionParameter.array.name",detail:"formula.functionList.COLUMNS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.DROP,functionType:t.FunctionType.Lookup,description:"formula.functionList.DROP.description",abstract:"formula.functionList.DROP.abstract",functionParameter:[{name:"formula.functionList.DROP.functionParameter.array.name",detail:"formula.functionList.DROP.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.rows.name",detail:"formula.functionList.DROP.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.DROP.functionParameter.columns.name",detail:"formula.functionList.DROP.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.EXPAND,functionType:t.FunctionType.Lookup,description:"formula.functionList.EXPAND.description",abstract:"formula.functionList.EXPAND.abstract",functionParameter:[{name:"formula.functionList.EXPAND.functionParameter.array.name",detail:"formula.functionList.EXPAND.functionParameter.array.detail",example:"A2",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.rows.name",detail:"formula.functionList.EXPAND.functionParameter.rows.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.columns.name",detail:"formula.functionList.EXPAND.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.EXPAND.functionParameter.padWith.name",detail:"formula.functionList.EXPAND.functionParameter.padWith.detail",example:'"-"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FILTER,functionType:t.FunctionType.Lookup,description:"formula.functionList.FILTER.description",abstract:"formula.functionList.FILTER.abstract",functionParameter:[{name:"formula.functionList.FILTER.functionParameter.array.name",detail:"formula.functionList.FILTER.functionParameter.array.detail",example:"A5:D20",require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.include.name",detail:"formula.functionList.FILTER.functionParameter.include.detail",example:'(C5:C20="Apple")*(A5:A20="East")',require:1,repeat:0},{name:"formula.functionList.FILTER.functionParameter.ifEmpty.name",detail:"formula.functionList.FILTER.functionParameter.ifEmpty.detail",example:'""',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.FORMULATEXT,functionType:t.FunctionType.Lookup,description:"formula.functionList.FORMULATEXT.description",abstract:"formula.functionList.FORMULATEXT.abstract",functionParameter:[{name:"formula.functionList.FORMULATEXT.functionParameter.reference.name",detail:"formula.functionList.FORMULATEXT.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.GETPIVOTDATA,functionType:t.FunctionType.Lookup,description:"formula.functionList.GETPIVOTDATA.description",abstract:"formula.functionList.GETPIVOTDATA.abstract",functionParameter:[{name:"formula.functionList.GETPIVOTDATA.functionParameter.number1.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.GETPIVOTDATA.functionParameter.number2.name",detail:"formula.functionList.GETPIVOTDATA.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.HLOOKUP.description",abstract:"formula.functionList.HLOOKUP.abstract",functionParameter:[{name:"formula.functionList.HLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.HLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.HLOOKUP.functionParameter.tableArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.name",detail:"formula.functionList.HLOOKUP.functionParameter.rowIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.HLOOKUP.functionParameter.rangeLookup.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HSTACK.description",abstract:"formula.functionList.HSTACK.abstract",functionParameter:[{name:"formula.functionList.HSTACK.functionParameter.array1.name",detail:"formula.functionList.HSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.HSTACK.functionParameter.array2.name",detail:"formula.functionList.HSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.HYPERLINK,functionType:t.FunctionType.Lookup,description:"formula.functionList.HYPERLINK.description",abstract:"formula.functionList.HYPERLINK.abstract",functionParameter:[{name:"formula.functionList.HYPERLINK.functionParameter.number1.name",detail:"formula.functionList.HYPERLINK.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.HYPERLINK.functionParameter.number2.name",detail:"formula.functionList.HYPERLINK.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.IMAGE,functionType:t.FunctionType.Lookup,description:"formula.functionList.IMAGE.description",abstract:"formula.functionList.IMAGE.abstract",functionParameter:[{name:"formula.functionList.IMAGE.functionParameter.number1.name",detail:"formula.functionList.IMAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.IMAGE.functionParameter.number2.name",detail:"formula.functionList.IMAGE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDEX,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDEX.description",abstract:"formula.functionList.INDEX.abstract",functionParameter:[{name:"formula.functionList.INDEX.functionParameter.reference.name",detail:"formula.functionList.INDEX.functionParameter.reference.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.INDEX.functionParameter.rowNum.name",detail:"formula.functionList.INDEX.functionParameter.rowNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.columnNum.name",detail:"formula.functionList.INDEX.functionParameter.columnNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.INDEX.functionParameter.areaNum.name",detail:"formula.functionList.INDEX.functionParameter.areaNum.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.INDIRECT,functionType:t.FunctionType.Lookup,description:"formula.functionList.INDIRECT.description",abstract:"formula.functionList.INDIRECT.abstract",functionParameter:[{name:"formula.functionList.INDIRECT.functionParameter.refText.name",detail:"formula.functionList.INDIRECT.functionParameter.refText.detail",example:'"A1"',require:1,repeat:0},{name:"formula.functionList.INDIRECT.functionParameter.a1.name",detail:"formula.functionList.INDIRECT.functionParameter.a1.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.LOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.LOOKUP.description",abstract:"formula.functionList.LOOKUP.abstract",functionParameter:[{name:"formula.functionList.LOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.name",detail:"formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LOOKUP.functionParameter.resultVector.name",detail:"formula.functionList.LOOKUP.functionParameter.resultVector.detail",example:"A1:A20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.MATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.MATCH.description",abstract:"formula.functionList.MATCH.abstract",functionParameter:[{name:"formula.functionList.MATCH.functionParameter.lookupValue.name",detail:"formula.functionList.MATCH.functionParameter.lookupValue.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.lookupArray.name",detail:"formula.functionList.MATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MATCH.functionParameter.matchType.name",detail:"formula.functionList.MATCH.functionParameter.matchType.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.OFFSET,functionType:t.FunctionType.Lookup,description:"formula.functionList.OFFSET.description",abstract:"formula.functionList.OFFSET.abstract",functionParameter:[{name:"formula.functionList.OFFSET.functionParameter.reference.name",detail:"formula.functionList.OFFSET.functionParameter.reference.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.rows.name",detail:"formula.functionList.OFFSET.functionParameter.rows.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.cols.name",detail:"formula.functionList.OFFSET.functionParameter.cols.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.height.name",detail:"formula.functionList.OFFSET.functionParameter.height.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.OFFSET.functionParameter.width.name",detail:"formula.functionList.OFFSET.functionParameter.width.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROW.description",abstract:"formula.functionList.ROW.abstract",functionParameter:[{name:"formula.functionList.ROW.functionParameter.reference.name",detail:"formula.functionList.ROW.functionParameter.reference.detail",example:"A1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.ROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.ROWS.description",abstract:"formula.functionList.ROWS.abstract",functionParameter:[{name:"formula.functionList.ROWS.functionParameter.array.name",detail:"formula.functionList.ROWS.functionParameter.array.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.RTD,functionType:t.FunctionType.Lookup,description:"formula.functionList.RTD.description",abstract:"formula.functionList.RTD.abstract",functionParameter:[{name:"formula.functionList.RTD.functionParameter.number1.name",detail:"formula.functionList.RTD.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.RTD.functionParameter.number2.name",detail:"formula.functionList.RTD.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORT,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORT.description",abstract:"formula.functionList.SORT.abstract",functionParameter:[{name:"formula.functionList.SORT.functionParameter.array.name",detail:"formula.functionList.SORT.functionParameter.array.detail",example:"A2:A17",require:1,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortIndex.name",detail:"formula.functionList.SORT.functionParameter.sortIndex.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.sortOrder.name",detail:"formula.functionList.SORT.functionParameter.sortOrder.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SORT.functionParameter.byCol.name",detail:"formula.functionList.SORT.functionParameter.byCol.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.SORTBY,functionType:t.FunctionType.Lookup,description:"formula.functionList.SORTBY.description",abstract:"formula.functionList.SORTBY.abstract",functionParameter:[{name:"formula.functionList.SORTBY.functionParameter.array.name",detail:"formula.functionList.SORTBY.functionParameter.array.detail",example:"D2:D9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray1.name",detail:"formula.functionList.SORTBY.functionParameter.byArray1.detail",example:"E2:E9",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.sortOrder1.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SORTBY.functionParameter.byArray2.name",detail:"formula.functionList.SORTBY.functionParameter.byArray2.detail",example:"E2:E9",require:0,repeat:1},{name:"formula.functionList.SORTBY.functionParameter.sortOrder2.name",detail:"formula.functionList.SORTBY.functionParameter.sortOrder2.detail",example:"1",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TAKE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TAKE.description",abstract:"formula.functionList.TAKE.abstract",functionParameter:[{name:"formula.functionList.TAKE.functionParameter.array.name",detail:"formula.functionList.TAKE.functionParameter.array.detail",example:"A2:C4",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.rows.name",detail:"formula.functionList.TAKE.functionParameter.rows.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.TAKE.functionParameter.columns.name",detail:"formula.functionList.TAKE.functionParameter.columns.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOCOL,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOCOL.description",abstract:"formula.functionList.TOCOL.abstract",functionParameter:[{name:"formula.functionList.TOCOL.functionParameter.array.name",detail:"formula.functionList.TOCOL.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.ignore.name",detail:"formula.functionList.TOCOL.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOCOL.functionParameter.scanByColumn.name",detail:"formula.functionList.TOCOL.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TOROW,functionType:t.FunctionType.Lookup,description:"formula.functionList.TOROW.description",abstract:"formula.functionList.TOROW.abstract",functionParameter:[{name:"formula.functionList.TOROW.functionParameter.array.name",detail:"formula.functionList.TOROW.functionParameter.array.detail",example:"A2:D4",require:1,repeat:0},{name:"formula.functionList.TOROW.functionParameter.ignore.name",detail:"formula.functionList.TOROW.functionParameter.ignore.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TOROW.functionParameter.scanByColumn.name",detail:"formula.functionList.TOROW.functionParameter.scanByColumn.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.TRANSPOSE,functionType:t.FunctionType.Lookup,description:"formula.functionList.TRANSPOSE.description",abstract:"formula.functionList.TRANSPOSE.abstract",functionParameter:[{name:"formula.functionList.TRANSPOSE.functionParameter.array.name",detail:"formula.functionList.TRANSPOSE.functionParameter.array.detail",example:"A2:F9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.UNIQUE,functionType:t.FunctionType.Lookup,description:"formula.functionList.UNIQUE.description",abstract:"formula.functionList.UNIQUE.abstract",functionParameter:[{name:"formula.functionList.UNIQUE.functionParameter.array.name",detail:"formula.functionList.UNIQUE.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.byCol.name",detail:"formula.functionList.UNIQUE.functionParameter.byCol.detail",example:"false",require:0,repeat:0},{name:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.name",detail:"formula.functionList.UNIQUE.functionParameter.exactlyOnce.detail",example:"false",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.VLOOKUP.description",abstract:"formula.functionList.VLOOKUP.abstract",functionParameter:[{name:"formula.functionList.VLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.VLOOKUP.functionParameter.lookupValue.detail",example:"B2",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.tableArray.name",detail:"formula.functionList.VLOOKUP.functionParameter.tableArray.detail",example:"C2:E7",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.name",detail:"formula.functionList.VLOOKUP.functionParameter.colIndexNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.name",detail:"formula.functionList.VLOOKUP.functionParameter.rangeLookup.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.VSTACK,functionType:t.FunctionType.Lookup,description:"formula.functionList.VSTACK.description",abstract:"formula.functionList.VSTACK.abstract",functionParameter:[{name:"formula.functionList.VSTACK.functionParameter.array1.name",detail:"formula.functionList.VSTACK.functionParameter.array1.detail",example:"A2:C3",require:1,repeat:0},{name:"formula.functionList.VSTACK.functionParameter.array2.name",detail:"formula.functionList.VSTACK.functionParameter.array2.detail",example:"E2:G3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPCOLS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPCOLS.description",abstract:"formula.functionList.WRAPCOLS.abstract",functionParameter:[{name:"formula.functionList.WRAPCOLS.functionParameter.vector.name",detail:"formula.functionList.WRAPCOLS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPCOLS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPCOLS.functionParameter.padWith.name",detail:"formula.functionList.WRAPCOLS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.WRAPROWS,functionType:t.FunctionType.Lookup,description:"formula.functionList.WRAPROWS.description",abstract:"formula.functionList.WRAPROWS.abstract",functionParameter:[{name:"formula.functionList.WRAPROWS.functionParameter.vector.name",detail:"formula.functionList.WRAPROWS.functionParameter.vector.detail",example:"A2:G2",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.wrapCount.name",detail:"formula.functionList.WRAPROWS.functionParameter.wrapCount.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.WRAPROWS.functionParameter.padWith.name",detail:"formula.functionList.WRAPROWS.functionParameter.padWith.detail",example:'"x"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XLOOKUP,functionType:t.FunctionType.Lookup,description:"formula.functionList.XLOOKUP.description",abstract:"formula.functionList.XLOOKUP.abstract",functionParameter:[{name:"formula.functionList.XLOOKUP.functionParameter.lookupValue.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupValue.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.lookupArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.returnArray.name",detail:"formula.functionList.XLOOKUP.functionParameter.returnArray.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.name",detail:"formula.functionList.XLOOKUP.functionParameter.ifNotFound.detail",example:"default",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.matchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XLOOKUP.functionParameter.searchMode.name",detail:"formula.functionList.XLOOKUP.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_LOOKUP.XMATCH,functionType:t.FunctionType.Lookup,description:"formula.functionList.XMATCH.description",abstract:"formula.functionList.XMATCH.abstract",functionParameter:[{name:"formula.functionList.XMATCH.functionParameter.lookupValue.name",detail:"formula.functionList.XMATCH.functionParameter.lookupValue.detail",example:"B1",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.lookupArray.name",detail:"formula.functionList.XMATCH.functionParameter.lookupArray.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.matchMode.name",detail:"formula.functionList.XMATCH.functionParameter.matchMode.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.XMATCH.functionParameter.searchMode.name",detail:"formula.functionList.XMATCH.functionParameter.searchMode.detail",example:"1",require:0,repeat:0}]}],ke=[{functionName:t.FUNCTION_NAMES_MATH.ABS,functionType:t.FunctionType.Math,description:"formula.functionList.ABS.description",abstract:"formula.functionList.ABS.abstract",functionParameter:[{name:"formula.functionList.ABS.functionParameter.number.name",detail:"formula.functionList.ABS.functionParameter.number.detail",example:"-2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOS,functionType:t.FunctionType.Math,description:"formula.functionList.ACOS.description",abstract:"formula.functionList.ACOS.abstract",functionParameter:[{name:"formula.functionList.ACOS.functionParameter.number.name",detail:"formula.functionList.ACOS.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOSH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOSH.description",abstract:"formula.functionList.ACOSH.abstract",functionParameter:[{name:"formula.functionList.ACOSH.functionParameter.number.name",detail:"formula.functionList.ACOSH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOT,functionType:t.FunctionType.Math,description:"formula.functionList.ACOT.description",abstract:"formula.functionList.ACOT.abstract",functionParameter:[{name:"formula.functionList.ACOT.functionParameter.number.name",detail:"formula.functionList.ACOT.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ACOTH,functionType:t.FunctionType.Math,description:"formula.functionList.ACOTH.description",abstract:"formula.functionList.ACOTH.abstract",functionParameter:[{name:"formula.functionList.ACOTH.functionParameter.number.name",detail:"formula.functionList.ACOTH.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.AGGREGATE,functionType:t.FunctionType.Math,description:"formula.functionList.AGGREGATE.description",abstract:"formula.functionList.AGGREGATE.abstract",functionParameter:[{name:"formula.functionList.AGGREGATE.functionParameter.number1.name",detail:"formula.functionList.AGGREGATE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AGGREGATE.functionParameter.number2.name",detail:"formula.functionList.AGGREGATE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ARABIC,functionType:t.FunctionType.Math,description:"formula.functionList.ARABIC.description",abstract:"formula.functionList.ARABIC.abstract",functionParameter:[{name:"formula.functionList.ARABIC.functionParameter.text.name",detail:"formula.functionList.ARABIC.functionParameter.text.detail",example:'"LVII"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASIN,functionType:t.FunctionType.Math,description:"formula.functionList.ASIN.description",abstract:"formula.functionList.ASIN.abstract",functionParameter:[{name:"formula.functionList.ASIN.functionParameter.number.name",detail:"formula.functionList.ASIN.functionParameter.number.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ASINH,functionType:t.FunctionType.Math,description:"formula.functionList.ASINH.description",abstract:"formula.functionList.ASINH.abstract",functionParameter:[{name:"formula.functionList.ASINH.functionParameter.number.name",detail:"formula.functionList.ASINH.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN.description",abstract:"formula.functionList.ATAN.abstract",functionParameter:[{name:"formula.functionList.ATAN.functionParameter.number.name",detail:"formula.functionList.ATAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATAN2,functionType:t.FunctionType.Math,description:"formula.functionList.ATAN2.description",abstract:"formula.functionList.ATAN2.abstract",functionParameter:[{name:"formula.functionList.ATAN2.functionParameter.xNum.name",detail:"formula.functionList.ATAN2.functionParameter.xNum.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.ATAN2.functionParameter.yNum.name",detail:"formula.functionList.ATAN2.functionParameter.yNum.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ATANH,functionType:t.FunctionType.Math,description:"formula.functionList.ATANH.description",abstract:"formula.functionList.ATANH.abstract",functionParameter:[{name:"formula.functionList.ATANH.functionParameter.number.name",detail:"formula.functionList.ATANH.functionParameter.number.detail",example:"0.1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.BASE,functionType:t.FunctionType.Math,description:"formula.functionList.BASE.description",abstract:"formula.functionList.BASE.abstract",functionParameter:[{name:"formula.functionList.BASE.functionParameter.number.name",detail:"formula.functionList.BASE.functionParameter.number.detail",example:"15",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.radix.name",detail:"formula.functionList.BASE.functionParameter.radix.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BASE.functionParameter.minLength.name",detail:"formula.functionList.BASE.functionParameter.minLength.detail",example:"10",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING.description",abstract:"formula.functionList.CEILING.abstract",functionParameter:[{name:"formula.functionList.CEILING.functionParameter.number.name",detail:"formula.functionList.CEILING.functionParameter.number.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CEILING.functionParameter.significance.name",detail:"formula.functionList.CEILING.functionParameter.significance.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_MATH.description",abstract:"formula.functionList.CEILING_MATH.abstract",functionParameter:[{name:"formula.functionList.CEILING_MATH.functionParameter.number.name",detail:"formula.functionList.CEILING_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.significance.name",detail:"formula.functionList.CEILING_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.CEILING_MATH.functionParameter.mode.name",detail:"formula.functionList.CEILING_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CEILING_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.CEILING_PRECISE.description",abstract:"formula.functionList.CEILING_PRECISE.abstract",functionParameter:[{name:"formula.functionList.CEILING_PRECISE.functionParameter.number.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.number.detail",example:"4.3",require:1,repeat:0},{name:"formula.functionList.CEILING_PRECISE.functionParameter.significance.name",detail:"formula.functionList.CEILING_PRECISE.functionParameter.significance.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBIN,functionType:t.FunctionType.Math,description:"formula.functionList.COMBIN.description",abstract:"formula.functionList.COMBIN.abstract",functionParameter:[{name:"formula.functionList.COMBIN.functionParameter.number.name",detail:"formula.functionList.COMBIN.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBIN.functionParameter.numberChosen.name",detail:"formula.functionList.COMBIN.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COMBINA,functionType:t.FunctionType.Math,description:"formula.functionList.COMBINA.description",abstract:"formula.functionList.COMBINA.abstract",functionParameter:[{name:"formula.functionList.COMBINA.functionParameter.number.name",detail:"formula.functionList.COMBINA.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.COMBINA.functionParameter.numberChosen.name",detail:"formula.functionList.COMBINA.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COS,functionType:t.FunctionType.Math,description:"formula.functionList.COS.description",abstract:"formula.functionList.COS.abstract",functionParameter:[{name:"formula.functionList.COS.functionParameter.number.name",detail:"formula.functionList.COS.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COSH,functionType:t.FunctionType.Math,description:"formula.functionList.COSH.description",abstract:"formula.functionList.COSH.abstract",functionParameter:[{name:"formula.functionList.COSH.functionParameter.number.name",detail:"formula.functionList.COSH.functionParameter.number.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COT,functionType:t.FunctionType.Math,description:"formula.functionList.COT.description",abstract:"formula.functionList.COT.abstract",functionParameter:[{name:"formula.functionList.COT.functionParameter.number.name",detail:"formula.functionList.COT.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.COTH,functionType:t.FunctionType.Math,description:"formula.functionList.COTH.description",abstract:"formula.functionList.COTH.abstract",functionParameter:[{name:"formula.functionList.COTH.functionParameter.number.name",detail:"formula.functionList.COTH.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSC,functionType:t.FunctionType.Math,description:"formula.functionList.CSC.description",abstract:"formula.functionList.CSC.abstract",functionParameter:[{name:"formula.functionList.CSC.functionParameter.number.name",detail:"formula.functionList.CSC.functionParameter.number.detail",example:"15",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.CSCH,functionType:t.FunctionType.Math,description:"formula.functionList.CSCH.description",abstract:"formula.functionList.CSCH.abstract",functionParameter:[{name:"formula.functionList.CSCH.functionParameter.number.name",detail:"formula.functionList.CSCH.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DECIMAL,functionType:t.FunctionType.Math,description:"formula.functionList.DECIMAL.description",abstract:"formula.functionList.DECIMAL.abstract",functionParameter:[{name:"formula.functionList.DECIMAL.functionParameter.text.name",detail:"formula.functionList.DECIMAL.functionParameter.text.detail",example:'"FF"',require:1,repeat:0},{name:"formula.functionList.DECIMAL.functionParameter.radix.name",detail:"formula.functionList.DECIMAL.functionParameter.radix.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.DEGREES,functionType:t.FunctionType.Math,description:"formula.functionList.DEGREES.description",abstract:"formula.functionList.DEGREES.abstract",functionParameter:[{name:"formula.functionList.DEGREES.functionParameter.angle.name",detail:"formula.functionList.DEGREES.functionParameter.angle.detail",example:"PI()",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EVEN,functionType:t.FunctionType.Math,description:"formula.functionList.EVEN.description",abstract:"formula.functionList.EVEN.abstract",functionParameter:[{name:"formula.functionList.EVEN.functionParameter.number.name",detail:"formula.functionList.EVEN.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.EXP,functionType:t.FunctionType.Math,description:"formula.functionList.EXP.description",abstract:"formula.functionList.EXP.abstract",functionParameter:[{name:"formula.functionList.EXP.functionParameter.number.name",detail:"formula.functionList.EXP.functionParameter.number.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACT,functionType:t.FunctionType.Math,description:"formula.functionList.FACT.description",abstract:"formula.functionList.FACT.abstract",functionParameter:[{name:"formula.functionList.FACT.functionParameter.number.name",detail:"formula.functionList.FACT.functionParameter.number.detail",example:"5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FACTDOUBLE,functionType:t.FunctionType.Math,description:"formula.functionList.FACTDOUBLE.description",abstract:"formula.functionList.FACTDOUBLE.abstract",functionParameter:[{name:"formula.functionList.FACTDOUBLE.functionParameter.number.name",detail:"formula.functionList.FACTDOUBLE.functionParameter.number.detail",example:"6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR.description",abstract:"formula.functionList.FLOOR.abstract",functionParameter:[{name:"formula.functionList.FLOOR.functionParameter.number.name",detail:"formula.functionList.FLOOR.functionParameter.number.detail",example:"3.7",require:1,repeat:0},{name:"formula.functionList.FLOOR.functionParameter.significance.name",detail:"formula.functionList.FLOOR.functionParameter.significance.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_MATH,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_MATH.description",abstract:"formula.functionList.FLOOR_MATH.abstract",functionParameter:[{name:"formula.functionList.FLOOR_MATH.functionParameter.number.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.number.detail",example:"-5.5",require:1,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.significance.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.significance.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FLOOR_MATH.functionParameter.mode.name",detail:"formula.functionList.FLOOR_MATH.functionParameter.mode.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.FLOOR_PRECISE,functionType:t.FunctionType.Math,description:"formula.functionList.FLOOR_PRECISE.description",abstract:"formula.functionList.FLOOR_PRECISE.abstract",functionParameter:[{name:"formula.functionList.FLOOR_PRECISE.functionParameter.number.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.number.detail",example:"-3.2",require:1,repeat:0},{name:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.name",detail:"formula.functionList.FLOOR_PRECISE.functionParameter.significance.detail",example:"-1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.GCD,functionType:t.FunctionType.Math,description:"formula.functionList.GCD.description",abstract:"formula.functionList.GCD.abstract",functionParameter:[{name:"formula.functionList.GCD.functionParameter.number1.name",detail:"formula.functionList.GCD.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.GCD.functionParameter.number2.name",detail:"formula.functionList.GCD.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.INT,functionType:t.FunctionType.Math,description:"formula.functionList.INT.description",abstract:"formula.functionList.INT.abstract",functionParameter:[{name:"formula.functionList.INT.functionParameter.number.name",detail:"formula.functionList.INT.functionParameter.number.detail",example:"8.9",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ISO_CEILING,functionType:t.FunctionType.Math,description:"formula.functionList.ISO_CEILING.description",abstract:"formula.functionList.ISO_CEILING.abstract",functionParameter:[{name:"formula.functionList.ISO_CEILING.functionParameter.number1.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.ISO_CEILING.functionParameter.number2.name",detail:"formula.functionList.ISO_CEILING.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LCM,functionType:t.FunctionType.Math,description:"formula.functionList.LCM.description",abstract:"formula.functionList.LCM.abstract",functionParameter:[{name:"formula.functionList.LCM.functionParameter.number1.name",detail:"formula.functionList.LCM.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.LCM.functionParameter.number2.name",detail:"formula.functionList.LCM.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.LET,functionType:t.FunctionType.Math,description:"formula.functionList.LET.description",abstract:"formula.functionList.LET.abstract",functionParameter:[{name:"formula.functionList.LET.functionParameter.number1.name",detail:"formula.functionList.LET.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.LET.functionParameter.number2.name",detail:"formula.functionList.LET.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LN,functionType:t.FunctionType.Math,description:"formula.functionList.LN.description",abstract:"formula.functionList.LN.abstract",functionParameter:[{name:"formula.functionList.LN.functionParameter.number.name",detail:"formula.functionList.LN.functionParameter.number.detail",example:"EXP(3)",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG,functionType:t.FunctionType.Math,description:"formula.functionList.LOG.description",abstract:"formula.functionList.LOG.abstract",functionParameter:[{name:"formula.functionList.LOG.functionParameter.number.name",detail:"formula.functionList.LOG.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.LOG.functionParameter.base.name",detail:"formula.functionList.LOG.functionParameter.base.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.LOG10,functionType:t.FunctionType.Math,description:"formula.functionList.LOG10.description",abstract:"formula.functionList.LOG10.abstract",functionParameter:[{name:"formula.functionList.LOG10.functionParameter.number.name",detail:"formula.functionList.LOG10.functionParameter.number.detail",example:"100000",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MDETERM,functionType:t.FunctionType.Math,description:"formula.functionList.MDETERM.description",abstract:"formula.functionList.MDETERM.abstract",functionParameter:[{name:"formula.functionList.MDETERM.functionParameter.array.name",detail:"formula.functionList.MDETERM.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MINVERSE,functionType:t.FunctionType.Math,description:"formula.functionList.MINVERSE.description",abstract:"formula.functionList.MINVERSE.abstract",functionParameter:[{name:"formula.functionList.MINVERSE.functionParameter.array.name",detail:"formula.functionList.MINVERSE.functionParameter.array.detail",example:"A1:C3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MMULT,functionType:t.FunctionType.Math,description:"formula.functionList.MMULT.description",abstract:"formula.functionList.MMULT.abstract",functionParameter:[{name:"formula.functionList.MMULT.functionParameter.array1.name",detail:"formula.functionList.MMULT.functionParameter.array1.detail",example:"A2:B3",require:1,repeat:0},{name:"formula.functionList.MMULT.functionParameter.array2.name",detail:"formula.functionList.MMULT.functionParameter.array2.detail",example:"A5:B6",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MOD,functionType:t.FunctionType.Math,description:"formula.functionList.MOD.description",abstract:"formula.functionList.MOD.abstract",functionParameter:[{name:"formula.functionList.MOD.functionParameter.number.name",detail:"formula.functionList.MOD.functionParameter.number.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.MOD.functionParameter.divisor.name",detail:"formula.functionList.MOD.functionParameter.divisor.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MROUND,functionType:t.FunctionType.Math,description:"formula.functionList.MROUND.description",abstract:"formula.functionList.MROUND.abstract",functionParameter:[{name:"formula.functionList.MROUND.functionParameter.number.name",detail:"formula.functionList.MROUND.functionParameter.number.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.MROUND.functionParameter.multiple.name",detail:"formula.functionList.MROUND.functionParameter.multiple.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.MULTINOMIAL,functionType:t.FunctionType.Math,description:"formula.functionList.MULTINOMIAL.description",abstract:"formula.functionList.MULTINOMIAL.abstract",functionParameter:[{name:"formula.functionList.MULTINOMIAL.functionParameter.number1.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number1.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.MULTINOMIAL.functionParameter.number2.name",detail:"formula.functionList.MULTINOMIAL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.MUNIT,functionType:t.FunctionType.Math,description:"formula.functionList.MUNIT.description",abstract:"formula.functionList.MUNIT.abstract",functionParameter:[{name:"formula.functionList.MUNIT.functionParameter.dimension.name",detail:"formula.functionList.MUNIT.functionParameter.dimension.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ODD,functionType:t.FunctionType.Math,description:"formula.functionList.ODD.description",abstract:"formula.functionList.ODD.abstract",functionParameter:[{name:"formula.functionList.ODD.functionParameter.number.name",detail:"formula.functionList.ODD.functionParameter.number.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PI,functionType:t.FunctionType.Math,description:"formula.functionList.PI.description",abstract:"formula.functionList.PI.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.POWER,functionType:t.FunctionType.Math,description:"formula.functionList.POWER.description",abstract:"formula.functionList.POWER.abstract",functionParameter:[{name:"formula.functionList.POWER.functionParameter.number.name",detail:"formula.functionList.POWER.functionParameter.number.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POWER.functionParameter.power.name",detail:"formula.functionList.POWER.functionParameter.power.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.PRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.PRODUCT.description",abstract:"formula.functionList.PRODUCT.abstract",functionParameter:[{name:"formula.functionList.PRODUCT.functionParameter.number1.name",detail:"formula.functionList.PRODUCT.functionParameter.number1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.PRODUCT.functionParameter.number2.name",detail:"formula.functionList.PRODUCT.functionParameter.number2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.QUOTIENT,functionType:t.FunctionType.Math,description:"formula.functionList.QUOTIENT.description",abstract:"formula.functionList.QUOTIENT.abstract",functionParameter:[{name:"formula.functionList.QUOTIENT.functionParameter.numerator.name",detail:"formula.functionList.QUOTIENT.functionParameter.numerator.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.QUOTIENT.functionParameter.denominator.name",detail:"formula.functionList.QUOTIENT.functionParameter.denominator.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RADIANS,functionType:t.FunctionType.Math,description:"formula.functionList.RADIANS.description",abstract:"formula.functionList.RADIANS.abstract",functionParameter:[{name:"formula.functionList.RADIANS.functionParameter.angle.name",detail:"formula.functionList.RADIANS.functionParameter.angle.detail",example:"270",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RAND,functionType:t.FunctionType.Math,description:"formula.functionList.RAND.description",abstract:"formula.functionList.RAND.abstract",functionParameter:[]},{functionName:t.FUNCTION_NAMES_MATH.RANDARRAY,functionType:t.FunctionType.Math,description:"formula.functionList.RANDARRAY.description",abstract:"formula.functionList.RANDARRAY.abstract",functionParameter:[{name:"formula.functionList.RANDARRAY.functionParameter.rows.name",detail:"formula.functionList.RANDARRAY.functionParameter.rows.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.columns.name",detail:"formula.functionList.RANDARRAY.functionParameter.columns.detail",example:"3",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.min.name",detail:"formula.functionList.RANDARRAY.functionParameter.min.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.max.name",detail:"formula.functionList.RANDARRAY.functionParameter.max.detail",example:"100",require:0,repeat:0},{name:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.name",detail:"formula.functionList.RANDARRAY.functionParameter.wholeNumber.detail",example:"TRUE",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.RANDBETWEEN,functionType:t.FunctionType.Math,description:"formula.functionList.RANDBETWEEN.description",abstract:"formula.functionList.RANDBETWEEN.abstract",functionParameter:[{name:"formula.functionList.RANDBETWEEN.functionParameter.bottom.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.bottom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.RANDBETWEEN.functionParameter.top.name",detail:"formula.functionList.RANDBETWEEN.functionParameter.top.detail",example:"100",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROMAN,functionType:t.FunctionType.Math,description:"formula.functionList.ROMAN.description",abstract:"formula.functionList.ROMAN.abstract",functionParameter:[{name:"formula.functionList.ROMAN.functionParameter.number.name",detail:"formula.functionList.ROMAN.functionParameter.number.detail",example:"499",require:1,repeat:0},{name:"formula.functionList.ROMAN.functionParameter.form.name",detail:"formula.functionList.ROMAN.functionParameter.form.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUND,functionType:t.FunctionType.Math,description:"formula.functionList.ROUND.description",abstract:"formula.functionList.ROUND.abstract",functionParameter:[{name:"formula.functionList.ROUND.functionParameter.number.name",detail:"formula.functionList.ROUND.functionParameter.number.detail",example:"2.15",require:1,repeat:0},{name:"formula.functionList.ROUND.functionParameter.numDigits.name",detail:"formula.functionList.ROUND.functionParameter.numDigits.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDBANK,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDBANK.description",abstract:"formula.functionList.ROUNDBANK.abstract",functionParameter:[{name:"formula.functionList.ROUNDBANK.functionParameter.number.name",detail:"formula.functionList.ROUNDBANK.functionParameter.number.detail",example:"2.345",require:1,repeat:0},{name:"formula.functionList.ROUNDBANK.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDBANK.functionParameter.numDigits.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDDOWN,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDDOWN.description",abstract:"formula.functionList.ROUNDDOWN.abstract",functionParameter:[{name:"formula.functionList.ROUNDDOWN.functionParameter.number.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDDOWN.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.ROUNDUP,functionType:t.FunctionType.Math,description:"formula.functionList.ROUNDUP.description",abstract:"formula.functionList.ROUNDUP.abstract",functionParameter:[{name:"formula.functionList.ROUNDUP.functionParameter.number.name",detail:"formula.functionList.ROUNDUP.functionParameter.number.detail",example:"3.2",require:1,repeat:0},{name:"formula.functionList.ROUNDUP.functionParameter.numDigits.name",detail:"formula.functionList.ROUNDUP.functionParameter.numDigits.detail",example:"0",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEC,functionType:t.FunctionType.Math,description:"formula.functionList.SEC.description",abstract:"formula.functionList.SEC.abstract",functionParameter:[{name:"formula.functionList.SEC.functionParameter.number.name",detail:"formula.functionList.SEC.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SECH,functionType:t.FunctionType.Math,description:"formula.functionList.SECH.description",abstract:"formula.functionList.SECH.abstract",functionParameter:[{name:"formula.functionList.SECH.functionParameter.number.name",detail:"formula.functionList.SECH.functionParameter.number.detail",example:"30",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SERIESSUM,functionType:t.FunctionType.Math,description:"formula.functionList.SERIESSUM.description",abstract:"formula.functionList.SERIESSUM.abstract",functionParameter:[{name:"formula.functionList.SERIESSUM.functionParameter.x.name",detail:"formula.functionList.SERIESSUM.functionParameter.x.detail",example:"0.785398163",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.n.name",detail:"formula.functionList.SERIESSUM.functionParameter.n.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.m.name",detail:"formula.functionList.SERIESSUM.functionParameter.m.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.SERIESSUM.functionParameter.coefficients.name",detail:"formula.functionList.SERIESSUM.functionParameter.coefficients.detail",example:"A1:A4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SEQUENCE,functionType:t.FunctionType.Math,description:"formula.functionList.SEQUENCE.description",abstract:"formula.functionList.SEQUENCE.abstract",functionParameter:[{name:"formula.functionList.SEQUENCE.functionParameter.rows.name",detail:"formula.functionList.SEQUENCE.functionParameter.rows.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.columns.name",detail:"formula.functionList.SEQUENCE.functionParameter.columns.detail",example:"5",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.start.name",detail:"formula.functionList.SEQUENCE.functionParameter.start.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.SEQUENCE.functionParameter.step.name",detail:"formula.functionList.SEQUENCE.functionParameter.step.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIGN,functionType:t.FunctionType.Math,description:"formula.functionList.SIGN.description",abstract:"formula.functionList.SIGN.abstract",functionParameter:[{name:"formula.functionList.SIGN.functionParameter.number.name",detail:"formula.functionList.SIGN.functionParameter.number.detail",example:"10",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SIN,functionType:t.FunctionType.Math,description:"formula.functionList.SIN.description",abstract:"formula.functionList.SIN.abstract",functionParameter:[{name:"formula.functionList.SIN.functionParameter.number.name",detail:"formula.functionList.SIN.functionParameter.number.detail",example:"30*PI()/180",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SINH,functionType:t.FunctionType.Math,description:"formula.functionList.SINH.description",abstract:"formula.functionList.SINH.abstract",functionParameter:[{name:"formula.functionList.SINH.functionParameter.number.name",detail:"formula.functionList.SINH.functionParameter.number.detail",example:"0.0342*1.03",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRT,functionType:t.FunctionType.Math,description:"formula.functionList.SQRT.description",abstract:"formula.functionList.SQRT.abstract",functionParameter:[{name:"formula.functionList.SQRT.functionParameter.number.name",detail:"formula.functionList.SQRT.functionParameter.number.detail",example:"16",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SQRTPI,functionType:t.FunctionType.Math,description:"formula.functionList.SQRTPI.description",abstract:"formula.functionList.SQRTPI.abstract",functionParameter:[{name:"formula.functionList.SQRTPI.functionParameter.number.name",detail:"formula.functionList.SQRTPI.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUBTOTAL,functionType:t.FunctionType.Math,description:"formula.functionList.SUBTOTAL.description",abstract:"formula.functionList.SUBTOTAL.abstract",functionParameter:[{name:"formula.functionList.SUBTOTAL.functionParameter.functionNum.name",detail:"formula.functionList.SUBTOTAL.functionParameter.functionNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref1.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUBTOTAL.functionParameter.ref2.name",detail:"formula.functionList.SUBTOTAL.functionParameter.ref2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUM,aliasFunctionName:"formula.functionList.SUM.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUM.description",abstract:"formula.functionList.SUM.abstract",functionParameter:[{name:"formula.functionList.SUM.functionParameter.number1.name",detail:"formula.functionList.SUM.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUM.functionParameter.number2.name",detail:"formula.functionList.SUM.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIF,aliasFunctionName:"formula.functionList.SUMIF.aliasFunctionName",functionType:t.FunctionType.Math,description:"formula.functionList.SUMIF.description",abstract:"formula.functionList.SUMIF.abstract",functionParameter:[{name:"formula.functionList.SUMIF.functionParameter.range.name",detail:"formula.functionList.SUMIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.criteria.name",detail:"formula.functionList.SUMIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.SUMIF.functionParameter.sumRange.name",detail:"formula.functionList.SUMIF.functionParameter.sumRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMIFS,functionType:t.FunctionType.Math,description:"formula.functionList.SUMIFS.description",abstract:"formula.functionList.SUMIFS.abstract",functionParameter:[{name:"formula.functionList.SUMIFS.functionParameter.sumRange.name",detail:"formula.functionList.SUMIFS.functionParameter.sumRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteria1.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.SUMIFS.functionParameter.criteria2.name",detail:"formula.functionList.SUMIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMPRODUCT,functionType:t.FunctionType.Math,description:"formula.functionList.SUMPRODUCT.description",abstract:"formula.functionList.SUMPRODUCT.abstract",functionParameter:[{name:"formula.functionList.SUMPRODUCT.functionParameter.array1.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array1.detail",example:"C2:C5",require:1,repeat:0},{name:"formula.functionList.SUMPRODUCT.functionParameter.array2.name",detail:"formula.functionList.SUMPRODUCT.functionParameter.array2.detail",example:"D2:D5",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMSQ,functionType:t.FunctionType.Math,description:"formula.functionList.SUMSQ.description",abstract:"formula.functionList.SUMSQ.abstract",functionParameter:[{name:"formula.functionList.SUMSQ.functionParameter.number1.name",detail:"formula.functionList.SUMSQ.functionParameter.number1.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.SUMSQ.functionParameter.number2.name",detail:"formula.functionList.SUMSQ.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2MY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2MY2.description",abstract:"formula.functionList.SUMX2MY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2MY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2MY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2MY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMX2PY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMX2PY2.description",abstract:"formula.functionList.SUMX2PY2.abstract",functionParameter:[{name:"formula.functionList.SUMX2PY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMX2PY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMX2PY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.SUMXMY2,functionType:t.FunctionType.Math,description:"formula.functionList.SUMXMY2.description",abstract:"formula.functionList.SUMXMY2.abstract",functionParameter:[{name:"formula.functionList.SUMXMY2.functionParameter.arrayX.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayX.detail",example:"A2:A8",require:1,repeat:0},{name:"formula.functionList.SUMXMY2.functionParameter.arrayY.name",detail:"formula.functionList.SUMXMY2.functionParameter.arrayY.detail",example:"B2:B8",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TAN,functionType:t.FunctionType.Math,description:"formula.functionList.TAN.description",abstract:"formula.functionList.TAN.abstract",functionParameter:[{name:"formula.functionList.TAN.functionParameter.number.name",detail:"formula.functionList.TAN.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TANH,functionType:t.FunctionType.Math,description:"formula.functionList.TANH.description",abstract:"formula.functionList.TANH.abstract",functionParameter:[{name:"formula.functionList.TANH.functionParameter.number.name",detail:"formula.functionList.TANH.functionParameter.number.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_MATH.TRUNC,functionType:t.FunctionType.Math,description:"formula.functionList.TRUNC.description",abstract:"formula.functionList.TRUNC.abstract",functionParameter:[{name:"formula.functionList.TRUNC.functionParameter.number.name",detail:"formula.functionList.TRUNC.functionParameter.number.detail",example:"0.45",require:1,repeat:0},{name:"formula.functionList.TRUNC.functionParameter.numDigits.name",detail:"formula.functionList.TRUNC.functionParameter.numDigits.detail",example:"1",require:0,repeat:0}]}],$e=[{functionName:t.FUNCTION_NAMES_STATISTICAL.AVEDEV,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVEDEV.description",abstract:"formula.functionList.AVEDEV.abstract",functionParameter:[{name:"formula.functionList.AVEDEV.functionParameter.number1.name",detail:"formula.functionList.AVEDEV.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVEDEV.functionParameter.number2.name",detail:"formula.functionList.AVEDEV.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE,aliasFunctionName:"formula.functionList.AVERAGE.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE.description",abstract:"formula.functionList.AVERAGE.abstract",functionParameter:[{name:"formula.functionList.AVERAGE.functionParameter.number1.name",detail:"formula.functionList.AVERAGE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGE.functionParameter.number2.name",detail:"formula.functionList.AVERAGE.functionParameter.number2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGE_WEIGHTED,aliasFunctionName:"formula.functionList.AVERAGE_WEIGHTED.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGE_WEIGHTED.description",abstract:"formula.functionList.AVERAGE_WEIGHTED.abstract",functionParameter:[{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.detail",example:"20",require:0,repeat:1},{name:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.name",detail:"formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.detail",example:"3",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEA,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEA.description",abstract:"formula.functionList.AVERAGEA.abstract",functionParameter:[{name:"formula.functionList.AVERAGEA.functionParameter.value1.name",detail:"formula.functionList.AVERAGEA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEA.functionParameter.value2.name",detail:"formula.functionList.AVERAGEA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIF.description",abstract:"formula.functionList.AVERAGEIF.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIF.functionParameter.range.name",detail:"formula.functionList.AVERAGEIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.criteria.name",detail:"formula.functionList.AVERAGEIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIF.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIF.functionParameter.averageRange.detail",example:"B1:B20",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.AVERAGEIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.AVERAGEIFS.description",abstract:"formula.functionList.AVERAGEIFS.abstract",functionParameter:[{name:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.averageRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.name",detail:"formula.functionList.AVERAGEIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_DIST.description",abstract:"formula.functionList.BETA_DIST.abstract",functionParameter:[{name:"formula.functionList.BETA_DIST.functionParameter.x.name",detail:"formula.functionList.BETA_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.alpha.name",detail:"formula.functionList.BETA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.beta.name",detail:"formula.functionList.BETA_DIST.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BETA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.A.name",detail:"formula.functionList.BETA_DIST.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_DIST.functionParameter.B.name",detail:"formula.functionList.BETA_DIST.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BETA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BETA_INV.description",abstract:"formula.functionList.BETA_INV.abstract",functionParameter:[{name:"formula.functionList.BETA_INV.functionParameter.probability.name",detail:"formula.functionList.BETA_INV.functionParameter.probability.detail",example:"0.685470581",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.alpha.name",detail:"formula.functionList.BETA_INV.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.beta.name",detail:"formula.functionList.BETA_INV.functionParameter.beta.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.A.name",detail:"formula.functionList.BETA_INV.functionParameter.A.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.BETA_INV.functionParameter.B.name",detail:"formula.functionList.BETA_INV.functionParameter.B.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST.description",abstract:"formula.functionList.BINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.numberS.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST.functionParameter.trials.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.BINOM_DIST.functionParameter.cumulative.detail",example:"false",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_DIST_RANGE.description",abstract:"formula.functionList.BINOM_DIST_RANGE.abstract",functionParameter:[{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.detail",example:"60",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.detail",example:"45",require:1,repeat:0},{name:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.name",detail:"formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.detail",example:"50",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.BINOM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.BINOM_INV.description",abstract:"formula.functionList.BINOM_INV.abstract",functionParameter:[{name:"formula.functionList.BINOM_INV.functionParameter.trials.name",detail:"formula.functionList.BINOM_INV.functionParameter.trials.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.probabilityS.name",detail:"formula.functionList.BINOM_INV.functionParameter.probabilityS.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.BINOM_INV.functionParameter.alpha.name",detail:"formula.functionList.BINOM_INV.functionParameter.alpha.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST.description",abstract:"formula.functionList.CHISQ_DIST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.name",detail:"formula.functionList.CHISQ_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_DIST_RT.description",abstract:"formula.functionList.CHISQ_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.x.detail",example:"0.5",require:1,repeat:0},{name:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV.description",abstract:"formula.functionList.CHISQ_INV.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_INV_RT.description",abstract:"formula.functionList.CHISQ_INV_RT.abstract",functionParameter:[{name:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.probability.detail",example:"0.93",require:1,repeat:0},{name:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.name",detail:"formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.CHISQ_TEST.description",abstract:"formula.functionList.CHISQ_TEST.abstract",functionParameter:[{name:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.actualRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.name",detail:"formula.functionList.CHISQ_TEST.functionParameter.expectedRange.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_NORM.description",abstract:"formula.functionList.CONFIDENCE_NORM.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_NORM.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,functionType:t.FunctionType.Statistical,description:"formula.functionList.CONFIDENCE_T.description",abstract:"formula.functionList.CONFIDENCE_T.abstract",functionParameter:[{name:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.alpha.detail",example:"0.05",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.standardDev.detail",example:"2.5",require:1,repeat:0},{name:"formula.functionList.CONFIDENCE_T.functionParameter.size.name",detail:"formula.functionList.CONFIDENCE_T.functionParameter.size.detail",example:"50",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.CORREL,functionType:t.FunctionType.Statistical,description:"formula.functionList.CORREL.description",abstract:"formula.functionList.CORREL.abstract",functionParameter:[{name:"formula.functionList.CORREL.functionParameter.array1.name",detail:"formula.functionList.CORREL.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.CORREL.functionParameter.array2.name",detail:"formula.functionList.CORREL.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNT,aliasFunctionName:"formula.functionList.COUNT.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNT.description",abstract:"formula.functionList.COUNT.abstract",functionParameter:[{name:"formula.functionList.COUNT.functionParameter.value1.name",detail:"formula.functionList.COUNT.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNT.functionParameter.value2.name",detail:"formula.functionList.COUNT.functionParameter.value2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTA,aliasFunctionName:"formula.functionList.COUNTA.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTA.description",abstract:"formula.functionList.COUNTA.abstract",functionParameter:[{name:"formula.functionList.COUNTA.functionParameter.number1.name",detail:"formula.functionList.COUNTA.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTA.functionParameter.number2.name",detail:"formula.functionList.COUNTA.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTBLANK,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTBLANK.description",abstract:"formula.functionList.COUNTBLANK.abstract",functionParameter:[{name:"formula.functionList.COUNTBLANK.functionParameter.range.name",detail:"formula.functionList.COUNTBLANK.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIF,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIF.description",abstract:"formula.functionList.COUNTIF.abstract",functionParameter:[{name:"formula.functionList.COUNTIF.functionParameter.range.name",detail:"formula.functionList.COUNTIF.functionParameter.range.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIF.functionParameter.criteria.name",detail:"formula.functionList.COUNTIF.functionParameter.criteria.detail",example:'">5"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COUNTIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.COUNTIFS.description",abstract:"formula.functionList.COUNTIFS.abstract",functionParameter:[{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteria1.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteriaRange2.detail",example:"B1:B20",require:0,repeat:1},{name:"formula.functionList.COUNTIFS.functionParameter.criteria2.name",detail:"formula.functionList.COUNTIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_P.description",abstract:"formula.functionList.COVARIANCE_P.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_P.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_P.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_P.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.COVARIANCE_S.description",abstract:"formula.functionList.COVARIANCE_S.abstract",functionParameter:[{name:"formula.functionList.COVARIANCE_S.functionParameter.array1.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.COVARIANCE_S.functionParameter.array2.name",detail:"formula.functionList.COVARIANCE_S.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.DEVSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.DEVSQ.description",abstract:"formula.functionList.DEVSQ.abstract",functionParameter:[{name:"formula.functionList.DEVSQ.functionParameter.number1.name",detail:"formula.functionList.DEVSQ.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.DEVSQ.functionParameter.number2.name",detail:"formula.functionList.DEVSQ.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.EXPON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.EXPON_DIST.description",abstract:"formula.functionList.EXPON_DIST.abstract",functionParameter:[{name:"formula.functionList.EXPON_DIST.functionParameter.x.name",detail:"formula.functionList.EXPON_DIST.functionParameter.x.detail",example:"0.2",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.lambda.name",detail:"formula.functionList.EXPON_DIST.functionParameter.lambda.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.EXPON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.EXPON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST.description",abstract:"formula.functionList.F_DIST.abstract",functionParameter:[{name:"formula.functionList.F_DIST.functionParameter.x.name",detail:"formula.functionList.F_DIST.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.F_DIST.functionParameter.cumulative.name",detail:"formula.functionList.F_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_DIST_RT.description",abstract:"formula.functionList.F_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.F_DIST_RT.functionParameter.x.name",detail:"formula.functionList.F_DIST_RT.functionParameter.x.detail",example:"15.2069",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_DIST_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV.description",abstract:"formula.functionList.F_INV.abstract",functionParameter:[{name:"formula.functionList.F_INV.functionParameter.probability.name",detail:"formula.functionList.F_INV.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_INV_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_INV_RT.description",abstract:"formula.functionList.F_INV_RT.abstract",functionParameter:[{name:"formula.functionList.F_INV_RT.functionParameter.probability.name",detail:"formula.functionList.F_INV_RT.functionParameter.probability.detail",example:"0.01",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom1.detail",example:"6",require:1,repeat:0},{name:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.name",detail:"formula.functionList.F_INV_RT.functionParameter.degFreedom2.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.F_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.F_TEST.description",abstract:"formula.functionList.F_TEST.abstract",functionParameter:[{name:"formula.functionList.F_TEST.functionParameter.array1.name",detail:"formula.functionList.F_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.F_TEST.functionParameter.array2.name",detail:"formula.functionList.F_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHER,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHER.description",abstract:"formula.functionList.FISHER.abstract",functionParameter:[{name:"formula.functionList.FISHER.functionParameter.x.name",detail:"formula.functionList.FISHER.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FISHERINV,functionType:t.FunctionType.Statistical,description:"formula.functionList.FISHERINV.description",abstract:"formula.functionList.FISHERINV.abstract",functionParameter:[{name:"formula.functionList.FISHERINV.functionParameter.y.name",detail:"formula.functionList.FISHERINV.functionParameter.y.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST.description",abstract:"formula.functionList.FORECAST.abstract",functionParameter:[{name:"formula.functionList.FORECAST.functionParameter.x.name",detail:"formula.functionList.FORECAST.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS.description",abstract:"formula.functionList.FORECAST_ETS.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_CONFINT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_CONFINT.description",abstract:"formula.functionList.FORECAST_ETS_CONFINT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_SEASONALITY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_SEASONALITY.description",abstract:"formula.functionList.FORECAST_ETS_SEASONALITY.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_ETS_STAT,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_ETS_STAT.description",abstract:"formula.functionList.FORECAST_ETS_STAT.abstract",functionParameter:[{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.name",detail:"formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,functionType:t.FunctionType.Statistical,description:"formula.functionList.FORECAST_LINEAR.description",abstract:"formula.functionList.FORECAST_LINEAR.abstract",functionParameter:[{name:"formula.functionList.FORECAST_LINEAR.functionParameter.x.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.x.detail",example:"30",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.name",detail:"formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.FREQUENCY,functionType:t.FunctionType.Statistical,description:"formula.functionList.FREQUENCY.description",abstract:"formula.functionList.FREQUENCY.abstract",functionParameter:[{name:"formula.functionList.FREQUENCY.functionParameter.dataArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.dataArray.detail",example:"A2:A10",require:1,repeat:0},{name:"formula.functionList.FREQUENCY.functionParameter.binsArray.name",detail:"formula.functionList.FREQUENCY.functionParameter.binsArray.detail",example:"B2:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA.description",abstract:"formula.functionList.GAMMA.abstract",functionParameter:[{name:"formula.functionList.GAMMA.functionParameter.number.name",detail:"formula.functionList.GAMMA.functionParameter.number.detail",example:"2.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_DIST.description",abstract:"formula.functionList.GAMMA_DIST.abstract",functionParameter:[{name:"formula.functionList.GAMMA_DIST.functionParameter.x.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.x.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.alpha.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.beta.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.beta.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.name",detail:"formula.functionList.GAMMA_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMA_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMA_INV.description",abstract:"formula.functionList.GAMMA_INV.abstract",functionParameter:[{name:"formula.functionList.GAMMA_INV.functionParameter.probability.name",detail:"formula.functionList.GAMMA_INV.functionParameter.probability.detail",example:"0.068094",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.alpha.name",detail:"formula.functionList.GAMMA_INV.functionParameter.alpha.detail",example:"9",require:1,repeat:0},{name:"formula.functionList.GAMMA_INV.functionParameter.beta.name",detail:"formula.functionList.GAMMA_INV.functionParameter.beta.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN.description",abstract:"formula.functionList.GAMMALN.abstract",functionParameter:[{name:"formula.functionList.GAMMALN.functionParameter.x.name",detail:"formula.functionList.GAMMALN.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAMMALN_PRECISE.description",abstract:"formula.functionList.GAMMALN_PRECISE.abstract",functionParameter:[{name:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.name",detail:"formula.functionList.GAMMALN_PRECISE.functionParameter.x.detail",example:"4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GAUSS,functionType:t.FunctionType.Statistical,description:"formula.functionList.GAUSS.description",abstract:"formula.functionList.GAUSS.abstract",functionParameter:[{name:"formula.functionList.GAUSS.functionParameter.z.name",detail:"formula.functionList.GAUSS.functionParameter.z.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GEOMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.GEOMEAN.description",abstract:"formula.functionList.GEOMEAN.abstract",functionParameter:[{name:"formula.functionList.GEOMEAN.functionParameter.number1.name",detail:"formula.functionList.GEOMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.GEOMEAN.functionParameter.number2.name",detail:"formula.functionList.GEOMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.GROWTH,functionType:t.FunctionType.Statistical,description:"formula.functionList.GROWTH.description",abstract:"formula.functionList.GROWTH.abstract",functionParameter:[{name:"formula.functionList.GROWTH.functionParameter.knownYs.name",detail:"formula.functionList.GROWTH.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.knownXs.name",detail:"formula.functionList.GROWTH.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.newXs.name",detail:"formula.functionList.GROWTH.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.GROWTH.functionParameter.constb.name",detail:"formula.functionList.GROWTH.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HARMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.HARMEAN.description",abstract:"formula.functionList.HARMEAN.abstract",functionParameter:[{name:"formula.functionList.HARMEAN.functionParameter.number1.name",detail:"formula.functionList.HARMEAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HARMEAN.functionParameter.number2.name",detail:"formula.functionList.HARMEAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.HYPGEOM_DIST.description",abstract:"formula.functionList.HYPGEOM_DIST.abstract",functionParameter:[{name:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.populationS.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.INTERCEPT,functionType:t.FunctionType.Statistical,description:"formula.functionList.INTERCEPT.description",abstract:"formula.functionList.INTERCEPT.abstract",functionParameter:[{name:"formula.functionList.INTERCEPT.functionParameter.knownYs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.INTERCEPT.functionParameter.knownXs.name",detail:"formula.functionList.INTERCEPT.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.KURT,functionType:t.FunctionType.Statistical,description:"formula.functionList.KURT.description",abstract:"formula.functionList.KURT.abstract",functionParameter:[{name:"formula.functionList.KURT.functionParameter.number1.name",detail:"formula.functionList.KURT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.KURT.functionParameter.number2.name",detail:"formula.functionList.KURT.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LARGE,functionType:t.FunctionType.Statistical,description:"formula.functionList.LARGE.description",abstract:"formula.functionList.LARGE.abstract",functionParameter:[{name:"formula.functionList.LARGE.functionParameter.array.name",detail:"formula.functionList.LARGE.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.LARGE.functionParameter.k.name",detail:"formula.functionList.LARGE.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LINEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LINEST.description",abstract:"formula.functionList.LINEST.abstract",functionParameter:[{name:"formula.functionList.LINEST.functionParameter.knownYs.name",detail:"formula.functionList.LINEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LINEST.functionParameter.knownXs.name",detail:"formula.functionList.LINEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.constb.name",detail:"formula.functionList.LINEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LINEST.functionParameter.stats.name",detail:"formula.functionList.LINEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGEST.description",abstract:"formula.functionList.LOGEST.abstract",functionParameter:[{name:"formula.functionList.LOGEST.functionParameter.knownYs.name",detail:"formula.functionList.LOGEST.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.knownXs.name",detail:"formula.functionList.LOGEST.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.constb.name",detail:"formula.functionList.LOGEST.functionParameter.constb.detail",example:"true",require:0,repeat:0},{name:"formula.functionList.LOGEST.functionParameter.stats.name",detail:"formula.functionList.LOGEST.functionParameter.stats.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_DIST.description",abstract:"formula.functionList.LOGNORM_DIST.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_DIST.functionParameter.x.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.LOGNORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.LOGNORM_INV.description",abstract:"formula.functionList.LOGNORM_INV.abstract",functionParameter:[{name:"formula.functionList.LOGNORM_INV.functionParameter.probability.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.mean.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.LOGNORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MARGINOFERROR,aliasFunctionName:"formula.functionList.MARGINOFERROR.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MARGINOFERROR.description",abstract:"formula.functionList.MARGINOFERROR.abstract",functionParameter:[{name:"formula.functionList.MARGINOFERROR.functionParameter.range.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.range.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MARGINOFERROR.functionParameter.confidence.name",detail:"formula.functionList.MARGINOFERROR.functionParameter.confidence.detail",example:"0.95",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAX,aliasFunctionName:"formula.functionList.MAX.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MAX.description",abstract:"formula.functionList.MAX.abstract",functionParameter:[{name:"formula.functionList.MAX.functionParameter.number1.name",detail:"formula.functionList.MAX.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAX.functionParameter.number2.name",detail:"formula.functionList.MAX.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXA.description",abstract:"formula.functionList.MAXA.abstract",functionParameter:[{name:"formula.functionList.MAXA.functionParameter.value1.name",detail:"formula.functionList.MAXA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXA.functionParameter.value2.name",detail:"formula.functionList.MAXA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MAXIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MAXIFS.description",abstract:"formula.functionList.MAXIFS.abstract",functionParameter:[{name:"formula.functionList.MAXIFS.functionParameter.maxRange.name",detail:"formula.functionList.MAXIFS.functionParameter.maxRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteria1.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MAXIFS.functionParameter.criteria2.name",detail:"formula.functionList.MAXIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MEDIAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.MEDIAN.description",abstract:"formula.functionList.MEDIAN.abstract",functionParameter:[{name:"formula.functionList.MEDIAN.functionParameter.number1.name",detail:"formula.functionList.MEDIAN.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MEDIAN.functionParameter.number2.name",detail:"formula.functionList.MEDIAN.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MIN,aliasFunctionName:"formula.functionList.MIN.aliasFunctionName",functionType:t.FunctionType.Statistical,description:"formula.functionList.MIN.description",abstract:"formula.functionList.MIN.abstract",functionParameter:[{name:"formula.functionList.MIN.functionParameter.number1.name",detail:"formula.functionList.MIN.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MIN.functionParameter.number2.name",detail:"formula.functionList.MIN.functionParameter.number2.detail",example:"B2:B10",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINA,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINA.description",abstract:"formula.functionList.MINA.abstract",functionParameter:[{name:"formula.functionList.MINA.functionParameter.value1.name",detail:"formula.functionList.MINA.functionParameter.value1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINA.functionParameter.value2.name",detail:"formula.functionList.MINA.functionParameter.value2.detail",example:"B1:B20",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MINIFS,functionType:t.FunctionType.Statistical,description:"formula.functionList.MINIFS.description",abstract:"formula.functionList.MINIFS.abstract",functionParameter:[{name:"formula.functionList.MINIFS.functionParameter.minRange.name",detail:"formula.functionList.MINIFS.functionParameter.minRange.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange1.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange1.detail",example:"B1:B20",require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteria1.name",detail:"formula.functionList.MINIFS.functionParameter.criteria1.detail",example:'">10"',require:1,repeat:0},{name:"formula.functionList.MINIFS.functionParameter.criteriaRange2.name",detail:"formula.functionList.MINIFS.functionParameter.criteriaRange2.detail",example:"C1:C20",require:0,repeat:1},{name:"formula.functionList.MINIFS.functionParameter.criteria2.name",detail:"formula.functionList.MINIFS.functionParameter.criteria2.detail",example:'"<20"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_MULT,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_MULT.description",abstract:"formula.functionList.MODE_MULT.abstract",functionParameter:[{name:"formula.functionList.MODE_MULT.functionParameter.number1.name",detail:"formula.functionList.MODE_MULT.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_MULT.functionParameter.number2.name",detail:"formula.functionList.MODE_MULT.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.MODE_SNGL,functionType:t.FunctionType.Statistical,description:"formula.functionList.MODE_SNGL.description",abstract:"formula.functionList.MODE_SNGL.abstract",functionParameter:[{name:"formula.functionList.MODE_SNGL.functionParameter.number1.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.MODE_SNGL.functionParameter.number2.name",detail:"formula.functionList.MODE_SNGL.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NEGBINOM_DIST.description",abstract:"formula.functionList.NEGBINOM_DIST.abstract",functionParameter:[{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberF.detail",example:"10",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.numberS.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.detail",example:"0.25",require:1,repeat:0},{name:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_DIST.description",abstract:"formula.functionList.NORM_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_DIST.functionParameter.x.name",detail:"formula.functionList.NORM_DIST.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.mean.name",detail:"formula.functionList.NORM_DIST.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.standardDev.name",detail:"formula.functionList.NORM_DIST.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.NORM_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_INV.description",abstract:"formula.functionList.NORM_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.mean.name",detail:"formula.functionList.NORM_INV.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.NORM_INV.functionParameter.standardDev.name",detail:"formula.functionList.NORM_INV.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_DIST.description",abstract:"formula.functionList.NORM_S_DIST.abstract",functionParameter:[{name:"formula.functionList.NORM_S_DIST.functionParameter.z.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.z.detail",example:"1.333333",require:1,repeat:0},{name:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.name",detail:"formula.functionList.NORM_S_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.NORM_S_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.NORM_S_INV.description",abstract:"formula.functionList.NORM_S_INV.abstract",functionParameter:[{name:"formula.functionList.NORM_S_INV.functionParameter.probability.name",detail:"formula.functionList.NORM_S_INV.functionParameter.probability.detail",example:"0.908789",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PEARSON,functionType:t.FunctionType.Statistical,description:"formula.functionList.PEARSON.description",abstract:"formula.functionList.PEARSON.abstract",functionParameter:[{name:"formula.functionList.PEARSON.functionParameter.array1.name",detail:"formula.functionList.PEARSON.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PEARSON.functionParameter.array2.name",detail:"formula.functionList.PEARSON.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_EXC.description",abstract:"formula.functionList.PERCENTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_EXC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_EXC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTILE_INC.description",abstract:"formula.functionList.PERCENTILE_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTILE_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTILE_INC.functionParameter.k.name",detail:"formula.functionList.PERCENTILE_INC.functionParameter.k.detail",example:"0.3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_EXC.description",abstract:"formula.functionList.PERCENTRANK_EXC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_EXC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERCENTRANK_INC.description",abstract:"formula.functionList.PERCENTRANK_INC.abstract",functionParameter:[{name:"formula.functionList.PERCENTRANK_INC.functionParameter.array.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.x.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.x.detail",example:"1.5",require:1,repeat:0},{name:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.name",detail:"formula.functionList.PERCENTRANK_INC.functionParameter.significance.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUT,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUT.description",abstract:"formula.functionList.PERMUT.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,functionType:t.FunctionType.Statistical,description:"formula.functionList.PERMUTATIONA.description",abstract:"formula.functionList.PERMUTATIONA.abstract",functionParameter:[{name:"formula.functionList.PERMUT.functionParameter.number.name",detail:"formula.functionList.PERMUT.functionParameter.number.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.PERMUT.functionParameter.numberChosen.name",detail:"formula.functionList.PERMUT.functionParameter.numberChosen.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PHI,functionType:t.FunctionType.Statistical,description:"formula.functionList.PHI.description",abstract:"formula.functionList.PHI.abstract",functionParameter:[{name:"formula.functionList.PHI.functionParameter.x.name",detail:"formula.functionList.PHI.functionParameter.x.detail",example:"0.75",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.POISSON_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.POISSON_DIST.description",abstract:"formula.functionList.POISSON_DIST.abstract",functionParameter:[{name:"formula.functionList.POISSON_DIST.functionParameter.x.name",detail:"formula.functionList.POISSON_DIST.functionParameter.x.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.mean.name",detail:"formula.functionList.POISSON_DIST.functionParameter.mean.detail",example:"5",require:1,repeat:0},{name:"formula.functionList.POISSON_DIST.functionParameter.cumulative.name",detail:"formula.functionList.POISSON_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.PROB,functionType:t.FunctionType.Statistical,description:"formula.functionList.PROB.description",abstract:"formula.functionList.PROB.abstract",functionParameter:[{name:"formula.functionList.PROB.functionParameter.xRange.name",detail:"formula.functionList.PROB.functionParameter.xRange.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.probRange.name",detail:"formula.functionList.PROB.functionParameter.probRange.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.lowerLimit.name",detail:"formula.functionList.PROB.functionParameter.lowerLimit.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.PROB.functionParameter.upperLimit.name",detail:"formula.functionList.PROB.functionParameter.upperLimit.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_EXC.description",abstract:"formula.functionList.QUARTILE_EXC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_EXC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_EXC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_EXC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,functionType:t.FunctionType.Statistical,description:"formula.functionList.QUARTILE_INC.description",abstract:"formula.functionList.QUARTILE_INC.abstract",functionParameter:[{name:"formula.functionList.QUARTILE_INC.functionParameter.array.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.array.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.QUARTILE_INC.functionParameter.quart.name",detail:"formula.functionList.QUARTILE_INC.functionParameter.quart.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_AVG,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_AVG.description",abstract:"formula.functionList.RANK_AVG.abstract",functionParameter:[{name:"formula.functionList.RANK_AVG.functionParameter.number.name",detail:"formula.functionList.RANK_AVG.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.ref.name",detail:"formula.functionList.RANK_AVG.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_AVG.functionParameter.order.name",detail:"formula.functionList.RANK_AVG.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RANK_EQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RANK_EQ.description",abstract:"formula.functionList.RANK_EQ.abstract",functionParameter:[{name:"formula.functionList.RANK_EQ.functionParameter.number.name",detail:"formula.functionList.RANK_EQ.functionParameter.number.detail",example:"A3",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.ref.name",detail:"formula.functionList.RANK_EQ.functionParameter.ref.detail",example:"A2:A6",require:1,repeat:0},{name:"formula.functionList.RANK_EQ.functionParameter.order.name",detail:"formula.functionList.RANK_EQ.functionParameter.order.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.RSQ,functionType:t.FunctionType.Statistical,description:"formula.functionList.RSQ.description",abstract:"formula.functionList.RSQ.abstract",functionParameter:[{name:"formula.functionList.RSQ.functionParameter.array1.name",detail:"formula.functionList.RSQ.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.RSQ.functionParameter.array2.name",detail:"formula.functionList.RSQ.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW.description",abstract:"formula.functionList.SKEW.abstract",functionParameter:[{name:"formula.functionList.SKEW.functionParameter.number1.name",detail:"formula.functionList.SKEW.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW.functionParameter.number2.name",detail:"formula.functionList.SKEW.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SKEW_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.SKEW_P.description",abstract:"formula.functionList.SKEW_P.abstract",functionParameter:[{name:"formula.functionList.SKEW_P.functionParameter.number1.name",detail:"formula.functionList.SKEW_P.functionParameter.number1.detail",example:"A1:C3",require:1,repeat:0},{name:"formula.functionList.SKEW_P.functionParameter.number2.name",detail:"formula.functionList.SKEW_P.functionParameter.number2.detail",example:"4",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SLOPE,functionType:t.FunctionType.Statistical,description:"formula.functionList.SLOPE.description",abstract:"formula.functionList.SLOPE.abstract",functionParameter:[{name:"formula.functionList.SLOPE.functionParameter.knownYs.name",detail:"formula.functionList.SLOPE.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.SLOPE.functionParameter.knownXs.name",detail:"formula.functionList.SLOPE.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.SMALL,functionType:t.FunctionType.Statistical,description:"formula.functionList.SMALL.description",abstract:"formula.functionList.SMALL.abstract",functionParameter:[{name:"formula.functionList.SMALL.functionParameter.array.name",detail:"formula.functionList.SMALL.functionParameter.array.detail",example:"A2:B6",require:1,repeat:0},{name:"formula.functionList.SMALL.functionParameter.k.name",detail:"formula.functionList.SMALL.functionParameter.k.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STANDARDIZE,functionType:t.FunctionType.Statistical,description:"formula.functionList.STANDARDIZE.description",abstract:"formula.functionList.STANDARDIZE.abstract",functionParameter:[{name:"formula.functionList.STANDARDIZE.functionParameter.x.name",detail:"formula.functionList.STANDARDIZE.functionParameter.x.detail",example:"42",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.mean.name",detail:"formula.functionList.STANDARDIZE.functionParameter.mean.detail",example:"40",require:1,repeat:0},{name:"formula.functionList.STANDARDIZE.functionParameter.standardDev.name",detail:"formula.functionList.STANDARDIZE.functionParameter.standardDev.detail",example:"1.5",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_P.description",abstract:"formula.functionList.STDEV_P.abstract",functionParameter:[{name:"formula.functionList.STDEV_P.functionParameter.number1.name",detail:"formula.functionList.STDEV_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_P.functionParameter.number2.name",detail:"formula.functionList.STDEV_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEV_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEV_S.description",abstract:"formula.functionList.STDEV_S.abstract",functionParameter:[{name:"formula.functionList.STDEV_S.functionParameter.number1.name",detail:"formula.functionList.STDEV_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEV_S.functionParameter.number2.name",detail:"formula.functionList.STDEV_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVA.description",abstract:"formula.functionList.STDEVA.abstract",functionParameter:[{name:"formula.functionList.STDEVA.functionParameter.value1.name",detail:"formula.functionList.STDEVA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVA.functionParameter.value2.name",detail:"formula.functionList.STDEVA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STDEVPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.STDEVPA.description",abstract:"formula.functionList.STDEVPA.abstract",functionParameter:[{name:"formula.functionList.STDEVPA.functionParameter.value1.name",detail:"formula.functionList.STDEVPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.STDEVPA.functionParameter.value2.name",detail:"formula.functionList.STDEVPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.STEYX,functionType:t.FunctionType.Statistical,description:"formula.functionList.STEYX.description",abstract:"formula.functionList.STEYX.abstract",functionParameter:[{name:"formula.functionList.STEYX.functionParameter.knownYs.name",detail:"formula.functionList.STEYX.functionParameter.knownYs.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.STEYX.functionParameter.knownXs.name",detail:"formula.functionList.STEYX.functionParameter.knownXs.detail",example:"B1:B4",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST.description",abstract:"formula.functionList.T_DIST.abstract",functionParameter:[{name:"formula.functionList.T_DIST.functionParameter.x.name",detail:"formula.functionList.T_DIST.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0},{name:"formula.functionList.T_DIST.functionParameter.cumulative.name",detail:"formula.functionList.T_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_2T.description",abstract:"formula.functionList.T_DIST_2T.abstract",functionParameter:[{name:"formula.functionList.T_DIST_2T.functionParameter.x.name",detail:"formula.functionList.T_DIST_2T.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_2T.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_DIST_RT,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_DIST_RT.description",abstract:"formula.functionList.T_DIST_RT.abstract",functionParameter:[{name:"formula.functionList.T_DIST_RT.functionParameter.x.name",detail:"formula.functionList.T_DIST_RT.functionParameter.x.detail",example:"8",require:1,repeat:0},{name:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.name",detail:"formula.functionList.T_DIST_RT.functionParameter.degFreedom.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV.description",abstract:"formula.functionList.T_INV.abstract",functionParameter:[{name:"formula.functionList.T_INV.functionParameter.probability.name",detail:"formula.functionList.T_INV.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_INV_2T,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_INV_2T.description",abstract:"formula.functionList.T_INV_2T.abstract",functionParameter:[{name:"formula.functionList.T_INV_2T.functionParameter.probability.name",detail:"formula.functionList.T_INV_2T.functionParameter.probability.detail",example:"0.75",require:1,repeat:0},{name:"formula.functionList.T_INV_2T.functionParameter.degFreedom.name",detail:"formula.functionList.T_INV_2T.functionParameter.degFreedom.detail",example:"2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.T_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.T_TEST.description",abstract:"formula.functionList.T_TEST.abstract",functionParameter:[{name:"formula.functionList.T_TEST.functionParameter.array1.name",detail:"formula.functionList.T_TEST.functionParameter.array1.detail",example:"A1:A4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.array2.name",detail:"formula.functionList.T_TEST.functionParameter.array2.detail",example:"B1:B4",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.tails.name",detail:"formula.functionList.T_TEST.functionParameter.tails.detail",example:"2",require:1,repeat:0},{name:"formula.functionList.T_TEST.functionParameter.type.name",detail:"formula.functionList.T_TEST.functionParameter.type.detail",example:"1",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TREND,functionType:t.FunctionType.Statistical,description:"formula.functionList.TREND.description",abstract:"formula.functionList.TREND.abstract",functionParameter:[{name:"formula.functionList.TREND.functionParameter.knownYs.name",detail:"formula.functionList.TREND.functionParameter.knownYs.detail",example:"B2:B7",require:1,repeat:0},{name:"formula.functionList.TREND.functionParameter.knownXs.name",detail:"formula.functionList.TREND.functionParameter.knownXs.detail",example:"A2:A7",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.newXs.name",detail:"formula.functionList.TREND.functionParameter.newXs.detail",example:"A9:A10",require:0,repeat:0},{name:"formula.functionList.TREND.functionParameter.constb.name",detail:"formula.functionList.TREND.functionParameter.constb.detail",example:"true",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.TRIMMEAN,functionType:t.FunctionType.Statistical,description:"formula.functionList.TRIMMEAN.description",abstract:"formula.functionList.TRIMMEAN.abstract",functionParameter:[{name:"formula.functionList.TRIMMEAN.functionParameter.array.name",detail:"formula.functionList.TRIMMEAN.functionParameter.array.detail",example:"A2:A12",require:1,repeat:0},{name:"formula.functionList.TRIMMEAN.functionParameter.percent.name",detail:"formula.functionList.TRIMMEAN.functionParameter.percent.detail",example:"0.2",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_P,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_P.description",abstract:"formula.functionList.VAR_P.abstract",functionParameter:[{name:"formula.functionList.VAR_P.functionParameter.number1.name",detail:"formula.functionList.VAR_P.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_P.functionParameter.number2.name",detail:"formula.functionList.VAR_P.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VAR_S,functionType:t.FunctionType.Statistical,description:"formula.functionList.VAR_S.description",abstract:"formula.functionList.VAR_S.abstract",functionParameter:[{name:"formula.functionList.VAR_S.functionParameter.number1.name",detail:"formula.functionList.VAR_S.functionParameter.number1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VAR_S.functionParameter.number2.name",detail:"formula.functionList.VAR_S.functionParameter.number2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARA.description",abstract:"formula.functionList.VARA.abstract",functionParameter:[{name:"formula.functionList.VARA.functionParameter.value1.name",detail:"formula.functionList.VARA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARA.functionParameter.value2.name",detail:"formula.functionList.VARA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.VARPA,functionType:t.FunctionType.Statistical,description:"formula.functionList.VARPA.description",abstract:"formula.functionList.VARPA.abstract",functionParameter:[{name:"formula.functionList.VARPA.functionParameter.value1.name",detail:"formula.functionList.VARPA.functionParameter.value1.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.VARPA.functionParameter.value2.name",detail:"formula.functionList.VARPA.functionParameter.value2.detail",example:"2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,functionType:t.FunctionType.Statistical,description:"formula.functionList.WEIBULL_DIST.description",abstract:"formula.functionList.WEIBULL_DIST.abstract",functionParameter:[{name:"formula.functionList.WEIBULL_DIST.functionParameter.x.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.x.detail",example:"105",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.alpha.detail",example:"20",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.beta.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.beta.detail",example:"100",require:1,repeat:0},{name:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.name",detail:"formula.functionList.WEIBULL_DIST.functionParameter.cumulative.detail",example:"true",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_STATISTICAL.Z_TEST,functionType:t.FunctionType.Statistical,description:"formula.functionList.Z_TEST.description",abstract:"formula.functionList.Z_TEST.abstract",functionParameter:[{name:"formula.functionList.Z_TEST.functionParameter.array.name",detail:"formula.functionList.Z_TEST.functionParameter.array.detail",example:"A2:A11",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.x.name",detail:"formula.functionList.Z_TEST.functionParameter.x.detail",example:"4",require:1,repeat:0},{name:"formula.functionList.Z_TEST.functionParameter.sigma.name",detail:"formula.functionList.Z_TEST.functionParameter.sigma.detail",example:"10",require:0,repeat:0}]}],ze=[{functionName:t.FUNCTION_NAMES_TEXT.ASC,functionType:t.FunctionType.Text,description:"formula.functionList.ASC.description",abstract:"formula.functionList.ASC.abstract",functionParameter:[{name:"formula.functionList.ASC.functionParameter.text.name",detail:"formula.functionList.ASC.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.ARRAYTOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.ARRAYTOTEXT.description",abstract:"formula.functionList.ARRAYTOTEXT.abstract",functionParameter:[{name:"formula.functionList.ARRAYTOTEXT.functionParameter.array.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.array.detail",example:"A2:B4",require:1,repeat:0},{name:"formula.functionList.ARRAYTOTEXT.functionParameter.format.name",detail:"formula.functionList.ARRAYTOTEXT.functionParameter.format.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.BAHTTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.BAHTTEXT.description",abstract:"formula.functionList.BAHTTEXT.abstract",functionParameter:[{name:"formula.functionList.BAHTTEXT.functionParameter.number.name",detail:"formula.functionList.BAHTTEXT.functionParameter.number.detail",example:"1234",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CHAR,functionType:t.FunctionType.Text,description:"formula.functionList.CHAR.description",abstract:"formula.functionList.CHAR.abstract",functionParameter:[{name:"formula.functionList.CHAR.functionParameter.number.name",detail:"formula.functionList.CHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CLEAN,functionType:t.FunctionType.Text,description:"formula.functionList.CLEAN.description",abstract:"formula.functionList.CLEAN.abstract",functionParameter:[{name:"formula.functionList.CLEAN.functionParameter.text.name",detail:"formula.functionList.CLEAN.functionParameter.text.detail",example:'CHAR(1)&"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CODE,functionType:t.FunctionType.Text,description:"formula.functionList.CODE.description",abstract:"formula.functionList.CODE.abstract",functionParameter:[{name:"formula.functionList.CODE.functionParameter.text.name",detail:"formula.functionList.CODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCAT,functionType:t.FunctionType.Text,description:"formula.functionList.CONCAT.description",abstract:"formula.functionList.CONCAT.abstract",functionParameter:[{name:"formula.functionList.CONCAT.functionParameter.text1.name",detail:"formula.functionList.CONCAT.functionParameter.text1.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.CONCAT.functionParameter.text2.name",detail:"formula.functionList.CONCAT.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.CONCATENATE,functionType:t.FunctionType.Text,description:"formula.functionList.CONCATENATE.description",abstract:"formula.functionList.CONCATENATE.abstract",functionParameter:[{name:"formula.functionList.CONCATENATE.functionParameter.text1.name",detail:"formula.functionList.CONCATENATE.functionParameter.text1.detail",example:"A1",require:1,repeat:0},{name:"formula.functionList.CONCATENATE.functionParameter.text2.name",detail:"formula.functionList.CONCATENATE.functionParameter.text2.detail",example:"A2",require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.DBCS,functionType:t.FunctionType.Text,description:"formula.functionList.DBCS.description",abstract:"formula.functionList.DBCS.abstract",functionParameter:[{name:"formula.functionList.DBCS.functionParameter.text.name",detail:"formula.functionList.DBCS.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.DOLLAR,functionType:t.FunctionType.Text,description:"formula.functionList.DOLLAR.description",abstract:"formula.functionList.DOLLAR.abstract",functionParameter:[{name:"formula.functionList.DOLLAR.functionParameter.number.name",detail:"formula.functionList.DOLLAR.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.DOLLAR.functionParameter.decimals.name",detail:"formula.functionList.DOLLAR.functionParameter.decimals.detail",example:"2",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EXACT,functionType:t.FunctionType.Text,description:"formula.functionList.EXACT.description",abstract:"formula.functionList.EXACT.abstract",functionParameter:[{name:"formula.functionList.EXACT.functionParameter.text1.name",detail:"formula.functionList.EXACT.functionParameter.text1.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.EXACT.functionParameter.text2.name",detail:"formula.functionList.EXACT.functionParameter.text2.detail",example:'"univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIND,functionType:t.FunctionType.Text,description:"formula.functionList.FIND.description",abstract:"formula.functionList.FIND.abstract",functionParameter:[{name:"formula.functionList.FIND.functionParameter.findText.name",detail:"formula.functionList.FIND.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.withinText.name",detail:"formula.functionList.FIND.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FIND.functionParameter.startNum.name",detail:"formula.functionList.FIND.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FINDB,functionType:t.FunctionType.Text,description:"formula.functionList.FINDB.description",abstract:"formula.functionList.FINDB.abstract",functionParameter:[{name:"formula.functionList.FINDB.functionParameter.findText.name",detail:"formula.functionList.FINDB.functionParameter.findText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.withinText.name",detail:"formula.functionList.FINDB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.FINDB.functionParameter.startNum.name",detail:"formula.functionList.FINDB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.FIXED,functionType:t.FunctionType.Text,description:"formula.functionList.FIXED.description",abstract:"formula.functionList.FIXED.abstract",functionParameter:[{name:"formula.functionList.FIXED.functionParameter.number.name",detail:"formula.functionList.FIXED.functionParameter.number.detail",example:"1234.567",require:1,repeat:0},{name:"formula.functionList.FIXED.functionParameter.decimals.name",detail:"formula.functionList.FIXED.functionParameter.decimals.detail",example:"2",require:0,repeat:0},{name:"formula.functionList.FIXED.functionParameter.noCommas.name",detail:"formula.functionList.FIXED.functionParameter.noCommas.detail",example:"0",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFT,functionType:t.FunctionType.Text,description:"formula.functionList.LEFT.description",abstract:"formula.functionList.LEFT.abstract",functionParameter:[{name:"formula.functionList.LEFT.functionParameter.text.name",detail:"formula.functionList.LEFT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFT.functionParameter.numChars.name",detail:"formula.functionList.LEFT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEFTB,functionType:t.FunctionType.Text,description:"formula.functionList.LEFTB.description",abstract:"formula.functionList.LEFTB.abstract",functionParameter:[{name:"formula.functionList.LEFTB.functionParameter.text.name",detail:"formula.functionList.LEFTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.LEFTB.functionParameter.numBytes.name",detail:"formula.functionList.LEFTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LEN,functionType:t.FunctionType.Text,description:"formula.functionList.LEN.description",abstract:"formula.functionList.LEN.abstract",functionParameter:[{name:"formula.functionList.LEN.functionParameter.text.name",detail:"formula.functionList.LEN.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LENB,functionType:t.FunctionType.Text,description:"formula.functionList.LENB.description",abstract:"formula.functionList.LENB.abstract",functionParameter:[{name:"formula.functionList.LENB.functionParameter.text.name",detail:"formula.functionList.LENB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.LOWER,functionType:t.FunctionType.Text,description:"formula.functionList.LOWER.description",abstract:"formula.functionList.LOWER.abstract",functionParameter:[{name:"formula.functionList.LOWER.functionParameter.text.name",detail:"formula.functionList.LOWER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MID,functionType:t.FunctionType.Text,description:"formula.functionList.MID.description",abstract:"formula.functionList.MID.abstract",functionParameter:[{name:"formula.functionList.MID.functionParameter.text.name",detail:"formula.functionList.MID.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.startNum.name",detail:"formula.functionList.MID.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MID.functionParameter.numChars.name",detail:"formula.functionList.MID.functionParameter.numChars.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.MIDB,functionType:t.FunctionType.Text,description:"formula.functionList.MIDB.description",abstract:"formula.functionList.MIDB.abstract",functionParameter:[{name:"formula.functionList.MIDB.functionParameter.text.name",detail:"formula.functionList.MIDB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.startNum.name",detail:"formula.functionList.MIDB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.MIDB.functionParameter.numBytes.name",detail:"formula.functionList.MIDB.functionParameter.numBytes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.NUMBERVALUE,functionType:t.FunctionType.Text,description:"formula.functionList.NUMBERVALUE.description",abstract:"formula.functionList.NUMBERVALUE.abstract",functionParameter:[{name:"formula.functionList.NUMBERVALUE.functionParameter.text.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.text.detail",example:'"2.500,27"',require:1,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.detail",example:'","',require:0,repeat:0},{name:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.name",detail:"formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.detail",example:'"."',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PHONETIC,functionType:t.FunctionType.Text,description:"formula.functionList.PHONETIC.description",abstract:"formula.functionList.PHONETIC.abstract",functionParameter:[{name:"formula.functionList.PHONETIC.functionParameter.number1.name",detail:"formula.functionList.PHONETIC.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.PHONETIC.functionParameter.number2.name",detail:"formula.functionList.PHONETIC.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.PROPER,functionType:t.FunctionType.Text,description:"formula.functionList.PROPER.description",abstract:"formula.functionList.PROPER.abstract",functionParameter:[{name:"formula.functionList.PROPER.functionParameter.text.name",detail:"formula.functionList.PROPER.functionParameter.text.detail",example:'"hello univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXEXTRACT,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXEXTRACT.description",abstract:"formula.functionList.REGEXEXTRACT.abstract",functionParameter:[{name:"formula.functionList.REGEXEXTRACT.functionParameter.text.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.text.detail",example:'"abcdefg"',require:1,repeat:0},{name:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.detail",example:'"c.*f"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXMATCH,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXMATCH.description",abstract:"formula.functionList.REGEXMATCH.abstract",functionParameter:[{name:"formula.functionList.REGEXMATCH.functionParameter.text.name",detail:"formula.functionList.REGEXMATCH.functionParameter.text.detail",example:'"Spreadsheets"',require:1,repeat:0},{name:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXMATCH.functionParameter.regularExpression.detail",example:'"S.r"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGEXREPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REGEXREPLACE.description",abstract:"formula.functionList.REGEXREPLACE.abstract",functionParameter:[{name:"formula.functionList.REGEXREPLACE.functionParameter.text.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.text.detail",example:'"abcedfg"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.regularExpression.detail",example:'"a.*d"',require:1,repeat:0},{name:"formula.functionList.REGEXREPLACE.functionParameter.replacement.name",detail:"formula.functionList.REGEXREPLACE.functionParameter.replacement.detail",example:'"xyz"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACE,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACE.description",abstract:"formula.functionList.REPLACE.abstract",functionParameter:[{name:"formula.functionList.REPLACE.functionParameter.oldText.name",detail:"formula.functionList.REPLACE.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.startNum.name",detail:"formula.functionList.REPLACE.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.numChars.name",detail:"formula.functionList.REPLACE.functionParameter.numChars.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACE.functionParameter.newText.name",detail:"formula.functionList.REPLACE.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPLACEB,functionType:t.FunctionType.Text,description:"formula.functionList.REPLACEB.description",abstract:"formula.functionList.REPLACEB.abstract",functionParameter:[{name:"formula.functionList.REPLACEB.functionParameter.oldText.name",detail:"formula.functionList.REPLACEB.functionParameter.oldText.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.startNum.name",detail:"formula.functionList.REPLACEB.functionParameter.startNum.detail",example:"1",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.numBytes.name",detail:"formula.functionList.REPLACEB.functionParameter.numBytes.detail",example:"0",require:1,repeat:0},{name:"formula.functionList.REPLACEB.functionParameter.newText.name",detail:"formula.functionList.REPLACEB.functionParameter.newText.detail",example:'"Hello "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REPT,functionType:t.FunctionType.Text,description:"formula.functionList.REPT.description",abstract:"formula.functionList.REPT.abstract",functionParameter:[{name:"formula.functionList.REPT.functionParameter.text.name",detail:"formula.functionList.REPT.functionParameter.text.detail",example:'"*-"',require:1,repeat:0},{name:"formula.functionList.REPT.functionParameter.numberTimes.name",detail:"formula.functionList.REPT.functionParameter.numberTimes.detail",example:"3",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHT,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHT.description",abstract:"formula.functionList.RIGHT.abstract",functionParameter:[{name:"formula.functionList.RIGHT.functionParameter.text.name",detail:"formula.functionList.RIGHT.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHT.functionParameter.numChars.name",detail:"formula.functionList.RIGHT.functionParameter.numChars.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.RIGHTB,functionType:t.FunctionType.Text,description:"formula.functionList.RIGHTB.description",abstract:"formula.functionList.RIGHTB.abstract",functionParameter:[{name:"formula.functionList.RIGHTB.functionParameter.text.name",detail:"formula.functionList.RIGHTB.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.RIGHTB.functionParameter.numBytes.name",detail:"formula.functionList.RIGHTB.functionParameter.numBytes.detail",example:"3",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCH,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCH.description",abstract:"formula.functionList.SEARCH.abstract",functionParameter:[{name:"formula.functionList.SEARCH.functionParameter.findText.name",detail:"formula.functionList.SEARCH.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.withinText.name",detail:"formula.functionList.SEARCH.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCH.functionParameter.startNum.name",detail:"formula.functionList.SEARCH.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SEARCHB,functionType:t.FunctionType.Text,description:"formula.functionList.SEARCHB.description",abstract:"formula.functionList.SEARCHB.abstract",functionParameter:[{name:"formula.functionList.SEARCHB.functionParameter.findText.name",detail:"formula.functionList.SEARCHB.functionParameter.findText.detail",example:'"univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.withinText.name",detail:"formula.functionList.SEARCHB.functionParameter.withinText.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SEARCHB.functionParameter.startNum.name",detail:"formula.functionList.SEARCHB.functionParameter.startNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.SUBSTITUTE,functionType:t.FunctionType.Text,description:"formula.functionList.SUBSTITUTE.description",abstract:"formula.functionList.SUBSTITUTE.abstract",functionParameter:[{name:"formula.functionList.SUBSTITUTE.functionParameter.text.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.text.detail",example:'"Hello Univer"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.oldText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.oldText.detail",example:'"Hello"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.newText.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.newText.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.name",detail:"formula.functionList.SUBSTITUTE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.T,functionType:t.FunctionType.Text,description:"formula.functionList.T.description",abstract:"formula.functionList.T.abstract",functionParameter:[{name:"formula.functionList.T.functionParameter.value.name",detail:"formula.functionList.T.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXT.description",abstract:"formula.functionList.TEXT.abstract",functionParameter:[{name:"formula.functionList.TEXT.functionParameter.value.name",detail:"formula.functionList.TEXT.functionParameter.value.detail",example:"1.23",require:1,repeat:0},{name:"formula.functionList.TEXT.functionParameter.formatText.name",detail:"formula.functionList.TEXT.functionParameter.formatText.detail",example:'"$0.00"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTAFTER,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTAFTER.description",abstract:"formula.functionList.TEXTAFTER.abstract",functionParameter:[{name:"formula.functionList.TEXTAFTER.functionParameter.text.name",detail:"formula.functionList.TEXTAFTER.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.delimiter.name",detail:"formula.functionList.TEXTAFTER.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTAFTER.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchMode.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTAFTER.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTAFTER.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTBEFORE,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTBEFORE.description",abstract:"formula.functionList.TEXTBEFORE.abstract",functionParameter:[{name:"formula.functionList.TEXTBEFORE.functionParameter.text.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.text.detail",example:'"Red riding hood’s, red hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.delimiter.detail",example:'"hood"',require:1,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.instanceNum.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchMode.detail",example:"1",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.matchEnd.detail",example:"0",require:0,repeat:0},{name:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.name",detail:"formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.detail",example:'"not found"',require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTJOIN,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTJOIN.description",abstract:"formula.functionList.TEXTJOIN.abstract",functionParameter:[{name:"formula.functionList.TEXTJOIN.functionParameter.delimiter.name",detail:"formula.functionList.TEXTJOIN.functionParameter.delimiter.detail",example:'", "',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.detail",example:"true",require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text1.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text1.detail",example:'"Hi"',require:1,repeat:0},{name:"formula.functionList.TEXTJOIN.functionParameter.text2.name",detail:"formula.functionList.TEXTJOIN.functionParameter.text2.detail",example:'"Univer"',require:0,repeat:1}]},{functionName:t.FUNCTION_NAMES_TEXT.TEXTSPLIT,functionType:t.FunctionType.Text,description:"formula.functionList.TEXTSPLIT.description",abstract:"formula.functionList.TEXTSPLIT.abstract",functionParameter:[{name:"formula.functionList.TEXTSPLIT.functionParameter.text.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.text.detail",example:"A1:C2",require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.detail",example:'","',require:1,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.detail",example:'";"',require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.matchMode.detail",example:"",require:0,repeat:0},{name:"formula.functionList.TEXTSPLIT.functionParameter.padWith.name",detail:"formula.functionList.TEXTSPLIT.functionParameter.padWith.detail",example:"",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.TRIM,functionType:t.FunctionType.Text,description:"formula.functionList.TRIM.description",abstract:"formula.functionList.TRIM.abstract",functionParameter:[{name:"formula.functionList.TRIM.functionParameter.text.name",detail:"formula.functionList.TRIM.functionParameter.text.detail",example:'" Hello Univer "',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICHAR,functionType:t.FunctionType.Text,description:"formula.functionList.UNICHAR.description",abstract:"formula.functionList.UNICHAR.abstract",functionParameter:[{name:"formula.functionList.UNICHAR.functionParameter.number.name",detail:"formula.functionList.UNICHAR.functionParameter.number.detail",example:"65",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UNICODE,functionType:t.FunctionType.Text,description:"formula.functionList.UNICODE.description",abstract:"formula.functionList.UNICODE.abstract",functionParameter:[{name:"formula.functionList.UNICODE.functionParameter.text.name",detail:"formula.functionList.UNICODE.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.UPPER,functionType:t.FunctionType.Text,description:"formula.functionList.UPPER.description",abstract:"formula.functionList.UPPER.abstract",functionParameter:[{name:"formula.functionList.UPPER.functionParameter.text.name",detail:"formula.functionList.UPPER.functionParameter.text.detail",example:'"Univer"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUE,functionType:t.FunctionType.Text,description:"formula.functionList.VALUE.description",abstract:"formula.functionList.VALUE.abstract",functionParameter:[{name:"formula.functionList.VALUE.functionParameter.text.name",detail:"formula.functionList.VALUE.functionParameter.text.detail",example:'"123"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.VALUETOTEXT,functionType:t.FunctionType.Text,description:"formula.functionList.VALUETOTEXT.description",abstract:"formula.functionList.VALUETOTEXT.abstract",functionParameter:[{name:"formula.functionList.VALUETOTEXT.functionParameter.value.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.value.detail",example:'"Univer"',require:1,repeat:0},{name:"formula.functionList.VALUETOTEXT.functionParameter.format.name",detail:"formula.functionList.VALUETOTEXT.functionParameter.format.detail",example:"1",require:0,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.CALL,functionType:t.FunctionType.Text,description:"formula.functionList.CALL.description",abstract:"formula.functionList.CALL.abstract",functionParameter:[{name:"formula.functionList.CALL.functionParameter.number1.name",detail:"formula.functionList.CALL.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.CALL.functionParameter.number2.name",detail:"formula.functionList.CALL.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.EUROCONVERT,functionType:t.FunctionType.Text,description:"formula.functionList.EUROCONVERT.description",abstract:"formula.functionList.EUROCONVERT.abstract",functionParameter:[{name:"formula.functionList.EUROCONVERT.functionParameter.number1.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.EUROCONVERT.functionParameter.number2.name",detail:"formula.functionList.EUROCONVERT.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_TEXT.REGISTER_ID,functionType:t.FunctionType.Text,description:"formula.functionList.REGISTER_ID.description",abstract:"formula.functionList.REGISTER_ID.abstract",functionParameter:[{name:"formula.functionList.REGISTER_ID.functionParameter.number1.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.REGISTER_ID.functionParameter.number2.name",detail:"formula.functionList.REGISTER_ID.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],Ze=[],Je=[{functionName:t.FUNCTION_NAMES_WEB.ENCODEURL,functionType:t.FunctionType.Web,description:"formula.functionList.ENCODEURL.description",abstract:"formula.functionList.ENCODEURL.abstract",functionParameter:[{name:"formula.functionList.ENCODEURL.functionParameter.text.name",detail:"formula.functionList.ENCODEURL.functionParameter.text.detail",example:'"https://univer.ai/"',require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.FILTERXML,functionType:t.FunctionType.Web,description:"formula.functionList.FILTERXML.description",abstract:"formula.functionList.FILTERXML.abstract",functionParameter:[{name:"formula.functionList.FILTERXML.functionParameter.number1.name",detail:"formula.functionList.FILTERXML.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.FILTERXML.functionParameter.number2.name",detail:"formula.functionList.FILTERXML.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]},{functionName:t.FUNCTION_NAMES_WEB.WEBSERVICE,functionType:t.FunctionType.Web,description:"formula.functionList.WEBSERVICE.description",abstract:"formula.functionList.WEBSERVICE.abstract",functionParameter:[{name:"formula.functionList.WEBSERVICE.functionParameter.number1.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number1.detail",example:"A1:A20",require:1,repeat:0},{name:"formula.functionList.WEBSERVICE.functionParameter.number2.name",detail:"formula.functionList.WEBSERVICE.functionParameter.number2.detail",example:"A1:A20",require:1,repeat:0}]}],ta=[...Ke,...we,...ke,...$e,...je,...Xe,...ze,...Qe,...ge,...We,...Ye,...He,...Je,...Ge,...Ze];function ea(r,e){let a="";return r.aliasFunctionName?(a=e.t(r.aliasFunctionName),a===r.aliasFunctionName&&(a=r.functionName)):a=r.functionName,a}var aa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,ia=(r,e,a,n)=>{for(var i=n>1?void 0:n?na(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&aa(e,a,i),i},Ct=(r,e)=>(a,n)=>e(a,n,r);const ut=f.createIdentifier("formula.description-service");E.DescriptionService=class{constructor(e,a,n){h(this,"_descriptions",[]);this._functionService=e,this._localeService=a,this._configService=n,this._initialize()}dispose(){this._localeService.localeChanged$.complete()}getDescriptions(){return this._functionService.getDescriptions()}hasFunction(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())!==void 0}getFunctionInfo(e){return this._functionService.getDescriptions().get(e.toLocaleUpperCase())}getSearchListByName(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c,functionType:s}=o;u.toLocaleUpperCase().indexOf(i)>-1&&s!==t.FunctionType.DefinedName&&a.push({name:u,desc:c})}),a}getSearchListByNameFirstLetter(e){const a=[],n=this._functionService.getDescriptions(),i=e.toLocaleUpperCase().trim();return n.forEach(o=>{const{functionName:u,abstract:c}=o;u.toLocaleUpperCase().indexOf(i)===0&&a.push({name:u,desc:c})}),a}getSearchListByType(e){const a=[];return this._functionService.getDescriptions().forEach(i=>{const{functionName:o,functionType:u,abstract:c}=i;(u===e||e===-1)&&u!==t.FunctionType.DefinedName&&a.push({name:o,desc:c})}),a}registerDescriptions(e){return this._descriptions=this._descriptions.concat(e),this._registerDescriptions(),f.toDisposable(()=>{const a=e.map(n=>n.functionName);this.unregisterDescriptions(a)})}unregisterDescriptions(e){this._descriptions=this._descriptions.filter(a=>!e.includes(a.functionName)),this._functionService.unregisterDescriptions(...e)}hasDescription(e){return this._descriptions.some(a=>a.functionName===e)}hasDefinedNameDescription(e){return this._descriptions.some(a=>a.functionName===e&&a.functionType===t.FunctionType.DefinedName)}isFormulaDefinedName(e){const a=this._descriptions.filter(i=>i.functionName===e&&i.functionType===t.FunctionType.DefinedName);if(a.length===0)return!1;const n=a[0].description;return!t.isReferenceStrings(n)}_initialize(){this._localeService.localeChanged$.subscribe(()=>{this._registerDescriptions()}),this._initDescription(),this._registerDescriptions()}_initDescription(){var i;const e=[...t.functionArray,...t.functionCompatibility,...t.functionCube,...t.functionDatabase,...t.functionDate,...t.functionEngineering,...t.functionFinancial,...t.functionInformation,...t.functionLogical,...t.functionLookup,...t.functionMath,...t.functionMeta,...t.functionStatistical,...t.functionText,...t.functionUniver,...t.functionWeb].map(o=>o[1]),a=ta.filter(o=>e.includes(o.functionName)),n=this._configService.getConfig(nt);this._descriptions=a.concat((i=n==null?void 0:n.description)!=null?i:[])}_registerDescriptions(){const e=this._localeService,a=this._descriptions.map(n=>({functionName:ea(n,e),functionType:n.functionType,description:e.t(n.description),abstract:e.t(n.abstract),functionParameter:n.functionParameter.map(i=>({name:e.t(i.name),detail:e.t(i.detail),example:i.example,require:i.require,repeat:i.repeat}))}));this._functionService.registerDescriptions(...a)}},E.DescriptionService=ia([Ct(0,t.IFunctionService),Ct(1,f.Inject(f.LocaleService)),Ct(2,f.IConfigService)],E.DescriptionService);var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,ua=(r,e,a,n)=>{for(var i=n>1?void 0:n?oa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&ra(e,a,i),i},ct=(r,e)=>(a,n)=>e(a,n,r);function vt(r,e,a,n){const i=r.sequenceNodesBuilder(e);if(i==null)return e;const o=[];for(let u=0,c=i.length;u<c;u++){const s=i[u];if(typeof s=="string"||s.nodeType!==t.sequenceNodeType.REFERENCE)continue;const{token:l}=s,d=t.deserializeRangeWithSheetWithCache(l),{sheetName:L,unitId:T}=d;let A=d.range;A.startAbsoluteRefType===f.AbsoluteRefType.ALL&&A.endAbsoluteRefType===f.AbsoluteRefType.ALL||(A=f.moveRangeByOffset(A,a,n),o.push({unitId:T,sheetName:L,range:A}))}return o.map(u=>`${u.unitId}!${u.sheetName}!${u.range.startRow}!${u.range.endRow}!${u.range.startColumn}!${u.range.endColumn}`).join("|")}E.FormulaRefRangeService=class extends f.Disposable{constructor(e,a,n,i){super(),this._refRangeService=e,this._lexerTreeBuilder=a,this._univerInstanceService=n,this._injector=i}transformFormulaByEffectCommand(e,a,n,i){const o=this._lexerTreeBuilder.sequenceNodesBuilder(n),u=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),c=u.getActiveSheet(),s=u.getUnitId(),l=c.getSheetId(),d=o==null?void 0:o.map(L=>{if(typeof L=="object"&&L.nodeType===t.sequenceNodeType.REFERENCE){const T=t.deserializeRangeWithSheetWithCache(L.token),{range:A,unitId:S,sheetName:C}=T,p=this._univerInstanceService.getUnit(S||e),N=C?p==null?void 0:p.getSheetBySheetName(C):p==null?void 0:p.getSheetBySheetId(a);if(!N)throw new Error("Sheet not found");const I=p.getUnitId(),P=N.getSheetId();if(I!==s||P!==l)return L;const _=m.handleDefaultRangeChangeWithEffectRefCommands(A,i);let R="";if(_){const x=_.startColumn-A.startColumn,q=_.startRow-A.startRow,D=f.moveRangeByOffset(A,x,q);S&&C?R=t.serializeRangeWithSpreadsheet(S,C,D):C?R=t.serializeRangeWithSheet(C,D):R=t.serializeRange(D)}else R=t.ErrorType.REF;return{...L,token:R}}else return L});return d?`=${t.generateStringWithSequence(d)}`:""}registerFormula(e,a,n,i){const o=new Map,u=this._lexerTreeBuilder.sequenceNodesBuilder(n),c=new f.DisposableCollection,s=l=>{const d=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET),L=d.getActiveSheet(),T=d.getUnitId(),A=L.getSheetId(),S=u==null?void 0:u.map(p=>{if(typeof p=="object"&&p.nodeType===t.sequenceNodeType.REFERENCE){const N=o.get(p.token);if(N.unitId!==T||N.subUnitId!==A)return p;const I=m.handleDefaultRangeChangeWithEffectRefCommands(N.range,l);let P="";if(I){const _=I.startColumn-N.range.startColumn,R=I.startRow-N.range.startRow,x=f.moveRangeByOffset(N.range,_,R);N.unitId&&N.sheetName?P=t.serializeRangeWithSpreadsheet(N.unitId,N.sheetName,x):N.sheetName?P=t.serializeRangeWithSheet(N.sheetName,x):P=t.serializeRange(x)}else P=t.ErrorType.REF;return{...p,token:P}}else return p}),C=S&&t.generateStringWithSequence(S);return i(`=${C}`)};return u==null||u.forEach(l=>{if(typeof l=="object"&&l.nodeType===t.sequenceNodeType.REFERENCE){const d=t.deserializeRangeWithSheetWithCache(l.token),{range:L,unitId:T,sheetName:A}=d,S=this._univerInstanceService.getUnit(T||e),C=A?S==null?void 0:S.getSheetBySheetName(A):S==null?void 0:S.getSheetBySheetId(a);if(!C)return;const p=S.getUnitId(),N=C.getSheetId(),I={unitId:p,subUnitId:N,range:L,sheetName:A};o.set(l.token,I),c.add(this._refRangeService.registerRefRange(L,s,p,N))}}),c}_getFormulaDependcy(e,a,n,i){const o=f.isFormulaString(n)?this._lexerTreeBuilder.sequenceNodesBuilder(n):null,u=[];return o==null||o.forEach(c=>{if(typeof c=="object"&&c.nodeType===t.sequenceNodeType.REFERENCE){const s=t.deserializeRangeWithSheetWithCache(c.token),{range:l,unitId:d,sheetName:L}=s;if(l.startAbsoluteRefType===f.AbsoluteRefType.ALL&&l.endAbsoluteRefType===f.AbsoluteRefType.ALL)return;const T=this._univerInstanceService.getUnit(d||e),A=L?T==null?void 0:T.getSheetBySheetName(L):T==null?void 0:T.getSheetBySheetId(a);if(!A)return;const S=T.getUnitId(),C=A.getSheetId(),p=i[0].startRow,N=i[0].startColumn,I=l.startRow,P=l.startColumn,_=i.map(R=>({startRow:R.startRow-p+I,endRow:R.endRow-p+I,startColumn:R.startColumn-N+P,endColumn:R.endColumn-N+P}));u.push({unitId:S,subUnitId:C,ranges:_})}}),u}registerRangeFormula(e,a,n,i,o){const u=new f.DisposableCollection,c=i.map(l=>this._getFormulaDependcy(e,a,l,n)),s=l=>{const d=n[0].startRow,L=n[0].startColumn,T=[{unitId:e,subUnitId:a,ranges:n},...c.flat()],A=[],S=m.getSeparateEffectedRangesOnCommand(this._injector,l);for(const{unitId:C,subUnitId:p,ranges:N}of T)if(C===S.unitId&&p===S.subUnitId){const I=[],P=N[0].startRow,_=N[0].startColumn,R=P-d,x=_-L;for(const q of S.ranges){const D=N.map(y=>f.getIntersectRange(q,y)).filter(Boolean);D.length>0&&I.push(...D)}I.length>0&&A.push(I.map(q=>({startRow:q.startRow-R,endRow:q.endRow-R,startColumn:q.startColumn-x,endColumn:q.endColumn-x})))}if(A.length>0){const C=f.Rectangle.splitIntoGrid([...A.flat()]),p=f.Rectangle.subtractMulti(n,C);p.sort((R,x)=>R.startRow-x.startRow||R.startColumn-x.startColumn);const N=new Map;for(let R=0;R<C.length;R++){const x=C[R],q=x.startRow,D=x.startColumn,y=q-d,M=D-L,U=m.handleCommonDefaultRangeChangeWithEffectRefCommands(x,l).sort((B,W)=>B.startRow-W.startRow||B.startColumn-W.startColumn);if(!U.length)continue;const F=U[0].startRow,O=U[0].startColumn,v=F-d,$=O-L,z=[];for(let B=0;B<i.length;B++){const W=i[B],G=f.isFormulaString(W),Nt=G?this._lexerTreeBuilder.moveFormulaRefOffset(W,M,y):W,K=G?this.transformFormulaByEffectCommand(e,a,Nt,l):Nt,Z=vt(this._lexerTreeBuilder,K,-$,-v);z.push({newFormula:K,orginFormula:Z})}const w={formulas:z,ranges:U,key:z.map(B=>B.orginFormula).join("_")};N.has(w.key)?N.get(w.key).push(w):N.set(w.key,[w])}const I=i.map(R=>vt(this._lexerTreeBuilder,R,0,0)).join("_");if(p.length>0){const R=p[0].startRow,x=p[0].startColumn,q=[];for(let y=0;y<i.length;y++){const M=i[y];q.push({newFormula:f.isFormulaString(M)?this._lexerTreeBuilder.moveFormulaRefOffset(M,x-L,R-d):M,orginFormula:M})}const D={formulas:q,ranges:p,key:I};N.has(D.key)?N.get(D.key).push(D):N.set(D.key,[D])}const P=[],_=Array.from(N.keys());for(let R=_.length-1;R>=0;R--){const x=_[R],q=N.get(x).sort((M,U)=>M.ranges[0].startRow-U.ranges[0].startRow||M.ranges[0].startColumn-U.ranges[0].startColumn),D=[];for(let M=0;M<q[0].formulas.length;M++)D.push(q[0].formulas[M].newFormula);const y=f.Rectangle.mergeRanges(q.map(M=>M.ranges).flat());y.sort((M,U)=>M.startRow-U.startRow||M.startColumn-U.startColumn),P.push({formulas:D,ranges:y})}return o(P)}return{undos:[],redos:[]}};return n.forEach(l=>{const d=this._refRangeService.registerRefRange(l,s,e,a);u.add(d)}),[...c.flat()].forEach(({unitId:l,subUnitId:d,ranges:L})=>{L.forEach(T=>{const A=this._refRangeService.registerRefRange(T,s,l,d);u.add(A)})}),u}},E.FormulaRefRangeService=ua([ct(0,f.Inject(m.RefRangeService)),ct(1,f.Inject(t.LexerTreeBuilder)),ct(2,f.IUniverInstanceService),ct(3,f.Inject(f.Injector))],E.FormulaRefRangeService);var ca=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,ma=(r,e,a,n)=>{for(var i=n>1?void 0:n?fa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&ca(e,a,i),i},sa=(r,e)=>(a,n)=>e(a,n,r);const Rt="sheets-formula.remote-register-function.service",Ot=f.createIdentifier(Rt);E.RemoteRegisterFunctionService=class{constructor(e){this._functionService=e}async registerFunctions(e){const a=e.map(([n,i])=>la(n,i));this._functionService.registerExecutors(...a)}async registerAsyncFunctions(e){const a=e.map(([n,i])=>pa(n,i));this._functionService.registerExecutors(...a)}async unregisterFunctions(e){this._functionService.unregisterDescriptions(...e)}},E.RemoteRegisterFunctionService=ma([sa(0,t.IFunctionService)],E.RemoteRegisterFunctionService);function la(r,e){const a=new t.CustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}function pa(r,e){const a=new t.AsyncCustomFunction(e),n=new Function(`return ${r}`)();return a.calculateCustom=n,a}var da=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Ta=(r,e,a,n)=>{for(var i=n>1?void 0:n?La(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&da(e,a,i),i},ft=(r,e)=>(a,n)=>e(a,n,r);const Vt=f.createIdentifier("sheets-formula.register-function-service");E.RegisterFunctionService=class extends f.Disposable{constructor(e,a,n,i){super(),this._localeService=e,this._descriptionService=a,this._functionService=n,this._remoteRegisterFunctionService=i}registerFunction(e){return this._registerSingleFunction(e)}registerAsyncFunction(e){return this._registerSingleFunction({...e,async:!0})}registerFunctions(e){const{locales:a,description:n,calculate:i}=e;a&&this._localeService.load(a);const o=new f.DisposableCollection;if(n)o.add(this._descriptionService.registerDescriptions(n));else{const u=i.map(([c,s,l])=>({functionName:s,functionType:t.FunctionType.User,description:"",abstract:l||"",functionParameter:[]}));o.add(this._functionService.registerDescriptions(...u))}return o.add(this._registerLocalExecutors(i)),this._remoteRegisterFunctionService&&o.add(this._registerRemoteExecutors(i)),o}_registerSingleFunction(e){const{name:a,func:n,description:i,locales:o,async:u=!1}=e,c=new f.DisposableCollection;if(o&&this._localeService.load(o),typeof i=="string"){const l={functionName:a,functionType:t.FunctionType.User,description:i,abstract:i||"",functionParameter:[]};c.add(this._descriptionService.registerDescriptions([l]))}else c.add(this._descriptionService.registerDescriptions([i]));const s=u?new t.AsyncCustomFunction(a):new t.CustomFunction(a);return s.calculateCustom=n,this._functionService.registerExecutors(s),c.add(f.toDisposable(()=>this._functionService.unregisterExecutors(a))),this._remoteRegisterFunctionService&&(this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(),a]]),c.add(f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions([a])))),c}_registerLocalExecutors(e){const a=e.map(([i,o])=>o),n=e.map(([i,o])=>{const u=new t.CustomFunction(o);return u.calculateCustom=i,u});return this._functionService.registerExecutors(...n),f.toDisposable(()=>this._functionService.unregisterExecutors(...a))}_registerRemoteExecutors(e){const a=[],n=e.map(([i,o])=>(a.push(o),[i.toString(),o]));return this._remoteRegisterFunctionService.registerFunctions(n),f.toDisposable(()=>this._remoteRegisterFunctionService.unregisterFunctions(a))}},E.RegisterFunctionService=Ta([ft(0,f.Inject(f.LocaleService)),ft(1,f.Inject(ut)),ft(2,t.IFunctionService),ft(3,f.Optional(Ot))],E.RegisterFunctionService);const Na="SHEETS_FORMULA_PLUGIN";var Pa=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Ia=(r,e,a,n)=>{for(var i=n>1?void 0:n?Ea(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Pa(e,a,i),i},Mt=(r,e)=>(a,n)=>e(a,n,r);let mt=class extends f.Disposable{constructor(r,e,a){super(),this._activeDirtyManagerService=r,this._univerInstanceService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._initialConversion()}_initialConversion(){this._activeDirtyManagerService.register(m.SetRangeValuesMutation.id,{commandId:m.SetRangeValuesMutation.id,getDirtyData:r=>{const e=r.params;return e.trigger===m.SetStyleCommand.id?{}:{dirtyRanges:this._getSetRangeValuesMutationDirtyRange(e)}}}),this._initialMove(),this._initialRowAndColumn(),this._initialSheet(),this._initialDefinedName()}_initialMove(){this._activeDirtyManagerService.register(m.MoveRangeMutation.id,{commandId:m.MoveRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.to.subUnitId]:"1",[e.from.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveRowsMutation.id,{commandId:m.MoveRowsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.MoveColsMutation.id,{commandId:m.MoveColsMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.ReorderRangeMutation.id,{commandId:m.ReorderRangeMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getReorderRangeMutationDirtyRange(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialRowAndColumn(){this._activeDirtyManagerService.register(m.RemoveRowMutation.id,{commandId:m.RemoveRowMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!0),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.RemoveColMutation.id,{commandId:m.RemoveColMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(e,!1),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertColMutation.id,{commandId:m.InsertColMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertRowMutation.id,{commandId:m.InsertRowMutation.id,getDirtyData:r=>{const e=r.params;return{clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}})}_initialSheet(){this._activeDirtyManagerService.register(m.RemoveSheetMutation.id,{commandId:m.RemoveSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getRemoveSheetMutation(e),clearDependencyTreeCache:{[e.unitId]:{[e.subUnitId]:"1"}}}}}),this._activeDirtyManagerService.register(m.InsertSheetMutation.id,{commandId:m.InsertSheetMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyNameMap:this._getInsertSheetMutation(e)}}})}_initialDefinedName(){this._activeDirtyManagerService.register(t.SetDefinedNameMutation.id,{commandId:t.SetDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}}),this._activeDirtyManagerService.register(t.RemoveDefinedNameMutation.id,{commandId:t.RemoveDefinedNameMutation.id,getDirtyData:r=>{const e=r.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(e)}}})}_getDefinedNameMutation(r){const{unitId:e,name:a,formulaOrRefString:n}=r,i={};return r==null?{}:(i[e]={},i[e][a]=n,i)}_getSetRangeValuesMutationDirtyRange(r){const{subUnitId:e,unitId:a,cellValue:n}=r,i=[];return n==null||(i.push(...this._getDirtyRangesByCellValue(a,e,n)),i.push(...this._getDirtyRangesForArrayFormula(a,e,n))),i}_getMoveRangeMutationDirtyRange(r){const{unitId:e,from:a,to:n}=r,i=[];return i.push(...this._getDirtyRangesByCellValue(e,a.subUnitId,a.value)),i.push(...this._getDirtyRangesByCellValue(e,n.subUnitId,n.value)),i.push(...this._getDirtyRangesForArrayFormula(e,n.subUnitId,n.value)),i}_getMoveRowsMutationDirtyRange(r){const{subUnitId:e,unitId:a,sourceRange:n,targetRange:i}=r,o=[],u=this._rangeToMatrix(n).getData(),c=this._rangeToMatrix(i).getData();return o.push(...this._getDirtyRangesByCellValue(a,e,u)),o.push(...this._getDirtyRangesByCellValue(a,e,c)),o.push(...this._getDirtyRangesForArrayFormula(a,e,c)),o}_getReorderRangeMutationDirtyRange(r){const{unitId:e,subUnitId:a,range:n}=r,i=this._rangeToMatrix(n).getData(),o=[];return o.push(...this._getDirtyRangesByCellValue(e,a,i)),o.push(...this._getDirtyRangesForArrayFormula(e,a,i)),o}_getDeleteRangeMutationDirtyRange(r){const{subUnitId:e,unitId:a,range:n,shiftDimension:i}=r,o=[],u=this._univerInstanceService.getUniverSheetInstance(a),c=u==null?void 0:u.getSheetBySheetId(e),s=(c==null?void 0:c.getLastRowWithContent())||0,l=(c==null?void 0:c.getLastColumnWithContent())||0,d=new f.ObjectMatrix;let L=null;const{startRow:T,startColumn:A,endRow:S,endColumn:C}=n;i===f.Dimension.ROWS?L=this._rangeToMatrix({startRow:T,startColumn:A,endRow:s,endColumn:C}):i===f.Dimension.COLUMNS&&(L=this._rangeToMatrix({startRow:T,startColumn:A,endRow:S,endColumn:l})),L!=null&&d.merge(L);const p=d.getData();return o.push(...this._getDirtyRangesByCellValue(a,e,p)),o.push(...this._getDirtyRangesForArrayFormula(a,e,p)),o}_getRemoveRowOrColumnMutation(r,e=!0){const{subUnitId:a,unitId:n,range:i}=r,o=[],u=this._univerInstanceService.getUniverSheetInstance(n),c=u==null?void 0:u.getSheetBySheetId(a),s=(c==null?void 0:c.getRowCount())||0,l=(c==null?void 0:c.getColumnCount())||0,d=new f.ObjectMatrix;let L=null;const{startRow:T,endRow:A,startColumn:S,endColumn:C}=i;e===!0?L=this._rangeToMatrix({startRow:T,startColumn:0,endRow:A,endColumn:l-1}):L=this._rangeToMatrix({startRow:0,startColumn:S,endRow:s,endColumn:C}),L!=null&&d.merge(L);const p=d.getData();return o.push(...this._getDirtyRangesByCellValue(n,a,p)),o.push(...this._getDirtyRangesForArrayFormula(n,a,p)),o}_getRemoveSheetMutation(r){const e={},{subUnitId:a,unitId:n,subUnitName:i}=r;return e[n]==null&&(e[n]={}),e[n][a]=i,e}_getInsertSheetMutation(r){const e={},{sheet:a,unitId:n}=r;return e[n]==null&&(e[n]={}),e[n][a.id]=a.name,e}_rangeToMatrix(r){const e=new f.ObjectMatrix,{startRow:a,startColumn:n,endRow:i,endColumn:o}=r;for(let u=a;u<=i;u++)for(let c=n;c<=o;c++)e.setValue(u,c,{});return e}_getDirtyRangesByCellValue(r,e,a){const n=[];return a==null||new f.ObjectMatrix(a).getDiscreteRanges().forEach(u=>{n.push({unitId:r,sheetId:e,range:u})}),n}_getDirtyRangesForArrayFormula(r,e,a){var u,c;const n=[];if(a==null)return n;const i=new f.ObjectMatrix(a),o=this._formulaDataModel.getArrayFormulaRange();if((u=o==null?void 0:o[r])!=null&&u[e]){const s=new f.ObjectMatrix((c=o==null?void 0:o[r])==null?void 0:c[e]);i.forValue((l,d)=>{s.forValue((L,T,A)=>{if(A==null)return!0;const{startRow:S,startColumn:C,endRow:p,endColumn:N}=A;l>=S&&l<=p&&d>=C&&d<=N&&n.push({unitId:r,sheetId:e,range:{startRow:S,startColumn:C,endRow:S,endColumn:C}})})})}return n}};mt=Ia([Mt(0,t.IActiveDirtyManagerService),Mt(1,f.IUniverInstanceService),Mt(2,f.Inject(t.FormulaDataModel))],mt);var Aa=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,Ca=(r,e,a,n)=>{for(var i=n>1?void 0:n?Sa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Aa(e,a,i),i},_t=(r,e)=>(a,n)=>e(a,n,r);let st=class extends f.Disposable{constructor(r,e,a){super(),this._commandService=r,this._sheetInterceptorService=e,this._formulaDataModel=a,this._initialize()}_initialize(){this._commandExecutedListener(),this._initInterceptorCellContent()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{if(r.id!==t.SetArrayFormulaDataMutation.id)return;const e=r.params;if(e==null)return;const{arrayFormulaRange:a,arrayFormulaCellData:n}=e;this._formulaDataModel.setArrayFormulaRange(a),this._formulaDataModel.setArrayFormulaCellData(n)}))}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(m.INTERCEPTOR_POINT.CELL_CONTENT,{priority:100,effect:f.InterceptorEffectEnum.Value,handler:(r,e,a)=>{var l,d,L;const{unitId:n,subUnitId:i,row:o,col:u}=e,c=this._formulaDataModel.getArrayFormulaCellData(),s=(L=(d=(l=c==null?void 0:c[n])==null?void 0:l[i])==null?void 0:d[o])==null?void 0:L[u];return s==null?a(r):s.v==null&&s.t==null?a({...r,v:0,t:f.CellValueType.NUMBER}):(r==null?void 0:r.t)===f.CellValueType.NUMBER&&typeof(r==null?void 0:r.v)=="number"?a({...r,v:t.stripErrorMargin(r.v)}):a({...r,v:s.v,t:s.t})}}))}};st=Ca([_t(0,f.ICommandService),_t(1,f.Inject(m.SheetInterceptorService)),_t(2,f.Inject(t.FormulaDataModel))],st);var Ra=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Ma=(r,e,a,n)=>{for(var i=n>1?void 0:n?Oa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Ra(e,a,i),i},lt=(r,e)=>(a,n)=>e(a,n,r);let pt=class extends f.Disposable{constructor(e,a,n,i){super();h(this,"_preUnitId",null);this._descriptionService=e,this._definedNamesService=a,this._univerInstanceService=n,this._commandService=i,this._initialize()}_initialize(){this._descriptionListener(),this._changeUnitListener(),this._changeSheetListener()}_descriptionListener(){f.toDisposable(this._definedNamesService.update$.subscribe(()=>{this._registerDescriptions()}))}_changeUnitListener(){f.toDisposable(this._univerInstanceService.getCurrentTypeOfUnit$(f.UniverInstanceType.UNIVER_SHEET).subscribe(()=>{this._unRegisterDescriptions(),this._registerDescriptions()}))}_changeSheetListener(){this.disposeWithMe(this._commandService.onCommandExecuted((e,a)=>{if(!(a!=null&&a.fromCollab)){if(e.id===m.SetWorksheetActiveOperation.id)this._unregisterDescriptionsForNotInSheetId(),this._registerDescriptions();else if(e.id===t.SetDefinedNameMutation.id){const n=e.params;this._registerDescription(n)}else if(e.id===t.RemoveDefinedNameMutation.id){const n=e.params;this._unregisterDescription(n)}}}))}_registerDescription(e){const{unitId:a,sheetId:n}=this._getUnitIdAndSheetId();if(a==null||n==null)return;const{name:i,comment:o,formulaOrRefString:u,localSheetId:c}=e;!this._descriptionService.hasDescription(i)&&(c==null||c===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||c===n)&&this._descriptionService.registerDescriptions([{functionName:i,description:u+(o||""),abstract:u,functionType:t.FunctionType.DefinedName,functionParameter:[]}])}_unregisterDescription(e){const{name:a}=e;this._descriptionService.unregisterDescriptions([a])}_unRegisterDescriptions(){if(this._preUnitId==null)return;const e=this._definedNamesService.getDefinedNameMap(this._preUnitId);if(e==null)return;const a=[];Array.from(Object.values(e)).forEach(n=>{const{name:i}=n;a.push(i)}),this._descriptionService.unregisterDescriptions(a),this._preUnitId=null}_getUnitIdAndSheetId(){const e=this._univerInstanceService.getCurrentUnitForType(f.UniverInstanceType.UNIVER_SHEET);if(e==null)return{};const a=e.getActiveSheet();return a==null?{}:{unitId:e.getUnitId(),sheetId:a.getSheetId()}}_registerDescriptions(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];this._preUnitId=e,Array.from(Object.values(n)).forEach(o=>{const{name:u,comment:c,formulaOrRefString:s,localSheetId:l}=o;!this._descriptionService.hasDescription(u)&&(l==null||l===m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||l===a)&&i.push({functionName:u,description:s+(c||""),abstract:s,functionType:t.FunctionType.DefinedName,functionParameter:[]})}),this._descriptionService.registerDescriptions(i)}_unregisterDescriptionsForNotInSheetId(){const{unitId:e,sheetId:a}=this._getUnitIdAndSheetId();if(e==null||a==null)return;const n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;const i=[];Array.from(Object.values(n)).forEach(o=>{const{name:u,localSheetId:c}=o;c!==m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME&&c!==a&&i.push(u)}),this._descriptionService.unregisterDescriptions(i)}};pt=Ma([lt(0,ut),lt(1,t.IDefinedNamesService),lt(2,f.IUniverInstanceService),lt(3,f.ICommandService)],pt);var _a=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,ba=(r,e,a,n)=>{for(var i=n>1?void 0:n?Da(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&_a(e,a,i),i},ya=(r,e)=>(a,n)=>e(a,n,r);let dt=class extends f.Disposable{constructor(r){super(),this._commandService=r,[Dt,tt].forEach(e=>this._commandService.registerCommand(e))}};dt=ba([ya(0,f.ICommandService)],dt);var Gt=Object.defineProperty,xa=Object.getOwnPropertyDescriptor,Ua=(r,e,a)=>e in r?Gt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Ht=(r,e,a,n)=>{for(var i=n>1?void 0:n?xa(e,a):e,o=r.length-1,u;o>=0;o--)(u=r[o])&&(i=(n?u(e,a,i):u(i))||i);return n&&i&&Gt(e,a,i),i},Lt=(r,e)=>(a,n)=>e(a,n,r),Tt=(r,e,a)=>Ua(r,typeof e!="symbol"?e+"":e,a);E.UniverRemoteSheetsFormulaPlugin=class extends f.Plugin{constructor(e=Ft,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},Ft,this._config);this._configService.setConfig(Ue,i)}onStarting(){this._injector.add([E.RemoteRegisterFunctionService]),this._injector.get(it.IRPCChannelService).registerChannel(Rt,it.fromModule(this._injector.get(E.RemoteRegisterFunctionService)))}},Tt(E.UniverRemoteSheetsFormulaPlugin,"pluginName","SHEET_FORMULA_REMOTE_PLUGIN"),Tt(E.UniverRemoteSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverRemoteSheetsFormulaPlugin=Ht([f.DependentOn(t.UniverFormulaEnginePlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverRemoteSheetsFormulaPlugin),E.UniverSheetsFormulaPlugin=class extends f.Plugin{constructor(e=ht,a,n){super(),this._config=e,this._injector=a,this._configService=n;const{...i}=f.merge({},ht,this._config);this._configService.setConfig(nt,i)}onStarting(){const e=this._injector,a=[[Vt,{useClass:E.RegisterFunctionService}],[ut,{useClass:E.DescriptionService}],[dt],[E.FormulaRefRangeService],[E.RegisterOtherFormulaService],[st],[E.TriggerCalculationController],[E.UpdateFormulaController],[mt],[pt],[E.UpdateDefinedNameController]];if(this._config.notExecuteFormula){const n=e.get(it.IRPCChannelService);a.push([Ot,{useFactory:()=>it.toModule(n.requestChannel(Rt))}])}a.forEach(n=>e.add(n))}onReady(){f.touchDependencies(this._injector,[[dt],[mt],[st],[E.UpdateFormulaController],[E.UpdateDefinedNameController]]),f.isNodeEnv()&&f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}onRendered(){f.touchDependencies(this._injector,[[pt]]),f.isNodeEnv()||f.touchDependencies(this._injector,[[E.TriggerCalculationController]])}},Tt(E.UniverSheetsFormulaPlugin,"pluginName",Na),Tt(E.UniverSheetsFormulaPlugin,"type",f.UniverInstanceType.UNIVER_SHEET),E.UniverSheetsFormulaPlugin=Ht([f.DependentOn(t.UniverFormulaEnginePlugin,m.UniverSheetsPlugin),Lt(1,f.Inject(f.Injector)),Lt(2,f.IConfigService)],E.UniverSheetsFormulaPlugin),E.CalculationMode=H,E.IDescriptionService=ut,E.IRegisterFunctionService=Vt,E.IRemoteRegisterFunctionService=Ot,E.InsertFunctionCommand=Dt,E.OtherFormulaMarkDirty=tt,E.PLUGIN_CONFIG_KEY_BASE=nt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
// @univerjs/sheets-formula/facade
|
|
52
|
-
(function(
|
|
52
|
+
(function(i,c){typeof exports=="object"&&typeof module<"u"?c(require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/engine-formula","@univerjs/sheets-formula"],c):(i=typeof globalThis<"u"?globalThis:i||self,c(i.UniverCore,i.UniverEngineFormula,i.UniverSheetsFormula))})(this,function(i,c,t){"use strict";class l extends i.FUniver{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(c.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}registerFunction(o){let r=this._injector.get(t.IRegisterFunctionService);r||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),r=this._injector.get(t.IRegisterFunctionService));const e=r.registerFunctions(o);return this._debouncedFormulaCalculation(),e}}i.FUniver.extend(l);class d extends c.FFormula{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(c.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}setInitialFormulaComputing(o){const e=this._injector.get(i.LifecycleService).stage,n=this._injector.get(i.ILogService),s=this._injector.get(i.IConfigService);e>i.LifecycleStages.Starting&&n.warn("[FFormula]","CalculationMode is called after the Starting lifecycle and will take effect the next time the Univer Sheet is constructed. If you want it to take effect when the Univer Sheet is initialized this time, consider calling it before the Ready lifecycle or using configuration.");const u=s.getConfig(t.PLUGIN_CONFIG_KEY_BASE);u&&(u.initialFormulaComputing=o)}registerFunction(o,r,e){var a;let n=this._injector.get(t.IRegisterFunctionService);n||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),n=this._injector.get(t.IRegisterFunctionService));const s={name:o,func:r,description:typeof e=="string"?e:(a=e==null?void 0:e.description)!=null?a:"",locales:typeof e=="object"?e.locales:void 0},u=n.registerFunction(s);return this._debouncedFormulaCalculation(),u}registerAsyncFunction(o,r,e){var a;let n=this._injector.get(t.IRegisterFunctionService);n||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),n=this._injector.get(t.IRegisterFunctionService));const s={name:o,func:r,description:typeof e=="string"?e:(a=e==null?void 0:e.description)!=null?a:"",locales:typeof e=="object"?e.locales:void 0},u=n.registerAsyncFunction(s);return this._debouncedFormulaCalculation(),u}}c.FFormula.extend(d)});
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
// @univerjs/sheets-hyper-link/index
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
// @univerjs/sheets-hyper-link/facade
|
|
60
|
-
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/sheets
|
|
60
|
+
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/sheets-hyper-link"),require("@univerjs/sheets/facade"),require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-hyper-link","@univerjs/sheets/facade","@univerjs/core"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.UniverSheetsHyperLinkFacade={},r.UniverSheetsHyperLink,r.UniverSheetsFacade,r.UniverCore))})(this,function(r,n,a,o){"use strict";class p extends a.FWorkbook{createSheetHyperlink(e,t){return this._injector.get(n.SheetsHyperLinkParserService).buildHyperLink(this.getId(),e,t)}parseSheetHyperlink(e){return this._injector.get(n.SheetsHyperLinkParserService).parseHyperLink(e)}}a.FWorkbook.extend(p);class y extends a.FRange{setHyperLink(e,t){const s={unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId(),link:{row:this._range.startRow,column:this._range.startColumn,payload:e,display:t,id:o.generateRandomId()}};return this._commandService.executeCommand(n.AddHyperLinkCommand.id,s)}getHyperLinks(){var t,s,d;const e=this._worksheet.getCellRaw(this._range.startRow,this._range.startColumn);return e!=null&&e.p?(d=(s=(t=e.p.body)==null?void 0:t.customRanges)==null?void 0:s.filter(i=>i.rangeType===o.CustomRangeType.HYPERLINK).map(i=>{var u,c,h,m,l;return{id:`${i.rangeId}`,startIndex:i.startIndex,endIndex:i.endIndex,url:(c=(u=i.properties)==null?void 0:u.url)!=null?c:"",label:(l=(m=(h=e.p)==null?void 0:h.body)==null?void 0:m.dataStream.slice(i.startIndex,i.endIndex+1).replaceAll(o.DataStreamTreeTokenType.CUSTOM_RANGE_START,"").replaceAll(o.DataStreamTreeTokenType.CUSTOM_RANGE_END,""))!=null?l:""}}))!=null?d:[]:[]}updateHyperLink(e,t,s){const d={unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId(),row:this._range.startRow,column:this._range.startColumn,id:e,payload:{payload:t,display:s}};return this._commandService.executeCommand(n.UpdateHyperLinkCommand.id,d)}cancelHyperLink(e){const t={unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId(),row:this._range.startRow,column:this._range.startColumn,id:e};return this._commandService.syncExecuteCommand(n.CancelHyperLinkCommand.id,t)}}a.FRange.extend(y),r.FWorkbookHyperLinkMixin=p,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
// @univerjs/sheets-sort/index
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
// @univerjs/sheets-sort/facade
|
|
68
|
-
(function(e,
|
|
68
|
+
(function(e,s){typeof exports=="object"&&typeof module<"u"?s(require("@univerjs/sheets-sort"),require("@univerjs/sheets/facade"),require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-sort","@univerjs/sheets/facade","@univerjs/core"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e.UniverSheetsSort,e.UniverSheetsFacade,e.UniverCore))})(this,function(e,s,a){"use strict";class C extends s.FRange{sort(r){const t=this._range.startColumn,i=(Array.isArray(r)?r:[r]).map(o=>typeof o=="number"?{colIndex:o+t,type:e.SortType.ASC}:{colIndex:o.column+t,type:o.ascending?e.SortType.ASC:e.SortType.DESC});return this._commandService.syncExecuteCommand(e.SortRangeCommand.id,{orderRules:i,range:this._range,hasTitle:!1,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}}s.FRange.extend(C);class R extends s.FWorksheet{sort(r,t=!0){const n=[{colIndex:r,type:t?e.SortType.ASC:e.SortType.DESC}],i={startRow:0,startColumn:0,endRow:this._worksheet.getRowCount()-1,endColumn:this._worksheet.getColumnCount()-1,rangeType:a.RANGE_TYPE.ALL};return this._commandService.syncExecuteCommand(e.SortRangeCommand.id,{orderRules:n,range:i,hasTitle:!1,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}}s.FWorksheet.extend(R),a.FEventName.extend(s.FSheetEventName);class l extends a.FUniver{_initialize(r){const t=r.get(a.ICommandService);this.disposeWithMe(t.beforeCommandExecuted(n=>{switch(n.id){case e.SortRangeCommand.id:this._beforeRangeSort(n);break}})),this.disposeWithMe(t.onCommandExecuted(n=>{switch(n.id){case e.SortRangeCommand.id:this._onRangeSorted(n);break}}))}_beforeRangeSort(r){const t=r.params,n=this.getUniverSheet(t.unitId),i=n.getSheetBySheetId(t.subUnitId),{startColumn:o,endColumn:m,startRow:d,endRow:u}=t.range,g=i.getRange(d,o,u-d+1,m-o+1),c={workbook:n,worksheet:i,range:g,sortColumn:t.orderRules.map(h=>({column:h.colIndex-o,ascending:h.type===e.SortType.ASC}))};if(this.fireEvent(this.Event.SheetBeforeRangeSort,c),c.cancel)throw new Error("SortRangeCommand canceled.")}_onRangeSorted(r){const t=r.params,n=this.getUniverSheet(t.unitId),i=n.getSheetBySheetId(t.subUnitId),{startColumn:o,endColumn:m,startRow:d,endRow:u}=t.range,g=i.getRange(d,o,u-d+1,m-o+1),c={workbook:n,worksheet:i,range:g,sortColumn:t.orderRules.map(h=>({column:h.colIndex-o,ascending:h.type===e.SortType.ASC}))};if(this.fireEvent(this.Event.SheetRangeSorted,c),c.cancel)throw new Error("SortRangeCommand canceled.")}}a.FUniver.extend(l)});
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
// @univerjs/thread-comment/index
|