@univerjs/sheets-find-replace 0.3.0-alpha.1 → 0.3.0-nightly.202410101606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -631
- package/lib/types/controllers/sheet-find-replace.controller.d.ts +1 -1
- package/lib/types/plugin.d.ts +2 -1
- package/lib/umd/index.js +1 -1
- package/package.json +14 -15
- package/LICENSE +0 -176
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ICellData, IDisposable, IRange, Nullable, Workbook, Worksheet, Disposable, ICommandService, IContextService, Injector, IUniverInstanceService, ThemeService } from '@univerjs/core';
|
|
2
|
-
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
2
|
import { IFindComplete, IFindMatch, IFindMoveParams, IFindQuery, IReplaceAllResult, FindModel, FindReplaceController, IFindReplaceService } from '@univerjs/find-replace';
|
|
3
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
4
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
5
5
|
import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
6
6
|
export declare class SheetsFindReplaceController extends Disposable implements IDisposable {
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
1
|
import { IUniverSheetsFindReplaceConfig } from './controllers/config.schema';
|
|
2
|
+
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
export declare class UniverSheetsFindReplacePlugin extends Plugin {
|
|
4
4
|
private readonly _config;
|
|
5
5
|
protected readonly _injector: Injector;
|
|
@@ -8,4 +8,5 @@ export declare class UniverSheetsFindReplacePlugin extends Plugin {
|
|
|
8
8
|
static type: UniverInstanceType;
|
|
9
9
|
constructor(_config: Partial<IUniverSheetsFindReplaceConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
10
10
|
onStarting(): void;
|
|
11
|
+
onSteady(): void;
|
|
11
12
|
}
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/find-replace"),require("@univerjs/sheets"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/find-replace","@univerjs/sheets","@univerjs/engine-render","@univerjs/sheets-ui","rxjs"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverSheetsFindReplace={},global.UniverCore,global.UniverFindReplace,global.UniverSheets,global.UniverEngineRender,global.UniverSheetsUi,global.rxjs))})(this,function(exports2,core,findReplace,sheets,engineRender,sheetsUi,rxjs){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b,_c,_d;const _SheetFindReplaceHighlightShape=class _SheetFindReplaceHighlightShape extends engineRender.Shape{constructor(key,props){super(key,props);__publicField(this,"_activated",!1);__publicField(this,"_inHiddenRange",!1);__publicField(this,"_color");props&&this.setShapeProps(props)}setShapeProps(props){this._activated=!!props.activated,typeof props.inHiddenRange<"u"&&(this._inHiddenRange=props.inHiddenRange),typeof props.color<"u"&&(this._color=props.color),this.transformByState({width:props.width,height:props.height})}_draw(ctx){const activated=this._activated,color=`rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, 0.35)`,borderColor=`rgb(${this._color.r}, ${this._color.g}, ${this._color.b})`;engineRender.Rect.drawWith(ctx,{width:this.width,height:this.height,fill:color,stroke:activated?borderColor:void 0,strokeWidth:activated?2:0,evented:!1})}};__name(_SheetFindReplaceHighlightShape,"SheetFindReplaceHighlightShape");let SheetFindReplaceHighlightShape=_SheetFindReplaceHighlightShape;const SheetReplaceCommand={id:"sheet.command.replace",type:core.CommandType.COMMAND,handler:__name(async(accessor,params)=>{const undoRedoService=accessor.get(core.IUndoRedoService),commandService=accessor.get(core.ICommandService),{unitId,replacements}=params,disposeBatchingHandler=undoRedoService.__tempBatchingUndoRedo(unitId),results=await Promise.all(replacements.map(replacement=>commandService.executeCommand(sheets.SetRangeValuesCommand.id,{unitId,subUnitId:replacement.subUnitId,value:replacement.value})));return disposeBatchingHandler.dispose(),getReplaceAllResult(results,replacements)},"handler")};function getReplaceAllResult(results,replacements){let success=0,failure=0;return results.forEach((r,index)=>{const count=replacements[index].count;r?success+=count:failure+=count}),{success,failure}}__name(getReplaceAllResult,"getReplaceAllResult");function isSamePosition(range1,range2){return range1.startRow===range2.startRow&&range1.startColumn===range2.startColumn}__name(isSamePosition,"isSamePosition");function isBehindPositionWithRowPriority(range1,range2){return range1.startRow<range2.startRow||range1.startRow===range2.startRow&&range1.startColumn<=range2.startColumn}__name(isBehindPositionWithRowPriority,"isBehindPositionWithRowPriority");function isBehindPositionWithColumnPriority(range1,range2){return range1.startColumn<range2.startColumn||range1.startColumn===range2.startColumn&&range1.startRow<=range2.startRow}__name(isBehindPositionWithColumnPriority,"isBehindPositionWithColumnPriority");function isBeforePositionWithRowPriority(range1,range2){return range1.startRow>range2.startRow||range1.startRow===range2.startRow&&range1.startColumn>=range2.startColumn}__name(isBeforePositionWithRowPriority,"isBeforePositionWithRowPriority");function isBeforePositionWithColumnPriority(range1,range2){return range1.startColumn>range2.startColumn||range1.startColumn===range2.startColumn&&range1.startRow>=range2.startRow}__name(isBeforePositionWithColumnPriority,"isBeforePositionWithColumnPriority");function isSelectionSingleCell(selection,worksheet){const{range}=selection,{startRow,startColumn}=range,hasMergedCell=worksheet.getMergedCell(startRow,startColumn);return hasMergedCell?core.Rectangle.equals(range,hasMergedCell):range.endRow===range.startRow&&range.endColumn===range.startColumn}__name(isSelectionSingleCell,"isSelectionSingleCell");var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");exports2.SheetsFindReplaceController=(_a=class extends core.Disposable{constructor(_injector,_findReplaceController,_contextService,_findReplaceService,_commandService){super();__publicField(this,"_provider");this._injector=_injector,this._findReplaceController=_findReplaceController,this._contextService=_contextService,this._findReplaceService=_findReplaceService,this._commandService=_commandService,this._init(),this._initCommands()}dispose(){super.dispose(),this._findReplaceController.closePanel(),this._provider.dispose()}_init(){const provider=this._injector.createInstance(SheetsFindReplaceProvider);this._provider=provider,this.disposeWithMe(this._findReplaceService.registerFindReplaceProvider(provider)),this.disposeWithMe(this._contextService.subscribeContextValue$(core.EDITOR_ACTIVATED).pipe(rxjs.filter(v=>!!v)).subscribe(()=>this._findReplaceController.closePanel()))}_initCommands(){[SheetReplaceCommand].forEach(command=>this.disposeWithMe(this._commandService.registerCommand(command)))}},__name(_a,"SheetsFindReplaceController"),_a),exports2.SheetsFindReplaceController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Steady,exports2.SheetsFindReplaceController),__decorateParam$1(0,core.Inject(core.Injector)),__decorateParam$1(1,core.Inject(findReplace.FindReplaceController)),__decorateParam$1(2,core.IContextService),__decorateParam$1(3,findReplace.IFindReplaceService),__decorateParam$1(4,core.ICommandService)],exports2.SheetsFindReplaceController);const SHEETS_FIND_REPLACE_PROVIDER_NAME="sheets-find-replace-provider",FIND_REPLACE_Z_INDEX=1e4;let SheetFindModel=(_b=class extends findReplace.FindModel{constructor(_workbook,_sheetSkeletonManagerService,_univerInstanceService,_renderManagerService,_commandService,_contextService,_themeService,_selectionManagerService){super();__publicField(this,"_matchesUpdate$",new rxjs.Subject);__publicField(this,"matchesUpdate$",this._matchesUpdate$.asObservable());__publicField(this,"_activelyChangingMatch$",new rxjs.Subject);__publicField(this,"activelyChangingMatch$",this._activelyChangingMatch$.asObservable());__publicField(this,"_matchesByWorksheet",new Map);__publicField(this,"_matches",[]);__publicField(this,"_matchesPosition",0);__publicField(this,"_activeHighlightIndex",-1);__publicField(this,"_highlightShapes",[]);__publicField(this,"_currentHighlightShape",null);__publicField(this,"_query",null);__publicField(this,"_workbookSelections");this._workbook=_workbook,this._sheetSkeletonManagerService=_sheetSkeletonManagerService,this._univerInstanceService=_univerInstanceService,this._renderManagerService=_renderManagerService,this._commandService=_commandService,this._contextService=_contextService,this._themeService=_themeService,this._workbookSelections=_selectionManagerService.getWorkbookSelections(this.unitId)}get _matchesCount(){return this._matches.length}get unitId(){return this._workbook.getUnitId()}get matchesCount(){return this._matchesCount}get matchesPosition(){return this._matchesPosition}get currentMatch(){return this._matchesPosition>0?this._matches[this._matchesPosition-1]:null}dispose(){super.dispose(),this._disposeHighlights(),this._toggleDisplayRawFormula(!1)}getMatches(){return this._matches}start(query){switch(this._query=query,query.findBy===findReplace.FindBy.FORMULA?this._toggleDisplayRawFormula(!0):this._toggleDisplayRawFormula(!1),query.findScope){case findReplace.FindScope.UNIT:this.findInWorkbook(query);break;case findReplace.FindScope.SUBUNIT:default:this.findInActiveWorksheet(query);break}}_toggleDisplayRawFormula(force){this._contextService.setContextValue(engineRender.RENDER_RAW_FORMULA_KEY,force)}findInWorkbook(query){const unitId=this._workbook.getUnitId();let complete,firstSearch=!0;const findInWorkbook=__name(()=>{const allCompletes=this._workbook.getSheets().filter(worksheet=>!worksheet.isSheetHidden()).map(worksheet=>{const complete2=this._findInWorksheet(worksheet,query,unitId),sheetId=worksheet.getSheetId(),{results}=complete2;return results.length?this._matchesByWorksheet.set(sheetId,complete2.results):this._matchesByWorksheet.delete(sheetId),complete2});this._matches=allCompletes.map(c=>c.results).flat(),this._updateFindHighlight(),firstSearch?(complete={results:this._matches},firstSearch=!1):this._matchesUpdate$.next(this._matches)},"findInWorkbook");return this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(()=>{this._updateFindHighlight(),this._updateCurrentHighlightShape(this._activeHighlightIndex)})),this.disposeWithMe(core.fromCallback(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(rxjs.filter(([command,options])=>command.id===sheets.SetWorksheetActiveOperation.id&&!(options!=null&&options.fromFindReplace))).subscribe(()=>{const activeSheet=this._workbook.getActiveSheet();if(!activeSheet)return;const activeSheetId=activeSheet.getSheetId();this._matchesByWorksheet.has(activeSheetId)&&this._findNextMatchOnActiveSheetChange(activeSheet)})),this.disposeWithMe(core.fromCallback(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(rxjs.filter(([command])=>command.type===core.CommandType.MUTATION&&command.params.unitId===this._workbook.getUnitId()),rxjs.throttleTime(600,void 0,{leading:!1,trailing:!0})).subscribe(()=>findInWorkbook())),findInWorkbook(),complete}_findNextMatchOnActiveSheetChange(activeSheet){let match,index,globalIndex=0;const matchesByWorksheet=this._matchesByWorksheet.get(activeSheet.getSheetId()),selections=this._workbookSelections.getCurrentSelections();selections!=null&&selections.length?([match,globalIndex]=this._findNextMatchByRange(matchesByWorksheet,selections[0].range),index=matchesByWorksheet.findIndex(m=>m===match)):(match=matchesByWorksheet[0],index=0,globalIndex=this._matches.findIndex(m=>m===match)),this._matchesPosition=globalIndex+1,this._activelyChangingMatch$.next(match),this._activeHighlightIndex=index,this._updateFindHighlight(),this._updateCurrentHighlightShape(index)}findInActiveWorksheet(query){const unitId=this._workbook.getUnitId(),checkShouldFindInSelections=__name(()=>{var _a2;const currentWorksheet=this._workbook.getActiveSheet();if(!currentWorksheet)return!1;const currentSelections=this._workbookSelections.getCurrentSelections();return(_a2=currentSelections==null?void 0:currentSelections.some(selection=>!isSelectionSingleCell(selection,currentWorksheet)))!=null?_a2:!1},"checkShouldFindInSelections");let complete,firstSearch=!0,findBySelections=!1;const performFindInWorksheet=__name(()=>{const currentWorksheet=this._workbook.getActiveSheet();if(!currentWorksheet)return{results:[]};const lastMatch=this.currentMatch;findBySelections=checkShouldFindInSelections();const currentSelections=this._workbookSelections.getCurrentSelections(),newComplete=findBySelections?this._findInSelections(currentWorksheet,currentSelections,query,unitId):this._findInWorksheet(currentWorksheet,query,unitId);return this._matches=newComplete.results,this._matchesPosition=this._tryRestoreLastMatchesPosition(lastMatch,this._matches),firstSearch?(complete=newComplete,firstSearch=!1):this._matchesUpdate$.next(this._matches),this._updateFindHighlight(),newComplete},"performFindInWorksheet");return this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(()=>this._updateFindHighlight())),this.disposeWithMe(rxjs.merge(core.fromCallback(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(rxjs.filter(([command])=>{if(command.type===core.CommandType.MUTATION&&command.params.unitId===this._workbook.getUnitId())return!0;if(command.id===sheets.SetSelectionsOperation.id&&command.params.unitId===unitId){const shouldFindBySelections=checkShouldFindInSelections();return shouldFindBySelections===!1&&findBySelections===!1?!1:(findBySelections=shouldFindBySelections,!0)}return!1})),this._workbook.activeSheet$.pipe(rxjs.skip(1))).pipe(rxjs.debounceTime(200)).subscribe(()=>performFindInWorksheet())),performFindInWorksheet(),complete}_findInRange(worksheet,query,range,unitId,dedupeFn){const results=[],subUnitId=worksheet.getSheetId(),iter=(query.findDirection===findReplace.FindDirection.COLUMN?worksheet.iterateByColumn:worksheet.iterateByRow).bind(worksheet)(range);for(const value of iter){const{row,col,colSpan,rowSpan,value:cellData}=value;if(dedupeFn!=null&&dedupeFn(row,col)||!cellData||worksheet.getRowFiltered(row))continue;const{hit,replaceable,isFormula}=hitCell(worksheet,row,col,query,cellData);if(hit){const result={provider:SHEETS_FIND_REPLACE_PROVIDER_NAME,unitId,replaceable,isFormula,range:{subUnitId,range:{startRow:row,startColumn:col,endColumn:col+(colSpan!=null?colSpan:1)-1,endRow:row+(rowSpan!=null?rowSpan:1)-1}}};results.push(result)}}return{results}}_findInSelections(worksheet,selections,query,unitId){const{findDirection}=query,sortFn=findDirection===findReplace.FindDirection.ROW?isBehindPositionWithRowPriority:isBehindPositionWithColumnPriority,dedupeSet=new Set;return{results:selections.map(selection=>this._findInRange(worksheet,query,selection.range,unitId,(row,col)=>{const key=`${row}-${col}`;return dedupeSet.has(key)?!0:(dedupeSet.add(key),!1)}).results).flat().sort((a,b)=>sortFn(a.range.range,b.range.range)?-1:1)}}_findInWorksheet(worksheet,query,unitId){const rowCount=worksheet.getRowCount(),colCount=worksheet.getColumnCount(),range={startRow:0,startColumn:0,endRow:rowCount-1,endColumn:colCount-1};return this._findInRange(worksheet,query,range,unitId)}_disposeHighlights(){var _a2;this._highlightShapes.forEach(shape=>{var _a3;(_a3=shape.getScene())==null||_a3.makeDirty(),shape.dispose()}),this._highlightShapes=[],(_a2=this._currentHighlightShape)==null||_a2.dispose(),this._currentHighlightShape=null}_updateFindHighlight(){var _a2;this._disposeHighlights();const skeleton=(_a2=this._sheetSkeletonManagerService.getCurrent())==null?void 0:_a2.skeleton;if(!skeleton)return;const unitId=this._workbook.getUnitId(),currentRender=this._renderManagerService.getRenderById(unitId);if(currentRender==null)return;const{scene}=currentRender,matches=this._matches,searchBackgroundColor=this._themeService.getCurrentTheme().gold400,color=new core.ColorKit(searchBackgroundColor).toRgb(),worksheet=this._workbook.getActiveSheet();if(!worksheet)return;const activeSheetId=worksheet.getSheetId(),highlightShapes=matches.filter(match=>match.range.subUnitId===activeSheetId).map((find,index)=>{const{startColumn,startRow,endColumn,endRow}=find.range.range,startPosition=sheetsUi.getCoordByCell(startRow,startColumn,scene,skeleton),endPosition=sheetsUi.getCoordByCell(endRow,endColumn,scene,skeleton),{startX,startY}=startPosition,{endX,endY}=endPosition,rowHidden=!worksheet.getRowRawVisible(startRow),columnHidden=!worksheet.getColVisible(startColumn),inHiddenRange=rowHidden||columnHidden,width=columnHidden?2:endX-startX,height=rowHidden?2:endY-startY,props={left:startX,top:startY,color,width,height,evented:!1,inHiddenRange,zIndex:FIND_REPLACE_Z_INDEX};return new SheetFindReplaceHighlightShape(`find-highlight-${index}`,props)});scene.addObjects(highlightShapes),this._highlightShapes=highlightShapes,scene.makeDirty()}_updateCurrentHighlightShape(matchIndex){var _a2;if((_a2=this._currentHighlightShape)==null||_a2.setShapeProps({activated:!1}),this._currentHighlightShape=null,matchIndex!==void 0){const shape=this._highlightShapes[matchIndex];if(!shape)return;this._currentHighlightShape=shape,shape.setShapeProps({activated:!0})}}_getSheetObject(){return sheetsUi.getSheetObject(this._univerInstanceService,this._renderManagerService)}_focusMatch(match){var _a2;const subUnitId=match.range.subUnitId;subUnitId!==((_a2=this._workbook.getActiveSheet())==null?void 0:_a2.getSheetId())&&this._commandService.executeCommand(sheets.SetWorksheetActivateCommand.id,{unitId:this._workbook.getUnitId(),subUnitId},{fromFindReplace:!0}),this._commandService.executeCommand(sheetsUi.ScrollToCellCommand.id,{range:match.range.range},{fromFindReplace:!0})}_tryRestoreLastMatchesPosition(lastMatch,newMatches){if(!lastMatch)return 0;const{subUnitId:lastSubUnitId}=lastMatch.range,{startColumn:lastStartColumn,startRow:lastStartRow}=lastMatch.range.range,index=newMatches.findIndex(match=>{if(lastSubUnitId!==match.range.subUnitId)return!1;const{startColumn,startRow}=match.range.range;return startColumn===lastStartColumn&&startRow===lastStartRow});return index>-1?index+1:0}moveToNextMatch(params){var _a2,_b2,_c2,_d2,_e;if(!this._matches.length)return null;const loop=(_a2=params==null?void 0:params.loop)!=null?_a2:!1,stayIfOnMatch=(_b2=params==null?void 0:params.stayIfOnMatch)!=null?_b2:!1,noFocus=(_c2=params==null?void 0:params.noFocus)!=null?_c2:!1,ignoreSelection=(_d2=params==null?void 0:params.ignoreSelection)!=null?_d2:!1,matchToMove=this._findNextMatch(loop,stayIfOnMatch,ignoreSelection);if(matchToMove){const[match,index]=matchToMove;return this._matchesPosition=index+1,this._query.findScope===findReplace.FindScope.UNIT?this._activeHighlightIndex=this._matchesByWorksheet.get(match.range.subUnitId).findIndex(m=>m===match):this._activeHighlightIndex=index,noFocus||this._focusMatch(match),((_e=this._workbook.getActiveSheet())==null?void 0:_e.getSheetId())===match.range.subUnitId&&this._updateCurrentHighlightShape(this._activeHighlightIndex),match}return this._matchesPosition=0,this._updateCurrentHighlightShape(),null}moveToPreviousMatch(params){var _a2,_b2,_c2,_d2,_e;if(!this._matches.length)return null;const loop=(_a2=params==null?void 0:params.loop)!=null?_a2:!1,stayIfOnMatch=(_b2=params==null?void 0:params.stayIfOnMatch)!=null?_b2:!1,noFocus=(_c2=params==null?void 0:params.noFocus)!=null?_c2:!1,ignoreSelection=(_d2=params==null?void 0:params.ignoreSelection)!=null?_d2:!1,matchToMove=this._findPreviousMatch(loop,stayIfOnMatch,ignoreSelection);if(matchToMove){const[match,index]=matchToMove;return this._matchesPosition=index+1,this._query.findScope===findReplace.FindScope.UNIT?this._activeHighlightIndex=this._matchesByWorksheet.get(match.range.subUnitId).findIndex(m=>m===match):this._activeHighlightIndex=index,noFocus||this._focusMatch(match),((_e=this._workbook.getActiveSheet())==null?void 0:_e.getSheetId())===match.range.subUnitId&&this._updateCurrentHighlightShape(this._activeHighlightIndex),match}return this._matchesPosition=0,this._updateCurrentHighlightShape(),null}_findPreviousMatch(loop=!1,stayIfOnMatch=!1,ignoreSelection=!1){var _a2;if(this.currentMatch){const currentMatchIndex=this._matches.findIndex(match=>match===this.currentMatch);if(stayIfOnMatch)return[this.currentMatch,currentMatchIndex];const nextMatchIndex=currentMatchIndex-1;if(!loop&&nextMatchIndex<0)return null;const length=this._matches.length,modded=(nextMatchIndex+length)%length;return[this._matches[modded],modded]}const lastSelection=this._workbookSelections.getCurrentLastSelection();if(ignoreSelection||!lastSelection){const lastIndex=this._matches.length-1;return[this._matches[lastIndex],lastIndex]}if(this._query.findScope!==findReplace.FindScope.UNIT)return this._findPreviousMatchByRange(this._matches,lastSelection.range);const currentSheetId=(_a2=this._workbook.getActiveSheet())==null?void 0:_a2.getSheetId();if(!currentSheetId)return null;const worksheetThatHasMatch=this._findPreviousWorksheetThatHasAMatch(currentSheetId,loop);return worksheetThatHasMatch?this._findPreviousMatchByRange(this._matchesByWorksheet.get(worksheetThatHasMatch),lastSelection.range):null}_findNextMatch(loop=!1,stayIfOnMatch=!1,ignoreSelection=!1){var _a2;if(this.currentMatch){const currentMatchIndex=this._matches.findIndex(match=>match===this.currentMatch);if(stayIfOnMatch)return[this.currentMatch,currentMatchIndex];const nextMatchIndex=currentMatchIndex+1,length=this._matches.length;if(!loop&&nextMatchIndex>=length)return null;const modded=nextMatchIndex%length;return[this._matches[modded],modded]}const last=this._workbookSelections.getCurrentLastSelection();if(ignoreSelection||!last)return[this._matches[0],0];if(this._query.findScope!==findReplace.FindScope.UNIT)return this._findNextMatchByRange(this._matches,last.range,stayIfOnMatch);const currentSheetId=(_a2=this._workbook.getActiveSheet())==null?void 0:_a2.getSheetId();if(!currentSheetId)return null;const worksheetThatHasMatch=this._findNextWorksheetThatHasAMatch(currentSheetId,loop);return worksheetThatHasMatch?this._findNextMatchByRange(this._matchesByWorksheet.get(worksheetThatHasMatch),last.range):null}_findPreviousWorksheetThatHasAMatch(currentWorksheet,loop=!1){const rawWorksheetsInOrder=this._workbook.getSheetOrders(),currentSheetIndex=rawWorksheetsInOrder.findIndex(sheet=>sheet===currentWorksheet),first=(loop?core.rotate(rawWorksheetsInOrder,currentSheetIndex+1):rawWorksheetsInOrder.slice(0,currentSheetIndex+1)).findLast(worksheet=>this._matchesByWorksheet.has(worksheet));return first!=null?first:null}_findNextWorksheetThatHasAMatch(currentWorksheet,loop=!1){const rawWorksheetsInOrder=this._workbook.getSheetOrders(),currentSheetIndex=rawWorksheetsInOrder.findIndex(sheet=>sheet===currentWorksheet),first=(loop?core.rotate(rawWorksheetsInOrder,currentSheetIndex):rawWorksheetsInOrder.slice(currentSheetIndex)).find(worksheet=>this._matchesByWorksheet.has(worksheet));return first!=null?first:null}_findNextMatchByRange(matches,range,stayIfOnMatch=!1){const findByRow=this._query.findDirection===findReplace.FindDirection.ROW;let index=matches.findIndex(match2=>{const matchRange=match2.range.range;if(!(findByRow?isBehindPositionWithRowPriority(range,matchRange):isBehindPositionWithColumnPriority(range,matchRange)))return!1;const isSame=isSamePosition(range,matchRange);return stayIfOnMatch?isSame:!isSame});index===-1&&(index=matches.length-1);const match=matches[index];return[match,this._matches.findIndex(m=>m===match)]}_findPreviousMatchByRange(matches,range,stayIfOnMatch=!1){const findByRow=this._query.findDirection===findReplace.FindDirection.ROW;let index=this._matches.findLastIndex(match2=>{const matchRange=match2.range.range;if(!(findByRow?isBeforePositionWithRowPriority(range,matchRange):isBeforePositionWithColumnPriority(range,matchRange)))return!1;const isSame=isSamePosition(range,matchRange);return stayIfOnMatch?isSame:!isSame});index===-1&&(index=0);const match=matches[index];return[match,this._matches.findIndex(m=>m===match)]}async replace(replaceString){if(this._matchesCount===0||!this.currentMatch||!this._query||!this.currentMatch.replaceable)return!1;const range=this.currentMatch.range,targetWorksheet=this._workbook.getSheetBySheetId(this.currentMatch.range.subUnitId),newContent=this._getReplacedCellData(this.currentMatch,targetWorksheet,this._query.findBy===findReplace.FindBy.FORMULA,this._query.findString,replaceString,this._query.caseSensitive?"g":"ig"),params={unitId:this.currentMatch.unitId,subUnitId:range.subUnitId,value:{[range.range.startRow]:{[range.range.startColumn]:newContent}}};return this._commandService.executeCommand(sheets.SetRangeValuesCommand.id,params)}async replaceAll(replaceString){if(this._matchesCount===0||!this._query)return{success:0,failure:0};const unitId=this._workbook.getUnitId(),{findString,caseSensitive,findBy}=this._query,shouldReplaceFormula=findBy===findReplace.FindBy.FORMULA,replaceFlag=caseSensitive?"g":"ig",replacements=[];return core.groupBy(this._matches.filter(m=>m.replaceable),match=>match.range.subUnitId).forEach((matches,subUnitId)=>{const matrix=new core.ObjectMatrix,worksheet=this._workbook.getSheetBySheetId(subUnitId);matches.forEach(match=>{const{startColumn,startRow}=match.range.range,newCellData=this._getReplacedCellData(match,worksheet,shouldReplaceFormula,findString,replaceString,replaceFlag);newCellData&&matrix.setValue(startRow,startColumn,newCellData)}),replacements.push({count:matches.length,subUnitId,value:matrix.getMatrix()})}),replacements?this._commandService.executeCommand(SheetReplaceCommand.id,{unitId,replacements}):{success:0,failure:0}}_getReplacedCellData(match,worksheet,shouldReplaceFormula,findString,replaceString,replaceFlag){var _a2;const range=match.range.range,{startRow,startColumn}=range,currentContent=worksheet.getCellRaw(startRow,startColumn);if(match.isFormula)return shouldReplaceFormula?{f:currentContent.f.replace(new RegExp(escapeRegExp(findString),replaceFlag),replaceString),v:null}:null;if(!!((_a2=currentContent.p)!=null&&_a2.body)){const clonedRichText=core.Tools.deepClone(currentContent.p);return core.replaceInDocumentBody(clonedRichText.body,findString,replaceString),{p:clonedRichText}}return{v:currentContent.v.toString().replace(new RegExp(escapeRegExp(findString),replaceFlag),replaceString)}}},__name(_b,"SheetFindModel"),_b);SheetFindModel=__decorateClass$1([__decorateParam$1(2,core.IUniverInstanceService),__decorateParam$1(3,engineRender.IRenderManagerService),__decorateParam$1(4,core.ICommandService),__decorateParam$1(5,core.IContextService),__decorateParam$1(6,core.Inject(core.ThemeService)),__decorateParam$1(7,core.Inject(sheets.SheetsSelectionsService))],SheetFindModel);function escapeRegExp(text){return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}__name(escapeRegExp,"escapeRegExp");let SheetsFindReplaceProvider=(_c=class extends core.Disposable{constructor(_univerInstanceService,_renderManagerService,_injector){super();__publicField(this,"_findModelsByUnitId",new Map);this._univerInstanceService=_univerInstanceService,this._renderManagerService=_renderManagerService,this._injector=_injector}async find(query){this._terminate();const allWorkbooks=this._univerInstanceService.getAllUnitsForType(core.UniverInstanceType.UNIVER_SHEET),parsedQuery=this._preprocessQuery(query);return allWorkbooks.map(workbook=>{const skeletonManagerService=this._renderManagerService.getRenderById(workbook.getUnitId()).with(sheetsUi.SheetSkeletonManagerService),sheetFind=this._injector.createInstance(SheetFindModel,workbook,skeletonManagerService);return this._findModelsByUnitId.set(workbook.getUnitId(),sheetFind),sheetFind.start(parsedQuery),sheetFind})}terminate(){this._terminate()}_terminate(){this._findModelsByUnitId.forEach(model=>model.dispose()),this._findModelsByUnitId.clear()}_preprocessQuery(query){let findString=query.caseSensitive?query.findString:query.findString.toLowerCase();return findString=findString.trim(),{...query,findString}}},__name(_c,"SheetsFindReplaceProvider"),_c);SheetsFindReplaceProvider=__decorateClass$1([__decorateParam$1(0,core.IUniverInstanceService),__decorateParam$1(1,engineRender.IRenderManagerService),__decorateParam$1(2,core.Inject(core.Injector))],SheetsFindReplaceProvider);const VALUE_PASSING_OBJECT={hit:!1,replaceable:!1,isFormula:!1,rawData:null};function hitCell(worksheet,row,col,query,cellData){const{findBy}=query,findByFormula=findBy===findReplace.FindBy.FORMULA,rawData=worksheet.getCellRaw(row,col);return VALUE_PASSING_OBJECT.rawData=rawData,!(rawData!=null&&rawData.f)?(VALUE_PASSING_OBJECT.isFormula=!1,matchCellData(cellData,query)?rawData?(VALUE_PASSING_OBJECT.hit=!0,VALUE_PASSING_OBJECT.replaceable=!0):(VALUE_PASSING_OBJECT.hit=!0,VALUE_PASSING_OBJECT.replaceable=!1):(VALUE_PASSING_OBJECT.hit=!1,VALUE_PASSING_OBJECT.replaceable=!1),VALUE_PASSING_OBJECT):(VALUE_PASSING_OBJECT.isFormula=!0,findByFormula?matchCellData({v:rawData.f},query)?(VALUE_PASSING_OBJECT.hit=!0,VALUE_PASSING_OBJECT.replaceable=!0,VALUE_PASSING_OBJECT):(VALUE_PASSING_OBJECT.hit=!1,VALUE_PASSING_OBJECT.replaceable=!1,VALUE_PASSING_OBJECT):(VALUE_PASSING_OBJECT.replaceable=!1,matchCellData(cellData,query)?VALUE_PASSING_OBJECT.hit=!0:VALUE_PASSING_OBJECT.hit=!1,VALUE_PASSING_OBJECT))}__name(hitCell,"hitCell");function matchCellData(cellData,query){let value=extractPureValue(cellData);return value?query.matchesTheWholeCell?(value=trimLeadingTrailingWhitespace(value),query.caseSensitive?value===query.findString:value.toLowerCase()===query.findString):query.caseSensitive?value.indexOf(query.findString)>-1:value.toLowerCase().indexOf(query.findString)>-1:!1}__name(matchCellData,"matchCellData");function extractPureValue(cell){var _a2,_b2,_c2;const rawValue=(_c2=(_b2=(_a2=cell==null?void 0:cell.p)==null?void 0:_a2.body)==null?void 0:_b2.dataStream)!=null?_c2:cell==null?void 0:cell.v;return typeof rawValue=="number"?`${rawValue}`:typeof rawValue=="boolean"?rawValue?"1":"0":rawValue}__name(extractPureValue,"extractPureValue");function trimLeadingTrailingWhitespace(value){return value.replace(/^ +/g,"").replace(/ +$/g,"")}__name(trimLeadingTrailingWhitespace,"trimLeadingTrailingWhitespace");const PLUGIN_CONFIG_KEY="sheets-find-replace.config",defaultPluginConfig={};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__defNormalProp2=__name((obj,key,value)=>key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,"__defNormalProp"),__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),__publicField2=__name((obj,key,value)=>__defNormalProp2(obj,typeof key!="symbol"?key+"":key,value),"__publicField");const NAME="SHEET_FIND_REPLACE_PLUGIN";exports2.UniverSheetsFindReplacePlugin=(_d=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[exports2.SheetsFindReplaceController]].forEach(d=>this._injector.add(d))}},__name(_d,"UniverSheetsFindReplacePlugin"),_d),__publicField2(exports2.UniverSheetsFindReplacePlugin,"pluginName",NAME),__publicField2(exports2.UniverSheetsFindReplacePlugin,"type",core.UniverInstanceType.UNIVER_SHEET),exports2.UniverSheetsFindReplacePlugin=__decorateClass([core.DependentOn(sheets.UniverSheetsPlugin,sheets.UniverSheetsPlugin,findReplace.UniverFindReplacePlugin),__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports2.UniverSheetsFindReplacePlugin),exports2.SheetReplaceCommand=SheetReplaceCommand,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
function _0x5c9a(){const _0x5461b7=['exports','dispose','Module','getRowCount','ColorKit','escapeRegExp','getCurrentSelections','_highlightShapes','startRow','closePanel','registerFindReplaceProvider','_matchesByWorksheet','sheet.command.replace','_univerInstanceService','40GhJjpG','getSheetObject','_findReplaceController','terminate','matchesCount','COMMAND','UniverCore','activated','throttleTime','_workbookSelections','noFocus','replaceable','bind','number','find-highlight-','rawData','6289326kOKeJc','subscribe','_findPreviousWorksheetThatHasAMatch','_query','sheets-find-replace-provider','Rectangle','getCoordByCell','some','setShapeProps','UniverSheetsFindReplacePlugin','Disposable','disposeWithMe','_matchesPosition','_activelyChangingMatch$','startColumn','get','filter','_findNextMatch','@univerjs/core','__decorateClass','@univerjs/engine-render','activelyChangingMatch$','moveToNextMatch','findScope','IRenderManagerService','getMergedCell','__publicField','findInWorkbook','Shape','replaceAll','_color','onStarting','_findInRange','FindScope','_findNextMatchOnActiveSheetChange','toStringTag','findDirection','performFindInWorksheet','function','registerCommand','executeCommand','color','_renderManagerService','CommandType','iterateByColumn','find','188874BYcZQX','_disposeHighlights','body','forEach','isSelectionSingleCell','getActiveSheet','flat','UniverSheets','FindDirection','inHiddenRange','_matchesCount',',\x200.35)','COLUMN','_config','1523039bxPMPv','_findInSelections','SHEET_FIND_REPLACE_PLUGIN','subscribeContextValue$','_inHiddenRange','_initCommands','getUnitId','hitCell','sort','next','setValue','EDITOR_ACTIVATED','_findPreviousMatch','asObservable','IUndoRedoService','IContextService','_themeService','3804260pPwswR','_terminate','results','getCurrent','caseSensitive','createInstance','getWorkbookSelections','UNIVER_SHEET','replace','findIndex','height','SheetFindModel','UniverEngineRender','SetWorksheetActiveOperation','SheetsFindReplaceController','set','_findReplaceService','findLastIndex','push','checkShouldFindInSelections','ThemeService','UniverSheetsUi','174BgnBwl','hit','getScene','slice','drawWith','with','add','_preprocessQuery','addObjects','Injector','_findPreviousMatchByRange','matchesUpdate$','UniverFindReplace','getCurrentLastSelection','MUTATION','_updateCurrentHighlightShape','_injector','_init','sheets-find-replace.config','_findModelsByUnitId','IConfigService','__tempBatchingUndoRedo','matchCellData','object','getSheetOrders','fromCallback','isBeforePositionWithRowPriority','amd','DependentOn','FORMULA','ignoreSelection','2969415JOyMSt','RENDER_RAW_FORMULA_KEY','_sheetSkeletonManagerService','getSheets','_getReplacedCellData','setContextValue','iterateByRow','FindModel','IUniverInstanceService','@univerjs/find-replace','68Vssfgg','ICommandService','isBehindPositionWithRowPriority','UniverSheetsFindReplace','map','isBeforePositionWithColumnPriority','UniverFindReplacePlugin','subUnitId','SheetsFindReplaceProvider','SUBUNIT','_tryRestoreLastMatchesPosition','unitId','_findNextMatchByRange','_contextService','getSheetId','ObjectMatrix','skeleton','Rect','ROW','indexOf','extractPureValue','@univerjs/sheets','getSheetBySheetId','Subject','loop','currentMatch','clear','params','toRgb','ScrollToCellCommand','FindBy','_updateFindHighlight','merge','onCommandExecuted','range','fromFindReplace','isSheetHidden','getRenderById','UniverInstanceType','value','_provider','width','rotate','getCurrentTheme','toLowerCase','setConfig','SetRangeValuesCommand','findInActiveWorksheet','has','pipe','_commandService','UniverSheetsPlugin','UNIT','_matchesUpdate$','endRow','Inject','findString','isBehindPositionWithColumnPriority','stayIfOnMatch','start','_matches','currentSkeleton$','getMatches','_findInWorksheet','getAllUnitsForType','_configService','IFindReplaceService','@univerjs/sheets-ui','_toggleDisplayRawFormula','handler','__defNormalProp','getCellRaw','rgba(','skip','type','trimLeadingTrailingWhitespace','findBy','getReplaceAllResult','_findNextWorksheetThatHasAMatch','length','rxjs','_workbook','rgb(','_activated','debounceTime','defineProperty','29396770oTdSaC','getOwnPropertyDescriptor','_focusMatch','_currentHighlightShape','8767susCVV','matchesPosition','makeDirty','_activeHighlightIndex','isFormula'];_0x5c9a=function(){return _0x5461b7;};return _0x5c9a();}function _0x29a4(_0xd760b3,_0x20ba76){const _0x5c9a58=_0x5c9a();return _0x29a4=function(_0x29a4d7,_0xcc5155){_0x29a4d7=_0x29a4d7-0x92;let _0x314f56=_0x5c9a58[_0x29a4d7];return _0x314f56;},_0x29a4(_0xd760b3,_0x20ba76);}(function(_0x945468,_0x5deb56){const _0x450d06=_0x29a4,_0xbb6adc=_0x945468();while(!![]){try{const _0x1188fd=-parseInt(_0x450d06(0xd8))/0x1*(parseInt(_0x450d06(0x15e))/0x2)+parseInt(_0x450d06(0x129))/0x3*(-parseInt(_0x450d06(0x187))/0x4)+-parseInt(_0x450d06(0x148))/0x5+parseInt(_0x450d06(0xfb))/0x6+parseInt(_0x450d06(0x137))/0x7*(-parseInt(_0x450d06(0xeb))/0x8)+parseInt(_0x450d06(0x17d))/0x9+parseInt(_0x450d06(0xd4))/0xa;if(_0x1188fd===_0x5deb56)break;else _0xbb6adc['push'](_0xbb6adc['shift']());}catch(_0x258050){_0xbb6adc['push'](_0xbb6adc['shift']());}}}(_0x5c9a,0x9b4b1),function(_0x386f57,_0x51e047){const _0x565d73=_0x29a4;typeof exports==_0x565d73(0x175)&&typeof module<'u'?_0x51e047(exports,require(_0x565d73(0x10d)),require(_0x565d73(0x186)),require(_0x565d73(0x93)),require(_0x565d73(0x10f)),require(_0x565d73(0xc1)),require(_0x565d73(0xce))):typeof define==_0x565d73(0x121)&&define[_0x565d73(0x179)]?define([_0x565d73(0xdd),_0x565d73(0x10d),_0x565d73(0x186),'@univerjs/sheets',_0x565d73(0x10f),'@univerjs/sheets-ui',_0x565d73(0xce)],_0x51e047):(_0x386f57=typeof globalThis<'u'?globalThis:_0x386f57||self,_0x51e047(_0x386f57[_0x565d73(0x18a)]={},_0x386f57[_0x565d73(0xf1)],_0x386f57[_0x565d73(0x16a)],_0x386f57[_0x565d73(0x130)],_0x386f57[_0x565d73(0x154)],_0x386f57[_0x565d73(0x15d)],_0x386f57[_0x565d73(0xce)]));}(this,function(_0x5e342f,_0x563350,_0x31524d,_0x863b34,_0x56e128,_0x2fd13f,_0x5ee1ca){'use strict';const _0x4bfa45=_0x29a4;var _0x5b107a=Object['defineProperty'],_0x461116=(_0x10fdc3,_0x379b22,_0x5a3286)=>_0x379b22 in _0x10fdc3?_0x5b107a(_0x10fdc3,_0x379b22,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5a3286}):_0x10fdc3[_0x379b22]=_0x5a3286,_0x381f37=(_0x1f0e4c,_0xb2a2e1)=>_0x5b107a(_0x1f0e4c,'name',{'value':_0xb2a2e1,'configurable':!0x0}),_0x2bae30=(_0x2abc6b,_0x3b0173,_0x44b362)=>_0x461116(_0x2abc6b,typeof _0x3b0173!='symbol'?_0x3b0173+'':_0x3b0173,_0x44b362),_0x219977,_0x48d806,_0x12a07e,_0x7636b3;const _0x5a585d=_0x4bfa45(0x170),_0x47142c={},_0x108cfb={'id':_0x4bfa45(0xe9),'type':_0x563350['CommandType'][_0x4bfa45(0xf0)],'handler':_0x381f37(async(_0x1237e6,_0x5ded70)=>{const _0x1671db=_0x4bfa45,_0x523ce3=_0x1237e6[_0x1671db(0x10a)](_0x563350[_0x1671db(0x145)]),_0x108eee=_0x1237e6[_0x1671db(0x10a)](_0x563350[_0x1671db(0x188)]),{unitId:_0x5b78ab,replacements:_0x59e683}=_0x5ded70,_0x226ee9=_0x523ce3[_0x1671db(0x173)](_0x5b78ab),_0x2a0450=await Promise['all'](_0x59e683[_0x1671db(0x18b)](_0x173459=>_0x108eee[_0x1671db(0x123)](_0x863b34['SetRangeValuesCommand']['id'],{'unitId':_0x5b78ab,'subUnitId':_0x173459[_0x1671db(0x18e)],'value':_0x173459[_0x1671db(0xa5)]})));return _0x226ee9[_0x1671db(0xde)](),_0x2ad458(_0x2a0450,_0x59e683);},_0x4bfa45(0xc3))};function _0x2ad458(_0x2885c4,_0x5aac1e){const _0x232a1f=_0x4bfa45;let _0x103d71=0x0,_0xb02399=0x0;return _0x2885c4[_0x232a1f(0x12c)]((_0x28e837,_0xc4195d)=>{const _0x299ae3=_0x5aac1e[_0xc4195d]['count'];_0x28e837?_0x103d71+=_0x299ae3:_0xb02399+=_0x299ae3;}),{'success':_0x103d71,'failure':_0xb02399};}_0x381f37(_0x2ad458,_0x4bfa45(0xcb));const _0x2e0704=class _0x5edf38 extends _0x56e128[_0x4bfa45(0x117)]{constructor(_0x2840c3,_0x3dc134){const _0x1ce9d0=_0x4bfa45;super(_0x2840c3,_0x3dc134),_0x2bae30(this,'_activated',!0x1),_0x2bae30(this,_0x1ce9d0(0x13b),!0x1),_0x2bae30(this,'_color'),_0x3dc134&&this[_0x1ce9d0(0x103)](_0x3dc134);}['setShapeProps'](_0x2beb21){const _0x366c5c=_0x4bfa45;this[_0x366c5c(0xd1)]=!!_0x2beb21[_0x366c5c(0xf2)],typeof _0x2beb21[_0x366c5c(0x132)]<'u'&&(this[_0x366c5c(0x13b)]=_0x2beb21[_0x366c5c(0x132)]),typeof _0x2beb21[_0x366c5c(0x124)]<'u'&&(this[_0x366c5c(0x119)]=_0x2beb21[_0x366c5c(0x124)]),this['transformByState']({'width':_0x2beb21['width'],'height':_0x2beb21[_0x366c5c(0x152)]});}['_draw'](_0x2c87a7){const _0x1eaf6b=_0x4bfa45,_0x3a13c0=this[_0x1eaf6b(0xd1)],_0x260ccb=_0x1eaf6b(0xc6)+this['_color']['r']+',\x20'+this[_0x1eaf6b(0x119)]['g']+',\x20'+this[_0x1eaf6b(0x119)]['b']+_0x1eaf6b(0x134),_0x27b8f3=_0x1eaf6b(0xd0)+this[_0x1eaf6b(0x119)]['r']+',\x20'+this[_0x1eaf6b(0x119)]['g']+',\x20'+this[_0x1eaf6b(0x119)]['b']+')';_0x56e128[_0x1eaf6b(0x198)][_0x1eaf6b(0x162)](_0x2c87a7,{'width':this[_0x1eaf6b(0xa7)],'height':this[_0x1eaf6b(0x152)],'fill':_0x260ccb,'stroke':_0x3a13c0?_0x27b8f3:void 0x0,'strokeWidth':_0x3a13c0?0x2:0x0,'evented':!0x1});}};_0x381f37(_0x2e0704,'SheetFindReplaceHighlightShape');let _0x47a2e3=_0x2e0704;function _0x3ead66(_0x1ba0a3,_0x1113bc){const _0x490c4a=_0x4bfa45;return _0x1ba0a3[_0x490c4a(0xe5)]===_0x1113bc['startRow']&&_0x1ba0a3[_0x490c4a(0x109)]===_0x1113bc[_0x490c4a(0x109)];}_0x381f37(_0x3ead66,'isSamePosition');function _0x5a6d27(_0x5f2e71,_0x4f99b2){const _0x56709b=_0x4bfa45;return _0x5f2e71[_0x56709b(0xe5)]<_0x4f99b2[_0x56709b(0xe5)]||_0x5f2e71[_0x56709b(0xe5)]===_0x4f99b2[_0x56709b(0xe5)]&&_0x5f2e71[_0x56709b(0x109)]<=_0x4f99b2[_0x56709b(0x109)];}_0x381f37(_0x5a6d27,_0x4bfa45(0x189));function _0xa40bf6(_0x1bf4cd,_0x4e7df5){const _0x16a8a4=_0x4bfa45;return _0x1bf4cd[_0x16a8a4(0x109)]<_0x4e7df5['startColumn']||_0x1bf4cd[_0x16a8a4(0x109)]===_0x4e7df5[_0x16a8a4(0x109)]&&_0x1bf4cd['startRow']<=_0x4e7df5[_0x16a8a4(0xe5)];}_0x381f37(_0xa40bf6,_0x4bfa45(0xb7));function _0x2be13e(_0x3563a5,_0x3860ee){const _0x24bd35=_0x4bfa45;return _0x3563a5[_0x24bd35(0xe5)]>_0x3860ee[_0x24bd35(0xe5)]||_0x3563a5['startRow']===_0x3860ee[_0x24bd35(0xe5)]&&_0x3563a5[_0x24bd35(0x109)]>=_0x3860ee[_0x24bd35(0x109)];}_0x381f37(_0x2be13e,_0x4bfa45(0x178));function _0x2857d4(_0x408415,_0x32b3b4){const _0x51690c=_0x4bfa45;return _0x408415[_0x51690c(0x109)]>_0x32b3b4[_0x51690c(0x109)]||_0x408415['startColumn']===_0x32b3b4[_0x51690c(0x109)]&&_0x408415[_0x51690c(0xe5)]>=_0x32b3b4[_0x51690c(0xe5)];}_0x381f37(_0x2857d4,_0x4bfa45(0x18c));function _0xc69e80(_0x424b2f,_0x297a88){const _0x3bf807=_0x4bfa45,{range:_0x3ff1c3}=_0x424b2f,{startRow:_0x1bd106,startColumn:_0x47e3fd}=_0x3ff1c3,_0xacad00=_0x297a88[_0x3bf807(0x114)](_0x1bd106,_0x47e3fd);return _0xacad00?_0x563350[_0x3bf807(0x100)]['equals'](_0x3ff1c3,_0xacad00):_0x3ff1c3[_0x3bf807(0xb4)]===_0x3ff1c3[_0x3bf807(0xe5)]&&_0x3ff1c3['endColumn']===_0x3ff1c3[_0x3bf807(0x109)];}_0x381f37(_0xc69e80,_0x4bfa45(0x12d));var _0x48bc23=Object[_0x4bfa45(0xd3)],_0x8d64a=Object[_0x4bfa45(0xd5)],_0x31cb24=_0x381f37((_0x3eb712,_0x59c4ff,_0x28c66c,_0x14664f)=>{const _0x95f04f=_0x4bfa45;for(var _0xb8deb=_0x14664f>0x1?void 0x0:_0x14664f?_0x8d64a(_0x59c4ff,_0x28c66c):_0x59c4ff,_0x331f45=_0x3eb712[_0x95f04f(0xcd)]-0x1,_0x50cf87;_0x331f45>=0x0;_0x331f45--)(_0x50cf87=_0x3eb712[_0x331f45])&&(_0xb8deb=(_0x14664f?_0x50cf87(_0x59c4ff,_0x28c66c,_0xb8deb):_0x50cf87(_0xb8deb))||_0xb8deb);return _0x14664f&&_0xb8deb&&_0x48bc23(_0x59c4ff,_0x28c66c,_0xb8deb),_0xb8deb;},'__decorateClass$1'),_0x50286b=_0x381f37((_0x38b693,_0x382a3d)=>(_0x12814e,_0x40ce6f)=>_0x382a3d(_0x12814e,_0x40ce6f,_0x38b693),'__decorateParam$1');_0x5e342f[_0x4bfa45(0x156)]=(_0x219977=class extends _0x563350[_0x4bfa45(0x105)]{constructor(_0x15d884,_0x47e45c,_0x107fe1,_0x292675,_0x230e67){const _0x20fb3e=_0x4bfa45;super(),_0x2bae30(this,_0x20fb3e(0xa6)),(this[_0x20fb3e(0x16e)]=_0x15d884,this[_0x20fb3e(0xed)]=_0x47e45c,this[_0x20fb3e(0x194)]=_0x107fe1,this['_findReplaceService']=_0x292675,this['_commandService']=_0x230e67,this[_0x20fb3e(0x16f)](),this['_initCommands']());}[_0x4bfa45(0xde)](){const _0x1236e7=_0x4bfa45;super['dispose'](),this[_0x1236e7(0xed)][_0x1236e7(0xe6)](),this[_0x1236e7(0xa6)][_0x1236e7(0xde)]();}['_init'](){const _0x497ce3=_0x4bfa45,_0x1b07da=this[_0x497ce3(0x16e)][_0x497ce3(0x14d)](_0x400897);this[_0x497ce3(0xa6)]=_0x1b07da,this[_0x497ce3(0x106)](this[_0x497ce3(0x158)][_0x497ce3(0xe7)](_0x1b07da)),this[_0x497ce3(0x106)](this[_0x497ce3(0x194)][_0x497ce3(0x13a)](_0x563350[_0x497ce3(0x142)])[_0x497ce3(0xaf)](_0x5ee1ca[_0x497ce3(0x10b)](_0x1d0144=>!!_0x1d0144))[_0x497ce3(0xfc)](()=>this[_0x497ce3(0xed)][_0x497ce3(0xe6)]()));}[_0x4bfa45(0x13c)](){const _0x2cbcd4=_0x4bfa45;[_0x108cfb][_0x2cbcd4(0x12c)](_0x5e872d=>this[_0x2cbcd4(0x106)](this['_commandService'][_0x2cbcd4(0x122)](_0x5e872d)));}},_0x381f37(_0x219977,'SheetsFindReplaceController'),_0x219977),_0x5e342f[_0x4bfa45(0x156)]=_0x31cb24([_0x50286b(0x0,_0x563350[_0x4bfa45(0xb5)](_0x563350[_0x4bfa45(0x167)])),_0x50286b(0x1,_0x563350[_0x4bfa45(0xb5)](_0x31524d['FindReplaceController'])),_0x50286b(0x2,_0x563350[_0x4bfa45(0x146)]),_0x50286b(0x3,_0x31524d[_0x4bfa45(0xc0)]),_0x50286b(0x4,_0x563350[_0x4bfa45(0x188)])],_0x5e342f['SheetsFindReplaceController']);const _0x225810=_0x4bfa45(0xff),_0x5d2dce=0x2710;let _0x1f0fab=(_0x48d806=class extends _0x31524d[_0x4bfa45(0x184)]{constructor(_0x15051f,_0x14d77a,_0x45d3ea,_0x1458d1,_0x2c689e,_0x1ba5b1,_0x4a9890,_0x390017){const _0x144dbd=_0x4bfa45;super(),_0x2bae30(this,'_matchesUpdate$',new _0x5ee1ca[(_0x144dbd(0x95))]()),_0x2bae30(this,_0x144dbd(0x169),this[_0x144dbd(0xb3)][_0x144dbd(0x144)]()),_0x2bae30(this,_0x144dbd(0x108),new _0x5ee1ca[(_0x144dbd(0x95))]()),_0x2bae30(this,_0x144dbd(0x110),this[_0x144dbd(0x108)][_0x144dbd(0x144)]()),_0x2bae30(this,_0x144dbd(0xe8),new Map()),_0x2bae30(this,_0x144dbd(0xba),[]),_0x2bae30(this,_0x144dbd(0x107),0x0),_0x2bae30(this,_0x144dbd(0xdb),-0x1),_0x2bae30(this,'_highlightShapes',[]),_0x2bae30(this,_0x144dbd(0xd7),null),_0x2bae30(this,'_query',null),_0x2bae30(this,'_workbookSelections'),(this[_0x144dbd(0xcf)]=_0x15051f,this['_sheetSkeletonManagerService']=_0x14d77a,this[_0x144dbd(0xea)]=_0x45d3ea,this[_0x144dbd(0x125)]=_0x1458d1,this[_0x144dbd(0xb0)]=_0x2c689e,this['_contextService']=_0x1ba5b1,this['_themeService']=_0x4a9890,this[_0x144dbd(0xf4)]=_0x390017[_0x144dbd(0x14e)](this[_0x144dbd(0x192)]));}get[_0x4bfa45(0x133)](){const _0x4592e9=_0x4bfa45;return this[_0x4592e9(0xba)][_0x4592e9(0xcd)];}get['unitId'](){const _0x17a3f3=_0x4bfa45;return this['_workbook'][_0x17a3f3(0x13d)]();}get[_0x4bfa45(0xef)](){const _0xe0836a=_0x4bfa45;return this[_0xe0836a(0x133)];}get[_0x4bfa45(0xd9)](){const _0x347dbf=_0x4bfa45;return this[_0x347dbf(0x107)];}get[_0x4bfa45(0x97)](){const _0x2e208b=_0x4bfa45;return this[_0x2e208b(0x107)]>0x0?this[_0x2e208b(0xba)][this[_0x2e208b(0x107)]-0x1]:null;}['dispose'](){const _0x1a8581=_0x4bfa45;super[_0x1a8581(0xde)](),this[_0x1a8581(0x12a)](),this['_toggleDisplayRawFormula'](!0x1);}[_0x4bfa45(0xbc)](){const _0x9930a9=_0x4bfa45;return this[_0x9930a9(0xba)];}[_0x4bfa45(0xb9)](_0x143fed){const _0x99f631=_0x4bfa45;switch(this[_0x99f631(0xfe)]=_0x143fed,_0x143fed[_0x99f631(0xca)]===_0x31524d[_0x99f631(0x9c)][_0x99f631(0x17b)]?this[_0x99f631(0xc2)](!0x0):this[_0x99f631(0xc2)](!0x1),_0x143fed[_0x99f631(0x112)]){case _0x31524d[_0x99f631(0x11c)][_0x99f631(0xb2)]:this[_0x99f631(0x116)](_0x143fed);break;case _0x31524d[_0x99f631(0x11c)][_0x99f631(0x190)]:default:this[_0x99f631(0xad)](_0x143fed);break;}}['_toggleDisplayRawFormula'](_0x33c89f){const _0x48387c=_0x4bfa45;this[_0x48387c(0x194)][_0x48387c(0x182)](_0x56e128[_0x48387c(0x17e)],_0x33c89f);}[_0x4bfa45(0x116)](_0x895c60){const _0x47e339=_0x4bfa45,_0x5315eb=this[_0x47e339(0xcf)][_0x47e339(0x13d)]();let _0x11037d,_0x36e8b0=!0x0;const _0x74927c=_0x381f37(()=>{const _0x24298e=_0x47e339,_0x1fbf87=this[_0x24298e(0xcf)][_0x24298e(0x180)]()['filter'](_0x22024b=>!_0x22024b[_0x24298e(0xa2)]())['map'](_0x21c356=>{const _0x176c78=_0x24298e,_0x15c204=this['_findInWorksheet'](_0x21c356,_0x895c60,_0x5315eb),_0x72ff36=_0x21c356[_0x176c78(0x195)](),{results:_0x19330f}=_0x15c204;return _0x19330f[_0x176c78(0xcd)]?this[_0x176c78(0xe8)]['set'](_0x72ff36,_0x15c204['results']):this['_matchesByWorksheet']['delete'](_0x72ff36),_0x15c204;});this['_matches']=_0x1fbf87['map'](_0x302397=>_0x302397[_0x24298e(0x14a)])[_0x24298e(0x12f)](),this[_0x24298e(0x9d)](),_0x36e8b0?(_0x11037d={'results':this[_0x24298e(0xba)]},_0x36e8b0=!0x1):this[_0x24298e(0xb3)]['next'](this['_matches']);},'findInWorkbook');return this[_0x47e339(0x106)](this[_0x47e339(0x17f)][_0x47e339(0xbb)][_0x47e339(0xfc)](()=>{const _0x4732b2=_0x47e339;this['_updateFindHighlight'](),this[_0x4732b2(0x16d)](this[_0x4732b2(0xdb)]);})),this[_0x47e339(0x106)](_0x563350['fromCallback'](this[_0x47e339(0xb0)][_0x47e339(0x9f)]['bind'](this[_0x47e339(0xb0)]))[_0x47e339(0xaf)](_0x5ee1ca[_0x47e339(0x10b)](([_0x3ca5ef,_0xfab74c])=>_0x3ca5ef['id']===_0x863b34[_0x47e339(0x155)]['id']&&!(_0xfab74c!=null&&_0xfab74c[_0x47e339(0xa1)])))[_0x47e339(0xfc)](()=>{const _0x3c3b80=_0x47e339,_0x4ae705=this[_0x3c3b80(0xcf)]['getActiveSheet']();if(!_0x4ae705)return;const _0x5d173e=_0x4ae705['getSheetId']();this[_0x3c3b80(0xe8)]['has'](_0x5d173e)&&this[_0x3c3b80(0x11d)](_0x4ae705);})),this[_0x47e339(0x106)](_0x563350[_0x47e339(0x177)](this[_0x47e339(0xb0)][_0x47e339(0x9f)]['bind'](this['_commandService']))[_0x47e339(0xaf)](_0x5ee1ca[_0x47e339(0x10b)](([_0x1da297])=>_0x1da297['type']===_0x563350[_0x47e339(0x126)][_0x47e339(0x16c)]&&_0x1da297['params'][_0x47e339(0x192)]===this[_0x47e339(0xcf)]['getUnitId']()),_0x5ee1ca[_0x47e339(0xf3)](0x258,void 0x0,{'leading':!0x1,'trailing':!0x0}))[_0x47e339(0xfc)](()=>_0x74927c())),_0x74927c(),_0x11037d;}[_0x4bfa45(0x11d)](_0x343597){const _0x280369=_0x4bfa45;let _0x1fb9ed,_0x217c77,_0x3f1b2c=0x0;const _0x3b6cc7=this[_0x280369(0xe8)]['get'](_0x343597[_0x280369(0x195)]()),_0x25c0ff=this[_0x280369(0xf4)]['getCurrentSelections']();_0x25c0ff!=null&&_0x25c0ff[_0x280369(0xcd)]?([_0x1fb9ed,_0x3f1b2c]=this[_0x280369(0x193)](_0x3b6cc7,_0x25c0ff[0x0][_0x280369(0xa0)]),_0x217c77=_0x3b6cc7[_0x280369(0x151)](_0x5e0b6b=>_0x5e0b6b===_0x1fb9ed)):(_0x1fb9ed=_0x3b6cc7[0x0],_0x217c77=0x0,_0x3f1b2c=this['_matches']['findIndex'](_0x5bd01a=>_0x5bd01a===_0x1fb9ed)),this[_0x280369(0x107)]=_0x3f1b2c+0x1,this[_0x280369(0x108)]['next'](_0x1fb9ed),this[_0x280369(0xdb)]=_0x217c77,this[_0x280369(0x9d)](),this[_0x280369(0x16d)](_0x217c77);}['findInActiveWorksheet'](_0xa66e56){const _0x25c3a1=_0x4bfa45,_0x3838f2=this[_0x25c3a1(0xcf)][_0x25c3a1(0x13d)](),_0x477903=_0x381f37(()=>{const _0x52d2bc=_0x25c3a1;var _0x27fcb1;const _0x2e6cbf=this['_workbook']['getActiveSheet']();if(!_0x2e6cbf)return!0x1;const _0x4274b5=this[_0x52d2bc(0xf4)][_0x52d2bc(0xe3)]();return(_0x27fcb1=_0x4274b5==null?void 0x0:_0x4274b5[_0x52d2bc(0x102)](_0x2a82d7=>!_0xc69e80(_0x2a82d7,_0x2e6cbf)))!=null?_0x27fcb1:!0x1;},_0x25c3a1(0x15b));let _0x59c876,_0x241458=!0x0,_0x20d84f=!0x1;const _0x1ee96a=_0x381f37(()=>{const _0x235698=_0x25c3a1,_0x901b38=this[_0x235698(0xcf)][_0x235698(0x12e)]();if(!_0x901b38)return{'results':[]};const _0x3e59cb=this['currentMatch'];_0x20d84f=_0x477903();const _0x1b3ec9=this[_0x235698(0xf4)][_0x235698(0xe3)](),_0x375aa0=_0x20d84f?this[_0x235698(0x138)](_0x901b38,_0x1b3ec9,_0xa66e56,_0x3838f2):this[_0x235698(0xbd)](_0x901b38,_0xa66e56,_0x3838f2);return this['_matches']=_0x375aa0['results'],this[_0x235698(0x107)]=this['_tryRestoreLastMatchesPosition'](_0x3e59cb,this[_0x235698(0xba)]),_0x241458?(_0x59c876=_0x375aa0,_0x241458=!0x1):this[_0x235698(0xb3)][_0x235698(0x140)](this[_0x235698(0xba)]),this[_0x235698(0x9d)](),_0x375aa0;},_0x25c3a1(0x120));return this[_0x25c3a1(0x106)](this[_0x25c3a1(0x17f)][_0x25c3a1(0xbb)][_0x25c3a1(0xfc)](()=>this['_updateFindHighlight']())),this[_0x25c3a1(0x106)](_0x5ee1ca[_0x25c3a1(0x9e)](_0x563350[_0x25c3a1(0x177)](this[_0x25c3a1(0xb0)][_0x25c3a1(0x9f)][_0x25c3a1(0xf7)](this[_0x25c3a1(0xb0)]))[_0x25c3a1(0xaf)](_0x5ee1ca[_0x25c3a1(0x10b)](([_0x386ef9])=>{const _0x419b5a=_0x25c3a1;if(_0x386ef9[_0x419b5a(0xc8)]===_0x563350[_0x419b5a(0x126)][_0x419b5a(0x16c)]&&_0x386ef9[_0x419b5a(0x99)][_0x419b5a(0x192)]===this[_0x419b5a(0xcf)]['getUnitId']())return!0x0;if(_0x386ef9['id']===_0x863b34['SetSelectionsOperation']['id']&&_0x386ef9[_0x419b5a(0x99)][_0x419b5a(0x192)]===_0x3838f2){const _0x4b307f=_0x477903();return _0x4b307f===!0x1&&_0x20d84f===!0x1?!0x1:(_0x20d84f=_0x4b307f,!0x0);}return!0x1;})),this[_0x25c3a1(0xcf)]['activeSheet$'][_0x25c3a1(0xaf)](_0x5ee1ca[_0x25c3a1(0xc7)](0x1)))['pipe'](_0x5ee1ca[_0x25c3a1(0xd2)](0xc8))[_0x25c3a1(0xfc)](()=>_0x1ee96a())),_0x1ee96a(),_0x59c876;}['_findInRange'](_0x4d5ef0,_0x19fc5d,_0x211051,_0x550ece,_0x442f51){const _0x335e9b=_0x4bfa45,_0x1edfdf=[],_0xe7a2d1=_0x4d5ef0[_0x335e9b(0x195)](),_0x148b48=(_0x19fc5d[_0x335e9b(0x11f)]===_0x31524d[_0x335e9b(0x131)][_0x335e9b(0x135)]?_0x4d5ef0[_0x335e9b(0x127)]:_0x4d5ef0[_0x335e9b(0x183)])[_0x335e9b(0xf7)](_0x4d5ef0)(_0x211051);for(const _0x400735 of _0x148b48){const {row:_0x28bae9,col:_0x149221,colSpan:_0x510f79,rowSpan:_0x4000c5,value:_0x5055fa}=_0x400735;if(_0x442f51!=null&&_0x442f51(_0x28bae9,_0x149221)||!_0x5055fa||_0x4d5ef0['getRowFiltered'](_0x28bae9))continue;const {hit:_0x4e7d15,replaceable:_0x2853aa,isFormula:_0x5f4f22}=_0x577464(_0x4d5ef0,_0x28bae9,_0x149221,_0x19fc5d,_0x5055fa);if(_0x4e7d15){const _0x27ed38={'provider':_0x225810,'unitId':_0x550ece,'replaceable':_0x2853aa,'isFormula':_0x5f4f22,'range':{'subUnitId':_0xe7a2d1,'range':{'startRow':_0x28bae9,'startColumn':_0x149221,'endColumn':_0x149221+(_0x510f79!=null?_0x510f79:0x1)-0x1,'endRow':_0x28bae9+(_0x4000c5!=null?_0x4000c5:0x1)-0x1}}};_0x1edfdf[_0x335e9b(0x15a)](_0x27ed38);}}return{'results':_0x1edfdf};}[_0x4bfa45(0x138)](_0x3e1271,_0x150985,_0x24ae65,_0x4bd8f9){const _0x38c4b9=_0x4bfa45,{findDirection:_0x5e786e}=_0x24ae65,_0x382bd6=_0x5e786e===_0x31524d[_0x38c4b9(0x131)][_0x38c4b9(0x199)]?_0x5a6d27:_0xa40bf6,_0x742698=new Set();return{'results':_0x150985[_0x38c4b9(0x18b)](_0x2107bf=>this[_0x38c4b9(0x11b)](_0x3e1271,_0x24ae65,_0x2107bf[_0x38c4b9(0xa0)],_0x4bd8f9,(_0x2b6481,_0x1b8eaa)=>{const _0x52484e=_0x38c4b9,_0xdff4f=_0x2b6481+'-'+_0x1b8eaa;return _0x742698[_0x52484e(0xae)](_0xdff4f)?!0x0:(_0x742698[_0x52484e(0x164)](_0xdff4f),!0x1);})['results'])[_0x38c4b9(0x12f)]()[_0x38c4b9(0x13f)]((_0x354656,_0xf79ae)=>_0x382bd6(_0x354656[_0x38c4b9(0xa0)][_0x38c4b9(0xa0)],_0xf79ae[_0x38c4b9(0xa0)]['range'])?-0x1:0x1)};}[_0x4bfa45(0xbd)](_0x514303,_0x3a31a2,_0x41c3cf){const _0x2c9e41=_0x4bfa45,_0x2b395c=_0x514303[_0x2c9e41(0xe0)](),_0x1919a0=_0x514303['getColumnCount'](),_0x11c24f={'startRow':0x0,'startColumn':0x0,'endRow':_0x2b395c-0x1,'endColumn':_0x1919a0-0x1};return this['_findInRange'](_0x514303,_0x3a31a2,_0x11c24f,_0x41c3cf);}[_0x4bfa45(0x12a)](){const _0x72f18f=_0x4bfa45;var _0x4addb7;this[_0x72f18f(0xe4)][_0x72f18f(0x12c)](_0xa77155=>{const _0x241e87=_0x72f18f;var _0x4976cd;(_0x4976cd=_0xa77155[_0x241e87(0x160)]())==null||_0x4976cd['makeDirty'](),_0xa77155['dispose']();}),this['_highlightShapes']=[],(_0x4addb7=this['_currentHighlightShape'])==null||_0x4addb7[_0x72f18f(0xde)](),this['_currentHighlightShape']=null;}[_0x4bfa45(0x9d)](){const _0x5eeeb6=_0x4bfa45;var _0x9c1815;this[_0x5eeeb6(0x12a)]();const _0x215dc5=(_0x9c1815=this['_sheetSkeletonManagerService'][_0x5eeeb6(0x14b)]())==null?void 0x0:_0x9c1815[_0x5eeeb6(0x197)];if(!_0x215dc5)return;const _0x326f34=this[_0x5eeeb6(0xcf)][_0x5eeeb6(0x13d)](),_0x3aca61=this[_0x5eeeb6(0x125)][_0x5eeeb6(0xa3)](_0x326f34);if(_0x3aca61==null)return;const {scene:_0x4bf7cc}=_0x3aca61,_0xf0bd9e=this[_0x5eeeb6(0xba)],_0x48b1d6=this[_0x5eeeb6(0x147)][_0x5eeeb6(0xa9)]()['gold400'],_0x1e1e68=new _0x563350[(_0x5eeeb6(0xe1))](_0x48b1d6)[_0x5eeeb6(0x9a)](),_0x342630=this[_0x5eeeb6(0xcf)]['getActiveSheet']();if(!_0x342630)return;const _0x142c2a=_0x342630[_0x5eeeb6(0x195)](),_0x1ac747=_0xf0bd9e[_0x5eeeb6(0x10b)](_0xe73d92=>_0xe73d92[_0x5eeeb6(0xa0)][_0x5eeeb6(0x18e)]===_0x142c2a)[_0x5eeeb6(0x18b)]((_0x2efc2b,_0x3da5e8)=>{const _0x49be12=_0x5eeeb6,{startColumn:_0x26123e,startRow:_0x3d12b4,endColumn:_0x970c8c,endRow:_0x215045}=_0x2efc2b[_0x49be12(0xa0)][_0x49be12(0xa0)],_0x565fa2=_0x2fd13f[_0x49be12(0x101)](_0x3d12b4,_0x26123e,_0x4bf7cc,_0x215dc5),_0x3b0dfb=_0x2fd13f[_0x49be12(0x101)](_0x215045,_0x970c8c,_0x4bf7cc,_0x215dc5),{startX:_0x1bff32,startY:_0x698dc5}=_0x565fa2,{endX:_0x4d877b,endY:_0x1cf38e}=_0x3b0dfb,_0x1b6ecb=!_0x342630['getRowRawVisible'](_0x3d12b4),_0x3d20bf=!_0x342630['getColVisible'](_0x26123e),_0x66b832=_0x1b6ecb||_0x3d20bf,_0x340c54=_0x3d20bf?0x2:_0x4d877b-_0x1bff32,_0x4ba81c=_0x1b6ecb?0x2:_0x1cf38e-_0x698dc5,_0x2a964e={'left':_0x1bff32,'top':_0x698dc5,'color':_0x1e1e68,'width':_0x340c54,'height':_0x4ba81c,'evented':!0x1,'inHiddenRange':_0x66b832,'zIndex':_0x5d2dce};return new _0x47a2e3(_0x49be12(0xf9)+_0x3da5e8,_0x2a964e);});_0x4bf7cc[_0x5eeeb6(0x166)](_0x1ac747),this[_0x5eeeb6(0xe4)]=_0x1ac747,_0x4bf7cc[_0x5eeeb6(0xda)]();}[_0x4bfa45(0x16d)](_0x15aaf5){const _0xcee64f=_0x4bfa45;var _0x5f45a7;if((_0x5f45a7=this[_0xcee64f(0xd7)])==null||_0x5f45a7[_0xcee64f(0x103)]({'activated':!0x1}),this[_0xcee64f(0xd7)]=null,_0x15aaf5!==void 0x0){const _0x19a5c4=this[_0xcee64f(0xe4)][_0x15aaf5];if(!_0x19a5c4)return;this[_0xcee64f(0xd7)]=_0x19a5c4,_0x19a5c4['setShapeProps']({'activated':!0x0});}}['_getSheetObject'](){const _0x308c40=_0x4bfa45;return _0x2fd13f[_0x308c40(0xec)](this['_univerInstanceService'],this[_0x308c40(0x125)]);}['_focusMatch'](_0x3e9fa7){const _0x56858e=_0x4bfa45;var _0x222c23;const _0x1af50c=_0x3e9fa7[_0x56858e(0xa0)][_0x56858e(0x18e)];_0x1af50c!==((_0x222c23=this['_workbook'][_0x56858e(0x12e)]())==null?void 0x0:_0x222c23['getSheetId']())&&this['_commandService'][_0x56858e(0x123)](_0x863b34['SetWorksheetActivateCommand']['id'],{'unitId':this[_0x56858e(0xcf)][_0x56858e(0x13d)](),'subUnitId':_0x1af50c},{'fromFindReplace':!0x0}),this[_0x56858e(0xb0)][_0x56858e(0x123)](_0x2fd13f[_0x56858e(0x9b)]['id'],{'range':_0x3e9fa7['range']['range']},{'fromFindReplace':!0x0});}[_0x4bfa45(0x191)](_0x25460d,_0x540bfa){const _0x280890=_0x4bfa45;if(!_0x25460d)return 0x0;const {subUnitId:_0x5a4e77}=_0x25460d[_0x280890(0xa0)],{startColumn:_0x84b61b,startRow:_0x17b7cc}=_0x25460d[_0x280890(0xa0)]['range'],_0x2af59e=_0x540bfa[_0x280890(0x151)](_0x57a324=>{const _0x207a66=_0x280890;if(_0x5a4e77!==_0x57a324[_0x207a66(0xa0)]['subUnitId'])return!0x1;const {startColumn:_0x182732,startRow:_0x4a0479}=_0x57a324['range'][_0x207a66(0xa0)];return _0x182732===_0x84b61b&&_0x4a0479===_0x17b7cc;});return _0x2af59e>-0x1?_0x2af59e+0x1:0x0;}[_0x4bfa45(0x111)](_0x65a15f){const _0x5a0827=_0x4bfa45;var _0x4b5568,_0x1edb69,_0x57c215,_0x5a6e06,_0x22bdaf;if(!this[_0x5a0827(0xba)]['length'])return null;const _0x14bd22=(_0x4b5568=_0x65a15f==null?void 0x0:_0x65a15f[_0x5a0827(0x96)])!=null?_0x4b5568:!0x1,_0x11dc5f=(_0x1edb69=_0x65a15f==null?void 0x0:_0x65a15f[_0x5a0827(0xb8)])!=null?_0x1edb69:!0x1,_0x560d59=(_0x57c215=_0x65a15f==null?void 0x0:_0x65a15f[_0x5a0827(0xf5)])!=null?_0x57c215:!0x1,_0x439a19=(_0x5a6e06=_0x65a15f==null?void 0x0:_0x65a15f[_0x5a0827(0x17c)])!=null?_0x5a6e06:!0x1,_0x33a862=this[_0x5a0827(0x10c)](_0x14bd22,_0x11dc5f,_0x439a19);if(_0x33a862){const [_0x48ba02,_0x412c1c]=_0x33a862;return this['_matchesPosition']=_0x412c1c+0x1,this[_0x5a0827(0xfe)]['findScope']===_0x31524d[_0x5a0827(0x11c)][_0x5a0827(0xb2)]?this[_0x5a0827(0xdb)]=this[_0x5a0827(0xe8)][_0x5a0827(0x10a)](_0x48ba02[_0x5a0827(0xa0)][_0x5a0827(0x18e)])[_0x5a0827(0x151)](_0x1f4734=>_0x1f4734===_0x48ba02):this['_activeHighlightIndex']=_0x412c1c,_0x560d59||this['_focusMatch'](_0x48ba02),((_0x22bdaf=this[_0x5a0827(0xcf)][_0x5a0827(0x12e)]())==null?void 0x0:_0x22bdaf[_0x5a0827(0x195)]())===_0x48ba02[_0x5a0827(0xa0)][_0x5a0827(0x18e)]&&this[_0x5a0827(0x16d)](this[_0x5a0827(0xdb)]),_0x48ba02;}return this[_0x5a0827(0x107)]=0x0,this[_0x5a0827(0x16d)](),null;}['moveToPreviousMatch'](_0x5a0662){const _0x41206c=_0x4bfa45;var _0x17a8e4,_0x3b4023,_0x407717,_0x374be0,_0x1484fe;if(!this[_0x41206c(0xba)][_0x41206c(0xcd)])return null;const _0x125fdc=(_0x17a8e4=_0x5a0662==null?void 0x0:_0x5a0662[_0x41206c(0x96)])!=null?_0x17a8e4:!0x1,_0x11b3e7=(_0x3b4023=_0x5a0662==null?void 0x0:_0x5a0662[_0x41206c(0xb8)])!=null?_0x3b4023:!0x1,_0x11b0e7=(_0x407717=_0x5a0662==null?void 0x0:_0x5a0662[_0x41206c(0xf5)])!=null?_0x407717:!0x1,_0x16aef9=(_0x374be0=_0x5a0662==null?void 0x0:_0x5a0662[_0x41206c(0x17c)])!=null?_0x374be0:!0x1,_0x80bc88=this[_0x41206c(0x143)](_0x125fdc,_0x11b3e7,_0x16aef9);if(_0x80bc88){const [_0x384799,_0x328d0a]=_0x80bc88;return this[_0x41206c(0x107)]=_0x328d0a+0x1,this[_0x41206c(0xfe)][_0x41206c(0x112)]===_0x31524d['FindScope']['UNIT']?this[_0x41206c(0xdb)]=this[_0x41206c(0xe8)][_0x41206c(0x10a)](_0x384799[_0x41206c(0xa0)][_0x41206c(0x18e)])['findIndex'](_0x230e95=>_0x230e95===_0x384799):this[_0x41206c(0xdb)]=_0x328d0a,_0x11b0e7||this[_0x41206c(0xd6)](_0x384799),((_0x1484fe=this[_0x41206c(0xcf)][_0x41206c(0x12e)]())==null?void 0x0:_0x1484fe['getSheetId']())===_0x384799[_0x41206c(0xa0)][_0x41206c(0x18e)]&&this[_0x41206c(0x16d)](this['_activeHighlightIndex']),_0x384799;}return this[_0x41206c(0x107)]=0x0,this[_0x41206c(0x16d)](),null;}['_findPreviousMatch'](_0x18742b=!0x1,_0x25cb16=!0x1,_0x4fac8a=!0x1){const _0x29b7c4=_0x4bfa45;var _0x2df2f7;if(this[_0x29b7c4(0x97)]){const _0x5760c7=this['_matches'][_0x29b7c4(0x151)](_0x57ef67=>_0x57ef67===this[_0x29b7c4(0x97)]);if(_0x25cb16)return[this[_0x29b7c4(0x97)],_0x5760c7];const _0x55b30b=_0x5760c7-0x1;if(!_0x18742b&&_0x55b30b<0x0)return null;const _0x2222d4=this[_0x29b7c4(0xba)][_0x29b7c4(0xcd)],_0x2137d0=(_0x55b30b+_0x2222d4)%_0x2222d4;return[this[_0x29b7c4(0xba)][_0x2137d0],_0x2137d0];}const _0xcdc9f9=this[_0x29b7c4(0xf4)][_0x29b7c4(0x16b)]();if(_0x4fac8a||!_0xcdc9f9){const _0x4b027d=this[_0x29b7c4(0xba)]['length']-0x1;return[this[_0x29b7c4(0xba)][_0x4b027d],_0x4b027d];}if(this['_query']['findScope']!==_0x31524d[_0x29b7c4(0x11c)][_0x29b7c4(0xb2)])return this[_0x29b7c4(0x168)](this[_0x29b7c4(0xba)],_0xcdc9f9[_0x29b7c4(0xa0)]);const _0x64c3d5=(_0x2df2f7=this[_0x29b7c4(0xcf)][_0x29b7c4(0x12e)]())==null?void 0x0:_0x2df2f7[_0x29b7c4(0x195)]();if(!_0x64c3d5)return null;const _0x18b2fe=this['_findPreviousWorksheetThatHasAMatch'](_0x64c3d5,_0x18742b);return _0x18b2fe?this['_findPreviousMatchByRange'](this[_0x29b7c4(0xe8)][_0x29b7c4(0x10a)](_0x18b2fe),_0xcdc9f9[_0x29b7c4(0xa0)]):null;}[_0x4bfa45(0x10c)](_0x19ddee=!0x1,_0x3856ed=!0x1,_0xf516b4=!0x1){const _0x1565cb=_0x4bfa45;var _0x31f1a6;if(this[_0x1565cb(0x97)]){const _0x18edc0=this[_0x1565cb(0xba)][_0x1565cb(0x151)](_0x2cd225=>_0x2cd225===this['currentMatch']);if(_0x3856ed)return[this[_0x1565cb(0x97)],_0x18edc0];const _0x3cf35e=_0x18edc0+0x1,_0x3278a0=this[_0x1565cb(0xba)]['length'];if(!_0x19ddee&&_0x3cf35e>=_0x3278a0)return null;const _0x1a5044=_0x3cf35e%_0x3278a0;return[this[_0x1565cb(0xba)][_0x1a5044],_0x1a5044];}const _0x5f066e=this['_workbookSelections'][_0x1565cb(0x16b)]();if(_0xf516b4||!_0x5f066e)return[this['_matches'][0x0],0x0];if(this['_query'][_0x1565cb(0x112)]!==_0x31524d[_0x1565cb(0x11c)][_0x1565cb(0xb2)])return this[_0x1565cb(0x193)](this['_matches'],_0x5f066e[_0x1565cb(0xa0)],_0x3856ed);const _0x23a0f9=(_0x31f1a6=this['_workbook'][_0x1565cb(0x12e)]())==null?void 0x0:_0x31f1a6[_0x1565cb(0x195)]();if(!_0x23a0f9)return null;const _0x533069=this['_findNextWorksheetThatHasAMatch'](_0x23a0f9,_0x19ddee);return _0x533069?this[_0x1565cb(0x193)](this['_matchesByWorksheet'][_0x1565cb(0x10a)](_0x533069),_0x5f066e[_0x1565cb(0xa0)]):null;}[_0x4bfa45(0xfd)](_0x1b0acf,_0x1f650d=!0x1){const _0x19b052=_0x4bfa45,_0x2b2592=this[_0x19b052(0xcf)][_0x19b052(0x176)](),_0x61dc35=_0x2b2592[_0x19b052(0x151)](_0xc2a55d=>_0xc2a55d===_0x1b0acf),_0x313c0c=(_0x1f650d?_0x563350['rotate'](_0x2b2592,_0x61dc35+0x1):_0x2b2592[_0x19b052(0x161)](0x0,_0x61dc35+0x1))['findLast'](_0x505a26=>this['_matchesByWorksheet'][_0x19b052(0xae)](_0x505a26));return _0x313c0c!=null?_0x313c0c:null;}[_0x4bfa45(0xcc)](_0x4c0633,_0x3c8d53=!0x1){const _0x233f23=_0x4bfa45,_0x5bab83=this['_workbook'][_0x233f23(0x176)](),_0x37f62b=_0x5bab83[_0x233f23(0x151)](_0x18a4f7=>_0x18a4f7===_0x4c0633),_0x54c8c7=(_0x3c8d53?_0x563350[_0x233f23(0xa8)](_0x5bab83,_0x37f62b):_0x5bab83[_0x233f23(0x161)](_0x37f62b))[_0x233f23(0x128)](_0x43de8d=>this['_matchesByWorksheet'][_0x233f23(0xae)](_0x43de8d));return _0x54c8c7!=null?_0x54c8c7:null;}[_0x4bfa45(0x193)](_0x48aefe,_0x1d86a0,_0x40a326=!0x1){const _0x3de926=_0x4bfa45,_0x462f8e=this[_0x3de926(0xfe)][_0x3de926(0x11f)]===_0x31524d[_0x3de926(0x131)]['ROW'];let _0x174346=_0x48aefe[_0x3de926(0x151)](_0xb0964=>{const _0x2a4d75=_0x3de926,_0x394bd9=_0xb0964[_0x2a4d75(0xa0)][_0x2a4d75(0xa0)];if(!(_0x462f8e?_0x5a6d27(_0x1d86a0,_0x394bd9):_0xa40bf6(_0x1d86a0,_0x394bd9)))return!0x1;const _0x3dd6ce=_0x3ead66(_0x1d86a0,_0x394bd9);return _0x40a326?_0x3dd6ce:!_0x3dd6ce;});_0x174346===-0x1&&(_0x174346=_0x48aefe['length']-0x1);const _0x5c477e=_0x48aefe[_0x174346];return[_0x5c477e,this[_0x3de926(0xba)][_0x3de926(0x151)](_0x409715=>_0x409715===_0x5c477e)];}[_0x4bfa45(0x168)](_0x382a84,_0x3e3e18,_0x14fa9e=!0x1){const _0x516601=_0x4bfa45,_0x80d470=this[_0x516601(0xfe)][_0x516601(0x11f)]===_0x31524d[_0x516601(0x131)][_0x516601(0x199)];let _0x534124=this[_0x516601(0xba)][_0x516601(0x159)](_0x55ae4f=>{const _0x3f6f66=_0x516601,_0x1f84d5=_0x55ae4f[_0x3f6f66(0xa0)][_0x3f6f66(0xa0)];if(!(_0x80d470?_0x2be13e(_0x3e3e18,_0x1f84d5):_0x2857d4(_0x3e3e18,_0x1f84d5)))return!0x1;const _0x492b91=_0x3ead66(_0x3e3e18,_0x1f84d5);return _0x14fa9e?_0x492b91:!_0x492b91;});_0x534124===-0x1&&(_0x534124=0x0);const _0x30e174=_0x382a84[_0x534124];return[_0x30e174,this[_0x516601(0xba)][_0x516601(0x151)](_0xa76ae3=>_0xa76ae3===_0x30e174)];}async[_0x4bfa45(0x150)](_0x34d6a6){const _0x58368a=_0x4bfa45;if(this['_matchesCount']===0x0||!this[_0x58368a(0x97)]||!this[_0x58368a(0xfe)]||!this[_0x58368a(0x97)][_0x58368a(0xf6)])return!0x1;const _0x2ee219=this[_0x58368a(0x97)][_0x58368a(0xa0)],_0x321257=this['_workbook'][_0x58368a(0x94)](this[_0x58368a(0x97)][_0x58368a(0xa0)]['subUnitId']),_0x40c3b7=this['_getReplacedCellData'](this[_0x58368a(0x97)],_0x321257,this[_0x58368a(0xfe)][_0x58368a(0xca)]===_0x31524d['FindBy'][_0x58368a(0x17b)],this['_query']['findString'],_0x34d6a6,this[_0x58368a(0xfe)][_0x58368a(0x14c)]?'g':'ig'),_0x305b73={'unitId':this[_0x58368a(0x97)][_0x58368a(0x192)],'subUnitId':_0x2ee219['subUnitId'],'value':{[_0x2ee219[_0x58368a(0xa0)][_0x58368a(0xe5)]]:{[_0x2ee219[_0x58368a(0xa0)][_0x58368a(0x109)]]:_0x40c3b7}}};return this[_0x58368a(0xb0)][_0x58368a(0x123)](_0x863b34[_0x58368a(0xac)]['id'],_0x305b73);}async[_0x4bfa45(0x118)](_0x20dca3){const _0x52fa88=_0x4bfa45;if(this['_matchesCount']===0x0||!this['_query'])return{'success':0x0,'failure':0x0};const _0x19118e=this['_workbook']['getUnitId'](),{findString:_0x570d28,caseSensitive:_0x2dbd51,findBy:_0x929d84}=this[_0x52fa88(0xfe)],_0x353278=_0x929d84===_0x31524d[_0x52fa88(0x9c)]['FORMULA'],_0x3cecbe=_0x2dbd51?'g':'ig',_0x251e9c=[];return _0x563350['groupBy'](this[_0x52fa88(0xba)]['filter'](_0x57568a=>_0x57568a['replaceable']),_0x2cf5e6=>_0x2cf5e6[_0x52fa88(0xa0)][_0x52fa88(0x18e)])[_0x52fa88(0x12c)]((_0x18fb82,_0x1e1a74)=>{const _0x58eff1=_0x52fa88,_0x22209c=new _0x563350[(_0x58eff1(0x196))](),_0x27efd2=this[_0x58eff1(0xcf)]['getSheetBySheetId'](_0x1e1a74);_0x18fb82[_0x58eff1(0x12c)](_0x55f981=>{const _0x4aff1f=_0x58eff1,{startColumn:_0x36bdfb,startRow:_0x5404e0}=_0x55f981['range'][_0x4aff1f(0xa0)],_0x2371ef=this[_0x4aff1f(0x181)](_0x55f981,_0x27efd2,_0x353278,_0x570d28,_0x20dca3,_0x3cecbe);_0x2371ef&&_0x22209c[_0x4aff1f(0x141)](_0x5404e0,_0x36bdfb,_0x2371ef);}),_0x251e9c['push']({'count':_0x18fb82[_0x58eff1(0xcd)],'subUnitId':_0x1e1a74,'value':_0x22209c['getMatrix']()});}),_0x251e9c?this[_0x52fa88(0xb0)][_0x52fa88(0x123)](_0x108cfb['id'],{'unitId':_0x19118e,'replacements':_0x251e9c}):{'success':0x0,'failure':0x0};}[_0x4bfa45(0x181)](_0x468883,_0xfe3ab6,_0x1193cb,_0x14ab1c,_0x32b555,_0x52f9be){const _0xd6731f=_0x4bfa45;var _0x53e074;const _0x3e1b30=_0x468883[_0xd6731f(0xa0)]['range'],{startRow:_0x2173c0,startColumn:_0x4feca4}=_0x3e1b30,_0x104bf4=_0xfe3ab6[_0xd6731f(0xc5)](_0x2173c0,_0x4feca4);if(_0x468883[_0xd6731f(0xdc)])return _0x1193cb?{'f':_0x104bf4['f'][_0xd6731f(0x150)](new RegExp(_0x851425(_0x14ab1c),_0x52f9be),_0x32b555),'v':null}:null;if(!!((_0x53e074=_0x104bf4['p'])!=null&&_0x53e074[_0xd6731f(0x12b)])){const _0x23279f=_0x563350['Tools']['deepClone'](_0x104bf4['p']);return _0x563350['replaceInDocumentBody'](_0x23279f[_0xd6731f(0x12b)],_0x14ab1c,_0x32b555),{'p':_0x23279f};}return{'v':_0x104bf4['v']['toString']()['replace'](new RegExp(_0x851425(_0x14ab1c),_0x52f9be),_0x32b555)};}},_0x381f37(_0x48d806,_0x4bfa45(0x153)),_0x48d806);_0x1f0fab=_0x31cb24([_0x50286b(0x2,_0x563350[_0x4bfa45(0x185)]),_0x50286b(0x3,_0x56e128['IRenderManagerService']),_0x50286b(0x4,_0x563350['ICommandService']),_0x50286b(0x5,_0x563350[_0x4bfa45(0x146)]),_0x50286b(0x6,_0x563350[_0x4bfa45(0xb5)](_0x563350[_0x4bfa45(0x15c)])),_0x50286b(0x7,_0x563350['Inject'](_0x863b34['SheetsSelectionsService']))],_0x1f0fab);function _0x851425(_0x3d10a5){const _0x7584d5=_0x4bfa45;return _0x3d10a5[_0x7584d5(0x150)](/[-[\]{}()*+?.,\\^$|#\s]/g,'\x5c$&');}_0x381f37(_0x851425,_0x4bfa45(0xe2));let _0x400897=(_0x12a07e=class extends _0x563350[_0x4bfa45(0x105)]{constructor(_0x5e20f4,_0x39ba32,_0xf6c4f1){const _0x48d4c6=_0x4bfa45;super(),_0x2bae30(this,_0x48d4c6(0x171),new Map()),(this['_univerInstanceService']=_0x5e20f4,this[_0x48d4c6(0x125)]=_0x39ba32,this[_0x48d4c6(0x16e)]=_0xf6c4f1);}async['find'](_0x3c7b94){const _0x41dd85=_0x4bfa45;this[_0x41dd85(0x149)]();const _0x5b9604=this[_0x41dd85(0xea)][_0x41dd85(0xbe)](_0x563350['UniverInstanceType'][_0x41dd85(0x14f)]),_0x1fa103=this[_0x41dd85(0x165)](_0x3c7b94);return _0x5b9604[_0x41dd85(0x18b)](_0x454bf8=>{const _0x6a9a42=_0x41dd85,_0x32573a=this['_renderManagerService'][_0x6a9a42(0xa3)](_0x454bf8['getUnitId']())[_0x6a9a42(0x163)](_0x2fd13f['SheetSkeletonManagerService']),_0x49c1a9=this[_0x6a9a42(0x16e)][_0x6a9a42(0x14d)](_0x1f0fab,_0x454bf8,_0x32573a);return this['_findModelsByUnitId'][_0x6a9a42(0x157)](_0x454bf8['getUnitId'](),_0x49c1a9),_0x49c1a9[_0x6a9a42(0xb9)](_0x1fa103),_0x49c1a9;});}[_0x4bfa45(0xee)](){const _0x57b9b4=_0x4bfa45;this[_0x57b9b4(0x149)]();}[_0x4bfa45(0x149)](){const _0x3f115b=_0x4bfa45;this[_0x3f115b(0x171)][_0x3f115b(0x12c)](_0x52547f=>_0x52547f[_0x3f115b(0xde)]()),this['_findModelsByUnitId'][_0x3f115b(0x98)]();}[_0x4bfa45(0x165)](_0x52e7a1){const _0x2cfa7d=_0x4bfa45;let _0x2a3dfc=_0x52e7a1['caseSensitive']?_0x52e7a1[_0x2cfa7d(0xb6)]:_0x52e7a1[_0x2cfa7d(0xb6)][_0x2cfa7d(0xaa)]();return _0x2a3dfc=_0x2a3dfc['trim'](),{..._0x52e7a1,'findString':_0x2a3dfc};}},_0x381f37(_0x12a07e,_0x4bfa45(0x18f)),_0x12a07e);_0x400897=_0x31cb24([_0x50286b(0x0,_0x563350[_0x4bfa45(0x185)]),_0x50286b(0x1,_0x56e128[_0x4bfa45(0x113)]),_0x50286b(0x2,_0x563350[_0x4bfa45(0xb5)](_0x563350[_0x4bfa45(0x167)]))],_0x400897);const _0x3ee47a={'hit':!0x1,'replaceable':!0x1,'isFormula':!0x1,'rawData':null};function _0x577464(_0x28c799,_0xe72e46,_0x320ef0,_0x4e3d36,_0x41aad3){const _0x29aae6=_0x4bfa45,{findBy:_0x21495b}=_0x4e3d36,_0x35f697=_0x21495b===_0x31524d[_0x29aae6(0x9c)]['FORMULA'],_0x5c28d0=_0x28c799[_0x29aae6(0xc5)](_0xe72e46,_0x320ef0);return _0x3ee47a[_0x29aae6(0xfa)]=_0x5c28d0,!(_0x5c28d0!=null&&_0x5c28d0['f'])?(_0x3ee47a['isFormula']=!0x1,_0x55fb1c(_0x41aad3,_0x4e3d36)?_0x5c28d0?(_0x3ee47a[_0x29aae6(0x15f)]=!0x0,_0x3ee47a[_0x29aae6(0xf6)]=!0x0):(_0x3ee47a[_0x29aae6(0x15f)]=!0x0,_0x3ee47a[_0x29aae6(0xf6)]=!0x1):(_0x3ee47a[_0x29aae6(0x15f)]=!0x1,_0x3ee47a[_0x29aae6(0xf6)]=!0x1),_0x3ee47a):(_0x3ee47a[_0x29aae6(0xdc)]=!0x0,_0x35f697?_0x55fb1c({'v':_0x5c28d0['f']},_0x4e3d36)?(_0x3ee47a[_0x29aae6(0x15f)]=!0x0,_0x3ee47a['replaceable']=!0x0,_0x3ee47a):(_0x3ee47a['hit']=!0x1,_0x3ee47a['replaceable']=!0x1,_0x3ee47a):(_0x3ee47a[_0x29aae6(0xf6)]=!0x1,_0x55fb1c(_0x41aad3,_0x4e3d36)?_0x3ee47a[_0x29aae6(0x15f)]=!0x0:_0x3ee47a['hit']=!0x1,_0x3ee47a));}_0x381f37(_0x577464,_0x4bfa45(0x13e));function _0x55fb1c(_0x3dfa7c,_0xcdb4f9){const _0x142039=_0x4bfa45;let _0x59df14=_0x54389a(_0x3dfa7c);return _0x59df14?_0xcdb4f9['matchesTheWholeCell']?(_0x59df14=_0x3de55d(_0x59df14),_0xcdb4f9[_0x142039(0x14c)]?_0x59df14===_0xcdb4f9[_0x142039(0xb6)]:_0x59df14[_0x142039(0xaa)]()===_0xcdb4f9[_0x142039(0xb6)]):_0xcdb4f9[_0x142039(0x14c)]?_0x59df14['indexOf'](_0xcdb4f9[_0x142039(0xb6)])>-0x1:_0x59df14[_0x142039(0xaa)]()[_0x142039(0x19a)](_0xcdb4f9[_0x142039(0xb6)])>-0x1:!0x1;}_0x381f37(_0x55fb1c,_0x4bfa45(0x174));function _0x54389a(_0xa68c3f){const _0x848d07=_0x4bfa45;var _0x136daa,_0x298613,_0x4bd309;const _0x2b808f=(_0x4bd309=(_0x298613=(_0x136daa=_0xa68c3f==null?void 0x0:_0xa68c3f['p'])==null?void 0x0:_0x136daa[_0x848d07(0x12b)])==null?void 0x0:_0x298613['dataStream'])!=null?_0x4bd309:_0xa68c3f==null?void 0x0:_0xa68c3f['v'];return typeof _0x2b808f==_0x848d07(0xf8)?''+_0x2b808f:typeof _0x2b808f=='boolean'?_0x2b808f?'1':'0':_0x2b808f;}_0x381f37(_0x54389a,_0x4bfa45(0x92));function _0x3de55d(_0x2e00c2){const _0x5441b7=_0x4bfa45;return _0x2e00c2[_0x5441b7(0x150)](/^ +/g,'')[_0x5441b7(0x150)](/ +$/g,'');}_0x381f37(_0x3de55d,_0x4bfa45(0xc9));var _0x2fc000=Object[_0x4bfa45(0xd3)],_0x5e99d0=Object[_0x4bfa45(0xd5)],_0x31a37d=_0x381f37((_0x1b0d39,_0x10e705,_0x43c534)=>_0x10e705 in _0x1b0d39?_0x2fc000(_0x1b0d39,_0x10e705,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x43c534}):_0x1b0d39[_0x10e705]=_0x43c534,_0x4bfa45(0xc4)),_0x27ecc0=_0x381f37((_0x37dd84,_0x27fff7,_0xb71020,_0x2ae6a0)=>{const _0x5e2aaa=_0x4bfa45;for(var _0x94870f=_0x2ae6a0>0x1?void 0x0:_0x2ae6a0?_0x5e99d0(_0x27fff7,_0xb71020):_0x27fff7,_0x21e06d=_0x37dd84[_0x5e2aaa(0xcd)]-0x1,_0x5da684;_0x21e06d>=0x0;_0x21e06d--)(_0x5da684=_0x37dd84[_0x21e06d])&&(_0x94870f=(_0x2ae6a0?_0x5da684(_0x27fff7,_0xb71020,_0x94870f):_0x5da684(_0x94870f))||_0x94870f);return _0x2ae6a0&&_0x94870f&&_0x2fc000(_0x27fff7,_0xb71020,_0x94870f),_0x94870f;},_0x4bfa45(0x10e)),_0x4b6d8a=_0x381f37((_0xc85211,_0x1c2c1b)=>(_0x48e8b2,_0x2a70c5)=>_0x1c2c1b(_0x48e8b2,_0x2a70c5,_0xc85211),'__decorateParam'),_0x4009f6=_0x381f37((_0x243b9c,_0x3549e8,_0x381198)=>_0x31a37d(_0x243b9c,typeof _0x3549e8!='symbol'?_0x3549e8+'':_0x3549e8,_0x381198),_0x4bfa45(0x115));const _0x13f210=_0x4bfa45(0x139);_0x5e342f[_0x4bfa45(0x104)]=(_0x7636b3=class extends _0x563350['Plugin']{constructor(_0x37ba=_0x47142c,_0xe7ba9e,_0x1865bd){const _0x246520=_0x4bfa45;super(),this[_0x246520(0x136)]=_0x37ba,this[_0x246520(0x16e)]=_0xe7ba9e,this[_0x246520(0xbf)]=_0x1865bd;const {..._0x4b79a1}=this[_0x246520(0x136)];this[_0x246520(0xbf)][_0x246520(0xab)](_0x5a585d,_0x4b79a1);}[_0x4bfa45(0x11a)](){const _0x57d7b9=_0x4bfa45;[[_0x5e342f['SheetsFindReplaceController']]]['forEach'](_0x1b08bd=>this[_0x57d7b9(0x16e)]['add'](_0x1b08bd));}['onSteady'](){const _0x22b119=_0x4bfa45;this[_0x22b119(0x16e)][_0x22b119(0x10a)](_0x5e342f['SheetsFindReplaceController']);}},_0x381f37(_0x7636b3,_0x4bfa45(0x104)),_0x7636b3),_0x4009f6(_0x5e342f[_0x4bfa45(0x104)],'pluginName',_0x13f210),_0x4009f6(_0x5e342f[_0x4bfa45(0x104)],'type',_0x563350[_0x4bfa45(0xa4)][_0x4bfa45(0x14f)]),_0x5e342f['UniverSheetsFindReplacePlugin']=_0x27ecc0([_0x563350[_0x4bfa45(0x17a)](_0x863b34['UniverSheetsPlugin'],_0x863b34[_0x4bfa45(0xb1)],_0x31524d[_0x4bfa45(0x18d)]),_0x4b6d8a(0x1,_0x563350[_0x4bfa45(0xb5)](_0x563350[_0x4bfa45(0x167)])),_0x4b6d8a(0x2,_0x563350[_0x4bfa45(0x172)])],_0x5e342f[_0x4bfa45(0x104)]),_0x5e342f['SheetReplaceCommand']=_0x108cfb,Object['defineProperty'](_0x5e342f,Symbol[_0x4bfa45(0x11e)],{'value':_0x4bfa45(0xdf)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-find-replace",
|
|
3
|
-
"version": "0.3.0-
|
|
3
|
+
"version": "0.3.0-nightly.202410101606",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UniverSheet find replace plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -48,27 +48,27 @@
|
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"rxjs": ">=7.0.0",
|
|
51
|
-
"@univerjs/core": "0.3.0-
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/find-replace": "0.3.0-
|
|
54
|
-
"@univerjs/sheets": "0.3.0-
|
|
55
|
-
"@univerjs/
|
|
51
|
+
"@univerjs/core": "0.3.0-nightly.202410101606",
|
|
52
|
+
"@univerjs/engine-render": "0.3.0-nightly.202410101606",
|
|
53
|
+
"@univerjs/find-replace": "0.3.0-nightly.202410101606",
|
|
54
|
+
"@univerjs/sheets-ui": "0.3.0-nightly.202410101606",
|
|
55
|
+
"@univerjs/sheets": "0.3.0-nightly.202410101606"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@univerjs/protocol": "0.1.39-alpha.15",
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/engine-formula": "0.3.0-
|
|
61
|
-
"@univerjs/
|
|
62
|
-
"@univerjs/find-replace": "0.3.0-
|
|
63
|
-
"@univerjs/sheets
|
|
64
|
-
"@univerjs/sheets": "0.3.0-
|
|
59
|
+
"@univerjs/engine-render": "0.3.0-nightly.202410101606",
|
|
60
|
+
"@univerjs/engine-formula": "0.3.0-nightly.202410101606",
|
|
61
|
+
"@univerjs/core": "0.3.0-nightly.202410101606",
|
|
62
|
+
"@univerjs/find-replace": "0.3.0-nightly.202410101606",
|
|
63
|
+
"@univerjs/sheets": "0.3.0-nightly.202410101606",
|
|
64
|
+
"@univerjs/sheets-ui": "0.3.0-nightly.202410101606"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"rxjs": "^7.8.1",
|
|
68
68
|
"typescript": "^5.6.2",
|
|
69
69
|
"vite": "^5.4.8",
|
|
70
70
|
"vitest": "^2.1.1",
|
|
71
|
-
"@univerjs-infra/shared": "0.3.0
|
|
71
|
+
"@univerjs-infra/shared": "0.3.0"
|
|
72
72
|
},
|
|
73
73
|
"univerSpace": {
|
|
74
74
|
".": {
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
"test:watch": "vitest",
|
|
90
90
|
"coverage": "vitest run --coverage",
|
|
91
91
|
"lint:types": "tsc --noEmit",
|
|
92
|
-
"build": "tsc && vite build"
|
|
93
|
-
"sync:cnpm": "cnpm sync"
|
|
92
|
+
"build": "tsc && vite build"
|
|
94
93
|
}
|
|
95
94
|
}
|
package/LICENSE
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|