@univerjs-pro/sheets-pivot-ui 1.5.1 → 1.5.2

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.
Files changed (81) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/ar-SA.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/de-DE.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/id-ID.js +1 -1
  10. package/lib/cjs/locale/it-IT.js +1 -1
  11. package/lib/cjs/locale/ja-JP.js +1 -1
  12. package/lib/cjs/locale/ko-KR.js +1 -1
  13. package/lib/cjs/locale/pl-PL.js +1 -1
  14. package/lib/cjs/locale/pt-BR.js +1 -1
  15. package/lib/cjs/locale/ru-RU.js +1 -1
  16. package/lib/cjs/locale/sk-SK.js +1 -1
  17. package/lib/cjs/locale/vi-VN.js +1 -1
  18. package/lib/cjs/locale/zh-CN.js +1 -1
  19. package/lib/cjs/locale/zh-HK.js +1 -1
  20. package/lib/cjs/locale/zh-TW.js +1 -1
  21. package/lib/es/index.js +1 -1
  22. package/lib/es/locale/ar-SA.js +1 -1
  23. package/lib/es/locale/ca-ES.js +1 -1
  24. package/lib/es/locale/de-DE.js +1 -1
  25. package/lib/es/locale/en-US.js +1 -1
  26. package/lib/es/locale/es-ES.js +1 -1
  27. package/lib/es/locale/fa-IR.js +1 -1
  28. package/lib/es/locale/fr-FR.js +1 -1
  29. package/lib/es/locale/id-ID.js +1 -1
  30. package/lib/es/locale/it-IT.js +1 -1
  31. package/lib/es/locale/ja-JP.js +1 -1
  32. package/lib/es/locale/ko-KR.js +1 -1
  33. package/lib/es/locale/pl-PL.js +1 -1
  34. package/lib/es/locale/pt-BR.js +1 -1
  35. package/lib/es/locale/ru-RU.js +1 -1
  36. package/lib/es/locale/sk-SK.js +1 -1
  37. package/lib/es/locale/vi-VN.js +1 -1
  38. package/lib/es/locale/zh-CN.js +1 -1
  39. package/lib/es/locale/zh-HK.js +1 -1
  40. package/lib/es/locale/zh-TW.js +1 -1
  41. package/lib/index.js +1 -1
  42. package/lib/locale/ar-SA.js +1 -1
  43. package/lib/locale/ca-ES.js +1 -1
  44. package/lib/locale/de-DE.js +1 -1
  45. package/lib/locale/en-US.js +1 -1
  46. package/lib/locale/es-ES.js +1 -1
  47. package/lib/locale/fa-IR.js +1 -1
  48. package/lib/locale/fr-FR.js +1 -1
  49. package/lib/locale/id-ID.js +1 -1
  50. package/lib/locale/it-IT.js +1 -1
  51. package/lib/locale/ja-JP.js +1 -1
  52. package/lib/locale/ko-KR.js +1 -1
  53. package/lib/locale/pl-PL.js +1 -1
  54. package/lib/locale/pt-BR.js +1 -1
  55. package/lib/locale/ru-RU.js +1 -1
  56. package/lib/locale/sk-SK.js +1 -1
  57. package/lib/locale/vi-VN.js +1 -1
  58. package/lib/locale/zh-CN.js +1 -1
  59. package/lib/locale/zh-HK.js +1 -1
  60. package/lib/locale/zh-TW.js +1 -1
  61. package/lib/umd/index.js +1 -1
  62. package/lib/umd/locale/ar-SA.js +1 -1
  63. package/lib/umd/locale/ca-ES.js +1 -1
  64. package/lib/umd/locale/de-DE.js +1 -1
  65. package/lib/umd/locale/en-US.js +1 -1
  66. package/lib/umd/locale/es-ES.js +1 -1
  67. package/lib/umd/locale/fa-IR.js +1 -1
  68. package/lib/umd/locale/fr-FR.js +1 -1
  69. package/lib/umd/locale/id-ID.js +1 -1
  70. package/lib/umd/locale/it-IT.js +1 -1
  71. package/lib/umd/locale/ja-JP.js +1 -1
  72. package/lib/umd/locale/ko-KR.js +1 -1
  73. package/lib/umd/locale/pl-PL.js +1 -1
  74. package/lib/umd/locale/pt-BR.js +1 -1
  75. package/lib/umd/locale/ru-RU.js +1 -1
  76. package/lib/umd/locale/sk-SK.js +1 -1
  77. package/lib/umd/locale/vi-VN.js +1 -1
  78. package/lib/umd/locale/zh-CN.js +1 -1
  79. package/lib/umd/locale/zh-HK.js +1 -1
  80. package/lib/umd/locale/zh-TW.js +1 -1
  81. package/package.json +16 -15
package/lib/es/index.js CHANGED
@@ -1 +1 @@
1
- const _0x1aaa99=_0x14e6;(function(_0x3c68ff,_0x9280eb){const _0x23ed7f=_0x14e6,_0x4f2aa2=_0x3c68ff();while(!![]){try{const _0x2fe623=-parseInt(_0x23ed7f(0x3b8))/0x1*(parseInt(_0x23ed7f(0x2ef))/0x2)+-parseInt(_0x23ed7f(0x435))/0x3*(parseInt(_0x23ed7f(0x294))/0x4)+-parseInt(_0x23ed7f(0x104))/0x5+-parseInt(_0x23ed7f(0x31e))/0x6+parseInt(_0x23ed7f(0x552))/0x7*(-parseInt(_0x23ed7f(0x1ce))/0x8)+-parseInt(_0x23ed7f(0x3be))/0x9+-parseInt(_0x23ed7f(0x325))/0xa*(-parseInt(_0x23ed7f(0x398))/0xb);if(_0x2fe623===_0x9280eb)break;else _0x4f2aa2['push'](_0x4f2aa2['shift']());}catch(_0x53b150){_0x4f2aa2['push'](_0x4f2aa2['shift']());}}}(_0x2983,0x668e2));import{GlobalConfig as _0x5fc13a,PivotCellStyleTypeEnum as _0x2f72a2,PivotDataFieldDataTypeEnum as _0xe427cd,PivotDataFieldSortOperatorEnum as _0x37cdcc,PivotDataFieldTypeEnum as _0x45b543,PivotDateGroupingMode as _0x161a50,PivotExcelDateGroupUnit as _0x55be9d,PivotFilterTypeEnum as _0x567986,PivotLayoutTypeEnum as _0x56ebe5,PivotShowAsBaseItemTypeEnum as _0x469ab7,PivotShowAsTypeEnum as _0x3c9058,PivotSubtotalPositionEnum as _0x199ba4,PivotSubtotalTypeEnum as _0x407a23,PivotTableFiledAreaEnum as _0x1d45fb,PivotTableValuePositionEnum as _0x1adff7,ST_PivotFilterOperatorEnum as _0x137159,compilePivotDateFilter as _0x176112,generateHexNumber as _0x254602,getPivotDateGroupingMode as _0x470709,hasPivotMultipleFilters as _0xebe916,isDateGroupFieldJSON as _0x16d347,isManualPivotFilter as _0x3bde09,isPivotDateFilter as _0x23bbe1,isPivotTableFilterRestrictive as _0x29f090,isValueFilterOperator as _0x3c7d69}from'@univerjs-pro/engine-pivot';import{AddPivotFieldCommand as _0x207afc,AddPivotTableCommand as _0x32f441,InitializePivotRuntimeLocalMutation as _0x53cf5b,MovePivotFieldCommand as _0x3f282e,PIVOT_DATE_GROUP_TYPES as _0xf1d45b,PIVOT_OPTION_FILTER_COORDINATION as _0x33b0b7,PivotDisplayDataType as _0x4d06ca,PivotDrillDownCommand as _0xafefe6,PositionType as _0x1e3671,RemovePivotFieldCommand as _0x2229ad,RemovePivotTableCommand as _0x34359f,RemovePivotTableMutation as _0x768732,SHEETS_PIVOT_PLUGIN_CONFIG_KEY as _0x2d42ea,SHEET_PIVOT_TABLE_PLUGIN as _0x5cac9f,SetPivotCollapseCommand as _0x8f3145,SetPivotDateFilterCommand as _0x41d20f,SetPivotDateGroupCommand as _0xc31403,SetPivotExcelDateGroupCommand as _0x163355,SetPivotFilterCommand as _0x1d4592,SetPivotLayoutCommand as _0x4a0aca,SetPivotManualGroupsCommand as _0x3804bf,SetPivotNumberGroupCommand as _0x499607,SetPivotOptionCommand as _0x4c22c7,SetPivotSortCommand as _0x213b5a,SetPivotValueFilterCommand as _0x19eda7,SheetsPivotRPCService as _0x40b8c0,SheetsPivotTableAdaptorModel as _0x131a27,SheetsPivotTableConfigModel as _0x344ed3,SheetsPivotTableService as _0x43647f,UniverSheetsPivotTablePlugin as _0x542b42,UpdatePivotFieldSettingCommand as _0x2d9543,UpdatePivotTableSourceRangeCommand as _0x3bcc73,UpdatePivotValuePositionCommand as _0x33eb57,generateSetRangeValueMutations as _0x151826,getPivotAppliedRanges as _0x3ae7ad,getPivotDateGroupContext as _0x4fc8c1,isPivotDateGroupTypeDisabled as _0x50a736,isolateTextForBidiContext as _0x44255e,mapPivotSheetColumn as _0x394f2b,mapPivotSheetRange as _0xb0594,resolvePivotSheetCell as _0x7518aa,resolvePivotValueFieldId as _0x282bd5,resolvePivotValueFilterTarget as _0xb556f0,unionPivotViewRange as _0x5e0a33}from'@univerjs-pro/sheets-pivot';import{CommandType as _0xe4a01,CustomCommandExecutionError as _0x5d2e21,DateSystem as _0x40debb,DependentOn as _0x112913,Disposable as _0x239c25,DisposableCollection as _0x5040df,FilterSelectionMode as _0x2394c4,ICommandService as _0x12babc,IConfigService as _0xcc1513,IConfirmService as _0x7c076c,ILogService as _0x3e0dae,IPermissionService as _0x5f571f,IUniverInstanceService as _0x570eee,Inject as _0x446f3f,Injector as _0x21b420,LocaleService as _0x2129e8,Optional as _0x3022df,Plugin as _0x1b4002,RANGE_TYPE as _0x2f8441,RecordValueType as _0x3d4959,Rectangle as _0x1ca723,ThemeService as _0x9976df,Tools as _0x302467,UniverInstanceType as _0x36df91,cellToRange as _0x4fbdbf,currencySymbols as _0x208996,debounce as _0x4916ba,excelDateTimePartsToSerial as _0x37c81c,excelSerialToDateTimeParts as _0x173e82,generateRandomId as _0x11168c,isPatternEqualWithoutDecimal as _0x55e497,isValidRange as _0x4c4e35,merge as _0x3cf2d5,numfmt as _0xd5638d,toDisposable as _0x56dd68,touchDependencies as _0x786ce2}from'@univerjs/core';import{AddWorksheetMergeMutation as _0x82d4ca,InsertColCommand as _0x37026d,InsertRowCommand as _0x5ace18,MergeCellController as _0xa41291,MoveRangeCommand as _0x5c163a,RangeProtectionPermissionEditPoint as _0x27648a,RangeProtectionPermissionViewPoint as _0x4707cc,RemoveColCommand as _0x4f07cc,RemoveRowCommand as _0x599d8f,SheetInterceptorService as _0x14478c,SheetPermissionCheckController as _0x2f1427,SheetsSelectionsService as _0x2f649b,UniverSheetsPlugin as _0x32b53a,WorkbookEditablePermission as _0x23a297,WorksheetEditPermission as _0x4cb3a4,WorksheetFilterPermission as _0x1723a0,WorksheetPivotTablePermission as _0x20e8fc,WorksheetViewPermission as _0x5424ba,checkRangesEditablePermission as _0x3ff5ee,expandToContinuousRange as _0x51e4c1,getSheetCommandTarget as _0x16d892,isSingleCellSelection as _0x11e87f}from'@univerjs/sheets';import{ComponentManager as _0x2260a2,ContextMenuGroup as _0x5cc463,ContextMenuPosition as _0x25e2c4,IDialogService as _0x4f85fa,IMenuManagerService as _0x176317,IMessageService as _0x2dc350,ISidebarService as _0x47511f,IconManager as _0x3312ae,MenuItemType as _0x4052c0,RibbonDataGroup as _0x24e4c4,UniverMobileUIPlugin as _0x3bfad0,getMenuHiddenObservable as _0xaf945e,useDependency as _0x2140ff,useObservable as _0x362266}from'@univerjs/ui';import{CellAlertManagerService as _0x5bce73,CellAlertType as _0x5380b8,IFormatPainterService as _0x1fc6c6,ISheetClipboardService as _0x465180,ISheetSelectionRenderService as _0x3236cb,MOBILE_CONTEXT_MENU as _0x506f0c,SetCellEditVisibleOperation as _0x574efd,SheetContextMenuMobileRenderController as _0x368b3e,SheetPrintInterceptorService as _0x21b75f,SheetSkeletonManagerService as _0x8f17eb,SheetsRenderService as _0x5d1f4c,UniverSheetsMobileUIPlugin as _0x1363cb,UniverSheetsUIPlugin as _0x14caaf,getCoordByCell as _0x4b0ff3,getCoordByOffset as _0x465121,getCurrentRangeDisable$ as _0x176c34,getObservableWithExclusiveRange$ as _0x1f49cd,getSheetObject as _0x26b66b}from'@univerjs/sheets-ui';import{EMPTY as _0x161fd7,Subject as _0x55b11a,auditTime as _0x1296c7,concat as _0x484ccd,debounceTime as _0xef7484,defer as _0x2e2635,filter as _0x36bc5f,map as _0x245ce1,merge as _0x2a5b68,of as _0x10b67b,skip as _0x5a560c,startWith as _0x36a106,switchMap as _0x449d61,takeUntil as _0x2ddc83,tap as _0x26841e}from'rxjs';import{ActionRow as _0xae166f,Button as _0x38daeb,Checkbox as _0x180ca8,DatePicker as _0x33030d,Dropdown as _0x29bff8,Input as _0x1b81fe,InputNumber as _0x536e2c,MessageType as _0x3330ef,MobileActionRow as _0xa38594,MobileActionRowGroup as _0x113010,MobileDropdownMenu as _0x147dcb,MobileSelect as _0x4831b8,Radio as _0x5996ee,RadioGroup as _0x5dfabf,Segmented as _0x13f1d9,Select as _0x44fcce,SelectList as _0x1a842c,TimeInput as _0x164f28,Tooltip as _0x911b8f,borderClassName as _0x4d03f3,clsx as _0x1d52fd,scrollbarClassName as _0x392444}from'@univerjs/design';import{UniverLicensePlugin as _0x3e6109}from'@univerjs-pro/license';import{CURSOR_TYPE as _0x73d6ca,IRenderManagerService as _0xf881cc,Rect as _0x3ad316,Shape as _0x30f8db,UniverRenderEnginePlugin as _0x574984,Vector2 as _0x4312a4}from'@univerjs/engine-render';import{ArrowLeftIcon as _0x1d964b,AscendingIcon as _0x1eab93,CalendarIcon as _0x343400,CheckMarkIcon as _0x23dd1,ColumnIcon as _0x2b6f12,DescendingIcon as _0xf36326,FilterIcon as _0x5e491f,FunctionIcon as _0x1b475a,GripVerticalIcon as _0x540bc3,MoreDownIcon as _0x2089b2,MoreHorizontalIcon as _0x35b17e,NumberIcon as _0x3577c6,PivotTableIcon as _0x3aa39e,RowIcon as _0x107601,SearchIcon as _0x337703,TextIcon as _0x571eae}from'@univerjs/icons';import{Fragment as _0x48361d,jsx as _0x2a3146,jsxs as _0x81f19b}from'react/jsx-runtime';import{createContext as _0x4e4db7,useCallback as _0x7784bf,useContext as _0x17a98d,useEffect as _0x2c2735,useMemo as _0x38d376,useRef as _0x25e96e,useState as _0x18aa7d}from'react';import{deserializeRangeWithSheet as _0x1f4fb6,serializeRange as _0x4d3163,serializeRangeWithSheet as _0x33a7d7}from'@univerjs/engine-formula';import{MobileRangeSelector as _0x4476fb,RangeSelector as _0x54e9eb}from'@univerjs/sheets-formula-ui';import{InsertTextCommand as _0x1b5e96}from'@univerjs/docs';import{IMEInputCommand as _0x25d14f}from'@univerjs/docs-ui';const Tr='UNIVER_SHEET_PIVOT_PANEL',Er='UNIVER_SHEET_PIVOT_PANEL_ID',Dr=_0x1aaa99(0x471),Or=_0x1aaa99(0x2b8),kr=_0x1aaa99(0x3e1),Ar='UNIVER_SHEET_PIVOT_FIELD_SETTING_ID',jr=_0x1aaa99(0x2eb),Mr=_0x1aaa99(0x54f),Nr='UNIVER_SHEET_PIVOT_SHOW_DATA_AS_DIALOG',Pr=_0x1aaa99(0x186),Fr=_0x1aaa99(0x221),Ir='UNIVER_SHEET_PIVOT_NUMBER_GROUP_DIALOG',Lr=_0x1aaa99(0x48d),Rr='univer.sheet.pivot-table-range-selector',zr='UNIVER_SHEET_PIVOT_MOBILE_ACTION_PANEL',Br=_0x1aaa99(0x429),Vr={'type':_0xe4a01['OPERATION'],'id':'sheet.operation.open-pivot-table-range-selector-panel',async 'handler'(_0x46d968){const _0x264340=_0x1aaa99;let _0x59dcdf=_0x46d968['get'](_0x570eee),_0x40fa0c=_0x46d968[_0x264340(0x210)](_0x12babc),_0x32c91a=_0x16d892(_0x59dcdf),_0x23291a=_0x46d968[_0x264340(0x210)](_0x2129e8);if(!_0x32c91a)return!0x1;let {unitId:_0x317cf6,subUnitId:_0x145206,worksheet:_0x34b869,workbook:_0x37e39c}=_0x32c91a,_0x18b8c9=_0x46d968[_0x264340(0x210)](_0x2f649b)[_0x264340(0x19b)](),_0x432680=(_0x18b8c9==null?void 0x0:_0x18b8c9['range'])??{'startRow':0x0,'endRow':0x0,'startColumn':0x0,'endColumn':0x0,'rangeType':_0x2f8441[_0x264340(0x2f4)]},_0x5610a7=await Hr(_0x46d968,_0x317cf6,_0x145206,_0x11e87f(_0x18b8c9)?_0x51e4c1(_0x432680,{'up':!0x0,'left':!0x0,'right':!0x0,'down':!0x0},_0x34b869):_0x432680,_0x34b869['getName']());if(!_0x5610a7)return!0x1;let _0x31d423=_0x37e39c[_0x264340(0x2dd)]()[_0x264340(0x55a)](_0x2089c6=>_0x2089c6['getName']()===_0x5610a7[_0x264340(0x3b5)]);if(!_0x31d423)return!0x1;let _0x4ebe64;if(_0x5610a7[_0x264340(0x3a6)]===_0x1e3671[_0x264340(0x1a4)])_0x4ebe64={'row':0x0,'col':0x0,'unitId':_0x317cf6,'subUnitId':_0x11168c(),'sheetName':_0x37e39c['generateNewSheetName'](''+_0x23291a['t']('sheets-pivot-ui.sheet'))};else{if(!_0x5610a7[_0x264340(0x2ac)]||!_0x5610a7[_0x264340(0x174)])return!0x1;let _0x28d8d9=_0x37e39c[_0x264340(0x2dd)]()[_0x264340(0x55a)](_0x2114d2=>_0x2114d2[_0x264340(0x4a7)]()===_0x5610a7[_0x264340(0x174)]);if(!_0x28d8d9)return!0x1;_0x4ebe64={'row':_0x5610a7['positionRange'][_0x264340(0x3a0)],'col':_0x5610a7[_0x264340(0x2ac)][_0x264340(0x401)],'unitId':_0x317cf6,'subUnitId':_0x28d8d9[_0x264340(0x258)](),'sheetName':_0x28d8d9[_0x264340(0x4a7)]()};}let _0x5c6f62=_0x254602(0x8);return await _0x40fa0c[_0x264340(0x4e2)](_0x32f441['id'],{'pivotTableId':_0x5c6f62,'pivotTableConfig':{'targetCellInfo':_0x4ebe64,'sourceRangeInfo':{'range':_0x5610a7[_0x264340(0x49a)],'unitId':_0x317cf6,'sheetName':_0x5610a7[_0x264340(0x3b5)],'subUnitId':_0x31d423['getSheetId']()}},'positionType':_0x5610a7['positionType']})?{'unitId':_0x4ebe64[_0x264340(0xf8)],'subUnitId':_0x4ebe64['subUnitId'],'pivotTableId':_0x5c6f62}:!0x1;}};async function Hr(_0x1c2c5c,_0x5ee42a,_0x313f12,_0x2d0999,_0x5577cd){const _0x1041f6=_0x1aaa99;let _0x207419=_0x1c2c5c['get'](_0x4f85fa),_0x238b03=_0x1c2c5c[_0x1041f6(0x210)](_0x2129e8);return new Promise(_0x12a59b=>{const _0x2e6c81=_0x1041f6;let _0x47484f,_0x9d8c1d={'unitId':_0x5ee42a,'subUnitId':_0x313f12,'sourceRange':_0x2d0999,'positionRange':null,'sourceSheetName':_0x5577cd,'positionSheetName':_0x5577cd,'onConfirm':_0x1ca1f4=>{const _0x1c8d0b=_0x14e6;_0x12a59b(_0x1ca1f4),_0x47484f==null||_0x47484f[_0x1c8d0b(0x144)]();},'onCancel':()=>{const _0x46bcab=_0x14e6;_0x12a59b(null),_0x47484f==null||_0x47484f[_0x46bcab(0x144)]();}};_0x47484f=_0x207419[_0x2e6c81(0x22d)]({'id':Rr,'title':{'title':_0x238b03['t'](_0x2e6c81(0x134))},'draggable':!0x0,'mask':!0x1,'maskClosable':!0x1,'children':{'label':{'name':Rr,'props':_0x9d8c1d}},'width':0x190,'onClose':()=>{_0x47484f['dispose']();}});});}const Ur={'type':_0xe4a01[_0x1aaa99(0x384)],'id':_0x1aaa99(0x353),async 'handler'(_0x4fafd3,_0x1d0c81){const _0x1408b1=_0x1aaa99;if(!_0x1d0c81)return!0x1;let _0x1ac9e8=Wr(_0x4fafd3);return _0x1ac9e8?_0x4fafd3[_0x1408b1(0x210)](_0x12babc)[_0x1408b1(0x4e2)](_0xc31403['id'],{'unitId':_0x1ac9e8[_0x1408b1(0xf8)],'subUnitId':_0x1ac9e8['subUnitId'],'pivotTableId':_0x1ac9e8['pivotTableId'],'tableFieldId':_0x1ac9e8['tableFieldId'],'dateType':_0x1d0c81[_0x1408b1(0x1cb)]}):!0x1;}};function Wr(_0xc73612,_0x5b5ce9=_0x161a50[_0x1aaa99(0x405)]){const _0x4d5128=_0x1aaa99;let _0x2f09b1=_0xc73612['get'](_0x570eee),_0x2780d6=_0x16d892(_0x2f09b1);if(!_0x2780d6)return;let _0x2fc1d7=_0xc73612[_0x4d5128(0x210)](_0x2f649b)[_0x4d5128(0x19b)](),_0x18280b=_0x2fc1d7==null?void 0x0:_0x2fc1d7['primary'];if(!_0x18280b)return;let {unitId:_0x565f34,subUnitId:_0x47f56c}=_0x2780d6,_0x417f95=_0x18280b[_0x4d5128(0x3a0)],_0x449429=_0x18280b[_0x4d5128(0x401)],_0x1ad410=_0xc73612[_0x4d5128(0x210)](_0x131a27)[_0x4d5128(0xc8)](_0x565f34,_0x47f56c,_0x417f95,_0x449429);if(!_0x1ad410)return;let _0x3b9b5a=Gr(_0xc73612,_0x565f34,_0x47f56c,_0x1ad410,_0x417f95,_0x449429);if(!_0x3b9b5a)return;let _0x513f32=_0xc73612[_0x4d5128(0x210)](_0x344ed3),_0x17b03c=_0x513f32[_0x4d5128(0x2fa)](_0x565f34,_0x47f56c,_0x1ad410);if(_0x470709(_0x17b03c==null?void 0x0:_0x17b03c[_0x4d5128(0x4e3)][_0x4d5128(0x103)])!==_0x5b5ce9)return;let _0x61e489=_0x513f32[_0x4d5128(0x1f1)](_0x565f34,_0x1ad410),_0x400248=_0x4fc8c1(_0x17b03c==null?void 0x0:_0x17b03c[_0x4d5128(0x4e3)],_0x61e489,_0x3b9b5a);if(_0x400248)return{'unitId':_0x565f34,'subUnitId':_0x47f56c,'pivotTableId':_0x1ad410,'tableFieldId':_0x3b9b5a,'row':_0x417f95,'col':_0x449429,'dateGroupContext':_0x400248};}function Gr(_0x475f0e,_0x4cb389,_0x495423,_0xf1df94,_0x5ccc02,_0x9d4843){const _0x440482=_0x1aaa99;let _0x18366d=_0x475f0e[_0x440482(0x210)](_0x131a27)['getPivotItemRenderInfoCache'](_0x4cb389,_0x495423,_0xf1df94);if(!_0x18366d)return;let _0x293fcf=_0x475f0e[_0x440482(0x210)](_0x131a27)[_0x440482(0x3fa)](_0x4cb389,_0x495423,_0x5ccc02,_0x9d4843),_0x485f1d=_0x7518aa(_0x5ccc02,_0x9d4843,_0x293fcf,_0x18366d);return _0x485f1d==null?void 0x0:_0x485f1d[_0x440482(0x1b1)];}function Kr(_0x5bb511){const _0x5050b2=_0x1aaa99;let _0x4b83a4=Wr(_0x5bb511,_0x161a50['ExcelLike']);if(!_0x4b83a4)return;let _0x31ac00=_0x5bb511[_0x5050b2(0x210)](_0x344ed3),_0x121398=_0x31ac00['getPivotTableConfig'](_0x4b83a4['unitId'],_0x4b83a4[_0x5050b2(0x19f)],_0x4b83a4[_0x5050b2(0x53d)]),_0x3e4cd1=_0x121398==null?void 0x0:_0x121398[_0x5050b2(0x4e3)][_0x5050b2(0x434)][_0x4b83a4['tableFieldId']];if(!_0x3e4cd1)return;let _0xb5c606=_0x31ac00[_0x5050b2(0x1f1)](_0x4b83a4['unitId'],_0x4b83a4[_0x5050b2(0x53d)]),_0x17c7af=(_0x4b83a4['dateGroupContext']['area']===_0x1d45fb[_0x5050b2(0x4c1)]?_0x121398[_0x5050b2(0x4e3)][_0x5050b2(0x12b)]:_0x121398[_0x5050b2(0x4e3)][_0x5050b2(0x39e)])[_0x5050b2(0x289)](_0x47369f=>{const _0x107a72=_0x5050b2;let _0x48b6e0=_0x121398[_0x107a72(0x4e3)][_0x107a72(0x434)][_0x47369f],_0x5b5d82=_0x48b6e0?_0xb5c606==null?void 0x0:_0xb5c606[_0x107a72(0x479)][_0x48b6e0[_0x107a72(0x26a)]]:void 0x0;return _0x5b5d82&&_0x16d347(_0x5b5d82)&&_0x5b5d82['originalFieldId']===_0x4b83a4[_0x107a72(0x44e)][_0x107a72(0x1e8)]&&_0x5b5d82['excelLike']?[_0x5b5d82[_0x107a72(0x158)]]:[];}),_0x567597=_0x17c7af[0x0],_0x568e72=_0x567597?{'units':_0x17c7af[_0x5050b2(0x15d)](_0x5df1c9=>_0x5df1c9[_0x5050b2(0x32d)]),'autoStart':_0x567597['autoStart'],'autoEnd':_0x567597[_0x5050b2(0x404)],..._0x567597['start']===void 0x0?{}:{'start':_0x567597['start']},..._0x567597[_0x5050b2(0x419)]===void 0x0?{}:{'end':_0x567597['end']},..._0x567597[_0x5050b2(0x55d)]===void 0x0?{}:{'daysInterval':_0x567597[_0x5050b2(0x55d)]}}:void 0x0;return{..._0x4b83a4,'targetFieldName':_0x3e4cd1[_0x5050b2(0x10a)],'grouping':_0x568e72};}const qr={'id':_0x1aaa99(0x30a),'type':_0xe4a01[_0x1aaa99(0x384)],async 'handler'(_0x312b47){const _0x274e88=_0x1aaa99;let _0x4d4584=Kr(_0x312b47);if(!_0x4d4584)return!0x1;let _0x29cfe0=_0x312b47['get'](_0x344ed3),_0x555e4e=_0x29cfe0[_0x274e88(0x2fa)](_0x4d4584[_0x274e88(0xf8)],_0x4d4584[_0x274e88(0x19f)],_0x4d4584[_0x274e88(0x53d)]),_0x4875c0=_0x29cfe0['getCollection'](_0x4d4584[_0x274e88(0xf8)],_0x4d4584[_0x274e88(0x53d)]),_0x301872=_0x312b47['get'](_0x4f85fa),_0x49c83d=_0x312b47[_0x274e88(0x210)](_0x2129e8),_0x5d0770=_0x312b47[_0x274e88(0x210)](_0x570eee)['getUnit'](_0x4d4584[_0x274e88(0xf8)]),_0x26a822=(_0x5d0770==null?void 0x0:_0x5d0770[_0x274e88(0x509)]())??_0x40debb[_0x274e88(0x330)],_0x3d9c26=null,_0x1c18a3=!0x1,_0x12bd0d=!0x1,_0x41b2b1=()=>{const _0x54a6fa=_0x274e88;_0x1c18a3||(_0x1c18a3=!0x0,_0x3d9c26==null||_0x3d9c26[_0x54a6fa(0x144)](),_0x3d9c26=null);},_0x11edbd=async _0x2c422a=>{const _0x3f4b67=_0x274e88;if(!(_0x12bd0d||_0x1c18a3)){_0x12bd0d=!0x0;try{let _0x1b585f=Kr(_0x312b47);if(!_0x1b585f||_0x1b585f[_0x3f4b67(0xf8)]!==_0x4d4584[_0x3f4b67(0xf8)]||_0x1b585f[_0x3f4b67(0x19f)]!==_0x4d4584[_0x3f4b67(0x19f)]||_0x1b585f[_0x3f4b67(0x53d)]!==_0x4d4584['pivotTableId']||_0x1b585f[_0x3f4b67(0x1b1)]!==_0x4d4584['tableFieldId']||_0x29cfe0[_0x3f4b67(0x2fa)](_0x4d4584[_0x3f4b67(0xf8)],_0x4d4584[_0x3f4b67(0x19f)],_0x4d4584[_0x3f4b67(0x53d)])!==_0x555e4e||_0x29cfe0['getCollection'](_0x4d4584[_0x3f4b67(0xf8)],_0x4d4584[_0x3f4b67(0x53d)])!==_0x4875c0)return;await _0x312b47['get'](_0x12babc)['executeCommand'](_0x163355['id'],{'unitId':_0x4d4584[_0x3f4b67(0xf8)],'subUnitId':_0x4d4584[_0x3f4b67(0x19f)],'pivotTableId':_0x4d4584[_0x3f4b67(0x53d)],'tableFieldId':_0x4d4584[_0x3f4b67(0x1b1)],'grouping':{..._0x2c422a,'units':_0x2c422a[_0x3f4b67(0x3bc)][_0x3f4b67(0x208)]()}});}catch{}finally{_0x41b2b1();}}};try{_0x3d9c26=_0x301872[_0x274e88(0x22d)]({'id':_0x274e88(0x1f8),'title':{'title':_0x49c83d['t'](_0x274e88(0x1fa))},'draggable':!0x0,'mask':!0x0,'maskClosable':!0x1,'width':0x1b8,'children':{'label':{'name':Fr,'props':{'targetFieldName':_0x4d4584[_0x274e88(0x473)],'dateSystem':_0x26a822,'grouping':_0x4d4584[_0x274e88(0xd0)],'onConfirm':_0x11edbd,'onCancel':_0x41b2b1}}},'onClose':_0x41b2b1});}catch{return _0x41b2b1(),!0x1;}return!0x0;}};function Jr(_0x21112c){const _0x215c4f=_0x1aaa99;return _0x21112c['map'](_0x814ebf=>({..._0x814ebf,'members':_0x814ebf[_0x215c4f(0x2af)][_0x215c4f(0x15d)](_0x56fbe3=>({..._0x56fbe3}))}));}function Yr(_0x300763){const _0x34da86=_0x1aaa99;let _0x1de884;try{_0x1de884=JSON[_0x34da86(0x246)](_0x300763);}catch{return;}if(!(!Array['isArray'](_0x1de884)||_0x1de884[_0x34da86(0x483)]<0x1||typeof _0x1de884[0x0]!='string'))return _0x1de884[0x0]===_0x3d4959[_0x34da86(0x247)]?_0x5fc13a['BLANK_PLACEHOLDER']:String(_0x1de884[0x1]);}function Xr(_0x59e4b6,_0x561256){const _0x3492f8=_0x1aaa99;var _0x4cee34;let _0xd5fe0e=()=>({'error':_0x3492f8(0x100)}),_0x3e48e2=_0x16d892(_0x59e4b6['get'](_0x570eee)),_0x4b1445=_0x59e4b6['get'](_0x2f649b)[_0x3492f8(0x11c)]();if(!_0x3e48e2||!_0x4b1445['length'])return _0xd5fe0e();let {unitId:_0x2b68e3,subUnitId:_0x82a542}=_0x3e48e2,_0x36daac=_0x4b1445[0x0][_0x3492f8(0xc5)];if(!_0x36daac)return _0xd5fe0e();let _0x4325ac=_0x59e4b6[_0x3492f8(0x210)](_0x131a27),_0x3a7d55=_0x4325ac['getPivotTableIdByCell'](_0x2b68e3,_0x82a542,_0x36daac['startRow'],_0x36daac['startColumn']),_0x145e1d=_0x59e4b6[_0x3492f8(0x210)](_0x344ed3),_0x4520f6=_0x3a7d55&&_0x145e1d['getPivotTableConfig'](_0x2b68e3,_0x82a542,_0x3a7d55),_0x3cb782=_0x3a7d55&&_0x145e1d[_0x3492f8(0x1f1)](_0x2b68e3,_0x3a7d55),_0x266da2=_0x3a7d55&&_0x4325ac[_0x3492f8(0x322)](_0x2b68e3,_0x82a542,_0x3a7d55);if(!_0x3a7d55||!_0x4520f6||!_0x3cb782||!_0x266da2)return _0xd5fe0e();let _0x45da55=_0x7518aa(_0x36daac[_0x3492f8(0x3a0)],_0x36daac['startColumn'],_0x4325ac[_0x3492f8(0x3fa)](_0x2b68e3,_0x82a542,_0x36daac['startRow'],_0x36daac['startColumn']),_0x266da2),_0x2d80c8=_0x45da55==null?void 0x0:_0x45da55[_0x3492f8(0x1b1)],_0x4180b1=_0x2d80c8&&_0x4520f6[_0x3492f8(0x4e3)][_0x3492f8(0x434)][_0x2d80c8];if(!_0x2d80c8||!_0x4180b1||!(_0x4520f6[_0x3492f8(0x4e3)]['rowFields'][_0x3492f8(0x444)](_0x2d80c8)||_0x4520f6[_0x3492f8(0x4e3)][_0x3492f8(0x39e)][_0x3492f8(0x444)](_0x2d80c8)))return _0xd5fe0e();let _0x57e189=_0x3cb782['fields'][_0x4180b1[_0x3492f8(0x26a)]];if(!_0x57e189)return _0xd5fe0e();let _0x4f9432=_0x57e189[_0x3492f8(0x1ab)]===_0x45b543[_0x3492f8(0x391)]?_0x57e189:void 0x0;if(!_0x4f9432&&_0x57e189[_0x3492f8(0x1ab)]!==_0x45b543[_0x3492f8(0x242)])return _0xd5fe0e();let _0x278a7f=(_0x4f9432==null?void 0x0:_0x4f9432[_0x3492f8(0x19d)])??_0x57e189['id'];if(((_0x4cee34=_0x3cb782['fields'][_0x278a7f])==null?void 0x0:_0x4cee34['dataFieldType'])!==_0x45b543[_0x3492f8(0x242)])return _0xd5fe0e();let _0x2e9614=Jr((_0x4f9432==null?void 0x0:_0x4f9432[_0x3492f8(0xd0)][_0x3492f8(0x2a1)])??[]),_0x49359f=new Map(),_0x4d570f=new Set(),_0x106c3b=0x0;for(let _0x5bfe4c of _0x4b1445){let {startRow:_0x10ee73,endRow:_0x384339,startColumn:_0x2e9a42,endColumn:_0x42dcfe}=_0x5bfe4c['range'];if(_0x106c3b+=(_0x384339-_0x10ee73+0x1)*(_0x42dcfe-_0x2e9a42+0x1),_0x106c3b>0x200)return _0xd5fe0e();for(let _0x2b311f=_0x10ee73;_0x2b311f<=_0x384339;_0x2b311f++)for(let _0x54637c=_0x2e9a42;_0x54637c<=_0x42dcfe;_0x54637c++){if(_0x4325ac['getPivotTableIdByCell'](_0x2b68e3,_0x82a542,_0x2b311f,_0x54637c)!==_0x3a7d55)return _0xd5fe0e();let _0xfceff1=_0x7518aa(_0x2b311f,_0x54637c,_0x4325ac[_0x3492f8(0x3fa)](_0x2b68e3,_0x82a542,_0x2b311f,_0x54637c),_0x266da2),_0x5d5a16=_0xfceff1==null?void 0x0:_0xfceff1['info'];if(!_0xfceff1||_0xfceff1[_0x3492f8(0x1ec)]!==_0x3492f8(0x4b6)&&_0xfceff1[_0x3492f8(0x1ec)]!==_0x3492f8(0x53e)||_0xfceff1[_0x3492f8(0x1b1)]!==_0x2d80c8||!_0x5d5a16||_0x5d5a16[_0x3492f8(0x410)]||_0x5d5a16[_0x3492f8(0x3ce)]||_0x5d5a16[_0x3492f8(0x3d0)]||_0x5d5a16[_0x3492f8(0x508)]||_0x5d5a16[_0x3492f8(0x178)]&&_0x5d5a16[_0x3492f8(0x178)]!==_0x3492f8(0x35d)||_0x5d5a16[_0x3492f8(0x3f2)]<0x1)return _0xd5fe0e();let _0x45063a=_0x5d5a16[_0x3492f8(0x24d)][_0x5d5a16[_0x3492f8(0x3f2)]-0x1];if(_0x45063a===void 0x0)return _0xd5fe0e();if(_0x4f9432){let _0x4be20f;try{_0x4be20f=JSON[_0x3492f8(0x246)](_0x45063a);}catch{return _0xd5fe0e();}if(!Array[_0x3492f8(0x3fd)](_0x4be20f)||_0x4be20f['length']!==0x2||typeof _0x4be20f[0x1]!='string')return _0xd5fe0e();if(_0x4be20f[0x0]===_0x3492f8(0x399)){if(!_0x2e9614[_0x3492f8(0x156)](_0x5dda24=>_0x5dda24['id']===_0x4be20f[0x1]))return _0xd5fe0e();_0x4d570f[_0x3492f8(0x549)](_0x4be20f[0x1]);continue;}if(_0x4be20f[0x0]!=='member')return _0xd5fe0e();let _0x57e911=Yr(_0x4be20f[0x1]);if(_0x57e911===void 0x0)return _0xd5fe0e();_0x49359f['set'](_0x4be20f[0x1],{'path':_0x57e911,'memberKey':_0x4be20f[0x1]});}else{var _0x5abdf4;let _0x2c8da7=(_0x5abdf4=_0x4325ac['getPivotTableCellData'](_0x2b68e3,_0x82a542,_0x2b311f,_0x54637c))==null?void 0x0:_0x5abdf4['v'],_0x5bb1a0=_0x2c8da7==null||_0x2c8da7===''?_0x5fc13a[_0x3492f8(0x279)]:String(_0x2c8da7);_0x49359f[_0x3492f8(0x11d)](_0x45063a,{'path':_0x5bb1a0,'tupleKey':_0x45063a});}}}return _0x561256==='group'&&(_0x49359f[_0x3492f8(0x23a)]<0x2||_0x4d570f['size']>0x0)||_0x561256!==_0x3492f8(0x399)&&(_0x49359f['size']>0x0||_0x4d570f['size']!==0x1)?_0xd5fe0e():{'context':{'unitId':_0x2b68e3,'subUnitId':_0x82a542,'pivotTableId':_0x3a7d55,'tableFieldId':_0x2d80c8,'sourceFieldId':_0x278a7f,'targetFieldName':_0x4180b1[_0x3492f8(0x10a)],'groups':_0x2e9614,'memberPaths':Array['from'](_0x49359f[_0x3492f8(0x562)]()),'selectedGroupId':Array[_0x3492f8(0x32c)](_0x4d570f)[0x0]}};}function Zr(_0x192b8a,_0x49542c){const _0x5a9b20=_0x1aaa99;return Xr(_0x192b8a,_0x49542c)[_0x5a9b20(0x3d3)];}function Qr(_0x8d78e0,_0x5094b1){const _0x5dbb69=_0x1aaa99;_0x8d78e0[_0x5dbb69(0x210)](_0x2dc350)[_0x5dbb69(0x276)]({'type':_0x3330ef[_0x5dbb69(0x1cf)],'content':_0x8d78e0[_0x5dbb69(0x210)](_0x2129e8)['t'](_0x5dbb69(0xf9)+_0x5094b1)});}function $r(_0x5c9306,_0x42db81,_0x47bcde){const _0x5e8f76=_0x1aaa99;let _0xceb4c2=Zr(_0x5c9306,_0x42db81);return!!_0xceb4c2&&_0xceb4c2['unitId']===_0x47bcde[_0x5e8f76(0xf8)]&&_0xceb4c2[_0x5e8f76(0x19f)]===_0x47bcde[_0x5e8f76(0x19f)]&&_0xceb4c2[_0x5e8f76(0x53d)]===_0x47bcde[_0x5e8f76(0x53d)]&&_0xceb4c2[_0x5e8f76(0x1b1)]===_0x47bcde[_0x5e8f76(0x1b1)]&&_0xceb4c2[_0x5e8f76(0x530)]===_0x47bcde[_0x5e8f76(0x530)]&&_0xceb4c2[_0x5e8f76(0x199)]===_0x47bcde[_0x5e8f76(0x199)]&&JSON[_0x5e8f76(0x42a)](_0xceb4c2['memberPaths'])===JSON[_0x5e8f76(0x42a)](_0x47bcde[_0x5e8f76(0x38e)])&&JSON[_0x5e8f76(0x42a)](_0xceb4c2[_0x5e8f76(0x2a1)])===JSON['stringify'](_0x47bcde[_0x5e8f76(0x2a1)]);}async function ei(_0x1b0d75,_0x1ce496){const _0x2a785b=_0x1aaa99;let _0x3cc453=Xr(_0x1b0d75,_0x1ce496),_0x4224c8=_0x3cc453[_0x2a785b(0x3d3)];if(!_0x4224c8)return Qr(_0x1b0d75,_0x3cc453['error']),!0x1;let _0x46ae75=_0x1b0d75[_0x2a785b(0x210)](_0x344ed3),_0x383e93=_0x46ae75['getPivotTableConfig'](_0x4224c8[_0x2a785b(0xf8)],_0x4224c8[_0x2a785b(0x19f)],_0x4224c8[_0x2a785b(0x53d)]),_0x32a739=_0x46ae75[_0x2a785b(0x1f1)](_0x4224c8[_0x2a785b(0xf8)],_0x4224c8[_0x2a785b(0x53d)]),_0x4ad33b=[];if(_0x1ce496===_0x2a785b(0x399)){try{let _0x751f37=(await _0x1b0d75[_0x2a785b(0x210)](_0x40b8c0)[_0x2a785b(0x1b0)]({'unitId':_0x4224c8[_0x2a785b(0xf8)],'subUnitId':_0x4224c8[_0x2a785b(0x19f)],'pivotTableId':_0x4224c8[_0x2a785b(0x53d)],'params':{'type':_0x4d06ca['ManualGroupMembers'],'manualGroupMembers':{'sourceFieldId':_0x4224c8[_0x2a785b(0x530)],'paths':_0x4224c8[_0x2a785b(0x38e)]}}}))[_0x2a785b(0x149)][_0x2a785b(0x21c)];if(!_0x751f37||_0x751f37['error']||_0x751f37[_0x2a785b(0x2af)]['length']<0x2)return Qr(_0x1b0d75,(_0x751f37==null?void 0x0:_0x751f37[_0x2a785b(0x344)])??'invalidSelection'),!0x1;_0x4ad33b=_0x751f37[_0x2a785b(0x2af)];}catch{return Qr(_0x1b0d75,'invalidSelection'),!0x1;}if(!$r(_0x1b0d75,_0x1ce496,_0x4224c8)||_0x46ae75[_0x2a785b(0x2fa)](_0x4224c8['unitId'],_0x4224c8['subUnitId'],_0x4224c8[_0x2a785b(0x53d)])!==_0x383e93||_0x46ae75[_0x2a785b(0x1f1)](_0x4224c8[_0x2a785b(0xf8)],_0x4224c8[_0x2a785b(0x53d)])!==_0x32a739)return!0x1;}let _0x2d9c33=_0x1b0d75[_0x2a785b(0x210)](_0x4f85fa),_0x1a9ac5=_0x1b0d75[_0x2a785b(0x210)](_0x2129e8),_0x356ac4=_0x4224c8[_0x2a785b(0x2a1)][_0x2a785b(0x55a)](_0x2c4233=>_0x2c4233['id']===_0x4224c8[_0x2a785b(0x199)]),_0x10089d=(_0x356ac4==null?void 0x0:_0x356ac4['name'])??_0x1a9ac5['t'](_0x2a785b(0x4f0),String(_0x4224c8['groups']['length']+0x1));if(!_0x356ac4){let _0x519810=_0x4224c8[_0x2a785b(0x2a1)][_0x2a785b(0x483)]+0x1;for(;_0x4224c8[_0x2a785b(0x2a1)][_0x2a785b(0x156)](_0x29d807=>_0x29d807['name']===_0x10089d);)_0x519810++,_0x10089d=_0x1a9ac5['t'](_0x2a785b(0x4f0),String(_0x519810));}let _0xfb9c0e=null,_0x408895=!0x1,_0x3d2308=!0x1,_0x3726e0=()=>{const _0x40d43c=_0x2a785b;_0x408895||(_0x408895=!0x0,_0xfb9c0e==null||_0xfb9c0e[_0x40d43c(0x144)](),_0xfb9c0e=null);},_0x5e69fc=async _0x4073ff=>{const _0x1cb0a0=_0x2a785b;if(_0x3d2308||_0x408895)return;let _0x66b51=_0x4073ff[_0x1cb0a0(0x311)]();if(!_0x66b51||_0x4224c8[_0x1cb0a0(0x2a1)]['some'](_0xaca40a=>_0xaca40a[_0x1cb0a0(0x372)]===_0x66b51&&_0xaca40a['id']!==_0x4224c8[_0x1cb0a0(0x199)]))Qr(_0x1b0d75,_0x1cb0a0(0x100));else{_0x3d2308=!0x0;try{if(!$r(_0x1b0d75,_0x1ce496,_0x4224c8)||_0x46ae75[_0x1cb0a0(0x2fa)](_0x4224c8[_0x1cb0a0(0xf8)],_0x4224c8[_0x1cb0a0(0x19f)],_0x4224c8[_0x1cb0a0(0x53d)])!==_0x383e93||_0x46ae75['getCollection'](_0x4224c8[_0x1cb0a0(0xf8)],_0x4224c8[_0x1cb0a0(0x53d)])!==_0x32a739)return;let _0x2ec3fc=_0x1ce496===_0x1cb0a0(0x399)?_0x4224c8[_0x1cb0a0(0x2a1)][_0x1cb0a0(0x208)]({'id':_0x11168c(),'name':_0x66b51,'members':_0x4ad33b[_0x1cb0a0(0x15d)](_0x66bf66=>({..._0x66bf66}))}):_0x4224c8[_0x1cb0a0(0x2a1)][_0x1cb0a0(0x15d)](_0x28fa3b=>_0x28fa3b['id']===_0x4224c8[_0x1cb0a0(0x199)]?{..._0x28fa3b,'name':_0x66b51}:_0x28fa3b);await _0x1b0d75[_0x1cb0a0(0x210)](_0x12babc)[_0x1cb0a0(0x4e2)](_0x3804bf['id'],{'unitId':_0x4224c8[_0x1cb0a0(0xf8)],'subUnitId':_0x4224c8[_0x1cb0a0(0x19f)],'pivotTableId':_0x4224c8['pivotTableId'],'sourceFieldId':_0x4224c8[_0x1cb0a0(0x530)],'groups':_0x2ec3fc});}catch{}finally{_0x3726e0();}}};try{_0xfb9c0e=_0x2d9c33[_0x2a785b(0x22d)]({'id':'UNIVER_SHEET_PIVOT_MANUAL_GROUP_DIALOG_ID','title':{'title':_0x1a9ac5['t'](_0x1ce496===_0x2a785b(0x399)?_0x2a785b(0x163):_0x2a785b(0x32a))},'draggable':!0x0,'mask':!0x0,'maskClosable':!0x1,'width':0x190,'children':{'label':{'name':Lr,'props':{'name':_0x10089d,'onConfirm':_0x5e69fc,'onCancel':_0x3726e0}}},'onClose':_0x3726e0});}catch{return _0x3726e0(),!0x1;}return!0x0;}const ti={'id':_0x1aaa99(0x427),'type':_0xe4a01[_0x1aaa99(0x384)],'handler':_0x30fb36=>ei(_0x30fb36,_0x1aaa99(0x399))},ni={'id':_0x1aaa99(0x4bc),'type':_0xe4a01[_0x1aaa99(0x384)],'handler':_0x1101a6=>ei(_0x1101a6,_0x1aaa99(0x305))},ri={'id':_0x1aaa99(0x185),'type':_0xe4a01['OPERATION'],async 'handler'(_0xc6a790){const _0x4f0aa6=_0x1aaa99;let _0x3fa9c5=Xr(_0xc6a790,_0x4f0aa6(0x392)),_0x107301=_0x3fa9c5[_0x4f0aa6(0x3d3)];if(!_0x107301)return Qr(_0xc6a790,_0x3fa9c5[_0x4f0aa6(0x344)]),!0x1;let _0x1daa7c=_0xc6a790['get'](_0x344ed3),_0x3a5692=_0x1daa7c[_0x4f0aa6(0x2fa)](_0x107301[_0x4f0aa6(0xf8)],_0x107301[_0x4f0aa6(0x19f)],_0x107301[_0x4f0aa6(0x53d)]),_0x112457=_0x1daa7c[_0x4f0aa6(0x1f1)](_0x107301[_0x4f0aa6(0xf8)],_0x107301[_0x4f0aa6(0x53d)]);return!$r(_0xc6a790,_0x4f0aa6(0x392),_0x107301)||_0x1daa7c[_0x4f0aa6(0x2fa)](_0x107301['unitId'],_0x107301[_0x4f0aa6(0x19f)],_0x107301[_0x4f0aa6(0x53d)])!==_0x3a5692||_0x1daa7c[_0x4f0aa6(0x1f1)](_0x107301[_0x4f0aa6(0xf8)],_0x107301[_0x4f0aa6(0x53d)])!==_0x112457?!0x1:_0xc6a790['get'](_0x12babc)['executeCommand'](_0x3804bf['id'],{'unitId':_0x107301[_0x4f0aa6(0xf8)],'subUnitId':_0x107301[_0x4f0aa6(0x19f)],'pivotTableId':_0x107301['pivotTableId'],'sourceFieldId':_0x107301[_0x4f0aa6(0x530)],'groups':_0x107301[_0x4f0aa6(0x2a1)][_0x4f0aa6(0x474)](_0x5670f4=>_0x5670f4['id']!==_0x107301[_0x4f0aa6(0x199)])});}};function ii(_0x4b8d8f){const _0x29a966=_0x1aaa99;return typeof _0x4b8d8f[_0x29a966(0xc4)]==_0x29a966(0x409)&&typeof _0x4b8d8f[_0x29a966(0x404)]==_0x29a966(0x409)&&Number[_0x29a966(0x3f4)](_0x4b8d8f[_0x29a966(0x3f3)])&&_0x4b8d8f[_0x29a966(0x3f3)]>0x0&&(_0x4b8d8f['start']===void 0x0||Number['isFinite'](_0x4b8d8f[_0x29a966(0x465)]))&&(_0x4b8d8f[_0x29a966(0x419)]===void 0x0||Number[_0x29a966(0x3f4)](_0x4b8d8f[_0x29a966(0x419)]))&&(_0x4b8d8f[_0x29a966(0xc4)]||_0x4b8d8f[_0x29a966(0x465)]!==void 0x0)&&(_0x4b8d8f[_0x29a966(0x404)]||_0x4b8d8f[_0x29a966(0x419)]!==void 0x0)&&(_0x4b8d8f['start']===void 0x0||_0x4b8d8f[_0x29a966(0x419)]===void 0x0||_0x4b8d8f[_0x29a966(0x465)]<=_0x4b8d8f[_0x29a966(0x419)]);}function ai(_0x439ef3,_0x21ba87){const _0x40c84c=_0x1aaa99;if(_0x439ef3[_0x40c84c(0x1ab)]===_0x45b543[_0x40c84c(0x4dd)]){let _0x2dc731=_0x439ef3,_0x126833=_0x21ba87[_0x40c84c(0x479)][_0x2dc731[_0x40c84c(0x19d)]];return!_0x126833||_0x126833[_0x40c84c(0x1ab)]!==_0x45b543[_0x40c84c(0x242)]||_0x126833[_0x40c84c(0x2a5)]!==_0xe427cd['number']?void 0x0:{'sourceFieldId':_0x2dc731[_0x40c84c(0x19d)],'grouping':{..._0x2dc731[_0x40c84c(0xd0)]}};}if(_0x439ef3[_0x40c84c(0x1ab)]===_0x45b543[_0x40c84c(0x242)]&&_0x439ef3['fieldDataType']===_0xe427cd[_0x40c84c(0x4b4)])return{'sourceFieldId':_0x439ef3['id']};}function oi(_0x430e46){const _0x50ddab=_0x1aaa99;var _0x46af00;let _0x2f455f=_0x16d892(_0x430e46['get'](_0x570eee)),_0x1cddd8=(_0x46af00=_0x430e46[_0x50ddab(0x210)](_0x2f649b)[_0x50ddab(0x19b)]())==null?void 0x0:_0x46af00[_0x50ddab(0xc5)];if(!_0x2f455f||!_0x1cddd8)return;let {unitId:_0x2ee706,subUnitId:_0x514b9d}=_0x2f455f,_0x4b16ee=_0x1cddd8[_0x50ddab(0x3a0)],_0x4bff08=_0x1cddd8[_0x50ddab(0x401)],_0x5048bc=_0x430e46[_0x50ddab(0x210)](_0x131a27),_0x5464dd=_0x5048bc[_0x50ddab(0xc8)](_0x2ee706,_0x514b9d,_0x4b16ee,_0x4bff08);if(!_0x5464dd)return;let _0xe41609=_0x5048bc['getPivotItemRenderInfoCache'](_0x2ee706,_0x514b9d,_0x5464dd);if(!_0xe41609)return;let _0xae3b9f=_0x7518aa(_0x4b16ee,_0x4bff08,_0x5048bc[_0x50ddab(0x3fa)](_0x2ee706,_0x514b9d,_0x4b16ee,_0x4bff08),_0xe41609),_0x43669b=_0xae3b9f==null?void 0x0:_0xae3b9f[_0x50ddab(0x1b1)];if(!_0x43669b||_0xae3b9f[_0x50ddab(0x1ec)]!==_0x50ddab(0x4b6)&&_0xae3b9f['area']!==_0x50ddab(0x53e))return;let _0x1e6cfc=_0x430e46[_0x50ddab(0x210)](_0x344ed3),_0x23808a=_0x1e6cfc[_0x50ddab(0x2fa)](_0x2ee706,_0x514b9d,_0x5464dd),_0x55d821=_0x1e6cfc[_0x50ddab(0x1f1)](_0x2ee706,_0x5464dd),_0x198258=_0x23808a==null?void 0x0:_0x23808a[_0x50ddab(0x4e3)]['dimension'][_0x43669b];if(!_0x198258||!_0x55d821||!(_0x23808a[_0x50ddab(0x4e3)][_0x50ddab(0x12b)][_0x50ddab(0x444)](_0x43669b)||_0x23808a[_0x50ddab(0x4e3)][_0x50ddab(0x39e)][_0x50ddab(0x444)](_0x43669b)))return;let _0x5b2dca=_0x55d821[_0x50ddab(0x479)][_0x198258['dataFieldId']];if(!_0x5b2dca)return;let _0x1b5d08=ai(_0x5b2dca,_0x55d821);if(_0x1b5d08)return{'unitId':_0x2ee706,'subUnitId':_0x514b9d,'pivotTableId':_0x5464dd,'tableFieldId':_0x43669b,'targetFieldName':_0x198258[_0x50ddab(0x10a)],..._0x1b5d08};}const si={'id':_0x1aaa99(0x157),'type':_0xe4a01['OPERATION'],async 'handler'(_0x56dfd0){const _0x17c879=_0x1aaa99;let _0x2070c0=oi(_0x56dfd0);if(!_0x2070c0)return!0x1;let _0x38510d=_0x56dfd0[_0x17c879(0x210)](_0x344ed3),_0x5d8cfd=_0x38510d[_0x17c879(0x1f1)](_0x2070c0[_0x17c879(0xf8)],_0x2070c0[_0x17c879(0x53d)]),_0x3ffd30=_0x38510d[_0x17c879(0x2fa)](_0x2070c0['unitId'],_0x2070c0['subUnitId'],_0x2070c0[_0x17c879(0x53d)]),_0x4d40cd=_0x56dfd0[_0x17c879(0x210)](_0x570eee),_0x24ef7e=()=>{const _0x2be507=_0x17c879;let _0x252aa8=oi(_0x56dfd0);return!!_0x252aa8&&_0x252aa8[_0x2be507(0xf8)]===_0x2070c0[_0x2be507(0xf8)]&&_0x252aa8[_0x2be507(0x19f)]===_0x2070c0[_0x2be507(0x19f)]&&_0x252aa8[_0x2be507(0x53d)]===_0x2070c0[_0x2be507(0x53d)]&&_0x252aa8[_0x2be507(0x1b1)]===_0x2070c0[_0x2be507(0x1b1)]&&_0x252aa8['sourceFieldId']===_0x2070c0[_0x2be507(0x530)]&&JSON[_0x2be507(0x42a)](_0x252aa8[_0x2be507(0xd0)])===JSON[_0x2be507(0x42a)](_0x2070c0['grouping']);},_0x59c532=_0x56dfd0['get'](_0x4f85fa),_0x32bdb5=_0x56dfd0['get'](_0x2129e8),_0x8c20ca=null,_0x2fe360=!0x1,_0x15daef=!0x1,_0x5340be=new _0x55b11a(),_0x5656a5=async()=>{const _0x3c4a26=_0x17c879;if(!_0x2fe360&&_0x24ef7e())try{let _0x44aedb=(await _0x56dfd0[_0x3c4a26(0x210)](_0x40b8c0)[_0x3c4a26(0x1b0)]({'unitId':_0x2070c0[_0x3c4a26(0xf8)],'subUnitId':_0x2070c0[_0x3c4a26(0x19f)],'pivotTableId':_0x2070c0[_0x3c4a26(0x53d)],'params':{'type':_0x4d06ca['NumberGroupDefaults'],'numberGroupDefaults':{'tableFieldId':_0x2070c0[_0x3c4a26(0x1b1)]}}}))[_0x3c4a26(0x149)][_0x3c4a26(0x2bd)];return!_0x2fe360&&_0x24ef7e()&&_0x44aedb&&ii(_0x44aedb)?_0x44aedb:void 0x0;}catch{return;}},_0x5c54af=()=>{const _0x177e0e=_0x17c879;_0x2fe360||(_0x2fe360=!0x0,_0x5340be[_0x177e0e(0xf7)](),_0x5340be[_0x177e0e(0x18a)](),_0x8c20ca==null||_0x8c20ca[_0x177e0e(0x144)](),_0x8c20ca=null);},_0x18f69c=await _0x5656a5();if(!_0x18f69c)return _0x5c54af(),!0x1;let _0x5cfd58=_0x4d40cd[_0x17c879(0x261)][_0x17c879(0x49b)](_0x36bc5f(_0x36f890=>_0x36f890[_0x17c879(0x10b)]()===_0x2070c0[_0x17c879(0xf8)]),_0x26841e(_0x5c54af)),_0x3c9e1c=_0x2e2635(()=>{const _0x3ec4fd=_0x17c879;if(_0x2fe360||!_0x4d40cd[_0x3ec4fd(0x29e)](_0x2070c0[_0x3ec4fd(0xf8)]))return _0x5c54af(),_0x161fd7;let _0x90768=_0x38510d['watchPivotTableChanges'](_0x2070c0[_0x3ec4fd(0xf8)],_0x2070c0['subUnitId'],_0x2070c0[_0x3ec4fd(0x53d)])[_0x3ec4fd(0x49b)](_0xef7484(0x0),_0x245ce1(()=>void 0x0));return _0x2a5b68(_0x10b67b(_0x18f69c),_0x90768)[_0x3ec4fd(0x49b)](_0x449d61(_0x434284=>_0x434284&&_0x38510d[_0x3ec4fd(0x1f1)](_0x2070c0[_0x3ec4fd(0xf8)],_0x2070c0[_0x3ec4fd(0x53d)])===_0x5d8cfd&&_0x38510d[_0x3ec4fd(0x2fa)](_0x2070c0['unitId'],_0x2070c0['subUnitId'],_0x2070c0['pivotTableId'])===_0x3ffd30?_0x10b67b(_0x434284):_0x484ccd(_0x10b67b(void 0x0),_0x5656a5())),_0x2ddc83(_0x2a5b68(_0x5340be,_0x5cfd58)));}),_0x97fb56=async _0x535a41=>{const _0x202963=_0x17c879;if(!(_0x15daef||_0x2fe360)){_0x15daef=!0x0;try{if(!ii(_0x535a41)||!_0x24ef7e())return;await _0x56dfd0[_0x202963(0x210)](_0x12babc)[_0x202963(0x4e2)](_0x499607['id'],{'unitId':_0x2070c0[_0x202963(0xf8)],'subUnitId':_0x2070c0[_0x202963(0x19f)],'pivotTableId':_0x2070c0[_0x202963(0x53d)],'tableFieldId':_0x2070c0[_0x202963(0x1b1)],'grouping':{..._0x535a41}});}catch{}finally{_0x5c54af();}}};try{_0x8c20ca=_0x59c532[_0x17c879(0x22d)]({'id':_0x17c879(0x54c),'title':{'title':_0x32bdb5['t'](_0x17c879(0x3a2))},'draggable':!0x0,'mask':!0x0,'maskClosable':!0x1,'width':0x190,'children':{'label':{'name':Ir,'props':{'targetFieldName':_0x2070c0['targetFieldName'],'grouping':_0x2070c0[_0x17c879(0xd0)],'defaults$':_0x3c9e1c,'onConfirm':_0x97fb56,'onCancel':_0x5c54af}}},'onClose':_0x5c54af});}catch{return _0x5c54af(),!0x1;}return!0x0;}},ci=[{'type':_0x3c9058[_0x1aaa99(0x37b)],'localeKey':_0x1aaa99(0x516),'requiresParameters':!0x1,'baseItemMode':_0x1aaa99(0x557)},{'type':_0x3c9058[_0x1aaa99(0x4db)],'localeKey':_0x1aaa99(0x233),'requiresParameters':!0x1,'baseItemMode':_0x1aaa99(0x557)},{'type':_0x3c9058[_0x1aaa99(0x25f)],'localeKey':_0x1aaa99(0x543),'requiresParameters':!0x1,'baseItemMode':'none'},{'type':_0x3c9058[_0x1aaa99(0x502)],'localeKey':_0x1aaa99(0xc3),'requiresParameters':!0x1,'baseItemMode':'none'},{'type':_0x3c9058['percentOfParentRowTotal'],'localeKey':'sheets-pivot-ui.showValuesAs.percentOfParentRowTotal','requiresParameters':!0x1,'baseItemMode':'none'},{'type':_0x3c9058['percentOfParentColumnTotal'],'localeKey':_0x1aaa99(0x403),'requiresParameters':!0x1,'baseItemMode':'none'},{'type':_0x3c9058[_0x1aaa99(0x415)],'localeKey':_0x1aaa99(0x266),'requiresParameters':!0x1,'baseItemMode':_0x1aaa99(0x557)},{'type':_0x3c9058[_0x1aaa99(0x18f)],'localeKey':_0x1aaa99(0x3b3),'requiresParameters':!0x0,'baseItemMode':_0x1aaa99(0x557),'parentFieldOnly':!0x0},{'type':_0x3c9058[_0x1aaa99(0x15e)],'localeKey':'sheets-pivot-ui.showValuesAs.percentOf','requiresParameters':!0x0,'baseItemMode':_0x1aaa99(0x35d)},{'type':_0x3c9058[_0x1aaa99(0x50f)],'localeKey':_0x1aaa99(0xbe),'requiresParameters':!0x0,'baseItemMode':_0x1aaa99(0x3e4)},{'type':_0x3c9058[_0x1aaa99(0x535)],'localeKey':_0x1aaa99(0x453),'requiresParameters':!0x0,'baseItemMode':_0x1aaa99(0x3e4)},{'type':_0x3c9058['runningTotal'],'localeKey':_0x1aaa99(0x13f),'requiresParameters':!0x0,'baseItemMode':'none'},{'type':_0x3c9058[_0x1aaa99(0x41b)],'localeKey':_0x1aaa99(0x361),'requiresParameters':!0x0,'baseItemMode':'none'},{'type':_0x3c9058[_0x1aaa99(0x355)],'localeKey':_0x1aaa99(0x27e),'requiresParameters':!0x0,'baseItemMode':_0x1aaa99(0x557)},{'type':_0x3c9058[_0x1aaa99(0x3d7)],'localeKey':_0x1aaa99(0x504),'requiresParameters':!0x0,'baseItemMode':_0x1aaa99(0x557)}],li={'type':_0xe4a01[_0x1aaa99(0x384)],'id':_0x1aaa99(0x24f),async 'handler'(_0x24bb40,_0x5579b6){const _0x507882=_0x1aaa99;let _0x3b4c29=_0x5579b6&&ci[_0x507882(0x55a)](_0x24eaec=>_0x24eaec[_0x507882(0x155)]===_0x5579b6[_0x507882(0x155)]);if(!_0x3b4c29)return!0x1;let _0x3dbb56=di(_0x24bb40);if(!_0x3dbb56)return!0x1;if(!_0x3b4c29[_0x507882(0x278)])return _0x24bb40[_0x507882(0x210)](_0x12babc)[_0x507882(0x4e2)](_0x2d9543['id'],{'unitId':_0x3dbb56['unitId'],'subUnitId':_0x3dbb56[_0x507882(0x19f)],'pivotTableId':_0x3dbb56[_0x507882(0x53d)],'tableFieldId':_0x3dbb56[_0x507882(0x1b1)],'showDataAs':{'type':_0x3b4c29['type'],'baseFieldId':'','baseItem':''},'tableFieldInfo':_0x3dbb56[_0x507882(0x285)],'dataFieldInfo':_0x3dbb56['dataFieldInfo']});let _0x3de702=fi(_0x24bb40,_0x3dbb56);if(!_0x3de702)return!0x1;let _0x4ba3f0=ui(_0x3de702[_0x507882(0xbd)],_0x3de702[_0x507882(0x159)],_0x3b4c29);if(_0x4ba3f0[_0x507882(0x483)]===0x0)return!0x1;let _0x13a158={};if(_0x3b4c29[_0x507882(0x478)]!==_0x507882(0x557)){try{_0x13a158=await pi(_0x24bb40,_0x3de702[_0x507882(0xbd)],_0x3dbb56[_0x507882(0x53d)],_0x4ba3f0);}catch{return!0x1;}if(!_0x4ba3f0['some'](_0x1e10a9=>_0x13a158[_0x1e10a9]&&(_0x3b4c29[_0x507882(0x478)]==='item-or-relative'||_0x13a158[_0x1e10a9][_0x507882(0x14e)]['length']>0x0)))return!0x1;}let _0x3da267=_0x24bb40[_0x507882(0x210)](_0x4f85fa),_0x5cf513=_0x24bb40[_0x507882(0x210)](_0x2129e8),_0x1ca9a9=null,_0x27c4f9=!0x1,_0x5e4164=!0x1,_0x4bdbdc=()=>{_0x27c4f9||(_0x27c4f9=!0x0,_0x1ca9a9==null||_0x1ca9a9['dispose'](),_0x1ca9a9=null);};try{_0x1ca9a9=_0x3da267[_0x507882(0x22d)]({'id':'UNIVER_SHEET_PIVOT_SHOW_DATA_AS_DIALOG_ID','title':{'title':_0x5cf513['t'](_0x507882(0x123))},'draggable':!0x0,'mask':!0x0,'maskClosable':!0x1,'width':0x190,'children':{'label':{'name':Nr,'props':{'unitId':_0x3dbb56['unitId'],'subUnitId':_0x3dbb56[_0x507882(0x19f)],'pivotTableId':_0x3dbb56[_0x507882(0x53d)],'tableFieldId':_0x3dbb56[_0x507882(0x1b1)],'type':_0x3b4c29['type'],'baseItems':_0x13a158,'onCancel':_0x4bdbdc,'onConfirm':async _0x2012c8=>{const _0x5bf466=_0x507882;if(!_0x5e4164){_0x5e4164=!0x0;try{let _0x240720=fi(_0x24bb40,_0x3dbb56);if(!_0x240720||!mi(_0x240720[_0x5bf466(0xbd)],_0x240720[_0x5bf466(0x159)],_0x3b4c29,_0x2012c8))return;if(_0x3b4c29[_0x5bf466(0x478)]!==_0x5bf466(0x557)&&_0x2012c8[_0x5bf466(0x1a9)]===void 0x0){var _0x58e5db;if(!((_0x58e5db=(await pi(_0x24bb40,_0x240720['config'],_0x240720[_0x5bf466(0x3d3)][_0x5bf466(0x53d)],[_0x2012c8['baseFieldId']]))[_0x2012c8['baseFieldId']])!=null&&_0x58e5db[_0x5bf466(0x14e)][_0x5bf466(0x444)](_0x2012c8['baseItem'])))return;}await _0x24bb40[_0x5bf466(0x210)](_0x12babc)[_0x5bf466(0x4e2)](_0x2d9543['id'],{'unitId':_0x240720['context']['unitId'],'subUnitId':_0x240720['context'][_0x5bf466(0x19f)],'pivotTableId':_0x240720['context'][_0x5bf466(0x53d)],'tableFieldId':_0x240720[_0x5bf466(0x3d3)][_0x5bf466(0x1b1)],'showDataAs':_0x2012c8,'tableFieldInfo':_0x240720[_0x5bf466(0x3d3)][_0x5bf466(0x285)],'dataFieldInfo':_0x240720[_0x5bf466(0x3d3)][_0x5bf466(0x2a9)]});}catch{}finally{_0x4bdbdc();}}}}}},'onClose':_0x4bdbdc});}catch{return _0x4bdbdc(),!0x1;}return!0x0;}};function ui(_0x248a4d,_0x279b0d,_0x253089){const _0x884b0e=_0x1aaa99;let {rowFields:_0x20039b,columnFields:_0x4d1769,dimension:_0x2f3819}=_0x248a4d[_0x884b0e(0x4e3)];return(_0x253089[_0x884b0e(0x27f)]?[..._0x20039b[_0x884b0e(0x1d1)](0x0,-0x1),..._0x4d1769[_0x884b0e(0x1d1)](0x0,-0x1)]:[..._0x20039b,..._0x4d1769])[_0x884b0e(0x474)](_0x3f2d92=>{const _0x3d264e=_0x884b0e;let _0x4cc1ff=_0x2f3819[_0x3f2d92];return!!(_0x4cc1ff&&(_0x279b0d[_0x3d264e(0x479)][_0x4cc1ff[_0x3d264e(0x26a)]]||_0x279b0d[_0x3d264e(0x280)][_0x3d264e(0x55a)](_0x158727=>_0x158727['id']===_0x4cc1ff[_0x3d264e(0x26a)])));});}function di(_0x3d783e){const _0x59bb94=_0x1aaa99;var _0x21e543,_0x18f0b7;let _0x43a53e=_0x16d892(_0x3d783e[_0x59bb94(0x210)](_0x570eee)),_0x9da3da=(_0x21e543=_0x3d783e[_0x59bb94(0x210)](_0x2f649b)[_0x59bb94(0x19b)]())==null?void 0x0:_0x21e543[_0x59bb94(0xc5)];if(!_0x43a53e||!_0x9da3da)return;let {unitId:_0x481132,subUnitId:_0xc254bf}=_0x43a53e,_0x5e2511=_0x9da3da[_0x59bb94(0x3a0)],_0x51c0f8=_0x9da3da['startColumn'],_0x5e0b85=_0x3d783e[_0x59bb94(0x210)](_0x131a27),_0x334373=_0x5e0b85['getPivotTableIdByCell'](_0x481132,_0xc254bf,_0x5e2511,_0x51c0f8);if(!_0x334373)return;let _0x2c969f=_0x3d783e['get'](_0x344ed3)[_0x59bb94(0x2fa)](_0x481132,_0xc254bf,_0x334373),_0x3f7a9e=_0x5e0b85['getPivotItemRenderInfoCache'](_0x481132,_0xc254bf,_0x334373),_0x5af2a3=_0x5e0b85[_0x59bb94(0x3fa)](_0x481132,_0xc254bf,_0x5e2511,_0x51c0f8);if(!_0x2c969f||!_0x3f7a9e)return;let _0x1446de=_0x7518aa(_0x5e2511,_0x51c0f8,_0x5af2a3,_0x3f7a9e);if(!_0x1446de)return;let _0x5a28d0=_0x282bd5(_0x1446de,_0x2c969f['fieldsConfig'][_0x59bb94(0x3c1)]);if(_0x5a28d0)return(_0x18f0b7=fi(_0x3d783e,{'unitId':_0x481132,'subUnitId':_0xc254bf,'pivotTableId':_0x334373,'tableFieldId':_0x5a28d0}))==null?void 0x0:_0x18f0b7['context'];}function fi(_0x48cd1f,_0xc9ddf2){const _0x4e32a8=_0x1aaa99;let {unitId:_0x4c7826,subUnitId:_0x5985ad,pivotTableId:_0xc5d692,tableFieldId:_0x2a7d0a}=_0xc9ddf2,_0x9a14c=_0x48cd1f['get'](_0x344ed3),_0x421146=_0x9a14c[_0x4e32a8(0x2fa)](_0x4c7826,_0x5985ad,_0xc5d692),_0x58195c=_0x9a14c[_0x4e32a8(0x1f1)](_0x4c7826,_0xc5d692),_0x2e8382=_0x421146==null?void 0x0:_0x421146[_0x4e32a8(0x4e3)][_0x4e32a8(0x2d3)][_0x2a7d0a];if(!_0x421146||!_0x58195c||!_0x2e8382||!_0x421146[_0x4e32a8(0x4e3)][_0x4e32a8(0x3c1)]['includes'](_0x2e8382['id']))return;let _0x4176e0=_0x58195c[_0x4e32a8(0x479)][_0x2e8382['dataFieldId']]??_0x58195c['customFields']['find'](_0x288a5d=>_0x288a5d['id']===_0x2e8382[_0x4e32a8(0x26a)]);if(!_0x4176e0)return;let _0x19ce94={..._0x2e8382[_0x4e32a8(0x22f)]};return{'config':_0x421146,'collection':_0x58195c,'context':{'unitId':_0x4c7826,'subUnitId':_0x5985ad,'pivotTableId':_0xc5d692,'tableFieldId':_0x2e8382['id'],'currentShowDataAs':_0x19ce94,'tableFieldInfo':{'tableFieldId':_0x2e8382['id'],'displayName':_0x2e8382[_0x4e32a8(0x10a)],'dataFieldId':_0x2e8382[_0x4e32a8(0x26a)],'format':_0x2e8382['format'],'subTotalType':_0x2e8382['subtotal'],'showDataAs':{..._0x19ce94}},'dataFieldInfo':{'id':_0x4176e0['id'],'dataFieldId':_0x4176e0['id'],'name':_0x4176e0['name'],'type':_0x4176e0['fieldDataType'],'checked':!0x0,'pivotTableId':_0xc5d692}}};}async function pi(_0x3d732e,_0x3c2a7a,_0x2474a2,_0x269330){const _0x2aee08=_0x1aaa99;let {unitId:_0x447da2,subUnitId:_0x1e130a}=_0x3c2a7a[_0x2aee08(0x217)],_0x34bb5a=_0x3c2a7a[_0x2aee08(0x217)],_0x2104cf=_0x3d732e['get'](_0x131a27)['getPivotItemRenderInfoCache'](_0x447da2,_0x1e130a,_0x2474a2);if(!_0x2104cf)throw Error(_0x2aee08(0x3aa));return(await Promise[_0x2aee08(0x2cf)](_0x269330[_0x2aee08(0x15d)](async _0x1d670f=>{const _0x49389d=_0x2aee08;try{return[_0x1d670f,(await _0x3d732e[_0x49389d(0x210)](_0x40b8c0)[_0x49389d(0x1b0)]({'unitId':_0x447da2,'subUnitId':_0x1e130a,'pivotTableId':_0x2474a2,'params':{'type':_0x4d06ca[_0x49389d(0x1dc)],'filter':{'row':_0x34bb5a[_0x49389d(0x220)],'col':_0x34bb5a['col'],'tableFieldId':_0x1d670f,'pivotItemRenderInfoCache':_0x2104cf}}}))[_0x49389d(0x149)]['filter']];}catch{return[_0x1d670f,void 0x0];}})))[_0x2aee08(0x424)]((_0x5df508,[_0x30c63f,_0x4ebb9a])=>(_0x4ebb9a&&(_0x5df508[_0x30c63f]={'items':_0x4ebb9a['items'],'itemTypes':_0x4ebb9a['itemTypes'],..._0x4ebb9a[_0x2aee08(0x38b)]?{'itemLabels':_0x4ebb9a[_0x2aee08(0x38b)]}:{},'format':_0x4ebb9a['format']}),_0x5df508),{});}function mi(_0x294aa4,_0x31d376,_0xc17206,_0x42b2b8){const _0x33a2d7=_0x1aaa99;return _0x42b2b8[_0x33a2d7(0x155)]!==_0xc17206[_0x33a2d7(0x155)]||!ui(_0x294aa4,_0x31d376,_0xc17206)[_0x33a2d7(0x444)](_0x42b2b8[_0x33a2d7(0x378)])?!0x1:_0xc17206['baseItemMode']===_0x33a2d7(0x557)?_0x42b2b8['baseItem']===''&&_0x42b2b8[_0x33a2d7(0x1a9)]===void 0x0:_0x42b2b8[_0x33a2d7(0x1a9)]===void 0x0?_0x42b2b8[_0x33a2d7(0x256)]!=='':_0xc17206[_0x33a2d7(0x478)]===_0x33a2d7(0x3e4)&&_0x42b2b8['baseItem']===''&&(_0x42b2b8[_0x33a2d7(0x1a9)]===_0x469ab7['previous']||_0x42b2b8[_0x33a2d7(0x1a9)]===_0x469ab7[_0x33a2d7(0xf7)]);}function hi(_0x22a62f){const _0x32095a=_0x1aaa99;return{..._0x22a62f,'expected':Array['isArray'](_0x22a62f[_0x32095a(0x2c9)])?_0x22a62f['expected']['concat']():_0x22a62f[_0x32095a(0x2c9)]};}function gi(_0x43488a,_0x2aae93){const _0x18db3b=_0x1aaa99;let _0x16ea3e=_0x43488a[_0x18db3b(0x210)](_0x344ed3)[_0x18db3b(0x2fa)](_0x2aae93['unitId'],_0x2aae93[_0x18db3b(0x19f)],_0x2aae93[_0x18db3b(0x53d)]);if(_0x16ea3e&&_0x16ea3e['fieldsConfig'][_0x18db3b(0x434)][_0x2aae93[_0x18db3b(0x36a)]]&&(_0x16ea3e[_0x18db3b(0x4e3)][_0x18db3b(0x12b)][_0x18db3b(0x444)](_0x2aae93[_0x18db3b(0x36a)])||_0x16ea3e[_0x18db3b(0x4e3)][_0x18db3b(0x39e)]['includes'](_0x2aae93[_0x18db3b(0x36a)])))return _0x16ea3e;}function _i(_0x10efa4){const _0x1902b8=_0x1aaa99;var _0x3052f0,_0x767e14;let _0x511397=_0x16d892(_0x10efa4['get'](_0x570eee)),_0x5d4b4b=(_0x3052f0=_0x10efa4[_0x1902b8(0x210)](_0x2f649b)[_0x1902b8(0x19b)]())==null?void 0x0:_0x3052f0[_0x1902b8(0xc5)];if(!_0x511397||!_0x5d4b4b)return;let {unitId:_0x5dd6db,subUnitId:_0x570b0e}=_0x511397,_0x3ad72b=_0x5d4b4b['startRow'],_0x4e0927=_0x5d4b4b['startColumn'],_0x2355f0=_0x10efa4[_0x1902b8(0x210)](_0x131a27),_0x4f5c9e=_0x2355f0[_0x1902b8(0xc8)](_0x5dd6db,_0x570b0e,_0x3ad72b,_0x4e0927);if(!_0x4f5c9e)return;let _0x4cad2f=_0x10efa4['get'](_0x344ed3)[_0x1902b8(0x2fa)](_0x5dd6db,_0x570b0e,_0x4f5c9e),_0x512ea0=_0x2355f0[_0x1902b8(0x322)](_0x5dd6db,_0x570b0e,_0x4f5c9e);if(!_0x4cad2f||!_0x512ea0)return;let _0x16f890=_0x7518aa(_0x3ad72b,_0x4e0927,_0x2355f0[_0x1902b8(0x3fa)](_0x5dd6db,_0x570b0e,_0x3ad72b,_0x4e0927),_0x512ea0),_0x74f0d6=_0x16f890&&_0xb556f0(_0x16f890,_0x4cad2f[_0x1902b8(0x4e3)]);if(!_0x74f0d6)return;let _0x615760=_0x4cad2f[_0x1902b8(0x4e3)][_0x1902b8(0x434)][_0x74f0d6[_0x1902b8(0x36a)]],_0x296e7d=_0x4cad2f[_0x1902b8(0x4e3)][_0x1902b8(0x3c1)]['flatMap'](_0x16a406=>{const _0x1abcc9=_0x1902b8;let _0x394c55=_0x4cad2f[_0x1abcc9(0x4e3)][_0x1abcc9(0x2d3)][_0x16a406];return _0x394c55?[{'id':_0x394c55['id'],'label':_0x394c55['displayName']}]:[];});if(!_0x615760||_0x296e7d[_0x1902b8(0x483)]===0x0)return;let _0x4bbed3=(_0x767e14=_0x4cad2f['fieldsConfig'][_0x1902b8(0x47d)])==null||(_0x767e14=_0x767e14[_0x1902b8(0x55a)](_0x3be743=>_0x3be743[_0x1902b8(0x1ff)]===_0x74f0d6[_0x1902b8(0x36a)]))==null?void 0x0:_0x767e14[_0x1902b8(0x34e)];return{'unitId':_0x5dd6db,'subUnitId':_0x570b0e,'pivotTableId':_0x4f5c9e,'targetFieldId':_0x74f0d6[_0x1902b8(0x36a)],'targetFieldName':_0x615760[_0x1902b8(0x10a)],'valueFields':_0x296e7d,'defaultValueFieldId':_0x74f0d6[_0x1902b8(0x558)],..._0x4bbed3?{'currentFilter':hi(_0x4bbed3)}:{}};}const vi={'type':_0xe4a01['OPERATION'],'id':_0x1aaa99(0x30d),async 'handler'(_0x3d8c18){const _0x5c62cd=_0x1aaa99;let _0x46c258=_i(_0x3d8c18);if(!_0x46c258)return!0x1;let _0x2d1865=_0x3d8c18['get'](_0x4f85fa),_0x4b81f0=_0x3d8c18['get'](_0x2129e8),_0x588216=null,_0x59241f=!0x1,_0x1605f1=!0x1,_0x38216d=()=>{const _0x55fe54=_0x14e6;_0x59241f||(_0x59241f=!0x0,_0x588216==null||_0x588216[_0x55fe54(0x144)](),_0x588216=null);},_0x59fb86=async _0x592ebe=>{const _0x568972=_0x14e6;if(!_0x1605f1){_0x1605f1=!0x0;try{let _0x42d932=gi(_0x3d8c18,_0x46c258);if(!_0x42d932||_0x592ebe&&(!_0x42d932[_0x568972(0x4e3)][_0x568972(0x2d3)][_0x592ebe['valueFieldId']]||!_0x42d932[_0x568972(0x4e3)][_0x568972(0x3c1)][_0x568972(0x444)](_0x592ebe[_0x568972(0xd4)])||!_0x3c7d69(_0x592ebe[_0x568972(0x3ec)])))return;await _0x3d8c18[_0x568972(0x210)](_0x12babc)[_0x568972(0x4e2)](_0x19eda7['id'],{'unitId':_0x46c258[_0x568972(0xf8)],'subUnitId':_0x46c258[_0x568972(0x19f)],'pivotTableId':_0x46c258[_0x568972(0x53d)],'fieldId':_0x46c258[_0x568972(0x36a)],'valueFilterInfo':_0x592ebe?{..._0x592ebe,'type':_0x567986[_0x568972(0x204)],'expected':Array[_0x568972(0x3fd)](_0x592ebe[_0x568972(0x2c9)])?_0x592ebe[_0x568972(0x2c9)][_0x568972(0x208)]():_0x592ebe[_0x568972(0x2c9)]}:void 0x0});}catch{}finally{_0x38216d();}}};try{_0x588216=_0x2d1865[_0x5c62cd(0x22d)]({'id':_0x5c62cd(0x536),'title':{'title':_0x4b81f0['t'](_0x5c62cd(0x477))},'draggable':!0x0,'mask':!0x0,'maskClosable':!0x1,'width':0x1a4,'children':{'label':{'name':Pr,'props':{'targetFieldId':_0x46c258[_0x5c62cd(0x36a)],'targetFieldName':_0x46c258[_0x5c62cd(0x473)],'valueFields':_0x46c258[_0x5c62cd(0x3c1)],'defaultValueFieldId':_0x46c258[_0x5c62cd(0x558)],'currentFilter':_0x46c258[_0x5c62cd(0x13e)],'onConfirm':_0x33aa45=>_0x59fb86(_0x33aa45),'onClear':()=>_0x59fb86(void 0x0),'onCancel':_0x38216d}}},'onClose':_0x38216d});}catch{return _0x38216d(),!0x1;}return!0x0;}},yi=_0x1aaa99(0x3b0),bi=_0x1aaa99(0x35a),xi=_0x1aaa99(0x364),Si=_0x1aaa99(0x13a),Ci=_0x1aaa99(0x528),wi=_0x1aaa99(0x490),Ti=_0x1aaa99(0x1c4),Ei=_0x1aaa99(0x2bb),Di={'year':_0x1aaa99(0x14a),'year-quarter':_0x1aaa99(0x16b),'quarter':_0x1aaa99(0x1cd),'year-month':_0x1aaa99(0x46b),'month':_0x1aaa99(0x42f),'month-date':_0x1aaa99(0x3e8),'year-month-date':_0x1aaa99(0x4f2),'date':_0x1aaa99(0x475),'hour':_0x1aaa99(0x4a2),'minute':_0x1aaa99(0x347),'hour-minute':'sheets-pivot-ui.dateGroup.hourMinute'};function Oi(_0x26584e){const _0x2e6b00=_0x1aaa99;return{'id':Vr['id'],'type':_0x4052c0['BUTTON'],'icon':'PivotTableIcon','hidden$':_0xaf945e(_0x26584e,_0x36df91[_0x2e6b00(0x416)]),'disabled$':_0x1f49cd(_0x26584e,_0x176c34(_0x26584e,{'workbookTypes':[_0x23a297],'worksheetTypes':[_0x5424ba,_0x20e8fc],'rangeTypes':[_0x4707cc]})),'tooltip':_0x2e6b00(0xc0),'title':_0x2e6b00(0xc0)};}function ki(_0x1b31e6){const _0x324a9f=_0x1aaa99;return{'id':yi,'type':_0x4052c0[_0x324a9f(0x1f0)],'title':_0x324a9f(0x335),'hidden$':Li(_0x1b31e6)};}function Ai(_0x322b7c){const _0x5a9775=_0x1aaa99;return{'id':bi,'commandId':qr['id'],'type':_0x4052c0['BUTTON'],'title':_0x5a9775(0x1fa),'hidden$':Bi(_0x322b7c)[_0x5a9775(0x49b)](_0x245ce1(()=>!Kr(_0x322b7c)))};}function ji(_0x1747ae){const _0x4ea20c=_0x1aaa99;return{'id':xi,'commandId':si['id'],'type':_0x4052c0['BUTTON'],'title':_0x4ea20c(0x3a2),'hidden$':Bi(_0x1747ae)[_0x4ea20c(0x49b)](_0x245ce1(()=>!oi(_0x1747ae)))};}function Mi(_0x29371b){const _0x4d895d=_0x1aaa99;return{'id':Si,'commandId':ti['id'],'type':_0x4052c0[_0x4d895d(0x264)],'title':_0x4d895d(0x163),'hidden$':Bi(_0x29371b)[_0x4d895d(0x49b)](_0x245ce1(()=>!Zr(_0x29371b,'group')))};}function Ni(_0xb3079d){const _0x402bd7=_0x1aaa99;return{'id':Ci,'commandId':ni['id'],'type':_0x4052c0[_0x402bd7(0x264)],'title':'sheets-pivot-ui.manualGroup.renameTitle','hidden$':Bi(_0xb3079d)['pipe'](_0x245ce1(()=>!Zr(_0xb3079d,_0x402bd7(0x305))))};}function Pi(_0x315235){const _0x327c74=_0x1aaa99;return{'id':wi,'commandId':ri['id'],'type':_0x4052c0[_0x327c74(0x264)],'title':_0x327c74(0x153),'hidden$':Bi(_0x315235)[_0x327c74(0x49b)](_0x245ce1(()=>!Zr(_0x315235,'ungroup')))};}function Fi(_0x156e4a){const _0xcf8c1=_0x1aaa99;return _0x18f698=>({'id':Ii(_0x156e4a),'commandId':Ur['id'],'type':_0x4052c0[_0xcf8c1(0x264)],'title':Di[_0x156e4a],'params':{'dateType':_0x156e4a},'disabled$':Ri(_0x18f698,_0x156e4a),'activated$':zi(_0x18f698,_0x156e4a)});}function Ii(_0x10b603){return'sheet.pivot.context-menu.date-group.'+_0x10b603;}function Li(_0x73151){const _0x4491cb=_0x1aaa99;return Bi(_0x73151)[_0x4491cb(0x49b)](_0x245ce1(()=>!Wr(_0x73151)));}function Ri(_0x22c682,_0x23f7b9){const _0x3c27c7=_0x1aaa99;return Bi(_0x22c682)[_0x3c27c7(0x49b)](_0x245ce1(()=>{const _0x55ab86=_0x3c27c7;let _0x475c7f=Wr(_0x22c682);return!_0x475c7f||_0x50a736(_0x475c7f[_0x55ab86(0x44e)],_0x23f7b9);}));}function zi(_0x244d40,_0x4a3bbc){const _0x36eeb1=_0x1aaa99;return Bi(_0x244d40)[_0x36eeb1(0x49b)](_0x245ce1(()=>{const _0x645404=_0x36eeb1;let _0xa2638f=Wr(_0x244d40);return(_0xa2638f==null?void 0x0:_0xa2638f[_0x645404(0x44e)][_0x645404(0x290)])===_0x4a3bbc;}));}function Bi(_0x8edc83){const _0x51a94e=_0x1aaa99;let _0x30510f=_0x8edc83[_0x51a94e(0x210)](_0x344ed3),_0xcc6c78=()=>{const _0x5a9fa4=_0x51a94e;var _0x4719be;let _0x1cd316=_0x16d892(_0x8edc83[_0x5a9fa4(0x210)](_0x570eee)),_0xc066c=(_0x4719be=_0x8edc83[_0x5a9fa4(0x210)](_0x2f649b)[_0x5a9fa4(0x19b)]())==null?void 0x0:_0x4719be[_0x5a9fa4(0xc5)];if(!_0x1cd316||!_0xc066c)return;let {unitId:_0x2e9648,subUnitId:_0x1d16e8}=_0x1cd316,_0x1e879e=_0x8edc83['get'](_0x131a27)[_0x5a9fa4(0xc8)](_0x2e9648,_0x1d16e8,_0xc066c[_0x5a9fa4(0x3a0)],_0xc066c[_0x5a9fa4(0x401)]);return _0x1e879e?{'unitId':_0x2e9648,'subUnitId':_0x1d16e8,'pivotTableId':_0x1e879e}:void 0x0;};return _0x2a5b68(_0x8edc83['get'](_0x2f649b)[_0x51a94e(0x487)],_0x30510f['pivotConfigChange$'][_0x51a94e(0x49b)](_0x36bc5f(_0xb02b6f=>{const _0x444326=_0x51a94e;let _0x47500a=_0xcc6c78();return(_0x47500a==null?void 0x0:_0x47500a[_0x444326(0xf8)])===_0xb02b6f[_0x444326(0xf8)]&&_0x47500a['subUnitId']===_0xb02b6f[_0x444326(0x19f)]&&_0x47500a[_0x444326(0x53d)]===_0xb02b6f[_0x444326(0x53d)];})),_0x30510f[_0x51a94e(0x3fe)][_0x51a94e(0x49b)](_0x36bc5f(_0x335537=>{const _0x15b71c=_0x51a94e;let _0x26b321=_0xcc6c78();if(!_0x26b321||!_0x335537[_0x15b71c(0x2fe)][_0x15b71c(0x444)](_0x26b321[_0x15b71c(0x53d)]))return!0x1;let _0x3808a7=_0x30510f[_0x15b71c(0x2fa)](_0x26b321[_0x15b71c(0xf8)],_0x26b321[_0x15b71c(0x19f)],_0x26b321[_0x15b71c(0x53d)]);return _0x335537['unitId']===((_0x3808a7==null?void 0x0:_0x3808a7[_0x15b71c(0x4ea)][_0x15b71c(0xf8)])??_0x26b321['unitId']);})))[_0x51a94e(0x49b)](_0x36a106(null));}const Vi=_0xf1d45b[_0x1aaa99(0x15d)](_0x35c2ec=>({'dateType':_0x35c2ec,'id':Ii(_0x35c2ec),'menuItemFactory':Fi(_0x35c2ec)}));function Hi(_0x583abf){const _0x5bff7c=_0x1aaa99;return{'id':Ti,'type':_0x4052c0['SUBITEMS'],'title':_0x5bff7c(0x43b),'hidden$':Gi(_0x583abf)[_0x5bff7c(0x49b)](_0x245ce1(()=>!di(_0x583abf)))};}function Ui(_0x162402){const _0x54208f=_0x1aaa99;return _0x5b5777=>({'id':Wi(_0x162402[_0x54208f(0x155)]),'commandId':li['id'],'type':_0x4052c0['BUTTON'],'title':_0x162402[_0x54208f(0x4fe)],'params':{'type':_0x162402[_0x54208f(0x155)]},'activated$':Gi(_0x5b5777)[_0x54208f(0x49b)](_0x245ce1(()=>{const _0x5c228=_0x54208f;let _0xdbeb5b=di(_0x5b5777);return!!(_0xdbeb5b&&(_0xdbeb5b['currentShowDataAs'][_0x5c228(0x155)]??_0x3c9058[_0x5c228(0x37b)])===_0x162402['type']);}))});}function Wi(_0x18229a){return'sheet.pivot.context-menu.show-data-as.'+_0x18229a;}function Gi(_0x37d7c2){const _0x89a759=_0x1aaa99;return _0x37d7c2[_0x89a759(0x210)](_0x2f649b)[_0x89a759(0x487)][_0x89a759(0x49b)](_0x36a106(null));}const Ki=ci[_0x1aaa99(0x15d)](_0xadc78a=>({'rule':_0xadc78a,'id':Wi(_0xadc78a[_0x1aaa99(0x155)]),'menuItemFactory':Ui(_0xadc78a)}));function qi(_0x2e4fcf){const _0x1d91f8=_0x1aaa99;return{'id':Ei,'commandId':vi['id'],'type':_0x4052c0['BUTTON'],'title':_0x1d91f8(0x2c4),'hidden$':_0x2e4fcf['get'](_0x2f649b)[_0x1d91f8(0x487)][_0x1d91f8(0x49b)](_0x36a106(null),_0x245ce1(()=>!_i(_0x2e4fcf)))};}const Ji=Vi[_0x1aaa99(0x424)]((_0x269b87,_0xdbed65,_0x45124e)=>(_0x269b87[_0xdbed65['id']]={'order':_0x45124e+0x1,'menuItemFactory':_0xdbed65[_0x1aaa99(0x45c)]},_0x269b87),{}),Yi=Ki['reduce']((_0x46bb4c,_0x60d5c4,_0x1f9bba)=>(_0x46bb4c[_0x60d5c4['id']]={'order':_0x1f9bba+0x1,'menuItemFactory':_0x60d5c4[_0x1aaa99(0x45c)]},_0x46bb4c),{}),Xi={[_0x24e4c4[_0x1aaa99(0x2c6)]]:{[Vr['id']]:{'order':0x1,'gridLayout':{'row':0x2,'column':0x1},'menuItemFactory':Oi}},[_0x25e2c4[_0x1aaa99(0x332)]]:{[_0x5cc463[_0x1aaa99(0x52e)]]:{[Vr['id']]:{'order':0x1,'menuItemFactory':Oi},[yi]:{'order':0x2,'menuItemFactory':ki,...Ji},[bi]:{'order':0x3,'menuItemFactory':Ai},[xi]:{'order':0x4,'menuItemFactory':ji},[Si]:{'order':0x5,'menuItemFactory':Mi},[Ci]:{'order':0x6,'menuItemFactory':Ni},[wi]:{'order':0x7,'menuItemFactory':Pi},[Ti]:{'order':0x8,'menuItemFactory':Hi,...Yi},[Ei]:{'order':0x9,'menuItemFactory':qi}}},[_0x25e2c4[_0x1aaa99(0x510)]]:{[_0x5cc463[_0x1aaa99(0x52e)]]:{[Vr['id']]:{'order':0x1,'menuItemFactory':Oi},[yi]:{'order':0x2,'menuItemFactory':ki,...Ji},[bi]:{'order':0x3,'menuItemFactory':Ai},[xi]:{'order':0x4,'menuItemFactory':ji},[Si]:{'order':0x5,'menuItemFactory':Mi},[Ci]:{'order':0x6,'menuItemFactory':Ni},[wi]:{'order':0x7,'menuItemFactory':Pi}}}};var Zi=_0x1aaa99(0x30c),Qi=_0x1aaa99(0x3df);const $i={'type':_0xe4a01['OPERATION'],'id':_0x1aaa99(0x21e),async 'handler'(_0x162c78,_0x3c78b8){const _0x1b8329=_0x1aaa99;if(!_0x3c78b8)return!0x1;let {row:_0x23f2f1,col:_0x2a8a19,unitId:_0x465606,subUnitId:_0x2bbad0,tableFieldId:_0x3221ae,pivotTableId:_0x4d2c08}=_0x3c78b8,_0x5eac49=_0x162c78[_0x1b8329(0x210)](_0x131a27),_0x527cb0=_0x4d2c08||_0x5eac49[_0x1b8329(0xc8)](_0x465606,_0x2bbad0,_0x23f2f1,_0x2a8a19);if(!_0x527cb0)return!0x1;let _0x487a19=_0x162c78[_0x1b8329(0x210)](_0x40b8c0),_0x12cf7c=_0x5eac49[_0x1b8329(0x322)](_0x465606,_0x2bbad0,_0x527cb0);if(!(_0x12cf7c!=null&&_0x12cf7c[_0x1b8329(0x377)]))return!0x1;let _0x8701df=_0x5eac49[_0x1b8329(0x3fa)](_0x465606,_0x2bbad0,_0x23f2f1,_0x2a8a19),_0x39c6f4=(await _0x487a19[_0x1b8329(0x1b0)]({'unitId':_0x465606,'subUnitId':_0x2bbad0,'pivotTableId':_0x527cb0,'params':{'type':_0x4d06ca[_0x1b8329(0x1dc)],'filter':{'row':_0x23f2f1,'col':_0x2a8a19,'tableFieldId':_0x3221ae,'cellData':_0x8701df,'pivotItemRenderInfoCache':_0x12cf7c}}}))['result']['filter'];if(!_0x39c6f4)return!0x1;let _0x563879=_0x162c78[_0x1b8329(0x210)](_0x4f85fa),_0x1004dc={'id':Or,'draggable':!0x0,'mask':!0x1,'maskClosable':!0x1,'width':0x150,'dialogStyles':{'header':{'padding':'16px\x2016px\x200','height':0x0},'body':{'padding':_0x1b8329(0x287)}},'closable':!0x1,'children':{'label':Dr,'unitId':_0x465606,'subUnitId':_0x2bbad0,'key':_0x23f2f1+'-'+_0x2a8a19+'-'+(_0x3221ae||''),'filterItemInfo':_0x39c6f4},'onClose':()=>{const _0x596772=_0x1b8329;_0x563879[_0x596772(0x2a3)](Or);}};return _0x563879[_0x1b8329(0x22d)](_0x1004dc),!0x0;}},ea={'type':_0xe4a01[_0x1aaa99(0x384)],'id':'sheet.operation.open-pivot-table-field-setting-panel','handler'(_0x4c62f8,_0x1074bd){const _0x5127eb=_0x1aaa99;if(!_0x1074bd)return!0x1;let _0x32f7a9=_0x4c62f8[_0x5127eb(0x210)](_0x2129e8),{tableFieldId:_0x4f2e68,pivotTableId:_0x137942,unitId:_0x5c7e66,subUnitId:_0x16d208,tableFieldInfo:_0x2bc8e7,dataFieldInfo:_0x580ad3}=_0x1074bd,_0x1ce75f=_0x4c62f8[_0x5127eb(0x210)](_0x4f85fa),_0x318a1f={'id':Ar,'title':{'title':_0x32f7a9['t'](_0x5127eb(0x228))},'draggable':!0x0,'mask':!0x1,'maskClosable':!0x1,'width':0x190,'children':{'label':kr,'tableFieldId':_0x4f2e68,'pivotTableId':_0x137942,'tableFieldInfo':_0x2bc8e7,'dataFieldInfo':_0x580ad3,'unitId':_0x5c7e66,'subUnitId':_0x16d208,'version':Math['random'](),'key':_0x5127eb(0x133)+(_0x4f2e68||''),'closeFn':()=>{const _0x3e0eda=_0x5127eb;_0x1ce75f[_0x3e0eda(0x2a3)](Ar);}},'onClose':()=>{const _0xcf4edf=_0x5127eb;_0x1ce75f[_0xcf4edf(0x2a3)](Ar);}};return _0x1ce75f['open'](_0x318a1f),!0x0;}};function ta(_0x5200c2,_0xa785e9,_0x358771){const _0x32bb2f=_0x1aaa99;let _0x5ad9cb=_0x358771['fieldIds'],{fieldsConfig:_0x248a92}=_0xa785e9,{rowFields:_0x3a4371,columnFields:_0x16d82a,valueFields:_0x5243b2,filterFields:_0x71e66,hiddenFields:_0x288ba2,dimension:_0x1a0732,measure:_0xd8923b,valueIndex:_0x4bd5f5,valuePosition:_0x5bfc06}=_0x248a92,_0x234a41=new Set();[..._0x3a4371,..._0x16d82a,..._0x5243b2,..._0x71e66,..._0x288ba2][_0x32bb2f(0x2d7)](_0x584dd9=>{const _0x3e324d=_0x32bb2f;let _0x48cd8f=_0x1a0732[_0x584dd9]||_0xd8923b[_0x584dd9];_0x48cd8f&&_0x234a41[_0x3e324d(0x549)](_0x48cd8f['dataFieldId']);});let _0xe7fc83=_0x5ad9cb[_0x32bb2f(0x15d)](_0x57d3fa=>{const _0x25ddb9=_0x32bb2f;let _0x48c5a7=_0x358771[_0x25ddb9(0x479)][_0x57d3fa];return{'checked':_0x234a41['has'](_0x57d3fa),'dataFieldId':_0x48c5a7['id'],'id':_0x48c5a7['id'],'name':_0x48c5a7[_0x25ddb9(0x372)],'type':_0x48c5a7['fieldDataType'],'pivotTableId':_0x5200c2};}),_0x2a5d0a=_0x3a4371[_0x32bb2f(0x289)](_0x45189c=>{const _0x2a3275=_0x32bb2f;let _0x291f0a=_0x1a0732[_0x45189c];return _0x291f0a?[{'dataFieldId':_0x291f0a[_0x2a3275(0x26a)],'tableFieldId':_0x291f0a['id'],'displayName':_0x291f0a[_0x2a3275(0x10a)]}]:[];}),_0x15d671=_0x16d82a[_0x32bb2f(0x289)](_0x425c9e=>{const _0x3ec248=_0x32bb2f;let _0x231df9=_0x1a0732[_0x425c9e];return _0x231df9?[{'dataFieldId':_0x231df9[_0x3ec248(0x26a)],'tableFieldId':_0x231df9['id'],'displayName':_0x231df9[_0x3ec248(0x10a)]}]:[];}),_0x4e5cdc=_0x5243b2[_0x32bb2f(0x289)](_0x307f51=>{const _0x3d820b=_0x32bb2f;let _0x1b7e83=_0xd8923b[_0x307f51];return _0x1b7e83?[{'dataFieldId':_0x1b7e83[_0x3d820b(0x26a)],'tableFieldId':_0x1b7e83['id'],'displayName':_0x1b7e83[_0x3d820b(0x10a)],'format':_0x1b7e83[_0x3d820b(0x4c5)],'subTotalType':_0x1b7e83[_0x3d820b(0x411)]}]:[];}),_0x55d82d=_0x71e66[_0x32bb2f(0x289)](_0x5a6ee1=>{const _0x59687b=_0x32bb2f;let _0x28e577=_0x1a0732[_0x5a6ee1];return _0x28e577?[{'dataFieldId':_0x28e577[_0x59687b(0x26a)],'tableFieldId':_0x28e577['id'],'displayName':_0x28e577['displayName']}]:[];}),_0x365f72=_0x288ba2[_0x32bb2f(0x289)](_0x5a9b1d=>{const _0x3b98bd=_0x32bb2f;let _0x27fd1a=_0x1a0732[_0x5a9b1d];return _0x27fd1a?[{'dataFieldId':_0x27fd1a[_0x3b98bd(0x26a)],'tableFieldId':_0x27fd1a['id'],'displayName':_0x27fd1a[_0x3b98bd(0x10a)],'filterInfo':_0x27fd1a['filterInfo']}]:[];});return _0x4e5cdc[_0x32bb2f(0x483)]>0x1&&(_0x5bfc06===_0x1adff7[_0x32bb2f(0x4c1)]?_0x2a5d0a:_0x15d671)['splice'](_0x4bd5f5,0x0,{'dataFieldId':'','tableFieldId':_0x32bb2f(0x42b),'displayName':_0x32bb2f(0x2e9)}),{'sourceList':_0xe7fc83,'sourceRange':_0xa785e9['sourceRangeInfo'],'rowFields':_0x2a5d0a,'columnFields':_0x15d671,'valueFields':_0x4e5cdc,'filterFields':_0x55d82d,'hiddenFields':_0x365f72,'positionInfo':_0xa785e9[_0x32bb2f(0x217)]};}const na={'type':_0xe4a01[_0x1aaa99(0x384)],'id':_0x1aaa99(0x38f),async 'handler'(_0x1f1609,_0x529cec){const _0x3af95f=_0x1aaa99;let _0x4c25b9=_0x529cec==null?void 0x0:_0x529cec[_0x3af95f(0x53d)];if(!_0x4c25b9)return!0x1;let _0x42e3e3=_0x1f1609[_0x3af95f(0x210)](_0x47511f),_0x51bb84=_0x1f1609[_0x3af95f(0x210)](_0x570eee),_0x243cc8=_0x1f1609['get'](_0x2129e8),_0x36291c=_0x1f1609[_0x3af95f(0x210)](_0x344ed3),_0x20e112=_0x16d892(_0x51bb84);if(!_0x20e112)return!0x1;let {unitId:_0x5ec0b6,subUnitId:_0x23f1e1}=_0x20e112,_0x3a3dea=_0x36291c[_0x3af95f(0x2fa)](_0x5ec0b6,_0x23f1e1,_0x4c25b9),_0x1877cb=_0x36291c[_0x3af95f(0x1f1)](_0x5ec0b6,_0x4c25b9);if(!_0x3a3dea||!_0x1877cb)return!0x1;let _0x29dfb3=ta(_0x4c25b9,_0x3a3dea,_0x1877cb),_0x39be3f={'header':{'title':_0x243cc8['t'](_0x3af95f(0xc0))},'id':Er,'children':{'label':Tr,'panelInfo':_0x29dfb3,'version':Math[_0x3af95f(0x4c2)](),'setVersion':()=>Math['random'](),'pivotTableId':_0x4c25b9,'unitId':_0x5ec0b6,'subUnitId':_0x23f1e1},'width':0x15a};return _0x42e3e3['open'](_0x39be3f),!0x0;}},ra=_0x1aaa99(0x498),ia={};function aa(_0x3f7353){'@babel/helpers - typeof';const _0x255373=_0x1aaa99;return aa=typeof Symbol==_0x255373(0x501)&&typeof Symbol[_0x255373(0xfb)]=='symbol'?function(_0x5b3c67){return typeof _0x5b3c67;}:function(_0x2cd6a0){const _0x4af27b=_0x255373;return _0x2cd6a0&&typeof Symbol=='function'&&_0x2cd6a0['constructor']===Symbol&&_0x2cd6a0!==Symbol[_0x4af27b(0x224)]?'symbol':typeof _0x2cd6a0;},aa(_0x3f7353);}function oa(_0x3a2450,_0x3386fd){const _0x319152=_0x1aaa99;if(aa(_0x3a2450)!=_0x319152(0x2de)||!_0x3a2450)return _0x3a2450;var _0xe26f6b;if(typeof Symbol<'u'&&(_0xe26f6b=_0x3a2450[Symbol[_0x319152(0x51d)]])!==void 0x0){var _0x21bcd3=_0xe26f6b['call'](_0x3a2450,_0x3386fd||_0x319152(0x4b2));if(aa(_0x21bcd3)!='object')return _0x21bcd3;throw TypeError(_0x319152(0x329));}return(_0x3386fd===_0x319152(0x53f)?String:Number)(_0x3a2450);}function sa(_0x204c54){const _0x4bd738=_0x1aaa99;var _0x2d3049=oa(_0x204c54,_0x4bd738(0x53f));return aa(_0x2d3049)==_0x4bd738(0x3e2)?_0x2d3049:_0x2d3049+'';}function X(_0x519dc9,_0x17b846,_0x326517){const _0xc405e7=_0x1aaa99;return(_0x17b846=sa(_0x17b846))in _0x519dc9?Object[_0xc405e7(0xf2)](_0x519dc9,_0x17b846,{'value':_0x326517,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x519dc9[_0x17b846]=_0x326517,_0x519dc9;}function Z(_0x27b4bd,_0x563d4b){return function(_0x5a300e,_0x3cbb3a){_0x563d4b(_0x5a300e,_0x3cbb3a,_0x27b4bd);};}function Q(_0x7ade7,_0x14411c,_0x25c69d,_0x31bd58){const _0x16ef94=_0x1aaa99;var _0x4a4204=arguments[_0x16ef94(0x483)],_0x24153=_0x4a4204<0x3?_0x14411c:_0x31bd58===null?_0x31bd58=Object[_0x16ef94(0x35c)](_0x14411c,_0x25c69d):_0x31bd58,_0x221a10;if(typeof Reflect==_0x16ef94(0x2de)&&typeof Reflect[_0x16ef94(0x2c7)]=='function')_0x24153=Reflect[_0x16ef94(0x2c7)](_0x7ade7,_0x14411c,_0x25c69d,_0x31bd58);else{for(var _0x417ace=_0x7ade7[_0x16ef94(0x483)]-0x1;_0x417ace>=0x0;_0x417ace--)(_0x221a10=_0x7ade7[_0x417ace])&&(_0x24153=(_0x4a4204<0x3?_0x221a10(_0x24153):_0x4a4204>0x3?_0x221a10(_0x14411c,_0x25c69d,_0x24153):_0x221a10(_0x14411c,_0x25c69d))||_0x24153);}return _0x4a4204>0x3&&_0x24153&&Object['defineProperty'](_0x14411c,_0x25c69d,_0x24153),_0x24153;}let ca=class extends _0x239c25{constructor(_0x47c35e,_0x4685ce,_0x18a71b,_0x1be84e,_0x4d8613,_0x433670,_0x14993e,_0x3b375b){const _0x3a2245=_0x1aaa99;var _0x3fb18b;super(),this[_0x3a2245(0x1f9)]=_0x47c35e,this[_0x3a2245(0x39b)]=_0x4685ce,this[_0x3a2245(0xf3)]=_0x18a71b,this[_0x3a2245(0x4e1)]=_0x1be84e,this[_0x3a2245(0x1eb)]=_0x4d8613,this['_configService']=_0x433670,this['_sheetPermissionCheckController']=_0x14993e,this[_0x3a2245(0x466)]=_0x3b375b,X(this,_0x3a2245(0x341),!0x1),this[_0x3a2245(0x320)](this['_sheetsRenderService']['registerSelfRenderingMutations'](_0x53cf5b['id'])),this['_initUIInterceptListener'](),this[_0x3a2245(0x341)]=((_0x3fb18b=this[_0x3a2245(0x50c)][_0x3a2245(0x10c)](_0x2d42ea))==null?void 0x0:_0x3fb18b[_0x3a2245(0x3ae)])??!0x1;}['_getPivotAppliedRanges'](_0x347a4b,_0x3cd645,_0x4fd00c){const _0x5a99c4=_0x1aaa99;return _0x3ae7ad(_0x347a4b,_0x3cd645,_0x4fd00c,this[_0x5a99c4(0x1f9)]['getDirection']());}['_initUIInterceptListener'](){const _0x26923f=_0x1aaa99;this[_0x26923f(0x1eb)][_0x26923f(0x30e)][_0x26923f(0x191)](this['_sheetsPivotTableService']['asyncInterceptor'][_0x26923f(0x441)]()['PIVOT_PERFORM_CHECK'],{'handler':async(_0x2e9b4f,_0x44e363)=>{const _0x3ad676=_0x26923f;let {cellInfo:_0x11a523,view:_0x315250,isEmpty:_0x441ed2}=_0x44e363,{unitId:_0x3872d9,subUnitId:_0x6cf84f}=_0x11a523,_0x390b1b=this[_0x3ad676(0x4d6)](_0x11a523,_0x315250,_0x441ed2);if(!_0x3ff5ee(this[_0x3ad676(0xf3)],_0x3872d9,_0x6cf84f,_0x390b1b)){let _0x211637=this[_0x3ad676(0x1f9)]['t'](_0x3ad676(0x553));this['_sheetPermissionCheckController'][_0x3ad676(0x11f)](_0x211637);}let _0xa2c97a=this[_0x3ad676(0x39b)][_0x3ad676(0x47f)]({'unitId':_0x3872d9,'subUnitId':_0x6cf84f,'ranges':_0x390b1b}),_0x356b49=_0x151826(this[_0x3ad676(0xf3)],_0x3872d9,_0x6cf84f,_0x390b1b);if(_0xa2c97a[_0x3ad676(0x2e7)][_0x3ad676(0x483)]||_0x356b49[_0x3ad676(0x3c3)]){if(this['_defaultOverride'])return Promise[_0x3ad676(0x45b)](!0x0);{let _0x217722=await this[_0x3ad676(0x4e1)][_0x3ad676(0x1a6)]({'id':_0x3ad676(0x4d5),'title':{'title':this[_0x3ad676(0x1f9)]['t']('sheets-pivot-ui.perform.tips')},'children':{'title':this['_localeService']['t'](_0x3ad676(0x4df))},'cancelText':this[_0x3ad676(0x1f9)]['t'](_0x3ad676(0x12c)),'confirmText':this[_0x3ad676(0x1f9)]['t'](_0x3ad676(0x10d))});return Promise[_0x3ad676(0x45b)](_0x217722);}}return Promise[_0x3ad676(0x45b)](!0x0);}});}};ca=Q([Z(0x0,_0x446f3f(_0x2129e8)),Z(0x1,_0x446f3f(_0x14478c)),Z(0x2,_0x446f3f(_0x21b420)),Z(0x3,_0x446f3f(_0x7c076c)),Z(0x4,_0x446f3f(_0x43647f)),Z(0x5,_0x446f3f(_0xcc1513)),Z(0x6,_0x446f3f(_0x2f1427)),Z(0x7,_0x446f3f(_0x5d1f4c))],ca);function la(_0x315912){const _0x12c283=_0x1aaa99;let {editable:_0x4325aa,pivotTableId:_0x5988e8,subUnitId:_0x15ef45,unitId:_0x5470a2}=_0x315912,_0x5a2cef=_0x2140ff(_0x12babc),_0x3717f4=_0x2140ff(_0x4f85fa),_0x5c468a=_0x2140ff(_0x2129e8),_0x106649=[{'command':{'id':na['id'],'params':{'pivotTableId':_0x5988e8}},'disabled':!_0x4325aa,'label':_0x12c283(0xe4)},{'command':{'id':_0x34359f['id'],'params':{'unitId':_0x5470a2,'subUnitId':_0x15ef45,'pivotTableId':_0x5988e8}},'disabled':!_0x4325aa,'label':_0x12c283(0x454)}];async function _0xdd1c91(_0x124e42){const _0x220e35=_0x12c283;await _0x5a2cef[_0x220e35(0x4e2)](_0x124e42['id'],_0x124e42[_0x220e35(0x119)]),_0x3717f4['close'](Br);}return _0x2a3146(_0x12c283(0x3cc),{'className':_0x12c283(0x120),'children':_0x106649[_0x12c283(0x15d)](_0x3730dd=>{const _0x2b00b7=_0x12c283;let _0x5b8686=_0x5c468a['t'](_0x3730dd['label']);return _0x2a3146(_0xa38594,{'title':_0x5b8686,'aria-label':_0x5b8686,'variant':_0x2b00b7(0x230),'disabled':_0x3730dd['disabled'],'onClick':()=>_0xdd1c91(_0x3730dd[_0x2b00b7(0x1c8)])},_0x3730dd[_0x2b00b7(0x1c8)]['id']);})});}const ua=[{'label':_0x1aaa99(0x1aa),'suffix':'yyyy-MM-dd'},{'label':_0x1aaa99(0xdb),'suffix':_0x1aaa99(0x135)},{'label':'1930年08月05日','suffix':_0x1aaa99(0x28a)},{'label':_0x1aaa99(0x507),'suffix':_0x1aaa99(0x564)},{'label':_0x1aaa99(0x172),'suffix':'M\x22月\x22d\x22日\x22'},{'label':_0x1aaa99(0xd7),'suffix':_0x1aaa99(0x239)},{'label':_0x1aaa99(0x219),'suffix':_0x1aaa99(0x10f)},{'label':'下午01:30','suffix':_0x1aaa99(0x151)},{'label':'下午1:30','suffix':'A/P\x20h:mm'},{'label':'下午1:30:30','suffix':_0x1aaa99(0x275)},{'label':'08-05\x20下午\x2001:30','suffix':'MM-dd\x20A/P\x20hh:mm'}],da=[{'label':_0x1aaa99(0x237),'suffix':'#,##0_);(#,##0)'},{'label':_0x1aaa99(0x3c6),'suffix':_0x1aaa99(0x162),'color':'red'},{'label':'1,234.56','suffix':'#,##0.00_);#,##0.00'},{'label':_0x1aaa99(0x462),'suffix':_0x1aaa99(0x18d),'color':_0x1aaa99(0x142)},{'label':_0x1aaa99(0x28e),'suffix':_0x1aaa99(0x4ad)},{'label':_0x1aaa99(0x28e),'suffix':'#,##0.00_);[Red]-#,##0.00','color':_0x1aaa99(0x142)}],fa=[{'label':_0x194b9c=>_0x194b9c+_0x1aaa99(0x3f6),'suffix':_0xdf194b=>'\x22'+_0xdf194b+_0x1aaa99(0x38c)+_0xdf194b+_0x1aaa99(0x346)},{'label':_0x13483f=>_0x13483f+_0x1aaa99(0x3f6),'suffix':_0x15e68b=>'\x22'+_0x15e68b+_0x1aaa99(0x1c7)+_0x15e68b+_0x1aaa99(0x346),'color':_0x1aaa99(0x142)},{'label':_0x8bb66f=>'('+_0x8bb66f+_0x1aaa99(0x1d0),'suffix':_0x533455=>'\x22'+_0x533455+_0x1aaa99(0x15b)+_0x533455+_0x1aaa99(0x11e)},{'label':_0x1716b2=>'('+_0x1716b2+_0x1aaa99(0x1d0),'suffix':_0x43bdbe=>'\x22'+_0x43bdbe+_0x1aaa99(0x44b)+_0x43bdbe+'\x22#,##0.00)','color':_0x1aaa99(0x142)},{'label':_0x1b4730=>'-'+_0x1b4730+_0x1aaa99(0x3f6),'suffix':_0x14da47=>'\x22'+_0x14da47+_0x1aaa99(0x177)+_0x14da47+_0x1aaa99(0x346)},{'label':_0x24850e=>'-'+_0x24850e+_0x1aaa99(0x3f6),'suffix':_0x224f57=>'\x22'+_0x224f57+_0x1aaa99(0x49d)+_0x224f57+'\x22#,##0.00','color':_0x1aaa99(0x142)}],pa='PivotMultipleValueId';function ma(_0x5edaf7,_0x554e88){const _0x42ac0e=_0x1aaa99;if(_0x554e88===_0xe427cd[_0x42ac0e(0x494)])return _0x42ac0e(0x250);if(_0x554e88===_0xe427cd[_0x42ac0e(0x218)]&&_0x5edaf7===_0x5fc13a[_0x42ac0e(0x292)])return'sheets-pivot-ui.showValuesAs.other';}function ha(_0xe8e5f,_0x28d988){const _0x569ef6=_0x1aaa99;let _0x1f6669=_0x44255e(_0x28d988,_0xe8e5f);return _0xe8e5f[_0x569ef6(0x444)](_0x569ef6(0xfe))?_0xe8e5f[_0x569ef6(0x51a)]('{0}',_0x1f6669):''+_0xe8e5f+_0x1f6669;}const ga=_0x10a520=>{const _0x5477c=_0x1aaa99;switch(_0x10a520){case'filter':return _0x1d45fb[_0x5477c(0x1dc)];case _0x5477c(0x220):return _0x1d45fb[_0x5477c(0x4c1)];case _0x5477c(0x187):return _0x1d45fb['Column'];case'value':return _0x1d45fb[_0x5477c(0x19c)];default:return _0x1d45fb[_0x5477c(0x4c1)];}};function _a(_0x436de3,_0x23d9ab){const _0x328a63=_0x1aaa99;switch(_0x23d9ab[_0x328a63(0x4cf)]||_0x2f8441[_0x328a63(0x2f4)]){case _0x2f8441[_0x328a63(0x2f4)]:return{'startRow':_0x23d9ab[_0x328a63(0x3a0)],'startColumn':_0x23d9ab['startColumn'],'endRow':_0x23d9ab[_0x328a63(0x25a)],'endColumn':_0x23d9ab[_0x328a63(0x488)]};case _0x2f8441[_0x328a63(0xeb)]:return{'startRow':_0x23d9ab[_0x328a63(0x3a0)],'startColumn':0x0,'endRow':_0x23d9ab['endRow'],'endColumn':_0x436de3[_0x328a63(0x464)]()-0x1};case _0x2f8441[_0x328a63(0x44d)]:return{'startRow':0x0,'startColumn':_0x23d9ab[_0x328a63(0x401)],'endRow':_0x436de3['getRowCount']()-0x1,'endColumn':_0x23d9ab[_0x328a63(0x488)]};case _0x2f8441[_0x328a63(0x1ac)]:return{'startRow':0x0,'startColumn':0x0,'endRow':_0x436de3[_0x328a63(0xea)]()-0x1,'endColumn':_0x436de3[_0x328a63(0x464)]()-0x1};}}function va(_0x4ec7ad,_0x1dbe9c){const _0x597a36=_0x1aaa99;if(!_0x1dbe9c||!_0x4ec7ad||_0x1dbe9c[_0x597a36(0x25a)]-_0x1dbe9c[_0x597a36(0x3a0)]<=0x0)return 0x1;let {startRow:_0x17c2a4,startColumn:_0x163224,endRow:_0x548990,endColumn:_0x6547da}=_a(_0x4ec7ad,_0x1dbe9c),_0x3a17da=_0x4ec7ad[_0x597a36(0x3b1)](),_0x3ea6b6=!0x1;for(let _0x4814e2=_0x17c2a4;_0x4814e2<=_0x548990;_0x4814e2++){for(let _0x72b801=_0x163224;_0x72b801<=_0x6547da;_0x72b801++)if(_0x3a17da[_0x597a36(0x3d6)](_0x4814e2,_0x72b801)!=null){_0x3ea6b6=!0x0;break;}if(_0x3ea6b6)break;}return _0x3ea6b6?0x2:0x0;}async function ya(_0x2a7869,_0x9788e,_0x264977){const _0x4accda=_0x1aaa99;let {commandService:_0x5574f0,pivotTableInfo:_0x10e26c,pivotTableId:_0x7075fe,unitId:_0x5ab749,subUnitId:_0x4255de}=_0x2a7869,_0xa4a5cc=[],{rowFields:_0x3960e4,columnFields:_0x4c5edf,filterFields:_0x40cbb4,valueFields:_0x4748a2}=_0x10e26c,_0x473f43=[..._0x3960e4,..._0x4c5edf,..._0x40cbb4,..._0x4748a2];_0x9788e===_0x4accda(0x42b)&&_0x4748a2[_0x4accda(0x2d7)](_0x2e8fef=>{const _0x523565=_0x4accda;_0xa4a5cc['push'](_0x2e8fef[_0x523565(0x1b1)]);}),_0x264977==='source'&&_0x473f43[_0x4accda(0x2d7)](_0x4e23b0=>{const _0xb2a799=_0x4accda;_0x4e23b0[_0xb2a799(0x26a)]===_0x9788e&&_0xa4a5cc[_0xb2a799(0x29b)](_0x4e23b0['tableFieldId']);}),_0x264977!==_0x4accda(0x113)&&_0x473f43[_0x4accda(0x55a)](_0x29c267=>_0x29c267['tableFieldId']===_0x9788e)&&_0xa4a5cc[_0x4accda(0x29b)](_0x9788e),await _0x5574f0[_0x4accda(0x4e2)](_0x2229ad['id'],{'pivotTableId':_0x7075fe,'fieldIds':_0xa4a5cc,'unitId':_0x5ab749,'subUnitId':_0x4255de});}async function ba(_0x30b811,_0x5b5a04,_0x265a33,_0x4e3d03,_0x212817){let _0x4b3f92={'unitId':_0x4e3d03,'subUnitId':_0x212817,'token':_0x5b5a04,'dataRangeInfo':_0x265a33};await _0x30b811['executeCommand'](_0x3bcc73['id'],_0x4b3f92);}const xa=(_0x484456,_0x42f50c)=>{let {rowFields:_0x4d01f5,columnFields:_0x3143e4,filterFields:_0x1fe346}=_0x484456,_0x31480f=[..._0x4d01f5,..._0x3143e4,..._0x1fe346],_0x382822=[];return _0x31480f['forEach'](_0x27521c=>{const _0x452a35=_0x14e6;_0x27521c[_0x452a35(0x26a)]===_0x42f50c&&_0x382822[_0x452a35(0x29b)](_0x27521c[_0x452a35(0x1b1)]);}),_0x382822;};async function Sa(_0x9573fd,_0x277f6b,_0x2dabd0,_0x2ed417,_0x1239e0){const _0x5f5848=_0x1aaa99;if(_0x2dabd0===_0x5f5848(0x113)&&_0x2ed417===_0x5f5848(0x113))return;let _0x10981e=_0x277f6b===pa,{commandService:_0x592261,pivotTableInfo:_0xc622fd,pivotTableId:_0x27ec1d,unitId:_0x48ad1b,subUnitId:_0x3d0c8d}=_0x9573fd;if(_0x2dabd0===_0x5f5848(0x113)&&_0x2ed417!==_0x5f5848(0x113)){let {sourceList:_0x4ef8e6}=_0xc622fd,_0x502c44=_0x4ef8e6['find'](_0xeafd30=>_0xeafd30['id']===_0x277f6b);if(_0x502c44){let _0x22f849=xa(_0xc622fd,_0x277f6b);if(_0x2ed417!==_0x5f5848(0xd6)&&_0x22f849[_0x5f5848(0x483)]>0x0){let _0x12b6da=_0x22f849[0x0];await _0x592261[_0x5f5848(0x4e2)](_0x3f282e['id'],{'pivotTableId':_0x27ec1d,'fieldId':_0x12b6da,'area':ga(_0x2ed417),'index':_0x1239e0,'unitId':_0x48ad1b,'subUnitId':_0x3d0c8d});}else await _0x592261['executeCommand'](_0x207afc['id'],{'pivotTableId':_0x27ec1d,'dataFieldId':_0x502c44[_0x5f5848(0x26a)],'fieldArea':ga(_0x2ed417),'index':_0x1239e0,'unitId':_0x48ad1b,'subUnitId':_0x3d0c8d});}}if(_0x2dabd0!=='source'&&_0x2ed417==='source'){let {rowFields:_0x11da7d,columnFields:_0x316979,filterFields:_0x1af123,valueFields:_0x43427f}=_0xc622fd,_0x490573=[..._0x11da7d,..._0x316979,..._0x1af123,..._0x43427f],_0x15f5ac=[];_0x10981e?_0x43427f['forEach'](_0x4a7b4b=>{const _0x4a7675=_0x5f5848;_0x15f5ac[_0x4a7675(0x29b)](_0x4a7b4b[_0x4a7675(0x1b1)]);}):_0x490573[_0x5f5848(0x55a)](_0x5bfc1b=>_0x5bfc1b['tableFieldId']===_0x277f6b)&&_0x15f5ac[_0x5f5848(0x29b)](_0x277f6b),await Ca(_0x9573fd,_0x15f5ac);}else _0x2dabd0!==_0x5f5848(0x113)&&_0x2ed417!=='source'&&await Ta(_0x9573fd,_0x277f6b,_0x2dabd0,_0x2ed417,_0x1239e0);}async function Ca(_0x51d6a5,_0x1ae740){const _0x5ef64a=_0x1aaa99;let {commandService:_0x2bea39,pivotTableId:_0x1b2d93,unitId:_0x121433,subUnitId:_0x30201c}=_0x51d6a5;await _0x2bea39[_0x5ef64a(0x4e2)](_0x2229ad['id'],{'pivotTableId':_0x1b2d93,'fieldIds':_0x1ae740,'unitId':_0x121433,'subUnitId':_0x30201c});}async function wa(_0x50682e,_0x4826a9,_0x4108aa){const _0x5923da=_0x1aaa99;let {commandService:_0x2f2c18,pivotTableId:_0x5122d1,unitId:_0x42886c,subUnitId:_0x47968b}=_0x50682e;await _0x2f2c18[_0x5923da(0x4e2)](_0x33eb57['id'],{'pivotTableId':_0x5122d1,'position':_0x4826a9,'index':_0x4108aa,'unitId':_0x42886c,'subUnitId':_0x47968b});}async function Ta(_0x48814d,_0x21cc9e,_0x6b7f6d,_0x38c01d,_0x1dffca){const _0x12325c=_0x1aaa99;let _0x4c27b2=_0x21cc9e===pa,{commandService:_0x522e0a,pivotTableInfo:_0x2444ec,pivotTableId:_0x421c42,unitId:_0x14bb8b,subUnitId:_0x4d546b}=_0x48814d;if(_0x4c27b2){let _0x574b8d=ga(_0x38c01d);(_0x574b8d===_0x1d45fb[_0x12325c(0x4c1)]||_0x574b8d===_0x1d45fb[_0x12325c(0x515)])&&await _0x522e0a[_0x12325c(0x4e2)](_0x33eb57['id'],{'pivotTableId':_0x421c42,'position':_0x574b8d===_0x1d45fb[_0x12325c(0x4c1)]?_0x1adff7[_0x12325c(0x4c1)]:_0x1adff7[_0x12325c(0x515)],'index':_0x1dffca,'unitId':_0x14bb8b,'subUnitId':_0x4d546b});return;}let {rowFields:_0x2f4d74,columnFields:_0x1cac15,filterFields:_0x4708df,valueFields:_0x1d28ca}=_0x2444ec,_0x275bb1=[..._0x2f4d74,..._0x1cac15,..._0x4708df,..._0x1d28ca][_0x12325c(0x55a)](_0x11c254=>_0x11c254[_0x12325c(0x1b1)]===_0x21cc9e);if(_0x275bb1){let _0xc96115=[..._0x2f4d74,..._0x1cac15,..._0x4708df];if(_0x6b7f6d===_0x12325c(0xd6)&&_0x38c01d!=='value'&&_0xc96115['find'](_0x15ee51=>_0x15ee51['dataFieldId']===_0x275bb1[_0x12325c(0x26a)])){await Ca(_0x48814d,[_0x21cc9e]);return;}await _0x522e0a[_0x12325c(0x4e2)](_0x3f282e['id'],{'pivotTableId':_0x421c42,'fieldId':_0x21cc9e,'area':ga(_0x38c01d),'index':_0x1dffca,'unitId':_0x14bb8b,'subUnitId':_0x4d546b});}}function Ea(_0x288a4d,_0x2f6573,_0x543881,_0x79556a,_0x46e21c){const _0x55ed23=_0x1aaa99;_0x288a4d[_0x55ed23(0x4e2)]($i['id'],{'row':-0x1,'col':-0x1,'unitId':_0x2f6573,'subUnitId':_0x543881,'tableFieldId':_0x46e21c,'pivotTableId':_0x79556a});}function Da(_0x26aca2,_0x12f5bd,_0x521781,_0x1664ba,_0x4e7a47,_0x5e36d6){const _0x3d1109=_0x1aaa99;let {sourceList:_0x5a8930,rowFields:_0x2ea3b5,columnFields:_0x373836,valueFields:_0x2f895b,filterFields:_0x53c73d}=_0x5e36d6,_0x155144=[..._0x2ea3b5,..._0x373836,..._0x2f895b,..._0x53c73d]['find'](_0x32c1f9=>_0x32c1f9[_0x3d1109(0x1b1)]===_0x521781),_0x3b7439=_0x5a8930[_0x3d1109(0x55a)](_0x50e03d=>_0x50e03d['id']===(_0x155144==null?void 0x0:_0x155144['dataFieldId']));if(_0x155144&&_0x3b7439){let _0x458289={'tableFieldId':_0x521781,'pivotTableId':_0x12f5bd,'unitId':_0x1664ba,'subUnitId':_0x4e7a47,'tableFieldInfo':_0x155144,'dataFieldInfo':_0x3b7439};_0x26aca2[_0x3d1109(0x4e2)](ea['id'],_0x458289);}}const Oa=[{'type':_0x407a23['average'],'textKey':_0x1aaa99(0x260)},{'type':_0x407a23[_0x1aaa99(0x350)],'textKey':'sheets-pivot-ui.subtotal.count'},{'type':_0x407a23[_0x1aaa99(0x2bf)],'textKey':_0x1aaa99(0x4cd)},{'type':_0x407a23[_0x1aaa99(0x30b)],'textKey':'sheets-pivot-ui.subtotal.max'},{'type':_0x407a23['min'],'textKey':_0x1aaa99(0x3a7)},{'type':_0x407a23[_0x1aaa99(0x13d)],'textKey':_0x1aaa99(0x4be)},{'type':_0x407a23['stdDev'],'textKey':_0x1aaa99(0x20b)},{'type':_0x407a23[_0x1aaa99(0xec)],'textKey':_0x1aaa99(0xe6)},{'type':_0x407a23[_0x1aaa99(0xc7)],'textKey':'sheets-pivot-ui.subtotal.sum'},{'type':_0x407a23['var'],'textKey':'sheets-pivot-ui.subtotal.var'},{'type':_0x407a23[_0x1aaa99(0x538)],'textKey':_0x1aaa99(0x182)}],ka=(_0x2372c3,_0x202dc4=0x0)=>_0x2372c3?_0xd5638d[_0x1aaa99(0x506)](_0x2372c3)[_0x1aaa99(0x26d)]??_0x202dc4:_0x202dc4,Aa=_0x30a4a1=>Array(Math[_0x1aaa99(0x18c)](Math['max'](0x0,Number(_0x30a4a1)),0x1e))['fill'](0x0)[_0x1aaa99(0x268)](''),$=(_0x159c2c,_0x2e0bd4)=>_0x159c2c['split'](';')[_0x1aaa99(0x15d)](_0x450d73=>/\.0?/[_0x1aaa99(0xf6)](_0x450d73)?_0x450d73[_0x1aaa99(0x51a)](/\.0*/g,''+(_0x2e0bd4>0x0?'.':'')+Aa(Number(_0x2e0bd4||0x0))):/0[^0]?/['test'](_0x450d73)?_0x450d73['replace'](/0[^0]+|0$/,'0'+(_0x2e0bd4>0x0?'.':'')+Aa(Number(_0x2e0bd4||0x0))):_0x450d73)['join'](';'),ja=_0x1d1ab1=>_0x208996[_0x1aaa99(0x55a)](_0x4dd28c=>_0x1d1ab1[_0x1aaa99(0x444)](_0x4dd28c)),Ma=_0x24fcb6=>!_0x24fcb6,Na=_0x11af6a=>!!ja(_0x11af6a)&&_0x11af6a[_0x1aaa99(0x232)]('_('),Pa=_0x269d85=>!!ja(_0x269d85)&&!_0x269d85['startsWith']('_('),Fa=()=>ua[_0x1aaa99(0x15d)](_0xde3a05=>({'label':_0xde3a05[_0x1aaa99(0x517)],'value':_0xde3a05[_0x1aaa99(0x26e)]})),Ia=_0x580f26=>{const _0x6b9826=_0x1aaa99;let _0x196793=_0xd5638d[_0x6b9826(0x506)](_0x580f26);return Fa()[_0x6b9826(0x15d)](_0x144215=>_0x144215['value'])['includes'](_0x580f26)||[_0x6b9826(0x33a),_0x6b9826(0x1e0),_0x6b9826(0x561)][_0x6b9826(0x444)](_0x196793['type']);},La=()=>da['map'](_0x4598cf=>({'label':_0x4598cf[_0x1aaa99(0x517)],'value':_0x4598cf[_0x1aaa99(0x26e)],'color':_0x4598cf[_0x1aaa99(0x20c)]})),Ra=_0xc847ba=>La()[_0x1aaa99(0x156)](_0x4ff85c=>_0x55e497(_0x4ff85c[_0x1aaa99(0xd6)],_0xc847ba)),za=(_0x5855c5,_0x51737c)=>{const _0x2657d1=_0x1aaa99;switch(_0x51737c){case _0x1d45fb[_0x2657d1(0x4c1)]:return _0x5855c5[_0x2657d1(0x12b)][_0x2657d1(0x483)];case _0x1d45fb[_0x2657d1(0x515)]:return _0x5855c5[_0x2657d1(0x39e)][_0x2657d1(0x483)];case _0x1d45fb[_0x2657d1(0x1dc)]:return _0x5855c5[_0x2657d1(0x2ea)][_0x2657d1(0x483)];case _0x1d45fb['Value']:return _0x5855c5[_0x2657d1(0x3c1)]['length'];default:return 0x0;}},Ba=(_0x18c14b,_0xc59437,_0x2b4779)=>{const _0x5d1b18=_0x1aaa99;for(let _0x433985 of['sheets-pivot-ui.averageName','sheets-pivot-ui.countName',_0x5d1b18(0x546),_0x5d1b18(0x26c),_0x5d1b18(0x22a),_0x5d1b18(0x457),'sheets-pivot-ui.stdDevName',_0x5d1b18(0x4ae),_0x5d1b18(0x3b9),_0x5d1b18(0x493),_0x5d1b18(0x51b)]){let _0x451bb7=_0x2b4779[_0x433985];if(_0x451bb7+_0x44255e(_0x18c14b,_0x451bb7)===_0xc59437||_0x451bb7+_0x18c14b===_0xc59437)return!0x0;}return!0x1;},Va=(_0x437851,_0x2fdf91,_0x56bab8)=>{const _0x118cf1=_0x1aaa99;let _0x4357c0='';switch(_0x56bab8){case _0x407a23[_0x118cf1(0x4aa)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x301)];break;case _0x407a23[_0x118cf1(0x350)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x3b4)];break;case _0x407a23[_0x118cf1(0x2bf)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x546)];break;case _0x407a23[_0x118cf1(0x30b)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x26c)];break;case _0x407a23[_0x118cf1(0x18c)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x22a)];break;case _0x407a23['product']:_0x4357c0=_0x2fdf91['sheets-pivot-ui.productName'];break;case _0x407a23[_0x118cf1(0xfc)]:_0x4357c0=_0x2fdf91['sheets-pivot-ui.stdDevName'];break;case _0x407a23[_0x118cf1(0xec)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x4ae)];break;case _0x407a23[_0x118cf1(0xc7)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x3b9)];break;case _0x407a23[_0x118cf1(0x2a4)]:_0x4357c0=_0x2fdf91['sheets-pivot-ui.varName'];break;case _0x407a23[_0x118cf1(0x538)]:_0x4357c0=_0x2fdf91[_0x118cf1(0x51b)];break;default:return _0x437851;}return _0x4357c0+_0x44255e(_0x437851,_0x4357c0);};function Ha(_0x3cd6a7,_0x39ec48){const _0x1f91f8=_0x1aaa99;if(_0x39ec48['conditionFilter']&&_0x29f090(_0x39ec48[_0x1f91f8(0x34a)]))return _0x1f91f8(0x48c);if(!_0x3cd6a7)return _0x1f91f8(0xd2);if(_0x23bbe1(_0x3cd6a7))return _0x1f91f8(0x48c);if(_0x3bde09(_0x3cd6a7)){var _0x51f36f;return _0x3cd6a7[_0x1f91f8(0x13b)]||((_0x51f36f=_0x39ec48[_0x1f91f8(0x14e)])==null?void 0x0:_0x51f36f[_0x1f91f8(0x483)])===_0x3cd6a7[_0x1f91f8(0x36e)][_0x1f91f8(0x483)]?'NotFilter':_0x1f91f8(0x48c);}return _0x29f090(_0x3cd6a7)?_0x1f91f8(0x48c):_0x1f91f8(0xd2);}function Ua(_0x308e0d){const _0x41ddb1=_0x1aaa99;return Na(_0x308e0d)?'accounting':Pa(_0x308e0d)?_0x41ddb1(0x20d):Ia(_0x308e0d)?'date':Ra(_0x308e0d)?_0x41ddb1(0x116):_0x41ddb1(0x42d);}function Wa(_0x4bd426){const _0x1ab8a3=_0x1aaa99;let {originPattern:_0x1fd26a='',onChange:_0x3b5005}=_0x4bd426,_0x331872=_0x2140ff(_0x2129e8),[_0x1f3274,_0x696a35]=_0x18aa7d(()=>Ua(_0x1fd26a)),[_0x3b910a,_0x16a249]=_0x18aa7d(()=>ka(_0x1fd26a,0x2)),[_0xa58e7e,_0x553279]=_0x18aa7d(()=>ja(_0x1fd26a)||_0x208996[0x0]),[_0x2b0846,_0x101189]=_0x18aa7d(_0x1fd26a),_0x79941e=_0x38d376(()=>[{'value':_0x1ab8a3(0x42d),'label':_0x331872['t'](_0x1ab8a3(0x1c9))},{'value':_0x1ab8a3(0x4ee),'label':_0x331872['t'](_0x1ab8a3(0x2f8))},{'value':_0x1ab8a3(0x20d),'label':_0x331872['t'](_0x1ab8a3(0x531))},{'value':_0x1ab8a3(0x33a),'label':_0x331872['t'](_0x1ab8a3(0xe1))},{'value':_0x1ab8a3(0x116),'label':_0x331872['t'](_0x1ab8a3(0x2e1))}],[_0x331872]),_0x472776=_0x208996[_0x1ab8a3(0x15d)](_0x4fb8cc=>({'label':_0x4fb8cc,'value':_0x4fb8cc}));function _0x3445a7(_0x188e65){_0x101189(_0x188e65),_0x3b5005(_0x188e65);}function _0x2684ee(_0x51cc15,_0x387ae9){const _0x56ad08=_0x1ab8a3;return $(_0x56ad08(0x566)+_0x51cc15+_0x56ad08(0x323)+(_0x387ae9>0x0?'.0':'')+'_)',_0x387ae9);}function _0x2ceaeb(_0x1314a5){const _0x23a61b=_0x1ab8a3;_0x696a35(_0x1314a5),_0x3445a7(_0x1314a5==='general'?'':_0x1314a5===_0x23a61b(0x4ee)?_0x2684ee(_0xa58e7e,_0x3b910a):_0x1314a5===_0x23a61b(0x20d)?$(fa[0x0]['suffix'](_0xa58e7e),_0x3b910a):_0x1314a5===_0x23a61b(0x33a)?ua[0x0][_0x23a61b(0x26e)]:$(da[0x0][_0x23a61b(0x26e)],_0x3b910a));}function _0x5845da(_0x3f03fa){const _0x2f97ce=_0x1ab8a3;_0x553279(_0x3f03fa),_0x3445a7(_0x1f3274===_0x2f97ce(0x4ee)?_0x2684ee(_0x3f03fa,_0x3b910a):$(fa[0x0][_0x2f97ce(0x26e)](_0x3f03fa),_0x3b910a));}function _0x1aafc0(_0x2b15a5){const _0x350422=_0x1ab8a3;let _0x2a9eec=_0x2b15a5??0x0;_0x16a249(_0x2a9eec),_0x3445a7(_0x1f3274===_0x350422(0x4ee)?_0x2684ee(_0xa58e7e,_0x2a9eec):$(_0x2b0846,_0x2a9eec));}let _0x3db3f8=fa['map'](_0x119872=>({'label':_0x119872['label'](_0xa58e7e),'value':_0x119872[_0x1ab8a3(0x26e)](_0xa58e7e),'color':_0x119872[_0x1ab8a3(0x20c)]})),_0x18f34f=da[_0x1ab8a3(0x15d)](_0x2f2b28=>({'label':_0x2f2b28[_0x1ab8a3(0x517)],'value':_0x2f2b28['suffix'],'color':_0x2f2b28[_0x1ab8a3(0x20c)]})),_0x4c0d57=ua[_0x1ab8a3(0x15d)](_0x29dbcd=>({'label':_0x29dbcd[_0x1ab8a3(0x517)],'value':_0x29dbcd[_0x1ab8a3(0x26e)]}));return _0x81f19b(_0x1ab8a3(0x3cc),{'className':_0x1ab8a3(0x241),'children':[_0x81f19b('div',{'children':[_0x2a3146(_0x1ab8a3(0x3cc),{'className':_0x1ab8a3(0x173),'children':_0x331872['t'](_0x1ab8a3(0x548))}),_0x2a3146(_0x4831b8,{'className':_0x1ab8a3(0x4b1),'value':_0x1f3274,'options':_0x79941e,'onChange':_0xbd63d4=>_0x2ceaeb(_0xbd63d4),'size':'small'})]}),(_0x1f3274===_0x1ab8a3(0x4ee)||_0x1f3274===_0x1ab8a3(0x20d))&&_0x81f19b(_0x1ab8a3(0x3cc),{'className':_0x1ab8a3(0x306),'children':[_0x81f19b('div',{'children':[_0x2a3146('div',{'className':_0x1ab8a3(0x173),'children':_0x331872['t'](_0x1ab8a3(0xf1))}),_0x2a3146(_0x536e2c,{'className':_0x1ab8a3(0x4b1),'value':_0x3b910a,'min':0x0,'max':0x14,'onChange':_0x1aafc0,'size':_0x1ab8a3(0x1a3),'controls':!0x1})]}),_0x81f19b(_0x1ab8a3(0x3cc),{'children':[_0x2a3146(_0x1ab8a3(0x3cc),{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium','children':_0x331872['t'](_0x1ab8a3(0x195))}),_0x2a3146(_0x4831b8,{'className':_0x1ab8a3(0x4b1),'value':_0xa58e7e,'options':_0x472776,'onChange':_0x5845da,'size':_0x1ab8a3(0x1a3)})]})]}),_0x1f3274==='thousandthPercentile'&&_0x81f19b(_0x1ab8a3(0x3cc),{'children':[_0x2a3146('div',{'className':_0x1ab8a3(0x173),'children':_0x331872['t']('sheets-pivot-ui.dialog.numfmt.decimalPlaces')}),_0x2a3146(_0x536e2c,{'className':_0x1ab8a3(0x4b1),'value':_0x3b910a,'min':0x0,'max':0x14,'onChange':_0x1aafc0,'size':'small','controls':!0x1})]}),_0x1f3274===_0x1ab8a3(0x20d)&&_0x2a3146(_0x1a842c,{'className':_0x1ab8a3(0x43e),'options':_0x3db3f8,'value':_0x2b0846,'onChange':_0x47529a=>_0x3445a7($(_0x47529a,_0x3b910a))}),_0x1f3274===_0x1ab8a3(0x33a)&&_0x2a3146(_0x1a842c,{'className':_0x1ab8a3(0x43e),'options':_0x4c0d57,'value':_0x2b0846,'onChange':_0x436598=>_0x3445a7(_0x436598)}),_0x1f3274===_0x1ab8a3(0x116)&&_0x2a3146(_0x1a842c,{'className':_0x1ab8a3(0x43e),'options':_0x18f34f,'value':_0x2b0846,'onChange':_0x385847=>_0x3445a7($(_0x385847,_0x3b910a))}),_0x2a3146(_0x1ab8a3(0x3cc),{'className':_0x1ab8a3(0x15f),'children':_0x331872['t'](_0x1ab8a3(0x2fc)+_0x1f3274+_0x1ab8a3(0x271))})]});}function Ga(_0x5eb582){const _0x14504f=_0x1aaa99;let {unitId:_0x7feb4f,subUnitId:_0x251e7f,pivotTableId:_0x4439f8,tableFieldId:_0x521154,originPattern:_0x41db46,tableFieldInfo:_0x3fcde5,dataFieldInfo:_0x16480d}=_0x5eb582,_0x4f8de7=_0x2140ff(_0x12babc),_0x4c1792=_0x2140ff(_0x4f85fa),_0x39fba3=_0x2140ff(_0x2129e8),[_0x559451,_0x44c48b]=_0x18aa7d(_0x41db46??'');async function _0x359e24(){const _0x57dfca=_0x14e6;let _0x3af0c8={'format':_0x559451,'tableFieldId':_0x521154,'pivotTableId':_0x4439f8,'unitId':_0x7feb4f,'subUnitId':_0x251e7f,'tableFieldInfo':_0x3fcde5,'dataFieldInfo':_0x16480d};await _0x4f8de7[_0x57dfca(0x4e2)](_0x2d9543['id'],_0x3af0c8),_0x4c1792[_0x57dfca(0x2a3)](Mr);}return _0x81f19b(_0x14504f(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-5','dir':_0x39fba3[_0x14504f(0x1d4)](),'children':[_0x2a3146(Wa,{'originPattern':_0x41db46,'onChange':_0x44c48b}),_0x81f19b(_0x113010,{'children':[_0x2a3146(_0x38daeb,{'onClick':()=>_0x4c1792[_0x14504f(0x2a3)](Mr),'size':'middle','children':_0x39fba3['t']('sheets-pivot-ui.dialog.numfmt.cancel')}),_0x2a3146(_0x38daeb,{'variant':_0x14504f(0xc5),'onClick':_0x359e24,'size':_0x14504f(0x1ad),'children':_0x39fba3['t']('sheets-pivot-ui.dialog.numfmt.confirm')})]})]});}function Ka(_0x5b8361){const _0x4f0b30=_0x1aaa99;let {unitId:_0x100fa9,subUnitId:_0x17cc8d,pivotTableId:_0x422d3b,tableFieldId:_0x57f63f,tableFieldInfo:_0x42dbef,dataFieldInfo:_0x146b90,closeFn:_0x145797,format:_0x32e47a,version:_0x324abc}=_0x5b8361,_0x149a2e=_0x2140ff(_0x12babc),_0x400007=_0x2140ff(_0x344ed3),_0x49cba=_0x2140ff(_0x2129e8),[_0x43c6d5,_0x663696]=_0x18aa7d(_0x4f0b30(0x36c)),[_0x4d628b,_0x44b6d8]=_0x18aa7d(_0x42dbef['displayName']),[_0x425d92,_0x2eba0d]=_0x18aa7d(_0x42dbef[_0x4f0b30(0x30f)]),[_0x2c1d08,_0x4966b7]=_0x18aa7d(_0x32e47a??_0x42dbef['format']??''),[_0x17be28,_0x4c8052]=_0x18aa7d(_0x2c1d08);_0x2c2735(()=>{const _0x4f68ef=_0x4f0b30;_0x663696(_0x4f68ef(0x36c)),_0x44b6d8(_0x42dbef['displayName']),_0x2eba0d(_0x42dbef[_0x4f68ef(0x30f)]),_0x4966b7(_0x32e47a??_0x42dbef[_0x4f68ef(0x4c5)]??''),_0x4c8052(_0x32e47a??_0x42dbef[_0x4f68ef(0x4c5)]??'');},[_0x32e47a,_0x42dbef,_0x324abc]);let _0x245b34={..._0x400007[_0x4f0b30(0x52a)]()};[_0x4f0b30(0x301),_0x4f0b30(0x3b4),_0x4f0b30(0x546),_0x4f0b30(0x26c),_0x4f0b30(0x22a),'sheets-pivot-ui.productName','sheets-pivot-ui.stdDevName',_0x4f0b30(0x4ae),_0x4f0b30(0x3b9),_0x4f0b30(0x493),_0x4f0b30(0x51b)]['forEach'](_0x45d6ca=>{_0x245b34[_0x45d6ca]=_0x49cba['t'](_0x45d6ca);});function _0x4d9337(_0xd88da7){const _0x4b42d4=_0x4f0b30;_0x2eba0d(_0xd88da7),Ba(_0x146b90[_0x4b42d4(0x372)],_0x4d628b,_0x245b34)&&_0x44b6d8(Va(_0x146b90['name'],_0x245b34,_0xd88da7));}async function _0x57f63c(){const _0x3fa35f=_0x4f0b30;let _0x43291e={'displayName':_0x42dbef[_0x3fa35f(0x10a)]===_0x4d628b?void 0x0:_0x4d628b,'subtotalType':_0x42dbef[_0x3fa35f(0x30f)]===_0x425d92?void 0x0:_0x425d92,'format':_0x42dbef['format']===_0x2c1d08?void 0x0:_0x2c1d08,'tableFieldId':_0x57f63f,'pivotTableId':_0x422d3b,'unitId':_0x100fa9,'subUnitId':_0x17cc8d,'tableFieldInfo':_0x42dbef,'dataFieldInfo':_0x146b90};await _0x149a2e[_0x3fa35f(0x4e2)](_0x2d9543['id'],_0x43291e),_0x145797();}return _0x43c6d5==='format'?_0x81f19b(_0x4f0b30(0x3cc),{'className':_0x4f0b30(0x3c5),'dir':_0x49cba[_0x4f0b30(0x1d4)](),'children':[_0x81f19b(_0x4f0b30(0x491),{'type':_0x4f0b30(0x491),'className':_0x4f0b30(0x286),'onClick':()=>_0x663696(_0x4f0b30(0x36c)),'children':[_0x2a3146(_0x1d964b,{}),_0x49cba['t'](_0x4f0b30(0x43f))]}),_0x2a3146(Wa,{'originPattern':_0x2c1d08,'onChange':_0x4c8052}),_0x81f19b(_0x113010,{'children':[_0x2a3146(_0x38daeb,{'onClick':()=>_0x663696(_0x4f0b30(0x36c)),'size':_0x4f0b30(0x1ad),'children':_0x49cba['t'](_0x4f0b30(0x313))}),_0x2a3146(_0x38daeb,{'variant':_0x4f0b30(0xc5),'onClick':()=>{_0x4966b7(_0x17be28),_0x663696('field');},'size':'middle','children':_0x49cba['t'](_0x4f0b30(0x37f))})]})]}):_0x81f19b(_0x4f0b30(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-4','dir':_0x49cba['getDirection'](),'children':[_0x81f19b(_0x4f0b30(0x3cc),{'children':[_0x81f19b('div',{'className':_0x4f0b30(0x1b7),'children':[_0x2a3146('span',{'className':_0x4f0b30(0x420),'children':_0x49cba['t']('sheets-pivot-ui.dialog.fieldName')}),_0x2a3146(_0x4f0b30(0x4fb),{'className':'univer-truncate\x20univer-text-xs\x20univer-text-gray-500','children':ha(_0x49cba['t']('sheets-pivot-ui.dialog.sourceName'),_0x146b90[_0x4f0b30(0x372)])})]}),_0x2a3146(_0x1b81fe,{'className':_0x4f0b30(0x198),'value':_0x4d628b,'onChange':_0x44b6d8,'size':_0x4f0b30(0x1a3)})]}),_0x81f19b(_0x4f0b30(0x3cc),{'children':[_0x2a3146('div',{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium','children':_0x49cba['t'](_0x4f0b30(0x36f))}),_0x2a3146('div',{'className':_0x4f0b30(0x348),'children':Oa['map'](_0x158ff0=>_0x81f19b(_0x4f0b30(0x491),{'type':_0x4f0b30(0x491),'className':_0x1d52fd(_0x4f0b30(0xee),{'univer-bg-primary-50\x20dark:!univer-bg-gray-700':_0x425d92===_0x158ff0[_0x4f0b30(0x155)]}),'onClick':()=>_0x4d9337(_0x158ff0[_0x4f0b30(0x155)]),'children':[_0x2a3146(_0x23dd1,{'className':_0x1d52fd('univer-text-primary-600',{'univer-invisible':_0x425d92!==_0x158ff0[_0x4f0b30(0x155)]})}),_0x49cba['t'](_0x158ff0[_0x4f0b30(0x2d5)])]},_0x158ff0[_0x4f0b30(0x155)]))})]}),_0x2a3146(_0x38daeb,{'className':_0x4f0b30(0x4b1),'onClick':()=>{const _0xf5f636=_0x4f0b30;_0x4c8052(_0x2c1d08),_0x663696(_0xf5f636(0x4c5));},'size':'middle','children':_0x49cba['t'](_0x4f0b30(0x303))}),_0x81f19b(_0x113010,{'children':[_0x2a3146(_0x38daeb,{'onClick':_0x145797,'size':'middle','children':_0x49cba['t'](_0x4f0b30(0x3eb))}),_0x2a3146(_0x38daeb,{'variant':'primary','disabled':!_0x4d628b,'onClick':_0x57f63c,'size':_0x4f0b30(0x1ad),'children':_0x49cba['t']('sheets-pivot-ui.dialog.ok')})]})]});}function qa(_0x49e4e1){const _0x4541cf=_0x1aaa99;var _0x135147;let {filterItemInfo:_0x545710,unitId:_0x29435c,subUnitId:_0x557c23}=_0x49e4e1,_0x22877e=_0x2140ff(_0x12babc),_0x1dc30d=_0x2140ff(_0x4f85fa),_0x4f510e=_0x2140ff(_0x2129e8),_0x40e810=_0x2140ff(_0x570eee),_0x1bf0ca=_0x362266(_0x4f510e[_0x4541cf(0x1ee)],_0x4f510e[_0x4541cf(0x1d4)]()),[_0x42a9b2,_0x1e1de2]=_0x18aa7d(()=>{const _0x26aa42=_0x4541cf;var _0x1741b9;return _0x545710[_0x26aa42(0x26f)]??((_0x1741b9=_0x545710[_0x26aa42(0x34e)])==null?void 0x0:_0x1741b9[_0x26aa42(0x36e)])??_0x545710[_0x26aa42(0x14e)];}),[_0x4aa7ff,_0x593077]=_0x18aa7d(()=>_0x545710[_0x4541cf(0x37c)]??[]),[_0x2c9a33,_0x1e0e33]=_0x18aa7d((_0x135147=_0x545710['sortInfo'])==null?void 0x0:_0x135147[_0x4541cf(0x155)]),_0x9cba60=_0x4aa7ff['length']===0x0&&_0x42a9b2[_0x4541cf(0x483)]===_0x545710['items']['length'],_0x5307a2=Ha(_0x545710[_0x4541cf(0x34e)],{'items':_0x545710['items'],'conditionFilter':_0x545710[_0x4541cf(0x34a)]});_0x2c2735(()=>{const _0x49b6f4=_0x4541cf;let _0x16bab6=_0x40e810[_0x49b6f4(0x2ab)](_0x36df91[_0x49b6f4(0x416)]);if(!_0x16bab6)return;let _0x174c06=_0x16bab6[_0x49b6f4(0x452)][_0x49b6f4(0x358)](_0x3f8e18=>{(_0x3f8e18==null?void 0x0:_0x3f8e18['getSheetId']())!==_0x557c23&&_0x1dc30d['close'](Or);});return()=>_0x174c06[_0x49b6f4(0x442)]();},[_0x1dc30d,_0x557c23,_0x40e810]);function _0x567760(){const _0x5d5c11=_0x4541cf;_0x1dc30d[_0x5d5c11(0x2a3)](Or);}function _0x4b10e9(_0x5a9891){const _0x1f945d=_0x4541cf;_0x4aa7ff[_0x1f945d(0x444)](_0x5a9891)?(_0x593077(_0x395fcf=>_0x395fcf[_0x1f945d(0x474)](_0x2d93b2=>_0x2d93b2!==_0x5a9891)),_0x1e1de2(_0x8a93fc=>[..._0x8a93fc,_0x5a9891])):_0x1e1de2(_0x2218f3=>_0x2218f3['includes'](_0x5a9891)?_0x2218f3[_0x1f945d(0x474)](_0x3ba310=>_0x3ba310!==_0x5a9891):[..._0x2218f3,_0x5a9891]);}async function _0x1ccdf6(_0x35240f,_0x201474,_0x34cf9a,_0x1b0af2=!0x1){const _0x2070c5=_0x4541cf;await _0x22877e[_0x2070c5(0x4e2)](_0x1d4592['id'],{'unitId':_0x29435c,'subUnitId':_0x557c23,'pivotTableId':_0x545710[_0x2070c5(0x53d)],'tableFieldId':_0x545710[_0x2070c5(0x1b1)],'items':_0x35240f,'partialItems':_0x34cf9a,'isAll':_0x201474,'clearAllFilters':_0x1b0af2}),_0x567760();}async function _0xf00fe2(_0x1bf6f5){const _0x13379d=_0x4541cf;await _0x22877e[_0x13379d(0x4e2)](_0x213b5a['id'],{'unitId':_0x29435c,'subUnitId':_0x557c23,'pivotTableId':_0x545710['pivotTableId'],'tableFieldId':_0x545710[_0x13379d(0x1b1)],'info':{'type':_0x1bf6f5}}),_0x1e0e33(_0x1bf6f5),_0x567760();}return _0x81f19b(_0x4541cf(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-4','dir':_0x1bf0ca,'children':[_0x2a3146(_0x4541cf(0x3cc),{'className':_0x4541cf(0x46f),'children':_0x4f510e['t']('sheets-pivot-ui.filterField')}),_0x81f19b('div',{'className':_0x4541cf(0x3c8),'children':[_0x81f19b(_0x38daeb,{'className':_0x1d52fd('',{'univer-bg-gray-100\x20dark:!univer-bg-gray-700':_0x2c9a33===_0x37cdcc[_0x4541cf(0x1f5)]}),'onClick':()=>_0xf00fe2(_0x37cdcc['ascending']),'size':_0x4541cf(0x1ad),'children':[_0x2a3146(_0x1eab93,{}),_0x4f510e['t']('sheets-pivot-ui.dialog.filter.ascending')]}),_0x81f19b(_0x38daeb,{'className':_0x1d52fd('',{'univer-bg-gray-100\x20dark:!univer-bg-gray-700':_0x2c9a33===_0x37cdcc[_0x4541cf(0x321)]}),'onClick':()=>_0xf00fe2(_0x37cdcc['descending']),'size':'middle','children':[_0x2a3146(_0xf36326,{}),_0x4f510e['t'](_0x4541cf(0x1cc))]})]}),_0x81f19b('div',{'className':_0x4541cf(0x534),'children':[_0x2a3146(_0x4541cf(0x3cc),{'className':_0x4541cf(0x34f),'children':_0x2a3146(_0x180ca8,{'checked':_0x9cba60,'indeterminate':!_0x9cba60&&(_0x42a9b2['length']>0x0||_0x4aa7ff[_0x4541cf(0x483)]>0x0),'onChange':()=>{_0x593077([]),_0x1e1de2(_0x9cba60?[]:_0x545710['items']);},'children':_0x4f510e['t'](_0x4541cf(0x459))})}),_0x545710[_0x4541cf(0x14e)][_0x4541cf(0x15d)]((_0x455c82,_0x15221d)=>{const _0x4891b5=_0x4541cf;var _0x314ded;let _0x3f9060=_0x545710[_0x4891b5(0x44a)][_0x15221d],_0x32b31e=(_0x314ded=_0x545710[_0x4891b5(0x38b)])==null?void 0x0:_0x314ded[_0x455c82],_0x51e4a5=ma(_0x455c82,_0x3f9060),_0x298a51=_0x455c82;return _0x51e4a5?_0x298a51=_0x4f510e['t'](_0x51e4a5):_0x32b31e===void 0x0?_0x3f9060===_0xe427cd[_0x4891b5(0x33a)]&&_0x545710[_0x4891b5(0x4c5)]&&(_0x298a51=_0xd5638d[_0x4891b5(0x4c5)](_0x545710['format'],Number(_0x455c82))):_0x298a51=_0x32b31e,_0x2a3146(_0x4891b5(0x3cc),{'className':_0x4891b5(0x34f),'children':_0x2a3146(_0x180ca8,{'checked':_0x42a9b2[_0x4891b5(0x444)](_0x455c82),'indeterminate':_0x4aa7ff[_0x4891b5(0x444)](_0x455c82),'contentClassName':'univer-max-w-[70vw]\x20univer-truncate','onChange':()=>_0x4b10e9(_0x455c82),'children':_0x298a51})},_0x455c82);})]}),_0x2a3146(_0x38daeb,{'className':_0x4541cf(0x4b1),'variant':'link','disabled':_0x5307a2===_0x4541cf(0xd2),'onClick':()=>_0x1ccdf6(_0x545710[_0x4541cf(0x14e)],!0x0,[],!0x0),'size':_0x4541cf(0x1ad),'children':_0x4f510e['t'](_0x4541cf(0x33e))}),_0x81f19b(_0x113010,{'children':[_0x2a3146(_0x38daeb,{'onClick':_0x567760,'size':_0x4541cf(0x1ad),'children':_0x4f510e['t']('sheets-pivot-ui.dialog.filter.cancel')}),_0x2a3146(_0x38daeb,{'variant':_0x4541cf(0xc5),'disabled':!_0x42a9b2[_0x4541cf(0x483)]&&!_0x4aa7ff[_0x4541cf(0x483)],'onClick':()=>_0x1ccdf6(_0x42a9b2,_0x9cba60,_0x4aa7ff),'size':_0x4541cf(0x1ad),'children':_0x4f510e['t'](_0x4541cf(0x263))})]})]});}const Ja=[{'label':_0x1aaa99(0x440),'value':_0x1aaa99(0x2ec)},{'label':'sheets-pivot-ui.config.pageOverThenDown','value':_0x1aaa99(0x53a)}],Ya=[{'label':_0x1aaa99(0xde),'value':String(_0x56ebe5[_0x1aaa99(0x15a)])},{'label':_0x1aaa99(0x138),'value':String(_0x56ebe5[_0x1aaa99(0x3e9)])},{'label':_0x1aaa99(0x4f7),'value':String(_0x56ebe5[_0x1aaa99(0xe0)])}],Xa=[{'label':_0x1aaa99(0x4f1),'value':String(_0x199ba4['top'])},{'label':_0x1aaa99(0x406),'value':String(_0x199ba4[_0x1aaa99(0x43c)])}],Za=[{'label':_0x1aaa99(0x22b),'value':_0x161a50[_0x1aaa99(0x405)]},{'label':'sheets-pivot-ui.config.dateGroupingExcelLike','value':_0x161a50[_0x1aaa99(0x284)]}];function Qa(_0x49da56){const _0x527865=_0x1aaa99;let {unitId:_0x4c5364,subUnitId:_0x4827d8,pivotTableId:_0x5b5149}=_0x49da56,_0x1b7ad=_0x2140ff(_0x12babc),_0x28f261=_0x2140ff(_0x7c076c),_0x144391=_0x2140ff(_0x3e0dae),_0x4d313b=_0x2140ff(_0x2129e8),_0x309cfc=_0x2140ff(_0x344ed3),_0x3c74af=_0x38d376(()=>_0x309cfc[_0x527865(0x49e)](_0x4c5364,_0x4827d8,_0x5b5149)[_0x527865(0x49b)](_0xef7484(0x0)),[_0x309cfc,_0x4c5364,_0x4827d8,_0x5b5149]);_0x362266(_0x3c74af);let [_0x5a8f1e,_0xb234bc]=_0x18aa7d(!0x1),_0x59894b=_0x25e96e(!0x1),_0x264296=_0x309cfc['getPivotTableConfig'](_0x4c5364,_0x4827d8,_0x5b5149),_0x5469c0=_0x470709(_0x264296==null?void 0x0:_0x264296[_0x527865(0x4e3)]['options']),[_0x4ef003,_0xaa02cc]=_0x18aa7d(()=>{const _0x15b859=_0x527865;var _0x13d986,_0x1944de;let _0x504124=_0x309cfc[_0x15b859(0x2fa)](_0x4c5364,_0x4827d8,_0x5b5149),_0x20f3a6=(_0x504124==null||(_0x13d986=_0x504124[_0x15b859(0x4e3)])==null?void 0x0:_0x13d986[_0x15b859(0x103)])??{};return{'showRowSubtotal':_0x20f3a6[_0x15b859(0x214)]??!0x0,'showRowGrandTotal':_0x20f3a6[_0x15b859(0x482)]??!0x0,'showColSubtotal':_0x20f3a6[_0x15b859(0x369)]??!0x0,'showColGrandTotal':_0x20f3a6['showColGrandTotal']??!0x0,'pageWrap':_0x20f3a6[_0x15b859(0x4eb)]??0x1,'pageOverThenDown':_0x20f3a6[_0x15b859(0x229)]??!0x1,'repeatRowLabels':_0x20f3a6[_0x15b859(0x397)]??!0x1,'repeatColLabels':_0x20f3a6[_0x15b859(0x339)]??!0x1,'layout':(_0x504124==null||(_0x1944de=_0x504124[_0x15b859(0x4e3)])==null?void 0x0:_0x1944de['layout'])??_0x56ebe5['tabular'],'rowSubtotalPosition':_0x20f3a6[_0x15b859(0x436)]??_0x199ba4[_0x15b859(0x3f5)]};});function _0x577b9b(_0x5e64a7){const _0x583a5d=_0x527865;let _0x40ddcd={'unitId':_0x4c5364,'subUnitId':_0x4827d8,'pivotTableId':_0x5b5149,'options':_0x5e64a7};return _0xaa02cc(_0x5d6545=>({..._0x5d6545,..._0x5e64a7})),_0x1b7ad[_0x583a5d(0x4e2)](_0x4c22c7['id'],_0x40ddcd)[_0x583a5d(0x17b)](_0x293f63=>_0x144391['error'](_0x583a5d(0x17f),_0x293f63));}function _0xa6434f(_0x27b30a){const _0x352213=_0x527865;let _0x1e83de={'unitId':_0x4c5364,'subUnitId':_0x4827d8,'pivotTableId':_0x5b5149,'layout':_0x27b30a};return _0xaa02cc(_0x385dab=>({..._0x385dab,'layout':_0x27b30a})),_0x1b7ad['executeCommand'](_0x4a0aca['id'],_0x1e83de)[_0x352213(0x17b)](_0x2e9e37=>_0x144391[_0x352213(0x344)](_0x352213(0x17f),_0x2e9e37));}async function _0x18cf32(_0x4dc7cc){const _0x5414c6=_0x527865;if(!(_0x59894b[_0x5414c6(0x312)]||_0x4dc7cc===_0x5469c0)){_0x59894b[_0x5414c6(0x312)]=!0x0,_0xb234bc(!0x0);try{let _0x21dda0=_0x309cfc[_0x5414c6(0x2fa)](_0x4c5364,_0x4827d8,_0x5b5149),_0x5f09b3=_0x309cfc[_0x5414c6(0x1f1)](_0x4c5364,_0x5b5149);if(!_0x21dda0||!_0x5f09b3||(Object['values'](_0x5f09b3[_0x5414c6(0x479)])[_0x5414c6(0x156)](_0x16d347)||_0x5f09b3['customFields'][_0x5414c6(0x156)](_0x16d347))&&!await _0x28f261[_0x5414c6(0x1a6)]({'id':_0x5414c6(0x1a0),'title':{'title':_0x4d313b['t']('sheets-pivot-ui.config.dateGroupingSwitchTitle')},'children':{'title':_0x4d313b['t'](_0x5414c6(0x565))},'cancelText':_0x4d313b['t'](_0x5414c6(0x3eb)),'confirmText':_0x4d313b['t'](_0x5414c6(0x299))})||_0x309cfc[_0x5414c6(0x2fa)](_0x4c5364,_0x4827d8,_0x5b5149)!==_0x21dda0||_0x309cfc[_0x5414c6(0x1f1)](_0x4c5364,_0x5b5149)!==_0x5f09b3||_0x470709(_0x21dda0[_0x5414c6(0x4e3)]['options'])===_0x4dc7cc)return;await _0x1b7ad['executeCommand'](_0x4c22c7['id'],{'unitId':_0x4c5364,'subUnitId':_0x4827d8,'pivotTableId':_0x5b5149,'options':{'dateGroupingMode':_0x4dc7cc}});}catch(_0xed3dd){_0x144391[_0x5414c6(0x344)](_0x5414c6(0x17f),_0xed3dd);}finally{_0x59894b[_0x5414c6(0x312)]=!0x1,_0xb234bc(!0x1);}}}let _0x18a1a8=_0x3d6848=>_0x3d6848[_0x527865(0x15d)](_0x465235=>({..._0x465235,'label':_0x4d313b['t'](_0x465235['label'])}));return _0x81f19b('div',{'className':_0x527865(0x21f),'children':[_0x81f19b(_0x527865(0x4c9),{'className':_0x527865(0x4f3),'children':[_0x2a3146('div',{'className':_0x527865(0x35e),'children':_0x4d313b['t'](_0x527865(0x4fc))}),_0x81f19b(_0x527865(0x3cc),{'className':'univer-flex\x20univer-min-h-10\x20univer-items-center\x20univer-justify-between\x20univer-gap-3','children':[_0x2a3146(_0x527865(0x4fb),{'className':_0x527865(0x2d0),'children':_0x4d313b['t']('sheets-pivot-ui.config.dateGroupingMode')}),_0x2a3146(_0x4831b8,{'className':'univer-w-40','value':_0x5469c0,'options':_0x18a1a8(Za),'disabled':_0x5a8f1e,'onChange':_0x1ab400=>_0x18cf32(_0x1ab400),'size':'small'})]}),_0x81f19b('div',{'className':_0x527865(0x114),'children':[_0x2a3146('span',{'className':_0x527865(0x2d0),'children':_0x4d313b['t']('sheets-pivot-ui.config.layout')}),_0x2a3146(_0x4831b8,{'className':_0x527865(0xc9),'value':String(_0x4ef003[_0x527865(0x443)]),'options':_0x18a1a8(Ya),'onChange':_0x219b8f=>_0xa6434f(Number(_0x219b8f)),'size':_0x527865(0x1a3)})]}),_0x2a3146(_0x180ca8,{'checked':_0x4ef003[_0x527865(0x397)],'disabled':_0x4ef003[_0x527865(0x443)]===_0x56ebe5[_0x527865(0x3e9)],'onChange':_0x3a916a=>_0x577b9b({'repeatRowLabels':!!_0x3a916a}),'children':_0x4d313b['t'](_0x527865(0x362))}),_0x2a3146(_0x180ca8,{'checked':_0x4ef003['repeatColLabels'],'onChange':_0x57bc34=>_0x577b9b({'repeatColLabels':!!_0x57bc34}),'children':_0x4d313b['t']('sheets-pivot-ui.config.repeatColLabels')})]}),_0x81f19b(_0x527865(0x4c9),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-3','children':[_0x2a3146(_0x527865(0x3cc),{'className':'univer-text-sm\x20univer-font-medium\x20univer-text-gray-600','children':_0x4d313b['t'](_0x527865(0x48a))}),_0x2a3146(_0x180ca8,{'checked':_0x4ef003[_0x527865(0x214)],'onChange':_0x1b8563=>_0x577b9b({'showRowSubtotal':!!_0x1b8563}),'children':_0x4d313b['t']('sheets-pivot-ui.config.showRowSubtotal')}),_0x4ef003[_0x527865(0x443)]===_0x56ebe5['outline']&&_0x81f19b('div',{'className':_0x527865(0x114),'children':[_0x2a3146(_0x527865(0x4fb),{'className':_0x527865(0x2d0),'children':_0x4d313b['t']('sheets-pivot-ui.config.rowSubtotalPosition')}),_0x2a3146(_0x4831b8,{'className':_0x527865(0xc9),'value':String(_0x4ef003['rowSubtotalPosition']),'options':_0x18a1a8(Xa),'onChange':_0x54b754=>_0x577b9b({'rowSubtotalPosition':Number(_0x54b754)}),'size':'small'})]}),_0x2a3146(_0x180ca8,{'checked':_0x4ef003[_0x527865(0x482)],'onChange':_0xd7c7e7=>_0x577b9b({'showRowGrandTotal':!!_0xd7c7e7}),'children':_0x4d313b['t'](_0x527865(0x1af))}),_0x2a3146(_0x180ca8,{'checked':_0x4ef003[_0x527865(0x369)],'onChange':_0x36203d=>_0x577b9b({'showColSubtotal':!!_0x36203d}),'children':_0x4d313b['t'](_0x527865(0x1c6))}),_0x2a3146(_0x180ca8,{'checked':_0x4ef003[_0x527865(0x1c0)],'onChange':_0x951d4d=>_0x577b9b({'showColGrandTotal':!!_0x951d4d}),'children':_0x4d313b['t'](_0x527865(0x1d5))})]}),_0x81f19b(_0x527865(0x4c9),{'className':_0x527865(0x4f3),'children':[_0x2a3146('div',{'className':_0x527865(0x35e),'children':_0x4d313b['t'](_0x527865(0x15c))}),_0x81f19b(_0x527865(0x3cc),{'className':_0x527865(0x114),'children':[_0x2a3146(_0x527865(0x4fb),{'className':_0x527865(0x2d0),'children':_0x4d313b['t'](_0x527865(0x4c6))}),_0x2a3146(_0x536e2c,{'className':_0x527865(0x55b),'value':_0x4ef003['pageWrap'],'min':0x1,'max':0x14,'onChange':_0x28b0c0=>{const _0x2aa1b9=_0x527865;let _0x12f3b8=Number(_0x28b0c0);return Number[_0x2aa1b9(0x3f4)](_0x12f3b8)&&_0x12f3b8>=0x1?_0x577b9b({'pageWrap':_0x12f3b8}):void 0x0;},'size':_0x527865(0x1a3),'controls':!0x1})]}),_0x2a3146('p',{'className':_0x527865(0xdc),'children':_0x4d313b['t'](_0x4ef003['pageOverThenDown']?'sheets-pivot-ui.config.pageWrapOverThenDownHelp':_0x527865(0xe3))}),_0x81f19b(_0x527865(0x3cc),{'className':_0x527865(0x114),'children':[_0x2a3146(_0x527865(0x4fb),{'className':_0x527865(0x2d0),'children':_0x4d313b['t'](_0x527865(0x458))}),_0x2a3146(_0x4831b8,{'className':_0x527865(0xc9),'value':String(_0x4ef003[_0x527865(0x229)]),'options':_0x18a1a8(Ja),'onChange':_0x24977f=>_0x577b9b({'pageOverThenDown':_0x24977f==='true'}),'size':_0x527865(0x1a3)})]})]})]});}function $a(_0x5ac29f,_0x51a1d3,_0x41d30e,_0x4a2d70){const _0x4db574=_0x1aaa99;let _0x5525bf=[];return _0x51a1d3>0x0&&_0x5525bf['push'](_0x4db574(0x4b5)),_0x51a1d3<_0x41d30e-0x1&&_0x5525bf['push'](_0x4db574(0x262)),_0x4a2d70?(_0x5525bf['push'](_0x5ac29f===_0x4db574(0x187)?_0x4db574(0x2f0):'moveToColumn'),_0x5525bf[_0x4db574(0x29b)](_0x4db574(0x2c0)),_0x5525bf):(_0x5ac29f!==_0x4db574(0x474)&&_0x5525bf[_0x4db574(0x29b)](_0x4db574(0x3a8)),_0x5ac29f!==_0x4db574(0x187)&&_0x5525bf[_0x4db574(0x29b)](_0x4db574(0x1d2)),_0x5ac29f!==_0x4db574(0x220)&&_0x5525bf[_0x4db574(0x29b)](_0x4db574(0x2f0)),_0x5ac29f===_0x4db574(0xd6)?_0x5525bf[_0x4db574(0x29b)](_0x4db574(0x51e)):(_0x5525bf[_0x4db574(0x29b)]('moveToValue'),_0x5525bf[_0x4db574(0x29b)]('filter')),_0x5525bf['push'](_0x4db574(0x2c0)),_0x5525bf);}const eo=[_0x1aaa99(0x474),_0x1aaa99(0x187),_0x1aaa99(0x220),_0x1aaa99(0xd6)];function to(_0xdd83be,_0x7fd04c){const _0x6ed7d5=_0x1aaa99;switch(_0x7fd04c){case _0x6ed7d5(0x474):return _0xdd83be[_0x6ed7d5(0x2ea)];case'column':return _0xdd83be[_0x6ed7d5(0x39e)];case'row':return _0xdd83be[_0x6ed7d5(0x12b)];case _0x6ed7d5(0xd6):return _0xdd83be['valueFields'];default:return[];}}function no(_0x3a832a){const _0x43d652=_0x1aaa99;switch(_0x3a832a){case _0x43d652(0x474):return _0x43d652(0x3f9);case _0x43d652(0x187):return'sheets-pivot-ui.column';case _0x43d652(0x220):return'sheets-pivot-ui.row';default:return _0x43d652(0x132);}}function ro(_0x36d811){const _0x408be7=_0x1aaa99;switch(_0x36d811){case _0x408be7(0x474):return'sheets-pivot-ui.mobile.filterDesc';case _0x408be7(0x187):return _0x408be7(0x129);case _0x408be7(0x220):return _0x408be7(0x3f1);default:return'sheets-pivot-ui.valueDesc';}}function io(_0x2cd551){const _0x354504=_0x1aaa99;switch(_0x2cd551[_0x354504(0x1ec)]){case _0x354504(0x474):return _0x2a3146(_0x5e491f,{});case _0x354504(0x187):return _0x2a3146(_0x107601,{});case _0x354504(0x220):return _0x2a3146(_0x2b6f12,{});default:return _0x2a3146(_0x1b475a,{});}}function ao(_0x54bbf8){const _0x5ad87c=_0x1aaa99;switch(_0x54bbf8){case'moveUp':return _0x5ad87c(0x17d);case'moveDown':return'sheets-pivot-ui.mobile.moveDown';case _0x5ad87c(0x3a8):return _0x5ad87c(0xfa);case _0x5ad87c(0x1d2):return _0x5ad87c(0x4f9);case _0x5ad87c(0x2f0):return _0x5ad87c(0xcd);case'moveToValue':return _0x5ad87c(0x164);case'filter':return _0x5ad87c(0x513);case'settings':return _0x5ad87c(0x228);default:return _0x5ad87c(0x2d8);}}function oo(_0x315177){const _0x434dc8=_0x1aaa99;switch(_0x315177){case _0x434dc8(0x3a8):return _0x434dc8(0x474);case _0x434dc8(0x1d2):return'column';case _0x434dc8(0x2f0):return _0x434dc8(0x220);case _0x434dc8(0x2f7):return _0x434dc8(0xd6);default:return null;}}function so(_0x3f1882){const _0x5baacb=_0x1aaa99;let {area:_0x1ca3b5,field:_0x429e90,index:_0x1cc6ee,fieldCount:_0x11cc28,info:_0x44c6fb,pivotTableId:_0x561c26,unitId:_0x54d20f,subUnitId:_0x5d98bb,refresh:_0x581a95}=_0x3f1882,_0x4b25ee=_0x2140ff(_0x12babc),_0x2e86cf=_0x2140ff(_0x2129e8),_0x4f731c=_0x429e90[_0x5baacb(0x1b1)]===pa,_0x2c22d9={'pivotTableInfo':_0x44c6fb,'pivotTableId':_0x561c26,'commandService':_0x4b25ee,'unitId':_0x54d20f,'subUnitId':_0x5d98bb};async function _0x537c0b(_0x4dceba){const _0x83b5cf=_0x5baacb;if(_0x4dceba===_0x83b5cf(0x474)){Ea(_0x4b25ee,_0x54d20f,_0x5d98bb,_0x561c26,_0x429e90['tableFieldId']);return;}if(_0x4dceba===_0x83b5cf(0x51e)){Da(_0x4b25ee,_0x561c26,_0x429e90[_0x83b5cf(0x1b1)],_0x54d20f,_0x5d98bb,_0x44c6fb);return;}if(_0x4dceba===_0x83b5cf(0x2c0)){await ya(_0x2c22d9,_0x429e90[_0x83b5cf(0x1b1)],_0x1ca3b5),await _0x581a95();return;}let _0x1521a8=oo(_0x4dceba)??_0x1ca3b5,_0x14aeeb=to(_0x44c6fb,_0x1521a8)[_0x83b5cf(0x483)];_0x4dceba==='moveUp'?_0x14aeeb=_0x1cc6ee-0x1:_0x4dceba===_0x83b5cf(0x262)&&(_0x14aeeb=_0x1cc6ee+0x1),await Sa(_0x2c22d9,_0x429e90['tableFieldId'],_0x1ca3b5,_0x1521a8,_0x14aeeb),await _0x581a95();}let _0x11fe72=$a(_0x1ca3b5,_0x1cc6ee,_0x11cc28,_0x4f731c)['map'](_0x333cea=>({'type':_0x5baacb(0x35d),'children':_0x2e86cf['t'](ao(_0x333cea)),'variant':_0x333cea==='remove'?_0x5baacb(0x2d2):_0x5baacb(0x4b2),'onSelect':()=>_0x537c0b(_0x333cea)}));return _0x81f19b(_0x5baacb(0x3cc),{'className':_0x5baacb(0x270),'children':[_0x2a3146(_0x5baacb(0x4ed),{'className':_0x5baacb(0x542),'dir':'auto','children':_0x4f731c?_0x2e86cf['t'](_0x5baacb(0x476)):_0x429e90['displayName']}),_0x2a3146(_0x147dcb,{'items':_0x11fe72,'children':_0x2a3146(_0x5baacb(0x491),{'type':'button','className':_0x5baacb(0x291),'children':_0x2a3146(_0x35b17e,{})})})]});}function co(_0xfd5966){const _0x57e230=_0x1aaa99;let _0x34194f=_0x2140ff(_0x2129e8);return _0x2a3146('div',{'className':_0x57e230(0x241),'children':eo[_0x57e230(0x15d)](_0x2439c2=>{const _0x15e2fe=_0x57e230;let _0x720667=to(_0xfd5966[_0x15e2fe(0x1b8)],_0x2439c2);return _0x81f19b(_0x15e2fe(0x4c9),{'children':[_0x81f19b(_0x15e2fe(0x3cc),{'className':_0x15e2fe(0x519),'children':[_0x2a3146(io,{'area':_0x2439c2}),_0x34194f['t'](no(_0x2439c2))]}),_0x2a3146('div',{'className':'univer-rounded-xl\x20univer-bg-gray-50\x20univer-p-1\x20dark:!univer-bg-gray-800','children':_0x720667['length']?_0x720667[_0x15e2fe(0x15d)]((_0x175a84,_0x231b46)=>_0x2a3146(so,{..._0xfd5966,'area':_0x2439c2,'field':_0x175a84,'index':_0x231b46,'fieldCount':_0x720667[_0x15e2fe(0x483)]},_0x175a84[_0x15e2fe(0x1b1)])):_0x2a3146(_0x15e2fe(0x3cc),{'className':'univer-p-4\x20univer-text-center\x20univer-text-xs\x20univer-text-gray-500','children':_0x34194f['t'](ro(_0x2439c2))})})]},_0x2439c2);})});}function lo(_0x4d6aaa,_0x48a8f9){const _0x2709a3=_0x1aaa99;switch(_0x48a8f9){case _0x2709a3(0x474):return _0x4d6aaa[_0x2709a3(0x2ea)][_0x2709a3(0x483)];case'column':return _0x4d6aaa['columnFields']['length'];case'row':return _0x4d6aaa[_0x2709a3(0x12b)][_0x2709a3(0x483)];case _0x2709a3(0xd6):return _0x4d6aaa[_0x2709a3(0x3c1)][_0x2709a3(0x483)];default:return 0x0;}}function uo(_0x4d35bf){const _0x475cd9=_0x1aaa99;let _0x5ba659=_0x475cd9(0x511);switch(_0x4d35bf[_0x475cd9(0x155)]){case _0xe427cd[_0x475cd9(0x4b4)]:return _0x2a3146(_0x3577c6,{'className':_0x5ba659});case _0xe427cd[_0x475cd9(0x33a)]:return _0x2a3146(_0x343400,{'className':_0x5ba659});default:return _0x2a3146(_0x571eae,{'className':_0x5ba659});}}function fo(_0x5406c2){const _0x2f77bb=_0x1aaa99;let {field:_0x3ad908,info:_0x129ce3,pivotTableId:_0x5096e1,unitId:_0x4a6881,subUnitId:_0x44602b,refresh:_0x4661e2}=_0x5406c2,_0x2d5178=_0x2140ff(_0x12babc),_0x47b474=_0x2140ff(_0x2129e8),_0x2240bb={'pivotTableInfo':_0x129ce3,'pivotTableId':_0x5096e1,'commandService':_0x2d5178,'unitId':_0x4a6881,'subUnitId':_0x44602b};async function _0xdb38f4(_0x40bcb2){const _0x35f8e1=_0x14e6;if(_0x40bcb2){let _0x5c2497=_0x3ad908['type']===_0xe427cd[_0x35f8e1(0x4b4)]?_0x35f8e1(0xd6):_0x35f8e1(0x220);await Sa(_0x2240bb,_0x3ad908[_0x35f8e1(0x26a)],_0x35f8e1(0x113),_0x5c2497,lo(_0x129ce3,_0x5c2497));}else await ya(_0x2240bb,_0x3ad908[_0x35f8e1(0x26a)],_0x35f8e1(0x113));await _0x4661e2();}async function _0x2c8e1d(_0x27d92d){const _0x4d5e35=_0x14e6;await Sa(_0x2240bb,_0x3ad908['dataFieldId'],_0x4d5e35(0x113),_0x27d92d,lo(_0x129ce3,_0x27d92d)),await _0x4661e2();}let _0x4a5464=[{'type':'item','children':_0x47b474['t'](_0x2f77bb(0x468)),'onSelect':()=>_0x2c8e1d(_0x2f77bb(0x220))},{'type':'item','children':_0x47b474['t'](_0x2f77bb(0x2f2)),'onSelect':()=>_0x2c8e1d(_0x2f77bb(0x187))},{'type':'item','children':_0x47b474['t'](_0x2f77bb(0x1e1)),'onSelect':()=>_0x2c8e1d(_0x2f77bb(0xd6))},{'type':_0x2f77bb(0x35d),'children':_0x47b474['t'](_0x2f77bb(0x4d1)),'onSelect':()=>_0x2c8e1d('filter')}];return _0x81f19b(_0x2f77bb(0x3cc),{'className':_0x2f77bb(0x527),'children':[_0x2a3146(_0x180ca8,{'checked':_0x3ad908[_0x2f77bb(0x371)],'onChange':_0x3a4c3d=>_0xdb38f4(!!_0x3a4c3d)}),_0x2a3146(uo,{'type':_0x3ad908[_0x2f77bb(0x155)]}),_0x2a3146(_0x2f77bb(0x4ed),{'className':_0x2f77bb(0x542),'dir':'auto','children':_0x3ad908[_0x2f77bb(0x372)]}),_0x2a3146(_0x147dcb,{'items':_0x4a5464,'children':_0x2a3146(_0x2f77bb(0x491),{'type':_0x2f77bb(0x491),'className':_0x2f77bb(0x291),'children':_0x2a3146(_0x35b17e,{})})})]});}function po(_0x4d58aa){const _0x17f6d0=_0x1aaa99;let {info:_0x54eca8}=_0x4d58aa,_0x3a02b5=_0x2140ff(_0x2129e8),[_0x53518d,_0x470a60]=_0x18aa7d(''),_0x110077=_0x53518d[_0x17f6d0(0x311)]()['toLocaleLowerCase'](),_0x17b8b8=_0x110077?_0x54eca8[_0x17f6d0(0x3ca)][_0x17f6d0(0x474)](_0x477254=>_0x477254[_0x17f6d0(0x372)]['toLocaleLowerCase']()[_0x17f6d0(0x444)](_0x110077)):_0x54eca8[_0x17f6d0(0x3ca)];return _0x81f19b('section',{'className':_0x17f6d0(0x120),'children':[_0x81f19b(_0x17f6d0(0x3cc),{'children':[_0x2a3146(_0x17f6d0(0x3cc),{'className':_0x17f6d0(0x420),'children':_0x3a02b5['t']('sheets-pivot-ui.sourceFieldTile')}),_0x2a3146(_0x17f6d0(0x3cc),{'className':_0x17f6d0(0x537),'children':_0x3a02b5['t'](_0x17f6d0(0x2b1))})]}),_0x2a3146(_0x1b81fe,{'allowClear':!0x0,'value':_0x53518d,'placeholder':_0x3a02b5['t'](_0x17f6d0(0x12e)),'slot':_0x2a3146(_0x337703,{}),'onChange':_0x470a60,'size':_0x17f6d0(0x1a3)}),_0x2a3146('div',{'className':_0x17f6d0(0x115),'children':_0x17b8b8[_0x17f6d0(0x483)]?_0x17b8b8[_0x17f6d0(0x15d)](_0x44b91c=>_0x2a3146(fo,{..._0x4d58aa,'field':_0x44b91c},_0x44b91c['id'])):_0x2a3146(_0x17f6d0(0x3cc),{'className':_0x17f6d0(0xdf),'children':_0x3a02b5['t'](_0x17f6d0(0x489))})})]});}function mo(_0x2c5e02){const _0x13f5a4=_0x1aaa99;var _0xdea7c6;let {sourceRangeInfo:_0x3ad31e,positionInfo:_0x283b6a,pivotTableId:_0x309c77,refresh:_0x4dee9c}=_0x2c5e02,_0x4ede69=_0x2140ff(_0x12babc),_0x52cc59=_0x2140ff(_0x3e0dae),_0x2824ba=_0x2140ff(_0x2129e8),_0x359412=_0x2140ff(_0x570eee)[_0x13f5a4(0x29e)](_0x3ad31e['unitId']),_0x301e16=(_0x359412==null||(_0xdea7c6=_0x359412['getSheetBySheetId'](_0x3ad31e[_0x13f5a4(0x19f)]))==null?void 0x0:_0xdea7c6[_0x13f5a4(0x4a7)]())??_0x3ad31e[_0x13f5a4(0x207)],[_0x4a5266,_0x507059]=_0x18aa7d(_0x3ad31e[_0x13f5a4(0x22e)]),[_0x283463,_0xcf165b]=_0x18aa7d(_0x301e16),[_0x275e5a,_0x3547ce]=_0x18aa7d('');_0x2c2735(()=>{const _0x3afcaf=_0x13f5a4;_0x507059(_0x3ad31e[_0x3afcaf(0x22e)]),_0xcf165b(_0x301e16);},[_0x301e16,_0x3ad31e]);async function _0xa33090(_0x3d985b){const _0x4aa513=_0x13f5a4;let _0x125f6a=_0x3d985b['split'](',')[_0x4aa513(0x474)](Boolean)[_0x4aa513(0x15d)](_0x1f4fb6)[0x0];if(!_0x125f6a||!_0x359412){_0x3547ce(_0x2824ba['t'](_0x4aa513(0x109)));return;}let _0x415e13=_0x125f6a[_0x4aa513(0x207)]||_0x3ad31e['sheetName'],_0x5637ef=_0x359412[_0x4aa513(0x357)](_0x415e13),_0x239e9a=va(_0x5637ef,_0x125f6a['range']);if(_0x239e9a!==0x2||!_0x5637ef){let _0x555abd=_0x239e9a===0x0?_0x4aa513(0x109):_0x4aa513(0x27a);_0x3547ce(_0x2824ba['t'](_0x555abd));}else _0x3547ce(''),_0x507059(_0x125f6a[_0x4aa513(0x22e)]),_0xcf165b(_0x415e13),await ba(_0x4ede69,_0x309c77,{'unitId':_0x3ad31e[_0x4aa513(0xf8)],'subUnitId':_0x5637ef[_0x4aa513(0x258)](),'range':_0x125f6a[_0x4aa513(0x22e)],'sheetName':_0x415e13},_0x283b6a['unitId'],_0x283b6a['subUnitId']),await _0x4dee9c();}return _0x81f19b(_0x13f5a4(0x4c9),{'children':[_0x2a3146(_0x13f5a4(0x3cc),{'className':_0x13f5a4(0x173),'children':_0x2824ba['t'](_0x13f5a4(0x3db))}),_0x2a3146(_0x4476fb,{'unitId':_0x3ad31e['unitId'],'subUnitId':_0x3ad31e[_0x13f5a4(0x19f)],'initialValue':_0x33a7d7(_0x283463,_0x4a5266),'maxRangeCount':0x1,'keepSheetReference':!0x0,'supportAcrossSheet':!0x0,'onChange':(_0x39cdbc,_0x340031)=>_0xa33090(_0x340031)['catch'](_0x13636e=>{const _0x2d60a8=_0x13f5a4;_0x52cc59['error'](_0x2d60a8(0x269),_0x13636e);})}),_0x275e5a&&_0x2a3146(_0x13f5a4(0x3cc),{'className':_0x13f5a4(0x267),'children':_0x275e5a})]});}function ho(_0x53071b){const _0xc2a5f7=_0x1aaa99;let {pivotTableId:_0x11092d,version:_0x534e5f,unitId:_0x25d3eb,subUnitId:_0x2b043e,panelInfo:_0x24f429}=_0x53071b,_0x21d6ea=_0x2140ff(_0x344ed3),_0x417ad6=_0x2140ff(_0x40b8c0),_0x2b0149=_0x2140ff(_0x3e0dae),_0x2ef5a3=_0x38d376(()=>_0x21d6ea[_0xc2a5f7(0x49e)](_0x25d3eb,_0x2b043e,_0x11092d)[_0xc2a5f7(0x49b)](_0xef7484(0x0)),[_0x21d6ea,_0x25d3eb,_0x2b043e,_0x11092d]),_0x21895c=_0x362266(_0x2ef5a3),[_0x33dc85,_0x93fec0]=_0x18aa7d(_0x24f429),_0x360a27=_0x7784bf(async()=>{const _0x2bbca1=_0xc2a5f7;if(!_0x21d6ea[_0x2bbca1(0x2fa)](_0x25d3eb,_0x2b043e,_0x11092d))return;let _0x2a3373=await _0x417ad6['getPivotDisplayConfig']({'unitId':_0x25d3eb,'subUnitId':_0x2b043e,'pivotTableId':_0x11092d,'params':{'type':_0x4d06ca[_0x2bbca1(0x448)],'panel':{'pivotTableId':_0x11092d}}});_0x2a3373[_0x2bbca1(0x149)][_0x2bbca1(0x298)]&&_0x93fec0(_0x2a3373['result'][_0x2bbca1(0x298)]);},[_0x21d6ea,_0x11092d,_0x417ad6,_0x2b043e,_0x25d3eb]);return _0x2c2735(()=>{const _0x4e6ec9=_0xc2a5f7;_0x360a27()[_0x4e6ec9(0x17b)](_0x940422=>_0x2b0149[_0x4e6ec9(0x344)]('[MobilePivotPanel]',_0x940422));},[_0x21895c,_0x2b0149,_0x360a27,_0x534e5f]),_0x81f19b(_0xc2a5f7(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-5\x20univer-py-4','children':[_0x2a3146(mo,{'sourceRangeInfo':_0x33dc85[_0xc2a5f7(0x49a)],'positionInfo':_0x33dc85[_0xc2a5f7(0x147)],'pivotTableId':_0x11092d,'refresh':_0x360a27}),_0x2a3146(po,{'info':_0x33dc85,'pivotTableId':_0x11092d,'unitId':_0x25d3eb,'subUnitId':_0x2b043e,'refresh':_0x360a27}),_0x2a3146(co,{'info':_0x33dc85,'pivotTableId':_0x11092d,'unitId':_0x25d3eb,'subUnitId':_0x2b043e,'refresh':_0x360a27})]});}function go(_0x3058ed){const _0x375cdb=_0x1aaa99;let {className:_0x2f04e8,unitId:_0x5f2668,subUnitId:_0x332f50,pivotTableId:_0xc45e91}=_0x3058ed,[_0x2f1870,_0x9c7069]=_0x18aa7d(_0x375cdb(0x479)),_0x1eb362=_0x2140ff(_0x2129e8);return _0x81f19b(_0x375cdb(0x3cc),{'className':_0x1d52fd('univer-flex\x20univer-size-full\x20univer-min-h-0\x20univer-flex-col',_0x2f04e8),'dir':_0x1eb362[_0x375cdb(0x1d4)](),'children':[_0x2a3146(_0x13f1d9,{'className':_0x375cdb(0x4f8),'items':[{'label':_0x1eb362['t'](_0x375cdb(0x499)),'value':'fields'},{'label':_0x1eb362['t'](_0x375cdb(0x324)),'value':_0x375cdb(0xbd)}],'value':_0x2f1870,'onChange':_0x9c7069}),_0x2a3146('div',{'className':'univer-min-h-0\x20univer-flex-1\x20univer-overflow-y-auto','children':_0x2f1870==='fields'?_0x2a3146(ho,{..._0x3058ed}):_0x2a3146(Qa,{'unitId':_0x5f2668,'subUnitId':_0x332f50,'pivotTableId':_0xc45e91})})]});}function _o(_0x438525,_0x4100ab){const _0x2119a9=_0x1aaa99;switch(_0x438525){case 0x1:return _0x4100ab['t'](_0x2119a9(0x27a));case 0x0:return _0x4100ab['t'](_0x2119a9(0x109));default:return'';}}function vo(_0x543a39){const _0x4b9683=_0x1aaa99;let {unitId:_0x29fced,subUnitId:_0x4bfd71,sourceRange:_0x558d08,positionRange:_0x14d44e,sourceSheetName:_0x464167,positionSheetName:_0x3887b6,onConfirm:_0x1b658a,onCancel:_0x3411bc}=_0x543a39,_0x11442e=_0x2140ff(_0x2129e8),_0x3dfc4c=_0x2140ff(_0x570eee)[_0x4b9683(0x29e)](_0x29fced),[_0x5de3cb,_0x430c11]=_0x18aa7d(_0x558d08),[_0x2855dd,_0x559a66]=_0x18aa7d(_0x14d44e),[_0x4409d1,_0x2fd0d4]=_0x18aa7d(_0x464167),[_0x1a9778,_0x210641]=_0x18aa7d(_0x3887b6),[_0x29459b,_0x48f0bd]=_0x18aa7d(_0x1e3671['New']),[_0x15fae4,_0x5cbae9]=_0x18aa7d(''),[_0x34acb0,_0x341073]=_0x18aa7d(!0x0);_0x2c2735(()=>{const _0x42451e=_0x4b9683;let _0x52e78d=va(_0x3dfc4c[_0x42451e(0x357)](_0x4409d1),_0x5de3cb);_0x5cbae9(_o(_0x52e78d,_0x11442e));},[_0x11442e,_0x5de3cb,_0x4409d1,_0x3dfc4c]);function _0x595a00(_0x90a586){const _0x2ccb61=_0x4b9683;let _0x55ad69=_0x90a586[_0x2ccb61(0x31b)](',')[_0x2ccb61(0x474)](Boolean)[_0x2ccb61(0x15d)](_0x1f4fb6)[0x0];_0x55ad69?(_0x430c11(_0x55ad69[_0x2ccb61(0x22e)]),_0x2fd0d4(_0x55ad69[_0x2ccb61(0x207)]||_0x4409d1)):_0x5cbae9(_0x11442e['t'](_0x2ccb61(0x109)));}function _0x1ea933(_0x3742b5){const _0x27f16b=_0x4b9683;let _0x3fc083=_0x3742b5[_0x27f16b(0x31b)](',')[_0x27f16b(0x474)](Boolean)[_0x27f16b(0x15d)](_0x1f4fb6)[0x0];if(!_0x3fc083){_0x559a66(null);return;}let _0x1007f1=_0x3fc083['sheetName']||_0x464167;_0x559a66(_0x3fc083[_0x27f16b(0x22e)]),_0x210641(_0x1007f1),_0x341073(_0x1007f1!==_0x4409d1||!_0x1ca723[_0x27f16b(0x4c8)](_0x3fc083['range'],_0x5de3cb));}function _0x37dcfe(){const _0x4af52c=_0x4b9683;if(_0x15fae4)return;let _0x1df836;if(_0x29459b===_0x1e3671[_0x4af52c(0x360)]){if(!_0x2855dd||!_0x34acb0)return;_0x1df836={'sourceRange':_0x5de3cb,'sourceSheetName':_0x4409d1,'positionRange':_0x2855dd,'positionSheetName':_0x1a9778,'positionType':_0x29459b};}else _0x1df836={'sourceRange':_0x5de3cb,'sourceSheetName':_0x4409d1,'positionType':_0x29459b};_0x1b658a(_0x1df836);}return _0x81f19b(_0x4b9683(0x3cc),{'className':_0x4b9683(0x3c5),'dir':_0x11442e[_0x4b9683(0x1d4)](),'children':[_0x81f19b(_0x4b9683(0x4c9),{'children':[_0x2a3146(_0x4b9683(0x3cc),{'className':_0x4b9683(0x173),'children':_0x11442e['t']('sheets-pivot-ui.dialog.source.sourceData')}),_0x2a3146(_0x4476fb,{'unitId':_0x29fced,'subUnitId':_0x4bfd71,'initialValue':_0x33a7d7(_0x4409d1,_0x5de3cb),'maxRangeCount':0x1,'supportAcrossSheet':!0x0,'keepSheetReference':!0x0,'onChange':(_0x5738f0,_0x56b24c)=>_0x595a00(_0x56b24c)}),_0x15fae4&&_0x2a3146(_0x4b9683(0x3cc),{'className':_0x4b9683(0x267),'children':_0x15fae4})]}),_0x81f19b(_0x4b9683(0x4c9),{'children':[_0x2a3146(_0x4b9683(0x3cc),{'className':_0x4b9683(0x173),'children':_0x11442e['t'](_0x4b9683(0x3ea))}),_0x81f19b(_0x5dfabf,{'className':_0x4b9683(0x4f3),'value':_0x29459b,'onChange':_0x43f09c=>_0x48f0bd(_0x43f09c),'children':[_0x2a3146(_0x5996ee,{'value':_0x1e3671[_0x4b9683(0x1a4)],'children':_0x11442e['t'](_0x4b9683(0x340))}),_0x2a3146(_0x5996ee,{'value':_0x1e3671['Existing'],'children':_0x11442e['t'](_0x4b9683(0x3ad))})]}),_0x29459b===_0x1e3671[_0x4b9683(0x360)]&&_0x81f19b('div',{'className':_0x4b9683(0x277),'children':[_0x2a3146(_0x4476fb,{'unitId':_0x29fced,'subUnitId':_0x4bfd71,'initialValue':_0x2855dd?_0x33a7d7(_0x1a9778,_0x2855dd):'','maxRangeCount':0x1,'supportAcrossSheet':!0x0,'keepSheetReference':!0x0,'onChange':(_0xb3565b,_0x2b2457)=>_0x1ea933(_0x2b2457)}),!_0x34acb0&&_0x2a3146(_0x4b9683(0x3cc),{'className':'univer-mt-2\x20univer-text-xs\x20univer-text-red-500','children':_0x11442e['t'](_0x4b9683(0x349))})]})]}),_0x81f19b(_0x113010,{'children':[_0x2a3146(_0x38daeb,{'onClick':_0x3411bc,'size':'middle','children':_0x11442e['t'](_0x4b9683(0x3eb))}),_0x2a3146(_0x38daeb,{'variant':'primary','onClick':_0x37dcfe,'size':_0x4b9683(0x1ad),'children':_0x11442e['t'](_0x4b9683(0x299))})]})]});}function _0x14e6(_0x2105a5,_0x1301a2){_0x2105a5=_0x2105a5-0xbc;const _0x2983dd=_0x2983();let _0x14e6e9=_0x2983dd[_0x2105a5];return _0x14e6e9;}let yo=class extends _0x239c25{constructor(_0x34a750,_0x1224d1){const _0x4dbf83=_0x1aaa99;super(),[[Rr,vo],[Tr,go],[Dr,qa],[kr,Ka],[jr,Ga],[zr,la]][_0x4dbf83(0x2d7)](([_0x5d0cd3,_0x432a54])=>{const _0x376b57=_0x4dbf83;this[_0x376b57(0x320)](_0x34a750[_0x376b57(0x460)](_0x5d0cd3,_0x432a54));}),this[_0x4dbf83(0x320)](_0x1224d1[_0x4dbf83(0x460)]({'PivotTableIcon':_0x3aa39e}));}};yo=Q([Z(0x0,_0x446f3f(_0x2260a2)),Z(0x1,_0x446f3f(_0x3312ae))],yo);function bo(_0x13dba7){const _0xcaa06c=_0x1aaa99;return{'id':Vr['id'],'commandId':Vr['id'],'type':_0x4052c0[_0xcaa06c(0x264)],'icon':_0xcaa06c(0x29c),'title':_0xcaa06c(0xc0),'tooltip':_0xcaa06c(0xc0),'hidden$':_0xaf945e(_0x13dba7,_0x36df91[_0xcaa06c(0x416)]),'disabled$':_0x1f49cd(_0x13dba7,_0x176c34(_0x13dba7,{'workbookTypes':[_0x23a297],'worksheetTypes':[_0x5424ba,_0x20e8fc],'rangeTypes':[_0x4707cc]}))};}const xo={[_0x24e4c4[_0x1aaa99(0x2c6)]]:{[Vr['id']]:{'order':0x1,'gridLayout':{'row':0x2,'column':0x1},'menuItemFactory':bo}},[_0x25e2c4[_0x1aaa99(0x332)]]:{[_0x5cc463[_0x1aaa99(0x52e)]]:{[Vr['id']]:{'order':0x1,'menuItemFactory':bo}}}};let So=class extends _0x239c25{constructor(_0x35e86e){const _0x1e6444=_0x1aaa99;super(),_0x35e86e[_0x1e6444(0x2c3)](xo);}};So=Q([Z(0x0,_0x176317)],So);let Co=class extends _0x239c25{constructor(_0x4501e8,_0x413235,_0x44853f,_0x2f62e9){const _0x83e082=_0x1aaa99;super(),this[_0x83e082(0x437)]=_0x44853f,this[_0x83e082(0x1e9)]=_0x2f62e9,X(this,_0x83e082(0x4d8),null),this[_0x83e082(0x320)](_0x4501e8[_0x83e082(0x36b)](_0x5484c9=>{const _0x5e6ff8=_0x83e082;_0x5484c9['id']===na['id']?this[_0x5e6ff8(0x4d8)]=_0x5484c9[_0x5e6ff8(0x119)][_0x5e6ff8(0x53d)]:_0x5484c9['id']===_0x768732['id']&&_0x5484c9['params'][_0x5e6ff8(0x53d)]===this[_0x5e6ff8(0x4d8)]&&this[_0x5e6ff8(0x28d)]();}));let _0x122e2d=_0x413235[_0x83e082(0x2ab)](_0x36df91[_0x83e082(0x416)]);_0x122e2d&&(this[_0x83e082(0x320)](_0x122e2d[_0x83e082(0x452)][_0x83e082(0x49b)](_0x5a560c(0x1))[_0x83e082(0x358)](()=>this[_0x83e082(0x28d)]())),this[_0x83e082(0x320)](_0x122e2d[_0x83e082(0x39f)]['subscribe'](()=>this['_closePanel']()))),this[_0x83e082(0x320)](this[_0x83e082(0x437)][_0x83e082(0x54e)]['subscribe'](_0x2897ff=>{const _0x42cf27=_0x83e082;_0x2897ff['id']==='UNIVER_SHEET_PIVOT_PANEL_ID'&&_0x2897ff[_0x42cf27(0x154)]===!0x1&&(this['_pivotTableId']=null,this['_closeChildDialogs']());}));}[_0x1aaa99(0x28d)](){const _0x4f807b=_0x1aaa99;this[_0x4f807b(0x4d8)]=null,this[_0x4f807b(0x437)][_0x4f807b(0x2a3)](Er),this[_0x4f807b(0x29f)]();}['_closeChildDialogs'](){const _0x29814a=_0x1aaa99;this[_0x29814a(0x1e9)][_0x29814a(0x2a3)](Or),this['_dialogService']['close'](Ar),this[_0x29814a(0x1e9)][_0x29814a(0x2a3)](Mr);}};Co=Q([Z(0x0,_0x12babc),Z(0x1,_0x570eee),Z(0x2,_0x47511f),Z(0x3,_0x4f85fa)],Co),new Path2D(_0x1aaa99(0xc6));var wo=class{static[_0x1aaa99(0x3d5)](_0x47e603,_0x1bf65f,_0x20e667,_0x42e54a){const _0x248da8=_0x1aaa99;_0x47e603[_0x248da8(0x122)](),_0x3ad316[_0x248da8(0x554)](_0x47e603,{'radius':0x2,'width':0x10,'height':0x10,'fill':_0x42e54a}),_0x47e603[_0x248da8(0x365)]=_0x248da8(0x20e),_0x47e603['strokeStyle']=_0x20e667,_0x47e603['scale'](_0x1bf65f/0x10,_0x1bf65f/0x10),_0x47e603['beginPath'](),_0x47e603['lineWidth']=0x1,_0x47e603[_0x248da8(0x365)]=_0x248da8(0x222),_0x47e603[_0x248da8(0x33f)](0x3,0x4),_0x47e603[_0x248da8(0x2e2)](0xd,0x4),_0x47e603['moveTo'](4.5,0x8),_0x47e603[_0x248da8(0x2e2)](11.5,0x8),_0x47e603[_0x248da8(0x33f)](0x6,0xc),_0x47e603[_0x248da8(0x2e2)](0xa,0xc),_0x47e603['stroke'](),_0x47e603[_0x248da8(0x4e7)]();}static['drawExpand'](_0x1f4bd5,_0x1756e8,_0x88c54e,_0x139676,_0x416034){const _0x5678fc=_0x1aaa99;let _0x5a2cf1=(_0x416034-_0x1756e8)/0x2;_0x1f4bd5['save'](),_0x1f4bd5[_0x5678fc(0x4bb)]=_0x139676,_0x1f4bd5[_0x5678fc(0x194)]=_0x88c54e,_0x1f4bd5[_0x5678fc(0x254)](),_0x1f4bd5[_0x5678fc(0x33f)](0x6,_0x5a2cf1),_0x1f4bd5['lineTo'](0x4+_0x1756e8-0x2,_0x5a2cf1),_0x1f4bd5[_0x5678fc(0x2fb)](0x4+_0x1756e8,_0x5a2cf1,0x4+_0x1756e8,_0x5a2cf1+0x2,0x2),_0x1f4bd5['lineTo'](0x4+_0x1756e8,_0x5a2cf1+_0x1756e8-0x2),_0x1f4bd5[_0x5678fc(0x2fb)](0x4+_0x1756e8,_0x5a2cf1+_0x1756e8,0x4+_0x1756e8-0x2,_0x5a2cf1+_0x1756e8,0x2),_0x1f4bd5['lineTo'](0x6,_0x5a2cf1+_0x1756e8),_0x1f4bd5[_0x5678fc(0x2fb)](0x4,_0x5a2cf1+_0x1756e8,0x4,_0x5a2cf1+_0x1756e8-0x2,0x2),_0x1f4bd5[_0x5678fc(0x2e2)](0x4,_0x5a2cf1+0x2),_0x1f4bd5[_0x5678fc(0x2fb)](0x4,_0x5a2cf1,0x6,_0x5a2cf1,0x2),_0x1f4bd5['closePath'](),_0x1f4bd5[_0x5678fc(0x421)](),_0x1f4bd5[_0x5678fc(0x3a4)](),_0x1f4bd5[_0x5678fc(0x254)](),_0x1f4bd5[_0x5678fc(0x33f)](0x4+_0x1756e8/0x2,_0x5a2cf1+0x2),_0x1f4bd5['lineTo'](0x4+_0x1756e8/0x2,_0x5a2cf1+_0x1756e8-0x2),_0x1f4bd5['moveTo'](0x6,_0x5a2cf1+_0x1756e8/0x2),_0x1f4bd5[_0x5678fc(0x2e2)](0x4+_0x1756e8-0x2,_0x5a2cf1+_0x1756e8/0x2),_0x1f4bd5[_0x5678fc(0x421)](),_0x1f4bd5['restore']();}static[_0x1aaa99(0x32e)](_0x334dac,_0x3cac6f,_0x44ee77,_0x381af2,_0x464c10){const _0x8672f=_0x1aaa99;let _0x59e35d=(_0x464c10-_0x3cac6f)/0x2;_0x334dac[_0x8672f(0x122)](),_0x334dac[_0x8672f(0x4bb)]=_0x381af2,_0x334dac['strokeStyle']=_0x44ee77,_0x334dac['beginPath'](),_0x334dac['moveTo'](0x6,_0x59e35d),_0x334dac[_0x8672f(0x2e2)](0x4+_0x3cac6f-0x2,_0x59e35d),_0x334dac[_0x8672f(0x2fb)](0x4+_0x3cac6f,_0x59e35d,0x4+_0x3cac6f,_0x59e35d+0x2,0x2),_0x334dac[_0x8672f(0x2e2)](0x4+_0x3cac6f,_0x59e35d+_0x3cac6f-0x2),_0x334dac[_0x8672f(0x2fb)](0x4+_0x3cac6f,_0x59e35d+_0x3cac6f,0x4+_0x3cac6f-0x2,_0x59e35d+_0x3cac6f,0x2),_0x334dac[_0x8672f(0x2e2)](0x6,_0x59e35d+_0x3cac6f),_0x334dac[_0x8672f(0x2fb)](0x4,_0x59e35d+_0x3cac6f,0x4,_0x59e35d+_0x3cac6f-0x2,0x2),_0x334dac[_0x8672f(0x2e2)](0x4,_0x59e35d+0x2),_0x334dac[_0x8672f(0x2fb)](0x4,_0x59e35d,0x6,_0x59e35d,0x2),_0x334dac[_0x8672f(0xf5)](),_0x334dac[_0x8672f(0x3a4)](),_0x334dac[_0x8672f(0x421)](),_0x334dac[_0x8672f(0x254)](),_0x334dac[_0x8672f(0x33f)](0x6,_0x59e35d+_0x3cac6f/0x2),_0x334dac['lineTo'](0x4+_0x3cac6f-0x2,_0x59e35d+_0x3cac6f/0x2),_0x334dac[_0x8672f(0x421)](),_0x334dac['restore']();}static[_0x1aaa99(0x18e)](_0x31136d,_0x5ae863,_0x2b04be,_0x1d586b){const _0x28cff2=_0x1aaa99;_0x31136d[_0x28cff2(0x122)](),_0x31136d[_0x28cff2(0x194)]=_0x2b04be,_0x31136d['fillStyle']=_0x1d586b,_0x3ad316['drawWith'](_0x31136d,{'radius':0x2,'width':0x10,'height':0x10,'fill':_0x1d586b}),_0x5ae863[_0x28cff2(0x2d7)](_0x2e28c5=>{const _0x173d6c=_0x28cff2;let _0x4965b4=new Path2D(_0x2e28c5);_0x31136d[_0x173d6c(0x4bb)]=_0x2b04be,_0x31136d['fill'](_0x4965b4,_0x173d6c(0x3b7));}),_0x31136d[_0x28cff2(0x4e7)]();}};const To=['M3.30363\x203C2.79117\x203\x202.51457\x203.60097\x202.84788\x203.99024L6.8\x208.60593V12.5662C6.8\x2012.7184\x206.8864\x2012.8575\x207.02289\x2012.9249L8.76717\x2013.7863C8.96655\x2013.8847\x209.2\x2013.7396\x209.2\x2013.5173V8.60593L13.1521\x203.99024C13.4854\x203.60097\x2013.2088\x203\x2012.6964\x203H3.30363Z'],Eo=['M12.4008\x2013.1831C12.6907\x2013.1831\x2012.9258\x2012.9481\x2012.9258\x2012.6581V4.60873L14.013\x205.69597C14.218\x205.901\x2014.5505\x205.901\x2014.7555\x205.69597C14.9605\x205.49094\x2014.9605\x205.15853\x2014.7555\x204.95351L12.7721\x202.97017C12.5671\x202.76515\x2012.2347\x202.76515\x2012.0297\x202.97017L10.0463\x204.95351C9.84132\x205.15853\x209.84132\x205.49094\x2010.0463\x205.69597C10.2514\x205.901\x2010.5838\x205.901\x2010.7888\x205.69597L11.8758\x204.60901V12.6581C11.8758\x2012.9481\x2012.1108\x2013.1831\x2012.4008\x2013.1831Z',_0x1aaa99(0xef)],Do=[_0x1aaa99(0x4b3),'M1.28069\x204.85444C0.842195\x204.33435\x201.21191\x203.53906\x201.89218\x203.53906H8.59333C9.2736\x203.53906\x209.64331\x204.33435\x209.20482\x204.85443L6.51052\x208.05006V11.6601C6.51052\x2012.2245\x205.94174\x2012.6113\x205.41683\x2012.404L4.48092\x2012.0342C4.1756\x2011.9136\x203.97498\x2011.6186\x203.97498\x2011.2903V8.05006L1.28069\x204.85444Z'],Oo=['M11.9003\x2013.7046C11.9003\x2013.9969\x2011.6633\x2014.2339\x2011.371\x2014.2339C11.0787\x2014.2339\x2010.8417\x2013.9969\x2010.8417\x2013.7046V3.57272L9.74577\x204.66862C9.53906\x204.87534\x209.20391\x204.87534\x208.9972\x204.66862C8.79048\x204.46191\x208.79048\x204.12676\x208.9972\x203.92005L10.9969\x201.92039C11.2036\x201.71368\x2011.5387\x201.71368\x2011.7454\x201.92039L13.7451\x203.92005C13.9518\x204.12676\x2013.9518\x204.46191\x2013.7451\x204.66862C13.5384\x204.87534\x2013.2032\x204.87534\x2012.9965\x204.66862L11.9003\x203.57243V13.7046Z',_0x1aaa99(0x302),'M5.51638\x202.58693C5.23363\x201.81542\x204.14248\x201.81543\x203.85973\x202.58693L2.13245\x207.29995C2.03185\x207.57443\x202.17281\x207.87849\x202.4473\x207.97909C2.72178\x208.07969\x203.02584\x207.93872\x203.12644\x207.66424L3.64346\x206.25351L3.64504\x206.25351H5.73266L6.24968\x207.66424C6.35027\x207.93872\x206.65433\x208.07969\x206.92882\x207.97909C7.2033\x207.87849\x207.34426\x207.57443\x207.24367\x207.29995L5.51638\x202.58693ZM5.34467\x205.19487L4.68806\x203.40325L4.03144\x205.19487H5.34467Z'],ko=[_0x1aaa99(0x31d),_0x1aaa99(0x326),_0x1aaa99(0x127)],Ao=new Set([_0x2f72a2['FilterAll'],_0x2f72a2[_0x1aaa99(0x293)],_0x2f72a2[_0x1aaa99(0x389)],_0x2f72a2['FilterNoneSortNone'],_0x2f72a2['FilteredSortAsc'],_0x2f72a2[_0x1aaa99(0x532)],_0x2f72a2[_0x1aaa99(0x3dd)],_0x2f72a2[_0x1aaa99(0x3bf)],_0x2f72a2['FilterNoneSortDesc']]),jo=new Set([_0x2f72a2[_0x1aaa99(0x1b3)],_0x2f72a2[_0x1aaa99(0x4f4)]]);let Mo=class extends _0x30f8db{constructor(_0x37aec3,_0x1bdc01,_0x2f309d,_0x55cf17){const _0x5d7349=_0x1aaa99;super(_0x37aec3,_0x1bdc01),this[_0x5d7349(0x20a)]=_0x2f309d,this[_0x5d7349(0x141)]=_0x55cf17,X(this,'_cellWidth',0x0),X(this,_0x5d7349(0x2cb),0x0),X(this,'_hovered',!0x1),X(this,'_pivotParams',void 0x0),this[_0x5d7349(0x40a)](_0x1bdc01),this['onPointerDown$'][_0x5d7349(0x556)](_0xe5a354=>this[_0x5d7349(0x17c)](_0xe5a354)),this[_0x5d7349(0x3fc)]['subscribeEvent'](()=>this[_0x5d7349(0xf0)]()),this[_0x5d7349(0x12a)][_0x5d7349(0x556)](()=>this[_0x5d7349(0x106)]());}[_0x1aaa99(0x40a)](_0x1e67cd){const _0x7b7aca=_0x1aaa99;_0x1e67cd[_0x7b7aca(0x16f)]!==void 0x0&&(this[_0x7b7aca(0x2cb)]=_0x1e67cd['cellHeight']),_0x1e67cd[_0x7b7aca(0x2a6)]!==void 0x0&&(this[_0x7b7aca(0x4de)]=_0x1e67cd[_0x7b7aca(0x2a6)]),_0x1e67cd[_0x7b7aca(0x439)]!==void 0x0&&(this[_0x7b7aca(0x1de)]=_0x1e67cd[_0x7b7aca(0x439)]),this[_0x7b7aca(0x25c)]({'width':_0x1e67cd[_0x7b7aca(0x4ff)],'height':_0x1e67cd['height']});}[_0x1aaa99(0x17c)](_0x20ef20){const _0xd016c4=_0x1aaa99;if(_0x20ef20[_0xd016c4(0x491)]===0x2)return;let {col:_0x274831,row:_0x1fae75,unitId:_0x218ed8,subUnitId:_0x4c03f6,buttonType:_0x491508}=this['_pivotParams'];Ao[_0xd016c4(0x36d)](_0x491508)?setTimeout(()=>{const _0x3bf6da=_0xd016c4;this[_0x3bf6da(0x20a)]['executeCommand']($i['id'],{'row':_0x1fae75,'col':_0x274831,'unitId':_0x218ed8,'subUnitId':_0x4c03f6});},0xc8):this[_0xd016c4(0x20a)][_0xd016c4(0x4e2)](_0x8f3145['id'],{'row':_0x1fae75,'col':_0x274831,'unitId':_0x218ed8,'subUnitId':_0x4c03f6,'collapse':_0x491508===_0x2f72a2['Expand']});}['onPointerEnter'](){const _0x36630d=_0x1aaa99;this[_0x36630d(0x495)]=!0x0,this[_0x36630d(0x34b)](_0x73d6ca[_0x36630d(0x1a7)]),this['makeDirty'](!0x0);}[_0x1aaa99(0x106)](){const _0x114b34=_0x1aaa99;this['_hovered']=!0x1,this[_0x114b34(0x34b)](_0x73d6ca[_0x114b34(0x1e4)]),this[_0x114b34(0x212)](!0x0);}[_0x1aaa99(0x3d1)](_0x30fd9f){const _0x9d559c=_0x1aaa99;var _0x13ce67,_0x1da8d1;if(!((_0x13ce67=this[_0x9d559c(0x1de)])!=null&&_0x13ce67['buttonType']))return;let _0x4b7563=this[_0x9d559c(0x141)][_0x9d559c(0x16d)]('primary.600'),_0x3bba7b=this['_themeService'][_0x9d559c(0x16d)]('gray.50');_0x30fd9f[_0x9d559c(0x122)]();let _0x5742c0=new Path2D();_0x5742c0[_0x9d559c(0x2c1)](0x0,0x0,this[_0x9d559c(0x4de)],this['_cellHeight']),_0x30fd9f[_0x9d559c(0x46e)](_0x5742c0),((_0x1da8d1=this[_0x9d559c(0x1de)])==null?void 0x0:_0x1da8d1[_0x9d559c(0x34c)])===_0x2f72a2[_0x9d559c(0x4f4)]?wo[_0x9d559c(0x1fb)](_0x30fd9f,0xc,_0x4b7563,_0x3bba7b,this['_cellHeight']):this[_0x9d559c(0x1de)]['buttonType']===_0x2f72a2[_0x9d559c(0x1b3)]?wo[_0x9d559c(0x32e)](_0x30fd9f,0xc,_0x4b7563,_0x3bba7b,this[_0x9d559c(0x2cb)]):this['_pivotParams']['buttonType']===_0x2f72a2[_0x9d559c(0x139)]||this[_0x9d559c(0x1de)]['buttonType']===_0x2f72a2[_0x9d559c(0x2e6)]?wo[_0x9d559c(0x3d5)](_0x30fd9f,0x10,_0x4b7563,_0x3bba7b):this[_0x9d559c(0x1de)][_0x9d559c(0x34c)]===_0x2f72a2[_0x9d559c(0x293)]||this[_0x9d559c(0x1de)][_0x9d559c(0x34c)]===_0x2f72a2[_0x9d559c(0x389)]||this[_0x9d559c(0x1de)][_0x9d559c(0x34c)]===_0x2f72a2[_0x9d559c(0x3dd)]?wo[_0x9d559c(0x18e)](_0x30fd9f,To,_0x4b7563,_0x3bba7b):this[_0x9d559c(0x1de)][_0x9d559c(0x34c)]===_0x2f72a2['FilterNoneSortAsc']?wo['drawIconByPath'](_0x30fd9f,Oo,_0x4b7563,_0x3bba7b):this['_pivotParams']['buttonType']===_0x2f72a2[_0x9d559c(0x17a)]?wo[_0x9d559c(0x18e)](_0x30fd9f,ko,_0x4b7563,_0x3bba7b):this[_0x9d559c(0x1de)][_0x9d559c(0x34c)]===_0x2f72a2[_0x9d559c(0x3e0)]?wo[_0x9d559c(0x18e)](_0x30fd9f,Eo,_0x4b7563,_0x3bba7b):this[_0x9d559c(0x1de)][_0x9d559c(0x34c)]===_0x2f72a2[_0x9d559c(0x532)]&&wo[_0x9d559c(0x18e)](_0x30fd9f,Do,_0x4b7563,_0x3bba7b),_0x30fd9f['restore']();}};Mo=Q([Z(0x2,_0x12babc),Z(0x3,_0x446f3f(_0x9976df))],Mo);let No=class extends _0x30f8db{constructor(_0xc496bb,_0x3bb06d,_0x2d22c9,_0x156610){const _0x4bf967=_0x1aaa99;super(_0xc496bb,_0x3bb06d),this[_0x4bf967(0x20a)]=_0x2d22c9,this[_0x4bf967(0x141)]=_0x156610,X(this,'_cellWidth',void 0x0),X(this,'_cellHeight',void 0x0),X(this,_0x4bf967(0x1de),void 0x0),this[_0x4bf967(0x4de)]=_0x3bb06d[_0x4bf967(0x2a6)],this[_0x4bf967(0x2cb)]=_0x3bb06d[_0x4bf967(0x16f)],this['_pivotParams']=_0x3bb06d[_0x4bf967(0x439)],this[_0x4bf967(0x25c)]({'width':_0x3bb06d[_0x4bf967(0x4ff)],'height':_0x3bb06d[_0x4bf967(0x3ac)]}),this['onPointerUp$'][_0x4bf967(0x556)](_0x11913f=>this[_0x4bf967(0x1ae)](_0x11913f));}[_0x1aaa99(0x1ae)](_0x1aea53){const _0x1499b9=_0x1aaa99;if(_0x1aea53[_0x1499b9(0x491)]===0x2)return;let {col:_0x406fe2,row:_0x2a2100,unitId:_0x1659f2,subUnitId:_0x599eda,buttonType:_0x3fd25d}=this[_0x1499b9(0x1de)];if(Ao[_0x1499b9(0x36d)](_0x3fd25d))return this['_commandService'][_0x1499b9(0x4e2)]($i['id'],{'row':_0x2a2100,'col':_0x406fe2,'unitId':_0x1659f2,'subUnitId':_0x599eda});if(jo['has'](_0x3fd25d))return this[_0x1499b9(0x20a)][_0x1499b9(0x4e2)](_0x8f3145['id'],{'row':_0x2a2100,'col':_0x406fe2,'unitId':_0x1659f2,'subUnitId':_0x599eda,'collapse':_0x3fd25d===_0x2f72a2[_0x1499b9(0x1b3)]});}[_0x1aaa99(0x3d1)](_0x2d1104){const _0x253322=_0x1aaa99;let _0x21cbdf=this[_0x253322(0x1de)][_0x253322(0x34c)],_0x462fd8=this[_0x253322(0x141)][_0x253322(0x16d)](_0x253322(0x2f1)),_0x2a96df=this[_0x253322(0x141)][_0x253322(0x16d)](_0x253322(0x3ef));_0x2d1104[_0x253322(0x122)]();let _0x108286=new Path2D();_0x108286[_0x253322(0x2c1)](0x0,0x0,this[_0x253322(0x4de)],this[_0x253322(0x2cb)]),_0x2d1104[_0x253322(0x46e)](_0x108286),_0x2d1104[_0x253322(0x136)](0x6,0x6),_0x21cbdf===_0x2f72a2[_0x253322(0x4f4)]?wo[_0x253322(0x1fb)](_0x2d1104,0xc,_0x462fd8,_0x2a96df,this[_0x253322(0x2cb)]):_0x21cbdf===_0x2f72a2['Expand']?wo[_0x253322(0x32e)](_0x2d1104,0xc,_0x462fd8,_0x2a96df,this[_0x253322(0x2cb)]):_0x21cbdf===_0x2f72a2[_0x253322(0x139)]||_0x21cbdf===_0x2f72a2[_0x253322(0x2e6)]?wo[_0x253322(0x3d5)](_0x2d1104,0x10,_0x462fd8,_0x2a96df):_0x21cbdf===_0x2f72a2[_0x253322(0x293)]||_0x21cbdf===_0x2f72a2[_0x253322(0x389)]||_0x21cbdf===_0x2f72a2['FilteredSortNone']?wo[_0x253322(0x18e)](_0x2d1104,To,_0x462fd8,_0x2a96df):_0x21cbdf===_0x2f72a2['FilterNoneSortAsc']?wo[_0x253322(0x18e)](_0x2d1104,Oo,_0x462fd8,_0x2a96df):_0x21cbdf===_0x2f72a2[_0x253322(0x17a)]?wo['drawIconByPath'](_0x2d1104,ko,_0x462fd8,_0x2a96df):_0x21cbdf===_0x2f72a2[_0x253322(0x3e0)]?wo[_0x253322(0x18e)](_0x2d1104,Eo,_0x462fd8,_0x2a96df):_0x21cbdf===_0x2f72a2['FilteredSortDesc']&&wo[_0x253322(0x18e)](_0x2d1104,Do,_0x462fd8,_0x2a96df),_0x2d1104['restore']();}};No=Q([Z(0x2,_0x12babc),Z(0x3,_0x446f3f(_0x9976df))],No);function Po(_0x12ae6f,_0x40d759,_0x83acc1){const _0x52d789=_0x1aaa99;let {startX:_0x1b447b,startY:_0x426989,endX:_0x2746bd,endY:_0xa09fcd}=_0x83acc1;return{'left':(_0x40d759===_0x52d789(0x474)?_0x12ae6f!==_0x52d789(0x484):_0x12ae6f===_0x52d789(0x484))?_0x2746bd-0x10-0x1:_0x1b447b+0x1,'top':_0x40d759==='filter'?_0xa09fcd-0x10-0x1:_0x426989+0x1};}let Fo=class extends _0x239c25{constructor(_0xd61b2b,_0x359692,_0x351156,_0x1fc65b,_0x27edd4,_0x4272d1,_0x19d440,_0x5af042,_0x2848fd,_0xd6c86a){const _0x8eb310=_0x1aaa99;super(),this[_0x8eb310(0x388)]=_0xd61b2b,this[_0x8eb310(0xf3)]=_0x359692,this[_0x8eb310(0x3cf)]=_0x351156,this['_skeletonManagerService']=_0x1fc65b,this[_0x8eb310(0x46d)]=_0x27edd4,this['_permissionController']=_0x4272d1,this[_0x8eb310(0x4d3)]=_0x19d440,this[_0x8eb310(0x1f9)]=_0x5af042,this['_dialogService']=_0x2848fd,this[_0x8eb310(0x200)]=_0xd6c86a,X(this,_0x8eb310(0x469),[]),this[_0x8eb310(0x1a5)](),this['_initButtonRender'](),this['_initSkeleton']();}[_0x1aaa99(0x144)](){const _0x42e1dc=_0x1aaa99;this[_0x42e1dc(0x20f)](),super[_0x42e1dc(0x144)]();}['_clearButtons'](){const _0x1bdd6e=_0x1aaa99;this[_0x1bdd6e(0x469)][_0x1bdd6e(0x2d7)](_0x1a638d=>_0x1a638d[_0x1bdd6e(0x144)]()),this['_buttonShapes'][_0x1bdd6e(0x483)]=0x0;}[_0x1aaa99(0x1a5)](){const _0x212d4d=_0x1aaa99;if(!this[_0x212d4d(0x200)])return;let _0x5578eb=this[_0x212d4d(0x200)]['contextMenuInterceptor']['intercept'](_0x506f0c,{'handler':(_0x391bd2,_0x62d5d3,_0x4a6876)=>{const _0x5756a8=_0x212d4d;if(_0x391bd2||_0x62d5d3[_0x5756a8(0x45e)]!==_0x25e2c4['MAIN_AREA'])return _0x4a6876(_0x391bd2);let {col:_0x388c83,row:_0x3524c6,subUnitId:_0x4aa5fe,unitId:_0x2d8e89}=_0x62d5d3;if(_0x388c83==null||_0x3524c6==null)return _0x4a6876(_0x391bd2);let _0x7d0309=this[_0x5756a8(0x3cf)][_0x5756a8(0xc8)](_0x2d8e89,_0x4aa5fe,_0x3524c6,_0x388c83);return _0x7d0309?(this['_openPivotActionPanel'](_0x2d8e89,_0x4aa5fe,_0x7d0309,_0x3524c6,_0x388c83),!0x0):_0x4a6876(_0x391bd2);}});this[_0x212d4d(0x320)](_0x56dd68(_0x5578eb));}[_0x1aaa99(0x1f4)](_0x5f4b8d,_0x5a2733,_0x4316a7,_0x288b60,_0x4d0374){const _0xcbeee7=_0x1aaa99;let _0x1196a4=this[_0xcbeee7(0xf4)][_0xcbeee7(0x2ee)]({'workbookTypes':[_0x23a297],'worksheetTypes':[_0x20e8fc],'rangeTypes':[_0x27648a]},[{'startRow':_0x288b60,'endRow':_0x288b60,'startColumn':_0x4d0374,'endColumn':_0x4d0374}],_0x5f4b8d,_0x5a2733);this[_0xcbeee7(0x1e9)][_0xcbeee7(0x22d)]({'id':Br,'title':{'title':this['_localeService']['t'](_0xcbeee7(0xc0))},'children':{'label':{'name':zr,'props':{'editable':_0x1196a4,'pivotTableId':_0x4316a7,'subUnitId':_0x5a2733,'unitId':_0x5f4b8d}}},'onClose':()=>this[_0xcbeee7(0x1e9)][_0xcbeee7(0x2a3)](Br)});}['_initButtonRender'](){const _0x3f15aa=_0x1aaa99;this[_0x3f15aa(0x320)](_0x2a5b68(this[_0x3f15aa(0x3cf)][_0x3f15aa(0x402)][_0x3f15aa(0x49b)](_0x1296c7(0x0)),this[_0x3f15aa(0x545)][_0x3f15aa(0x2e3)],this[_0x3f15aa(0x46d)]['pivotConfigChange$'],this['_permissionService'][_0x3f15aa(0x2c8)][_0x3f15aa(0x49b)](_0x1296c7(0x64)))['subscribe'](()=>{const _0x2e572a=_0x3f15aa;let _0x24217f=this['_context'][_0x2e572a(0x32d)],_0x3fd5c8=this['_skeletonManagerService'][_0x2e572a(0x168)]();if(!_0x24217f||!_0x3fd5c8)return;let _0x282123=_0x24217f[_0x2e572a(0x189)](),_0x550eb8=_0x24217f[_0x2e572a(0x10b)](),_0x25578e=_0x282123['getSheetId'](),_0xd503ed=this['_localeService']['getDirection'](),{scene:_0x5c06da}=this[_0x2e572a(0x388)];this[_0x2e572a(0x20f)](),this[_0x2e572a(0x3cf)][_0x2e572a(0x317)](_0x550eb8,_0x25578e)['forValue']((_0x2feec6,_0x407363,_0x2b7b30)=>{const _0x3e32d9=_0x2e572a;if(!(_0x2b7b30!=null&&_0x2b7b30[_0x3e32d9(0x447)]))return;let {startX:_0x4fe2e3,startY:_0x31cabc,endX:_0x2036b8,endY:_0x4f1fda}=_0x4b0ff3(_0x2feec6,_0x407363,_0x5c06da,_0x3fd5c8),_0x2cbe76=_0x2036b8-_0x4fe2e3,_0x52df11=_0x4f1fda-_0x31cabc;if(_0x52df11<0x8||_0x2cbe76<0x8||!this[_0x3e32d9(0xf4)][_0x3e32d9(0x2ee)]({'workbookTypes':[_0x23a297],'worksheetTypes':[_0x5424ba,_0x4cb3a4,_0x20e8fc],'rangeTypes':[_0x4707cc,_0x27648a]},[{'startRow':_0x2feec6,'endRow':_0x2feec6,'startColumn':_0x407363,'endColumn':_0x407363}],_0x550eb8,_0x25578e))return;let _0x2cc38a;if(Ao[_0x3e32d9(0x36d)](_0x2b7b30[_0x3e32d9(0x447)]))_0x2cc38a='filter';else{if(jo[_0x3e32d9(0x36d)](_0x2b7b30[_0x3e32d9(0x447)]))_0x2cc38a='collapse';else return;}let _0x4a94c4=Po(_0xd503ed,_0x2cc38a,{'startX':_0x4fe2e3,'startY':_0x31cabc,'endX':_0x2036b8,'endY':_0x4f1fda}),_0x5190b0={'left':_0x4a94c4[_0x3e32d9(0x188)]-0x6,'top':_0x4a94c4[_0x3e32d9(0x3f5)]-0x6,'width':0x1c,'height':0x1c,'zIndex':0x1388,'cellWidth':_0x2cbe76,'cellHeight':_0x52df11,'pivotParams':{'row':_0x2feec6,'col':_0x407363,'unitId':_0x550eb8,'subUnitId':_0x25578e,'buttonType':_0x2b7b30[_0x3e32d9(0x447)]}},_0x17fd58=_0x3e32d9(0x1bc)+_0x2feec6+'-'+_0x407363+'-'+_0x550eb8+'-'+_0x25578e;this[_0x3e32d9(0x469)]['push'](this[_0x3e32d9(0xf3)][_0x3e32d9(0x450)](No,_0x17fd58,_0x5190b0));}),this['_buttonShapes'][_0x2e572a(0x483)]&&_0x5c06da[_0x2e572a(0x40e)](this['_buttonShapes']),_0x5c06da[_0x2e572a(0x212)]();}));}[_0x1aaa99(0x4fd)](){const _0x4e4e09=_0x1aaa99;var _0x3fa9bd;this[_0x4e4e09(0x320)](this[_0x4e4e09(0x3cf)]['markDirty$'][_0x4e4e09(0x358)](({unitId:_0x282eb9,subUnitId:_0x4968d8})=>{const _0x4ffae9=_0x4e4e09;if(_0x282eb9===this[_0x4ffae9(0x388)][_0x4ffae9(0xf8)]&&(this['_skeletonManagerService'][_0x4ffae9(0x212)]({'sheetId':_0x4968d8}),this[_0x4ffae9(0x388)][_0x4ffae9(0x32d)][_0x4ffae9(0x189)]()[_0x4ffae9(0x258)]()===_0x4968d8)){var _0xc3299d;this['_skeletonManagerService']['reCalculate'](),(_0xc3299d=this[_0x4ffae9(0x388)][_0x4ffae9(0x35f)])==null||_0xc3299d['makeDirty']();}}));let _0x37dc17=this['_context'][_0x4e4e09(0xf8)];this[_0x4e4e09(0x388)]['unit']['getSheets']()[_0x4e4e09(0x2d7)](_0x31ff95=>{const _0x15c265=_0x4e4e09;var _0x5cac13;let _0x3f5c72=_0x31ff95[_0x15c265(0x258)]();(_0x5cac13=this[_0x15c265(0x3cf)]['getSubUnitPivotRenderCache'](_0x37dc17,_0x3f5c72))!=null&&_0x5cac13[_0x15c265(0x23a)]&&this[_0x15c265(0x545)][_0x15c265(0x212)]({'sheetId':_0x3f5c72});}),this[_0x4e4e09(0x545)]['reCalculate'](),(_0x3fa9bd=this['_context'][_0x4e4e09(0x35f)])==null||_0x3fa9bd[_0x4e4e09(0x212)]();}};Fo=Q([Z(0x1,_0x446f3f(_0x21b420)),Z(0x2,_0x446f3f(_0x131a27)),Z(0x3,_0x446f3f(_0x8f17eb)),Z(0x4,_0x446f3f(_0x344ed3)),Z(0x5,_0x446f3f(_0x2f1427)),Z(0x6,_0x446f3f(_0x5f571f)),Z(0x7,_0x446f3f(_0x2129e8)),Z(0x8,_0x4f85fa),Z(0x9,_0x3022df(_0x368b3e))],Fo);let Io=class extends _0x239c25{constructor(_0x54f41b,_0x3080b7,_0x4ee104){const _0x52d290=_0x1aaa99;super(),this['_univerInstanceService']=_0x54f41b,this[_0x52d290(0x418)]=_0x3080b7,this[_0x52d290(0x2e8)]=_0x4ee104,this[_0x52d290(0x1ea)]();}[_0x1aaa99(0x1ea)](){const _0x1f5b60=_0x1aaa99;let _0x46548e=this,_0x3e8353,_0x143cc3;this[_0x1f5b60(0x320)](this[_0x1f5b60(0x2e8)][_0x1f5b60(0x160)]({'id':_0x5cac9f,'onBeforeCopy'(_0x54d4ec,_0x2cc681){const _0x22e6d7=_0x1f5b60;let _0x4c456c=_0x46548e[_0x22e6d7(0x112)][_0x22e6d7(0x29e)](_0x54d4ec,_0x36df91['UNIVER_SHEET']);_0x4c456c&&(_0x3e8353=_0x46548e[_0x22e6d7(0x418)]['getSubUnitPivotMatrix'](_0x54d4ec,_0x2cc681),_0x143cc3=_0x4c456c[_0x22e6d7(0x309)]());},'onAfterCopy'(){_0x3e8353=null,_0x143cc3=null;},'getCellValueBySpecialMatrix'(_0x10e143,_0x47a2f2){const _0x4ce4c8=_0x1f5b60;if(!_0x3e8353)return;let _0x1a9e50=_0x3e8353==null?void 0x0:_0x3e8353[_0x4ce4c8(0x3d6)](_0x10e143,_0x47a2f2);if(_0x1a9e50){var _0x2b5092;return{..._0x1a9e50,'s':_0x143cc3==null?void 0x0:_0x143cc3[_0x4ce4c8(0x210)](_0x1a9e50['s']),'displayV':((_0x2b5092=_0x1a9e50['v'])==null?void 0x0:_0x2b5092[_0x4ce4c8(0x11a)]())||''};}}}));}};Io=Q([Z(0x0,_0x446f3f(_0x570eee)),Z(0x1,_0x446f3f(_0x131a27)),Z(0x2,_0x465180)],Io);const Lo=[_0x5ace18['id'],_0x4f07cc['id'],_0x599d8f['id'],_0x37026d['id']];let Ro=class extends _0x239c25{constructor(_0x2c4d52,_0x8ee839,_0x3c18a9,_0x218228,_0x38bd2d,_0x168da9,_0x416afc,_0x559ead,_0xe1c1ac){const _0x33f768=_0x1aaa99;var _0x290335;super(),this[_0x33f768(0xf3)]=_0x2c4d52,this[_0x33f768(0x112)]=_0x8ee839,this['_sheetsPivotTableAdaptorModel']=_0x3c18a9,this[_0x33f768(0x39b)]=_0x218228,this[_0x33f768(0x4e1)]=_0x38bd2d,this['_localeService']=_0x168da9,this['_sheetsPivotTableConfigModel']=_0x416afc,this['_messageService']=_0x559ead,this[_0x33f768(0x50c)]=_0xe1c1ac,X(this,_0x33f768(0x341),!0x1),this['_initMoveRangeConfirmCheck'](),this[_0x33f768(0x336)](),this['_defaultOverride']=((_0x290335=this[_0x33f768(0x50c)]['getConfig'](_0x2d42ea))==null?void 0x0:_0x290335[_0x33f768(0x3ae)])??!0x1;}[_0x1aaa99(0x413)](){const _0x4aac8b=_0x1aaa99;this[_0x4aac8b(0x320)](this[_0x4aac8b(0x39b)]['interceptBeforeCommand']({'performCheck':async _0x1c713d=>{const _0x8b8e1e=_0x4aac8b;if(_0x1c713d['id']===_0x5c163a['id']){let _0x4c88af=_0x16d892(this[_0x8b8e1e(0x112)]);if(!_0x4c88af)return Promise[_0x8b8e1e(0x45b)](!0x1);let {unitId:_0x2ae1db,subUnitId:_0x36020d}=_0x4c88af,{fromRange:_0x47d552,toRange:_0x1af5e2}=_0x1c713d[_0x8b8e1e(0x119)],_0x27fa3e=this['_sheetsPivotTableConfigModel'][_0x8b8e1e(0x226)](_0x2ae1db,_0x36020d);if(!(_0x27fa3e!=null&&_0x27fa3e[_0x8b8e1e(0x23a)]))return Promise[_0x8b8e1e(0x45b)](!0x0);for(let [_0x22f10d,_0x740090]of _0x27fa3e){let {targetCellInfo:_0x34d8ba}=_0x740090,{row:_0x5c2f85,col:_0x23f45b}=_0x34d8ba,_0x1282c2=_0x5c2f85-_0x47d552[_0x8b8e1e(0x3a0)],_0x50bc35=_0x23f45b-_0x47d552['startColumn'],_0x36b2a7={'row':_0x1af5e2[_0x8b8e1e(0x3a0)]+_0x1282c2,'col':_0x1af5e2[_0x8b8e1e(0x401)]+_0x50bc35},_0x4d0ff3=_0x36b2a7[_0x8b8e1e(0x220)]-_0x34d8ba[_0x8b8e1e(0x220)],_0x568a44=_0x36b2a7[_0x8b8e1e(0x252)]-_0x34d8ba[_0x8b8e1e(0x252)],_0x2b70a0=this[_0x8b8e1e(0x418)][_0x8b8e1e(0x322)](_0x2ae1db,_0x36020d,_0x22f10d),_0x521d78=_0x2b70a0==null?void 0x0:_0x2b70a0['rangesInfo'];if(!_0x521d78)return Promise[_0x8b8e1e(0x45b)](!0x0);let _0x557266=[];Object['keys'](_0x521d78)[_0x8b8e1e(0x2d7)](_0x6b31aa=>{const _0x1e528d=_0x8b8e1e;_0x521d78[_0x6b31aa][_0x1e528d(0x2d7)](_0x3cae80=>{const _0x266b26=_0x1e528d;let _0x371f15={..._0x3cae80};_0x371f15[_0x266b26(0x3a0)]=_0x3cae80[_0x266b26(0x3a0)]+_0x4d0ff3,_0x371f15['endRow']=_0x3cae80[_0x266b26(0x25a)]+_0x4d0ff3,_0x371f15[_0x266b26(0x401)]=_0x3cae80[_0x266b26(0x401)]+_0x568a44,_0x371f15[_0x266b26(0x488)]=_0x3cae80[_0x266b26(0x488)]+_0x568a44,_0x557266[_0x266b26(0x29b)](_0x371f15);});});let _0x101fbe=this[_0x8b8e1e(0x39b)]['generateMutationsByRanges']({'unitId':_0x2ae1db,'subUnitId':_0x36020d,'ranges':_0x557266}),_0x254c7f=_0x151826(this[_0x8b8e1e(0xf3)],_0x2ae1db,_0x36020d,_0x557266);if(_0x101fbe['redos'][_0x8b8e1e(0x483)]||_0x254c7f['shouldClear']){if(this[_0x8b8e1e(0x341)])return Promise[_0x8b8e1e(0x45b)](!0x0);{let _0x29fb44=await this[_0x8b8e1e(0x4e1)][_0x8b8e1e(0x1a6)]({'id':'sheet-pivot.confirm.add-sheet-pivot','title':{'title':this[_0x8b8e1e(0x1f9)]['t'](_0x8b8e1e(0x3c0))},'children':{'title':this[_0x8b8e1e(0x1f9)]['t'](_0x8b8e1e(0x4df))},'cancelText':this['_localeService']['t'](_0x8b8e1e(0x12c)),'confirmText':this[_0x8b8e1e(0x1f9)]['t'](_0x8b8e1e(0x10d))});return Promise[_0x8b8e1e(0x45b)](_0x29fb44);}}}}return Promise[_0x8b8e1e(0x45b)](!0x0);}}));}['_initRowColOperationCheck'](){const _0x28b62e=_0x1aaa99;this[_0x28b62e(0x320)](this[_0x28b62e(0x39b)][_0x28b62e(0x22c)]({'performCheck':async _0x427636=>{const _0x256bab=_0x28b62e;if(Lo[_0x256bab(0x444)](_0x427636['id'])){let _0x1bc68e=_0x427636['params'],{range:_0x3d928b}=_0x1bc68e,_0x2c09d0=_0x16d892(this[_0x256bab(0x112)]),_0x16a056=_0x1bc68e['unitId']||(_0x2c09d0==null?void 0x0:_0x2c09d0[_0x256bab(0xf8)]),_0x96f084=_0x1bc68e[_0x256bab(0x19f)]||(_0x2c09d0==null?void 0x0:_0x2c09d0[_0x256bab(0x19f)]);if(!_0x16a056||!_0x96f084)return Promise[_0x256bab(0x45b)](!0x0);let _0x23fff4=this['_sheetsPivotTableConfigModel'][_0x256bab(0x226)](_0x16a056,_0x96f084);if(_0x23fff4!=null&&_0x23fff4['size'])for(let [_0x5234d0,_0x29ab91]of _0x23fff4){let _0x2269e4=this[_0x256bab(0x418)][_0x256bab(0x322)](_0x16a056,_0x96f084,_0x5234d0);if(_0x2269e4!=null&&_0x2269e4['rangesInfo']){for(let _0x2d04b1 of Object[_0x256bab(0x2b6)](_0x2269e4['rangesInfo']))if(_0x2269e4[_0x256bab(0x377)][_0x2d04b1]['some'](_0x2bc134=>_0x1ca723[_0x256bab(0x4c8)](_0x2bc134,_0x3d928b)))return this['_messageService'][_0x256bab(0x276)]({'type':_0x3330ef['Error'],'content':this['_localeService']['t'](_0x256bab(0x3c4))}),Promise[_0x256bab(0x45b)](!0x1);}}}return Promise[_0x256bab(0x45b)](!0x0);}}));}};Ro=Q([Z(0x0,_0x446f3f(_0x21b420)),Z(0x1,_0x446f3f(_0x570eee)),Z(0x2,_0x446f3f(_0x131a27)),Z(0x3,_0x446f3f(_0x14478c)),Z(0x4,_0x446f3f(_0x7c076c)),Z(0x5,_0x446f3f(_0x2129e8)),Z(0x6,_0x446f3f(_0x344ed3)),Z(0x7,_0x446f3f(_0x2dc350)),Z(0x8,_0x446f3f(_0xcc1513))],Ro);const zo=[_0x1b5e96['id'],_0x25d14f['id'],_0x574efd['id']];let Bo=class extends _0x239c25{constructor(_0x1b2fb4,_0x115402,_0x1d0d23,_0x159785,_0x2f3400,_0x506f35){const _0x4a24cf=_0x1aaa99;super(),this[_0x4a24cf(0x433)]=_0x1b2fb4,this[_0x4a24cf(0x112)]=_0x115402,this[_0x4a24cf(0x418)]=_0x1d0d23,this[_0x4a24cf(0x20a)]=_0x159785,this['_sheetsPivotTableConfigModel']=_0x2f3400,this[_0x4a24cf(0x1f9)]=_0x506f35,this[_0x4a24cf(0xd8)]();}[_0x1aaa99(0xd8)](){const _0x33dbb1=_0x1aaa99;this[_0x33dbb1(0x320)](this[_0x33dbb1(0x20a)][_0x33dbb1(0x525)](_0xe170b6=>{const _0x3ead06=_0x33dbb1;if(zo['includes'](_0xe170b6['id'])){var _0x3222b5;let _0x5c8e3f=(_0x3222b5=this[_0x3ead06(0x433)]['getCurrentLastSelection']())==null?void 0x0:_0x3222b5[_0x3ead06(0xc5)];if(!_0x5c8e3f)return;let {actualRow:_0x435845,actualColumn:_0x1d7154}=_0x5c8e3f,_0x53e19e=_0x4fbdbf(_0x435845,_0x1d7154),_0x18ee38=_0x16d892(this['_univerInstanceService'],_0xe170b6[_0x3ead06(0x119)]);if(!_0x18ee38)return;let {unitId:_0x574814,subUnitId:_0x4d627d}=_0x18ee38,_0x308825=this[_0x3ead06(0x2a0)]['getSubUnitPivotConfigs'](_0x574814,_0x4d627d);if(_0x308825!=null&&_0x308825[_0x3ead06(0x23a)])for(let [_0x550e77]of _0x308825){let _0x3b2d26=this['_sheetsPivotTableAdaptorModel'][_0x3ead06(0x322)](_0x574814,_0x4d627d,_0x550e77);if(_0x3b2d26!=null&&_0x3b2d26['rangesInfo']){for(let _0x2c9ed of Object[_0x3ead06(0x2b6)](_0x3b2d26[_0x3ead06(0x377)]))if(_0x3b2d26[_0x3ead06(0x377)][_0x2c9ed][_0x3ead06(0x156)](_0x5223c7=>_0x1ca723[_0x3ead06(0x4c8)](_0x5223c7,_0x53e19e)))throw new _0x5d2e21(this['_localeService']['t'](_0x3ead06(0x520)));}}}}));}};Bo=Q([Z(0x0,_0x446f3f(_0x2f649b)),Z(0x1,_0x446f3f(_0x570eee)),Z(0x2,_0x446f3f(_0x131a27)),Z(0x3,_0x446f3f(_0x12babc)),Z(0x4,_0x446f3f(_0x344ed3)),Z(0x5,_0x446f3f(_0x2129e8))],Bo);let Vo=class extends _0x239c25{constructor(_0x15d1c5,_0x3bec4a,_0x4d1b39,_0x35d53f){const _0x5127df=_0x1aaa99;super(),this[_0x5127df(0x418)]=_0x15d1c5,this[_0x5127df(0x394)]=_0x3bec4a,this['_messageService']=_0x4d1b39,this[_0x5127df(0x1f9)]=_0x35d53f,this[_0x5127df(0x265)]();}[_0x1aaa99(0x265)](){const _0x36383e=_0x1aaa99;let _0x36c7a4=this[_0x36383e(0x418)],_0x5d900e=this['_messageService'],_0x3dc1f9=this[_0x36383e(0x1f9)];this[_0x36383e(0x394)][_0x36383e(0x4ba)]({'id':'pivot-format-painter-hook','onBeforeApply'(_0x512620){const _0x3a594e=_0x36383e;let {redoMutationsInfo:_0x48da68}=_0x512620;for(let _0x367e49 of _0x48da68)if(_0x367e49['id']===_0x82d4ca['id']){let {unitId:_0x463aec,subUnitId:_0x2e27b1,ranges:_0x1b0e63}=_0x367e49[_0x3a594e(0x119)];for(let _0x1fd712 of _0x1b0e63)if(_0x36c7a4[_0x3a594e(0x31f)](_0x463aec,_0x2e27b1,_0x1fd712)[_0x3a594e(0x483)]>0x0)return _0x5d900e[_0x3a594e(0x276)]({'type':_0x3330ef[_0x3a594e(0x1cf)],'content':_0x3dc1f9['t']('sheets-pivot-ui.msg.mergeCellError')}),!0x1;}return!0x0;}});}};Vo=Q([Z(0x0,_0x446f3f(_0x131a27)),Z(0x1,_0x446f3f(_0x1fc6c6)),Z(0x2,_0x446f3f(_0x2dc350)),Z(0x3,_0x446f3f(_0x2129e8))],Vo);let Ho=class extends _0x239c25{constructor(_0x32b655,_0x3190a6,_0x5edb2d){const _0x2d715e=_0x1aaa99;super(),this[_0x2d715e(0x1be)]=_0x32b655,this[_0x2d715e(0x418)]=_0x3190a6,this[_0x2d715e(0x2a0)]=_0x5edb2d,this[_0x2d715e(0x2da)]();}[_0x1aaa99(0x2da)](){const _0x204bd0=_0x1aaa99;this[_0x204bd0(0x320)](this[_0x204bd0(0x1be)][_0x204bd0(0x334)]['intercept'](this[_0x204bd0(0x1be)][_0x204bd0(0x334)][_0x204bd0(0x441)]()[_0x204bd0(0x28b)],{'handler':(_0x32cf84,_0x3c743b,_0x233570)=>{const _0x444b63=_0x204bd0;let {unitId:_0x367a80,subUnitId:_0x117b9e}=_0x3c743b,_0x5b88b8=(_0x32cf84==null?void 0x0:_0x32cf84[_0x444b63(0x3a0)])??0x1/0x0,_0x19f820=(_0x32cf84==null?void 0x0:_0x32cf84[_0x444b63(0x25a)])??-0x1/0x0,_0x3c5b20=(_0x32cf84==null?void 0x0:_0x32cf84['startColumn'])??0x1/0x0,_0x2fa0bd=(_0x32cf84==null?void 0x0:_0x32cf84[_0x444b63(0x488)])??-0x1/0x0,_0xe45f56=this[_0x444b63(0x2a0)]['getSubUnitPivotConfigs'](_0x367a80,_0x117b9e);if(!_0xe45f56)return _0x233570(_0x32cf84);for(let [_0x193124,_0x374590]of _0xe45f56){var _0x6e8ae;let _0x333dec=(_0x6e8ae=this[_0x444b63(0x418)]['getPivotItemRenderInfoCache'](_0x367a80,_0x117b9e,_0x193124))==null?void 0x0:_0x6e8ae[_0x444b63(0x377)];_0x333dec&&Object['values'](_0x333dec)[_0x444b63(0x2d7)](_0x345c4c=>{const _0x56ed2d=_0x444b63;_0x345c4c[_0x56ed2d(0x2d7)](_0x455c57=>{const _0x252696=_0x56ed2d;let {startRow:_0x1e0a0c,endRow:_0x5d2c4f,startColumn:_0x4dcb6d,endColumn:_0x540799}=_0x455c57;_0x5b88b8=Math[_0x252696(0x18c)](_0x1e0a0c,_0x5b88b8),_0x19f820=Math[_0x252696(0x30b)](_0x5d2c4f,_0x19f820),_0x3c5b20=Math[_0x252696(0x18c)](_0x4dcb6d,_0x3c5b20),_0x2fa0bd=Math['max'](_0x540799,_0x2fa0bd);});});}let _0x57d926={'startRow':_0x5b88b8,'endRow':_0x19f820,'startColumn':_0x3c5b20,'endColumn':_0x2fa0bd};return _0x4c4e35(_0x57d926)?_0x233570(_0x57d926):_0x233570(_0x32cf84);}}));}};Ho=Q([Z(0x0,_0x446f3f(_0x21b75f)),Z(0x1,_0x446f3f(_0x131a27)),Z(0x2,_0x446f3f(_0x344ed3))],Ho);let Uo=class extends _0x239c25{constructor(_0x50a3b3,_0x248368,_0x39f359){const _0x5f4a98=_0x1aaa99;super(),this[_0x5f4a98(0x1b4)]=_0x50a3b3,this[_0x5f4a98(0x112)]=_0x248368,this[_0x5f4a98(0x2a0)]=_0x39f359,this[_0x5f4a98(0x3a9)]();}[_0x1aaa99(0x3a9)](){const _0x3d4277=_0x1aaa99;this[_0x3d4277(0x320)](this['_mergeCellController'][_0x3d4277(0x334)][_0x3d4277(0x2b4)](this[_0x3d4277(0x1b4)][_0x3d4277(0x334)][_0x3d4277(0x441)]()[_0x3d4277(0x47c)],{'handler':(_0x552052,_0x4c4f00)=>{const _0x5745dc=_0x3d4277;let _0x452e5c=_0x16d892(this[_0x5745dc(0x112)]);if(!_0x452e5c)return _0x552052;let {unitId:_0x20e76d,subUnitId:_0x6246e2}=_0x452e5c,_0x1b1098=this[_0x5745dc(0x2a0)][_0x5745dc(0x226)](_0x20e76d,_0x6246e2),_0x1b4326=[];return _0x1b1098&&_0x1b1098[_0x5745dc(0x2d7)]((_0x2c1253,_0x285951)=>{const _0x3b238c=_0x5745dc;var _0x5b28a7;let _0x8b70e3=(_0x5b28a7=this[_0x3b238c(0x2a0)][_0x3b238c(0xff)](_0x20e76d,_0x6246e2,_0x285951))==null?void 0x0:_0x5b28a7[_0x3b238c(0x39d)];_0x8b70e3&&Object['keys'](_0x8b70e3)['forEach'](_0x484632=>{const _0x102a57=_0x3b238c;let _0x305f50=_0x8b70e3[_0x484632];Array[_0x102a57(0x3fd)](_0x305f50)&&_0x1b4326[_0x102a57(0x29b)](..._0x305f50);});}),_0x1b4326['length']&&_0x4c4f00[_0x5745dc(0x156)](_0x44a372=>_0x1b4326[_0x5745dc(0x156)](_0x282033=>_0x1ca723[_0x5745dc(0x4c8)](_0x282033,_0x44a372)))?!0x0:_0x552052;}}));}};Uo=Q([Z(0x0,_0x446f3f(_0xa41291)),Z(0x1,_0x446f3f(_0x570eee)),Z(0x2,_0x446f3f(_0x344ed3))],Uo);let Wo=class extends _0x1b4002{constructor(_0x2ed4e0=ia,_0x266c48,_0x1e7eb8,_0x44bf08,_0x4df387){const _0x3ab2a4=_0x1aaa99;super(),this[_0x3ab2a4(0x37a)]=_0x2ed4e0,this[_0x3ab2a4(0xf3)]=_0x266c48,this['_commandService']=_0x1e7eb8,this[_0x3ab2a4(0x3b6)]=_0x44bf08,this[_0x3ab2a4(0x50c)]=_0x4df387;let {menu:_0x2b81cd,..._0x34fa72}=_0x3cf2d5({},ia,this[_0x3ab2a4(0x37a)]);_0x2b81cd&&this[_0x3ab2a4(0x50c)][_0x3ab2a4(0x166)](_0x3ab2a4(0x338),_0x2b81cd,{'merge':!0x0}),this[_0x3ab2a4(0x50c)][_0x3ab2a4(0x166)](ra,_0x34fa72),this[_0x3ab2a4(0x145)]();}[_0x1aaa99(0x2bc)](){const _0x2d5994=_0x1aaa99;[[yo],[So],[Co],[Uo],[Ro],[Ho],[Bo],[Vo],[ca],[Io]][_0x2d5994(0x2d7)](_0x36a56a=>this['_injector'][_0x2d5994(0x549)](_0x36a56a)),_0x786ce2(this[_0x2d5994(0xf3)],[[yo],[So],[Co],[ca]]);}[_0x1aaa99(0x27d)](){const _0x44c75a=_0x1aaa99;this[_0x44c75a(0x4ce)](),_0x786ce2(this[_0x44c75a(0xf3)],[[Ro],[Ho],[Bo],[Vo],[Io]]);}[_0x1aaa99(0x366)](){const _0x2956c5=_0x1aaa99;_0x786ce2(this[_0x2956c5(0xf3)],[[Uo]]);}['_registerCommands'](){const _0x28caee=_0x1aaa99;[na,Vr,$i,ea,Ur][_0x28caee(0x2d7)](_0x536f23=>this[_0x28caee(0x320)](this[_0x28caee(0x20a)][_0x28caee(0x31c)](_0x536f23)));}[_0x1aaa99(0x4ce)](){const _0x95ed9c=_0x1aaa99;this[_0x95ed9c(0x320)](this[_0x95ed9c(0x3b6)][_0x95ed9c(0x50b)](_0x36df91['UNIVER_SHEET'],[Fo]));}};X(Wo,_0x1aaa99(0x4d2),_0x5cac9f+_0x1aaa99(0x523)),X(Wo,_0x1aaa99(0x130),Zi),X(Wo,_0x1aaa99(0x253),Qi),X(Wo,'type',_0x36df91['UNIVER_SHEET']),Wo=Q([_0x112913(_0x3e6109,_0x574984,_0x32b53a,_0x542b42,_0x1363cb,_0x3bfad0),Z(0x1,_0x446f3f(_0x21b420)),Z(0x2,_0x12babc),Z(0x3,_0xf881cc),Z(0x4,_0xcc1513)],Wo);const Go=[_0x55be9d[_0x1aaa99(0x143)],_0x55be9d[_0x1aaa99(0x400)],_0x55be9d[_0x1aaa99(0x1da)],_0x55be9d[_0x1aaa99(0x1b5)],_0x55be9d[_0x1aaa99(0xbf)],_0x55be9d['Minute'],_0x55be9d[_0x1aaa99(0x257)]],Ko={[_0x55be9d[_0x1aaa99(0x143)]]:_0x1aaa99(0x14a),[_0x55be9d['Quarter']]:'sheets-pivot-ui.dateGroup.quarter',[_0x55be9d[_0x1aaa99(0x1da)]]:_0x1aaa99(0x42f),[_0x55be9d[_0x1aaa99(0x1b5)]]:_0x1aaa99(0x1b2),[_0x55be9d[_0x1aaa99(0xbf)]]:_0x1aaa99(0x4a2),[_0x55be9d[_0x1aaa99(0x24a)]]:'sheets-pivot-ui.dateGroup.minute',[_0x55be9d['Second']]:'sheets-pivot-ui.dateGroup.second'},qo=_0x1aaa99(0x17e);function Jo({targetFieldName:_0x1affbd,dateSystem:_0x3d7909,grouping:_0x4212ec,onConfirm:_0x7e5407,onCancel:_0x47d121}){const _0x1c387d=_0x1aaa99;let _0xaa8618=_0x2140ff(_0x2129e8),_0x212b07=_0x362266(_0xaa8618[_0x1c387d(0x1ee)],_0xaa8618[_0x1c387d(0x1d4)]()),_0x13bf81=(_0x40d5f3,_0x1da010)=>{const _0x2afcd8=_0x1c387d;let _0x5ee038=_0x40d5f3===void 0x0?null:_0x173e82(_0x40d5f3,{'dateSystem':_0x3d7909});if(!_0x5ee038)return{'date':'','time':_0x1da010};let _0x21f09b=_0x293d1b=>String(_0x293d1b)[_0x2afcd8(0x445)](0x2,'0');return{'date':_0x5ee038[_0x2afcd8(0x1bf)]+'-'+_0x21f09b(_0x5ee038[_0x2afcd8(0x49f)])+'-'+_0x21f09b(_0x5ee038[_0x2afcd8(0x11b)]),'time':_0x21f09b(_0x5ee038['hours'])+':'+_0x21f09b(_0x5ee038['minutes'])+':'+_0x21f09b(_0x5ee038['seconds'])};},[_0x36c8b8,_0x536a37]=_0x18aa7d((_0x4212ec==null?void 0x0:_0x4212ec[_0x1c387d(0x3bc)])??[_0x55be9d[_0x1c387d(0x1b5)]]),[_0x4c2f1b,_0x188a8b]=_0x18aa7d((_0x4212ec==null?void 0x0:_0x4212ec[_0x1c387d(0xc4)])??!0x0),[_0x3957a2,_0x429cea]=_0x18aa7d((_0x4212ec==null?void 0x0:_0x4212ec[_0x1c387d(0x404)])??!0x0),[_0x3ed8a1,_0x17a88b]=_0x18aa7d(()=>_0x13bf81(_0x4212ec==null?void 0x0:_0x4212ec[_0x1c387d(0x465)],_0x1c387d(0x171))[_0x1c387d(0x33a)]),[_0x1d315f,_0xc7f9cd]=_0x18aa7d(()=>_0x13bf81(_0x4212ec==null?void 0x0:_0x4212ec[_0x1c387d(0x419)],_0x1c387d(0x407))['date']),[_0x338634,_0x5020e8]=_0x18aa7d(()=>_0x13bf81(_0x4212ec==null?void 0x0:_0x4212ec['start'],'00:00:00')[_0x1c387d(0x561)]),[_0x385a0d,_0xf18241]=_0x18aa7d(()=>_0x13bf81(_0x4212ec==null?void 0x0:_0x4212ec['end'],_0x1c387d(0x407))[_0x1c387d(0x561)]),[_0x436dbd,_0x33cfd4]=_0x18aa7d((_0x4212ec==null?void 0x0:_0x4212ec[_0x1c387d(0x55d)])??0x1),[_0x3dabdc,_0x4d9738]=_0x18aa7d(!0x1),_0x523fda=_0x25e96e(!0x1),_0x52c955=_0x36c8b8[_0x1c387d(0x156)](_0x33a82f=>_0x33a82f===_0x55be9d[_0x1c387d(0xbf)]||_0x33a82f===_0x55be9d[_0x1c387d(0x24a)]||_0x33a82f===_0x55be9d[_0x1c387d(0x257)]),_0x1bc90f=_0x36c8b8[_0x1c387d(0x483)]===0x1&&_0x36c8b8[0x0]===_0x55be9d[_0x1c387d(0x1b5)],_0xf004d8=(_0x237599,_0x22b007,_0x1e16de)=>{const _0x2a4c3a=_0x1c387d;let _0x2aeba8=/^(\d{4})-(\d{2})-(\d{2})$/[_0x2a4c3a(0x1f2)](_0x237599),_0x5ba078=/^(\d{2}):(\d{2})(?::(\d{2}))?$/[_0x2a4c3a(0x1f2)](_0x22b007);return!_0x2aeba8||!_0x5ba078?null:_0x37c81c({'year':Number(_0x2aeba8[0x1]),'month':Number(_0x2aeba8[0x2]),'day':Number(_0x2aeba8[0x3]),'hours':_0x52c955?Number(_0x5ba078[0x1]):_0x1e16de?0x17:0x0,'minutes':_0x52c955?Number(_0x5ba078[0x2]):_0x1e16de?0x3b:0x0,'seconds':_0x52c955?Number(_0x5ba078[0x3]??0x0):_0x1e16de?0x3b:0x0,'fractionalSecond':_0x1e16de?0.999:0x0},{'dateSystem':_0x3d7909});},_0x4cc9a6=_0x4c2f1b?void 0x0:_0xf004d8(_0x3ed8a1,_0x338634,!0x1),_0x5e0b01=_0x3957a2?void 0x0:_0xf004d8(_0x1d315f,_0x385a0d,!0x0),_0x304348=_0x36c8b8['length']>0x0&&(_0x4c2f1b||_0x4cc9a6!==null)&&(_0x3957a2||_0x5e0b01!==null)&&(_0x4cc9a6==null||_0x5e0b01==null||_0x4cc9a6<=_0x5e0b01)&&(!_0x1bc90f||Number[_0x1c387d(0x3b2)](_0x436dbd)&&_0x436dbd>=0x1);return _0x81f19b('div',{'className':'univer-flex\x20univer-flex-col\x20univer-gap-4','dir':_0x212b07,'children':[_0x2a3146(_0x1c387d(0x3cc),{'className':_0x1c387d(0x420),'children':_0x1affbd}),_0x81f19b('fieldset',{'children':[_0x2a3146(_0x1c387d(0x107),{'className':_0x1c387d(0x173),'children':_0xaa8618['t'](_0x1c387d(0x430))}),_0x2a3146('div',{'className':'univer-grid\x20univer-grid-cols-2\x20univer-gap-2','children':Go[_0x1c387d(0x15d)](_0x1f1254=>_0x2a3146(_0x180ca8,{'checked':_0x36c8b8[_0x1c387d(0x444)](_0x1f1254),'onChange':_0x337428=>_0x536a37(_0x2fd2c1=>_0x337428?Go[_0x1c387d(0x474)](_0x87507f=>_0x87507f===_0x1f1254||_0x2fd2c1[_0x1c387d(0x444)](_0x87507f)):_0x2fd2c1[_0x1c387d(0x474)](_0x38cf69=>_0x38cf69!==_0x1f1254)),'children':_0xaa8618['t'](Ko[_0x1f1254])},_0x1f1254))})]}),_0x1bc90f&&_0x81f19b(_0x1c387d(0x517),{'className':'univer-flex\x20univer-items-center\x20univer-justify-between\x20univer-gap-3\x20univer-text-sm','children':[_0xaa8618['t'](_0x1c387d(0x101)),_0x2a3146(_0x536e2c,{'className':_0x1c387d(0x55b),'value':_0x436dbd,'min':0x1,'onChange':_0x5b590e=>_0x33cfd4(Number(_0x5b590e))})]}),_0x81f19b('div',{'className':_0x1c387d(0x120),'children':[_0x2a3146(_0x180ca8,{'checked':_0x4c2f1b,'onChange':_0x458b16=>_0x188a8b(!!_0x458b16),'children':_0xaa8618['t']('sheets-pivot-ui.dateGroup.autoStart')}),!_0x4c2f1b&&_0x81f19b('label',{'className':_0x1c387d(0xd1),'children':[_0xaa8618['t'](_0x1c387d(0x274)),_0x2a3146(_0x1b81fe,{'type':_0x1c387d(0x33a),'value':_0x3ed8a1,'onChange':_0x17a88b}),_0x52c955&&_0x2a3146(_0x1c387d(0x315),{'className':qo,'type':_0x1c387d(0x561),'step':0x1,'value':_0x338634,'onChange':_0x1f99d7=>_0x5020e8(_0x1f99d7[_0x1c387d(0x386)][_0x1c387d(0xd6)])})]}),_0x2a3146(_0x180ca8,{'checked':_0x3957a2,'onChange':_0x271cd5=>_0x429cea(!!_0x271cd5),'children':_0xaa8618['t'](_0x1c387d(0x231))}),!_0x3957a2&&_0x81f19b(_0x1c387d(0x517),{'className':'univer-flex\x20univer-items-center\x20univer-gap-2\x20univer-text-sm','children':[_0xaa8618['t'](_0x1c387d(0x47e)),_0x2a3146(_0x1b81fe,{'type':'date','value':_0x1d315f,'onChange':_0xc7f9cd}),_0x52c955&&_0x2a3146('input',{'className':qo,'type':'time','step':0x1,'value':_0x385a0d,'onChange':_0x4c62b4=>_0xf18241(_0x4c62b4[_0x1c387d(0x386)][_0x1c387d(0xd6)])})]})]}),_0x81f19b('div',{'className':_0x1c387d(0x1b6),'children':[_0x2a3146(_0x38daeb,{'onClick':_0x47d121,'children':_0xaa8618['t']('sheets-pivot-ui.dialog.cancel')}),_0x2a3146(_0x38daeb,{'variant':'primary','disabled':!_0x304348||_0x3dabdc,'onClick':async()=>{const _0x125dd7=_0x1c387d;if(!_0x304348||_0x523fda['current'])return;let _0x5231c4={'units':Go['filter'](_0x33748c=>_0x36c8b8[_0x125dd7(0x444)](_0x33748c)),'autoStart':_0x4c2f1b,'autoEnd':_0x3957a2};!_0x4c2f1b&&_0x4cc9a6!=null&&(_0x5231c4[_0x125dd7(0x465)]=_0x4cc9a6),!_0x3957a2&&_0x5e0b01!=null&&(_0x5231c4[_0x125dd7(0x419)]=_0x5e0b01),_0x1bc90f&&_0x436dbd>0x1&&(_0x5231c4[_0x125dd7(0x55d)]=_0x436dbd),_0x523fda[_0x125dd7(0x312)]=!0x0,_0x4d9738(!0x0);try{await _0x7e5407(_0x5231c4);}catch{}finally{_0x523fda[_0x125dd7(0x312)]=!0x1,_0x4d9738(!0x1);}},'children':_0xaa8618['t']('sheets-pivot-ui.dialog.ok')})]})]});}function Yo(_0x5ab994){const _0xd39f83=_0x1aaa99;let _0x364853=_0x5ab994[_0xd39f83(0x3ec)]===_0x137159['dateBetween']||_0x5ab994[_0xd39f83(0x3ec)]===_0x137159['dateNotBetween'],_0x3429db={'type':_0x567986[_0xd39f83(0x472)],'operator':_0x5ab994[_0xd39f83(0x3ec)],'expected':_0x364853?[_0x5ab994[_0xd39f83(0x128)],_0x5ab994['upper']]:_0x5ab994['lower'],'useWholeDay':_0x5ab994[_0xd39f83(0x524)]};try{return _0x176112(_0x3429db),_0x3429db;}catch{return;}}function Xo(_0x194ab6,_0x4253e5){const _0x16cc21=_0x1aaa99;let _0x26e539=_0x173e82(_0x194ab6,{'dateSystem':_0x4253e5});if(!_0x26e539||_0x26e539[_0x16cc21(0x11b)]===0x0||_0x26e539[_0x16cc21(0x1bf)]===0x76c&&_0x26e539[_0x16cc21(0x49f)]===0x2&&_0x26e539['day']===0x1d)return;let _0x448573=new Date(0x7d0,0x0,0x1,0xc);return _0x448573[_0x16cc21(0x54b)](_0x26e539[_0x16cc21(0x1bf)],_0x26e539[_0x16cc21(0x49f)]-0x1,_0x26e539[_0x16cc21(0x11b)]),_0x448573;}function Zo(_0xfd21c3,_0x43fc41,_0x218f6d){const _0x9e87cb=_0x1aaa99;let _0x3a935d=_0x37c81c({'year':_0x43fc41[_0x9e87cb(0x35b)](),'month':_0x43fc41[_0x9e87cb(0x4a0)]()+0x1,'day':_0x43fc41[_0x9e87cb(0x24c)](),'hours':0x0,'minutes':0x0,'seconds':0x0,'fractionalSecond':0x0},{'dateSystem':_0x218f6d});return _0x3a935d===null?void 0x0:_0x3a935d+(_0xfd21c3===void 0x0?0x0:_0xfd21c3-Math[_0x9e87cb(0x505)](_0xfd21c3));}function Qo(_0x3eb837,_0x55df82){const _0x337e1e=_0x1aaa99;return _0x3eb837===void 0x0||!Number[_0x337e1e(0x3f4)](_0x55df82[_0x337e1e(0x455)]())?_0x3eb837:Math[_0x337e1e(0x505)](_0x3eb837)+(_0x55df82['getHours']()*0xe10+_0x55df82['getMinutes']()*0x3c+_0x55df82[_0x337e1e(0x4b8)]()+_0x55df82[_0x337e1e(0x52c)]()/0x3e8)/0x15180;}const $o=[{'value':_0x137159[_0x1aaa99(0xcb)],'label':_0x1aaa99(0x201)},{'value':_0x137159['dateNotEqual'],'label':_0x1aaa99(0x193)},{'value':_0x137159[_0x1aaa99(0x467)],'label':_0x1aaa99(0x41f)},{'value':_0x137159[_0x1aaa99(0x4d0)],'label':_0x1aaa99(0x485)},{'value':_0x137159[_0x1aaa99(0x387)],'label':'sheets-pivot-ui.dateFilter.before'},{'value':_0x137159[_0x1aaa99(0x550)],'label':'sheets-pivot-ui.dateFilter.beforeOrEqual'},{'value':_0x137159[_0x1aaa99(0x46c)],'label':_0x1aaa99(0xc2)},{'value':_0x137159[_0x1aaa99(0x1d9)],'label':'sheets-pivot-ui.dateFilter.notBetween'}];function es({dateSystem:_0x5ec442,defaultDate:_0x2d5d0a,currentFilter:_0x1279f9,onConfirm:_0x2d5b52,onCancel:_0x429cd7}){const _0x4fc120=_0x1aaa99;let _0x591633=_0x2140ff(_0x2129e8);_0x362266(_0x591633['currentLocale$']);let _0x299589=_0x362266(_0x591633[_0x4fc120(0x1ee)],_0x591633[_0x4fc120(0x1d4)]()),[_0x3eb75c,_0x498350]=_0x18aa7d((_0x1279f9==null?void 0x0:_0x1279f9[_0x4fc120(0x3ec)])??_0x137159['dateEqual']),_0x38523b=Array[_0x4fc120(0x3fd)](_0x1279f9==null?void 0x0:_0x1279f9[_0x4fc120(0x2c9)])?_0x1279f9[_0x4fc120(0x2c9)][0x0]:_0x1279f9==null?void 0x0:_0x1279f9[_0x4fc120(0x2c9)],_0x4e1a18=Array[_0x4fc120(0x3fd)](_0x1279f9==null?void 0x0:_0x1279f9[_0x4fc120(0x2c9)])?_0x1279f9['expected'][0x1]:void 0x0,[_0x32ac25,_0xf15e0b]=_0x18aa7d(()=>_0x38523b??_0x2d5d0a??Zo(void 0x0,new Date(),_0x5ec442)),[_0x189bd7,_0x7b074f]=_0x18aa7d(()=>_0x4e1a18??_0x38523b??_0x2d5d0a??Zo(void 0x0,new Date(),_0x5ec442)),[_0x3d3647,_0x376f09]=_0x18aa7d((_0x1279f9==null?void 0x0:_0x1279f9[_0x4fc120(0x524)])===!0x0),[_0x3fd27d,_0x216185]=_0x18aa7d(!0x1),[_0x242a12,_0x362845]=_0x18aa7d(!0x1),_0x425843=_0x25e96e(!0x1),_0x1ca205=_0x1fe472(_0x32ac25),_0x220bdc=_0x1fe472(_0x189bd7),_0x5874b0=_0x3eb75c===_0x137159['dateBetween']||_0x3eb75c===_0x137159[_0x4fc120(0x1d9)],_0x1a556=Yo({'operator':_0x3eb75c,'lower':_0x1ca205,'upper':_0x220bdc,'useWholeDay':_0x3d3647}),_0x1704b8=_0x1a556!==void 0x0&&_0x1279f9!==void 0x0&&_0x3eb75c===_0x1279f9[_0x4fc120(0x3ec)]&&_0x3d3647===(_0x1279f9[_0x4fc120(0x524)]===!0x0)&&_0x302467['diffValue'](_0x1a556[_0x4fc120(0x2c9)],_0x1279f9[_0x4fc120(0x2c9)]);async function _0x259ca3(_0x32371f){const _0x542a63=_0x4fc120;if(!_0x425843[_0x542a63(0x312)]){_0x425843[_0x542a63(0x312)]=!0x0,_0x216185(!0x0),_0x362845(!0x1);try{await _0x2d5b52(_0x32371f)||_0x362845(!0x0);}catch{_0x362845(!0x0);}finally{_0x425843[_0x542a63(0x312)]=!0x1,_0x216185(!0x1);}}}function _0x1fe472(_0x5ac422){const _0x41a173=_0x4fc120;return typeof _0x5ac422=='string'?_0x5ac422[_0x41a173(0x311)]()===''?void 0x0:Number(_0x5ac422):_0x5ac422;}function _0x228814(_0x140a88,_0x1d41f9){_0x1d41f9?_0x7b074f(_0x140a88):_0xf15e0b(_0x140a88);}function _0x4623f2(_0x52ee71,_0x52e3e1){let _0x599f57=Zo(_0x52e3e1?_0x220bdc:_0x1ca205,_0x52ee71,_0x5ec442);_0x52e3e1?_0x7b074f(_0x599f57):_0xf15e0b(_0x599f57);}function _0x2bc3bf(_0x1ae9b7,_0x2ab83b){let _0x5cbf07=_0x2ab83b?_0x220bdc:_0x1ca205;if(_0x5cbf07===void 0x0)return;let _0x103977=Qo(_0x5cbf07,_0x1ae9b7);_0x2ab83b?_0x7b074f(_0x103977):_0xf15e0b(_0x103977);}return _0x81f19b(_0x4fc120(0x3cc),{'dir':_0x299589,'className':'univer-flex\x20univer-min-w-0\x20univer-flex-col\x20univer-gap-3','children':[_0x2a3146(_0x4fc120(0x3cc),{'className':'univer-text-sm\x20univer-font-medium','children':_0x591633['t']('sheets-pivot-ui.dateFilter.title')}),_0x81f19b(_0x4fc120(0x3cc),{'className':_0x4fc120(0xd3),'children':[_0x2a3146(_0x4fc120(0x4fb),{'className':_0x4fc120(0x33c),'children':_0x591633['t'](_0x4fc120(0x463))}),_0x2a3146(_0x44fcce,{'className':_0x4fc120(0x4b1),'value':String(_0x3eb75c),'options':$o[_0x4fc120(0x15d)](_0x55a05f=>({'value':String(_0x55a05f['value']),'label':_0x591633['t'](_0x55a05f[_0x4fc120(0x517)])})),'onChange':_0x13b2ff=>_0x498350(Number(_0x13b2ff))})]}),(_0x5874b0?[!0x1,!0x0]:[!0x1])[_0x4fc120(0x15d)](_0x4aef68=>{const _0x5d692f=_0x4fc120;let _0x45c879=_0x4aef68?_0x220bdc:_0x1ca205,_0x5b686d=_0x45c879===void 0x0?void 0x0:Xo(_0x45c879,_0x5ec442),_0x5c1c3e=(_0x4aef68?_0x4e1a18:void 0x0)??_0x38523b??_0x2d5d0a,_0x454472=_0x5c1c3e!==void 0x0&&!Xo(_0x5c1c3e,_0x5ec442),_0x52c4ae=_0x45c879===void 0x0?null:_0x173e82(_0x45c879,{'dateSystem':_0x5ec442}),_0x5a300b=_0x52c4ae?new Date(0x7d0,0x0,0x1,_0x52c4ae['hours'],_0x52c4ae[_0x5d692f(0x2f9)],_0x52c4ae[_0x5d692f(0x422)],Math[_0x5d692f(0x505)](_0x52c4ae[_0x5d692f(0x395)]*0x3e8)):void 0x0,_0x2805bf=_0x5d692f(0x16a);return _0x5874b0&&(_0x2805bf=_0x4aef68?_0x5d692f(0xca):_0x5d692f(0x40d)),_0x81f19b(_0x5d692f(0x3cc),{'role':_0x5d692f(0x399),'aria-label':_0x591633['t'](_0x2805bf),'className':_0x5d692f(0x354),'children':[_0x2a3146('span',{'className':'univer-text-xs','children':_0x591633['t'](_0x2805bf)}),_0x454472?_0x81f19b(_0x5d692f(0x3cc),{'className':_0x5d692f(0xd3),'children':[_0x2a3146(_0x5d692f(0x4fb),{'className':_0x5d692f(0x1ba),'children':_0x591633['t'](_0x5d692f(0x203))}),_0x2a3146(_0x1b81fe,{'value':String((_0x4aef68?_0x189bd7:_0x32ac25)??''),'onChange':_0x256f58=>_0x228814(_0x256f58,_0x4aef68)})]}):_0x81f19b(_0x5d692f(0x3cc),{'className':_0x5d692f(0x3ed),'children':[_0x2a3146(_0x33030d,{'value':_0x5b686d,'onValueChange':_0x532de6=>_0x4623f2(_0x532de6,_0x4aef68)}),!_0x3d3647&&_0x45c879!==void 0x0&&_0x2a3146(_0x164f28,{'value':_0x5a300b,'onValueChange':_0x4a3b15=>_0x2bc3bf(_0x4a3b15,_0x4aef68)})]})]},String(_0x4aef68));}),_0x2a3146(_0x180ca8,{'checked':_0x3d3647,'onChange':_0x23391a=>_0x376f09(_0x23391a===!0x0),'children':_0x591633['t'](_0x4fc120(0x131))}),_0x242a12&&_0x2a3146(_0x4fc120(0x3cc),{'role':_0x4fc120(0x235),'className':'univer-text-xs\x20univer-text-red-500','children':_0x591633['t'](_0x4fc120(0x1f7))}),_0x81f19b('div',{'className':'univer-flex\x20univer-flex-wrap\x20univer-items-center\x20univer-justify-between\x20univer-gap-2','children':[_0x2a3146(_0x38daeb,{'variant':_0x4fc120(0x2f5),'disabled':_0x3fd27d||!_0x1279f9,'onClick':()=>_0x259ca3(void 0x0),'children':_0x591633['t'](_0x4fc120(0x33e))}),_0x81f19b(_0x4fc120(0x3cc),{'className':_0x4fc120(0x14f),'children':[_0x2a3146(_0x38daeb,{'disabled':_0x3fd27d,'onClick':_0x429cd7,'children':_0x591633['t'](_0x4fc120(0x351))}),_0x2a3146(_0x38daeb,{'variant':'primary','disabled':_0x3fd27d||!_0x1a556||_0x1704b8,'onClick':()=>_0x259ca3(_0x1a556),'children':_0x591633['t'](_0x4fc120(0x263))})]})]})]});}function ts(_0xfc10ef){const _0x385b64=_0x1aaa99;let {dialogId:_0x5bf799=Or,filterItemInfo:_0x4471d3,onClose:_0x30fe78,onSetFilter:_0x38c8d9,onSetSort:_0x3f1060,onSetDateFilter:_0x3d3fce,unitId:_0x52bbe7,subUnitId:_0x456467}=_0xfc10ef,{format:_0x6ab524,filterInfo:_0x9ddfcf,sortInfo:_0x2aad81}=_0x4471d3,_0x444219=_0x4471d3['conditionFilter']??_0x9ddfcf,_0x2cdf68=_0x2140ff(_0x12babc),_0x180a18=_0x2140ff(_0x2129e8);_0x362266(_0x180a18[_0x385b64(0x51c)]);let _0x38625a=_0x2140ff(_0x4f85fa),_0xbd08db=_0x2140ff(_0x570eee),_0x3b9018=_0x362266(_0x180a18['direction$'],_0x180a18[_0x385b64(0x1d4)]()),_0x5039fa=_0x25e96e(!0x0),[_0x419bd8,_0x42d7df]=_0x18aa7d(!0x1);_0x2c2735(()=>(_0x5039fa[_0x385b64(0x312)]=!0x0,()=>{const _0x5cd37d=_0x385b64;_0x5039fa[_0x5cd37d(0x312)]=!0x1;}),[]);let [_0x3b5724,_0x255f3c]=_0x18aa7d(()=>_0x4471d3?_0x4471d3[_0x385b64(0x26f)]??(_0x9ddfcf==null?void 0x0:_0x9ddfcf['list'])??_0x4471d3[_0x385b64(0x14e)]:[]),[_0x2fec6b,_0xb0ae27]=_0x18aa7d(()=>_0x4471d3[_0x385b64(0x37c)]??[]),_0x2f99f3=_0x2fec6b['length']===0x0&&_0x3b5724[_0x385b64(0x483)]===_0x4471d3['items']['length'],_0x13c170=_0x3b5724['length']===0x0&&_0x2fec6b['length']===0x0,[_0x42a81c,_0xc08b63]=_0x18aa7d(()=>{const _0x148e83=_0x385b64;if(_0x4471d3)return _0x2aad81==null?void 0x0:_0x2aad81[_0x148e83(0x155)];}),_0x5bd3ed=()=>{const _0x457793=_0x385b64;_0x5039fa[_0x457793(0x312)]&&(_0x5039fa[_0x457793(0x312)]=!0x1,_0x30fe78?_0x30fe78():_0x38625a[_0x457793(0x2a3)](_0x5bf799));};if(_0x2c2735(()=>{const _0xc0f1a2=_0x385b64;let _0x5028f8=_0xbd08db[_0xc0f1a2(0x2ab)](_0x36df91[_0xc0f1a2(0x416)]);if(!_0x5028f8)return;let _0x53db3c=_0x5028f8[_0xc0f1a2(0x452)]['subscribe'](_0x495b49=>{const _0x5ae3d8=_0xc0f1a2;_0x495b49&&_0x495b49[_0x5ae3d8(0x258)]()!==_0x456467&&_0x5039fa[_0x5ae3d8(0x312)]&&(_0x5039fa[_0x5ae3d8(0x312)]=!0x1,_0x30fe78?_0x30fe78():_0x38625a[_0x5ae3d8(0x2a3)](_0x5bf799));});return()=>_0x53db3c==null?void 0x0:_0x53db3c['unsubscribe']();},[_0x5bf799,_0x38625a,_0x30fe78,_0x456467,_0xbd08db]),!_0x4471d3)return;let _0x256268=()=>{const _0x6df64e=_0x385b64;_0xb0ae27([]),_0x255f3c(_0x2f99f3?[]:_0x4471d3[_0x6df64e(0x14e)]);},_0x27fc6b=_0x2f7177=>{const _0x26918e=_0x385b64;_0x2fec6b['includes'](_0x2f7177)?(_0xb0ae27(_0x2fec6b[_0x26918e(0x474)](_0x1ae4bc=>_0x1ae4bc!==_0x2f7177)),_0x255f3c([..._0x3b5724,_0x2f7177])):_0x3b5724[_0x26918e(0x444)](_0x2f7177)?_0x255f3c(_0x3b5724['filter'](_0x2216e5=>_0x2216e5!==_0x2f7177)):_0x255f3c([..._0x3b5724,_0x2f7177]);},_0x21daab=async()=>{const _0x7aa9dc=_0x385b64;let {tableFieldId:_0x39f53a,pivotTableId:_0x129b3c}=_0x4471d3;if(_0x39f53a&&_0x129b3c)try{(_0x38c8d9?await _0x38c8d9(_0x3b5724,_0x2f99f3,_0x2fec6b):await _0x2cdf68[_0x7aa9dc(0x4e2)](_0x1d4592['id'],{'unitId':_0x52bbe7,'subUnitId':_0x456467,'pivotTableId':_0x129b3c,'tableFieldId':_0x39f53a,'items':_0x3b5724,'partialItems':_0x2fec6b,'isAll':_0x2f99f3}))&&_0x5039fa[_0x7aa9dc(0x312)]&&_0x5bd3ed();}catch{}},_0x2bff37=()=>{_0x5bd3ed();},_0xff5358=async()=>{const _0x347fc8=_0x385b64;let {tableFieldId:_0x33fc4c,pivotTableId:_0x9fbb3c}=_0x4471d3;if(_0x33fc4c&&_0x9fbb3c){_0x255f3c(_0x4471d3['items']),_0xb0ae27([]);try{(_0x38c8d9?await _0x38c8d9(_0x4471d3[_0x347fc8(0x14e)],!0x0,[],!0x0):await _0x2cdf68[_0x347fc8(0x4e2)](_0x1d4592['id'],{'unitId':_0x52bbe7,'subUnitId':_0x456467,'pivotTableId':_0x9fbb3c,'tableFieldId':_0x33fc4c,'items':_0x4471d3[_0x347fc8(0x14e)],'partialItems':[],'isAll':!0x0,'clearAllFilters':!0x0}))&&_0x5039fa['current']&&_0x5bd3ed();}catch{}}},_0x2ce6c6=async _0x5a4770=>{const _0xeccdb2=_0x385b64;let {tableFieldId:_0x291096,pivotTableId:_0x129f4e}=_0x4471d3;if(!_0x291096||!_0x129f4e)return;let _0x252961={'type':_0x5a4770};try{(_0x3f1060?await _0x3f1060(_0x252961):await _0x2cdf68['executeCommand'](_0x213b5a['id'],{'unitId':_0x52bbe7,'subUnitId':_0x456467,'pivotTableId':_0x129f4e,'tableFieldId':_0x291096,'info':_0x252961}))&&_0x5039fa[_0xeccdb2(0x312)]&&(_0xc08b63(_0x5a4770),_0x5bd3ed());}catch{}},_0x4b0a58=Ha(_0x9ddfcf,{'items':_0x4471d3[_0x385b64(0x14e)],'conditionFilter':_0x4471d3[_0x385b64(0x34a)]});async function _0x4352ed(_0x40ca9b){const _0x47bca0=_0x385b64;if(!_0x5039fa['current'])return!0x1;let _0x3497f5=_0x3d3fce?await _0x3d3fce(_0x40ca9b):await _0x2cdf68[_0x47bca0(0x4e2)](_0x41d20f['id'],{'unitId':_0x52bbe7,'subUnitId':_0x456467,'pivotTableId':_0x4471d3[_0x47bca0(0x53d)],'tableFieldId':_0x4471d3[_0x47bca0(0x1b1)],'filterInfo':_0x40ca9b});return _0x3497f5&&_0x5039fa[_0x47bca0(0x312)]&&_0x5bd3ed(),_0x3497f5;}if(_0x419bd8){let _0x44d3fb=_0xbd08db[_0x385b64(0x29e)](_0x52bbe7),_0xb36164=_0x4471d3['itemTypes'][_0x385b64(0x47b)](_0x332274=>_0x332274===_0xe427cd['date']),_0x3fd390=Number(_0x4471d3[_0x385b64(0x14e)][_0xb36164]);return _0x2a3146(es,{'dateSystem':(_0x44d3fb==null?void 0x0:_0x44d3fb[_0x385b64(0x509)]())??_0x40debb[_0x385b64(0x330)],'defaultDate':Number[_0x385b64(0x3f4)](_0x3fd390)?_0x3fd390:void 0x0,'currentFilter':_0x23bbe1(_0x444219)?_0x444219:void 0x0,'onConfirm':_0x4352ed,'onCancel':()=>_0x42d7df(!0x1)});}return _0x81f19b(_0x385b64(0x3cc),{'dir':_0x3b9018,'children':[_0x4471d3[_0x385b64(0x43d)]&&_0x2a3146(_0x38daeb,{'className':_0x385b64(0x105),'onClick':()=>_0x42d7df(!0x0),'children':_0x180a18['t']('sheets-pivot-ui.dateFilter.title')}),_0x81f19b(_0x385b64(0x3cc),{'className':_0x385b64(0x3e6),'children':[_0x81f19b(_0x385b64(0x3cc),{'className':_0x1d52fd(_0x385b64(0x4b9),_0x4d03f3,{'univer-bg-gray-100\x20dark:!univer-bg-gray-700':_0x42a81c===_0x37cdcc['ascending']}),'onClick':()=>_0x2ce6c6(_0x37cdcc['ascending']),'children':[_0x2a3146(_0x1eab93,{}),_0x180a18['t'](_0x385b64(0x167))]}),_0x81f19b(_0x385b64(0x3cc),{'className':_0x1d52fd(_0x385b64(0x227),_0x4d03f3,{'univer-bg-gray-100\x20dark:!univer-bg-gray-700':_0x42a81c===_0x37cdcc['descending']}),'onClick':()=>_0x2ce6c6(_0x37cdcc['descending']),'children':[_0x2a3146(_0xf36326,{}),_0x180a18['t']('sheets-pivot-ui.dialog.filter.descending')]})]}),_0x2a3146('div',{'className':_0x1d52fd('univer-mx-0\x20univer-mb-4\x20univer-mt-3\x20univer-h-[300px]\x20univer-rounded-lg\x20univer-p-2',_0x4d03f3),'children':_0x81f19b('div',{'className':_0x1d52fd(_0x385b64(0x1b9),_0x392444),'children':[_0x2a3146('div',{'className':_0x385b64(0x480),'children':_0x2a3146(_0x180ca8,{'checked':_0x2f99f3,'onChange':_0x256268,'indeterminate':!_0x2f99f3&&(_0x3b5724['length']>0x0||_0x2fec6b['length']>0x0),'children':_0x180a18['t'](_0x385b64(0x459))})}),_0x4471d3['items'][_0x385b64(0x15d)]((_0x377359,_0x2d2966)=>{const _0x4ce190=_0x385b64;var _0x575e3d,_0x24361e;let _0x132211=_0x377359,_0x1604c3=(_0x575e3d=_0x4471d3['itemLabels'])==null?void 0x0:_0x575e3d[_0x377359],_0x157387=(_0x24361e=_0x4471d3['itemTypes'])==null?void 0x0:_0x24361e[_0x2d2966],_0x2f2fa1=ma(_0x377359,_0x157387);return _0x2f2fa1?_0x132211=_0x180a18['t'](_0x2f2fa1):_0x1604c3===void 0x0?_0x157387===_0xe427cd[_0x4ce190(0x33a)]&&_0x6ab524&&(_0x132211=_0xd5638d[_0x4ce190(0x4c5)](_0x6ab524,Number(_0x377359))):_0x132211=_0x1604c3,_0x2a3146(_0x4ce190(0x3cc),{'className':_0x4ce190(0x37d),'children':_0x2a3146(_0x180ca8,{'checked':_0x3b5724['includes'](_0x377359),'indeterminate':_0x2fec6b[_0x4ce190(0x444)](_0x377359),'onChange':()=>_0x27fc6b(_0x377359),'contentClassName':_0x4ce190(0x540),'children':_0x132211})},_0x377359);})]})}),_0x81f19b(_0xae166f,{'className':_0x385b64(0x47a),'children':[_0x2a3146(_0x385b64(0x3cc),{'className':_0x385b64(0x4ab),'children':_0x2a3146(_0x38daeb,{'variant':_0x385b64(0x2f5),'disabled':_0x4b0a58===_0x385b64(0xd2),'onClick':_0xff5358,'children':_0x180a18['t'](_0x385b64(0x33e))})}),_0x81f19b(_0xae166f,{'className':_0x385b64(0x425),'children':[_0x2a3146(_0x38daeb,{'onClick':_0x2bff37,'children':_0x180a18['t']('sheets-pivot-ui.dialog.filter.cancel')}),_0x2a3146(_0x38daeb,{'variant':_0x385b64(0xc5),'disabled':_0x13c170,'onClick':_0x21daab,'children':_0x180a18['t'](_0x385b64(0x263))})]})]})]});}function ns({name:_0x324145,onConfirm:_0x3ae1c6,onCancel:_0x2a377d}){const _0x5cac1d=_0x1aaa99;let _0x2fa258=_0x2140ff(_0x2129e8),_0x37f0b7=_0x362266(_0x2fa258[_0x5cac1d(0x1ee)],_0x2fa258['getDirection']()),[_0x130555,_0xa5c163]=_0x18aa7d(_0x324145),[_0x15c68d,_0x519ec1]=_0x18aa7d(!0x1),_0x48ae4c=_0x25e96e(!0x1);return _0x81f19b(_0x5cac1d(0x3cc),{'className':_0x5cac1d(0x241),'dir':_0x37f0b7,'children':[_0x81f19b(_0x5cac1d(0x517),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-2\x20univer-text-sm','children':[_0x2fa258['t']('sheets-pivot-ui.manualGroup.name'),_0x2a3146(_0x1b81fe,{'value':_0x130555,'onChange':_0xa5c163})]}),_0x81f19b(_0x5cac1d(0x3cc),{'className':_0x5cac1d(0x1b6),'children':[_0x2a3146(_0x38daeb,{'onClick':_0x2a377d,'children':_0x2fa258['t'](_0x5cac1d(0x3eb))}),_0x2a3146(_0x38daeb,{'variant':_0x5cac1d(0xc5),'disabled':!_0x130555[_0x5cac1d(0x311)]()||_0x15c68d,'onClick':async()=>{const _0x4a6228=_0x5cac1d;if(_0x130555[_0x4a6228(0x311)]()&&!_0x48ae4c[_0x4a6228(0x312)]){_0x48ae4c[_0x4a6228(0x312)]=!0x0,_0x519ec1(!0x0);try{await _0x3ae1c6(_0x130555);}catch{}finally{_0x48ae4c[_0x4a6228(0x312)]=!0x1,_0x519ec1(!0x1);}}},'children':_0x2fa258['t'](_0x5cac1d(0x299))})]})]});}const rs=_0x1aaa99(0x492);function is({targetFieldName:_0x85a7cf,grouping:_0x28612b,defaults$:_0x8bcb92,onConfirm:_0x44d354,onCancel:_0x28f5d3}){const _0x5633d6=_0x1aaa99;let _0x3613cf=_0x2140ff(_0x2129e8),_0x211feb=_0x362266(_0x3613cf[_0x5633d6(0x1ee)],_0x3613cf[_0x5633d6(0x1d4)]()),_0x11d454=_0x362266(_0x8bcb92),[_0x93a31e,_0x344d1a]=_0x18aa7d((_0x28612b==null?void 0x0:_0x28612b[_0x5633d6(0xc4)])??!0x0),[_0x487219,_0xc57ed5]=_0x18aa7d((_0x28612b==null?void 0x0:_0x28612b['autoEnd'])??!0x0),[_0x33d162,_0xf29c7]=_0x18aa7d((_0x28612b==null?void 0x0:_0x28612b[_0x5633d6(0xc4)])===!0x1?String(_0x28612b['start']):void 0x0),[_0xa0ebbb,_0x4cd31e]=_0x18aa7d((_0x28612b==null?void 0x0:_0x28612b[_0x5633d6(0x404)])===!0x1?String(_0x28612b['end']):void 0x0),[_0x24f038,_0x3c680a]=_0x18aa7d(_0x28612b?String(_0x28612b['interval']):void 0x0),[_0x4e5552,_0x29c2bd]=_0x18aa7d(!0x1),_0x5d207a=_0x25e96e(!0x1),_0x3289fb=_0x311bb4=>_0x311bb4===void 0x0||!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i[_0x5633d6(0xf6)](_0x311bb4['trim']())?NaN:Number(_0x311bb4),_0x37468e={'autoStart':_0x93a31e,'autoEnd':_0x487219,'start':_0x93a31e?_0x11d454==null?void 0x0:_0x11d454[_0x5633d6(0x465)]:_0x3289fb(_0x33d162),'end':_0x487219?_0x11d454==null?void 0x0:_0x11d454['end']:_0x3289fb(_0xa0ebbb),'interval':_0x24f038===void 0x0||_0x24f038[_0x5633d6(0x311)]()===''?(_0x11d454==null?void 0x0:_0x11d454['interval'])??0x0:_0x3289fb(_0x24f038)},_0x3e492f=!!_0x11d454&&ii(_0x37468e),_0x38d0de=_0x4c4a1f=>{const _0x2ff2fc=_0x5633d6;!_0x4c4a1f&&_0x33d162===void 0x0&&(_0x11d454==null?void 0x0:_0x11d454[_0x2ff2fc(0x465)])!==void 0x0&&_0xf29c7(String(_0x11d454[_0x2ff2fc(0x465)])),_0x344d1a(_0x4c4a1f);},_0x3f6f1b=_0x4f7750=>{const _0xbddd4a=_0x5633d6;!_0x4f7750&&_0xa0ebbb===void 0x0&&(_0x11d454==null?void 0x0:_0x11d454[_0xbddd4a(0x419)])!==void 0x0&&_0x4cd31e(String(_0x11d454[_0xbddd4a(0x419)])),_0xc57ed5(_0x4f7750);};return _0x81f19b(_0x5633d6(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-4','dir':_0x211feb,'children':[_0x2a3146('div',{'className':'univer-text-sm\x20univer-font-medium','children':_0x85a7cf}),_0x81f19b(_0x5633d6(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-2','children':[_0x2a3146(_0x180ca8,{'checked':_0x93a31e,'onChange':_0xe18e38=>_0x38d0de(!!_0xe18e38),'children':_0x3613cf['t']('sheets-pivot-ui.numberGroup.autoStart')}),_0x81f19b('label',{'className':rs,'children':[_0x3613cf['t'](_0x5633d6(0x295)),_0x2a3146(_0x1b81fe,{'className':_0x5633d6(0x563),'value':_0x93a31e?String((_0x11d454==null?void 0x0:_0x11d454[_0x5633d6(0x465)])??''):_0x33d162??'','disabled':_0x93a31e,'onChange':_0xf29c7})]}),_0x2a3146(_0x180ca8,{'checked':_0x487219,'onChange':_0x22ac16=>_0x3f6f1b(!!_0x22ac16),'children':_0x3613cf['t'](_0x5633d6(0x300))}),_0x81f19b('label',{'className':rs,'children':[_0x3613cf['t']('sheets-pivot-ui.numberGroup.end'),_0x2a3146(_0x1b81fe,{'className':'univer-w-32','value':_0x487219?String((_0x11d454==null?void 0x0:_0x11d454[_0x5633d6(0x419)])??''):_0xa0ebbb??'','disabled':_0x487219,'onChange':_0x4cd31e})]}),_0x81f19b('label',{'className':rs,'children':[_0x3613cf['t']('sheets-pivot-ui.numberGroup.interval'),_0x2a3146(_0x1b81fe,{'className':_0x5633d6(0x563),'value':_0x24f038??String((_0x11d454==null?void 0x0:_0x11d454['interval'])??''),'placeholder':String((_0x11d454==null?void 0x0:_0x11d454[_0x5633d6(0x3f3)])??''),'onChange':_0x3c680a})]})]}),_0x81f19b(_0x5633d6(0x3cc),{'className':_0x5633d6(0x1b6),'children':[_0x2a3146(_0x38daeb,{'onClick':_0x28f5d3,'children':_0x3613cf['t']('sheets-pivot-ui.dialog.cancel')}),_0x2a3146(_0x38daeb,{'variant':_0x5633d6(0xc5),'disabled':!_0x3e492f||_0x4e5552,'onClick':async()=>{const _0x17cd90=_0x5633d6;if(_0x3e492f&&!_0x5d207a['current']){_0x5d207a[_0x17cd90(0x312)]=!0x0,_0x29c2bd(!0x0);try{await _0x44d354(_0x37468e);}catch{}finally{_0x5d207a[_0x17cd90(0x312)]=!0x1,_0x29c2bd(!0x1);}}},'children':_0x3613cf['t'](_0x5633d6(0x299))})]})]});}const as=({handlePatternChange:_0x431da9})=>{const _0x32f176=_0x1aaa99;let _0x42f278=_0x2140ff(_0x2129e8);return _0x2c2735(()=>{_0x431da9('');},[]),_0x2a3146(_0x32f176(0x3cc),{'className':'univer-mt-1.5\x20univer-text-sm\x20univer-leading-5\x20univer-text-gray-600\x20dark:!univer-text-gray-200','children':_0x42f278['t'](_0x32f176(0x1ca))});},os=({originPattern:_0x2edd4f,handlePatternChange:_0x5c3b2c})=>{const _0x47d181=_0x1aaa99;let _0x21e5cf=_0x2140ff(_0x2129e8),_0x46c723=_0x208996[_0x47d181(0x15d)](_0x385687=>({'label':_0x385687,'value':_0x385687})),[_0x2c196c,_0x2e2039]=_0x18aa7d(()=>ka(_0x2edd4f||'',0x2)),[_0x312f50,_0x487533]=_0x18aa7d(()=>ja(_0x2edd4f??'')||_0x46c723[0x0]['value']);return _0x2c2735(()=>{const _0x501b0e=_0x47d181;_0x5c3b2c($(_0x501b0e(0x566)+_0x312f50+_0x501b0e(0x323)+(_0x2c196c>0x0?'.0':'')+'_)',_0x2c196c));},[]),_0x81f19b('div',{'className':_0x47d181(0x4a6),'children':[_0x81f19b(_0x47d181(0x3cc),{'className':_0x47d181(0x47a),'children':[_0x81f19b(_0x47d181(0x3cc),{'className':_0x47d181(0x4e0),'children':[_0x2a3146('div',{'className':_0x47d181(0x173),'children':_0x21e5cf['t'](_0x47d181(0xf1))}),_0x2a3146(_0x536e2c,{'className':_0x47d181(0x4e4),'value':_0x2c196c,'max':0x14,'min':0x0,'onChange':_0x22c8f7=>{const _0x58f6b1=_0x47d181;let _0x3fbcf1=_0x22c8f7??0x0;_0x2e2039(_0x3fbcf1),_0x5c3b2c($(_0x58f6b1(0x566)+_0x312f50+_0x58f6b1(0x323)+(_0x3fbcf1>0x0?'.0':'')+'_)',_0x3fbcf1));}})]}),_0x81f19b('div',{'className':_0x47d181(0x4e0),'children':[_0x2a3146(_0x47d181(0x3cc),{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium','children':_0x21e5cf['t'](_0x47d181(0x195))}),_0x2a3146(_0x44fcce,{'options':_0x46c723,'value':_0x312f50,'onChange':_0x433833=>{const _0x4fd622=_0x47d181;_0x487533(_0x433833),_0x5c3b2c($(_0x4fd622(0x566)+_0x433833+_0x4fd622(0x323)+(_0x2c196c>0x0?'.0':'')+'_)',_0x2c196c));}})]})]}),_0x2a3146('div',{'className':_0x47d181(0x213),'children':_0x21e5cf['t'](_0x47d181(0x18b))})]});},ss=({originPattern:_0x56bb53,handlePatternChange:_0x1354ec})=>{const _0x5c29ff=_0x1aaa99;let _0x5daef7=_0x2140ff(_0x2129e8),_0x587961=_0x208996[_0x5c29ff(0x15d)](_0x3db1cf=>({'label':_0x3db1cf,'value':_0x3db1cf})),[_0x1ab135,_0x3cd7a0]=_0x18aa7d(()=>ka(_0x56bb53||'',0x2)),[_0x5cde4f,_0x495177]=_0x18aa7d(()=>ja(_0x56bb53??'')||_0x587961[0x0]['value']),_0x37587b=fa['map'](_0x575f78=>({'label':_0x575f78['label'](_0x5cde4f),'value':_0x575f78[_0x5c29ff(0x26e)](_0x5cde4f),'color':_0x575f78[_0x5c29ff(0x20c)]})),[_0x3f69de,_0x2d451e]=_0x18aa7d(()=>{const _0x4819ce=_0x5c29ff;var _0x31027f;return((_0x31027f=_0x37587b[_0x4819ce(0x55a)](_0x14ef7f=>_0x55e497(_0x14ef7f[_0x4819ce(0xd6)],_0x56bb53??'')))==null?void 0x0:_0x31027f['value'])||_0x37587b[0x0][_0x4819ce(0xd6)];});return _0x2c2735(()=>{_0x1354ec($(_0x3f69de,_0x1ab135));},[]),_0x81f19b('div',{'className':_0x5c29ff(0x4a6),'children':[_0x81f19b(_0x5c29ff(0x3cc),{'className':_0x5c29ff(0x47a),'children':[_0x81f19b('div',{'className':_0x5c29ff(0x4e0),'children':[_0x2a3146('div',{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium','children':_0x5daef7['t'](_0x5c29ff(0xf1))}),_0x2a3146(_0x536e2c,{'className':_0x5c29ff(0x4e4),'value':_0x1ab135,'max':0x14,'min':0x0,'onChange':_0x3aded4=>{_0x3aded4&&(_0x3cd7a0(_0x3aded4),_0x1354ec($(_0x3f69de,_0x3aded4)));}})]}),_0x81f19b(_0x5c29ff(0x3cc),{'className':_0x5c29ff(0x4e0),'children':[_0x2a3146(_0x5c29ff(0x3cc),{'className':_0x5c29ff(0x173),'children':_0x5daef7['t'](_0x5c29ff(0x195))}),_0x2a3146(_0x44fcce,{'options':_0x587961,'value':_0x5cde4f,'onChange':_0x420e11=>{const _0x1277f4=_0x5c29ff;_0x495177(_0x420e11);let _0x1c57ef=fa[_0x1277f4(0x15d)](_0x5e211f=>({'label':_0x5e211f[_0x1277f4(0x517)](_0x420e11),'value':_0x5e211f[_0x1277f4(0x26e)](_0x420e11),'color':_0x5e211f['color']}));_0x2d451e(_0x1c57ef[0x0][_0x1277f4(0xd6)]),_0x1354ec($(_0x1c57ef[0x0][_0x1277f4(0xd6)],_0x1ab135));}})]})]}),_0x81f19b(_0x5c29ff(0x3cc),{'className':'univer-mt-4','children':[_0x2a3146(_0x5c29ff(0x3cc),{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium','children':_0x5daef7['t'](_0x5c29ff(0x503))}),_0x2a3146(_0x1a842c,{'className':'univer-rounded-lg\x20univer-p-2','options':_0x37587b,'value':_0x3f69de,'onChange':_0x53e057=>{_0x2d451e(_0x53e057),_0x1354ec($(_0x53e057,_0x1ab135));}}),_0x2a3146(_0x5c29ff(0x3cc),{'className':'univer-mt-1.5\x20univer-text-sm\x20univer-leading-5\x20univer-text-gray-600\x20dark:!univer-text-gray-200','children':_0x5daef7['t']('sheets-pivot-ui.dialog.numfmt.currencyDesc')})]})]});},cs=({originPattern:_0x5dc9c2,handlePatternChange:_0xe4a75})=>{const _0x5aae9a=_0x1aaa99;let _0x53ae21=_0x2140ff(_0x2129e8),_0x35e777=ua[_0x5aae9a(0x15d)](_0x53bbe9=>({'label':_0x53bbe9[_0x5aae9a(0x517)],'value':_0x53bbe9[_0x5aae9a(0x26e)]})),[_0x2ebfb2,_0x58d334]=_0x18aa7d(()=>{const _0x1a0519=_0x5aae9a;if(_0x5dc9c2){let _0x340b52=_0x35e777[_0x1a0519(0x55a)](_0x656e92=>_0x656e92['value']===_0x5dc9c2);if(_0x340b52)return _0x340b52[_0x1a0519(0xd6)];}return _0x35e777[0x0][_0x1a0519(0xd6)];});return _0x2c2735(()=>{_0xe4a75(_0x2ebfb2);},[]),_0x2a3146(_0x5aae9a(0x3cc),{'className':_0x5aae9a(0x4a6),'children':_0x81f19b('div',{'className':'univer-mt-5','children':[_0x2a3146(_0x5aae9a(0x3cc),{'className':_0x5aae9a(0x173),'children':_0x53ae21['t'](_0x5aae9a(0x240))}),_0x2a3146(_0x5aae9a(0x3cc),{'children':_0x2a3146(_0x1a842c,{'className':'univer-rounded-lg\x20univer-p-2','options':_0x35e777,'value':_0x2ebfb2,'onChange':_0x1cca35=>{_0x58d334(_0x1cca35),_0xe4a75(_0x1cca35);}})}),_0x2a3146('div',{'className':_0x5aae9a(0x213),'children':_0x53ae21['t'](_0x5aae9a(0x481))})]})});},ls=({originPattern:_0x41da3f,handlePatternChange:_0xbb8ee5})=>{const _0x1f3206=_0x1aaa99;let _0x49985b=_0x2140ff(_0x2129e8),[_0x31b5ed,_0xcf69ee]=_0x18aa7d(()=>ka(_0x41da3f||'',0x0)),_0x490f6d=da[_0x1f3206(0x15d)](_0x58ade9=>({'label':_0x58ade9[_0x1f3206(0x517)],'value':_0x58ade9[_0x1f3206(0x26e)],'color':_0x58ade9[_0x1f3206(0x20c)]})),[_0x2e3506,_0x56ebba]=_0x18aa7d(()=>{const _0x5b776b=_0x1f3206;let _0x1fef47=_0x490f6d['find'](_0x494331=>_0x55e497(_0x494331[_0x5b776b(0xd6)],_0x41da3f||''));return(_0x1fef47==null?void 0x0:_0x1fef47[_0x5b776b(0xd6)])||_0x490f6d[0x0]['value'];});return _0x2c2735(()=>{_0xbb8ee5($(_0x2e3506,Number(_0x31b5ed||0x0)));},[]),_0x81f19b('div',{'className':_0x1f3206(0x4a6),'children':[_0x2a3146(_0x1f3206(0x3cc),{'className':_0x1f3206(0x47a),'children':_0x81f19b(_0x1f3206(0x3cc),{'className':'univer-w-[136px]','children':[_0x2a3146(_0x1f3206(0x3cc),{'className':_0x1f3206(0x173),'children':_0x49985b['t'](_0x1f3206(0xf1))}),_0x2a3146(_0x536e2c,{'className':_0x1f3206(0x4e4),'value':_0x31b5ed,'max':0x14,'min':0x0,'onChange':_0x4d6601=>{_0x4d6601&&(_0xcf69ee(_0x4d6601),_0xbb8ee5($(_0x2e3506,Number(_0x4d6601))));}})]})}),_0x81f19b(_0x1f3206(0x3cc),{'className':'univer-mt-4','children':[_0x2a3146(_0x1f3206(0x3cc),{'className':_0x1f3206(0x173),'children':_0x49985b['t']('sheets-pivot-ui.dialog.numfmt.negativeNumberTypes')}),_0x2a3146(_0x1a842c,{'className':_0x1f3206(0x3de),'options':_0x490f6d,'value':_0x2e3506,'onChange':_0x4eb46c=>{_0xcf69ee(ka(_0x4eb46c,0x0)),_0x56ebba(_0x4eb46c),_0xbb8ee5(_0x4eb46c);}}),_0x2a3146('div',{'className':_0x1f3206(0x213),'children':_0x49985b['t'](_0x1f3206(0x48b))})]})]});},us=({unitId:_0x2b17bf,subUnitId:_0x455bc0,pivotTableId:_0x35c83d,tableFieldId:_0x37ce30,originPattern:_0x2e7591,tableFieldInfo:_0x3e8e1a,dataFieldInfo:_0x21e858})=>{const _0x55e6c8=_0x1aaa99;let _0x583854=_0x2140ff(_0x2129e8),_0x5ae1a9=_0x2140ff(_0x4f85fa),_0x2670ff=_0x583854[_0x55e6c8(0x1d4)](),_0x1fcfc2=_0x38d376(()=>[{'label':_0x55e6c8(0x1c9),'component':as,'key':_0x55e6c8(0x2a7)},{'label':_0x55e6c8(0x2f8),'component':os,'key':_0x55e6c8(0x318)},{'label':_0x55e6c8(0x531),'component':ss,'key':_0x55e6c8(0x451)},{'label':'sheets-pivot-ui.dialog.numfmt.date','component':cs,'key':_0x55e6c8(0x2a8)},{'label':_0x55e6c8(0x2e1),'component':ls,'key':'sheet.numfmt.thousandthPercentile'}][_0x55e6c8(0x15d)](_0x48cd15=>({..._0x48cd15,'label':_0x583854['t'](_0x48cd15['label'])})),[_0x583854]),_0x3ea8f6=_0x1fcfc2[_0x55e6c8(0x15d)](_0x16c8eb=>({'label':_0x16c8eb[_0x55e6c8(0x517)],'value':_0x16c8eb['key']})),[_0x5e5fc0,_0x126bd2]=_0x18aa7d(()=>[Ma,Na,Pa,Ia,Ra][_0x55e6c8(0x424)]((_0xe84204,_0x584761,_0x576abf)=>_0xe84204||(_0x584761(_0x2e7591??'')?_0x1fcfc2[_0x576abf][_0x55e6c8(0x3d4)]:''),'')||_0x1fcfc2[0x0]['key']),[_0x43abab,_0x302628]=_0x18aa7d(_0x2e7591),_0x4457b9=_0x589e2a=>_0x302628(_0x589e2a),_0x42d3e4=_0x3a1808=>{_0x126bd2(_0x3a1808);},_0x4f429d=_0x1ed9b7=>({'id':Ar,'title':{'title':_0x583854['t'](_0x55e6c8(0x228))},'draggable':!0x0,'mask':!0x1,'maskClosable':!0x1,'width':0x190,'children':{'label':kr,'tableFieldId':_0x37ce30,'pivotTableId':_0x35c83d,'unitId':_0x2b17bf,'subUnitId':_0x455bc0,'tableFieldInfo':_0x3e8e1a,'dataFieldInfo':_0x21e858,'key':_0x55e6c8(0x133)+(_0x37ce30||''),'closeFn':()=>{_0x5ae1a9['close'](Ar);},'format':_0x1ed9b7?_0x43abab:''},'onClose':()=>{const _0x5d19d2=_0x55e6c8;_0x5ae1a9[_0x5d19d2(0x2a3)](Ar);}}),_0x19a70d=()=>{const _0x58e5d0=_0x55e6c8;_0x5ae1a9[_0x58e5d0(0x2a3)](Mr);let _0x3f42f5=_0x4f429d(!0x1);_0x5ae1a9['open'](_0x3f42f5);};return _0x81f19b(_0x55e6c8(0x3cc),{'dir':_0x2670ff,'children':[_0x2a3146(_0x55e6c8(0x3cc),{'className':_0x55e6c8(0x3e6),'children':_0x81f19b(_0x55e6c8(0x3cc),{'className':_0x55e6c8(0x23e),'onClick':_0x19a70d,'children':[_0x2a3146(_0x1d964b,{}),_0x583854['t'](_0x55e6c8(0x43f))]})}),_0x2a3146('div',{'className':_0x55e6c8(0xc1),'children':_0x583854['t'](_0x55e6c8(0x548))}),_0x2a3146('div',{'children':_0x2a3146(_0x44fcce,{'className':_0x55e6c8(0x4b1),'value':_0x5e5fc0,'options':_0x3ea8f6,'onChange':_0x489364=>_0x42d3e4(_0x489364)})}),_0x81f19b(_0x55e6c8(0x3cc),{'children':[_0x5e5fc0===_0x55e6c8(0x2a7)&&_0x2a3146(as,{'originPattern':_0x2e7591,'handlePatternChange':_0x4457b9}),_0x5e5fc0===_0x55e6c8(0x318)&&_0x2a3146(os,{'originPattern':_0x2e7591,'handlePatternChange':_0x4457b9}),_0x5e5fc0===_0x55e6c8(0x451)&&_0x2a3146(ss,{'originPattern':_0x2e7591,'handlePatternChange':_0x4457b9}),_0x5e5fc0==='sheet.numfmt.date'&&_0x2a3146(cs,{'originPattern':_0x2e7591,'handlePatternChange':_0x4457b9}),_0x5e5fc0===_0x55e6c8(0x514)&&_0x2a3146(ls,{'originPattern':_0x2e7591,'handlePatternChange':_0x4457b9})]}),_0x81f19b(_0xae166f,{'className':_0x55e6c8(0x359),'children':[_0x2a3146(_0x38daeb,{'onClick':_0x19a70d,'children':_0x583854['t'](_0x55e6c8(0x313))}),_0x2a3146(_0x38daeb,{'className':_0x55e6c8(0x152),'variant':_0x55e6c8(0xc5),'onClick':()=>{const _0x54b884=_0x55e6c8;_0x5ae1a9[_0x54b884(0x2a3)](Mr);let _0x2c816a=_0x4f429d(!0x0);_0x5ae1a9['open'](_0x2c816a);},'children':_0x583854['t'](_0x55e6c8(0x37f))})]})]});};function ds(_0x14bf6d){const _0x14e611=_0x1aaa99;var _0x377296,_0x2a458d;let {scope:_0x59cd28,report:_0xa1c20b,getCurrentReport:_0x2ac347,onChange:_0x536875}=_0x14bf6d,_0x102572=_0x2140ff(_0x2129e8),_0x3b3f9a=_0x2140ff(_0x7c076c),_0x1168f2=_0x2140ff(_0x43647f),_0x5b1eaf=_0x2140ff(_0x5f571f),_0x4731d6=_0x2140ff(_0x3e0dae);_0x362266(_0x5b1eaf[_0x14e611(0x2c8)]);let [_0x3d522c,_0x99c14a]=_0x18aa7d(!0x1),_0x557d1e=_0x25e96e(!0x1),_0x50e0df=_0x25e96e(!0x0),_0x319097=JSON[_0x14e611(0x42a)](_0x59cd28),_0x4c139a=_0x25e96e(_0x319097);_0x4c139a[_0x14e611(0x312)]=_0x319097,_0x2c2735(()=>(_0x50e0df[_0x14e611(0x312)]=!0x0,()=>{const _0x4503ec=_0x14e611;_0x50e0df[_0x4503ec(0x312)]=!0x1;}),[]);let _0xfe70d5=_0x3d522c||!_0xa1c20b||((_0x377296=_0x5b1eaf[_0x14e611(0x1c5)](new _0x23a297(_0x59cd28['unitId'])['id']))==null?void 0x0:_0x377296['value'])===!0x1||((_0x2a458d=_0x5b1eaf[_0x14e611(0x1c5)](new _0x1723a0(_0x59cd28[_0x14e611(0xf8)],_0x59cd28['subUnitId'])['id']))==null?void 0x0:_0x2a458d[_0x14e611(0xd6)])===!0x1,_0xb8521e=async _0x18e9ee=>{const _0x9e420a=_0x14e611;if(_0x557d1e['current']||_0xfe70d5||!_0xa1c20b||_0xa1c20b['options'][_0x9e420a(0x3d9)]===_0x18e9ee)return;_0x557d1e[_0x9e420a(0x312)]=!0x0,_0x99c14a(!0x0);let _0x2dec0c=_0x302467['deepClone'](_0xa1c20b);try{if(!_0x18e9ee&&_0xebe916(_0xa1c20b)){let _0x32ec5c=await _0x1168f2[_0x9e420a(0x30e)]['fetchThroughAsyncInterceptors'](_0x33b0b7)({'redos':[],'undos':[],'groups':[],'validate':()=>void 0x0},_0x59cd28);if(!_0x50e0df['current']||_0x4c139a[_0x9e420a(0x312)]!==_0x319097||!await _0x3b3f9a[_0x9e420a(0x1a6)]({'id':'sheet-pivot.confirm.disable-multiple-filters','title':{'title':_0x102572['t'](_0x9e420a(0xbc))},'children':{'title':_0x102572['t']('sheets-pivot-ui.config.multipleFiltersClearWarning')},'cancelText':_0x102572['t'](_0x9e420a(0x3eb)),'confirmText':_0x102572['t'](_0x9e420a(0x299))}))return;_0x32ec5c==null||_0x32ec5c[_0x9e420a(0x2d1)]();}if(!_0x50e0df[_0x9e420a(0x312)]||_0x4c139a[_0x9e420a(0x312)]!==_0x319097||!_0x302467[_0x9e420a(0x14c)](_0x2dec0c,_0x2ac347()))return;await _0x536875(_0x18e9ee);}catch(_0x193c3c){_0x4731d6[_0x9e420a(0x344)](_0x9e420a(0x381),_0x193c3c);}finally{_0x557d1e[_0x9e420a(0x312)]=!0x1,_0x50e0df[_0x9e420a(0x312)]&&_0x99c14a(!0x1);}};return _0x81f19b(_0x14e611(0x4c9),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-3','children':[_0x2a3146(_0x14e611(0x3cc),{'className':'univer-text-sm\x20univer-font-medium\x20univer-text-gray-600','children':_0x102572['t'](_0x14e611(0x3bd))}),_0x81f19b(_0x14e611(0x517),{'className':_0x14e611(0x3ff),'children':[_0x2a3146(_0x180ca8,{'checked':(_0xa1c20b==null?void 0x0:_0xa1c20b[_0x14e611(0x103)][_0x14e611(0x3d9)])===!0x0,'disabled':_0xfe70d5,'onChange':_0x29cb8e=>_0xb8521e(!!_0x29cb8e)}),_0x2a3146('span',{'children':_0x102572['t'](_0x14e611(0x190))})]})]});}const fs=[{'label':_0x1aaa99(0x440),'value':_0x1aaa99(0x2ec)},{'label':'sheets-pivot-ui.config.pageOverThenDown','value':_0x1aaa99(0x53a)}],ps=[{'label':'sheets-pivot-ui.config.layoutTabular','value':String(_0x56ebe5['tabular'])},{'label':_0x1aaa99(0x138),'value':String(_0x56ebe5[_0x1aaa99(0x3e9)])},{'label':_0x1aaa99(0x4f7),'value':String(_0x56ebe5[_0x1aaa99(0xe0)])}],ms=[{'label':'sheets-pivot-ui.config.rowSubtotalTop','value':String(_0x199ba4['top'])},{'label':_0x1aaa99(0x406),'value':String(_0x199ba4[_0x1aaa99(0x43c)])}],hs=[{'label':'sheets-pivot-ui.config.dateGroupingLegacy','value':_0x161a50[_0x1aaa99(0x405)]},{'label':_0x1aaa99(0x2d6),'value':_0x161a50[_0x1aaa99(0x284)]}];function gs(_0x579e35){const _0x54761a=_0x1aaa99;let {unitId:_0x58e311,subUnitId:_0x586c45,pivotTableId:_0x5570e4}=_0x579e35,_0x268c45=_0x2140ff(_0x12babc),_0x5d5455=_0x2140ff(_0x7c076c),_0x5d47c5=_0x2140ff(_0x3e0dae),_0x21b26e=_0x2140ff(_0x2129e8),_0x5c1ef2=_0x2140ff(_0x344ed3),_0x40451b=_0x38d376(()=>_0x5c1ef2[_0x54761a(0x49e)](_0x58e311,_0x586c45,_0x5570e4)[_0x54761a(0x49b)](_0xef7484(0x0)),[_0x5c1ef2,_0x58e311,_0x586c45,_0x5570e4]);_0x362266(_0x40451b);let [_0x2d48e4,_0xa79329]=_0x18aa7d(!0x1),_0x177c55=_0x25e96e(!0x1),_0x1efc5e=_0x5c1ef2[_0x54761a(0x2fa)](_0x58e311,_0x586c45,_0x5570e4),_0x2162e5=_0x470709(_0x1efc5e==null?void 0x0:_0x1efc5e[_0x54761a(0x4e3)][_0x54761a(0x103)]),[_0x4b758f,_0x43022a]=_0x18aa7d(()=>{const _0x6ea587=_0x54761a;var _0x4f780d,_0x298dc6;let _0x4ac059=_0x5c1ef2['getPivotTableConfig'](_0x58e311,_0x586c45,_0x5570e4),_0x2014c7=(_0x4ac059==null||(_0x4f780d=_0x4ac059[_0x6ea587(0x4e3)])==null?void 0x0:_0x4f780d['options'])??{};return{'showRowSubtotal':_0x2014c7[_0x6ea587(0x214)]??!0x0,'showRowGrandTotal':_0x2014c7[_0x6ea587(0x482)]??!0x0,'showColSubtotal':_0x2014c7[_0x6ea587(0x369)]??!0x0,'showColGrandTotal':_0x2014c7[_0x6ea587(0x1c0)]??!0x0,'pageWrap':_0x2014c7[_0x6ea587(0x4eb)]??0x1,'pageOverThenDown':_0x2014c7['pageOverThenDown']??!0x1,'repeatRowLabels':_0x2014c7['repeatRowLabels']??!0x1,'repeatColLabels':_0x2014c7[_0x6ea587(0x339)]??!0x1,'layout':(_0x4ac059==null||(_0x298dc6=_0x4ac059[_0x6ea587(0x4e3)])==null?void 0x0:_0x298dc6[_0x6ea587(0x443)])??_0x56ebe5[_0x6ea587(0x15a)],'rowSubtotalPosition':_0x2014c7[_0x6ea587(0x436)]??_0x199ba4[_0x6ea587(0x3f5)]};}),_0x3fa782=_0x51f497=>{const _0x32c76c=_0x54761a;let _0x2f5d5a={'unitId':_0x58e311,'subUnitId':_0x586c45,'pivotTableId':_0x5570e4,'options':_0x51f497};_0x268c45['executeCommand'](_0x4c22c7['id'],_0x2f5d5a)[_0x32c76c(0x17b)](_0x147a29=>_0x5d47c5[_0x32c76c(0x344)](_0x32c76c(0x245),_0x147a29)),_0x43022a(_0x588019=>({..._0x588019,..._0x51f497}));},_0x22f39d=_0x4ec847=>{const _0x3b6264=_0x54761a;let _0x2e664c={'unitId':_0x58e311,'subUnitId':_0x586c45,'pivotTableId':_0x5570e4,'layout':_0x4ec847};_0x268c45[_0x3b6264(0x4e2)](_0x4a0aca['id'],_0x2e664c)[_0x3b6264(0x17b)](_0x475ff1=>_0x5d47c5[_0x3b6264(0x344)](_0x3b6264(0x245),_0x475ff1)),_0x43022a(_0xe6e7b7=>({..._0xe6e7b7,'layout':_0x4ec847}));},_0x26092a=async _0x21dac9=>{const _0x110706=_0x54761a;if(!(_0x177c55[_0x110706(0x312)]||_0x21dac9===_0x2162e5)){_0x177c55[_0x110706(0x312)]=!0x0,_0xa79329(!0x0);try{let _0x17f688=_0x5c1ef2[_0x110706(0x2fa)](_0x58e311,_0x586c45,_0x5570e4),_0x39bb93=_0x5c1ef2['getCollection'](_0x58e311,_0x5570e4);if(!_0x17f688||!_0x39bb93||(Object['values'](_0x39bb93['fields'])[_0x110706(0x156)](_0x16d347)||_0x39bb93['customFields'][_0x110706(0x156)](_0x16d347))&&!await _0x5d5455[_0x110706(0x1a6)]({'id':_0x110706(0x1a0),'title':{'title':_0x21b26e['t'](_0x110706(0x52f))},'children':{'title':_0x21b26e['t'](_0x110706(0x565))},'cancelText':_0x21b26e['t'](_0x110706(0x3eb)),'confirmText':_0x21b26e['t'](_0x110706(0x299))})||_0x5c1ef2[_0x110706(0x2fa)](_0x58e311,_0x586c45,_0x5570e4)!==_0x17f688||_0x5c1ef2[_0x110706(0x1f1)](_0x58e311,_0x5570e4)!==_0x39bb93||_0x470709(_0x17f688[_0x110706(0x4e3)][_0x110706(0x103)])===_0x21dac9)return;await _0x268c45[_0x110706(0x4e2)](_0x4c22c7['id'],{'unitId':_0x58e311,'subUnitId':_0x586c45,'pivotTableId':_0x5570e4,'options':{'dateGroupingMode':_0x21dac9}});}catch(_0x380edd){_0x5d47c5[_0x110706(0x344)](_0x110706(0x245),_0x380edd);}finally{_0x177c55['current']=!0x1,_0xa79329(!0x1);}}};return _0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x375),'children':[_0x2a3146(ds,{'scope':{'unitId':_0x58e311,'subUnitId':_0x586c45,'pivotTableId':_0x5570e4},'report':_0x1efc5e==null?void 0x0:_0x1efc5e[_0x54761a(0x4e3)],'getCurrentReport':()=>{const _0x399dd9=_0x54761a;var _0x36acd9;return(_0x36acd9=_0x5c1ef2[_0x399dd9(0x2fa)](_0x58e311,_0x586c45,_0x5570e4))==null?void 0x0:_0x36acd9[_0x399dd9(0x4e3)];},'onChange':_0x5c96d3=>_0x268c45[_0x54761a(0x4e2)](_0x4c22c7['id'],{'unitId':_0x58e311,'subUnitId':_0x586c45,'pivotTableId':_0x5570e4,'options':{'allowMultipleFilters':_0x5c96d3}})}),_0x81f19b('section',{'children':[_0x2a3146(_0x54761a(0x3cc),{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium\x20univer-text-gray-600','children':_0x21b26e['t'](_0x54761a(0x4fc))}),_0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x120),'children':[_0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x541),'children':[_0x2a3146(_0x54761a(0x4fb),{'className':'univer-text-sm\x20univer-text-gray-600','children':_0x21b26e['t'](_0x54761a(0x244))}),_0x2a3146(_0x44fcce,{'className':'univer-w-36','value':_0x2162e5,'options':hs[_0x54761a(0x15d)](_0x24ee53=>({..._0x24ee53,'label':_0x21b26e['t'](_0x24ee53['label'])})),'disabled':_0x2d48e4,'onChange':_0x5c304e=>_0x26092a(_0x5c304e)})]}),_0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x541),'children':[_0x2a3146(_0x54761a(0x4fb),{'className':_0x54761a(0x3cd),'children':_0x21b26e['t'](_0x54761a(0x25b))}),_0x2a3146(_0x44fcce,{'className':'univer-w-36','value':String(_0x4b758f['layout']),'options':ps[_0x54761a(0x15d)](_0x23d60a=>({..._0x23d60a,'label':_0x21b26e['t'](_0x23d60a[_0x54761a(0x517)])})),'onChange':_0x563919=>_0x22f39d(Number(_0x563919))})]}),_0x81f19b(_0x54761a(0x517),{'className':_0x54761a(0x234),'children':[_0x2a3146(_0x180ca8,{'checked':_0x4b758f['repeatRowLabels'],'disabled':_0x4b758f[_0x54761a(0x443)]===_0x56ebe5[_0x54761a(0x3e9)],'onChange':_0x5cc28e=>_0x3fa782({'repeatRowLabels':!!_0x5cc28e})}),_0x21b26e['t']('sheets-pivot-ui.config.repeatRowLabels')]}),_0x81f19b('label',{'className':_0x54761a(0x234),'children':[_0x2a3146(_0x180ca8,{'checked':_0x4b758f[_0x54761a(0x339)],'onChange':_0x1c602a=>_0x3fa782({'repeatColLabels':!!_0x1c602a})}),_0x21b26e['t'](_0x54761a(0x192))]})]})]}),_0x81f19b(_0x54761a(0x4c9),{'children':[_0x2a3146('div',{'className':_0x1d52fd('univer-mb-2\x20univer-text-sm\x20univer-font-medium\x20univer-text-gray-600'),'children':_0x21b26e['t'](_0x54761a(0x48a))}),_0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x120),'children':[_0x81f19b(_0x54761a(0x517),{'className':'univer-flex\x20univer-cursor-pointer\x20univer-items-center\x20univer-gap-2\x20univer-text-sm\x20univer-text-gray-600','children':[_0x2a3146(_0x180ca8,{'checked':_0x4b758f['showRowSubtotal'],'onChange':_0x3afe45=>_0x3fa782({'showRowSubtotal':!!_0x3afe45})}),_0x21b26e['t'](_0x54761a(0x25e))]}),_0x4b758f[_0x54761a(0x443)]===_0x56ebe5[_0x54761a(0xe0)]&&_0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x541),'children':[_0x2a3146(_0x54761a(0x4fb),{'className':_0x54761a(0x3cd),'children':_0x21b26e['t']('sheets-pivot-ui.config.rowSubtotalPosition')}),_0x2a3146(_0x44fcce,{'className':_0x54761a(0x314),'value':String(_0x4b758f['rowSubtotalPosition']),'options':ms['map'](_0xcbc35c=>({..._0xcbc35c,'label':_0x21b26e['t'](_0xcbc35c[_0x54761a(0x517)])})),'onChange':_0x2ec305=>_0x3fa782({'rowSubtotalPosition':Number(_0x2ec305)})})]}),_0x81f19b('label',{'className':_0x54761a(0x234),'children':[_0x2a3146(_0x180ca8,{'checked':_0x4b758f[_0x54761a(0x482)],'onChange':_0x7c712e=>_0x3fa782({'showRowGrandTotal':!!_0x7c712e})}),_0x21b26e['t'](_0x54761a(0x1af))]}),_0x81f19b('label',{'className':_0x54761a(0x234),'children':[_0x2a3146(_0x180ca8,{'checked':_0x4b758f[_0x54761a(0x369)],'onChange':_0xb98525=>_0x3fa782({'showColSubtotal':!!_0xb98525})}),_0x21b26e['t'](_0x54761a(0x1c6))]}),_0x81f19b(_0x54761a(0x517),{'className':'univer-flex\x20univer-cursor-pointer\x20univer-items-center\x20univer-gap-2\x20univer-text-sm\x20univer-text-gray-600','children':[_0x2a3146(_0x180ca8,{'checked':_0x4b758f[_0x54761a(0x1c0)],'onChange':_0x67de6a=>_0x3fa782({'showColGrandTotal':!!_0x67de6a})}),_0x21b26e['t'](_0x54761a(0x1d5))]})]})]}),_0x81f19b(_0x54761a(0x4c9),{'children':[_0x2a3146(_0x54761a(0x3cc),{'className':_0x54761a(0x202),'children':_0x21b26e['t']('sheets-pivot-ui.config.pageSection')}),_0x81f19b(_0x54761a(0x3cc),{'className':_0x54761a(0x4f3),'children':[_0x81f19b('div',{'className':_0x54761a(0x541),'children':[_0x2a3146('span',{'className':_0x54761a(0x3cd),'children':_0x21b26e['t'](_0x54761a(0x4c6))}),_0x2a3146(_0x536e2c,{'className':_0x54761a(0x55b),'value':_0x4b758f['pageWrap'],'min':0x1,'max':0x14,'onChange':_0x400f4e=>{const _0x2d4384=_0x54761a;let _0xd223f2=Number(_0x400f4e);Number[_0x2d4384(0x3f4)](_0xd223f2)&&_0xd223f2>=0x1&&_0x3fa782({'pageWrap':_0xd223f2});}})]}),_0x2a3146('p',{'className':_0x54761a(0xdc),'children':_0x21b26e['t'](_0x4b758f[_0x54761a(0x229)]?_0x54761a(0x55c):_0x54761a(0xe3))}),_0x81f19b('div',{'className':_0x54761a(0x541),'children':[_0x2a3146(_0x54761a(0x4fb),{'className':_0x54761a(0x3cd),'children':_0x21b26e['t'](_0x54761a(0x458))}),_0x2a3146(_0x44fcce,{'className':_0x54761a(0x314),'value':String(_0x4b758f[_0x54761a(0x229)]),'options':fs[_0x54761a(0x15d)](_0x4dc967=>({..._0x4dc967,'label':_0x21b26e['t'](_0x4dc967[_0x54761a(0x517)])})),'onChange':_0x26aafc=>_0x3fa782({'pageOverThenDown':_0x26aafc===_0x54761a(0x53a)})})]})]})]})]});}let _s=class extends _0x239c25{constructor(_0x341906,_0x53b7ec,_0x7ea0ac,_0x5977d3,_0x3bee0f,_0x4383ca,_0x52c0db,_0x1b1de6){const _0x1a1019=_0x1aaa99;super(),this['_sheetsSelectionsService']=_0x341906,this[_0x1a1019(0x112)]=_0x53b7ec,this['_sheetsPivotTableAdaptorModel']=_0x7ea0ac,this[_0x1a1019(0x20a)]=_0x5977d3,this[_0x1a1019(0x437)]=_0x3bee0f,this[_0x1a1019(0x1e9)]=_0x4383ca,this[_0x1a1019(0xf3)]=_0x52c0db,this[_0x1a1019(0x4d3)]=_0x1b1de6,X(this,_0x1a1019(0x4d8),void 0x0),X(this,'_pivotTablePanelVisible$',new _0x55b11a()),X(this,_0x1a1019(0x4e8),this[_0x1a1019(0x4e6)][_0x1a1019(0x470)]()),X(this,_0x1a1019(0x3e5),!0x1),X(this,'_isRangeSelector2Focus',!0x1),this[_0x1a1019(0x273)](),this[_0x1a1019(0x379)]();}[_0x1aaa99(0x50d)](_0x507f1b){const _0x14bfec=_0x1aaa99;this[_0x14bfec(0x3e5)]=_0x507f1b;}[_0x1aaa99(0x148)](_0x6109f9){const _0x48545e=_0x1aaa99;this[_0x48545e(0xcf)]=_0x6109f9;}[_0x1aaa99(0x2ba)](_0x502260){const _0x36edc1=_0x1aaa99;this[_0x36edc1(0x4d8)]=_0x502260;}['_closePivotPanel'](){const _0x3e762c=_0x1aaa99;this[_0x3e762c(0x3e5)]||this[_0x3e762c(0xcf)]||(this['_setPivotTableId'](void 0x0),this[_0x3e762c(0x437)][_0x3e762c(0x2a3)](Er));}[_0x1aaa99(0x273)](){const _0x1e1efc=_0x1aaa99;let _0xcf921a=this[_0x1e1efc(0x112)][_0x1e1efc(0x2ab)](_0x36df91[_0x1e1efc(0x416)]);if(_0xcf921a){let _0x273561=_0xcf921a[_0x1e1efc(0x452)];this[_0x1e1efc(0x320)](_0x2a5b68(_0x273561,this[_0x1e1efc(0x433)]['selectionMoveEnd$'])[_0x1e1efc(0x358)](()=>{const _0x5eb1ac=_0x1e1efc;let _0x44b574=this[_0x5eb1ac(0x433)]['getCurrentSelections']();if(!_0x44b574)return;let _0x3443d6=_0x44b574[_0x44b574[_0x5eb1ac(0x483)]-0x1];if(!_0x3443d6)return;let _0x3b528a=_0x3443d6[_0x5eb1ac(0xc5)];if(!_0x3b528a)return;let _0x1c6767=this[_0x5eb1ac(0x112)][_0x5eb1ac(0x2ab)](_0x36df91[_0x5eb1ac(0x416)]),_0x33ebb8=_0x1c6767==null?void 0x0:_0x1c6767[_0x5eb1ac(0x189)]();if(!_0x1c6767||!_0x33ebb8)return;let _0x30e59a=_0x1c6767[_0x5eb1ac(0x10b)](),_0x547518=_0x33ebb8[_0x5eb1ac(0x258)](),_0x60b7c4=this['_sheetsPivotTableAdaptorModel']['getPivotTableIdByCell'](_0x30e59a,_0x547518,_0x3b528a['startRow'],_0x3b528a[_0x5eb1ac(0x401)]);if(_0x60b7c4){var _0x5b8948,_0x133691;let _0x1ed417=(_0x5b8948=this[_0x5eb1ac(0x418)][_0x5eb1ac(0x322)](_0x30e59a,_0x547518,_0x60b7c4))==null?void 0x0:_0x5b8948['rangesInfo'],_0x253e2a=_0x5e0a33(_0x1ed417),_0x363fe4=_0x3ff5ee(this[_0x5eb1ac(0xf3)],_0x30e59a,_0x547518,_0x253e2a),_0x215516=(_0x133691=this[_0x5eb1ac(0x4d3)]['getPermissionPoint'](new _0x20e8fc(_0x30e59a,_0x547518)['id']))==null?void 0x0:_0x133691[_0x5eb1ac(0xd6)];if(!_0x363fe4||!_0x215516)return;this['_setPivotTableId'](_0x60b7c4),this[_0x5eb1ac(0x4e6)][_0x5eb1ac(0xf7)](!0x0),this['_commandService'][_0x5eb1ac(0x4e2)](na['id'],{'pivotTableId':_0x60b7c4});}else this[_0x5eb1ac(0x2ff)]();})),this[_0x1e1efc(0x320)](this[_0x1e1efc(0x20a)][_0x1e1efc(0x36b)](_0x5dbc7b=>{const _0x252d2f=_0x1e1efc;_0x5dbc7b['id']===_0x768732['id']&&_0x5dbc7b[_0x252d2f(0x119)][_0x252d2f(0x53d)]===this[_0x252d2f(0x4d8)]&&this[_0x252d2f(0x437)]['close'](Er);}));}}['_initSheetChange'](){const _0x21e0c7=_0x1aaa99;let _0xb3871f=this[_0x21e0c7(0x112)]['getCurrentUnitOfType'](_0x36df91[_0x21e0c7(0x416)]);_0xb3871f&&this[_0x21e0c7(0x320)](_0xb3871f[_0x21e0c7(0x39f)][_0x21e0c7(0x358)](()=>{const _0x41ef19=_0x21e0c7;this[_0x41ef19(0x437)]['close']();})),this[_0x21e0c7(0x320)](this[_0x21e0c7(0x437)][_0x21e0c7(0x54e)][_0x21e0c7(0x358)](_0x57ff9a=>{const _0x31eeb0=_0x21e0c7;if(_0x57ff9a['id']===_0x31eeb0(0x367)){let _0x1f1d5d=!!_0x57ff9a[_0x31eeb0(0x154)];this[_0x31eeb0(0x4e6)][_0x31eeb0(0xf7)](_0x1f1d5d),_0x1f1d5d||this['_dialogService'][_0x31eeb0(0x2a3)](Ar);}})),this[_0x21e0c7(0x320)](this[_0x21e0c7(0x1e9)][_0x21e0c7(0xfd)]()['subscribe'](_0x3f721b=>{const _0x51d3fa=_0x21e0c7;let _0x9f7026=_0x3f721b[_0x51d3fa(0x55a)](_0x5010f4=>_0x5010f4['id']===Rr);_0x9f7026&&_0x9f7026['open']===!0x1&&this['_dialogService'][_0x51d3fa(0x2a3)](Rr);}));}};_s=Q([Z(0x0,_0x446f3f(_0x2f649b)),Z(0x1,_0x446f3f(_0x570eee)),Z(0x2,_0x446f3f(_0x131a27)),Z(0x3,_0x446f3f(_0x12babc)),Z(0x4,_0x446f3f(_0x47511f)),Z(0x5,_0x446f3f(_0x4f85fa)),Z(0x6,_0x446f3f(_0x21b420)),Z(0x7,_0x446f3f(_0x5f571f))],_s);const vs=_0x4e4db7(null),ys=_0x4e4db7(null);function bs(_0xfffb7b,_0x3fa596){const _0x372b16=_0x1aaa99;return _0xfffb7b===_0x3fa596?!0x0:!_0xfffb7b||!_0x3fa596?!0x1:_0xfffb7b[_0x372b16(0x356)]===_0x3fa596[_0x372b16(0x356)]&&_0xfffb7b[_0x372b16(0x415)]===_0x3fa596[_0x372b16(0x415)];}function xs(_0x1ccfea){const _0x2d1510=_0x1aaa99;if(!(_0x1ccfea instanceof Element))return null;let _0x38935f=_0x1ccfea[_0x2d1510(0x521)](_0x2d1510(0x4d7));return _0x38935f instanceof HTMLElement?_0x38935f:null;}function Ss(_0x3261ca,_0x37050e,_0x83f0b1,_0x1ac8ff){const _0x5d9c28=_0x1aaa99;let _0x17c44d=Array[_0x5d9c28(0x32c)](_0x3261ca[_0x5d9c28(0x108)](_0x5d9c28(0x41e)))[_0x5d9c28(0x474)](_0x5340a1=>{const _0x43fb3f=_0x5d9c28;let _0x15818d=_0x5340a1[_0x43fb3f(0x2b7)]['univerDndId'];return _0x15818d?_0x15818d!==_0x83f0b1['draggableId']||_0x83f0b1[_0x43fb3f(0x113)][_0x43fb3f(0x356)]!==_0x1ac8ff:!0x1;});if(!_0x17c44d[_0x5d9c28(0x483)])return 0x0;for(let _0x57fb92=0x0;_0x57fb92<_0x17c44d[_0x5d9c28(0x483)]-0x1;_0x57fb92++){let _0x8e59d6=_0x17c44d[_0x57fb92]['getBoundingClientRect']();if(_0x37050e<_0x8e59d6[_0x5d9c28(0x3f5)]+_0x8e59d6[_0x5d9c28(0x3ac)]/0x2)return _0x57fb92;}let _0x458f66=_0x17c44d['length']-0x1,_0x32a2da=_0x17c44d[_0x458f66]['getBoundingClientRect']();return _0x37050e<_0x32a2da[_0x5d9c28(0x3f5)]+_0x32a2da[_0x5d9c28(0x3ac)]*0.35?_0x458f66:_0x17c44d[_0x5d9c28(0x483)];}function Cs(){const _0x25cda0=_0x1aaa99;let _0x37a90e=_0x17a98d(vs);if(!_0x37a90e)throw Error(_0x25cda0(0x343));return _0x37a90e;}function ws(_0xcf1a2d){const _0x2d710b=_0x1aaa99;let {children:_0x586eab,onDragEnd:_0x12a7ad,onDragStart:_0x510f08,onDragUpdate:_0x413508}=_0xcf1a2d,[_0x1a07d4,_0x52c60d]=_0x18aa7d(null),_0x352026=_0x25e96e(null),_0x1c6408=_0x7784bf((_0x2e2707,_0x2ae8c8)=>{const _0x14b745=_0x14e6;let _0x31e080={'draggableId':_0x2e2707,'source':_0x2ae8c8,'destination':null};_0x352026[_0x14b745(0x312)]=_0x31e080,_0x52c60d(_0x31e080),_0x510f08==null||_0x510f08({'draggableId':_0x2e2707,'source':_0x2ae8c8}),_0x413508==null||_0x413508({'draggableId':_0x2e2707,'source':_0x2ae8c8,'destination':null});},[_0x510f08,_0x413508]),_0x4fcc0a=_0x7784bf(_0x4e0ac0=>{const _0x27a644=_0x14e6;let _0x44f2fc=_0x352026[_0x27a644(0x312)];if(!_0x44f2fc||bs(_0x44f2fc[_0x27a644(0x3f7)],_0x4e0ac0))return;let _0x2fafd6={..._0x44f2fc,'destination':_0x4e0ac0};_0x352026['current']=_0x2fafd6,_0x52c60d(_0x2fafd6),_0x413508==null||_0x413508({'draggableId':_0x2fafd6['draggableId'],'source':_0x2fafd6[_0x27a644(0x113)],'destination':_0x2fafd6[_0x27a644(0x3f7)]});},[_0x413508]),_0x433b7f=_0x7784bf(async(_0x5adfb3,_0x1ffa32)=>{const _0x34d078=_0x14e6;let _0x4eec73=_0x352026['current'];_0x4eec73&&(_0x352026[_0x34d078(0x312)]=null,_0x52c60d(null),await(_0x12a7ad==null?void 0x0:_0x12a7ad({'draggableId':_0x4eec73['draggableId'],'source':_0x4eec73['source'],'destination':_0x1ffa32===void 0x0?_0x4eec73['destination']:_0x1ffa32,'reason':_0x5adfb3})));},[_0x12a7ad]);_0x2c2735(()=>{const _0x5948a2=_0x14e6;if(!_0x1a07d4)return;let _0xf2b9b6=_0x5d8ce3=>{const _0x37bd1e=_0x14e6;let _0x1d5393=xs(_0x5d8ce3[_0x37bd1e(0x386)]);_0x1d5393&&_0x1d5393[_0x37bd1e(0x2b7)]['univerDndDropDisabled']!==_0x37bd1e(0x53a)||_0x4fcc0a(null);};return window[_0x5948a2(0x4da)](_0x5948a2(0x2ce),_0xf2b9b6,!0x0),()=>{const _0x87f820=_0x5948a2;window[_0x87f820(0x32b)](_0x87f820(0x2ce),_0xf2b9b6,!0x0);};},[_0x1a07d4,_0x4fcc0a]);let _0x5ba6e0=_0x38d376(()=>({'activeDrag':_0x1a07d4,'startDrag':_0x1c6408,'updateDestination':_0x4fcc0a,'endDrag':_0x433b7f}),[_0x1a07d4,_0x1c6408,_0x4fcc0a,_0x433b7f]);return _0x2a3146(vs[_0x2d710b(0x225)],{'value':_0x5ba6e0,'children':_0x586eab});}function Ts(_0x13c5dd){const _0x3e8891=_0x1aaa99;var _0x38247a;let {children:_0x421f8d,droppableId:_0x2cf3cb,isDropDisabled:_0x4f27b7=!0x1}=_0x13c5dd,{activeDrag:_0x17706b,updateDestination:_0x14b949,endDrag:_0x5cfb73}=Cs(),_0x421396=_0x25e96e(null),_0x185ae6={'innerRef':_0x7784bf(_0x5bb1b0=>{const _0x52678a=_0x14e6;_0x421396[_0x52678a(0x312)]=_0x5bb1b0;},[]),'droppableProps':{'onDragOver':_0x7784bf(_0x5a29b3=>{const _0x558a3c=_0x14e6;if(!_0x17706b||_0x4f27b7||!_0x421396[_0x558a3c(0x312)])return;_0x5a29b3[_0x558a3c(0x259)]();let _0x38374d=Ss(_0x421396[_0x558a3c(0x312)],_0x5a29b3[_0x558a3c(0xe5)],_0x17706b,_0x2cf3cb);_0x14b949({'droppableId':_0x2cf3cb,'index':_0x38374d});},[_0x17706b,_0x4f27b7,_0x2cf3cb,_0x14b949]),'onDrop':_0x7784bf(_0x4fb6aa=>{const _0x29d8cb=_0x14e6;var _0x57782d;if(!_0x17706b||_0x4f27b7||!_0x421396['current'])return;_0x4fb6aa[_0x29d8cb(0x259)]();let _0x281072=(((_0x57782d=_0x17706b['destination'])==null?void 0x0:_0x57782d[_0x29d8cb(0x356)])===_0x2cf3cb?_0x17706b['destination']:null)??{'droppableId':_0x2cf3cb,'index':Ss(_0x421396[_0x29d8cb(0x312)],_0x4fb6aa[_0x29d8cb(0xe5)],_0x17706b,_0x2cf3cb)};return _0x5cfb73(_0x29d8cb(0x412),_0x281072);},[_0x17706b,_0x5cfb73,_0x4f27b7,_0x2cf3cb]),'data-univer-dnd-droppable-id':_0x2cf3cb,'data-univer-dnd-drop-disabled':String(_0x4f27b7)},'placeholder':null},_0x4da752={'isDraggingOver':!!(_0x17706b&&((_0x38247a=_0x17706b[_0x3e8891(0x3f7)])==null?void 0x0:_0x38247a['droppableId'])===_0x2cf3cb)};return _0x2a3146(ys[_0x3e8891(0x225)],{'value':_0x2cf3cb,'children':_0x421f8d(_0x185ae6,_0x4da752)});}function Es(_0x325288){const _0x46f1b1=_0x1aaa99;var _0x5ebfb0;let {children:_0x23382a,draggableId:_0x429fb9,index:_0x57c31e,isDragDisabled:_0x4a6bc5=!0x1}=_0x325288,{activeDrag:_0x349ae5,startDrag:_0x3f732e,updateDestination:_0x535905,endDrag:_0x390220}=Cs(),_0x1e7f3b=_0x17a98d(ys),_0x343a2e=_0x25e96e(null),_0x4a506f=_0x25e96e(null),_0x5b1803=_0x25e96e(!0x1),_0x4e63eb=_0x25e96e(null),_0x30da14=_0x25e96e(null),_0x22efaa=_0x25e96e(!0x1),_0x1e046b=_0x25e96e(null),_0x1704d8=_0x25e96e(null),_0x9de56=_0x25e96e(null),_0x17ec8c=_0x7784bf(_0x253670=>{const _0x15a783=_0x14e6;_0x343a2e[_0x15a783(0x312)]=_0x253670;},[]),_0x18277b=(_0x349ae5==null?void 0x0:_0x349ae5[_0x46f1b1(0x19e)])===_0x429fb9,_0x44b012=_0x7784bf(()=>{const _0x310b65=_0x46f1b1;_0x30da14[_0x310b65(0x312)]&&=(window[_0x310b65(0x288)](_0x30da14['current']),null);},[]),_0x128a6f=_0x7784bf(()=>{const _0x398410=_0x46f1b1;_0x44b012(),_0x9de56[_0x398410(0x312)]=null,_0x4e63eb[_0x398410(0x312)]&&=(_0x4e63eb['current'](),null),_0x1e046b[_0x398410(0x312)]&&=(_0x1e046b['current'][_0x398410(0x2c0)](),null),_0x1704d8[_0x398410(0x312)]=null,_0x5b1803[_0x398410(0x312)]=!0x1;},[_0x44b012]);_0x2c2735(()=>_0x128a6f,[_0x128a6f]);let _0x11ab84=_0x7784bf((_0x172569,_0x4d3c52)=>{const _0x3af1b2=_0x46f1b1;if(_0x1e046b['current'])return;let _0x5a9095=_0x343a2e[_0x3af1b2(0x312)];if(!_0x5a9095)return;let _0x4f6c4b=_0x5a9095['getBoundingClientRect'](),_0x211acf=_0x172569>0x0?Math[_0x3af1b2(0x30b)](0x0,_0x172569-_0x4f6c4b[_0x3af1b2(0x188)]):0xc,_0x3a8a15=_0x4d3c52>0x0?Math[_0x3af1b2(0x30b)](0x0,_0x4d3c52-_0x4f6c4b['top']):0xc,_0x16425e=_0x5a9095[_0x3af1b2(0x1d7)](!0x0);if(!(_0x16425e instanceof HTMLDivElement))return;let _0x32bf37=_0x16425e;_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x53b)]=_0x3af1b2(0x140),_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x188)]=_0x3af1b2(0x44f),_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x3f5)]=_0x3af1b2(0x44f),_0x32bf37[_0x3af1b2(0x1dd)]['width']=_0x4f6c4b['width']+'px',_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x3ac)]=_0x4f6c4b[_0x3af1b2(0x3ac)]+'px',_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x307)]=_0x3af1b2(0x557),_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x316)]='0.9',_0x32bf37[_0x3af1b2(0x1dd)]['zIndex']=_0x3af1b2(0x551),_0x32bf37['style'][_0x3af1b2(0x1f6)]=_0x3af1b2(0x2cd),_0x32bf37[_0x3af1b2(0x1dd)][_0x3af1b2(0x408)]=_0x3af1b2(0x376)+Math[_0x3af1b2(0x30b)](0x0,_0x172569-_0x211acf)+'px,\x20'+Math[_0x3af1b2(0x30b)](0x0,_0x4d3c52-_0x3a8a15)+_0x3af1b2(0x14b),document[_0x3af1b2(0x42c)][_0x3af1b2(0x121)](_0x32bf37),_0x1e046b[_0x3af1b2(0x312)]=_0x32bf37,_0x1704d8[_0x3af1b2(0x312)]={'x':_0x211acf,'y':_0x3a8a15};},[]),_0x125b73=_0x7784bf((_0x381f13,_0x5de9ad)=>{const _0x78fbcb=_0x46f1b1;let _0x1418f7=_0x1e046b['current'],_0x13025f=_0x1704d8['current'];_0x1418f7&&_0x13025f&&(_0x1418f7[_0x78fbcb(0x1dd)][_0x78fbcb(0x408)]=_0x78fbcb(0x376)+Math[_0x78fbcb(0x30b)](0x0,_0x381f13-_0x13025f['x'])+'px,\x20'+Math['max'](0x0,_0x5de9ad-_0x13025f['y'])+_0x78fbcb(0x14b));},[]),_0x239287=_0x7784bf((_0x534858,_0x17def1)=>{const _0x382aa1=_0x46f1b1;let _0x18fa7b=xs(document['elementFromPoint'](_0x534858,_0x17def1));if(!_0x18fa7b||_0x18fa7b[_0x382aa1(0x2b7)][_0x382aa1(0x4cc)]===_0x382aa1(0x53a))return null;let _0x10ff62=_0x18fa7b[_0x382aa1(0x2b7)]['univerDndDroppableId'];return _0x10ff62?{'droppableId':_0x10ff62,'index':Ss(_0x18fa7b,_0x17def1,{'draggableId':_0x429fb9,'source':{'droppableId':_0x1e7f3b??'','index':_0x57c31e},'destination':null},_0x10ff62)}:null;},[_0x429fb9,_0x1e7f3b,_0x57c31e]),_0x2a8e4c=_0x7784bf((_0x47fdbd,_0x33223a,_0x15deb2,_0x53431d)=>{const _0x22c725=_0x46f1b1;if(_0x5b1803[_0x22c725(0x312)]||_0x22efaa[_0x22c725(0x312)]||_0x4a6bc5||!_0x1e7f3b)return;_0x5b1803['current']=!0x0,_0x44b012(),_0x22efaa[_0x22c725(0x312)]=!0x1;try{var _0x2deb93;(_0x2deb93=_0x343a2e['current'])==null||_0x2deb93[_0x22c725(0xd9)](_0x33223a);}catch{}_0x11ab84(_0x15deb2,_0x53431d),_0x3f732e(_0x429fb9,{'droppableId':_0x1e7f3b,'index':_0x57c31e});let _0x480fd5=_0x239287(_0x15deb2,_0x53431d);_0x535905(_0x480fd5);try{_0x47fdbd[_0x22c725(0x259)]();}catch{}},[_0x44b012,_0x429fb9,_0x1e7f3b,_0x57c31e,_0x4a6bc5,_0x11ab84,_0x239287,_0x3f732e,_0x535905]),_0x266ccb=_0x7784bf(_0x5f0c0d=>{const _0x4b8151=_0x46f1b1;if(_0x4a6bc5||!_0x1e7f3b||_0x5f0c0d[_0x4b8151(0x1fe)]===_0x4b8151(0x1a8)&&_0x5f0c0d[_0x4b8151(0x491)]!==0x0)return;_0x22efaa['current']=!0x1;let _0x256e27=_0x5f0c0d[_0x4b8151(0x118)];_0x9de56[_0x4b8151(0x312)]={'pointerId':_0x256e27,'pointerType':_0x5f0c0d[_0x4b8151(0x1fe)],'startX':_0x5f0c0d[_0x4b8151(0x4cb)],'startY':_0x5f0c0d['clientY']},_0x44b012(),_0x5f0c0d[_0x4b8151(0x1fe)]!==_0x4b8151(0x1a8)&&(_0x30da14[_0x4b8151(0x312)]=window[_0x4b8151(0xd5)](()=>{const _0x3f8ae5=_0x4b8151;let _0x2aebc8=_0x9de56[_0x3f8ae5(0x312)];_0x2aebc8&&_0x2aebc8[_0x3f8ae5(0x118)]===_0x256e27&&_0x2a8e4c(_0x5f0c0d[_0x3f8ae5(0x4c7)],_0x2aebc8[_0x3f8ae5(0x118)],_0x2aebc8[_0x3f8ae5(0x124)],_0x2aebc8['startY']);},0x96));let _0x122496=_0x4ef683=>{const _0x587a76=_0x4b8151;let _0x2eb8ca=_0x9de56['current'];if(!_0x2eb8ca||_0x4ef683[_0x587a76(0x118)]!==_0x2eb8ca['pointerId'])return;if(!_0x5b1803[_0x587a76(0x312)]){if(_0x22efaa[_0x587a76(0x312)]){_0x128a6f();return;}if(_0x2eb8ca[_0x587a76(0x1fe)]===_0x587a76(0x1a8)){let _0x1b4963=_0x4ef683[_0x587a76(0x4cb)]-_0x2eb8ca[_0x587a76(0x124)],_0x8359ae=_0x4ef683[_0x587a76(0xe5)]-_0x2eb8ca[_0x587a76(0x175)];_0x1b4963*_0x1b4963+_0x8359ae*_0x8359ae>=0x10&&_0x2a8e4c(_0x4ef683,_0x2eb8ca[_0x587a76(0x118)],_0x4ef683['clientX'],_0x4ef683[_0x587a76(0xe5)]);}return;}_0x125b73(_0x4ef683[_0x587a76(0x4cb)],_0x4ef683[_0x587a76(0xe5)]);let _0x4f861a=_0x239287(_0x4ef683[_0x587a76(0x4cb)],_0x4ef683[_0x587a76(0xe5)]);_0x535905(_0x4f861a);try{_0x4ef683[_0x587a76(0x259)]();}catch{}},_0x5c2504=_0x303a80=>{const _0xbfeec8=_0x4b8151;let _0x1e624b=_0x9de56[_0xbfeec8(0x312)];if(!_0x1e624b||_0x303a80[_0xbfeec8(0x118)]!==_0x1e624b[_0xbfeec8(0x118)])return;let _0x4b111b=_0x5b1803[_0xbfeec8(0x312)]?_0x239287(_0x303a80[_0xbfeec8(0x4cb)],_0x303a80[_0xbfeec8(0xe5)]):null,_0x5d43c6=_0x5b1803[_0xbfeec8(0x312)]?_0x390220(_0x4b111b?_0xbfeec8(0x412):_0xbfeec8(0x38d),_0x4b111b):Promise[_0xbfeec8(0x45b)]();return _0x128a6f(),_0x5d43c6;};window['addEventListener']('pointermove',_0x122496,{'capture':!0x0,'passive':!0x1}),window[_0x4b8151(0x4da)]('pointerup',_0x5c2504,{'capture':!0x0}),window[_0x4b8151(0x4da)](_0x4b8151(0x16e),_0x5c2504,{'capture':!0x0}),_0x4e63eb[_0x4b8151(0x312)]=()=>{const _0x35fbff=_0x4b8151;window[_0x35fbff(0x32b)](_0x35fbff(0x486),_0x122496,!0x0),window[_0x35fbff(0x32b)](_0x35fbff(0x518),_0x5c2504,!0x0),window[_0x35fbff(0x32b)](_0x35fbff(0x16e),_0x5c2504,!0x0);};},[_0x128a6f,_0x44b012,_0x1e7f3b,_0x390220,_0x4a6bc5,_0x239287,_0x2a8e4c,_0x535905,_0x125b73]),_0x5c5dba=_0x7784bf(_0x3ef604=>{const _0x1fafb2=_0x46f1b1;let _0x758405=_0x3ef604['dataTransfer'];if(!_0x758405||typeof _0x758405[_0x1fafb2(0x3a5)]!=_0x1fafb2(0x501))return;let _0x382957=_0x3ef604[_0x1fafb2(0x4a8)],_0x1a3d63=_0x382957['cloneNode'](!0x0);if(!(_0x1a3d63 instanceof HTMLDivElement))return;let _0x10564d=_0x1a3d63;_0x10564d['style'][_0x1fafb2(0x53b)]='fixed',_0x10564d[_0x1fafb2(0x1dd)][_0x1fafb2(0x188)]=_0x1fafb2(0x2e0),_0x10564d['style'][_0x1fafb2(0x3f5)]='-9999px',_0x10564d[_0x1fafb2(0x1dd)][_0x1fafb2(0x4ff)]=_0x382957['getBoundingClientRect']()[_0x1fafb2(0x4ff)]+'px',_0x10564d[_0x1fafb2(0x1dd)][_0x1fafb2(0x307)]=_0x1fafb2(0x557),_0x10564d['style'][_0x1fafb2(0x316)]=_0x1fafb2(0x4dc),_0x10564d[_0x1fafb2(0x1dd)][_0x1fafb2(0x1d8)]='2147483647',document['body'][_0x1fafb2(0x121)](_0x10564d);let _0x388c23=_0x382957['getBoundingClientRect'](),_0x45191b=_0x3ef604[_0x1fafb2(0x4cb)]>0x0?Math[_0x1fafb2(0x30b)](0x0,_0x3ef604[_0x1fafb2(0x4cb)]-_0x388c23[_0x1fafb2(0x188)]):0xc,_0xaa83b6=_0x3ef604[_0x1fafb2(0xe5)]>0x0?Math[_0x1fafb2(0x30b)](0x0,_0x3ef604[_0x1fafb2(0xe5)]-_0x388c23['top']):0xc;_0x758405['setDragImage'](_0x10564d,_0x45191b,_0xaa83b6),_0x4a506f[_0x1fafb2(0x312)]&&_0x4a506f['current']!==_0x10564d&&_0x4a506f[_0x1fafb2(0x312)][_0x1fafb2(0x2c0)](),_0x4a506f['current']=_0x10564d;},[]),_0x1d33bb=_0x7784bf(_0x49b341=>{const _0x2fd503=_0x46f1b1;if(_0x5b1803[_0x2fd503(0x312)]||_0x4a6bc5||!_0x1e7f3b){_0x49b341[_0x2fd503(0x259)]();return;}_0x22efaa[_0x2fd503(0x312)]=!0x0,_0x44b012(),_0x9de56['current']=null,_0x4e63eb[_0x2fd503(0x312)]&&=(_0x4e63eb['current'](),null);let _0x314d70=_0x49b341[_0x2fd503(0x50e)];if(_0x314d70){try{_0x314d70[_0x2fd503(0x54d)]=_0x2fd503(0x446);}catch{}try{_0x314d70[_0x2fd503(0x2b2)]('text/plain',_0x429fb9);}catch{}}try{_0x5c5dba(_0x49b341);}catch{}_0x3f732e(_0x429fb9,{'droppableId':_0x1e7f3b,'index':_0x57c31e});},[_0x5c5dba,_0x44b012,_0x429fb9,_0x1e7f3b,_0x57c31e,_0x4a6bc5,_0x3f732e]),_0x1b217f=_0x7784bf(()=>(_0x4a506f[_0x46f1b1(0x312)]&&=(_0x4a506f[_0x46f1b1(0x312)]['remove'](),null),_0x390220(_0x46f1b1(0x38d),null)),[_0x390220]);return _0x23382a({'innerRef':_0x17ec8c,'draggableProps':{'draggable':!_0x4a6bc5,'onDragStart':_0x1d33bb,'onDragEnd':_0x1b217f,'style':_0x18277b?{'opacity':0x1}:void 0x0,'data-univer-dnd-item':_0x46f1b1(0x53a),'data-univer-dnd-id':_0x429fb9,'data-univer-dnd-index':String(_0x57c31e)},'dragHandleProps':{'onPointerDown':_0x266ccb}},{'isDragging':_0x18277b,'draggingOver':_0x349ae5==null||(_0x5ebfb0=_0x349ae5[_0x46f1b1(0x3f7)])==null?void 0x0:_0x5ebfb0[_0x46f1b1(0x356)]});}function Ds(_0x2bc19b,_0x254a15){const _0x121f44=_0x1aaa99;switch(_0x2bc19b){case _0x121f44(0x474):return _0x254a15['t']('sheets-pivot-ui.filter');case _0x121f44(0x220):return _0x254a15['t'](_0x121f44(0x417));case _0x121f44(0x187):return _0x254a15['t'](_0x121f44(0x4b7));case _0x121f44(0xd6):return _0x254a15['t'](_0x121f44(0x132));}}function Os(_0x30fdbf){const _0x1e66e4=_0x1aaa99;switch(_0x30fdbf){case'filter':return _0x2a3146(_0x5e491f,{'className':'univer-flex\x20univer-flex-row\x20univer-gap-4'});case'row':return _0x2a3146(_0x2b6f12,{'className':_0x1e66e4(0x184)});case _0x1e66e4(0x187):return _0x2a3146(_0x107601,{'className':_0x1e66e4(0x184)});case _0x1e66e4(0xd6):return _0x2a3146(_0x1b475a,{'className':_0x1e66e4(0x184)});}}function ks(_0x591b07){const _0x1e962a=_0x1aaa99;switch(_0x591b07){case _0x1e962a(0x474):return _0x81f19b(_0x1e962a(0x426),{'xmlns':'http://www.w3.org/2000/svg','width':'32','height':'32','viewBox':'0\x200\x2032\x2032','fill':_0x1e962a(0x557),'children':[_0x2a3146(_0x1e962a(0x2ed),{'d':'M4.99957\x201.875C2.84556\x201.875\x201.67491\x204.3932\x203.06336\x206.04001L11.5946\x2016.1587V26.4187C11.5946\x2027.4582\x2012.2298\x2028.3922\x2013.1966\x2028.7741L16.1601\x2029.9449C17.8221\x2030.6015\x2019.6232\x2029.3766\x2019.6232\x2027.5895V16.1587L28.1544\x206.04C29.5428\x204.3932\x2028.3722\x201.875\x2026.2182\x201.875H4.99957Z','fill':'#ECECEC'}),_0x2a3146('rect',{'x':_0x1e962a(0x206),'y':_0x1e962a(0x29d),'width':_0x1e962a(0x3dc),'height':_0x1e962a(0x33d),'rx':_0x1e962a(0x1a2),'fill':_0x1e962a(0x53c)}),_0x2a3146(_0x1e962a(0x2c1),{'x':_0x1e962a(0x206),'y':'21.9067','width':_0x1e962a(0x3dc),'height':'2.2793','rx':_0x1e962a(0x1a2),'fill':_0x1e962a(0x53c)}),_0x2a3146(_0x1e962a(0x2c1),{'x':_0x1e962a(0x206),'y':_0x1e962a(0x24b),'width':_0x1e962a(0x3dc),'height':_0x1e962a(0x33d),'rx':_0x1e962a(0x1a2),'fill':'#274FEE'})]});case'row':return _0x81f19b(_0x1e962a(0x426),{'xmlns':_0x1e962a(0x51f),'width':'32','height':'32','viewBox':_0x1e962a(0x3c7),'fill':_0x1e962a(0x557),'children':[_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x560),'fill':_0x1e962a(0x3ee)}),_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x28c),'fill':'#D8D8D8'}),_0x2a3146('path',{'d':_0x1e962a(0x14d),'fill':_0x1e962a(0x1e2)}),_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x27b),'fill':_0x1e962a(0x53c)})]});case'column':return _0x81f19b(_0x1e962a(0x426),{'xmlns':_0x1e962a(0x51f),'width':'32','height':'32','viewBox':_0x1e962a(0x3c7),'fill':_0x1e962a(0x557),'children':[_0x2a3146('path',{'d':_0x1e962a(0x560),'fill':_0x1e962a(0x53c)}),_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x28c),'fill':_0x1e962a(0x3ee)}),_0x2a3146('path',{'d':_0x1e962a(0x216),'fill':_0x1e962a(0x3ee)}),_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x4a5),'fill':_0x1e962a(0x1e2)})]});case _0x1e962a(0xd6):return _0x81f19b(_0x1e962a(0x426),{'xmlns':_0x1e962a(0x51f),'width':'32','height':'32','viewBox':'0\x200\x2032\x2032','fill':'none','children':[_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x560),'fill':_0x1e962a(0x3ee)}),_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x28c),'fill':'#D8D8D8'}),_0x2a3146(_0x1e962a(0x2ed),{'d':'M12.2637\x202.6863C12.2637\x202.35493\x2012.5323\x202.0863\x2012.8637\x202.0863H27.9702C29.0748\x202.0863\x2029.9702\x202.98173\x2029.9702\x204.0863V8.73627C29.9702\x209.06764\x2029.7016\x209.33627\x2029.3702\x209.33627H12.8637C12.5323\x209.33627\x2012.2637\x209.06764\x2012.2637\x208.73627L12.2637\x202.6863Z','fill':_0x1e962a(0x3ee)}),_0x2a3146(_0x1e962a(0x2ed),{'d':_0x1e962a(0x4a5),'fill':_0x1e962a(0x53c)})]});}}function As(_0x1f6fdf,_0x28dfe9){const _0x588b8c=_0x1aaa99;switch(_0x1f6fdf){case _0x588b8c(0x474):return _0x28dfe9['t'](_0x588b8c(0x4f5));case _0x588b8c(0x220):return _0x28dfe9['t'](_0x588b8c(0x3cb));case'column':return _0x28dfe9['t'](_0x588b8c(0x390));case _0x588b8c(0xd6):return _0x28dfe9['t']('sheets-pivot-ui.valueDesc');}}function js(_0x6328bb){const _0x4d7df4=_0x1aaa99;let _0x5104fc=_0x2140ff(_0x2129e8),{areaType:_0xe2a0be}=_0x6328bb,_0x52b32b=As(_0xe2a0be,_0x5104fc),_0x31d53f=ks(_0xe2a0be);return _0x81f19b(_0x4d7df4(0x3cc),{'className':_0x4d7df4(0x3a3),'children':[_0x2a3146(_0x4d7df4(0x3cc),{'className':_0x4d7df4(0x41c),'children':_0x31d53f}),_0x2a3146('div',{'className':_0x4d7df4(0x449),'children':_0x52b32b})]});}function Ms(_0x19023e){const _0x251268=_0x1aaa99;let {areaType:_0x15c41c,items:_0x1bb018,positionInfo:_0x498c03,pivotTableId:_0x77ceb,pivotTableInfo:_0x144226}=_0x19023e,_0xf233b=_0x2140ff(_0x2129e8);return _0x81f19b('div',{'className':_0x251268(0x3ba),'children':[_0x81f19b(_0x251268(0x3cc),{'className':_0x251268(0x54a),'children':[Os(_0x15c41c),_0x2a3146(_0x251268(0x4fb),{'className':'univer-inline-block\x20univer-align-top','children':Ds(_0x15c41c,_0xf233b)})]}),_0x2a3146(Ts,{'droppableId':''+_0x15c41c,'isCombineEnabled':!0x1,'isDropDisabled':!0x1,'ignoreContainerClipping':!0x1,'direction':_0x251268(0x296),'children':(_0x2bd633,_0x849fad)=>_0x2a3146(_0x251268(0x3cc),{'className':_0x1d52fd(_0x251268(0x21a),_0x4d03f3,{'univer-border-primary-600':_0x849fad[_0x251268(0xce)]}),'children':_0x2a3146('div',{'className':_0x1d52fd(_0x251268(0x1b9),_0x392444),'children':_0x81f19b(_0x251268(0x3cc),{'ref':_0x2bd633['innerRef'],'className':_0x251268(0x215),..._0x2bd633[_0x251268(0x337)],'children':[_0x1bb018[_0x251268(0x483)]>0x0&&_0x1bb018[_0x251268(0x15d)]((_0x537b8b,_0x327ba8)=>_0x2a3146(_0x251268(0x3cc),{'children':_0x2a3146(Es,{'isDragDisabled':!0x1,'draggableId':_0x537b8b[_0x251268(0x1b1)],'index':_0x327ba8,'children':(_0x3192e5,_0x157e0c)=>_0x2a3146(_0x48361d,{'children':_0x2a3146(_0x251268(0x3cc),{'ref':_0x3192e5[_0x251268(0x2b3)],..._0x3192e5[_0x251268(0x4d4)],..._0x3192e5[_0x251268(0x44c)],'style':_0x3192e5[_0x251268(0x4d4)][_0x251268(0x1dd)],'className':_0x1d52fd('univer-flex\x20univer-items-center\x20univer-gap-1\x20univer-self-stretch\x20univer-border\x20univer-border-transparent\x20univer-p-0.5\x20univer-leading-4\x20hover:univer-bg-gray-100\x20dark:hover:!univer-bg-gray-700',_0x157e0c[_0x251268(0x282)]&&_0x251268(0x529)),'children':_0x2a3146(Ns,{'pivotTableId':_0x77ceb,'positionInfo':_0x498c03,'item':_0x537b8b,'areaType':_0x15c41c,'pivotTableInfo':_0x144226})})})},_0x537b8b[_0x251268(0x1b1)])},_0x537b8b[_0x251268(0x1b1)])),_0x1bb018['length']===0x0&&_0x2a3146(js,{'areaType':_0x15c41c})]})})})})]});}function Ns(_0x545e5f){const _0x4f919a=_0x1aaa99;let {areaType:_0x25780e,item:_0x2cdf2b,positionInfo:_0x949048,pivotTableId:_0x16583a,pivotTableInfo:_0x18281c}=_0x545e5f,{unitId:_0x5a578c,subUnitId:_0x5709a3}=_0x949048,_0xac5cb4=_0x2cdf2b[_0x4f919a(0x1b1)]===pa,_0x333f62=_0x2140ff(_0x12babc),_0xa5377b=_0x2140ff(_0x2129e8),_0x485b0f=()=>{const _0x554184=_0x4f919a;if(_0xac5cb4){let _0x5a6eab=(_0x18281c[_0x554184(0x3c1)]||[])[_0x554184(0x15d)](_0x294aad=>_0x294aad[_0x554184(0x1b1)]);Ca({'pivotTableId':_0x16583a,'unitId':_0x5a578c,'subUnitId':_0x5709a3,'commandService':_0x333f62},_0x5a6eab);}else Ca({'pivotTableId':_0x16583a,'unitId':_0x5a578c,'subUnitId':_0x5709a3,'commandService':_0x333f62},[_0x2cdf2b['tableFieldId']]);},_0x170b83=()=>{const _0x54cd12=_0x4f919a;_0x5a578c&&_0x5709a3&&Ea(_0x333f62,_0x5a578c,_0x5709a3,_0x16583a,_0x2cdf2b[_0x54cd12(0x1b1)]);},_0x36aa70=()=>{const _0x170d27=_0x4f919a;_0x5a578c&&_0x5709a3&&Da(_0x333f62,_0x16583a,_0x2cdf2b[_0x170d27(0x1b1)],_0x5a578c,_0x5709a3,_0x18281c);},_0x3e2b3f=_0x47d461=>{const _0x1c23ad=_0x4f919a;let _0x51fd3c=_0x47d461===_0x1c23ad(0x187)?_0x1adff7[_0x1c23ad(0x4c1)]:_0x1adff7[_0x1c23ad(0x515)],_0x16314e=_0x47d461==='column'?_0x18281c[_0x1c23ad(0x12b)]['length']:_0x18281c[_0x1c23ad(0x39e)]['length'];wa({'pivotTableId':_0x16583a,'unitId':_0x5a578c,'subUnitId':_0x5709a3,'commandService':_0x333f62},_0x51fd3c,_0x16314e);},_0x4ca523=_0x81f19b(_0x4f919a(0x3cc),{'className':_0x4f919a(0x328),'children':[_0x2a3146(_0x4f919a(0x3cc),{'className':_0x4f919a(0x393),'onClick':()=>{_0x485b0f();},'children':_0xa5377b['t'](_0x4f919a(0x2d8))}),_0x25780e!=='value'&&!_0xac5cb4&&_0x2a3146(_0x4f919a(0x3cc),{'className':'univer-flex\x20univer-cursor-pointer\x20univer-items-center\x20univer-self-stretch\x20univer-px-2\x20univer-py-1.5\x20univer-text-sm\x20univer-leading-5\x20univer-text-gray-900\x20dark:!univer-text-gray-0','onClick':()=>{_0x170b83();},'children':_0xa5377b['t'](_0x4f919a(0x513))}),_0xac5cb4&&_0x2a3146('div',{'className':_0x4f919a(0x393),'onClick':()=>{_0x3e2b3f(_0x25780e);},'children':_0x25780e===_0x4f919a(0x187)?_0xa5377b['t'](_0x4f919a(0x3e3)):_0xa5377b['t'](_0x4f919a(0x431))}),_0x25780e===_0x4f919a(0xd6)&&_0x2a3146('div',{'className':_0x4f919a(0x393),'onClick':()=>{_0x36aa70();},'children':_0xa5377b['t'](_0x4f919a(0x228))})]}),_0x255e74=_0xac5cb4?_0xa5377b['t']('sheets-pivot-ui.multipleValue'):_0x2cdf2b[_0x4f919a(0x10a)],_0x395655=_0x2a3146(_0x4f919a(0x4ed),{'dir':'auto','children':_0x255e74});return _0x81f19b(_0x48361d,{'children':[_0x2a3146(_0x540bc3,{}),_0x2a3146(_0x4f919a(0x3cc),{'className':_0x4f919a(0x48e),'children':_0x2a3146(_0x911b8f,{'title':_0x395655,'children':_0x395655})}),_0x2a3146(_0x4f919a(0x3cc),{'className':_0x4f919a(0x50a),'children':_0x2a3146(_0x29bff8,{'align':_0x4f919a(0x419),'overlay':_0x4ca523,'children':_0x2a3146('span',{'children':_0x2a3146(_0x35b17e,{})})})})]});}function Ps(_0x234851){const _0x30b02f=_0x1aaa99;var _0x5ed9a3;let _0x2c0089=_0x2140ff(_0x570eee),_0x1562c6=_0x2140ff(_0x2129e8),_0xe012a9=_0x2140ff(_0x12babc),_0x1dc1ed=_0x2140ff(_s),{sourceRangeInfo:_0x2c2587,refreshHandler:_0x53612b,pivotTableId:_0x3071f8,positionInfo:_0x37cd43}=_0x234851,{unitId:_0x36d371,range:_0x3dc337,subUnitId:_0x482550}=_0x2c2587,_0x4f904c=_0x2c0089[_0x30b02f(0x29e)](_0x36d371),_0x402076=(_0x4f904c==null||(_0x5ed9a3=_0x4f904c[_0x30b02f(0x297)](_0x482550))==null?void 0x0:_0x5ed9a3[_0x30b02f(0x4a7)]())??'',[_0x32ada3,_0x4b74a7]=_0x18aa7d(void 0x0),_0x9ed996=_0x25e96e(_0x32ada3);_0x9ed996[_0x30b02f(0x312)]=_0x32ada3;let [_0x255c43,_0x5cca22]=_0x18aa7d(_0x3dc337),[_0x4d5076,_0x2c7978]=_0x18aa7d(_0x402076),[_0x2da696,_0x1464ca]=_0x18aa7d(!0x1);_0x2c2735(()=>{_0x1dc1ed['setIsRangeSelectorFocus'](_0x2da696);},[_0x2da696,_0x1dc1ed]),_0x2c2735(()=>{_0x5cca22(_0x2c2587['range']),_0x2c7978(_0x402076);},[_0x2c2587,_0x402076]);let _0x17f450=_0x38d376(()=>_0x4916ba(async _0x1f5a1d=>{const _0x103444=_0x30b02f;let _0x1a586c=_0x1f5a1d[_0x103444(0x31b)](',')[_0x103444(0x474)](_0x225d3c=>!!_0x225d3c)[_0x103444(0x15d)](_0x1f4fb6);if(!_0x1a586c[0x0])return;let _0xb7fd46=_0x1a586c[0x0];if(!_0x4f904c||_0x9ed996[_0x103444(0x312)])return;let _0x38d5d1=_0xb7fd46[_0x103444(0x207)]||_0x2c2587[_0x103444(0x207)];_0x5cca22(_0xb7fd46[_0x103444(0x22e)]),_0x2c7978(_0x38d5d1);let _0x191d31={'unitId':_0x36d371,'subUnitId':_0x4f904c[_0x103444(0x357)](_0x38d5d1)[_0x103444(0x258)](),'range':{..._0xb7fd46[_0x103444(0x22e)]},'sheetName':_0x38d5d1};await ba(_0xe012a9,_0x3071f8,_0x191d31,_0x37cd43[_0x103444(0xf8)],_0x37cd43[_0x103444(0x19f)]),_0x53612b();},0x12c,{'leading':!0x1,'maxWait':0x3e8,'trailing':!0x0}),[]);return _0x81f19b(_0x30b02f(0x3cc),{'className':'univer-mb-4','children':[_0x81f19b(_0x30b02f(0x3cc),{'className':_0x30b02f(0x2f6),'children':[_0x2a3146(_0x30b02f(0x4fb),{'className':'univer-text-justify\x20univer-text-gray-900\x20dark:!univer-text-gray-0','children':_0x1562c6['t'](_0x30b02f(0x3db))}),_0x2a3146(_0x30b02f(0x4fb),{'className':'univer-text-xs\x20univer-text-gray-600\x20dark:!univer-text-gray-200','children':_0x1562c6['t'](_0x30b02f(0x211))})]}),_0x81f19b(_0x30b02f(0x3cc),{'className':'univer-relative','children':[_0x2a3146(_0x54e9eb,{'unitId':_0x36d371,'subUnitId':_0x482550,'initialValue':_0x33a7d7(_0x4d5076,_0x255c43),'onChange':(_0x50f10f,_0x49af61)=>{_0x33a7d7(_0x4d5076,_0x255c43)!==_0x49af61&&_0x17f450(_0x49af61);},'keepSheetReference':!0x0,'supportAcrossSheet':!0x0,'onVerify':(_0x1634ea,_0x1bc4b8)=>{const _0x3d80fb=_0x30b02f;let _0x41c97b=_0x1bc4b8[_0x3d80fb(0x31b)](',')[_0x3d80fb(0x474)](_0x582700=>!!_0x582700);if(!_0x41c97b[0x0]){_0x4b74a7(_0x1562c6['t'](_0x3d80fb(0x109)));return;}if(!_0x1634ea){_0x4b74a7(_0x1562c6['t'](_0x3d80fb(0x27a)));return;}let _0x551750=_0x1f4fb6(_0x41c97b[0x0]),_0x28cbad=_0x551750[_0x3d80fb(0x207)]||_0x2c2587[_0x3d80fb(0x207)];if(_0x4f904c)switch(va(_0x4f904c[_0x3d80fb(0x357)](_0x28cbad),_0x551750[_0x3d80fb(0x22e)])){case 0x2:_0x4b74a7(void 0x0);break;case 0x0:_0x4b74a7(_0x1562c6['t'](_0x3d80fb(0x109)));break;case 0x1:_0x4b74a7(_0x1562c6['t']('sheets-pivot-ui.msg.invalidSize'));}},'maxRangeCount':0x1,'onFocusChange':_0x52f8e2=>{_0x1464ca(_0x52f8e2);},'onRangeSelectorDialogVisibleChange':_0x536a33=>{_0x1464ca(!!_0x536a33);}}),_0x32ada3?_0x2a3146(_0x30b02f(0x3cc),{'className':'univer-my-1\x20univer-text-xs\x20univer-text-red-500','children':_0x32ada3}):null]})]});}function Fs(_0x566d31){const _0xb80405=_0x1aaa99;let {type:_0x6b6965}=_0x566d31;switch(_0x6b6965){case _0xe427cd[_0xb80405(0x4af)]:return _0x2a3146(_0x571eae,{'className':_0xb80405(0x383)});case _0xe427cd[_0xb80405(0x4b4)]:return _0x2a3146(_0x3577c6,{'className':_0xb80405(0x383)});case _0xe427cd['date']:return _0x2a3146(_0x343400,{'className':'univer-mx-1.5\x20univer-my-0\x20univer-h-4\x20univer-text-xs\x20univer-text-gray-200\x20dark:!univer-text-gray-600'});}}function Is(_0x41a158){const _0x4b61fe=_0x1aaa99;if(!_0x41a158)return!0x1;if(_0x41a158[_0x4b61fe(0x155)]===_0x567986[_0x4b61fe(0x559)]){var _0x39336f;return _0x41a158[_0x4b61fe(0x2b5)]!==void 0x0||(((_0x39336f=_0x41a158['selection'])==null?void 0x0:_0x39336f['mode'])??_0x2394c4[_0x4b61fe(0x374)])!==_0x2394c4[_0x4b61fe(0x374)];}return _0x41a158[_0x4b61fe(0x155)]!==_0x567986['ManualFilter']||_0x41a158[_0x4b61fe(0x13b)]!==!0x0;}function Ls(_0x30f666){const _0x3d4e74=_0x1aaa99;let {name:_0x1382f6,dataFieldId:_0x3c28ef,checked:_0x213646,type:_0x1aaa16,refreshHandler:_0x24484b,pivotTableId:_0x4c0b13,draggingId:_0x483433,pivotTableInfo:_0x3fd438,unitId:_0x400c45,subUnitId:_0x3d2d72}=_0x30f666,[_0x237814,_0x2ad4f7]=_0x18aa7d(!0x1),_0x1e9ecb=_0x2140ff(_0x12babc),_0x382590=_0x2140ff(_0x2129e8);if(!_0x3fd438)return null;let {rowFields:_0x3e18fb,columnFields:_0x2b95eb,filterFields:_0x3022d5,valueFields:_0x344681}=_0x3fd438,_0x1fd058=_0x3fd438[_0x3d4e74(0x4a1)]??[],_0x568ba9=[..._0x3e18fb,..._0x2b95eb,..._0x3022d5,..._0x344681,..._0x1fd058],_0x15c174=_0x1fd058[_0x3d4e74(0x55a)](_0x2eeeb1=>_0x2eeeb1[_0x3d4e74(0x26a)]===_0x3c28ef),_0x246615=async _0x144a57=>{const _0x33abd6=_0x3d4e74;let _0x49c69c=!!_0x144a57,_0x428f52=!0x1;if(_0x49c69c){let _0x2f596f={'pivotTableId':_0x4c0b13,'dataFieldId':_0x3c28ef,'fieldArea':_0x1aaa16===_0xe427cd[_0x33abd6(0x4b4)]?_0x1d45fb[_0x33abd6(0x19c)]:_0x1d45fb[_0x33abd6(0x4c1)],'unitId':_0x400c45,'subUnitId':_0x3d2d72,'index':_0x1aaa16===_0xe427cd[_0x33abd6(0x4b4)]?_0x344681['length']:_0x3e18fb['length']};_0x428f52=await _0x1e9ecb[_0x33abd6(0x4e2)](_0x207afc['id'],_0x2f596f);}else{let _0x354941=[];_0x568ba9[_0x33abd6(0x2d7)](_0x5f417d=>{const _0x4db16b=_0x33abd6;_0x5f417d[_0x4db16b(0x26a)]===_0x3c28ef&&_0x354941[_0x4db16b(0x29b)](_0x5f417d[_0x4db16b(0x1b1)]);}),_0x428f52=await _0x1e9ecb[_0x33abd6(0x4e2)](_0x2229ad['id'],{'pivotTableId':_0x4c0b13,'fieldIds':_0x354941,'unitId':_0x400c45,'subUnitId':_0x3d2d72});}_0x428f52&&_0x24484b();},_0x1e54cc=async _0x43f981=>{const _0x150172=_0x3d4e74;let _0x2686e9=!0x1,_0x254c04='';if([..._0x3e18fb,..._0x2b95eb,..._0x3022d5,..._0x1fd058]['forEach'](_0x3cb523=>{const _0x1ef156=_0x14e6;_0x3cb523[_0x1ef156(0x26a)]===_0x3c28ef&&(_0x2686e9=!0x0,_0x254c04=_0x3cb523[_0x1ef156(0x1b1)]);}),_0x2686e9&&_0x43f981!==_0x1d45fb[_0x150172(0x19c)]){if(_0x4c0b13){let _0x9461a6=za(_0x3fd438,_0x43f981),_0x327526={'pivotTableId':_0x4c0b13,'area':_0x43f981,'index':_0x9461a6,'fieldId':_0x254c04,'unitId':_0x400c45,'subUnitId':_0x3d2d72};await _0x1e9ecb[_0x150172(0x4e2)](_0x3f282e['id'],_0x327526)&&_0x24484b();}}else{if(_0x4c0b13){let _0x7d27={'pivotTableId':_0x4c0b13,'dataFieldId':_0x3c28ef,'fieldArea':_0x43f981,'unitId':_0x400c45,'subUnitId':_0x3d2d72,'index':za(_0x3fd438,_0x43f981)};await _0x1e9ecb[_0x150172(0x4e2)](_0x207afc['id'],_0x7d27)&&_0x24484b();}}};return _0x81f19b(_0x3d4e74(0x3cc),{'className':_0x1d52fd('univer-group\x20univer-relative\x20univer-box-border\x20univer-flex\x20univer-h-8\x20univer-w-full\x20univer-flex-row\x20univer-items-center\x20univer-rounded-md\x20univer-px-1\x20univer-py-2\x20univer-leading-4\x20univer-transition-all\x20hover:univer-bg-gray-100\x20dark:hover:!univer-bg-gray-700',{'univer-flex\x20univer-bg-gray-100\x20dark:!univer-bg-gray-700':_0x483433===_0x3c28ef}),'id':_0x3d4e74(0x39a)+_0x3c28ef,'onContextMenu':_0x3d3dce=>{const _0xb290ae=_0x3d4e74;_0x3d3dce[_0xb290ae(0x259)](),_0x2ad4f7(!0x0);},'children':[_0x2a3146(_0x3d4e74(0x4fb),{'className':_0x3d4e74(0x304),'children':_0x2a3146(_0x540bc3,{})}),_0x2a3146(_0x180ca8,{'className':_0x3d4e74(0x55e),'checked':_0x213646,'onChange':_0x246615}),_0x81f19b(_0x3d4e74(0x3cc),{'className':_0x3d4e74(0x125),'children':[_0x2a3146(Fs,{'type':_0x1aaa16}),_0x2a3146(_0x3d4e74(0x4fb),{'className':_0x3d4e74(0x500),'children':_0x1382f6})]}),_0x2a3146(_0x29bff8,{'align':_0x3d4e74(0x419),'side':_0x3d4e74(0x43c),'open':_0x237814,'onOpenChange':_0x2ad4f7,'overlay':_0x81f19b('div',{'children':[Is(_0x15c174==null?void 0x0:_0x15c174[_0x3d4e74(0x34e)])&&_0x2a3146(_0x3d4e74(0x3cc),{'className':_0x3d4e74(0x1ef),'onClick':async()=>{const _0x26242b=_0x3d4e74;_0x15c174&&(_0x2ad4f7(!0x1),await _0x1e9ecb[_0x26242b(0x4e2)](_0x1d4592['id'],{'unitId':_0x400c45,'subUnitId':_0x3d2d72,'pivotTableId':_0x4c0b13,'tableFieldId':_0x15c174['tableFieldId'],'items':[],'partialItems':[],'isAll':!0x0})&&_0x24484b());},'children':_0x382590['t'](_0x3d4e74(0x33e))}),_0x2a3146(_0x3d4e74(0x3cc),{'className':_0x3d4e74(0x1ef),'onClick':()=>{const _0x47a234=_0x3d4e74;_0x2ad4f7(!0x1),_0x1e54cc(_0x1d45fb[_0x47a234(0x4c1)]);},'children':_0x382590['t'](_0x3d4e74(0x468))}),_0x2a3146(_0x3d4e74(0x3cc),{'className':_0x3d4e74(0x1ef),'onClick':()=>{const _0x30b1de=_0x3d4e74;_0x2ad4f7(!0x1),_0x1e54cc(_0x1d45fb[_0x30b1de(0x515)]);},'children':_0x382590['t'](_0x3d4e74(0x2f2))}),_0x2a3146('div',{'className':_0x3d4e74(0x1ef),'onClick':()=>{const _0x40d24a=_0x3d4e74;_0x2ad4f7(!0x1),_0x1e54cc(_0x1d45fb[_0x40d24a(0x19c)]);},'children':_0x382590['t'](_0x3d4e74(0x1e1))}),_0x2a3146('div',{'className':_0x3d4e74(0x1ef),'onClick':()=>{_0x2ad4f7(!0x1),_0x1e54cc(_0x1d45fb['Filter']);},'children':_0x382590['t'](_0x3d4e74(0x4d1))})]}),'children':_0x2a3146('div',{'className':_0x1d52fd(_0x3d4e74(0x414),{'univer-opacity-100':_0x237814,'univer-opacity-0\x20group-hover:univer-opacity-100':!_0x237814}),'onMouseDown':_0x261a0e=>_0x261a0e['stopPropagation'](),'onClick':_0x23653f=>_0x23653f['stopPropagation'](),'children':_0x2a3146(_0x2089b2,{'className':_0x3d4e74(0x251)})})})]},_0x3c28ef);}function Rs(_0xfb4504){const _0x3f4207=_0x1aaa99;let {sourceList:_0x174736,refreshHandler:_0x42f4c5,pivotTableId:_0x2ec4cd,pivotTableInfo:_0x1839f2,unitId:_0x2f37cd,draggingId:_0x2cb0ad,subUnitId:_0xb3b73a}=_0xfb4504,_0x9704ce=_0x2140ff(_0x2129e8),[_0xa178c6,_0x225c70]=_0x18aa7d(''),_0x5d4bba=_0xa178c6['trim']()[_0x3f4207(0x1ed)](),_0x3792bd=_0x5d4bba?_0x174736['filter'](_0x240f37=>_0x240f37['name']['toLocaleLowerCase']()[_0x3f4207(0x444)](_0x5d4bba)):_0x174736;return _0x81f19b(_0x3f4207(0x3cc),{'className':_0x3f4207(0x272),'children':[_0x2a3146('p',{'className':_0x3f4207(0x1fc),'children':_0x9704ce['t'](_0x3f4207(0x497))}),_0x2a3146('p',{'className':'univer-mb-2\x20univer-mt-0\x20univer-text-xs\x20univer-leading-4\x20univer-text-gray-600\x20dark:!univer-text-gray-200','children':_0x9704ce['t'](_0x3f4207(0xcc))}),_0x2a3146(_0x1b81fe,{'allowClear':!0x0,'className':_0x3f4207(0x352),'placeholder':_0x9704ce['t'](_0x3f4207(0x12e)),'slot':_0x2a3146(_0x337703,{}),'value':_0xa178c6,'onChange':_0x225c70}),_0x2a3146('div',{'className':_0x1d52fd(_0x3f4207(0x23c),_0x4d03f3),'children':_0x2a3146(_0x3f4207(0x3cc),{'className':_0x1d52fd(_0x3f4207(0x342),_0x392444),'data-testid':_0x3f4207(0x33b),'children':_0x2a3146(Ts,{'droppableId':_0x3f4207(0x113),'direction':_0x3f4207(0x296),'isCombineEnabled':!0x1,'ignoreContainerClipping':!0x1,'isDropDisabled':!0x0,'children':_0x309cb6=>_0x81f19b('div',{'ref':_0x309cb6[_0x3f4207(0x2b3)],'className':_0x3f4207(0x215),..._0x309cb6[_0x3f4207(0x337)],'children':[_0x3792bd[_0x3f4207(0x15d)]((_0x1216fe,_0x457e52)=>_0x2a3146(_0x3f4207(0x3cc),{'className':'univer-relative\x20univer-flex\x20univer-h-8\x20univer-w-full\x20univer-items-center\x20univer-gap-1\x20univer-self-stretch\x20univer-border\x20univer-border-transparent\x20univer-p-0.5\x20univer-leading-4\x20hover:univer-bg-gray-100\x20dark:hover:!univer-bg-gray-700','children':_0x2a3146(Es,{'draggableId':_0x1216fe['id'],'isDragDisabled':!0x1,'index':_0x457e52,'children':({innerRef:_0x202f79,draggableProps:_0x360c65,dragHandleProps:_0x2875d7})=>_0x2a3146(_0x3f4207(0x3cc),{'ref':_0x202f79,..._0x360c65,..._0x2875d7,'className':_0x3f4207(0x496),'style':_0x360c65[_0x3f4207(0x1dd)],'children':_0x2a3146(Ls,{'draggingId':_0x2cb0ad,'unitId':_0x2f37cd,'subUnitId':_0xb3b73a,..._0x1216fe,'refreshHandler':_0x42f4c5,'pivotTableId':_0x2ec4cd,'pivotTableInfo':_0x1839f2})})},_0x1216fe['id'])},_0x1216fe['id'])),_0x3792bd[_0x3f4207(0x483)]===0x0&&_0x2a3146(_0x3f4207(0x3cc),{'className':_0x3f4207(0x150),'children':_0x9704ce['t'](_0x3f4207(0x489))})]})})})})]});}function zs(_0xd95236){const _0x1c411b=_0x1aaa99;let {pivotTableId:_0x187c96,version:_0x33a493,unitId:_0x482cec,subUnitId:_0x2dc7a0,panelInfo:_0x295c9d}=_0xd95236,_0x8c65e=_0x2140ff(_0x344ed3),_0x2a0b7b=_0x38d376(()=>_0x8c65e[_0x1c411b(0x49e)](_0x482cec,_0x2dc7a0,_0x187c96)[_0x1c411b(0x49b)](_0xef7484(0x0)),[_0x8c65e,_0x482cec,_0x2dc7a0,_0x187c96]),_0x2e5634=_0x362266(_0x2a0b7b),_0x382967=_0x2140ff(_0x40b8c0),_0x182356=_0x2140ff(_s),_0x31bf6b=_0x362266(_0x182356[_0x1c411b(0x4e8)],!0x0),_0x3166af=_0x2140ff(_0x12babc),_0xfc2cb7=_0x2140ff(_0x3e0dae),[_0x4907da,_0x16fa7c]=_0x18aa7d(_0x295c9d),[_0x6e0568,_0x2567e5]=_0x18aa7d(null),_0x5e614a=_0x7784bf(async()=>{const _0x28da01=_0x1c411b;if(!_0x8c65e[_0x28da01(0x2fa)](_0x482cec,_0x2dc7a0,_0x187c96))return;let _0x3e9bc3=await _0x382967[_0x28da01(0x1b0)]({'unitId':_0x482cec,'subUnitId':_0x2dc7a0,'pivotTableId':_0x187c96,'params':{'type':_0x4d06ca['Panel'],'panel':{'pivotTableId':_0x187c96}}});_0x3e9bc3[_0x28da01(0x149)][_0x28da01(0x298)]&&_0x16fa7c(_0x3e9bc3[_0x28da01(0x149)][_0x28da01(0x298)]);},[_0x187c96,_0x382967,_0x8c65e,_0x2dc7a0,_0x482cec]);_0x2c2735(()=>{const _0x1c4fc1=_0x1c411b;_0x5e614a()[_0x1c4fc1(0x17b)](_0x5d1dc9=>_0xfc2cb7[_0x1c4fc1(0x344)]('[PivotPanel]',_0x5d1dc9));},[_0xfc2cb7,_0x2e5634,_0x187c96,_0x5e614a,_0x33a493]);let _0xaca5d3=async _0x1bcb23=>{const _0x1157e2=_0x1c411b;let {source:_0x4da397,destination:_0x425301,draggableId:_0x51208b}=_0x1bcb23;_0x2567e5(null);let _0x44174f={'pivotTableInfo':_0x4907da,'pivotTableId':_0x187c96,'commandService':_0x3166af,'unitId':_0x482cec,'subUnitId':_0x2dc7a0},_0x317493=_0x4da397[_0x1157e2(0x356)];if(_0x425301&&_0x425301[_0x1157e2(0x356)]){let _0x222572=_0x425301['droppableId'];await Sa(_0x44174f,_0x51208b,_0x317493,_0x222572,_0x425301[_0x1157e2(0x415)]),await _0x5e614a();}_0x425301===null&&(await ya(_0x44174f,_0x51208b,_0x317493),await _0x5e614a());},_0xcb6967=_0x4d6928=>{const _0x429893=_0x1c411b;_0x2567e5({'draggingId':_0x4d6928[_0x429893(0x19e)]});},_0x3cbbe4=_0x2d64fa=>{let {draggableId:_0x210ca9,destination:_0x1c9da6,source:_0x1fe868}=_0x2d64fa;_0x2567e5({'draggingId':_0x210ca9,'destination':_0x1c9da6,'source':_0x1fe868});};if(!_0x31bf6b||!_0x4907da)return null;let {sourceList:_0x361e6b,rowFields:_0x392898,columnFields:_0x481873,filterFields:_0x48223f,valueFields:_0x10fea4,sourceRange:_0x3268cc,positionInfo:_0x23ed0a}=_0x4907da;return _0x81f19b(_0x1c411b(0x3cc),{'className':_0x1d52fd(_0x1c411b(0x181),_0x392444),'children':[_0x2a3146(Ps,{'sourceRangeInfo':_0x3268cc,'pivotTableId':_0x187c96,'refreshHandler':_0x5e614a,'positionInfo':_0x23ed0a}),_0x81f19b(ws,{'onDragEnd':_0xaca5d3,'onDragStart':_0xcb6967,'onDragUpdate':_0x3cbbe4,'children':[_0x2a3146(Rs,{'draggingId':(_0x6e0568==null?void 0x0:_0x6e0568[_0x1c411b(0xe7)])??'','sourceList':_0x361e6b,'refreshHandler':_0x5e614a,'pivotTableId':_0x187c96,'pivotTableInfo':_0x4907da,'unitId':_0x482cec,'subUnitId':_0x2dc7a0}),_0x2a3146(Bs,{'rowFields':_0x392898,'columnFields':_0x481873,'filterFields':_0x48223f,'valueFields':_0x10fea4,'refreshHandler':_0x5e614a,'positionInfo':_0x23ed0a,'pivotTableId':_0x187c96,'pivotTableInfo':_0x4907da})]})]});}function Bs(_0x4c538d){const _0x4e5037=_0x1aaa99;let {rowFields:_0x42384d,columnFields:_0x513dc7,filterFields:_0x47ee93,valueFields:_0x10e8b1,refreshHandler:_0x96f031,pivotTableInfo:_0x1dc964,positionInfo:_0x4d4192,pivotTableId:_0xc24266}=_0x4c538d;return _0x81f19b(_0x4e5037(0x3cc),{'className':_0x4e5037(0x555),'data-testid':_0x4e5037(0x249),'children':[_0x81f19b(_0x4e5037(0x3cc),{'className':'univer-flex\x20univer-flex-row\x20univer-gap-4','children':[_0x2a3146(Ms,{'areaType':_0x4e5037(0x474),'items':_0x47ee93,'positionInfo':_0x4d4192,'pivotTableId':_0xc24266,'pivotTableInfo':_0x1dc964,'refreshHandler':_0x96f031}),_0x2a3146(Ms,{'areaType':_0x4e5037(0x187),'items':_0x513dc7,'positionInfo':_0x4d4192,'pivotTableId':_0xc24266,'pivotTableInfo':_0x1dc964,'refreshHandler':_0x96f031})]}),_0x81f19b(_0x4e5037(0x3cc),{'className':_0x4e5037(0x184),'children':[_0x2a3146(Ms,{'areaType':_0x4e5037(0x220),'items':_0x42384d,'positionInfo':_0x4d4192,'pivotTableId':_0xc24266,'pivotTableInfo':_0x1dc964,'refreshHandler':_0x96f031}),_0x2a3146(Ms,{'areaType':'value','items':_0x10e8b1,'positionInfo':_0x4d4192,'pivotTableId':_0xc24266,'pivotTableInfo':_0x1dc964,'refreshHandler':_0x96f031})]})]});}function _0x2983(){const _0x339ae8=['sheets-pivot-ui.stdDevpName','text','pivot-value-filter-expected','univer-w-full','default','M12.4008\x202.81641C12.6907\x202.81641\x2012.9258\x203.05146\x2012.9258\x203.34141V11.3908L14.013\x2010.3036C14.218\x2010.0986\x2014.5505\x2010.0986\x2014.7555\x2010.3036C14.9605\x2010.5086\x2014.9605\x2010.841\x2014.7555\x2011.046L12.7721\x2013.0294C12.5671\x2013.2344\x2012.2347\x2013.2344\x2012.0297\x2013.0294L10.0463\x2011.046C9.84132\x2010.841\x209.84132\x2010.5086\x2010.0463\x2010.3036C10.2514\x2010.0986\x2010.5838\x2010.0986\x2010.7888\x2010.3036L11.8758\x2011.3905V3.34141C11.8758\x203.05146\x2012.1108\x202.81641\x2012.4008\x202.81641Z','number','moveUp','rowRanges','sheets-pivot-ui.column','getSeconds','univer-flex\x20univer-h-8\x20univer-w-[140px]\x20univer-flex-1\x20univer-cursor-pointer\x20univer-items-center\x20univer-justify-center\x20univer-rounded-l-md\x20univer-text-center\x20univer-text-sm\x20hover:univer-bg-gray-100\x20rtl:univer-rounded-l-none\x20rtl:univer-rounded-r-md\x20dark:hover:!univer-bg-gray-700','addHook','fillStyle','sheet.operation.rename-pivot-manual-group','bottomCount','sheets-pivot-ui.subtotal.product','sheets-pivot-ui.valueFilter.bottomPercent','sheets-pivot-ui.showValuesAs.ok','Row','random','componentKey','onPointerUp$','format','sheets-pivot-ui.config.pageWrap','nativeEvent','intersects','section','valueGreaterThanOrEqual','clientX','univerDndDropDisabled','sheets-pivot-ui.subtotal.countNums','_registerRenderModules','rangeType','dateNewerThanOrEqual','sheets-pivot-ui.addToFilter','pluginName','_permissionService','draggableProps','sheet-pivot.confirm.add-sheet-pivot','_getPivotAppliedRanges','[data-univer-dnd-droppable-id]','_pivotTableId','pivotConfigChange$','addEventListener','percentOfGrandTotal','0.95','numberGroupField','_cellWidth','sheets-pivot-ui.perform.info','univer-w-[136px]','_confirmService','executeCommand','fieldsConfig','univer-box-border\x20univer-h-8','projection','_pivotTablePanelVisible$','restore','pivotTablePanelVisible$','isBetween','sourceRangeInfo','pageWrap','onPointerDown$','bdi','accounting','topCount','sheets-pivot-ui.manualGroup.defaultName','sheets-pivot-ui.config.rowSubtotalTop','sheets-pivot-ui.dateGroup.yearMonthDate','univer-flex\x20univer-flex-col\x20univer-gap-3','Collapse','sheets-pivot-ui.filterDesc','univer-flex\x20univer-justify-end\x20univer-gap-2','sheets-pivot-ui.config.layoutOutline','univer-sticky\x20univer-top-0\x20univer-z-10\x20univer-my-3\x20univer-w-full\x20univer-shrink-0','sheets-pivot-ui.mobile.moveToColumn','splice','span','sheets-pivot-ui.config.displaySection','_initSkeleton','localeKey','width','univer-truncate','function','percentOfColumnTotal','sheets-pivot-ui.dialog.numfmt.negativeNumberTypes','sheets-pivot-ui.showValuesAs.rankDescending','floor','getFormatInfo','08-05','isTopTotal','getDateSystem','univer-cursor-pointer','registerRenderModule','_configService','setIsRangeSelectorFocus','dataTransfer','differenceFrom','COL_HEADER','univer-size-4\x20univer-shrink-0\x20univer-text-gray-500','valueLessThan','sheets-pivot-ui.filterField','sheet.numfmt.thousandthPercentile','Column','sheets-pivot-ui.showValuesAs.normal','label','pointerup','univer-mb-2\x20univer-flex\x20univer-items-center\x20univer-gap-2\x20univer-text-sm\x20univer-font-medium','replace','sheets-pivot-ui.varpName','currentLocale$','toPrimitive','settings','http://www.w3.org/2000/svg','sheets-pivot-ui.msg.editCellError','closest','univer-mb-4','_UI_PLUGIN','useWholeDay','beforeCommandExecuted','lessThanOrEqual','univer-flex\x20univer-min-h-12\x20univer-items-center\x20univer-gap-3\x20univer-rounded-xl\x20univer-px-2','sheet.pivot.context-menu.manual-rename','univer-border-primary-600','getTextInfo','itemType','getMilliseconds','pivot','DATA','sheets-pivot-ui.config.dateGroupingSwitchTitle','sourceFieldId','sheets-pivot-ui.dialog.numfmt.currency','FilteredSortDesc','blockedRange','univer-max-h-[40vh]\x20univer-overflow-y-auto\x20univer-rounded-xl\x20univer-bg-gray-50\x20univer-p-2\x20dark:!univer-bg-gray-800','percentDifferenceFrom','UNIVER_SHEET_PIVOT_VALUE_FILTER_DIALOG_ID','univer-mt-1\x20univer-text-xs\x20univer-text-gray-500','varp','sheets-pivot-ui.dialog.fieldName','true','position','#274FEE','pivotTableId','colRanges','string','univer-max-w-[200px]\x20univer-truncate','univer-flex\x20univer-items-center\x20univer-justify-between\x20univer-gap-2','univer-min-w-0\x20univer-flex-1\x20univer-truncate\x20univer-text-sm','sheets-pivot-ui.showValuesAs.percentOfRowTotal','sheets-pivot-ui.valueFilter.topCount','_skeletonManagerService','sheets-pivot-ui.countNumsName','markDirty$','sheets-pivot-ui.dialog.numfmt.formatTypes','add','univer-mb-2\x20univer-mt-0\x20univer-flex\x20univer-w-full\x20univer-text-sm\x20univer-leading-4\x20univer-text-gray-900','setFullYear','UNIVER_SHEET_PIVOT_NUMBER_GROUP_DIALOG_ID','effectAllowed','sidebarOptions$','UNIVER_SHEET_PIVOT_FIELD_NUMFMT_ID','dateOlderThanOrEqual','2147483647','87437EbtQzF','sheets-pivot-ui.msg.permissionError','drawWith','univer-shrink-0','subscribeEvent','none','defaultValueFieldId','RecordFilter','find','univer-w-24','sheets-pivot-ui.config.pageWrapOverThenDownHelp','daysInterval','univer-w-[14px]\x20univer-text-sm\x20univer-text-gray-200','onPointerMove$','M2\x2012.3661C2\x2012.0347\x202.26863\x2011.7661\x202.6\x2011.7661H9.24705C9.57842\x2011.7661\x209.84705\x2012.0347\x209.84705\x2012.3661V29.278C9.84705\x2029.6093\x209.57842\x2029.878\x209.24705\x2029.878H4C2.89543\x2029.878\x202\x2028.9825\x202\x2027.878V12.3661Z','time','values','univer-w-32','MM-dd','sheets-pivot-ui.config.dateGroupingSwitchMessage','_(\x22','reCalculate','sheets-pivot-ui.config.multipleFiltersTitle','config','sheets-pivot-ui.showValuesAs.differenceFrom','Hour','sheets-pivot-ui.title','univer-mb-2\x20univer-h-5\x20univer-text-sm\x20univer-font-medium\x20univer-leading-5','sheets-pivot-ui.dateFilter.between','sheets-pivot-ui.showValuesAs.percentOfColumnTotal','autoStart','primary','M3.30363\x203C2.79117\x203\x202.51457\x203.60097\x202.84788\x203.99024L6.8\x208.60593V12.5662C6.8\x2012.7184\x206.8864\x2012.8575\x207.02289\x2012.9249L8.76717\x2013.7863C8.96655\x2013.8847\x209.2\x2013.7396\x209.2\x2013.5173V8.60593L13.1521\x203.99024C13.4854\x203.60097\x2013.2088\x203\x2012.6964\x203H3.30363Z','sum','getPivotTableIdByCell','univer-w-40','sheets-pivot-ui.dateFilter.to','dateEqual','sheets-pivot-ui.sourceFieldDescription','sheets-pivot-ui.mobile.moveToRow','isDraggingOver','_isRangeSelector2Focus','grouping','univer-flex\x20univer-items-center\x20univer-gap-2\x20univer-text-sm','NotFilter','univer-flex\x20univer-flex-col\x20univer-gap-1','valueFieldId','setTimeout','value','13:30:30','_initEditListener','setPointerCapture','univer-w-4\x20univer-text-base\x20univer-text-primary-600','1930/08/05','univer-text-xs\x20univer-text-gray-600','sheets-pivot-ui.dialog.sourceName','sheets-pivot-ui.config.layoutTabular','univer-p-4\x20univer-text-center\x20univer-text-sm\x20univer-text-gray-500','outline','sheets-pivot-ui.dialog.numfmt.date','valueEqual','sheets-pivot-ui.config.pageWrapDownThenOverHelp','sheets-pivot-ui.mobile.edit','clientY','sheets-pivot-ui.subtotal.stdDevp','draggingId','_iconManager','_registerComponents','getRowCount','ROW','stdDevp','_controlPointerDownHandler','univer-flex\x20univer-h-12\x20univer-w-full\x20univer-items-center\x20univer-gap-2\x20univer-rounded-xl\x20univer-border-0\x20univer-bg-transparent\x20univer-px-3\x20univer-text-left\x20univer-text-sm','M1.28069\x204.85447C0.842195\x204.33439\x201.21191\x203.5391\x201.89218\x203.5391H8.59333C9.2736\x203.5391\x209.64331\x204.33439\x209.20482\x204.85447L6.51052\x208.0501V11.6601C6.51052\x2012.2245\x205.94174\x2012.6114\x205.41683\x2012.404L4.48092\x2012.0343C4.1756\x2011.9136\x203.97498\x2011.6187\x203.97498\x2011.2904V8.0501L1.28069\x204.85447Z','onPointerEnter','sheets-pivot-ui.dialog.numfmt.decimalPlaces','defineProperty','_injector','_permissionController','closePath','test','next','unitId','sheets-pivot-ui.manualGroup.','sheets-pivot-ui.mobile.moveToFilter','iterator','stdDev','getDialogs$','{0}','getPivotTableRangeInfo','invalidSelection','sheets-pivot-ui.dateGroup.daysInterval','univer-text-sm\x20univer-font-medium\x20univer-leading-5\x20univer-text-gray-900','options','684485YQHRBh','univer-mb-3\x20univer-w-full','onPointerLeave','legend','querySelectorAll','sheets-pivot-ui.msg.emptySourceRange','displayName','getUnitId','getConfig','sheets-pivot-ui.perform.confirm','_selectionControl','h:mm','between','univer-my-3\x20univer-w-full\x20univer-shrink-0','_univerInstanceService','source','univer-flex\x20univer-min-h-10\x20univer-items-center\x20univer-justify-between\x20univer-gap-3','univer-rounded-xl\x20univer-bg-gray-50\x20univer-p-1\x20dark:!univer-bg-gray-800','thousandthPercentile','_initControl','pointerId','params','toString','day','getCurrentSelections','set','\x22#,##0.00)','blockExecuteWithoutPermission','univer-flex\x20univer-flex-col\x20univer-gap-2','appendChild','save','sheets-pivot-ui.showValuesAs.dialogTitle','startX','univer-flex\x20univer-min-w-0\x20univer-flex-1\x20univer-items-center\x20univer-text-xs\x20univer-leading-4\x20univer-text-gray-900\x20dark:!univer-text-gray-0','sheets-pivot-ui.valueFilter.lessThan','M5.5165\x202.58693C5.23375\x201.81542\x204.1426\x201.81543\x203.85985\x202.58693L2.13257\x207.29995C2.03197\x207.57443\x202.17294\x207.8785\x202.44742\x207.97909C2.7219\x208.07969\x203.02596\x207.93872\x203.12656\x207.66424L3.64358\x206.25351L3.64516\x206.25351H5.73278L6.2498\x207.66424C6.35039\x207.93872\x206.65446\x208.07969\x206.92894\x207.97909C7.20342\x207.8785\x207.34438\x207.57443\x207.24379\x207.29995L5.5165\x202.58693ZM5.34479\x205.19487L4.68818\x203.40325L4.03156\x205.19487H5.34479Z','lower','sheets-pivot-ui.mobile.columnDesc','onPointerLeave$','rowFields','sheets-pivot-ui.perform.cancel','topPercent','sheets-pivot-ui.searchFieldPlaceholder','sheets-pivot-ui.valueFilter.lessThanOrEqual','packageName','sheets-pivot-ui.dateFilter.wholeDay','sheets-pivot-ui.value','field-setting-','sheets-pivot-ui.dialog.source.insertPivotTable','yyyy/MM/dd','translate','sheets-pivot-ui.valueFilter.equal','sheets-pivot-ui.config.layoutCompact','FilterAll','sheet.pivot.context-menu.manual-group','isAll','univer-mb-5\x20univer-mt-2\x20univer-box-border\x20univer-h-8\x20univer-w-full\x20univer-rounded-md\x20univer-py-1.5\x20univer-text-sm\x20univer-leading-5','product','currentFilter','sheets-pivot-ui.showValuesAs.runningTotal','fixed','_themeService','red','Year','dispose','_registerCommands','sheets-pivot-ui.showValuesAs.baseItem','positionInfo','setIsRangeSelector2Focus','result','sheets-pivot-ui.dateGroup.year','px)','diffValue','M12.2983\x2012.4011C12.2982\x2012.0697\x2012.5669\x2011.8009\x2012.8983\x2011.8009L29.3931\x2011.8009C29.7243\x2011.8009\x2029.9929\x2012.0694\x2029.9931\x2012.4007L29.9993\x2027.9129C29.9997\x2029.0178\x2029.1042\x2029.9137\x2027.9993\x2029.9137H12.9051C12.5738\x2029.9137\x2012.3053\x2029.6452\x2012.3051\x2029.314L12.2983\x2012.4011Z','items','univer-flex\x20univer-gap-2','univer-py-4\x20univer-text-center\x20univer-text-xs\x20univer-text-gray-500','A/P\x20hh:mm','univer-ml-3\x20rtl:univer-ml-0\x20rtl:univer-mr-3','sheets-pivot-ui.manualGroup.ungroupTitle','visible','type','some','sheet.operation.set-pivot-number-group','excelLike','collection','tabular','\x22#,##0.00_);(\x22','sheets-pivot-ui.config.pageSection','map','percentOf','univer-text-sm\x20univer-text-gray-500','addClipboardHook','_initButtonRender','#,##0_);[Red](#,##0)','sheets-pivot-ui.manualGroup.groupTitle','sheets-pivot-ui.mobile.moveToValue','merge','setConfig','sheets-pivot-ui.dialog.filter.ascending','getCurrentSkeleton','item:','sheets-pivot-ui.dateFilter.date','sheets-pivot-ui.dateGroup.yearQuarter','forValue','getColorFromTheme','pointercancel','cellHeight','colHeaderMap','00:00:00','8月5日','univer-mb-2\x20univer-text-sm\x20univer-font-medium','positionSheetName','startY','auto','\x22#,##0.00_);-\x22','rowType','univer-flex\x20univer-items-center\x20univer-gap-1.5\x20univer-self-stretch\x20univer-rounded-md\x20univer-px-2\x20univer-py-1.5\x20univer-text-sm\x20univer-capitalize\x20univer-leading-5','FilterNoneSortDesc','catch','onPointerDown','sheets-pivot-ui.mobile.moveUp','univer-h-8\x20univer-rounded-md\x20univer-border\x20univer-border-gray-300\x20univer-bg-gray-0\x20univer-px-2\x20univer-text-sm\x20univer-text-gray-900\x20dark:univer-bg-gray-700\x20dark:univer-text-gray-0','[MobilePivotConfigPanel]','previous','univer-mt-4\x20univer-flex\x20univer-h-[calc(100%-16px)]\x20univer-min-h-0\x20univer-w-full\x20univer-flex-col\x20univer-overflow-y-auto\x20univer-overflow-x-hidden','sheets-pivot-ui.subtotal.varp','univer-flex\x20univer-size-full\x20univer-min-h-0\x20univer-flex-col','univer-flex\x20univer-flex-row\x20univer-gap-4','sheet.operation.ungroup-pivot-manual-group','UNIVER_SHEET_PIVOT_VALUE_FILTER_DIALOG','column','left','getActiveSheet','complete','sheets-pivot-ui.dialog.numfmt.accountingDesc','min','#,##0.00_);[Red]#,##0.00','drawIconByPath','percentOfParent','sheets-pivot-ui.config.allowMultipleFilters','interceptAsync','sheets-pivot-ui.config.repeatColLabels','sheets-pivot-ui.dateFilter.notEqual','strokeStyle','sheets-pivot-ui.dialog.numfmt.currencyTypes','_componentManager','_cellAlerts','univer-mt-2\x20univer-w-full','selectedGroupId','sheets-pivot-ui.showValuesAs.cancel','getCurrentLastSelection','Value','originalFieldId','draggableId','subUnitId','sheet-pivot.confirm.change-date-grouping-mode','offsetY','1.13965','small','New','_initContextMenu','confirm','POINTER','mouse','baseItemType','1930-08-05','dataFieldType','ALL','middle','_handlePointerUp','sheets-pivot-ui.config.showRowGrandTotal','getPivotDisplayConfig','tableFieldId','sheets-pivot-ui.dateGroup.day','Expand','_mergeCellController','Day','univer-flex\x20univer-justify-end\x20univer-gap-3','univer-flex\x20univer-items-center\x20univer-justify-between\x20univer-gap-3','info','univer-h-full\x20univer-overflow-y-auto','univer-text-xs\x20univer-text-gray-500','univer-mb-2\x20univer-mt-5\x20univer-h-5\x20univer-text-sm\x20univer-font-medium','sheets-mobile-pivot-button-','sheets-pivot-ui.valueFilter.selectValueField','_sheetPrintInterceptorService','year','showColGrandTotal','valueGreaterThan','univer-overflow-auto','indexOf','sheet.pivot.context-menu.show-data-as','getPermissionPoint','sheets-pivot-ui.config.showColSubtotal','\x22#,##0.00_);[Red]\x22','command','sheets-pivot-ui.dialog.numfmt.general','sheets-pivot-ui.dialog.numfmt.generalDesc','dateType','sheets-pivot-ui.dialog.filter.descending','sheets-pivot-ui.dateGroup.quarter','312zPpzQv','Error','1,235)','slice','moveToColumn','sheets-pivot-ui.perform.blockedByMerge','getDirection','sheets-pivot-ui.config.showColGrandTotal','pivot-value-filter-confirm','cloneNode','zIndex','dateNotBetween','Month','sheets-pivot-ui.valueFilter.bottomCount','Filter','style','_pivotParams','sheets-pivot-ui.valueFilter.topPercent','datetime','sheets-pivot-ui.addToValue','#ECECEC','_sheetSkeletonManagerService','DEFAULT','SHEET_PIVOT_MOVE_KEY','addObject','scene','originalDataFieldId','_dialogService','_initialize','_sheetsPivotTableService','area','toLocaleLowerCase','direction$','univer-flex\x20univer-cursor-pointer\x20univer-items-center\x20univer-self-stretch\x20univer-px-2\x20univer-py-1.5\x20univer-text-sm\x20univer-leading-5\x20univer-text-gray-900\x20hover:univer-bg-gray-100\x20dark:!univer-text-gray-0\x20dark:hover:!univer-bg-gray-700','SUBITEMS','getCollection','exec','sheets-pivot-ui.perform.blockedByPivot','_openPivotActionPanel','ascending','boxSizing','sheets-pivot-ui.dateFilter.failed','UNIVER_SHEET_PIVOT_EXCEL_DATE_GROUP_DIALOG_ID','_localeService','sheets-pivot-ui.dateGroup.excelLikeTitle','drawExpand','univer-mb-1\x20univer-mt-0\x20univer-text-sm\x20univer-font-medium\x20univer-leading-5\x20univer-text-gray-900\x20dark:!univer-text-gray-0','selectionChanged$','pointerType','fieldId','_contextMenuController','sheets-pivot-ui.dateFilter.equal','univer-mb-2\x20univer-text-sm\x20univer-font-medium\x20univer-text-gray-600','sheets-pivot-ui.dateFilter.serial','ValueFilter','collapse','21.9404','sheetName','concat','isPercent','_commandService','sheets-pivot-ui.subtotal.stdDev','color','currency','square','_clearButtons','get','sheets-pivot-ui.sourceRangePlaceholder','makeDirty','univer-mt-1.5\x20univer-text-sm\x20univer-leading-5\x20univer-text-gray-600\x20dark:!univer-text-gray-200','showRowSubtotal','univer-box-border\x20univer-h-full\x20univer-px-2','M12.2637\x202.6863C12.2637\x202.35493\x2012.5323\x202.0863\x2012.8637\x202.0863H27.9702C29.0748\x202.0863\x2029.9702\x202.98173\x2029.9702\x204.0863V8.73627C29.9702\x209.06764\x2029.7016\x209.33627\x2029.3702\x209.33627H12.8637C12.5323\x209.33627\x2012.2637\x209.06764\x2012.2637\x208.73627L12.2637\x202.6863Z','targetCellInfo','other','13:30','univer-box-border\x20univer-h-[161px]\x20univer-w-full\x20univer-flex-col\x20univer-items-center\x20univer-justify-center\x20univer-overflow-x-hidden\x20univer-rounded-lg\x20univer-bg-gray-50\x20univer-py-2\x20dark:!univer-bg-gray-900','_moveType','manualGroupMembers','decimal','sheet.operation.open-pivot-table-filter-panel','univer-flex\x20univer-flex-col\x20univer-gap-5\x20univer-py-4','row','UNIVER_SHEET_PIVOT_EXCEL_DATE_GROUP_DIALOG','round','bind','prototype','Provider','getSubUnitPivotConfigs','univer-flex\x20univer-h-8\x20univer-w-[140px]\x20univer-flex-1\x20univer-cursor-pointer\x20univer-items-center\x20univer-justify-center\x20univer-rounded-r-md\x20univer-text-center\x20univer-text-sm\x20hover:univer-bg-gray-100\x20rtl:univer-rounded-l-md\x20rtl:univer-rounded-r-none\x20dark:hover:!univer-bg-gray-700','sheets-pivot-ui.fieldSettings','pageOverThenDown','sheets-pivot-ui.minName','sheets-pivot-ui.config.dateGroupingLegacy','interceptBeforeCommand','open','range','showDataAs','subtle','sheets-pivot-ui.dateGroup.autoEnd','startsWith','sheets-pivot-ui.showValuesAs.percentOfGrandTotal','univer-flex\x20univer-cursor-pointer\x20univer-items-center\x20univer-gap-2\x20univer-text-sm\x20univer-text-gray-600','alert','pivot-value-filter-rule','(1,235)','_selectionsService','h:mm:ss','size','pivot-value-filter-clear','univer-box-border\x20univer-min-h-0\x20univer-flex-1\x20univer-rounded-lg\x20univer-bg-gray-0\x20univer-p-2\x20dark:!univer-bg-gray-900','_registerIcons','univer-mb-5\x20univer-flex\x20univer-h-6\x20univer-cursor-pointer\x20univer-items-center\x20univer-text-base\x20univer-font-medium\x20univer-leading-6','lessThan','sheets-pivot-ui.dialog.numfmt.dateTypes','univer-flex\x20univer-flex-col\x20univer-gap-4','defaultNormalField','sheets-pivot-ui.valueFilter.greaterThan','sheets-pivot-ui.config.dateGroupingMode','[PivotConfigPanel]','parse','Blank','Subtotal','pivot-field-areas','Minute','25.959','getDate','paths','getCellWithCoordByIndex','sheet.operation.set-pivot-show-data-as','sheets-pivot-ui.dialog.filter.blank','univer-text-gray-400\x20dark:!univer-text-gray-500','col','version','beginPath','MOVE','baseItem','Second','getSheetId','preventDefault','endRow','sheets-pivot-ui.config.layout','transformByState','realContain','sheets-pivot-ui.config.showRowSubtotal','percentOfRowTotal','sheets-pivot-ui.subtotal.average','unitDisposed$','moveDown','sheets-pivot-ui.dialog.filter.confirm','BUTTON','_initFormatPainterListener','sheets-pivot-ui.showValuesAs.index','univer-mt-2\x20univer-text-xs\x20univer-text-red-500','join','[MobilePivotSourceRange]','dataFieldId','_updatePivotSort','sheets-pivot-ui.maxName','maxDecimals','suffix','checkedItems','univer-flex\x20univer-min-h-12\x20univer-items-center\x20univer-gap-3\x20univer-rounded-xl\x20univer-px-3','Desc','univer-mb-4\x20univer-flex\x20univer-min-h-0\x20univer-flex-1\x20univer-flex-col','_initPanelOpen','sheets-pivot-ui.dateGroup.start','A/P\x20h:mm:ss','show','univer-mt-3','requiresParameters','BLANK_PLACEHOLDER','sheets-pivot-ui.msg.invalidSize','M12.2517\x202.6863C12.2517\x202.35493\x2012.5203\x202.0863\x2012.8517\x202.0863H27.9582C29.0628\x202.0863\x2029.9582\x202.98173\x2029.9582\x204.0863V8.73627C29.9582\x209.06764\x2029.6896\x209.33627\x2029.3582\x209.33627H12.8517C12.5203\x209.33627\x2012.2517\x209.06764\x2012.2517\x208.73627L12.2517\x202.6863Z','univer-h-40\x20univer-flex-1\x20univer-overflow-y-auto\x20univer-rounded-lg','onRendered','sheets-pivot-ui.showValuesAs.rankAscending','parentFieldOnly','customFields','offsetX','draggingOver','footer','ExcelLike','tableFieldInfo','univer-flex\x20univer-h-10\x20univer-items-center\x20univer-gap-2\x20univer-border-0\x20univer-bg-transparent\x20univer-p-0\x20univer-text-base\x20univer-font-semibold','0\x2016px\x2016px','clearTimeout','flatMap','yyyy\x22年\x22MM\x22月\x22dd\x22日\x22','PRINTING_RANGE','M2\x204.0863C2\x202.98173\x202.89543\x202.0863\x204\x202.0863H9.24705C9.57842\x202.0863\x209.84705\x202.35493\x209.84705\x202.6863V8.73981C9.84705\x209.07118\x209.57842\x209.33981\x209.24705\x209.33981H2.6C2.26863\x209.33981\x202\x209.07118\x202\x208.73981V4.0863Z','_closePanel','-1,234.56','bottomPercent','currentDateType','univer-flex\x20univer-size-10\x20univer-shrink-0\x20univer-items-center\x20univer-justify-center\x20univer-rounded-lg\x20univer-border-0\x20univer-bg-transparent\x20active:univer-bg-gray-100\x20dark:active:!univer-bg-gray-700','otherDataKey','FilterPartial','1604JgsmvL','sheets-pivot-ui.numberGroup.start','vertical','getSheetBySheetId','panel','sheets-pivot-ui.dialog.ok','_initMenu','push','PivotTableIcon','17.8544','getUnit','_closeChildDialogs','_sheetsPivotTableConfigModel','groups','_scenePointerUpSubscribe','close','var','fieldDataType','cellWidth','sheet.numfmt.general','sheet.numfmt.date','dataFieldInfo','greaterThan','getCurrentUnitOfType','positionRange','0\x2024px\x2020px','univer-flex\x20univer-justify-between\x20univer-gap-3','members','relative:previous','sheets-pivot-ui.mobile.sourceFieldDescription','setData','innerRef','intercept','dateRange','keys','dataset','UNIVER_SHEET_PIVOT_FILTER_PANEL_ID','custom','_setPivotTableId','sheet.pivot.context-menu.value-filter','onStarting','numberGroupDefaults','univer-mb-2\x20univer-h-5\x20univer-text-sm\x20univer-font-medium','countNums','remove','rect','valueNotEqual','mergeMenu','sheets-pivot-ui.valueFilter.title','_scenePointerMoveSubscribe','ORGANIZATION','decorate','permissionPointUpdate$','expected','getRange','_cellHeight','sheets-pivot-ui.showValuesAs.baseField','border-box','dragover','all','univer-text-sm','validate','destructive','measure','getSelectionControls','textKey','sheets-pivot-ui.config.dateGroupingExcelLike','forEach','sheets-pivot-ui.removeField','_initBlockedPivotAlert','_initPrintArea','sheets-pivot-ui.valueFilter.ok','univer-overflow-hidden','getSheets','object','model','-9999px','sheets-pivot-ui.dialog.numfmt.thousandthPercentile','lineTo','currentSkeleton$','notEqual','univer-flex\x20univer-items-center\x20univer-justify-between\x20univer-self-stretch\x20univer-leading-5','FilterNoneSortNone','redos','_sheetClipboardService','ΣValue','filterFields','UNIVER_SHEET_PIVOT_FIELD_NUMFMT','false','path','permissionCheckWithRanges','88006BdyskS','moveToRow','primary.600','sheets-pivot-ui.addToColumn','getSubUnitPivotRenderCache','NORMAL','link','univer-mb-2\x20univer-flex\x20univer-h-5\x20univer-justify-between\x20univer-text-sm\x20univer-leading-5','moveToValue','sheets-pivot-ui.dialog.numfmt.accounting','minutes','getPivotTableConfig','arcTo','sheets-pivot-ui.dialog.numfmt.','percent','pivotTableIds','_closePivotPanel','sheets-pivot-ui.numberGroup.autoEnd','sheets-pivot-ui.averageName','M2.69779\x2010.0113C2.40546\x2010.0113\x202.16847\x209.77429\x202.16847\x209.48196C2.16847\x209.18962\x202.40546\x208.95264\x202.69779\x208.95264H6.67804C6.89213\x208.95264\x207.08514\x209.0816\x207.16707\x209.2794C7.249\x209.47719\x207.20371\x209.70486\x207.05233\x209.85624L3.97569\x2012.9329H6.67804C6.97038\x2012.9329\x207.20736\x2013.1699\x207.20736\x2013.4622C7.20736\x2013.7545\x206.97038\x2013.9915\x206.67804\x2013.9915H2.69779C2.4837\x2013.9915\x202.29069\x2013.8626\x202.20876\x2013.6648C2.12684\x2013.467\x202.17212\x2013.2393\x202.32351\x2013.0879L5.40015\x2010.0113H2.69779Z','sheets-pivot-ui.dialog.format','univer-mr-2\x20univer-w-4\x20rtl:univer-ml-2\x20rtl:univer-mr-0','rename','univer-grid\x20univer-grid-cols-2\x20univer-gap-3','pointerEvents','univer-mt-2\x20univer-h-5\x20univer-text-xs\x20univer-text-red-400','getStyles','sheet.operation.set-pivot-excel-date-group','max','@univerjs-pro/sheets-pivot-ui','sheet.operation.set-pivot-value-filter','asyncInterceptor','subTotalType','itemKey','trim','current','sheets-pivot-ui.dialog.numfmt.cancel','univer-w-36','input','opacity','getSubUnitPivotMatrix','sheet.numfmt.accounting','getScrollXYInfoByViewport','relative:next','split','registerCommand','M11.9003\x202.29495C11.9003\x202.00261\x2011.6633\x201.76562\x2011.371\x201.76562C11.0787\x201.76562\x2010.8417\x202.00261\x2010.8417\x202.29495V12.4268L9.74577\x2011.3309C9.53906\x2011.1242\x209.20391\x2011.1242\x208.9972\x2011.3309C8.79048\x2011.5376\x208.79048\x2011.8727\x208.9972\x2012.0795L10.9969\x2014.0791C11.2036\x2014.2858\x2011.5387\x2014.2858\x2011.7454\x2014.0791L13.7451\x2012.0795C13.9518\x2011.8727\x2013.9518\x2011.5376\x2013.7451\x2011.3309C13.5384\x2011.1242\x2013.2032\x2011.1242\x2012.9965\x2011.3309L11.9003\x2012.4271V2.29495Z','2847552HccKtY','getIntersectsPivotTable','disposeWithMe','descending','getPivotItemRenderInfoCache','\x22*\x20#,##0','sheets-pivot-ui.configPanel','38283930pbmhYM','M2.69792\x2010.0113C2.40558\x2010.0113\x202.16859\x209.77429\x202.16859\x209.48196C2.16859\x209.18962\x202.40558\x208.95264\x202.69792\x208.95264H6.67816C6.89225\x208.95264\x207.08526\x209.0816\x207.16719\x209.2794C7.24912\x209.47719\x207.20384\x209.70486\x207.05245\x209.85624L3.97581\x2012.9329H6.67816C6.9705\x2012.9329\x207.20749\x2013.1699\x207.20749\x2013.4622C7.20749\x2013.7545\x206.9705\x2013.9915\x206.67816\x2013.9915H2.69792C2.48383\x2013.9915\x202.29082\x2013.8626\x202.20889\x2013.6648C2.12696\x2013.467\x202.17224\x2013.2393\x202.32363\x2013.0879L5.40027\x2010.0113H2.69792Z','reason','univer-inline-flex\x20univer-flex-col\x20univer-rounded-lg\x20univer-border\x20univer-border-gray-200\x20univer-bg-gray-0\x20univer-p-2\x20univer-shadow-lg','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','sheets-pivot-ui.manualGroup.renameTitle','removeEventListener','from','unit','drawCollapse','univer-flex\x20univer-gap-3','Date1900','sheets-pivot-ui.perform.blocked','MAIN_AREA','_moveStartCellIndex','interceptor','sheets-pivot-ui.dateGroup.title','_initRowColOperationCheck','droppableProps','menu','repeatColLabels','date','pivot-source-field-viewport','univer-text-xs','2.2793','sheets-pivot-ui.dialog.filter.clearFilter','moveTo','sheets-pivot-ui.dialog.source.newSheet','_defaultOverride','univer-relative\x20univer-h-full\x20univer-overflow-y-auto','Draggable/Droppable\x20must\x20be\x20used\x20inside\x20DragDropContext','error','sheets-pivot-ui.valueFilter.valueField','\x22#,##0.00','sheets-pivot-ui.dateGroup.minute','univer-max-h-[40vh]\x20univer-overflow-y-auto\x20univer-rounded-xl\x20univer-bg-gray-50\x20univer-p-1\x20dark:!univer-bg-gray-800','sheets-pivot-ui.dialog.source.intersect','conditionFilter','setCursor','buttonType','showAlert','filterInfo','univer-flex\x20univer-min-h-12\x20univer-items-center\x20univer-px-2','count','sheets-pivot-ui.dialog.filter.cancel','univer-mb-2','sheet.operation.set-pivot-date-group','univer-flex\x20univer-min-w-0\x20univer-flex-col\x20univer-gap-1','rankAscending','droppableId','getSheetBySheetName','subscribe','univer-mt-2\x20univer-flex\x20univer-justify-end','sheet.pivot.context-menu.excel-date-group','getFullYear','getOwnPropertyDescriptor','item','univer-text-sm\x20univer-font-medium\x20univer-text-gray-600','mainComponent','Existing','sheets-pivot-ui.showValuesAs.percentRunningTotal','sheets-pivot-ui.config.repeatRowLabels','univer-flex\x20univer-items-center\x20univer-justify-between\x20univer-self-stretch','sheet.pivot.context-menu.number-group','lineCap','onSteady','UNIVER_SHEET_PIVOT_PANEL_ID','sheets-pivot-ui.showValuesAs.other','showColSubtotal','targetFieldId','onCommandExecuted','field','has','list','sheets-pivot-ui.dialog.summarizeBy','sheets-pivot-ui.valueFilter.notEqual','checked','name','greaterThanOrEqual','All','univer-flex\x20univer-flex-col\x20univer-gap-4\x20univer-py-4','translate(','rangesInfo','baseFieldId','_initSheetChange','_config','normal','partialItems','univer-mb-1\x20univer-box-border\x20univer-h-7\x20univer-py-1\x20univer-pl-[22px]\x20univer-pr-1\x20univer-text-sm\x20rtl:univer-pl-1\x20rtl:univer-pr-[22px]','_sheetPermissionCheckController','sheets-pivot-ui.dialog.numfmt.confirm','sheets-pivot-ui.valueFilter.between','[PivotFilterOptions]','setControlExtensionDisable','univer-mx-1.5\x20univer-my-0\x20univer-h-4\x20univer-text-xs\x20univer-text-gray-200\x20dark:!univer-text-gray-600','OPERATION','sheets-pivot-ui.stdDevName','target','dateOlderThan','_context','FilterSingle','_menuManagerService','itemLabels','\x22#,##0.00_);\x22','CANCEL','memberPaths','sheet.operation.open-pivot-table-panel','sheets-pivot-ui.columnDesc','textGroupField','ungroup','univer-flex\x20univer-cursor-pointer\x20univer-items-center\x20univer-self-stretch\x20univer-px-2\x20univer-py-1.5\x20univer-text-sm\x20univer-leading-5\x20univer-text-gray-900\x20dark:!univer-text-gray-0','_formatPainterService','fractionalSecond','univer-flex\x20univer-h-8\x20univer-cursor-pointer\x20univer-items-center\x20univer-justify-center\x20univer-gap-1.5\x20univer-rounded\x20univer-border-none\x20univer-bg-gray-0\x20univer-px-3\x20univer-text-primary-600','repeatRowLabels','11siuhVk','group','source-','_sheetInterceptorService','sheetId','rangeInfo','columnFields','sheetDisposed$','startRow','valueLessThanOrEqual','sheets-pivot-ui.numberGroup.title','univer-flex\x20univer-h-[140px]\x20univer-flex-col\x20univer-items-center\x20univer-justify-center\x20univer-gap-1\x20univer-self-stretch\x20univer-px-2','fill','setDragImage','positionType','sheets-pivot-ui.subtotal.min','moveToFilter','_initMenuInterceptor','[sheets-pivot-ui]:\x20Pivot\x20render\x20cache\x20is\x20unavailable','_targetRange','height','sheets-pivot-ui.dialog.source.existingSheet','defaultOverride','isCount','sheet.pivot.context-menu.date-group','getCellMatrix','isInteger','sheets-pivot-ui.showValuesAs.percentOfParent','sheets-pivot-ui.countName','sourceSheetName','_renderManagerService','evenodd','18nBjntz','sheets-pivot-ui.sumName','univer-min-h-[200px]\x20univer-flex-1\x20univer-p-1','onDblclick$','units','sheets-pivot-ui.config.filteringSection','7202214UkuvXW','FilterNoneSortAsc','sheets-pivot-ui.perform.tips','valueFields','univer-mb-2\x20univer-text-sm\x20univer-font-medium\x20univer-text-gray-900\x20dark:!univer-text-gray-0','shouldClear','sheets-pivot-ui.perform.rowColError','univer-flex\x20univer-flex-col\x20univer-gap-5','(1,235)\x20','0\x200\x2032\x2032','univer-grid\x20univer-grid-cols-2\x20univer-gap-2','_pivotButtonShapesArr','sourceList','sheets-pivot-ui.rowDesc','div','univer-text-sm\x20univer-text-gray-600','isSubtotal','_adaptorModel','isBottomTotal','_draw','GrandTotal','context','key','drawNoSetting','getValue','rankDescending','_initListener','allowMultipleFilters','univer-flex\x20univer-flex-1\x20univer-gap-2\x20univer-text-sm\x20rtl:univer-flex-row-reverse','sheets-pivot-ui.sourceRangeLabel','7.59766','FilteredSortNone','univer-rounded-lg\x20univer-p-2','1.5.1','FilteredSortAsc','UNIVER_SHEET_PIVOT_FIELD_SETTING','symbol','sheets-pivot-ui.moveToRow','item-or-relative','_isRangeSelectorFocus','univer-flex','_moveRowOrCol','sheets-pivot-ui.dateGroup.monthDate','compact','sheets-pivot-ui.dialog.source.position','sheets-pivot-ui.dialog.cancel','operator','univer-flex\x20univer-flex-wrap\x20univer-items-center\x20univer-gap-2','#D8D8D8','gray.50','_movePivotId','sheets-pivot-ui.mobile.rowDesc','level','interval','isFinite','top','1,235','destination','sheets-pivot-ui.valueFilter.condition','sheets-pivot-ui.filter','getPivotTableCellData','_moveStartRange','onPointerEnter$','isArray','collectionChange$','univer-flex\x20univer-items-start\x20univer-gap-2\x20univer-text-sm','Quarter','startColumn','viewUpdate$','sheets-pivot-ui.showValuesAs.percentOfParentColumnTotal','autoEnd','Legacy','sheets-pivot-ui.config.rowSubtotalBottom','23:59:59','transform','boolean','setShapeProps','univer-min-w-0\x20univer-flex-1','equal','sheets-pivot-ui.dateFilter.from','addObjects','sheets-pivot-ui.showValuesAs.previous','isValue','subtotal','DROP','_initMoveRangeConfirmCheck','univer-ml-1\x20univer-flex\x20univer-size-5\x20univer-cursor-pointer\x20univer-items-center\x20univer-justify-center\x20univer-rounded-md\x20univer-transition-opacity\x20hover:univer-bg-gray-200\x20rtl:univer-ml-0\x20rtl:univer-mr-1\x20dark:hover:!univer-bg-gray-700','index','UNIVER_SHEET','sheets-pivot-ui.row','_sheetsPivotTableAdaptorModel','end','#8bc34a','percentRunningTotal','univer-size-8','_selectionRenderService','[data-univer-dnd-item=\x22true\x22]','sheets-pivot-ui.dateFilter.after','univer-text-sm\x20univer-font-medium','stroke','seconds','getAncestorScale','reduce','univer-flex\x20univer-flex-1\x20univer-items-center\x20univer-gap-3','svg','sheet.operation.set-pivot-manual-group','removeAlert','UNIVER_SHEET_PIVOT_MOBILE_ACTION_PANEL_ID','stringify','PivotMultipleValueId','body','general','_initRegisterCommand','sheets-pivot-ui.dateGroup.month','sheets-pivot-ui.dateGroup.groupBy','sheets-pivot-ui.moveToColumn','FromArray','_sheetsSelectionsService','dimension','5367IqZeBc','rowSubtotalPosition','_sidebarService','lineWidth','pivotParams','20px\x2024px\x200','sheets-pivot-ui.showValuesAs.title','bottom','supportsDateFilter','univer-rounded-xl\x20univer-p-2','sheets-pivot-ui.dialog.numfmt.fieldSetting','sheets-pivot-ui.config.pageDownThenOver','getInterceptPoints','unsubscribe','layout','includes','padStart','move','pbt','Panel','univer-text-center\x20univer-text-xs\x20univer-leading-4\x20univer-text-gray-600\x20dark:!univer-text-gray-200','itemTypes','\x22#,##0.00_);[Red](\x22','dragHandleProps','COLUMN','dateGroupContext','0px','createInstance','sheet.numfmt.currency','activeSheet$','sheets-pivot-ui.showValuesAs.percentDifferenceFrom','sheets-pivot-ui.mobile.delete','getTime','univer-min-h-0\x20univer-flex-1','sheets-pivot-ui.productName','sheets-pivot-ui.config.pageDirection','sheets-pivot-ui.dialog.filter.selectAll','sheets-pivot-ui.showValuesAs.next','resolve','menuItemFactory','univer-h-5\x20univer-text-sm\x20univer-text-red-400','menuPosition','valueBetween','register','getCellIndexByOffset','1,234.56','sheets-pivot-ui.dateFilter.rule','getColumnCount','start','_sheetsRenderService','dateNewerThan','sheets-pivot-ui.addToRow','_buttonShapes','univer-text-xs\x20univer-leading-4\x20univer-text-gray-600','sheets-pivot-ui.dateGroup.yearMonth','dateBetween','_configModel','clip','univer-text-base\x20univer-font-semibold','asObservable','UNIVER_SHEET_PIVOT_FILTER_PANEL','CustomFilter','targetFieldName','filter','sheets-pivot-ui.dateGroup.date','sheets-pivot-ui.multipleValue','sheets-pivot-ui.valueFilter.dialogTitle','baseItemMode','fields','univer-flex\x20univer-items-center\x20univer-justify-between','findIndex','MERGE_CELL_INTERCEPTOR_CHECK','valueFilter','sheets-pivot-ui.dateGroup.end','generateMutationsByRanges','univer-mb-1\x20univer-box-border\x20univer-h-7\x20univer-py-[5px]\x20univer-pl-[22px]\x20univer-pr-1\x20univer-text-sm\x20rtl:univer-pl-1\x20rtl:univer-pr-[22px]','sheets-pivot-ui.dialog.numfmt.dateDesc','showRowGrandTotal','length','rtl','sheets-pivot-ui.dateFilter.afterOrEqual','pointermove','selectionMoveEnd$','endColumn','sheets-pivot-ui.noMatchingFields','sheets-pivot-ui.config.totalsSection','sheets-pivot-ui.dialog.numfmt.thousandthPercentileDesc','HasFilter','UNIVER_SHEET_PIVOT_MANUAL_GROUP_DIALOG','univer-max-w-[66px]\x20univer-flex-1\x20univer-shrink-0\x20univer-truncate\x20univer-text-xs\x20univer-leading-4\x20univer-text-gray-800\x20dark:!univer-text-gray-100','removeObject','sheet.pivot.context-menu.manual-ungroup','button','univer-flex\x20univer-items-center\x20univer-justify-between\x20univer-gap-3\x20univer-text-sm','sheets-pivot-ui.varName','blank','_hovered','univer-h-8\x20univer-w-full','sheets-pivot-ui.sourceFieldTile','sheets-pivot-ui.config','sheets-pivot-ui.fieldPanel','sourceRange','pipe','_pivotSelectionMoveShape','\x22#,##0.00_);[Red]-\x22','watchPivotTableChanges','month','getMonth','hiddenFields','sheets-pivot-ui.dateGroup.hour','univer-flex\x20univer-flex-col\x20univer-gap-2\x20univer-text-sm','ERROR','M12.2982\x2012.4011C12.2981\x2012.0697\x2012.5667\x2011.8009\x2012.8982\x2011.8009L29.3929\x2011.8009C29.7242\x2011.8009\x2029.9928\x2012.0694\x2029.9929\x2012.4007L29.9992\x2027.9129C29.9996\x2029.0178\x2029.104\x2029.9137\x2027.9992\x2029.9137H12.905C12.5737\x2029.9137\x2012.3051\x2029.6452\x2012.305\x2029.314L12.2982\x2012.4011Z','univer-mt-5','getName','currentTarget','getCoordRelativeToViewport','average','univer-cursor-pointer\x20univer-text-xs\x20univer-text-primary-600','isBottom','#,##0.00_);-#,##0.00'];_0x2983=function(){return _0x339ae8;};return _0x2983();}function Vs(_0x263127){const _0x13eb9d=_0x1aaa99;let {className:_0x4cbfc7,unitId:_0x2a6a9a,subUnitId:_0x1a8f5f,pivotTableId:_0x3db234}=_0x263127,[_0x1c13e3,_0x4f1db2]=_0x18aa7d(0x0),_0x3b238d=_0x2140ff(_0x2129e8),_0x2cbbbd=_0x3b238d['getDirection']();return _0x81f19b(_0x13eb9d(0x3cc),{'className':_0x1d52fd(_0x13eb9d(0x183),_0x4cbfc7),'dir':_0x2cbbbd,'children':[_0x2a3146(_0x13f1d9,{'className':_0x13eb9d(0x111),'items':[{'label':_0x3b238d['t'](_0x13eb9d(0x499)),'value':0x0},{'label':_0x3b238d['t'](_0x13eb9d(0x324)),'value':0x1}],'value':_0x1c13e3,'onChange':_0x4f1db2}),_0x2a3146(_0x13eb9d(0x3cc),{'className':_0x1d52fd(_0x13eb9d(0x456),_0x1c13e3===0x0?_0x13eb9d(0x2dc):_0x13eb9d(0x1c2)),'children':_0x1c13e3===0x0?_0x2a3146(zs,{..._0x263127}):_0x2a3146(gs,{'unitId':_0x2a6a9a,'subUnitId':_0x1a8f5f,'pivotTableId':_0x3db234})})]});}function Hs(_0x17cd26){const _0x1200cc=_0x1aaa99;let {unitId:_0x5da551,subUnitId:_0x34057d,pivotTableId:_0x383ba6,tableFieldId:_0xda49fb,type:_0x161638}=_0x17cd26,_0x1fa9ea=JSON[_0x1200cc(0x42a)]([_0x5da551,_0x34057d,_0x383ba6,_0xda49fb,_0x161638]);return _0x2a3146(Us,{..._0x17cd26},_0x1fa9ea);}function Us({unitId:_0x1a2e72,subUnitId:_0x18bc2b,pivotTableId:_0x2a5868,tableFieldId:_0x23e2cc,type:_0x155491,baseItems:_0x415135,onConfirm:_0xffe85b,onCancel:_0x299bce}){const _0x58bd8=_0x1aaa99;var _0x42c092;let _0x17f8c0=_0x2140ff(_0x344ed3),_0x2d3f74=_0x2140ff(_0x2129e8),_0xb6646d=_0x362266(_0x2d3f74['direction$'],_0x2d3f74['getDirection']()),_0x2aab79=ci['find'](_0x40d590=>_0x40d590[_0x58bd8(0x155)]===_0x155491),_0xa36462=_0x17f8c0[_0x58bd8(0x2fa)](_0x1a2e72,_0x18bc2b,_0x2a5868),_0x220142=_0xa36462==null||(_0x42c092=_0xa36462[_0x58bd8(0x4e3)][_0x58bd8(0x2d3)][_0x23e2cc])==null?void 0x0:_0x42c092[_0x58bd8(0x22f)],_0xa53432=()=>{const _0x53900e=_0x58bd8;var _0x5701ae;if((_0x220142==null?void 0x0:_0x220142['type'])!==_0x155491||!_0x220142[_0x53900e(0x378)])return'';if(_0x220142[_0x53900e(0x1a9)]===_0x469ab7[_0x53900e(0x180)])return _0x53900e(0x2b0);if(_0x220142['baseItemType']===_0x469ab7[_0x53900e(0xf7)])return _0x53900e(0x31a);let _0x243d40=((_0x5701ae=_0x415135[_0x220142[_0x53900e(0x378)]])==null?void 0x0:_0x5701ae['items'][_0x53900e(0x1c3)](_0x220142[_0x53900e(0x256)]))??-0x1;return _0x243d40<0x0?'':_0x53900e(0x169)+_0x243d40;},[_0x28ad8a,_0x3c75dd]=_0x18aa7d((_0x220142==null?void 0x0:_0x220142[_0x58bd8(0x155)])===_0x155491?_0x220142[_0x58bd8(0x378)]:''),[_0x10d84a,_0x2c20c2]=_0x18aa7d(_0xa53432),_0x52641e=_0x25e96e(!0x1),[_0x3e9acc,_0x343635]=_0x18aa7d(!0x1),_0x1dc14b=_0x17f8c0[_0x58bd8(0x2fa)](_0x1a2e72,_0x18bc2b,_0x2a5868),_0x3fabf5=_0x17f8c0[_0x58bd8(0x1f1)](_0x1a2e72,_0x2a5868),_0xc8091=_0x1dc14b==null?void 0x0:_0x1dc14b[_0x58bd8(0x4e3)]['measure'][_0x23e2cc],_0x2fa2bc=!!(_0xc8091&&_0x3fabf5&&(_0x3fabf5[_0x58bd8(0x479)][_0xc8091[_0x58bd8(0x26a)]]||_0x3fabf5[_0x58bd8(0x280)][_0x58bd8(0x55a)](_0x3db0bd=>_0x3db0bd['id']===_0xc8091[_0x58bd8(0x26a)]))),_0xffa192=(_0x1dc14b&&_0x3fabf5&&_0x2aab79?ui(_0x1dc14b,_0x3fabf5,_0x2aab79):[])[_0x58bd8(0x474)](_0x38c4ff=>{const _0xf0e9e0=_0x58bd8;let _0x4c0484=_0x415135[_0x38c4ff];return(_0x2aab79==null?void 0x0:_0x2aab79['baseItemMode'])===_0xf0e9e0(0x557)||!!(_0x4c0484&&((_0x2aab79==null?void 0x0:_0x2aab79[_0xf0e9e0(0x478)])===_0xf0e9e0(0x3e4)||_0x4c0484['items'][_0xf0e9e0(0x483)]>0x0));}),_0x5380be=_0xffa192['map'](_0x5e0101=>({'label':_0x1dc14b[_0x58bd8(0x4e3)]['dimension'][_0x5e0101]['displayName'],'value':_0x5e0101})),_0x116fd8=_0x1dc14b==null?void 0x0:_0x1dc14b['fieldsConfig']['dimension'][_0x28ad8a],_0xe1318c=_0x116fd8&&_0x3fabf5&&(_0x3fabf5[_0x58bd8(0x479)][_0x116fd8[_0x58bd8(0x26a)]]??_0x3fabf5[_0x58bd8(0x280)]['find'](_0xa20c1e=>_0xa20c1e['id']===_0x116fd8[_0x58bd8(0x26a)])),_0x5f465a=_0x415135[_0x28ad8a],_0x348752=(_0x5f465a==null?void 0x0:_0x5f465a[_0x58bd8(0x14e)][_0x58bd8(0x15d)]((_0x487713,_0x43cac1)=>{const _0x2363ad=_0x58bd8;var _0x932d7a;let _0x51f42a=_0x5f465a[_0x2363ad(0x44a)][_0x43cac1],_0x466069=(_0x932d7a=_0x5f465a['itemLabels'])==null?void 0x0:_0x932d7a[_0x487713],_0x4cd431=ma(_0x487713,_0x51f42a),_0x4c4e58=_0x487713;return _0x4cd431?_0x4c4e58=_0x2d3f74['t'](_0x4cd431):_0x466069===void 0x0?_0x51f42a===_0xe427cd['other']?_0x4c4e58=_0x2d3f74['t'](_0x2363ad(0x368)):(_0x51f42a===_0xe427cd[_0x2363ad(0x33a)]||_0x51f42a===_0xe427cd['number'])&&_0x5f465a[_0x2363ad(0x4c5)]&&(_0x4c4e58=_0xd5638d['format'](_0x5f465a['format'],Number(_0x487713))):_0x4c4e58=_0x466069,{'label':_0x4c4e58,'value':_0x2363ad(0x169)+_0x43cac1,'itemKey':_0x487713};}))??[];(_0x2aab79==null?void 0x0:_0x2aab79[_0x58bd8(0x478)])===_0x58bd8(0x3e4)&&_0x348752[_0x58bd8(0x29b)]({'label':_0x2d3f74['t'](_0x58bd8(0x40f)),'value':'relative:previous','itemKey':'','itemType':_0x469ab7['previous']},{'label':_0x2d3f74['t'](_0x58bd8(0x45a)),'value':_0x58bd8(0x31a),'itemKey':'','itemType':_0x469ab7[_0x58bd8(0xf7)]});let _0x4b703f=_0x348752[_0x58bd8(0x55a)](_0x495772=>_0x495772[_0x58bd8(0xd6)]===_0x10d84a),_0x3ec464=!!(_0x2aab79!=null&&_0x2aab79[_0x58bd8(0x478)]&&_0x2aab79[_0x58bd8(0x478)]!=='none'),_0x41fe72=!!(_0x2aab79&&_0x1dc14b&&_0x3fabf5&&_0x2fa2bc&&_0x1dc14b[_0x58bd8(0x4e3)]['valueFields']['includes'](_0x23e2cc)&&_0xffa192['includes'](_0x28ad8a)&&_0xe1318c&&(!_0x3ec464||_0x4b703f));return _0x81f19b(_0x58bd8(0x3cc),{'dir':_0xb6646d,'children':[_0x81f19b(_0x58bd8(0x3cc),{'className':_0x58bd8(0x522),'children':[_0x2a3146(_0x58bd8(0x3cc),{'className':'univer-mb-2\x20univer-text-sm\x20univer-font-medium','children':_0x2d3f74['t'](_0x58bd8(0x2cc))}),_0x2a3146(_0x44fcce,{'className':_0x58bd8(0x4b1),'value':_0x28ad8a,'options':_0x5380be,'onChange':_0x39d4ae=>{_0x3c75dd(_0x39d4ae),_0x2c20c2('');}})]}),_0x3ec464&&_0x81f19b(_0x58bd8(0x3cc),{'className':_0x58bd8(0x522),'children':[_0x2a3146(_0x58bd8(0x3cc),{'className':_0x58bd8(0x173),'children':_0x2d3f74['t'](_0x58bd8(0x146))}),_0x2a3146(_0x44fcce,{'className':_0x58bd8(0x4b1),'value':_0x10d84a,'options':_0x348752,'disabled':!_0x28ad8a,'onChange':_0x2c20c2})]}),_0x81f19b(_0x58bd8(0x3cc),{'className':_0x58bd8(0x1b6),'children':[_0x2a3146(_0x38daeb,{'onClick':_0x299bce,'children':_0x2d3f74['t'](_0x58bd8(0x19a))}),_0x2a3146(_0x38daeb,{'variant':_0x58bd8(0xc5),'disabled':!_0x41fe72||_0x3e9acc,'onClick':async()=>{const _0x1842d8=_0x58bd8;let _0x2c082c=_0x17f8c0[_0x1842d8(0x2fa)](_0x1a2e72,_0x18bc2b,_0x2a5868),_0x11284a=_0x17f8c0['getCollection'](_0x1a2e72,_0x2a5868),_0x48f5ba=_0x2c082c==null?void 0x0:_0x2c082c[_0x1842d8(0x4e3)][_0x1842d8(0x2d3)][_0x23e2cc];if(!_0x2aab79||!_0x2c082c||!_0x11284a||!_0x48f5ba||_0x52641e[_0x1842d8(0x312)]||!_0x2c082c[_0x1842d8(0x4e3)][_0x1842d8(0x3c1)][_0x1842d8(0x444)](_0x23e2cc)||!(_0x11284a[_0x1842d8(0x479)][_0x48f5ba[_0x1842d8(0x26a)]]||_0x11284a[_0x1842d8(0x280)][_0x1842d8(0x55a)](_0x319012=>_0x319012['id']===_0x48f5ba[_0x1842d8(0x26a)]))||!ui(_0x2c082c,_0x11284a,_0x2aab79)['includes'](_0x28ad8a)||_0x3ec464&&!_0x4b703f)return;let _0x8037a9={'type':_0x155491,'baseFieldId':_0x28ad8a,'baseItem':(_0x4b703f==null?void 0x0:_0x4b703f[_0x1842d8(0x310)])??''};(_0x4b703f==null?void 0x0:_0x4b703f[_0x1842d8(0x52b)])!==void 0x0&&(_0x8037a9[_0x1842d8(0x1a9)]=_0x4b703f[_0x1842d8(0x52b)]),_0x52641e[_0x1842d8(0x312)]=!0x0,_0x343635(!0x0);try{await _0xffe85b(_0x8037a9);}catch{}finally{_0x52641e[_0x1842d8(0x312)]=!0x1,_0x343635(!0x1);}},'children':_0x2d3f74['t'](_0x58bd8(0x4c0))})]})]});}const Ws=_0x814322=>{let [_0x174fd2,_0x28c9f4]=_0x18aa7d(!0x1),_0x1414c9=_0x2140ff(_s);return _0x2c2735(()=>{const _0x5d447b=_0x14e6;_0x1414c9[_0x5d447b(0x148)](_0x174fd2);},[_0x174fd2,_0x1414c9]),_0x2a3146(_0x54e9eb,{..._0x814322,'onFocusChange':_0x493c36=>{var _0x280030;(_0x280030=_0x814322['onFocusChange'])==null||_0x280030['call'](_0x814322,_0x493c36),_0x28c9f4(_0x493c36);}});},Gs=(_0x25fcaf,_0x154675,_0x42b8b0,_0x7b952,_0x11a92a,_0x488d39)=>_0x2a3146(Ws,{'unitId':_0x25fcaf,'subUnitId':_0x154675,'initialValue':_0x7b952,'onChange':(_0x473ce2,_0x4ba01b)=>_0x42b8b0(_0x4ba01b),'maxRangeCount':0x1,'supportAcrossSheet':!0x0,'keepSheetReference':!0x0}),Ks=(_0x57125d,_0x58a636)=>{const _0x176794=_0x1aaa99;switch(_0x57125d){case 0x1:return _0x58a636['t'](_0x176794(0x27a));case 0x0:return _0x58a636['t']('sheets-pivot-ui.msg.emptySourceRange');default:return'';}};function qs(_0x39e5b3){const _0x46895e=_0x1aaa99;let {unitId:_0x2a500e,sourceRange:_0x56f3bf,positionRange:_0x60fc4c,sourceSheetName:_0x24af1c,positionSheetName:_0x2e8e27,onConfirm:_0x453825,onCancel:_0x668259}=_0x39e5b3,_0x46ae9b=_0x2140ff(_0x2129e8),_0x3a3378=_0x2140ff(_0x570eee),_0x42a7a4=_0x46ae9b['getDirection'](),_0x163883=_0x3a3378['getUnit'](_0x2a500e),_0x3fea65=_0x38d376(()=>_0x163883[_0x46895e(0x189)]()[_0x46895e(0x258)](),[_0x163883]),[_0x48eded,_0x4d08b2]=_0x18aa7d(_0x56f3bf),[_0x244ec1,_0x4b7b61]=_0x18aa7d(_0x60fc4c),[_0xce8f1e,_0x1fd129]=_0x18aa7d(_0x24af1c),[_0x45ed5e,_0x564d2c]=_0x18aa7d(_0x2e8e27),_0x1b1252=_0x25e96e(void 0x0),[_0x22f456,_0x214d68]=_0x18aa7d(),[_0x4b52d1,_0x2db4c6]=_0x18aa7d(_0x1e3671[_0x46895e(0x1a4)]),[_0x2431fa,_0xbbdc40]=_0x18aa7d(!0x0),[_0x4575f9,_0x48af61]=_0x18aa7d(!0x0),[_0x2165d9,_0x38b5c2]=_0x18aa7d(void 0x0);_0x2c2735(()=>{const _0x4408a5=_0x46895e;let _0x46eb32=va(_0x163883[_0x4408a5(0x357)](_0xce8f1e),_0x48eded);_0x48af61(_0x46eb32===0x2),_0x38b5c2(Ks(_0x46eb32,_0x46ae9b));},[_0x48eded,_0xce8f1e,_0x163883,_0x46ae9b]);let _0x369211=_0x33e552=>{const _0x464c18=_0x46895e;if(_0x33a7d7(_0xce8f1e,_0x48eded)===_0x33e552)return;let _0x4615cb=_0x33e552[_0x464c18(0x31b)](',')['filter'](_0x45b73f=>!!_0x45b73f)['map'](_0x1f4fb6);if(Array[_0x464c18(0x3fd)](_0x4615cb)&&_0x4615cb['length']>0x0){let {range:_0x51d1f9,sheetName:_0x5c57b5}=_0x4615cb[0x0];_0x4d08b2(_0x51d1f9),_0x1fd129(_0x5c57b5);}_0x4615cb[0x0]||_0x38b5c2(_0x46ae9b['t']('sheets-pivot-ui.msg.emptySourceRange'));},_0x4a9abd=Gs(_0x2a500e,_0x3fea65,_0x2dbd13=>{const _0x33431d=_0x46895e;if(_0x244ec1&&_0x33a7d7(_0x45ed5e,_0x244ec1)===_0x2dbd13)return;let _0x1c84fd=_0x2dbd13['split'](',')[_0x33431d(0x474)](_0x5cbfc9=>!!_0x5cbfc9)[_0x33431d(0x15d)](_0x1f4fb6);if(_0x1c84fd[_0x33431d(0x483)]===0x0){_0x4b7b61(null);return;}let _0x3b9829=_0x1c84fd[0x0];_0x4b7b61(_0x3b9829[_0x33431d(0x22e)]),_0x564d2c(_0x3b9829['sheetName']||_0x24af1c),_0x3b9829[_0x33431d(0x207)]===_0x24af1c&&_0x1ca723[_0x33431d(0x4c8)](_0x3b9829[_0x33431d(0x22e)],_0x48eded)?_0xbbdc40(!0x1):_0xbbdc40(!0x0);},_0x244ec1?_0x33a7d7(_0x45ed5e,_0x244ec1):'',!0x1,_0x22f456),_0x9098df=()=>!!(_0x48eded&&_0x244ec1&&_0xce8f1e&&_0x45ed5e&&_0x4b52d1===_0x1e3671[_0x46895e(0x360)]&&_0x2431fa&&_0x4575f9)||!!(_0x48eded&&_0xce8f1e&&_0x4b52d1===_0x1e3671[_0x46895e(0x1a4)]&&_0x4575f9);return _0x2c2735(()=>{const _0x44fdcc=_0x46895e;_0x214d68(_0x1b1252[_0x44fdcc(0x312)]);},[]),_0x81f19b(_0x46895e(0x3cc),{'ref':_0x1b1252,'dir':_0x42a7a4,'children':[_0x2a3146('div',{'className':_0x46895e(0x2be),'children':_0x46ae9b['t']('sheets-pivot-ui.dialog.source.sourceData')}),Gs(_0x2a500e,_0x3fea65,_0x369211,_0x33a7d7(_0xce8f1e,_0x48eded),!0x0,_0x22f456),_0x2165d9&&_0x2a3146(_0x46895e(0x3cc),{'className':_0x46895e(0x308),'children':_0x2165d9}),_0x2a3146(_0x46895e(0x3cc),{'className':_0x46895e(0x1bb),'children':_0x46ae9b['t']('sheets-pivot-ui.dialog.source.position')}),_0x81f19b(_0x5dfabf,{'value':_0x4b52d1,'onChange':_0x401a09=>_0x2db4c6(_0x401a09),'className':_0x46895e(0x120),'children':[_0x2a3146(_0x5996ee,{'value':_0x1e3671[_0x46895e(0x1a4)],'children':_0x46ae9b['t'](_0x46895e(0x340))}),_0x2a3146(_0x5996ee,{'value':_0x1e3671['Existing'],'children':_0x46ae9b['t']('sheets-pivot-ui.dialog.source.existingSheet')})]}),_0x4b52d1===_0x1e3671[_0x46895e(0x360)]&&_0x81f19b(_0x48361d,{'children':[_0x4a9abd,!_0x2431fa&&_0x2a3146(_0x46895e(0x4fb),{'className':_0x46895e(0x45d),'children':_0x46ae9b['t']('sheets-pivot-ui.dialog.source.intersect')})]}),_0x2a3146(_0x46895e(0x283),{'className':_0x46895e(0x4a6),'children':_0x81f19b(_0xae166f,{'className':_0x46895e(0x4f6),'children':[_0x2a3146(_0x38daeb,{'onClick':()=>_0x668259(),'children':_0x46ae9b['t'](_0x46895e(0x3eb))}),_0x2a3146(_0x38daeb,{'variant':_0x46895e(0xc5),'onClick':()=>{const _0x182119=_0x46895e;_0x9098df()&&(_0x4b52d1===_0x1e3671[_0x182119(0x360)]?_0x453825({'sourceRange':_0x48eded,'sourceSheetName':_0xce8f1e,'positionRange':_0x244ec1,'positionSheetName':_0x45ed5e,'positionType':_0x4b52d1}):_0x453825({'sourceRange':_0x48eded,'sourceSheetName':_0xce8f1e,'positionType':_0x4b52d1}));},'children':_0x46ae9b['t'](_0x46895e(0x299))})]})})]});}qs[_0x1aaa99(0x4c3)]=Rr;const Js=[{'id':_0x1aaa99(0x40c),'localeKey':_0x1aaa99(0x137),'operator':_0x137159[_0x1aaa99(0xe2)]},{'id':_0x1aaa99(0x2e4),'localeKey':_0x1aaa99(0x370),'operator':_0x137159[_0x1aaa99(0x2c2)]},{'id':_0x1aaa99(0x2aa),'localeKey':_0x1aaa99(0x243),'operator':_0x137159[_0x1aaa99(0x1c1)]},{'id':_0x1aaa99(0x373),'localeKey':'sheets-pivot-ui.valueFilter.greaterThanOrEqual','operator':_0x137159[_0x1aaa99(0x4ca)]},{'id':_0x1aaa99(0x23f),'localeKey':_0x1aaa99(0x126),'operator':_0x137159[_0x1aaa99(0x512)]},{'id':_0x1aaa99(0x526),'localeKey':_0x1aaa99(0x12f),'operator':_0x137159[_0x1aaa99(0x3a1)]},{'id':_0x1aaa99(0x110),'localeKey':_0x1aaa99(0x380),'operator':_0x137159[_0x1aaa99(0x45f)],'isBetween':!0x0},{'id':'notBetween','localeKey':'sheets-pivot-ui.valueFilter.notBetween','operator':_0x137159['valueNotBetween'],'isBetween':!0x0},{'id':_0x1aaa99(0x4ef),'localeKey':_0x1aaa99(0x544),'operator':_0x137159[_0x1aaa99(0x350)],'isCount':!0x0},{'id':'bottomCount','localeKey':_0x1aaa99(0x1db),'operator':_0x137159[_0x1aaa99(0x350)],'isBottom':!0x0,'isCount':!0x0},{'id':_0x1aaa99(0x12d),'localeKey':_0x1aaa99(0x1df),'operator':_0x137159['percent'],'isPercent':!0x0},{'id':_0x1aaa99(0x28f),'localeKey':_0x1aaa99(0x4bf),'operator':_0x137159[_0x1aaa99(0x2fd)],'isBottom':!0x0,'isPercent':!0x0}];function Ys({targetFieldId:_0x94a0c4,targetFieldName:_0x4e1451,valueFields:_0x26554d,defaultValueFieldId:_0x1d1d26,currentFilter:_0x34fe2c,onConfirm:_0x543750,onClear:_0x5ca7d0,onCancel:_0x28e440}){const _0x176419=_0x1aaa99;function _0x5833f2(_0x32f087){const _0x5ca722=_0x14e6;var _0xfc5cd7;return(_0x32f087==null?void 0x0:_0x32f087[_0x5ca722(0x3ec)])===_0x137159[_0x5ca722(0x350)]?_0x32f087[_0x5ca722(0x4ac)]?_0x5ca722(0x4bd):_0x5ca722(0x4ef):(_0x32f087==null?void 0x0:_0x32f087[_0x5ca722(0x3ec)])===_0x137159[_0x5ca722(0x2fd)]?_0x32f087[_0x5ca722(0x4ac)]?_0x5ca722(0x28f):_0x5ca722(0x12d):((_0xfc5cd7=Js['find'](_0x5a7dab=>_0x5a7dab[_0x5ca722(0x3ec)]===(_0x32f087==null?void 0x0:_0x32f087['operator'])))==null?void 0x0:_0xfc5cd7['id'])??_0x5ca722(0x2aa);}let _0x3971a7=_0x2140ff(_0x2129e8),_0x1743da=_0x362266(_0x3971a7[_0x176419(0x1ee)],_0x3971a7['getDirection']()),_0x33e436=_0x34fe2c==null?void 0x0:_0x34fe2c['expected'],[_0x16b088,_0x598fec]=_0x18aa7d(()=>{const _0x448885=_0x176419;let _0x251ebc=_0x34fe2c==null?void 0x0:_0x34fe2c['valueFieldId'];return _0x251ebc&&_0x26554d[_0x448885(0x156)](_0x28fe12=>_0x28fe12['id']===_0x251ebc)?_0x251ebc:_0x1d1d26&&_0x26554d[_0x448885(0x156)](_0x2fdfc1=>_0x2fdfc1['id']===_0x1d1d26)?_0x1d1d26:_0x26554d[_0x448885(0x483)]===0x1?_0x26554d[0x0]['id']:'';}),[_0x5a7a4e,_0x38ae00]=_0x18aa7d(()=>_0x5833f2(_0x34fe2c)),[_0x5bd9e6,_0x445987]=_0x18aa7d(()=>String(Array[_0x176419(0x3fd)](_0x33e436)?_0x33e436[0x0]:_0x33e436??0x0)),[_0x1250ab,_0x1bfd97]=_0x18aa7d(()=>String(Array[_0x176419(0x3fd)](_0x33e436)?_0x33e436[0x1]:0x0)),_0x5156f3=_0x25e96e(!0x1),[_0x32d17d,_0x3754d0]=_0x18aa7d(!0x1),_0x20e923=Js[_0x176419(0x55a)](_0x50da15=>_0x50da15['id']===_0x5a7a4e),_0x3ca1b9=_0x5bd9e6[_0x176419(0x311)]()!==''&&Number['isFinite'](Number(_0x5bd9e6)),_0x75853b=!_0x20e923[_0x176419(0x4e9)]||_0x1250ab[_0x176419(0x311)]()!==''&&Number[_0x176419(0x3f4)](Number(_0x1250ab)),_0x1e5e0a=!_0x20e923[_0x176419(0x3af)]||Number[_0x176419(0x3b2)](Number(_0x5bd9e6))&&Number(_0x5bd9e6)>=0x1,_0x2696a4=!_0x20e923[_0x176419(0x209)]||Number(_0x5bd9e6)>=0x0&&Number(_0x5bd9e6)<=0x64,_0x5cddfe=!!(_0x26554d[_0x176419(0x156)](_0x7cdec6=>_0x7cdec6['id']===_0x16b088)&&_0x3ca1b9&&_0x75853b&&_0x1e5e0a&&_0x2696a4),_0x1a5002=async _0xf73bd=>{const _0x41ede9=_0x176419;if(!_0x5156f3[_0x41ede9(0x312)]){_0x5156f3[_0x41ede9(0x312)]=!0x0,_0x3754d0(!0x0);try{await _0xf73bd();}catch{}finally{_0x5156f3[_0x41ede9(0x312)]=!0x1,_0x3754d0(!0x1);}}},_0x2abdfe=()=>_0x1a5002(async()=>{const _0x4075bb=_0x176419;if(!_0x5cddfe)return;let _0x3294f3={'operator':_0x20e923[_0x4075bb(0x3ec)],'expected':_0x20e923[_0x4075bb(0x4e9)]?[Number(_0x5bd9e6),Number(_0x1250ab)]:Number(_0x5bd9e6),'valueFieldId':_0x16b088};_0x20e923[_0x4075bb(0x4ac)]&&(_0x3294f3[_0x4075bb(0x4ac)]=!0x0),await _0x543750(_0x3294f3);}),_0x2485b2=()=>_0x1a5002(_0x5ca7d0);return _0x81f19b(_0x176419(0x3cc),{'className':'univer-flex\x20univer-flex-col\x20univer-gap-4','data-target-field-id':_0x94a0c4,'dir':_0x1743da,'children':[_0x2a3146(_0x176419(0x3cc),{'className':_0x176419(0x420),'children':_0x2a3146(_0x176419(0x4ed),{'dir':_0x176419(0x176),'children':_0x4e1451})}),_0x81f19b(_0x176419(0x517),{'className':_0x176419(0x4a3),'children':[_0x3971a7['t']('sheets-pivot-ui.valueFilter.valueField'),_0x2a3146(_0x44fcce,{'aria-label':_0x3971a7['t'](_0x176419(0x345)),'data-testid':'pivot-value-filter-value-field','value':_0x16b088,'options':[{'value':'','label':_0x3971a7['t'](_0x176419(0x1bd))},..._0x26554d[_0x176419(0x15d)](_0x14754a=>({'value':_0x14754a['id'],'label':_0x14754a[_0x176419(0x517)]}))],'onChange':_0x598fec})]}),_0x81f19b(_0x176419(0x517),{'className':_0x176419(0x4a3),'children':[_0x3971a7['t'](_0x176419(0x3f8)),_0x2a3146(_0x44fcce,{'aria-label':_0x3971a7['t']('sheets-pivot-ui.valueFilter.condition'),'data-testid':_0x176419(0x236),'value':_0x5a7a4e,'options':Js[_0x176419(0x15d)](_0x3d003e=>({'value':_0x3d003e['id'],'label':_0x3971a7['t'](_0x3d003e['localeKey'])})),'onChange':_0x317a96=>_0x38ae00(_0x317a96)})]}),_0x81f19b(_0x176419(0x3cc),{'className':_0x176419(0x14f),'children':[_0x2a3146(_0x1b81fe,{'aria-label':_0x3971a7['t'](_0x176419(0x3f8)),'aria-invalid':!_0x3ca1b9||!_0x1e5e0a||!_0x2696a4,'className':_0x176419(0x40b),'data-testid':_0x176419(0x4b0),'inputMode':'decimal','value':_0x5bd9e6,'onChange':_0x445987}),_0x20e923[_0x176419(0x4e9)]&&_0x2a3146(_0x1b81fe,{'aria-label':_0x3971a7['t']('sheets-pivot-ui.valueFilter.condition'),'aria-invalid':!_0x75853b,'className':_0x176419(0x40b),'data-testid':_0x176419(0x4b0),'inputMode':_0x176419(0x21d),'value':_0x1250ab,'onChange':_0x1bfd97})]}),_0x81f19b(_0x176419(0x3cc),{'className':_0x176419(0x2ae),'children':[_0x2a3146(_0x38daeb,{'data-testid':_0x176419(0x23b),'disabled':_0x32d17d,'onClick':_0x2485b2,'children':_0x3971a7['t']('sheets-pivot-ui.valueFilter.clear')}),_0x81f19b(_0x176419(0x3cc),{'className':_0x176419(0x32f),'children':[_0x2a3146(_0x38daeb,{'disabled':_0x32d17d,'onClick':_0x28e440,'children':_0x3971a7['t']('sheets-pivot-ui.valueFilter.cancel')}),_0x2a3146(_0x38daeb,{'data-testid':_0x176419(0x1d6),'variant':'primary','disabled':!_0x5cddfe||_0x32d17d,'onClick':_0x2abdfe,'children':_0x3971a7['t'](_0x176419(0x2db))})]})]})]});}function Xs(_0x3b881d){const _0x2bbd89=_0x1aaa99;let {pivotTableId:_0x338145,tableFieldId:_0x1657f8,closeFn:_0x1ef300,unitId:_0x2c1774,subUnitId:_0x4bb162,format:_0x166ae7,tableFieldInfo:_0x4a5281,dataFieldInfo:_0xf82f9e,version:_0x3d1dc8}=_0x3b881d,[_0x387e1d,_0x7db0e]=_0x18aa7d(_0x4a5281[_0x2bbd89(0x10a)]),[_0x465ec0,_0x23b173]=_0x18aa7d(_0x4a5281[_0x2bbd89(0x30f)]),_0x4b4848=_0x2140ff(_0x2129e8),_0x2e1c90=_0x2140ff(_0x12babc),_0xe8069=_0x2140ff(_0x4f85fa),_0x33ee1a={..._0x2140ff(_0x344ed3)[_0x2bbd89(0x52a)]()};for(let _0xe623ce of[_0x2bbd89(0x301),_0x2bbd89(0x3b4),_0x2bbd89(0x546),_0x2bbd89(0x26c),'sheets-pivot-ui.minName',_0x2bbd89(0x457),_0x2bbd89(0x385),_0x2bbd89(0x4ae),'sheets-pivot-ui.sumName',_0x2bbd89(0x493),_0x2bbd89(0x51b)])_0x33ee1a[_0xe623ce]=_0x4b4848['t'](_0xe623ce);if(_0x2c2735(()=>{const _0x58ec30=_0x2bbd89;_0x7db0e(_0x4a5281[_0x58ec30(0x10a)]),_0x23b173(_0x4a5281[_0x58ec30(0x30f)]);},[_0x3d1dc8]),!_0x4a5281||!_0xf82f9e)return;let _0x58ebed=_0xf82f9e[_0x2bbd89(0x372)],_0x2f872e=_0x4b4848['getDirection'](),_0x198931=_0x166ae7??_0x4a5281[_0x2bbd89(0x4c5)],_0x794759=Oa['map'](_0x3e445e=>({'value':''+_0x3e445e[_0x2bbd89(0x155)],'type':_0x3e445e['type'],'label':_0x4b4848['t'](_0x3e445e[_0x2bbd89(0x2d5)])})),_0x2ef392=_0x2cae85=>{const _0xb5ee7b=_0x2bbd89;let _0x35e95e=_0x2cae85;if(Array[_0xb5ee7b(0x3fd)](_0x2cae85)&&(_0x35e95e=_0x2cae85[0x0]),_0x35e95e!==void 0x0){let _0x1b72c4=Number(_0x35e95e);_0x23b173(_0x1b72c4),Ba(_0x58ebed,_0x387e1d,_0x33ee1a)&&_0x7db0e(Va(_0x58ebed,_0x33ee1a,_0x1b72c4));}};return _0x81f19b('div',{'dir':_0x2f872e,'children':[_0x81f19b(_0x2bbd89(0x3cc),{'className':_0x2bbd89(0x2e5),'children':[_0x2a3146('span',{'className':_0x2bbd89(0x102),'children':_0x4b4848['t'](_0x2bbd89(0x539))}),_0x2a3146(_0x2bbd89(0x4fb),{'className':_0x2bbd89(0x46a),'children':ha(_0x4b4848['t'](_0x2bbd89(0xdd)),_0x58ebed)})]}),_0x2a3146('div',{'children':_0x2a3146(_0x1b81fe,{'className':_0x2bbd89(0x13c),'value':_0x387e1d,'onChange':_0x39747f=>_0x7db0e(_0x39747f)})}),_0x2a3146(_0x2bbd89(0x517),{'className':_0x2bbd89(0x3c2),'children':_0x4b4848['t'](_0x2bbd89(0x36f))}),_0x2a3146(_0x2bbd89(0x3cc),{'className':_0x1d52fd(_0x2bbd89(0x27c),_0x4d03f3,_0x392444),'children':_0x794759[_0x2bbd89(0x15d)](_0x380ba2=>_0x81f19b(_0x2bbd89(0x3cc),{'className':_0x2bbd89(0x179),'onClick':()=>_0x2ef392(_0x380ba2[_0x2bbd89(0xd6)]),'children':[_0x2a3146(_0x2bbd89(0x4fb),{'className':_0x2bbd89(0xda),'children':_0x2a3146(_0x23dd1,{'className':_0x1d52fd({'univer-hidden':_0x465ec0!==_0x380ba2[_0x2bbd89(0x155)]})})}),_0x2a3146(_0x2bbd89(0x4fb),{'children':_0x380ba2[_0x2bbd89(0x517)]})]},_0x380ba2[_0x2bbd89(0x155)]))}),_0x2a3146(_0x2bbd89(0x283),{'className':_0x2bbd89(0x4a6),'children':_0x81f19b(_0xae166f,{'className':_0x2bbd89(0x363),'children':[_0x2a3146(_0x38daeb,{'className':_0x2bbd89(0x396),'onClick':()=>{const _0x4d8382=_0x2bbd89;let _0x294fbf={'id':Ar,'draggable':!0x0,'mask':!0x1,'maskClosable':!0x1,'width':0x190,'children':{'label':jr,'unitId':_0x2c1774,'subUnitId':_0x4bb162,'pivotTableId':_0x338145,'tableFieldId':_0x1657f8,'originPattern':_0x198931,'tableFieldInfo':_0x4a5281,'dataFieldInfo':_0xf82f9e},'dialogStyles':{'header':{'padding':_0x4d8382(0x43a),'height':0x0},'body':{'padding':_0x4d8382(0x2ad)}},'closable':!0x1,'onClose':()=>{const _0x4d1edf=_0x4d8382;_0xe8069[_0x4d1edf(0x2a3)](Ar);}};_0xe8069['open'](_0x294fbf);},'children':_0x4b4848['t'](_0x2bbd89(0x303))}),_0x81f19b(_0xae166f,{'className':_0x2bbd89(0x3da),'children':[_0x2a3146(_0x38daeb,{'onClick':()=>{_0x1ef300&&_0x1ef300();},'children':_0x4b4848['t'](_0x2bbd89(0x3eb))}),_0x2a3146(_0x38daeb,{'variant':_0x2bbd89(0xc5),'disabled':_0x387e1d==='','onClick':()=>{const _0x3c3180=_0x2bbd89;let _0x5f2ac1=_0x4a5281[_0x3c3180(0x10a)],_0x4cd270=_0x4a5281[_0x3c3180(0x30f)],_0x2fa413=_0x4a5281[_0x3c3180(0x4c5)],_0x85c38d=_0x5f2ac1===_0x387e1d?void 0x0:_0x387e1d,_0x4e71c9=_0x4cd270===_0x465ec0?void 0x0:_0x465ec0,_0x537a0e=_0x2fa413===_0x198931?void 0x0:_0x198931;if(_0x5f2ac1!==_0x387e1d||_0x4cd270!==_0x465ec0||_0x2fa413!==_0x537a0e){let _0x1ee348={'displayName':_0x85c38d,'subtotalType':_0x4e71c9,'format':_0x537a0e,'tableFieldId':_0x1657f8,'pivotTableId':_0x338145,'unitId':_0x2c1774,'subUnitId':_0x4bb162,'tableFieldInfo':_0x4a5281,'dataFieldInfo':_0xf82f9e};_0x2e1c90[_0x3c3180(0x4e2)](_0x2d9543['id'],_0x1ee348);}_0x1ef300&&_0x1ef300();},'children':_0x4b4848['t'](_0x2bbd89(0x299))})]})]})})]});}let Zs=class extends _0x239c25{constructor(_0x560387,_0x549b2e){const _0x251ee1=_0x1aaa99;super(),this[_0x251ee1(0x196)]=_0x560387,this[_0x251ee1(0xe8)]=_0x549b2e,this['_registerComponents'](),this['_registerIcons']();}[_0x1aaa99(0xe9)](){const _0x536436=_0x1aaa99;[[Rr,qs],[Tr,Vs],[Dr,ts],[kr,Xs],[jr,us],[Nr,Hs],[Pr,Ys],[Fr,Jo],[Ir,is],[Lr,ns]][_0x536436(0x2d7)](([_0x28cf17,_0xa2364a])=>{const _0x642a8a=_0x536436;this['disposeWithMe'](this[_0x642a8a(0x196)][_0x642a8a(0x460)](_0x28cf17,_0xa2364a));});}[_0x1aaa99(0x23d)](){const _0x138817=_0x1aaa99;this[_0x138817(0x320)](this[_0x138817(0xe8)][_0x138817(0x460)]({'PivotTableIcon':_0x3aa39e}));}};Zs=Q([Z(0x0,_0x446f3f(_0x2260a2)),Z(0x1,_0x446f3f(_0x3312ae))],Zs);let Qs=class extends _0x239c25{constructor(_0x25d8b1){const _0x2b1ae3=_0x1aaa99;super(),this[_0x2b1ae3(0x38a)]=_0x25d8b1,this[_0x2b1ae3(0x29a)]();}[_0x1aaa99(0x29a)](){const _0x44075a=_0x1aaa99;this[_0x44075a(0x38a)][_0x44075a(0x2c3)](Xi);}};Qs=Q([Z(0x0,_0x176317)],Qs);let $s=class extends _0x239c25{constructor(_0x170cbc,_0x2dc5d2,_0x3e15ae,_0x2ddb4f,_0xf963c4,_0x44fc76,_0x54c6b4,_0x1835c5,_0x1142db,_0x50cf81,_0xe91bfb){const _0x5df9f6=_0x1aaa99;super(),this[_0x5df9f6(0x388)]=_0x170cbc,this[_0x5df9f6(0xf3)]=_0x2dc5d2,this[_0x5df9f6(0x418)]=_0x3e15ae,this['_sheetSkeletonManagerService']=_0x2ddb4f,this[_0x5df9f6(0x2a0)]=_0xf963c4,this[_0x5df9f6(0x20a)]=_0x44fc76,this[_0x5df9f6(0x37e)]=_0x54c6b4,this[_0x5df9f6(0x4d3)]=_0x1835c5,this[_0x5df9f6(0x1f9)]=_0x1142db,this['_selectionsService']=_0x50cf81,this['_cellAlerts']=_0xe91bfb,X(this,_0x5df9f6(0x3c9),[]),this['_initButtonRender'](),this[_0x5df9f6(0x4fd)](),this['_initListener'](),this[_0x5df9f6(0x2d9)]();}[_0x1aaa99(0x2d9)](){const _0x1f2f0f=_0x1aaa99;let _0x35ff6f='SHEET_PIVOT_BLOCKED:'+this['_context'][_0x1f2f0f(0xf8)];this[_0x1f2f0f(0x320)](_0x2a5b68(this[_0x1f2f0f(0x238)][_0x1f2f0f(0x1fd)],this['_context']['unit']['activeSheet$'],this['_sheetsPivotTableAdaptorModel'][_0x1f2f0f(0x402)])[_0x1f2f0f(0x49b)](_0x1296c7(0x0))['subscribe'](()=>{const _0x4bad93=_0x1f2f0f;var _0x4b6fa7,_0x5ee192,_0x3fa6e3;let {unitId:_0x2d5edc,unit:_0x556e2b}=this[_0x4bad93(0x388)],_0x2d78f7=this[_0x4bad93(0x238)]['currentSelectionParam'],_0x35f184=(_0x4b6fa7=_0x556e2b[_0x4bad93(0x189)]())==null?void 0x0:_0x4b6fa7[_0x4bad93(0x258)](),_0x59015f=(_0x5ee192=this[_0x4bad93(0x238)][_0x4bad93(0x11c)]())==null||(_0x5ee192=_0x5ee192[_0x4bad93(0x1d1)](-0x1)[0x0])==null?void 0x0:_0x5ee192[_0x4bad93(0xc5)];if(!_0x35f184||!_0x59015f||(_0x2d78f7==null?void 0x0:_0x2d78f7[_0x4bad93(0xf8)])!==_0x2d5edc||_0x2d78f7[_0x4bad93(0x39c)]!==_0x35f184){this['_cellAlerts'][_0x4bad93(0x428)](_0x35ff6f);return;}let {actualRow:_0x5a2839,actualColumn:_0x324528}=_0x59015f,_0x229eba=this[_0x4bad93(0x418)],_0x396673=_0x229eba['getPivotTableIdByCell'](_0x2d5edc,_0x35f184,_0x5a2839,_0x324528),_0x4b4c91=_0x396673&&((_0x3fa6e3=_0x229eba[_0x4bad93(0x322)](_0x2d5edc,_0x35f184,_0x396673))==null?void 0x0:_0x3fa6e3[_0x4bad93(0x533)]);if(!_0x4b4c91){this['_cellAlerts'][_0x4bad93(0x428)](_0x35ff6f);return;}let _0x642b85=_0x4bad93(0x331);_0x4b4c91[_0x4bad93(0x327)]===_0x4bad93(0x52d)?_0x642b85=_0x4bad93(0x1f3):_0x4b4c91[_0x4bad93(0x327)]===_0x4bad93(0x165)&&(_0x642b85=_0x4bad93(0x1d3)),this['_cellAlerts'][_0x4bad93(0x34d)]({'key':_0x35ff6f,'type':_0x5380b8[_0x4bad93(0x4a4)],'title':this[_0x4bad93(0x1f9)]['t'](_0x4bad93(0x3c0)),'message':this['_localeService']['t'](_0x642b85,_0x4d3163(_0x4b4c91)),'location':{'unitId':_0x2d5edc,'subUnitId':_0x35f184,'row':_0x5a2839,'col':_0x324528},'width':0x104,'height':0x60});})),this[_0x1f2f0f(0x320)](()=>this[_0x1f2f0f(0x197)][_0x1f2f0f(0x428)](_0x35ff6f));}[_0x1aaa99(0x161)](){const _0x52edc6=_0x1aaa99;this['disposeWithMe'](_0x2a5b68(this[_0x52edc6(0x418)]['viewUpdate$'][_0x52edc6(0x49b)](_0x1296c7(0x0)),this[_0x52edc6(0x1e3)][_0x52edc6(0x2e3)],this[_0x52edc6(0x2a0)][_0x52edc6(0x4d9)],this[_0x52edc6(0x4d3)][_0x52edc6(0x2c8)][_0x52edc6(0x49b)](_0x1296c7(0x64)))[_0x52edc6(0x358)](()=>{const _0x59d9d1=_0x52edc6;if(!this['_context'][_0x59d9d1(0x32d)])return;let _0x3851bb=this[_0x59d9d1(0x388)][_0x59d9d1(0xf8)],_0x496821=this['_context'][_0x59d9d1(0x32d)]['getActiveSheet']()[_0x59d9d1(0x258)](),{scene:_0x4ce35d}=this[_0x59d9d1(0x388)],_0x19b2cc=this[_0x59d9d1(0x1f9)][_0x59d9d1(0x1d4)](),_0x462523=this[_0x59d9d1(0x1e3)]['getCurrentSkeleton']();if(!_0x462523)return;let _0x1fbaaa=this[_0x59d9d1(0x3c9)];_0x1fbaaa['forEach'](_0x55fee1=>_0x55fee1['dispose']()),_0x1fbaaa[_0x59d9d1(0x4fa)](0x0,_0x1fbaaa[_0x59d9d1(0x483)]),this[_0x59d9d1(0x418)][_0x59d9d1(0x317)](_0x3851bb,_0x496821)[_0x59d9d1(0x16c)]((_0x18da33,_0x55cdf2,_0x33fd9a)=>{const _0x127062=_0x59d9d1;if(_0x33fd9a!=null&&_0x33fd9a[_0x127062(0x447)]){let _0x1ccb72='sheets-pivot-button-'+_0x18da33+'-'+_0x55cdf2+'-'+_0x3851bb+'-'+_0x496821,{startX:_0x5eb12a,startY:_0x56e1cd,endX:_0x2a7fc0,endY:_0x58b20d}=_0x4b0ff3(_0x18da33,_0x55cdf2,_0x4ce35d,_0x462523),_0x5a320e=_0x2a7fc0-_0x5eb12a,_0x2ba6f2=_0x58b20d-_0x56e1cd;if(_0x2ba6f2<0x8||_0x5a320e<0x8||this[_0x127062(0x37e)][_0x127062(0x2ee)]({'workbookTypes':[_0x23a297],'worksheetTypes':[_0x5424ba,_0x4cb3a4,_0x20e8fc],'rangeTypes':[_0x4707cc,_0x27648a]},[{'startRow':_0x18da33,'endRow':_0x18da33,'startColumn':_0x55cdf2,'endColumn':_0x55cdf2}],_0x3851bb,_0x496821)===!0x1)return;let _0x149a82;if(Ao[_0x127062(0x36d)](_0x33fd9a[_0x127062(0x447)])){let {left:_0x119b71,top:_0xf73b63}=Po(_0x19b2cc,'filter',{'startX':_0x5eb12a,'startY':_0x56e1cd,'endX':_0x2a7fc0,'endY':_0x58b20d});_0x149a82={'left':_0x119b71,'top':_0xf73b63,'height':0x10,'width':0x10,'zIndex':0x1388,'cellWidth':_0x5a320e,'cellHeight':_0x2ba6f2,'pivotParams':{'col':_0x55cdf2,'row':_0x18da33,'unitId':_0x3851bb,'subUnitId':_0x496821,'buttonType':_0x33fd9a['pbt']}};}else{if(jo[_0x127062(0x36d)](_0x33fd9a['pbt'])){let {left:_0x1b7051,top:_0x1321b5}=Po(_0x19b2cc,_0x127062(0x205),{'startX':_0x5eb12a,'startY':_0x56e1cd,'endX':_0x2a7fc0,'endY':_0x58b20d});_0x149a82={'left':_0x1b7051,'top':_0x1321b5,'height':0x10,'width':0x10,'zIndex':0x1388,'cellWidth':_0x5a320e,'cellHeight':_0x2ba6f2,'pivotParams':{'col':_0x55cdf2,'row':_0x18da33,'unitId':_0x3851bb,'subUnitId':_0x496821,'buttonType':_0x33fd9a[_0x127062(0x447)]}};}else return;}let _0x3896fc=this[_0x127062(0xf3)][_0x127062(0x450)](Mo,_0x1ccb72,_0x149a82);_0x1fbaaa[_0x127062(0x29b)](_0x3896fc);}}),_0x1fbaaa[_0x59d9d1(0x483)]&&_0x4ce35d[_0x59d9d1(0x40e)](_0x1fbaaa),_0x4ce35d[_0x59d9d1(0x212)]();}));}[_0x1aaa99(0x4fd)](){const _0x519c25=_0x1aaa99;var _0x174217;this[_0x519c25(0x320)](this[_0x519c25(0x418)][_0x519c25(0x547)]['subscribe'](({unitId:_0x2af828,subUnitId:_0x2c71c8})=>{const _0x68b8=_0x519c25;if(_0x2af828===this[_0x68b8(0x388)][_0x68b8(0xf8)]&&(this['_sheetSkeletonManagerService'][_0x68b8(0x212)]({'sheetId':_0x2c71c8}),this[_0x68b8(0x388)][_0x68b8(0x32d)][_0x68b8(0x189)]()[_0x68b8(0x258)]()===_0x2c71c8)){var _0xb590e6;this[_0x68b8(0x1e3)]['reCalculate'](),(_0xb590e6=this['_context'][_0x68b8(0x35f)])==null||_0xb590e6['makeDirty']();}}));let _0x2780e5=this['_context'][_0x519c25(0xf8)];this['_context']['unit'][_0x519c25(0x2dd)]()[_0x519c25(0x2d7)](_0x464272=>{const _0x2624bb=_0x519c25;var _0x138ef1;let _0x244bd7=_0x464272['getSheetId']();(_0x138ef1=this['_sheetsPivotTableAdaptorModel'][_0x2624bb(0x2f3)](_0x2780e5,_0x244bd7))!=null&&_0x138ef1['size']&&this[_0x2624bb(0x1e3)]['makeDirty']({'sheetId':_0x244bd7});}),this['_sheetSkeletonManagerService'][_0x519c25(0x567)](),(_0x174217=this['_context']['mainComponent'])==null||_0x174217[_0x519c25(0x212)]();}[_0x1aaa99(0x3d8)](){const _0x1c0333=_0x1aaa99;let _0xd51273=new _0x5040df(),{spreadsheet:_0x5f2a95}=_0x26b66b(this[_0x1c0333(0x388)][_0x1c0333(0x32d)],this[_0x1c0333(0x388)]);_0xd51273[_0x1c0333(0x549)](_0x5f2a95[_0x1c0333(0x3bb)][_0x1c0333(0x556)](_0xc22482=>{const _0x2c37cf=_0x1c0333;if(_0xc22482['button']===0x2)return;let _0x48eba=this[_0x2c37cf(0x1e3)][_0x2c37cf(0x168)]();if(_0x48eba==null)return;let _0x210ed3=this[_0x2c37cf(0x388)][_0x2c37cf(0x1e7)],{row:_0x36d8cd,column:_0x2446a1}=_0x465121(_0xc22482[_0x2c37cf(0x281)],_0xc22482[_0x2c37cf(0x1a1)],_0x210ed3,_0x48eba);this[_0x2c37cf(0x20a)][_0x2c37cf(0x4e2)](_0xafefe6['id'],{'row':_0x36d8cd,'col':_0x2446a1});}));}};$s=Q([Z(0x1,_0x446f3f(_0x21b420)),Z(0x2,_0x446f3f(_0x131a27)),Z(0x3,_0x446f3f(_0x8f17eb)),Z(0x4,_0x446f3f(_0x344ed3)),Z(0x5,_0x446f3f(_0x12babc)),Z(0x6,_0x446f3f(_0x2f1427)),Z(0x7,_0x446f3f(_0x5f571f)),Z(0x8,_0x446f3f(_0x2129e8)),Z(0x9,_0x446f3f(_0x2f649b)),Z(0xa,_0x446f3f(_0x5bce73))],$s);var ec=class e extends _0x30f8db{constructor(_0x2d5ad1){const _0x3b4b20=_0x1aaa99;super(_0x3b4b20(0x1e5)),X(this,_0x3b4b20(0x21b),void 0x0),this[_0x3b4b20(0x21b)]=_0x2d5ad1;}[_0x1aaa99(0x3d1)](_0xbeb7b){const _0x1eb338=_0x1aaa99;this[_0x1eb338(0x4ff)]!==0x0&&this['height']!==0x0&&e[_0x1eb338(0x554)](_0xbeb7b,this);}static['drawWith'](_0x77f546,_0x54d701){const _0x550692=_0x1aaa99;let _0x368a80=_0x54d701[_0x550692(0x21b)];if(_0x77f546['save'](),_0x77f546[_0x550692(0x194)]=_0x550692(0x41a),_0x77f546[_0x550692(0x438)]=0x2,_0x368a80==='row'){let _0x4f66cf=_0x54d701[_0x550692(0x4ff)];if(!_0x4f66cf)return;_0x77f546[_0x550692(0x254)](),_0x77f546[_0x550692(0x33f)](0x0,0x0),_0x77f546[_0x550692(0x2e2)](0x0+_0x4f66cf,0x0),_0x77f546[_0x550692(0x33f)](0x0,-0xa),_0x77f546[_0x550692(0x2e2)](0x0,0xa),_0x77f546[_0x550692(0x33f)](0x0+_0x4f66cf,-0xa),_0x77f546[_0x550692(0x2e2)](0x0+_0x4f66cf,0xa);}else{let _0x23801d=_0x54d701[_0x550692(0x3ac)];if(!_0x23801d)return;_0x77f546[_0x550692(0x33f)](0x0,0x0),_0x77f546[_0x550692(0x2e2)](0x0,0x0+_0x23801d),_0x77f546[_0x550692(0x33f)](-0xa,0x0),_0x77f546[_0x550692(0x2e2)](0xa,0x0),_0x77f546[_0x550692(0x33f)](-0xa,0x0+_0x23801d),_0x77f546[_0x550692(0x2e2)](0xa,0x0+_0x23801d);}_0x77f546['stroke'](),_0x77f546[_0x550692(0x4e7)]();}};let tc=class extends _0x239c25{constructor(_0x50e38c,_0x4a7ef6,_0x5e4c67,_0x195e7a,_0x1d5fca,_0x15198e){const _0x35a632=_0x1aaa99;super(),this[_0x35a632(0x388)]=_0x50e38c,this[_0x35a632(0x418)]=_0x4a7ef6,this[_0x35a632(0x1e3)]=_0x5e4c67,this[_0x35a632(0x20a)]=_0x195e7a,this['_selectionRenderService']=_0x1d5fca,this[_0x35a632(0x433)]=_0x15198e,X(this,_0x35a632(0x49c),void 0x0),X(this,_0x35a632(0x2c5),void 0x0),X(this,_0x35a632(0x2a2),void 0x0),X(this,_0x35a632(0x10e),void 0x0),X(this,_0x35a632(0x3fb),void 0x0),X(this,_0x35a632(0x333),void 0x0),X(this,'_moveRowOrCol','row'),X(this,_0x35a632(0x3ab),void 0x0),X(this,_0x35a632(0x3f0),void 0x0),this[_0x35a632(0x117)]();}['_controlMoving'](_0x52d03a,_0x428c95){const _0x16c147=_0x1aaa99;let _0x55f258=this[_0x16c147(0x388)][_0x16c147(0x1e7)],_0x484b3a=_0x55f258[_0x16c147(0x319)](_0x4312a4[_0x16c147(0x432)]([_0x52d03a,_0x428c95])),{scaleX:_0x5dcb2e,scaleY:_0x2fe89e}=_0x55f258[_0x16c147(0x423)](),_0x355d11=this[_0x16c147(0x1e3)]['getCurrentSkeleton']();if(!_0x355d11||!this[_0x16c147(0x3fb)]||!this[_0x16c147(0x333)])return;let {row:_0x212623,column:_0x3b1175}=_0x355d11[_0x16c147(0x461)](_0x52d03a,_0x428c95,_0x5dcb2e,_0x2fe89e,_0x484b3a);if(this[_0x16c147(0x3e7)]==='row'){var _0x4abf9a;let _0x2e9761=0x0,_0x58212c=0x0,_0x7fa1bc=this[_0x16c147(0x3fb)]['endColumn']-this['_moveStartRange'][_0x16c147(0x401)]+0x1;if(this[_0x16c147(0x333)][_0x16c147(0x187)]===this['_moveStartRange'][_0x16c147(0x401)])_0x2e9761=_0x3b1175,_0x58212c=_0x3b1175+_0x7fa1bc-0x1;else{if(this[_0x16c147(0x333)][_0x16c147(0x187)]===this[_0x16c147(0x3fb)][_0x16c147(0x488)])_0x58212c=_0x3b1175,_0x2e9761=_0x3b1175-_0x7fa1bc+0x1;else{let _0x120162=this[_0x16c147(0x333)][_0x16c147(0x187)]-this[_0x16c147(0x3fb)][_0x16c147(0x401)];_0x2e9761=_0x3b1175-_0x120162,_0x58212c=_0x3b1175-_0x120162+_0x7fa1bc-0x1;}}let _0x593ff6=_0x355d11[_0x16c147(0x24e)](_0x212623,_0x2e9761),_0x23b23e=_0x355d11['getCellWithCoordByIndex'](_0x212623,_0x58212c),{startX:_0x2110a1,endY:_0x57474a}=_0x593ff6,{endX:_0x3b87e9}=_0x23b23e;this[_0x16c147(0x3ab)]={'startRow':_0x212623,'endRow':_0x212623,'startColumn':_0x2e9761,'endColumn':_0x58212c},(_0x4abf9a=this[_0x16c147(0x49c)])==null||_0x4abf9a[_0x16c147(0x25c)]({'left':_0x2110a1,'top':_0x57474a,'width':_0x3b87e9-_0x2110a1,'height':0x14});}else{var _0x22a375;let _0x381988=0x0,_0x46e2d1=0x0,_0x2a2475=this[_0x16c147(0x3fb)][_0x16c147(0x25a)]-this[_0x16c147(0x3fb)][_0x16c147(0x3a0)]+0x1;if(this[_0x16c147(0x333)][_0x16c147(0x220)]===this[_0x16c147(0x3fb)][_0x16c147(0x3a0)])_0x381988=_0x212623,_0x46e2d1=_0x212623+_0x2a2475-0x1;else{if(this[_0x16c147(0x333)][_0x16c147(0x220)]===this[_0x16c147(0x3fb)][_0x16c147(0x25a)])_0x46e2d1=_0x212623,_0x381988=_0x212623-_0x2a2475+0x1;else{let _0x18e8a5=this['_moveStartCellIndex'][_0x16c147(0x220)]-this[_0x16c147(0x3fb)][_0x16c147(0x3a0)];_0x381988=_0x212623-_0x18e8a5,_0x46e2d1=_0x212623-_0x18e8a5+_0x2a2475-0x1;}}let _0x3d9c80=_0x355d11[_0x16c147(0x24e)](_0x381988,_0x3b1175),_0x330f7c=_0x355d11['getCellWithCoordByIndex'](_0x46e2d1,_0x3b1175),{startX:_0xde2898,startY:_0x48aec7}=_0x3d9c80,{endY:_0x3a656b}=_0x330f7c;this[_0x16c147(0x3ab)]={'startColumn':_0x3b1175,'endColumn':_0x3b1175,'startRow':_0x381988,'endRow':_0x46e2d1},(_0x22a375=this[_0x16c147(0x49c)])==null||_0x22a375[_0x16c147(0x25c)]({'left':_0xde2898,'top':_0x48aec7,'width':0x14,'height':_0x3a656b-_0x48aec7});}}[_0x1aaa99(0xed)](_0xd86d0c){const _0x2b638a=_0x1aaa99;var _0x3f465a,_0x1663b1,_0x447614;(_0x3f465a=this[_0x2b638a(0x10e)])==null||_0x3f465a['setControlExtensionDisable'](!0x1),this[_0x2b638a(0x388)][_0x2b638a(0x1e7)][_0x2b638a(0x34b)](_0x73d6ca[_0x2b638a(0x1e4)]);let _0x2afeaa=this['_sheetsSelectionsService'][_0x2b638a(0x11c)]();if(!_0x2afeaa[_0x2b638a(0x483)]||_0x2afeaa[_0x2b638a(0x483)]>0x1)return;let _0x3b444b=_0x2afeaa[0x0][_0x2b638a(0x22e)],_0x552ae4=this['_context']['unit'],_0x9fa91=_0x552ae4[_0x2b638a(0x189)](),_0x2dcf46=_0x552ae4['getUnitId'](),_0x51c511=_0x9fa91[_0x2b638a(0x258)](),_0x1d3205=this[_0x2b638a(0x418)][_0x2b638a(0x2f3)](_0x2dcf46,_0x51c511);if(!(_0x1d3205!=null&&_0x1d3205['size']))return;let _0x438676=Array['from'](_0x1d3205)['find'](([_0x25e8e6,_0x37109a])=>{const _0x507553=_0x2b638a;let {rangesInfo:_0x349809}=_0x37109a;if(!_0x349809)return!0x1;let {rowRanges:_0x2bfd17,colRanges:_0x1407ee}=_0x349809,_0x212b5f=_0x2bfd17[0x0],_0x283176=_0x1407ee[0x0],_0xec0578=!0x1;return _0x212b5f&&(_0xec0578=_0x1ca723['realContain'](_0x212b5f,_0x3b444b),this[_0x507553(0x3e7)]=_0x507553(0x220)),!_0xec0578&&_0x283176&&(_0xec0578=_0x1ca723[_0x507553(0x25d)](_0x283176,_0x3b444b),this[_0x507553(0x3e7)]=_0x507553(0x252)),_0xec0578;});if(!_0x438676)return;this[_0x2b638a(0x3f0)]=_0x438676[0x0],this['_pivotSelectionMoveShape']||(this[_0x2b638a(0x49c)]=new ec(this[_0x2b638a(0x3e7)]),this[_0x2b638a(0x388)][_0x2b638a(0x1e7)][_0x2b638a(0x1e6)](this[_0x2b638a(0x49c)]));let _0x1c8333=this[_0x2b638a(0x388)][_0x2b638a(0x1e7)],_0x247bf6=this[_0x2b638a(0x1e3)][_0x2b638a(0x168)]();if(!_0x247bf6)return;let {offsetX:_0x5cda24,offsetY:_0xa4352e}=_0xd86d0c,_0x27dde1=_0x1c8333[_0x2b638a(0x4a9)](_0x4312a4['FromArray']([_0x5cda24,_0xa4352e])),{x:_0x4265f4,y:_0x448eb4}=_0x27dde1,_0x5b273a=_0x1c8333[_0x2b638a(0x319)](_0x27dde1),{scaleX:_0x5e320e,scaleY:_0x3cd6b8}=_0x1c8333['getAncestorScale'](),{row:_0x40cec3,column:_0x3ddec3}=_0x247bf6['getCellIndexByOffset'](_0x4265f4,_0x448eb4,_0x5e320e,_0x3cd6b8,_0x5b273a),_0x558756=(_0x1663b1=this[_0x2b638a(0x10e)])==null?void 0x0:_0x1663b1[_0x2b638a(0x2df)][_0x2b638a(0x2ca)]();if(this[_0x2b638a(0x3fb)]=_0x558756,!_0x558756)return;let _0x52fc24=0x0;_0x52fc24=_0x40cec3<_0x558756[_0x2b638a(0x3a0)]?_0x558756[_0x2b638a(0x3a0)]:_0x40cec3>_0x558756['endRow']?_0x558756['endRow']:_0x40cec3;let _0x4df742=0x0;_0x4df742=_0x3ddec3<_0x558756['startColumn']?_0x558756[_0x2b638a(0x401)]:_0x3ddec3>_0x558756[_0x2b638a(0x488)]?_0x558756['endColumn']:_0x3ddec3,this[_0x2b638a(0x333)]={'row':_0x52fc24,'column':_0x4df742},(_0x447614=this['_selectionControl'])==null||_0x447614[_0x2b638a(0x382)](!0x0),this[_0x2b638a(0x2c5)]=_0x1c8333[_0x2b638a(0x55f)][_0x2b638a(0x556)](_0x565fc2=>{const _0xe217a9=_0x2b638a;let {offsetX:_0x104fb2,offsetY:_0x3cb818}=_0x565fc2,{x:_0x14df53,y:_0x374e09}=_0x1c8333[_0xe217a9(0x4a9)](_0x4312a4[_0xe217a9(0x432)]([_0x104fb2,_0x3cb818]));this['_controlMoving'](_0x14df53,_0x374e09),_0x1c8333[_0xe217a9(0x34b)](_0x73d6ca[_0xe217a9(0x255)]);}),this[_0x2b638a(0x2a2)]=_0x1c8333[_0x2b638a(0x4c4)]['subscribeEvent'](_0x5c035b=>{const _0xefd86c=_0x2b638a;var _0x555752,_0x47d880,_0x339f40;(_0x555752=this[_0xefd86c(0x2c5)])==null||_0x555752['unsubscribe'](),this[_0xefd86c(0x2c5)]=null,(_0x47d880=this[_0xefd86c(0x10e)])==null||_0x47d880['setControlExtensionDisable'](!0x1),this[_0xefd86c(0x10e)]=null,_0x1c8333[_0xefd86c(0x34b)](_0x73d6ca[_0xefd86c(0x1e4)]),_0x1c8333[_0xefd86c(0x48f)](this['_pivotSelectionMoveShape']),this['_pivotSelectionMoveShape']=null,this[_0xefd86c(0x26b)](),(_0x339f40=this[_0xefd86c(0x2a2)])==null||_0x339f40[_0xefd86c(0x442)](),this[_0xefd86c(0x2a2)]=null;});}[_0x1aaa99(0x26b)](){const _0x29f678=_0x1aaa99;if(!this[_0x29f678(0x3fb)]||!this[_0x29f678(0x3ab)]||!this[_0x29f678(0x3f0)])return;let _0x4d3d55=this[_0x29f678(0x388)][_0x29f678(0x32d)][_0x29f678(0x10b)](),_0x13eabd=this[_0x29f678(0x388)]['unit']['getActiveSheet']()['getSheetId']();if(this[_0x29f678(0x3e7)]===_0x29f678(0x220)){var _0x54e670;let _0x46fde4=(_0x54e670=this[_0x29f678(0x418)]['getSubUnitPivotRenderCache'](_0x4d3d55,_0x13eabd))==null?void 0x0:_0x54e670[_0x29f678(0x210)](this[_0x29f678(0x3f0)]);if(!_0x46fde4)return;let _0x1cac4a=this['_sheetsPivotTableAdaptorModel'][_0x29f678(0x317)](_0x4d3d55,_0x13eabd);if(!_0x1cac4a)return;let _0x2f132a=[],_0x228db0='',{headerMap:_0x5726e4,rangesInfo:_0x2a5a3a}=_0x46fde4;for(let _0x29a69a=this['_moveStartRange'][_0x29f678(0x401)];_0x29a69a<=this['_moveStartRange']['endColumn'];_0x29a69a++){var _0x22320d;let _0x872c05=_0x5726e4==null||(_0x22320d=_0x5726e4['rowHeaderMap'])==null?void 0x0:_0x22320d[_0x29a69a];if(!_0x872c05)continue;_0x228db0=_0x872c05[_0x29f678(0x1b1)];let _0x1ad03d=_0x2a5a3a==null?void 0x0:_0x2a5a3a[_0x29f678(0x4b6)],_0x97588e=_0x1ad03d==null?void 0x0:_0x1ad03d[0x0];if(!_0x97588e)continue;let _0x26b294={..._0x97588e,'startColumn':_0x29a69a,'endColumn':_0x29a69a};for(let _0x44ec7d=_0x26b294['startRow'];_0x44ec7d<=_0x26b294['endRow'];_0x44ec7d++){let _0x1148ea=_0x1cac4a[_0x29f678(0x3d6)](_0x44ec7d,_0x29a69a);if(!_0x1148ea)continue;let {v:_0x224888,pbt:_0x237736}=_0x1148ea;_0x224888&&_0x237736!==_0x2f72a2[_0x29f678(0x248)]&&_0x237736!==_0x2f72a2[_0x29f678(0x3d2)]&&(typeof _0x224888==_0x29f678(0x53f)?_0x2f132a[_0x44ec7d]=_0x224888:typeof _0x224888==_0x29f678(0x4b4)&&(_0x2f132a[_0x44ec7d]=_0x224888['toString']()));}break;}if(!_0x228db0)return;let _0x55ec8b=this[_0x29f678(0x3fb)]['startRow'],_0x4d9286=this[_0x29f678(0x3fb)]['endRow']-this['_moveStartRange']['startRow']+0x1,_0x5e4e7a=this[_0x29f678(0x3ab)]['startRow'];if(_0x55ec8b<_0x5e4e7a){let _0x2d55cf=_0x2f132a[_0x29f678(0x4fa)](_0x55ec8b,_0x4d9286);_0x2f132a[_0x29f678(0x4fa)](_0x5e4e7a-_0x4d9286,0x0,..._0x2d55cf);}else{let _0x2c78c6=_0x2f132a['splice'](_0x55ec8b,_0x4d9286);_0x2f132a[_0x29f678(0x4fa)](_0x5e4e7a,0x0,..._0x2c78c6);}let _0x1a137d=_0x2f132a[_0x29f678(0x474)](_0x4c1e51=>_0x4c1e51!==void 0x0);this[_0x29f678(0x20a)][_0x29f678(0x4e2)](_0x213b5a['id'],{'unitId':_0x4d3d55,'subUnitId':_0x13eabd,'pivotTableId':this['_movePivotId'],'tableFieldId':_0x228db0,'info':{'type':_0x37cdcc[_0x29f678(0x2b9)],'customOrder':_0x1a137d}});}else{var _0x257bb0;let _0x2ce038=(_0x257bb0=this[_0x29f678(0x418)][_0x29f678(0x2f3)](_0x4d3d55,_0x13eabd))==null?void 0x0:_0x257bb0['get'](this['_movePivotId']);if(!_0x2ce038)return;let _0x584c07=this[_0x29f678(0x418)][_0x29f678(0x317)](_0x4d3d55,_0x13eabd);if(!_0x584c07)return;let _0x3bc3a1=[],_0x55fd78='',{headerMap:_0x359571,rangesInfo:_0x40e500}=_0x2ce038;for(let _0x5660af=this[_0x29f678(0x3fb)][_0x29f678(0x3a0)];_0x5660af<=this[_0x29f678(0x3fb)][_0x29f678(0x25a)];_0x5660af++){var _0x56633a;let _0x9e26db=_0x359571==null||(_0x56633a=_0x359571[_0x29f678(0x170)])==null?void 0x0:_0x56633a[_0x5660af];if(!_0x9e26db)continue;_0x55fd78=_0x9e26db[_0x29f678(0x1b1)];let _0x148edb=_0x40e500==null?void 0x0:_0x40e500[_0x29f678(0x53e)],_0x4feb52=_0x148edb==null?void 0x0:_0x148edb[0x0];if(!_0x4feb52)continue;let _0x3df3dc={..._0x4feb52,'startRow':_0x5660af,'endRow':_0x5660af};for(let _0x101e0b=_0x3df3dc[_0x29f678(0x401)];_0x101e0b<=_0x3df3dc[_0x29f678(0x488)];_0x101e0b++){let _0x489b0b=_0x584c07['getValue'](_0x5660af,_0x101e0b);if(!_0x489b0b)continue;let {v:_0x410d6c,pbt:_0x5bcd06}=_0x489b0b;if(_0x410d6c&&_0x5bcd06!==_0x2f72a2[_0x29f678(0x248)]&&_0x5bcd06!==_0x2f72a2[_0x29f678(0x3d2)]){if(typeof _0x410d6c==_0x29f678(0x53f)){let _0x39f688=_0x2ce038[_0x29f678(0x4e5)]?_0x394f2b(_0x2ce038['projection'],_0x101e0b):_0x101e0b;_0x3bc3a1[_0x39f688]=_0x410d6c;}else{if(typeof _0x410d6c==_0x29f678(0x4b4)){let _0xcb3162=_0x2ce038['projection']?_0x394f2b(_0x2ce038[_0x29f678(0x4e5)],_0x101e0b):_0x101e0b;_0x3bc3a1[_0xcb3162]=_0x410d6c[_0x29f678(0x11a)]();}}}}break;}if(!_0x55fd78)return;let _0x46910b=_0x2ce038[_0x29f678(0x4e5)]?_0xb0594(_0x2ce038[_0x29f678(0x4e5)],this['_moveStartRange']):this[_0x29f678(0x3fb)],_0x3eb07f=_0x2ce038[_0x29f678(0x4e5)]?_0xb0594(_0x2ce038[_0x29f678(0x4e5)],this[_0x29f678(0x3ab)]):this[_0x29f678(0x3ab)],_0x5b2ef5=_0x46910b[_0x29f678(0x401)],_0x33074b=this[_0x29f678(0x3fb)][_0x29f678(0x488)]-this[_0x29f678(0x3fb)][_0x29f678(0x401)]+0x1,_0x12b4a9=_0x3eb07f['startColumn'];if(_0x5b2ef5<_0x12b4a9){let _0x546c9d=_0x3bc3a1[_0x29f678(0x4fa)](_0x5b2ef5,_0x33074b);_0x3bc3a1[_0x29f678(0x4fa)](_0x12b4a9-_0x33074b,0x0,..._0x546c9d);}else{let _0xc96462=_0x3bc3a1['splice'](_0x5b2ef5,_0x33074b);_0x3bc3a1['splice'](_0x12b4a9,0x0,..._0xc96462);}let _0x942233=_0x3bc3a1[_0x29f678(0x474)](_0x527c12=>_0x527c12!==void 0x0);this[_0x29f678(0x20a)][_0x29f678(0x4e2)](_0x213b5a['id'],{'unitId':_0x4d3d55,'subUnitId':_0x13eabd,'pivotTableId':this['_movePivotId'],'tableFieldId':_0x55fd78,'info':{'type':_0x37cdcc['custom'],'customOrder':_0x942233}});}}[_0x1aaa99(0x117)](){const _0x5b39c7=_0x1aaa99;this[_0x5b39c7(0x320)](this[_0x5b39c7(0x433)][_0x5b39c7(0x487)][_0x5b39c7(0x358)](()=>{const _0x2020a9=_0x5b39c7;let _0x240c14=this[_0x2020a9(0x41d)][_0x2020a9(0x2d4)]();if(this[_0x2020a9(0x10e)]=_0x240c14[_0x240c14[_0x2020a9(0x483)]-0x1],this[_0x2020a9(0x10e)]&&this[_0x2020a9(0x10e)]['setControlExtensionDisable'](!0x1),!this[_0x2020a9(0x10e)])return;let {leftControl:_0x380684,rightControl:_0x1c5e95,topControl:_0x1f8b2f,bottomControl:_0x295269}=this[_0x2020a9(0x10e)];[_0x380684,_0x1c5e95,_0x1f8b2f,_0x295269][_0x2020a9(0x2d7)](_0x40868e=>{const _0x5c7374=_0x2020a9;_0x40868e[_0x5c7374(0x4ec)][_0x5c7374(0x556)](this[_0x5c7374(0xed)][_0x5c7374(0x223)](this));});}));}[_0x1aaa99(0x144)](){const _0x15a0b9=_0x1aaa99;var _0x19ecd2,_0x5d1394;(_0x19ecd2=this['_scenePointerMoveSubscribe'])==null||_0x19ecd2[_0x15a0b9(0x442)](),this[_0x15a0b9(0x2c5)]=null,(_0x5d1394=this[_0x15a0b9(0x2a2)])==null||_0x5d1394[_0x15a0b9(0x442)](),this[_0x15a0b9(0x2a2)]=null,this[_0x15a0b9(0x10e)]=null,this[_0x15a0b9(0x3fb)]=null,this[_0x15a0b9(0x333)]=null,this[_0x15a0b9(0x3ab)]=null,super['dispose']();}};tc=Q([Z(0x1,_0x446f3f(_0x131a27)),Z(0x2,_0x446f3f(_0x8f17eb)),Z(0x3,_0x446f3f(_0x12babc)),Z(0x4,_0x3236cb),Z(0x5,_0x446f3f(_0x2f649b))],tc);let nc=class extends _0x1b4002{constructor(_0x40d35d=ia,_0x2c13ee,_0x4f49b4,_0x3e77b5,_0x105018){const _0xde8d0e=_0x1aaa99;super(),this['_config']=_0x40d35d,this['_injector']=_0x2c13ee,this['_commandService']=_0x4f49b4,this[_0xde8d0e(0x3b6)]=_0x3e77b5,this[_0xde8d0e(0x50c)]=_0x105018;let {menu:_0x5a0d54,..._0x51fbe7}=_0x3cf2d5({},ia,this[_0xde8d0e(0x37a)]);_0x5a0d54&&this[_0xde8d0e(0x50c)][_0xde8d0e(0x166)](_0xde8d0e(0x338),_0x5a0d54,{'merge':!0x0}),this['_configService'][_0xde8d0e(0x166)](ra,_0x51fbe7),this[_0xde8d0e(0x42e)]();}[_0x1aaa99(0x2bc)](){const _0x27380c=_0x1aaa99;this[_0x27380c(0xf3)][_0x27380c(0x549)]([Zs]),this[_0x27380c(0xf3)][_0x27380c(0x210)](Zs),[[Qs],[Uo],[Ro],[_s],[Ho],[Bo],[Vo],[ca],[Io]][_0x27380c(0x2d7)](_0x35377b=>this['_injector'][_0x27380c(0x549)](_0x35377b)),this['_injector'][_0x27380c(0x210)](ca);}['onReady'](){const _0x544f1d=_0x1aaa99;this['_registerRenderModules'](),this[_0x544f1d(0xf3)][_0x544f1d(0x210)](Qs);}[_0x1aaa99(0x27d)](){const _0x49e570=_0x1aaa99;this['_injector'][_0x49e570(0x210)](Ro),this['_injector'][_0x49e570(0x210)](_s),this[_0x49e570(0xf3)][_0x49e570(0x210)](Ho),this[_0x49e570(0xf3)][_0x49e570(0x210)](Bo),this[_0x49e570(0xf3)][_0x49e570(0x210)](Vo),this[_0x49e570(0xf3)]['get'](Io);}[_0x1aaa99(0x366)](){const _0x4141aa=_0x1aaa99;this[_0x4141aa(0xf3)]['get'](Uo);}[_0x1aaa99(0x4ce)](){[[$s],[tc]]['forEach'](_0x171985=>{const _0x534469=_0x14e6;this[_0x534469(0x320)](this[_0x534469(0x3b6)][_0x534469(0x50b)](_0x36df91['UNIVER_SHEET'],_0x171985));});}[_0x1aaa99(0x42e)](){const _0x3c3661=_0x1aaa99;[na,Vr,$i,ea,Ur,qr,ti,ni,ri,si,li,vi]['forEach'](_0x41390a=>this[_0x3c3661(0x20a)][_0x3c3661(0x31c)](_0x41390a));}};X(nc,_0x1aaa99(0x4d2),_0x5cac9f+_0x1aaa99(0x523)),X(nc,'packageName',Zi),X(nc,_0x1aaa99(0x253),Qi),X(nc,_0x1aaa99(0x155),_0x36df91[_0x1aaa99(0x416)]),nc=Q([_0x112913(_0x3e6109,_0x574984,_0x32b53a,_0x542b42,_0x14caaf),Z(0x1,_0x446f3f(_0x21b420)),Z(0x2,_0x446f3f(_0x12babc)),Z(0x3,_0xf881cc),Z(0x4,_0xcc1513)],nc);export{ws as DragDropContext,Es as Draggable,Ts as Droppable,Vr as OpenPivotTableRangeSelectorPanelOperation,ds as PivotFilterOptions,ts as PivotFilterPanel,Xi as SheetsPivotTableUIMenuSchema,Wo as UniverSheetsPivotTableMobileUIPlugin,nc as UniverSheetsPivotTableUIPlugin};
1
+ import{GlobalConfig as e,PivotCellStyleTypeEnum as t,PivotDataFieldDataTypeEnum as n,PivotDataFieldSortOperatorEnum as r,PivotDataFieldTypeEnum as i,PivotDateGroupingMode as a,PivotExcelDateGroupUnit as o,PivotFilterTypeEnum as s,PivotLayoutTypeEnum as c,PivotShowAsBaseItemTypeEnum as l,PivotShowAsTypeEnum as u,PivotSubtotalPositionEnum as d,PivotSubtotalTypeEnum as f,PivotTableFiledAreaEnum as p,PivotTableValuePositionEnum as m,ST_PivotFilterOperatorEnum as h,compilePivotDateFilter as g,generateHexNumber as _,getPivotDateGroupingMode as v,hasPivotMultipleFilters as y,isDateGroupFieldJSON as b,isManualPivotFilter as x,isPivotDateFilter as S,isPivotTableFilterRestrictive as C,isValueFilterOperator as w}from"@univerjs-pro/engine-pivot";import{AddPivotFieldCommand as T,AddPivotTableCommand as E,InitializePivotRuntimeLocalMutation as D,MovePivotFieldCommand as O,PIVOT_DATE_GROUP_TYPES as ee,PIVOT_OPTION_FILTER_COORDINATION as te,PivotDisplayDataType as k,PivotDrillDownCommand as ne,PositionType as A,RemovePivotFieldCommand as re,RemovePivotTableCommand as ie,RemovePivotTableMutation as ae,SHEETS_PIVOT_PLUGIN_CONFIG_KEY as oe,SHEET_PIVOT_TABLE_PLUGIN as se,SetPivotCollapseCommand as ce,SetPivotDateFilterCommand as le,SetPivotDateGroupCommand as ue,SetPivotExcelDateGroupCommand as de,SetPivotFilterCommand as fe,SetPivotLayoutCommand as pe,SetPivotManualGroupsCommand as me,SetPivotNumberGroupCommand as he,SetPivotOptionCommand as ge,SetPivotSortCommand as _e,SetPivotValueFilterCommand as ve,SheetsPivotRPCService as ye,SheetsPivotTableAdaptorModel as j,SheetsPivotTableConfigModel as M,SheetsPivotTableService as be,UniverSheetsPivotTablePlugin as xe,UpdatePivotFieldSettingCommand as Se,UpdatePivotTableSourceRangeCommand as Ce,UpdatePivotValuePositionCommand as we,generateSetRangeValueMutations as Te,getPivotAppliedRanges as Ee,getPivotDateGroupContext as De,isPivotDateGroupTypeDisabled as Oe,isolateTextForBidiContext as ke,mapPivotSheetColumn as Ae,mapPivotSheetRange as je,resolvePivotSheetCell as Me,resolvePivotValueFieldId as Ne,resolvePivotValueFilterTarget as Pe,unionPivotViewRange as Fe}from"@univerjs-pro/sheets-pivot";import{CommandType as Ie,CustomCommandExecutionError as Le,DateSystem as Re,DependentOn as ze,Disposable as N,DisposableCollection as Be,FilterSelectionMode as Ve,ICommandService as P,IConfigService as He,IConfirmService as Ue,ILogService as We,IPermissionService as Ge,IUniverInstanceService as F,Inject as I,Injector as Ke,LocaleService as L,Optional as qe,Plugin as Je,RANGE_TYPE as Ye,RecordValueType as Xe,Rectangle as Ze,ThemeService as Qe,Tools as $e,UniverInstanceType as et,cellToRange as tt,currencySymbols as nt,debounce as rt,excelDateTimePartsToSerial as it,excelSerialToDateTimeParts as at,generateRandomId as ot,isPatternEqualWithoutDecimal as st,isValidRange as ct,merge as lt,numfmt as ut,toDisposable as dt,touchDependencies as ft}from"@univerjs/core";import{AddWorksheetMergeMutation as pt,InsertColCommand as mt,InsertRowCommand as ht,MergeCellController as gt,MoveRangeCommand as _t,RangeProtectionPermissionEditPoint as vt,RangeProtectionPermissionViewPoint as yt,RemoveColCommand as bt,RemoveRowCommand as xt,SheetInterceptorService as St,SheetPermissionCheckController as Ct,SheetsSelectionsService as wt,UniverSheetsPlugin as Tt,WorkbookEditablePermission as Et,WorksheetEditPermission as Dt,WorksheetFilterPermission as Ot,WorksheetPivotTablePermission as kt,WorksheetViewPermission as At,checkRangesEditablePermission as jt,expandToContinuousRange as Mt,getSheetCommandTarget as Nt,isSingleCellSelection as Pt}from"@univerjs/sheets";import{ComponentManager as Ft,ContextMenuGroup as It,ContextMenuPosition as Lt,IDialogService as R,IMenuManagerService as Rt,IMessageService as zt,ISidebarService as Bt,IconManager as Vt,MenuItemType as Ht,RibbonDataGroup as Ut,UniverMobileUIPlugin as Wt,getMenuHiddenObservable as Gt,useDependency as z,useObservable as B}from"@univerjs/ui";import{CellAlertManagerService as Kt,CellAlertType as qt,IFormatPainterService as Jt,ISheetClipboardService as Yt,ISheetSelectionRenderService as Xt,MOBILE_CONTEXT_MENU as Zt,SetCellEditVisibleOperation as Qt,SheetContextMenuMobileRenderController as $t,SheetPrintInterceptorService as en,SheetSkeletonManagerService as tn,SheetsRenderService as nn,UniverSheetsMobileUIPlugin as rn,UniverSheetsUIPlugin as an,getCoordByCell as on,getCoordByOffset as sn,getCurrentRangeDisable$ as cn,getObservableWithExclusiveRange$ as ln,getSheetObject as un}from"@univerjs/sheets-ui";import{EMPTY as dn,Subject as fn,auditTime as pn,concat as mn,debounceTime as hn,defer as gn,filter as _n,map as vn,merge as yn,of as bn,skip as xn,startWith as Sn,switchMap as Cn,takeUntil as wn,tap as Tn}from"rxjs";import{ActionRow as En,Button as V,Checkbox as H,DatePicker as Dn,Dropdown as On,Input as kn,InputNumber as An,MessageType as jn,MobileActionRow as Mn,MobileActionRowGroup as Nn,MobileDropdownMenu as Pn,MobileSelect as Fn,Radio as In,RadioGroup as Ln,Segmented as Rn,Select as zn,SelectList as Bn,TimeInput as Vn,Tooltip as Hn,borderClassName as Un,clsx as U,scrollbarClassName as Wn}from"@univerjs/design";import{UniverLicensePlugin as Gn}from"@univerjs-pro/license";import{CURSOR_TYPE as Kn,IRenderManagerService as qn,Rect as Jn,Shape as Yn,UniverRenderEnginePlugin as Xn,Vector2 as Zn}from"@univerjs/engine-render";import{ArrowLeftIcon as Qn,AscendingIcon as $n,CalendarIcon as er,CheckMarkIcon as tr,ColumnIcon as nr,DescendingIcon as rr,FilterIcon as ir,FunctionIcon as ar,GripVerticalIcon as or,MoreDownIcon as sr,MoreHorizontalIcon as cr,NumberIcon as lr,PivotTableIcon as ur,RowIcon as dr,SearchIcon as fr,TextIcon as pr}from"@univerjs/icons";import{Fragment as mr,jsx as W,jsxs as G}from"react/jsx-runtime";import{createContext as hr,useCallback as K,useContext as gr,useEffect as q,useMemo as _r,useRef as J,useState as Y}from"react";import{deserializeRangeWithSheet as vr,serializeRange as yr,serializeRangeWithSheet as br}from"@univerjs/engine-formula";import{MobileRangeSelector as xr,RangeSelector as Sr}from"@univerjs/sheets-formula-ui";import{InsertTextCommand as Cr}from"@univerjs/docs";import{IMEInputCommand as wr}from"@univerjs/docs-ui";const Tr=`UNIVER_SHEET_PIVOT_PANEL`,Er=`UNIVER_SHEET_PIVOT_PANEL_ID`,Dr=`UNIVER_SHEET_PIVOT_FILTER_PANEL`,Or=`UNIVER_SHEET_PIVOT_FILTER_PANEL_ID`,kr=`UNIVER_SHEET_PIVOT_FIELD_SETTING`,Ar=`UNIVER_SHEET_PIVOT_FIELD_SETTING_ID`,jr=`UNIVER_SHEET_PIVOT_FIELD_NUMFMT`,Mr=`UNIVER_SHEET_PIVOT_FIELD_NUMFMT_ID`,Nr=`UNIVER_SHEET_PIVOT_SHOW_DATA_AS_DIALOG`,Pr=`UNIVER_SHEET_PIVOT_VALUE_FILTER_DIALOG`,Fr=`UNIVER_SHEET_PIVOT_EXCEL_DATE_GROUP_DIALOG`,Ir=`UNIVER_SHEET_PIVOT_NUMBER_GROUP_DIALOG`,Lr=`UNIVER_SHEET_PIVOT_MANUAL_GROUP_DIALOG`,Rr=`univer.sheet.pivot-table-range-selector`,zr=`UNIVER_SHEET_PIVOT_MOBILE_ACTION_PANEL`,Br=`UNIVER_SHEET_PIVOT_MOBILE_ACTION_PANEL_ID`,Vr={type:Ie.OPERATION,id:`sheet.operation.open-pivot-table-range-selector-panel`,async handler(e){let t=e.get(F),n=e.get(P),r=Nt(t),i=e.get(L);if(!r)return!1;let{unitId:a,subUnitId:o,worksheet:s,workbook:c}=r,l=e.get(wt).getCurrentLastSelection(),u=(l==null?void 0:l.range)??{startRow:0,endRow:0,startColumn:0,endColumn:0,rangeType:Ye.NORMAL},d=await Hr(e,a,o,Pt(l)?Mt(u,{up:!0,left:!0,right:!0,down:!0},s):u,s.getName());if(!d)return!1;let f=c.getSheets().find(e=>e.getName()===d.sourceSheetName);if(!f)return!1;let p;if(d.positionType===A.New)p={row:0,col:0,unitId:a,subUnitId:ot(),sheetName:c.generateNewSheetName(`${i.t(`sheets-pivot-ui.sheet`)}`)};else{if(!d.positionRange||!d.positionSheetName)return!1;let e=c.getSheets().find(e=>e.getName()===d.positionSheetName);if(!e)return!1;p={row:d.positionRange.startRow,col:d.positionRange.startColumn,unitId:a,subUnitId:e.getSheetId(),sheetName:e.getName()}}let m=_(8);return await n.executeCommand(E.id,{pivotTableId:m,pivotTableConfig:{targetCellInfo:p,sourceRangeInfo:{range:d.sourceRange,unitId:a,sheetName:d.sourceSheetName,subUnitId:f.getSheetId()}},positionType:d.positionType})?{unitId:p.unitId,subUnitId:p.subUnitId,pivotTableId:m}:!1}};async function Hr(e,t,n,r,i){let a=e.get(R),o=e.get(L);return new Promise(e=>{let s,c={unitId:t,subUnitId:n,sourceRange:r,positionRange:null,sourceSheetName:i,positionSheetName:i,onConfirm:t=>{e(t),s==null||s.dispose()},onCancel:()=>{e(null),s==null||s.dispose()}};s=a.open({id:Rr,title:{title:o.t(`sheets-pivot-ui.dialog.source.insertPivotTable`)},draggable:!0,mask:!1,maskClosable:!1,children:{label:{name:Rr,props:c}},width:400,onClose:()=>{s.dispose()}})})}const Ur={type:Ie.OPERATION,id:`sheet.operation.set-pivot-date-group`,async handler(e,t){if(!t)return!1;let n=Wr(e);return n?e.get(P).executeCommand(ue.id,{unitId:n.unitId,subUnitId:n.subUnitId,pivotTableId:n.pivotTableId,tableFieldId:n.tableFieldId,dateType:t.dateType}):!1}};function Wr(e,t=a.Legacy){let n=e.get(F),r=Nt(n);if(!r)return;let i=e.get(wt).getCurrentLastSelection(),o=i==null?void 0:i.primary;if(!o)return;let{unitId:s,subUnitId:c}=r,l=o.startRow,u=o.startColumn,d=e.get(j).getPivotTableIdByCell(s,c,l,u);if(!d)return;let f=Gr(e,s,c,d,l,u);if(!f)return;let p=e.get(M),m=p.getPivotTableConfig(s,c,d);if(v(m==null?void 0:m.fieldsConfig.options)!==t)return;let h=p.getCollection(s,d),g=De(m==null?void 0:m.fieldsConfig,h,f);if(g)return{unitId:s,subUnitId:c,pivotTableId:d,tableFieldId:f,row:l,col:u,dateGroupContext:g}}function Gr(e,t,n,r,i,a){let o=e.get(j).getPivotItemRenderInfoCache(t,n,r);if(!o)return;let s=e.get(j).getPivotTableCellData(t,n,i,a),c=Me(i,a,s,o);return c==null?void 0:c.tableFieldId}function Kr(e){let t=Wr(e,a.ExcelLike);if(!t)return;let n=e.get(M),r=n.getPivotTableConfig(t.unitId,t.subUnitId,t.pivotTableId),i=r==null?void 0:r.fieldsConfig.dimension[t.tableFieldId];if(!i)return;let o=n.getCollection(t.unitId,t.pivotTableId),s=(t.dateGroupContext.area===p.Row?r.fieldsConfig.rowFields:r.fieldsConfig.columnFields).flatMap(e=>{let n=r.fieldsConfig.dimension[e],i=n?o==null?void 0:o.fields[n.dataFieldId]:void 0;return i&&b(i)&&i.originalFieldId===t.dateGroupContext.originalDataFieldId&&i.excelLike?[i.excelLike]:[]}),c=s[0],l=c?{units:s.map(e=>e.unit),autoStart:c.autoStart,autoEnd:c.autoEnd,...c.start===void 0?{}:{start:c.start},...c.end===void 0?{}:{end:c.end},...c.daysInterval===void 0?{}:{daysInterval:c.daysInterval}}:void 0;return{...t,targetFieldName:i.displayName,grouping:l}}const qr={id:`sheet.operation.set-pivot-excel-date-group`,type:Ie.OPERATION,async handler(e){let t=Kr(e);if(!t)return!1;let n=e.get(M),r=n.getPivotTableConfig(t.unitId,t.subUnitId,t.pivotTableId),i=n.getCollection(t.unitId,t.pivotTableId),a=e.get(R),o=e.get(L),s=e.get(F).getUnit(t.unitId),c=(s==null?void 0:s.getDateSystem())??Re.Date1900,l=null,u=!1,d=!1,f=()=>{u||(u=!0,l==null||l.dispose(),l=null)},p=async a=>{if(!(d||u)){d=!0;try{let o=Kr(e);if(!o||o.unitId!==t.unitId||o.subUnitId!==t.subUnitId||o.pivotTableId!==t.pivotTableId||o.tableFieldId!==t.tableFieldId||n.getPivotTableConfig(t.unitId,t.subUnitId,t.pivotTableId)!==r||n.getCollection(t.unitId,t.pivotTableId)!==i)return;await e.get(P).executeCommand(de.id,{unitId:t.unitId,subUnitId:t.subUnitId,pivotTableId:t.pivotTableId,tableFieldId:t.tableFieldId,grouping:{...a,units:a.units.concat()}})}catch{}finally{f()}}};try{l=a.open({id:`UNIVER_SHEET_PIVOT_EXCEL_DATE_GROUP_DIALOG_ID`,title:{title:o.t(`sheets-pivot-ui.dateGroup.excelLikeTitle`)},draggable:!0,mask:!0,maskClosable:!1,width:440,children:{label:{name:Fr,props:{targetFieldName:t.targetFieldName,dateSystem:c,grouping:t.grouping,onConfirm:p,onCancel:f}}},onClose:f})}catch{return f(),!1}return!0}};function Jr(e){return e.map(e=>({...e,members:e.members.map(e=>({...e}))}))}function Yr(t){let n;try{n=JSON.parse(t)}catch{return}if(!(!Array.isArray(n)||n.length<1||typeof n[0]!=`string`))return n[0]===Xe.Blank?e.BLANK_PLACEHOLDER:String(n[1])}function Xr(t,n){var r;let a=()=>({error:`invalidSelection`}),o=Nt(t.get(F)),s=t.get(wt).getCurrentSelections();if(!o||!s.length)return a();let{unitId:c,subUnitId:l}=o,u=s[0].primary;if(!u)return a();let d=t.get(j),f=d.getPivotTableIdByCell(c,l,u.startRow,u.startColumn),p=t.get(M),m=f&&p.getPivotTableConfig(c,l,f),h=f&&p.getCollection(c,f),g=f&&d.getPivotItemRenderInfoCache(c,l,f);if(!f||!m||!h||!g)return a();let _=Me(u.startRow,u.startColumn,d.getPivotTableCellData(c,l,u.startRow,u.startColumn),g),v=_==null?void 0:_.tableFieldId,y=v&&m.fieldsConfig.dimension[v];if(!v||!y||!(m.fieldsConfig.rowFields.includes(v)||m.fieldsConfig.columnFields.includes(v)))return a();let b=h.fields[y.dataFieldId];if(!b)return a();let x=b.dataFieldType===i.textGroupField?b:void 0;if(!x&&b.dataFieldType!==i.defaultNormalField)return a();let S=(x==null?void 0:x.originalFieldId)??b.id;if(((r=h.fields[S])==null?void 0:r.dataFieldType)!==i.defaultNormalField)return a();let C=Jr((x==null?void 0:x.grouping.groups)??[]),w=/* @__PURE__ */ new Map,T=/* @__PURE__ */ new Set,E=0;for(let t of s){let{startRow:n,endRow:r,startColumn:i,endColumn:o}=t.range;if(E+=(r-n+1)*(o-i+1),E>512)return a();for(let t=n;t<=r;t++)for(let n=i;n<=o;n++){if(d.getPivotTableIdByCell(c,l,t,n)!==f)return a();let r=Me(t,n,d.getPivotTableCellData(c,l,t,n),g),i=r==null?void 0:r.info;if(!r||r.area!==`rowRanges`&&r.area!==`colRanges`||r.tableFieldId!==v||!i||i.isValue||i.isSubtotal||i.isBottomTotal||i.isTopTotal||i.rowType&&i.rowType!==`item`||i.level<1)return a();let o=i.paths[i.level-1];if(o===void 0)return a();if(x){let e;try{e=JSON.parse(o)}catch{return a()}if(!Array.isArray(e)||e.length!==2||typeof e[1]!=`string`)return a();if(e[0]===`group`){if(!C.some(t=>t.id===e[1]))return a();T.add(e[1]);continue}if(e[0]!==`member`)return a();let t=Yr(e[1]);if(t===void 0)return a();w.set(e[1],{path:t,memberKey:e[1]})}else{var D;let r=(D=d.getPivotTableCellData(c,l,t,n))==null?void 0:D.v,i=r==null||r===``?e.BLANK_PLACEHOLDER:String(r);w.set(o,{path:i,tupleKey:o})}}}return n===`group`&&(w.size<2||T.size>0)||n!==`group`&&(w.size>0||T.size!==1)?a():{context:{unitId:c,subUnitId:l,pivotTableId:f,tableFieldId:v,sourceFieldId:S,targetFieldName:y.displayName,groups:C,memberPaths:Array.from(w.values()),selectedGroupId:Array.from(T)[0]}}}function Zr(e,t){return Xr(e,t).context}function Qr(e,t){e.get(zt).show({type:jn.Error,content:e.get(L).t(`sheets-pivot-ui.manualGroup.${t}`)})}function $r(e,t,n){let r=Zr(e,t);return!!r&&r.unitId===n.unitId&&r.subUnitId===n.subUnitId&&r.pivotTableId===n.pivotTableId&&r.tableFieldId===n.tableFieldId&&r.sourceFieldId===n.sourceFieldId&&r.selectedGroupId===n.selectedGroupId&&JSON.stringify(r.memberPaths)===JSON.stringify(n.memberPaths)&&JSON.stringify(r.groups)===JSON.stringify(n.groups)}async function ei(e,t){let n=Xr(e,t),r=n.context;if(!r)return Qr(e,n.error),!1;let i=e.get(M),a=i.getPivotTableConfig(r.unitId,r.subUnitId,r.pivotTableId),o=i.getCollection(r.unitId,r.pivotTableId),s=[];if(t===`group`){try{let t=(await e.get(ye).getPivotDisplayConfig({unitId:r.unitId,subUnitId:r.subUnitId,pivotTableId:r.pivotTableId,params:{type:k.ManualGroupMembers,manualGroupMembers:{sourceFieldId:r.sourceFieldId,paths:r.memberPaths}}})).result.manualGroupMembers;if(!t||t.error||t.members.length<2)return Qr(e,(t==null?void 0:t.error)??`invalidSelection`),!1;s=t.members}catch{return Qr(e,`invalidSelection`),!1}if(!$r(e,t,r)||i.getPivotTableConfig(r.unitId,r.subUnitId,r.pivotTableId)!==a||i.getCollection(r.unitId,r.pivotTableId)!==o)return!1}let c=e.get(R),l=e.get(L),u=r.groups.find(e=>e.id===r.selectedGroupId),d=(u==null?void 0:u.name)??l.t(`sheets-pivot-ui.manualGroup.defaultName`,String(r.groups.length+1));if(!u){let e=r.groups.length+1;for(;r.groups.some(e=>e.name===d);)e++,d=l.t(`sheets-pivot-ui.manualGroup.defaultName`,String(e))}let f=null,p=!1,m=!1,h=()=>{p||(p=!0,f==null||f.dispose(),f=null)},g=async n=>{if(m||p)return;let c=n.trim();if(!c||r.groups.some(e=>e.name===c&&e.id!==r.selectedGroupId))Qr(e,`invalidSelection`);else{m=!0;try{if(!$r(e,t,r)||i.getPivotTableConfig(r.unitId,r.subUnitId,r.pivotTableId)!==a||i.getCollection(r.unitId,r.pivotTableId)!==o)return;let n=t===`group`?r.groups.concat({id:ot(),name:c,members:s.map(e=>({...e}))}):r.groups.map(e=>e.id===r.selectedGroupId?{...e,name:c}:e);await e.get(P).executeCommand(me.id,{unitId:r.unitId,subUnitId:r.subUnitId,pivotTableId:r.pivotTableId,sourceFieldId:r.sourceFieldId,groups:n})}catch{}finally{h()}}};try{f=c.open({id:`UNIVER_SHEET_PIVOT_MANUAL_GROUP_DIALOG_ID`,title:{title:l.t(t===`group`?`sheets-pivot-ui.manualGroup.groupTitle`:`sheets-pivot-ui.manualGroup.renameTitle`)},draggable:!0,mask:!0,maskClosable:!1,width:400,children:{label:{name:Lr,props:{name:d,onConfirm:g,onCancel:h}}},onClose:h})}catch{return h(),!1}return!0}const ti={id:`sheet.operation.set-pivot-manual-group`,type:Ie.OPERATION,handler:e=>ei(e,`group`)},ni={id:`sheet.operation.rename-pivot-manual-group`,type:Ie.OPERATION,handler:e=>ei(e,`rename`)},ri={id:`sheet.operation.ungroup-pivot-manual-group`,type:Ie.OPERATION,async handler(e){let t=Xr(e,`ungroup`),n=t.context;if(!n)return Qr(e,t.error),!1;let r=e.get(M),i=r.getPivotTableConfig(n.unitId,n.subUnitId,n.pivotTableId),a=r.getCollection(n.unitId,n.pivotTableId);return!$r(e,`ungroup`,n)||r.getPivotTableConfig(n.unitId,n.subUnitId,n.pivotTableId)!==i||r.getCollection(n.unitId,n.pivotTableId)!==a?!1:e.get(P).executeCommand(me.id,{unitId:n.unitId,subUnitId:n.subUnitId,pivotTableId:n.pivotTableId,sourceFieldId:n.sourceFieldId,groups:n.groups.filter(e=>e.id!==n.selectedGroupId)})}};function ii(e){return typeof e.autoStart==`boolean`&&typeof e.autoEnd==`boolean`&&Number.isFinite(e.interval)&&e.interval>0&&(e.start===void 0||Number.isFinite(e.start))&&(e.end===void 0||Number.isFinite(e.end))&&(e.autoStart||e.start!==void 0)&&(e.autoEnd||e.end!==void 0)&&(e.start===void 0||e.end===void 0||e.start<=e.end)}function ai(e,t){if(e.dataFieldType===i.numberGroupField){let r=e,a=t.fields[r.originalFieldId];return!a||a.dataFieldType!==i.defaultNormalField||a.fieldDataType!==n.number?void 0:{sourceFieldId:r.originalFieldId,grouping:{...r.grouping}}}if(e.dataFieldType===i.defaultNormalField&&e.fieldDataType===n.number)return{sourceFieldId:e.id}}function oi(e){var t;let n=Nt(e.get(F)),r=(t=e.get(wt).getCurrentLastSelection())==null?void 0:t.primary;if(!n||!r)return;let{unitId:i,subUnitId:a}=n,o=r.startRow,s=r.startColumn,c=e.get(j),l=c.getPivotTableIdByCell(i,a,o,s);if(!l)return;let u=c.getPivotItemRenderInfoCache(i,a,l);if(!u)return;let d=Me(o,s,c.getPivotTableCellData(i,a,o,s),u),f=d==null?void 0:d.tableFieldId;if(!f||d.area!==`rowRanges`&&d.area!==`colRanges`)return;let p=e.get(M),m=p.getPivotTableConfig(i,a,l),h=p.getCollection(i,l),g=m==null?void 0:m.fieldsConfig.dimension[f];if(!g||!h||!(m.fieldsConfig.rowFields.includes(f)||m.fieldsConfig.columnFields.includes(f)))return;let _=h.fields[g.dataFieldId];if(!_)return;let v=ai(_,h);if(v)return{unitId:i,subUnitId:a,pivotTableId:l,tableFieldId:f,targetFieldName:g.displayName,...v}}const si={id:`sheet.operation.set-pivot-number-group`,type:Ie.OPERATION,async handler(e){let t=oi(e);if(!t)return!1;let n=e.get(M),r=n.getCollection(t.unitId,t.pivotTableId),i=n.getPivotTableConfig(t.unitId,t.subUnitId,t.pivotTableId),a=e.get(F),o=()=>{let n=oi(e);return!!n&&n.unitId===t.unitId&&n.subUnitId===t.subUnitId&&n.pivotTableId===t.pivotTableId&&n.tableFieldId===t.tableFieldId&&n.sourceFieldId===t.sourceFieldId&&JSON.stringify(n.grouping)===JSON.stringify(t.grouping)},s=e.get(R),c=e.get(L),l=null,u=!1,d=!1,f=new fn,p=async()=>{if(!u&&o())try{let n=(await e.get(ye).getPivotDisplayConfig({unitId:t.unitId,subUnitId:t.subUnitId,pivotTableId:t.pivotTableId,params:{type:k.NumberGroupDefaults,numberGroupDefaults:{tableFieldId:t.tableFieldId}}})).result.numberGroupDefaults;return!u&&o()&&n&&ii(n)?n:void 0}catch{return}},m=()=>{u||(u=!0,f.next(),f.complete(),l==null||l.dispose(),l=null)},h=await p();if(!h)return m(),!1;let g=a.unitDisposed$.pipe(_n(e=>e.getUnitId()===t.unitId),Tn(m)),_=gn(()=>{if(u||!a.getUnit(t.unitId))return m(),dn;let e=n.watchPivotTableChanges(t.unitId,t.subUnitId,t.pivotTableId).pipe(hn(0),vn(()=>void 0));return yn(bn(h),e).pipe(Cn(e=>e&&n.getCollection(t.unitId,t.pivotTableId)===r&&n.getPivotTableConfig(t.unitId,t.subUnitId,t.pivotTableId)===i?bn(e):mn(bn(void 0),p())),wn(yn(f,g)))}),v=async n=>{if(!(d||u)){d=!0;try{if(!ii(n)||!o())return;await e.get(P).executeCommand(he.id,{unitId:t.unitId,subUnitId:t.subUnitId,pivotTableId:t.pivotTableId,tableFieldId:t.tableFieldId,grouping:{...n}})}catch{}finally{m()}}};try{l=s.open({id:`UNIVER_SHEET_PIVOT_NUMBER_GROUP_DIALOG_ID`,title:{title:c.t(`sheets-pivot-ui.numberGroup.title`)},draggable:!0,mask:!0,maskClosable:!1,width:400,children:{label:{name:Ir,props:{targetFieldName:t.targetFieldName,grouping:t.grouping,defaults$:_,onConfirm:v,onCancel:m}}},onClose:m})}catch{return m(),!1}return!0}},ci=[{type:u.normal,localeKey:`sheets-pivot-ui.showValuesAs.normal`,requiresParameters:!1,baseItemMode:`none`},{type:u.percentOfGrandTotal,localeKey:`sheets-pivot-ui.showValuesAs.percentOfGrandTotal`,requiresParameters:!1,baseItemMode:`none`},{type:u.percentOfRowTotal,localeKey:`sheets-pivot-ui.showValuesAs.percentOfRowTotal`,requiresParameters:!1,baseItemMode:`none`},{type:u.percentOfColumnTotal,localeKey:`sheets-pivot-ui.showValuesAs.percentOfColumnTotal`,requiresParameters:!1,baseItemMode:`none`},{type:u.percentOfParentRowTotal,localeKey:`sheets-pivot-ui.showValuesAs.percentOfParentRowTotal`,requiresParameters:!1,baseItemMode:`none`},{type:u.percentOfParentColumnTotal,localeKey:`sheets-pivot-ui.showValuesAs.percentOfParentColumnTotal`,requiresParameters:!1,baseItemMode:`none`},{type:u.index,localeKey:`sheets-pivot-ui.showValuesAs.index`,requiresParameters:!1,baseItemMode:`none`},{type:u.percentOfParent,localeKey:`sheets-pivot-ui.showValuesAs.percentOfParent`,requiresParameters:!0,baseItemMode:`none`,parentFieldOnly:!0},{type:u.percentOf,localeKey:`sheets-pivot-ui.showValuesAs.percentOf`,requiresParameters:!0,baseItemMode:`item`},{type:u.differenceFrom,localeKey:`sheets-pivot-ui.showValuesAs.differenceFrom`,requiresParameters:!0,baseItemMode:`item-or-relative`},{type:u.percentDifferenceFrom,localeKey:`sheets-pivot-ui.showValuesAs.percentDifferenceFrom`,requiresParameters:!0,baseItemMode:`item-or-relative`},{type:u.runningTotal,localeKey:`sheets-pivot-ui.showValuesAs.runningTotal`,requiresParameters:!0,baseItemMode:`none`},{type:u.percentRunningTotal,localeKey:`sheets-pivot-ui.showValuesAs.percentRunningTotal`,requiresParameters:!0,baseItemMode:`none`},{type:u.rankAscending,localeKey:`sheets-pivot-ui.showValuesAs.rankAscending`,requiresParameters:!0,baseItemMode:`none`},{type:u.rankDescending,localeKey:`sheets-pivot-ui.showValuesAs.rankDescending`,requiresParameters:!0,baseItemMode:`none`}],li={type:Ie.OPERATION,id:`sheet.operation.set-pivot-show-data-as`,async handler(e,t){let n=t&&ci.find(e=>e.type===t.type);if(!n)return!1;let r=di(e);if(!r)return!1;if(!n.requiresParameters)return e.get(P).executeCommand(Se.id,{unitId:r.unitId,subUnitId:r.subUnitId,pivotTableId:r.pivotTableId,tableFieldId:r.tableFieldId,showDataAs:{type:n.type,baseFieldId:``,baseItem:``},tableFieldInfo:r.tableFieldInfo,dataFieldInfo:r.dataFieldInfo});let i=fi(e,r);if(!i)return!1;let a=ui(i.config,i.collection,n);if(a.length===0)return!1;let o={};if(n.baseItemMode!==`none`){try{o=await pi(e,i.config,r.pivotTableId,a)}catch{return!1}if(!a.some(e=>o[e]&&(n.baseItemMode===`item-or-relative`||o[e].items.length>0)))return!1}let s=e.get(R),c=e.get(L),l=null,u=!1,d=!1,f=()=>{u||(u=!0,l==null||l.dispose(),l=null)};try{l=s.open({id:`UNIVER_SHEET_PIVOT_SHOW_DATA_AS_DIALOG_ID`,title:{title:c.t(`sheets-pivot-ui.showValuesAs.dialogTitle`)},draggable:!0,mask:!0,maskClosable:!1,width:400,children:{label:{name:Nr,props:{unitId:r.unitId,subUnitId:r.subUnitId,pivotTableId:r.pivotTableId,tableFieldId:r.tableFieldId,type:n.type,baseItems:o,onCancel:f,onConfirm:async t=>{if(!d){d=!0;try{let a=fi(e,r);if(!a||!mi(a.config,a.collection,n,t))return;if(n.baseItemMode!==`none`&&t.baseItemType===void 0){var i;if(!((i=(await pi(e,a.config,a.context.pivotTableId,[t.baseFieldId]))[t.baseFieldId])!=null&&i.items.includes(t.baseItem)))return}await e.get(P).executeCommand(Se.id,{unitId:a.context.unitId,subUnitId:a.context.subUnitId,pivotTableId:a.context.pivotTableId,tableFieldId:a.context.tableFieldId,showDataAs:t,tableFieldInfo:a.context.tableFieldInfo,dataFieldInfo:a.context.dataFieldInfo})}catch{}finally{f()}}}}}},onClose:f})}catch{return f(),!1}return!0}};function ui(e,t,n){let{rowFields:r,columnFields:i,dimension:a}=e.fieldsConfig;return(n.parentFieldOnly?[...r.slice(0,-1),...i.slice(0,-1)]:[...r,...i]).filter(e=>{let n=a[e];return!!(n&&(t.fields[n.dataFieldId]||t.customFields.find(e=>e.id===n.dataFieldId)))})}function di(e){var t,n;let r=Nt(e.get(F)),i=(t=e.get(wt).getCurrentLastSelection())==null?void 0:t.primary;if(!r||!i)return;let{unitId:a,subUnitId:o}=r,s=i.startRow,c=i.startColumn,l=e.get(j),u=l.getPivotTableIdByCell(a,o,s,c);if(!u)return;let d=e.get(M).getPivotTableConfig(a,o,u),f=l.getPivotItemRenderInfoCache(a,o,u),p=l.getPivotTableCellData(a,o,s,c);if(!d||!f)return;let m=Me(s,c,p,f);if(!m)return;let h=Ne(m,d.fieldsConfig.valueFields);if(h)return(n=fi(e,{unitId:a,subUnitId:o,pivotTableId:u,tableFieldId:h}))==null?void 0:n.context}function fi(e,t){let{unitId:n,subUnitId:r,pivotTableId:i,tableFieldId:a}=t,o=e.get(M),s=o.getPivotTableConfig(n,r,i),c=o.getCollection(n,i),l=s==null?void 0:s.fieldsConfig.measure[a];if(!s||!c||!l||!s.fieldsConfig.valueFields.includes(l.id))return;let u=c.fields[l.dataFieldId]??c.customFields.find(e=>e.id===l.dataFieldId);if(!u)return;let d={...l.showDataAs};return{config:s,collection:c,context:{unitId:n,subUnitId:r,pivotTableId:i,tableFieldId:l.id,currentShowDataAs:d,tableFieldInfo:{tableFieldId:l.id,displayName:l.displayName,dataFieldId:l.dataFieldId,format:l.format,subTotalType:l.subtotal,showDataAs:{...d}},dataFieldInfo:{id:u.id,dataFieldId:u.id,name:u.name,type:u.fieldDataType,checked:!0,pivotTableId:i}}}}async function pi(e,t,n,r){let{unitId:i,subUnitId:a}=t.targetCellInfo,o=t.targetCellInfo,s=e.get(j).getPivotItemRenderInfoCache(i,a,n);if(!s)throw Error(`[sheets-pivot-ui]: Pivot render cache is unavailable`);return(await Promise.all(r.map(async t=>{try{return[t,(await e.get(ye).getPivotDisplayConfig({unitId:i,subUnitId:a,pivotTableId:n,params:{type:k.Filter,filter:{row:o.row,col:o.col,tableFieldId:t,pivotItemRenderInfoCache:s}}})).result.filter]}catch{return[t,void 0]}}))).reduce((e,[t,n])=>(n&&(e[t]={items:n.items,itemTypes:n.itemTypes,...n.itemLabels?{itemLabels:n.itemLabels}:{},format:n.format}),e),{})}function mi(e,t,n,r){return r.type!==n.type||!ui(e,t,n).includes(r.baseFieldId)?!1:n.baseItemMode===`none`?r.baseItem===``&&r.baseItemType===void 0:r.baseItemType===void 0?r.baseItem!==``:n.baseItemMode===`item-or-relative`&&r.baseItem===``&&(r.baseItemType===l.previous||r.baseItemType===l.next)}function hi(e){return{...e,expected:Array.isArray(e.expected)?e.expected.concat():e.expected}}function gi(e,t){let n=e.get(M).getPivotTableConfig(t.unitId,t.subUnitId,t.pivotTableId);if(n&&n.fieldsConfig.dimension[t.targetFieldId]&&(n.fieldsConfig.rowFields.includes(t.targetFieldId)||n.fieldsConfig.columnFields.includes(t.targetFieldId)))return n}function _i(e){var t,n;let r=Nt(e.get(F)),i=(t=e.get(wt).getCurrentLastSelection())==null?void 0:t.primary;if(!r||!i)return;let{unitId:a,subUnitId:o}=r,s=i.startRow,c=i.startColumn,l=e.get(j),u=l.getPivotTableIdByCell(a,o,s,c);if(!u)return;let d=e.get(M).getPivotTableConfig(a,o,u),f=l.getPivotItemRenderInfoCache(a,o,u);if(!d||!f)return;let p=Me(s,c,l.getPivotTableCellData(a,o,s,c),f),m=p&&Pe(p,d.fieldsConfig);if(!m)return;let h=d.fieldsConfig.dimension[m.targetFieldId],g=d.fieldsConfig.valueFields.flatMap(e=>{let t=d.fieldsConfig.measure[e];return t?[{id:t.id,label:t.displayName}]:[]});if(!h||g.length===0)return;let _=(n=d.fieldsConfig.valueFilter)==null||(n=n.find(e=>e.fieldId===m.targetFieldId))==null?void 0:n.filterInfo;return{unitId:a,subUnitId:o,pivotTableId:u,targetFieldId:m.targetFieldId,targetFieldName:h.displayName,valueFields:g,defaultValueFieldId:m.defaultValueFieldId,..._?{currentFilter:hi(_)}:{}}}const vi={type:Ie.OPERATION,id:`sheet.operation.set-pivot-value-filter`,async handler(e){let t=_i(e);if(!t)return!1;let n=e.get(R),r=e.get(L),i=null,a=!1,o=!1,c=()=>{a||(a=!0,i==null||i.dispose(),i=null)},l=async n=>{if(!o){o=!0;try{let r=gi(e,t);if(!r||n&&(!r.fieldsConfig.measure[n.valueFieldId]||!r.fieldsConfig.valueFields.includes(n.valueFieldId)||!w(n.operator)))return;await e.get(P).executeCommand(ve.id,{unitId:t.unitId,subUnitId:t.subUnitId,pivotTableId:t.pivotTableId,fieldId:t.targetFieldId,valueFilterInfo:n?{...n,type:s.ValueFilter,expected:Array.isArray(n.expected)?n.expected.concat():n.expected}:void 0})}catch{}finally{c()}}};try{i=n.open({id:`UNIVER_SHEET_PIVOT_VALUE_FILTER_DIALOG_ID`,title:{title:r.t(`sheets-pivot-ui.valueFilter.dialogTitle`)},draggable:!0,mask:!0,maskClosable:!1,width:420,children:{label:{name:Pr,props:{targetFieldId:t.targetFieldId,targetFieldName:t.targetFieldName,valueFields:t.valueFields,defaultValueFieldId:t.defaultValueFieldId,currentFilter:t.currentFilter,onConfirm:e=>l(e),onClear:()=>l(void 0),onCancel:c}}},onClose:c})}catch{return c(),!1}return!0}},yi=`sheet.pivot.context-menu.date-group`,bi=`sheet.pivot.context-menu.excel-date-group`,xi=`sheet.pivot.context-menu.number-group`,Si=`sheet.pivot.context-menu.manual-group`,Ci=`sheet.pivot.context-menu.manual-rename`,wi=`sheet.pivot.context-menu.manual-ungroup`,Ti=`sheet.pivot.context-menu.show-data-as`,Ei=`sheet.pivot.context-menu.value-filter`,Di={year:`sheets-pivot-ui.dateGroup.year`,"year-quarter":`sheets-pivot-ui.dateGroup.yearQuarter`,quarter:`sheets-pivot-ui.dateGroup.quarter`,"year-month":`sheets-pivot-ui.dateGroup.yearMonth`,month:`sheets-pivot-ui.dateGroup.month`,"month-date":`sheets-pivot-ui.dateGroup.monthDate`,"year-month-date":`sheets-pivot-ui.dateGroup.yearMonthDate`,date:`sheets-pivot-ui.dateGroup.date`,hour:`sheets-pivot-ui.dateGroup.hour`,minute:`sheets-pivot-ui.dateGroup.minute`,"hour-minute":`sheets-pivot-ui.dateGroup.hourMinute`};function Oi(e){return{id:Vr.id,type:Ht.BUTTON,icon:`PivotTableIcon`,hidden$:Gt(e,et.UNIVER_SHEET),disabled$:ln(e,cn(e,{workbookTypes:[Et],worksheetTypes:[At,kt],rangeTypes:[yt]})),tooltip:`sheets-pivot-ui.title`,title:`sheets-pivot-ui.title`}}function ki(e){return{id:yi,type:Ht.SUBITEMS,title:`sheets-pivot-ui.dateGroup.title`,hidden$:Li(e)}}function Ai(e){return{id:bi,commandId:qr.id,type:Ht.BUTTON,title:`sheets-pivot-ui.dateGroup.excelLikeTitle`,hidden$:Bi(e).pipe(vn(()=>!Kr(e)))}}function ji(e){return{id:xi,commandId:si.id,type:Ht.BUTTON,title:`sheets-pivot-ui.numberGroup.title`,hidden$:Bi(e).pipe(vn(()=>!oi(e)))}}function Mi(e){return{id:Si,commandId:ti.id,type:Ht.BUTTON,title:`sheets-pivot-ui.manualGroup.groupTitle`,hidden$:Bi(e).pipe(vn(()=>!Zr(e,`group`)))}}function Ni(e){return{id:Ci,commandId:ni.id,type:Ht.BUTTON,title:`sheets-pivot-ui.manualGroup.renameTitle`,hidden$:Bi(e).pipe(vn(()=>!Zr(e,`rename`)))}}function Pi(e){return{id:wi,commandId:ri.id,type:Ht.BUTTON,title:`sheets-pivot-ui.manualGroup.ungroupTitle`,hidden$:Bi(e).pipe(vn(()=>!Zr(e,`ungroup`)))}}function Fi(e){return t=>({id:Ii(e),commandId:Ur.id,type:Ht.BUTTON,title:Di[e],params:{dateType:e},disabled$:Ri(t,e),activated$:zi(t,e)})}function Ii(e){return`sheet.pivot.context-menu.date-group.${e}`}function Li(e){return Bi(e).pipe(vn(()=>!Wr(e)))}function Ri(e,t){return Bi(e).pipe(vn(()=>{let n=Wr(e);return!n||Oe(n.dateGroupContext,t)}))}function zi(e,t){return Bi(e).pipe(vn(()=>{let n=Wr(e);return(n==null?void 0:n.dateGroupContext.currentDateType)===t}))}function Bi(e){let t=e.get(M),n=()=>{var t;let n=Nt(e.get(F)),r=(t=e.get(wt).getCurrentLastSelection())==null?void 0:t.primary;if(!n||!r)return;let{unitId:i,subUnitId:a}=n,o=e.get(j).getPivotTableIdByCell(i,a,r.startRow,r.startColumn);return o?{unitId:i,subUnitId:a,pivotTableId:o}:void 0};return yn(e.get(wt).selectionMoveEnd$,t.pivotConfigChange$.pipe(_n(e=>{let t=n();return(t==null?void 0:t.unitId)===e.unitId&&t.subUnitId===e.subUnitId&&t.pivotTableId===e.pivotTableId})),t.collectionChange$.pipe(_n(e=>{let r=n();if(!r||!e.pivotTableIds.includes(r.pivotTableId))return!1;let i=t.getPivotTableConfig(r.unitId,r.subUnitId,r.pivotTableId);return e.unitId===((i==null?void 0:i.sourceRangeInfo.unitId)??r.unitId)}))).pipe(Sn(null))}const Vi=ee.map(e=>({dateType:e,id:Ii(e),menuItemFactory:Fi(e)}));function Hi(e){return{id:Ti,type:Ht.SUBITEMS,title:`sheets-pivot-ui.showValuesAs.title`,hidden$:Gi(e).pipe(vn(()=>!di(e)))}}function Ui(e){return t=>({id:Wi(e.type),commandId:li.id,type:Ht.BUTTON,title:e.localeKey,params:{type:e.type},activated$:Gi(t).pipe(vn(()=>{let n=di(t);return!!(n&&(n.currentShowDataAs.type??u.normal)===e.type)}))})}function Wi(e){return`sheet.pivot.context-menu.show-data-as.${e}`}function Gi(e){return e.get(wt).selectionMoveEnd$.pipe(Sn(null))}const Ki=ci.map(e=>({rule:e,id:Wi(e.type),menuItemFactory:Ui(e)}));function qi(e){return{id:Ei,commandId:vi.id,type:Ht.BUTTON,title:`sheets-pivot-ui.valueFilter.title`,hidden$:e.get(wt).selectionMoveEnd$.pipe(Sn(null),vn(()=>!_i(e)))}}const Ji=Vi.reduce((e,t,n)=>(e[t.id]={order:n+1,menuItemFactory:t.menuItemFactory},e),{}),Yi=Ki.reduce((e,t,n)=>(e[t.id]={order:n+1,menuItemFactory:t.menuItemFactory},e),{}),Xi={[Ut.ORGANIZATION]:{[Vr.id]:{order:1,gridLayout:{row:2,column:1},menuItemFactory:Oi}},[Lt.MAIN_AREA]:{[It.DATA]:{[Vr.id]:{order:1,menuItemFactory:Oi},[yi]:{order:2,menuItemFactory:ki,...Ji},[bi]:{order:3,menuItemFactory:Ai},[xi]:{order:4,menuItemFactory:ji},[Si]:{order:5,menuItemFactory:Mi},[Ci]:{order:6,menuItemFactory:Ni},[wi]:{order:7,menuItemFactory:Pi},[Ti]:{order:8,menuItemFactory:Hi,...Yi},[Ei]:{order:9,menuItemFactory:qi}}},[Lt.COL_HEADER]:{[It.DATA]:{[Vr.id]:{order:1,menuItemFactory:Oi},[yi]:{order:2,menuItemFactory:ki,...Ji},[bi]:{order:3,menuItemFactory:Ai},[xi]:{order:4,menuItemFactory:ji},[Si]:{order:5,menuItemFactory:Mi},[Ci]:{order:6,menuItemFactory:Ni},[wi]:{order:7,menuItemFactory:Pi}}}};var Zi=`@univerjs-pro/sheets-pivot-ui`,Qi=`1.5.2`;const $i={type:Ie.OPERATION,id:`sheet.operation.open-pivot-table-filter-panel`,async handler(e,t){if(!t)return!1;let{row:n,col:r,unitId:i,subUnitId:a,tableFieldId:o,pivotTableId:s}=t,c=e.get(j),l=s||c.getPivotTableIdByCell(i,a,n,r);if(!l)return!1;let u=e.get(ye),d=c.getPivotItemRenderInfoCache(i,a,l);if(!(d!=null&&d.rangesInfo))return!1;let f=c.getPivotTableCellData(i,a,n,r),p=(await u.getPivotDisplayConfig({unitId:i,subUnitId:a,pivotTableId:l,params:{type:k.Filter,filter:{row:n,col:r,tableFieldId:o,cellData:f,pivotItemRenderInfoCache:d}}})).result.filter;if(!p)return!1;let m=e.get(R),h={id:Or,draggable:!0,mask:!1,maskClosable:!1,width:336,dialogStyles:{header:{padding:`16px 16px 0`,height:0},body:{padding:`0 16px 16px`}},closable:!1,children:{label:Dr,unitId:i,subUnitId:a,key:`${n}-${r}-${o||``}`,filterItemInfo:p},onClose:()=>{m.close(Or)}};return m.open(h),!0}},ea={type:Ie.OPERATION,id:`sheet.operation.open-pivot-table-field-setting-panel`,handler(e,t){if(!t)return!1;let n=e.get(L),{tableFieldId:r,pivotTableId:i,unitId:a,subUnitId:o,tableFieldInfo:s,dataFieldInfo:c}=t,l=e.get(R),u={id:Ar,title:{title:n.t(`sheets-pivot-ui.fieldSettings`)},draggable:!0,mask:!1,maskClosable:!1,width:400,children:{label:kr,tableFieldId:r,pivotTableId:i,tableFieldInfo:s,dataFieldInfo:c,unitId:a,subUnitId:o,version:Math.random(),key:`field-setting-${r||``}`,closeFn:()=>{l.close(Ar)}},onClose:()=>{l.close(Ar)}};return l.open(u),!0}};function ta(e,t,n){let r=n.fieldIds,{fieldsConfig:i}=t,{rowFields:a,columnFields:o,valueFields:s,filterFields:c,hiddenFields:l,dimension:u,measure:d,valueIndex:f,valuePosition:p}=i,h=/* @__PURE__ */ new Set;[...a,...o,...s,...c,...l].forEach(e=>{let t=u[e]||d[e];t&&h.add(t.dataFieldId)});let g=r.map(t=>{let r=n.fields[t];return{checked:h.has(t),dataFieldId:r.id,id:r.id,name:r.name,type:r.fieldDataType,pivotTableId:e}}),_=a.flatMap(e=>{let t=u[e];return t?[{dataFieldId:t.dataFieldId,tableFieldId:t.id,displayName:t.displayName}]:[]}),v=o.flatMap(e=>{let t=u[e];return t?[{dataFieldId:t.dataFieldId,tableFieldId:t.id,displayName:t.displayName}]:[]}),y=s.flatMap(e=>{let t=d[e];return t?[{dataFieldId:t.dataFieldId,tableFieldId:t.id,displayName:t.displayName,format:t.format,subTotalType:t.subtotal}]:[]}),b=c.flatMap(e=>{let t=u[e];return t?[{dataFieldId:t.dataFieldId,tableFieldId:t.id,displayName:t.displayName}]:[]}),x=l.flatMap(e=>{let t=u[e];return t?[{dataFieldId:t.dataFieldId,tableFieldId:t.id,displayName:t.displayName,filterInfo:t.filterInfo}]:[]});return y.length>1&&(p===m.Row?_:v).splice(f,0,{dataFieldId:``,tableFieldId:`PivotMultipleValueId`,displayName:`ΣValue`}),{sourceList:g,sourceRange:t.sourceRangeInfo,rowFields:_,columnFields:v,valueFields:y,filterFields:b,hiddenFields:x,positionInfo:t.targetCellInfo}}const na={type:Ie.OPERATION,id:`sheet.operation.open-pivot-table-panel`,async handler(e,t){let n=t==null?void 0:t.pivotTableId;if(!n)return!1;let r=e.get(Bt),i=e.get(F),a=e.get(L),o=e.get(M),s=Nt(i);if(!s)return!1;let{unitId:c,subUnitId:l}=s,u=o.getPivotTableConfig(c,l,n),d=o.getCollection(c,n);if(!u||!d)return!1;let f=ta(n,u,d),p={header:{title:a.t(`sheets-pivot-ui.title`)},id:Er,children:{label:Tr,panelInfo:f,version:Math.random(),setVersion:()=>Math.random(),pivotTableId:n,unitId:c,subUnitId:l},width:346};return r.open(p),!0}},ra=`sheets-pivot-ui.config`,ia={};function aa(e){"@babel/helpers - typeof";return aa=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aa(e)}function oa(e,t){if(aa(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(aa(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function sa(e){var t=oa(e,`string`);return aa(t)==`symbol`?t:t+``}function X(e,t,n){return(t=sa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){return function(n,r){t(n,r,e)}}function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let ca=class extends N{constructor(e,t,n,r,i,a,o,s){var c;super(),this._localeService=e,this._sheetInterceptorService=t,this._injector=n,this._confirmService=r,this._sheetsPivotTableService=i,this._configService=a,this._sheetPermissionCheckController=o,this._sheetsRenderService=s,X(this,`_defaultOverride`,!1),this.disposeWithMe(this._sheetsRenderService.registerSelfRenderingMutations(D.id)),this._initUIInterceptListener(),this._defaultOverride=((c=this._configService.getConfig(oe))==null?void 0:c.defaultOverride)??!1}_getPivotAppliedRanges(e,t,n){return Ee(e,t,n,this._localeService.getDirection())}_initUIInterceptListener(){this._sheetsPivotTableService.asyncInterceptor.interceptAsync(this._sheetsPivotTableService.asyncInterceptor.getInterceptPoints().PIVOT_PERFORM_CHECK,{handler:async(e,t)=>{let{cellInfo:n,view:r,isEmpty:i}=t,{unitId:a,subUnitId:o}=n,s=this._getPivotAppliedRanges(n,r,i);if(!jt(this._injector,a,o,s)){let e=this._localeService.t(`sheets-pivot-ui.msg.permissionError`);this._sheetPermissionCheckController.blockExecuteWithoutPermission(e)}let c=this._sheetInterceptorService.generateMutationsByRanges({unitId:a,subUnitId:o,ranges:s}),l=Te(this._injector,a,o,s);if(c.redos.length||l.shouldClear){if(this._defaultOverride)return Promise.resolve(!0);{let e=await this._confirmService.confirm({id:`sheet-pivot.confirm.add-sheet-pivot`,title:{title:this._localeService.t(`sheets-pivot-ui.perform.tips`)},children:{title:this._localeService.t(`sheets-pivot-ui.perform.info`)},cancelText:this._localeService.t(`sheets-pivot-ui.perform.cancel`),confirmText:this._localeService.t(`sheets-pivot-ui.perform.confirm`)});return Promise.resolve(e)}}return Promise.resolve(!0)}})}};ca=Q([Z(0,I(L)),Z(1,I(St)),Z(2,I(Ke)),Z(3,I(Ue)),Z(4,I(be)),Z(5,I(He)),Z(6,I(Ct)),Z(7,I(nn))],ca);function la(e){let{editable:t,pivotTableId:n,subUnitId:r,unitId:i}=e,a=z(P),o=z(R),s=z(L),c=[{command:{id:na.id,params:{pivotTableId:n}},disabled:!t,label:`sheets-pivot-ui.mobile.edit`},{command:{id:ie.id,params:{unitId:i,subUnitId:r,pivotTableId:n}},disabled:!t,label:`sheets-pivot-ui.mobile.delete`}];async function l(e){await a.executeCommand(e.id,e.params),o.close(Br)}return/* @__PURE__ */ W(`div`,{className:`univer-flex univer-flex-col univer-gap-2`,children:c.map(e=>{let t=s.t(e.label);return/* @__PURE__ */ W(Mn,{title:t,"aria-label":t,variant:`subtle`,disabled:e.disabled,onClick:()=>l(e.command)},e.command.id)})})}const ua=[{label:`1930-08-05`,suffix:`yyyy-MM-dd`},{label:`1930/08/05`,suffix:`yyyy/MM/dd`},{label:`1930年08月05日`,suffix:`yyyy"年"MM"月"dd"日"`},{label:`08-05`,suffix:`MM-dd`},{label:`8月5日`,suffix:`M"月"d"日"`},{label:`13:30:30`,suffix:`h:mm:ss`},{label:`13:30`,suffix:`h:mm`},{label:`下午01:30`,suffix:`A/P hh:mm`},{label:`下午1:30`,suffix:`A/P h:mm`},{label:`下午1:30:30`,suffix:`A/P h:mm:ss`},{label:`08-05 下午 01:30`,suffix:`MM-dd A/P hh:mm`}],da=[{label:`(1,235)`,suffix:`#,##0_);(#,##0)`},{label:`(1,235) `,suffix:`#,##0_);[Red](#,##0)`,color:`red`},{label:`1,234.56`,suffix:`#,##0.00_);#,##0.00`},{label:`1,234.56`,suffix:`#,##0.00_);[Red]#,##0.00`,color:`red`},{label:`-1,234.56`,suffix:`#,##0.00_);-#,##0.00`},{label:`-1,234.56`,suffix:`#,##0.00_);[Red]-#,##0.00`,color:`red`}],fa=[{label:e=>`${e}1,235`,suffix:e=>`"${e}"#,##0.00_);"${e}"#,##0.00`},{label:e=>`${e}1,235`,suffix:e=>`"${e}"#,##0.00_);[Red]"${e}"#,##0.00`,color:`red`},{label:e=>`(${e}1,235)`,suffix:e=>`"${e}"#,##0.00_);("${e}"#,##0.00)`},{label:e=>`(${e}1,235)`,suffix:e=>`"${e}"#,##0.00_);[Red]("${e}"#,##0.00)`,color:`red`},{label:e=>`-${e}1,235`,suffix:e=>`"${e}"#,##0.00_);-"${e}"#,##0.00`},{label:e=>`-${e}1,235`,suffix:e=>`"${e}"#,##0.00_);[Red]-"${e}"#,##0.00`,color:`red`}],pa=`PivotMultipleValueId`;function ma(t,r){if(r===n.blank)return`sheets-pivot-ui.dialog.filter.blank`;if(r===n.other&&t===e.otherDataKey)return`sheets-pivot-ui.showValuesAs.other`}function ha(e,t){let n=ke(t,e);return e.includes(`{0}`)?e.replace(`{0}`,n):`${e}${n}`}const ga=e=>{switch(e){case`filter`:return p.Filter;case`row`:return p.Row;case`column`:return p.Column;case`value`:return p.Value;default:return p.Row}};function _a(e,t){switch(t.rangeType||Ye.NORMAL){case Ye.NORMAL:return{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn};case Ye.ROW:return{startRow:t.startRow,startColumn:0,endRow:t.endRow,endColumn:e.getColumnCount()-1};case Ye.COLUMN:return{startRow:0,startColumn:t.startColumn,endRow:e.getRowCount()-1,endColumn:t.endColumn};case Ye.ALL:return{startRow:0,startColumn:0,endRow:e.getRowCount()-1,endColumn:e.getColumnCount()-1}}}function va(e,t){if(!t||!e||t.endRow-t.startRow<=0)return 1;let{startRow:n,startColumn:r,endRow:i,endColumn:a}=_a(e,t),o=e.getCellMatrix(),s=!1;for(let e=n;e<=i;e++){for(let t=r;t<=a;t++)if(o.getValue(e,t)!=null){s=!0;break}if(s)break}return s?2:0}async function ya(e,t,n){let{commandService:r,pivotTableInfo:i,pivotTableId:a,unitId:o,subUnitId:s}=e,c=[],{rowFields:l,columnFields:u,filterFields:d,valueFields:f}=i,p=[...l,...u,...d,...f];t===`PivotMultipleValueId`&&f.forEach(e=>{c.push(e.tableFieldId)}),n===`source`&&p.forEach(e=>{e.dataFieldId===t&&c.push(e.tableFieldId)}),n!==`source`&&p.find(e=>e.tableFieldId===t)&&c.push(t),await r.executeCommand(re.id,{pivotTableId:a,fieldIds:c,unitId:o,subUnitId:s})}async function ba(e,t,n,r,i){let a={unitId:r,subUnitId:i,token:t,dataRangeInfo:n};await e.executeCommand(Ce.id,a)}const xa=(e,t)=>{let{rowFields:n,columnFields:r,filterFields:i}=e,a=[...n,...r,...i],o=[];return a.forEach(e=>{e.dataFieldId===t&&o.push(e.tableFieldId)}),o};async function Sa(e,t,n,r,i){if(n===`source`&&r===`source`)return;let a=t===pa,{commandService:o,pivotTableInfo:s,pivotTableId:c,unitId:l,subUnitId:u}=e;if(n===`source`&&r!==`source`){let{sourceList:e}=s,n=e.find(e=>e.id===t);if(n){let e=xa(s,t);if(r!==`value`&&e.length>0){let t=e[0];await o.executeCommand(O.id,{pivotTableId:c,fieldId:t,area:ga(r),index:i,unitId:l,subUnitId:u})}else await o.executeCommand(T.id,{pivotTableId:c,dataFieldId:n.dataFieldId,fieldArea:ga(r),index:i,unitId:l,subUnitId:u})}}if(n!==`source`&&r===`source`){let{rowFields:n,columnFields:r,filterFields:i,valueFields:o}=s,c=[...n,...r,...i,...o],l=[];a?o.forEach(e=>{l.push(e.tableFieldId)}):c.find(e=>e.tableFieldId===t)&&l.push(t),await Ca(e,l)}else n!==`source`&&r!==`source`&&await Ta(e,t,n,r,i)}async function Ca(e,t){let{commandService:n,pivotTableId:r,unitId:i,subUnitId:a}=e;await n.executeCommand(re.id,{pivotTableId:r,fieldIds:t,unitId:i,subUnitId:a})}async function wa(e,t,n){let{commandService:r,pivotTableId:i,unitId:a,subUnitId:o}=e;await r.executeCommand(we.id,{pivotTableId:i,position:t,index:n,unitId:a,subUnitId:o})}async function Ta(e,t,n,r,i){let a=t===pa,{commandService:o,pivotTableInfo:s,pivotTableId:c,unitId:l,subUnitId:u}=e;if(a){let e=ga(r);(e===p.Row||e===p.Column)&&await o.executeCommand(we.id,{pivotTableId:c,position:e===p.Row?m.Row:m.Column,index:i,unitId:l,subUnitId:u});return}let{rowFields:d,columnFields:f,filterFields:h,valueFields:g}=s,_=[...d,...f,...h,...g].find(e=>e.tableFieldId===t);if(_){let a=[...d,...f,...h];if(n===`value`&&r!==`value`&&a.find(e=>e.dataFieldId===_.dataFieldId)){await Ca(e,[t]);return}await o.executeCommand(O.id,{pivotTableId:c,fieldId:t,area:ga(r),index:i,unitId:l,subUnitId:u})}}function Ea(e,t,n,r,i){e.executeCommand($i.id,{row:-1,col:-1,unitId:t,subUnitId:n,tableFieldId:i,pivotTableId:r})}function Da(e,t,n,r,i,a){let{sourceList:o,rowFields:s,columnFields:c,valueFields:l,filterFields:u}=a,d=[...s,...c,...l,...u].find(e=>e.tableFieldId===n),f=o.find(e=>e.id===(d==null?void 0:d.dataFieldId));if(d&&f){let a={tableFieldId:n,pivotTableId:t,unitId:r,subUnitId:i,tableFieldInfo:d,dataFieldInfo:f};e.executeCommand(ea.id,a)}}const Oa=[{type:f.average,textKey:`sheets-pivot-ui.subtotal.average`},{type:f.count,textKey:`sheets-pivot-ui.subtotal.count`},{type:f.countNums,textKey:`sheets-pivot-ui.subtotal.countNums`},{type:f.max,textKey:`sheets-pivot-ui.subtotal.max`},{type:f.min,textKey:`sheets-pivot-ui.subtotal.min`},{type:f.product,textKey:`sheets-pivot-ui.subtotal.product`},{type:f.stdDev,textKey:`sheets-pivot-ui.subtotal.stdDev`},{type:f.stdDevp,textKey:`sheets-pivot-ui.subtotal.stdDevp`},{type:f.sum,textKey:`sheets-pivot-ui.subtotal.sum`},{type:f.var,textKey:`sheets-pivot-ui.subtotal.var`},{type:f.varp,textKey:`sheets-pivot-ui.subtotal.varp`}],ka=(e,t=0)=>e?ut.getFormatInfo(e).maxDecimals??t:t,Aa=e=>Array(Math.min(Math.max(0,Number(e)),30)).fill(0).join(``),$=(e,t)=>e.split(`;`).map(e=>/\.0?/.test(e)?e.replace(/\.0*/g,`${t>0?`.`:``}${Aa(Number(t||0))}`):/0[^0]?/.test(e)?e.replace(/0[^0]+|0$/,`0${t>0?`.`:``}${Aa(Number(t||0))}`):e).join(`;`),ja=e=>nt.find(t=>e.includes(t)),Ma=e=>!e,Na=e=>!!ja(e)&&e.startsWith(`_(`),Pa=e=>!!ja(e)&&!e.startsWith(`_(`),Fa=()=>ua.map(e=>({label:e.label,value:e.suffix})),Ia=e=>{let t=ut.getFormatInfo(e);return Fa().map(e=>e.value).includes(e)||[`date`,`datetime`,`time`].includes(t.type)},La=()=>da.map(e=>({label:e.label,value:e.suffix,color:e.color})),Ra=e=>La().some(t=>st(t.value,e)),za=(e,t)=>{switch(t){case p.Row:return e.rowFields.length;case p.Column:return e.columnFields.length;case p.Filter:return e.filterFields.length;case p.Value:return e.valueFields.length;default:return 0}},Ba=(e,t,n)=>{for(let r of[`sheets-pivot-ui.averageName`,`sheets-pivot-ui.countName`,`sheets-pivot-ui.countNumsName`,`sheets-pivot-ui.maxName`,`sheets-pivot-ui.minName`,`sheets-pivot-ui.productName`,`sheets-pivot-ui.stdDevName`,`sheets-pivot-ui.stdDevpName`,`sheets-pivot-ui.sumName`,`sheets-pivot-ui.varName`,`sheets-pivot-ui.varpName`]){let i=n[r];if(i+ke(e,i)===t||i+e===t)return!0}return!1},Va=(e,t,n)=>{let r=``;switch(n){case f.average:r=t[`sheets-pivot-ui.averageName`];break;case f.count:r=t[`sheets-pivot-ui.countName`];break;case f.countNums:r=t[`sheets-pivot-ui.countNumsName`];break;case f.max:r=t[`sheets-pivot-ui.maxName`];break;case f.min:r=t[`sheets-pivot-ui.minName`];break;case f.product:r=t[`sheets-pivot-ui.productName`];break;case f.stdDev:r=t[`sheets-pivot-ui.stdDevName`];break;case f.stdDevp:r=t[`sheets-pivot-ui.stdDevpName`];break;case f.sum:r=t[`sheets-pivot-ui.sumName`];break;case f.var:r=t[`sheets-pivot-ui.varName`];break;case f.varp:r=t[`sheets-pivot-ui.varpName`];break;default:return e}return r+ke(e,r)};function Ha(e,t){if(t.conditionFilter&&C(t.conditionFilter))return`HasFilter`;if(!e)return`NotFilter`;if(S(e))return`HasFilter`;if(x(e)){var n;return e.isAll||((n=t.items)==null?void 0:n.length)===e.list.length?`NotFilter`:`HasFilter`}return C(e)?`HasFilter`:`NotFilter`}function Ua(e){return Na(e)?`accounting`:Pa(e)?`currency`:Ia(e)?`date`:Ra(e)?`thousandthPercentile`:`general`}function Wa(e){let{originPattern:t=``,onChange:n}=e,r=z(L),[i,a]=Y(()=>Ua(t)),[o,s]=Y(()=>ka(t,2)),[c,l]=Y(()=>ja(t)||nt[0]),[u,d]=Y(t),f=_r(()=>[{value:`general`,label:r.t(`sheets-pivot-ui.dialog.numfmt.general`)},{value:`accounting`,label:r.t(`sheets-pivot-ui.dialog.numfmt.accounting`)},{value:`currency`,label:r.t(`sheets-pivot-ui.dialog.numfmt.currency`)},{value:`date`,label:r.t(`sheets-pivot-ui.dialog.numfmt.date`)},{value:`thousandthPercentile`,label:r.t(`sheets-pivot-ui.dialog.numfmt.thousandthPercentile`)}],[r]),p=nt.map(e=>({label:e,value:e}));function m(e){d(e),n(e)}function h(e,t){return $(`_("${e}"* #,##0${t>0?`.0`:``}_)`,t)}function g(e){a(e),m(e===`general`?``:e===`accounting`?h(c,o):e===`currency`?$(fa[0].suffix(c),o):e===`date`?ua[0].suffix:$(da[0].suffix,o))}function _(e){l(e),m(i===`accounting`?h(e,o):$(fa[0].suffix(e),o))}function v(e){let t=e??0;s(t),m(i===`accounting`?h(c,t):$(u,t))}let y=fa.map(e=>({label:e.label(c),value:e.suffix(c),color:e.color})),b=da.map(e=>({label:e.label,value:e.suffix,color:e.color})),x=ua.map(e=>({label:e.label,value:e.suffix}));return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,children:[/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:r.t(`sheets-pivot-ui.dialog.numfmt.formatTypes`)}),/* @__PURE__ */ W(Fn,{className:`univer-w-full`,value:i,options:f,onChange:e=>g(e),size:`small`})]}),(i===`accounting`||i===`currency`)&&/* @__PURE__ */ G(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-3`,children:[/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:r.t(`sheets-pivot-ui.dialog.numfmt.decimalPlaces`)}),/* @__PURE__ */ W(An,{className:`univer-w-full`,value:o,min:0,max:20,onChange:v,size:`small`,controls:!1})]}),/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:r.t(`sheets-pivot-ui.dialog.numfmt.currencyTypes`)}),/* @__PURE__ */ W(Fn,{className:`univer-w-full`,value:c,options:p,onChange:_,size:`small`})]})]}),i===`thousandthPercentile`&&/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:r.t(`sheets-pivot-ui.dialog.numfmt.decimalPlaces`)}),/* @__PURE__ */ W(An,{className:`univer-w-full`,value:o,min:0,max:20,onChange:v,size:`small`,controls:!1})]}),i===`currency`&&/* @__PURE__ */ W(Bn,{className:`univer-rounded-xl univer-p-2`,options:y,value:u,onChange:e=>m($(e,o))}),i===`date`&&/* @__PURE__ */ W(Bn,{className:`univer-rounded-xl univer-p-2`,options:x,value:u,onChange:e=>m(e)}),i===`thousandthPercentile`&&/* @__PURE__ */ W(Bn,{className:`univer-rounded-xl univer-p-2`,options:b,value:u,onChange:e=>m($(e,o))}),/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-text-gray-500`,children:r.t(`sheets-pivot-ui.dialog.numfmt.${i}Desc`)})]})}function Ga(e){let{unitId:t,subUnitId:n,pivotTableId:r,tableFieldId:i,originPattern:a,tableFieldInfo:o,dataFieldInfo:s}=e,c=z(P),l=z(R),u=z(L),[d,f]=Y(a??``);async function p(){let e={format:d,tableFieldId:i,pivotTableId:r,unitId:t,subUnitId:n,tableFieldInfo:o,dataFieldInfo:s};await c.executeCommand(Se.id,e),l.close(Mr)}return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-5`,dir:u.getDirection(),children:[/* @__PURE__ */ W(Wa,{originPattern:a,onChange:f}),/* @__PURE__ */ G(Nn,{children:[/* @__PURE__ */ W(V,{onClick:()=>l.close(Mr),size:`middle`,children:u.t(`sheets-pivot-ui.dialog.numfmt.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,onClick:p,size:`middle`,children:u.t(`sheets-pivot-ui.dialog.numfmt.confirm`)})]})]})}function Ka(e){let{unitId:t,subUnitId:n,pivotTableId:r,tableFieldId:i,tableFieldInfo:a,dataFieldInfo:o,closeFn:s,format:c,version:l}=e,u=z(P),d=z(M),f=z(L),[p,m]=Y(`field`),[h,g]=Y(a.displayName),[_,v]=Y(a.subTotalType),[y,b]=Y(c??a.format??``),[x,S]=Y(y);q(()=>{m(`field`),g(a.displayName),v(a.subTotalType),b(c??a.format??``),S(c??a.format??``)},[c,a,l]);let C={...d.getTextInfo()};[`sheets-pivot-ui.averageName`,`sheets-pivot-ui.countName`,`sheets-pivot-ui.countNumsName`,`sheets-pivot-ui.maxName`,`sheets-pivot-ui.minName`,`sheets-pivot-ui.productName`,`sheets-pivot-ui.stdDevName`,`sheets-pivot-ui.stdDevpName`,`sheets-pivot-ui.sumName`,`sheets-pivot-ui.varName`,`sheets-pivot-ui.varpName`].forEach(e=>{C[e]=f.t(e)});function w(e){v(e),Ba(o.name,h,C)&&g(Va(o.name,C,e))}async function T(){let e={displayName:a.displayName===h?void 0:h,subtotalType:a.subTotalType===_?void 0:_,format:a.format===y?void 0:y,tableFieldId:i,pivotTableId:r,unitId:t,subUnitId:n,tableFieldInfo:a,dataFieldInfo:o};await u.executeCommand(Se.id,e),s()}return p===`format`?/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-5`,dir:f.getDirection(),children:[/* @__PURE__ */ G(`button`,{type:`button`,className:`univer-flex univer-h-10 univer-items-center univer-gap-2 univer-border-0 univer-bg-transparent univer-p-0 univer-text-base univer-font-semibold`,onClick:()=>m(`field`),children:[/* @__PURE__ */ W(Qn,{}),f.t(`sheets-pivot-ui.dialog.numfmt.fieldSetting`)]}),/* @__PURE__ */ W(Wa,{originPattern:y,onChange:S}),/* @__PURE__ */ G(Nn,{children:[/* @__PURE__ */ W(V,{onClick:()=>m(`field`),size:`middle`,children:f.t(`sheets-pivot-ui.dialog.numfmt.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,onClick:()=>{b(x),m(`field`)},size:`middle`,children:f.t(`sheets-pivot-ui.dialog.numfmt.confirm`)})]})]}):/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,dir:f.getDirection(),children:[/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-font-medium`,children:f.t(`sheets-pivot-ui.dialog.fieldName`)}),/* @__PURE__ */ W(`span`,{className:`univer-truncate univer-text-xs univer-text-gray-500`,children:ha(f.t(`sheets-pivot-ui.dialog.sourceName`),o.name)})]}),/* @__PURE__ */ W(kn,{className:`univer-mt-2 univer-w-full`,value:h,onChange:g,size:`small`})]}),/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:f.t(`sheets-pivot-ui.dialog.summarizeBy`)}),/* @__PURE__ */ W(`div`,{className:`univer-max-h-[40vh] univer-overflow-y-auto univer-rounded-xl univer-bg-gray-50 univer-p-1 dark:!univer-bg-gray-800`,children:Oa.map(e=>/* @__PURE__ */ G(`button`,{type:`button`,className:U(`univer-flex univer-h-12 univer-w-full univer-items-center univer-gap-2 univer-rounded-xl univer-border-0 univer-bg-transparent univer-px-3 univer-text-left univer-text-sm`,{"univer-bg-primary-50 dark:!univer-bg-gray-700":_===e.type}),onClick:()=>w(e.type),children:[/* @__PURE__ */ W(tr,{className:U(`univer-text-primary-600`,{"univer-invisible":_!==e.type})}),f.t(e.textKey)]},e.type))})]}),/* @__PURE__ */ W(V,{className:`univer-w-full`,onClick:()=>{S(y),m(`format`)},size:`middle`,children:f.t(`sheets-pivot-ui.dialog.format`)}),/* @__PURE__ */ G(Nn,{children:[/* @__PURE__ */ W(V,{onClick:s,size:`middle`,children:f.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:!h,onClick:T,size:`middle`,children:f.t(`sheets-pivot-ui.dialog.ok`)})]})]})}function qa(e){var t;let{filterItemInfo:i,unitId:a,subUnitId:o}=e,s=z(P),c=z(R),l=z(L),u=z(F),d=B(l.direction$,l.getDirection()),[f,p]=Y(()=>{var e;return i.checkedItems??((e=i.filterInfo)==null?void 0:e.list)??i.items}),[m,h]=Y(()=>i.partialItems??[]),[g,_]=Y((t=i.sortInfo)==null?void 0:t.type),v=m.length===0&&f.length===i.items.length,y=Ha(i.filterInfo,{items:i.items,conditionFilter:i.conditionFilter});q(()=>{let e=u.getCurrentUnitOfType(et.UNIVER_SHEET);if(!e)return;let t=e.activeSheet$.subscribe(e=>{(e==null?void 0:e.getSheetId())!==o&&c.close(Or)});return()=>t.unsubscribe()},[c,o,u]);function b(){c.close(Or)}function x(e){m.includes(e)?(h(t=>t.filter(t=>t!==e)),p(t=>[...t,e])):p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}async function S(e,t,n,r=!1){await s.executeCommand(fe.id,{unitId:a,subUnitId:o,pivotTableId:i.pivotTableId,tableFieldId:i.tableFieldId,items:e,partialItems:n,isAll:t,clearAllFilters:r}),b()}async function C(e){await s.executeCommand(_e.id,{unitId:a,subUnitId:o,pivotTableId:i.pivotTableId,tableFieldId:i.tableFieldId,info:{type:e}}),_(e),b()}return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,dir:d,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-base univer-font-semibold`,children:l.t(`sheets-pivot-ui.filterField`)}),/* @__PURE__ */ G(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2`,children:[/* @__PURE__ */ G(V,{className:U(``,{"univer-bg-gray-100 dark:!univer-bg-gray-700":g===r.ascending}),onClick:()=>C(r.ascending),size:`middle`,children:[/* @__PURE__ */ W($n,{}),l.t(`sheets-pivot-ui.dialog.filter.ascending`)]}),/* @__PURE__ */ G(V,{className:U(``,{"univer-bg-gray-100 dark:!univer-bg-gray-700":g===r.descending}),onClick:()=>C(r.descending),size:`middle`,children:[/* @__PURE__ */ W(rr,{}),l.t(`sheets-pivot-ui.dialog.filter.descending`)]})]}),/* @__PURE__ */ G(`div`,{className:`univer-max-h-[40vh] univer-overflow-y-auto univer-rounded-xl univer-bg-gray-50 univer-p-2 dark:!univer-bg-gray-800`,children:[/* @__PURE__ */ W(`div`,{className:`univer-flex univer-min-h-12 univer-items-center univer-px-2`,children:/* @__PURE__ */ W(H,{checked:v,indeterminate:!v&&(f.length>0||m.length>0),onChange:()=>{h([]),p(v?[]:i.items)},children:l.t(`sheets-pivot-ui.dialog.filter.selectAll`)})}),i.items.map((e,t)=>{var r;let a=i.itemTypes[t],o=(r=i.itemLabels)==null?void 0:r[e],s=ma(e,a),c=e;return s?c=l.t(s):o===void 0?a===n.date&&i.format&&(c=ut.format(i.format,Number(e))):c=o,/* @__PURE__ */ W(`div`,{className:`univer-flex univer-min-h-12 univer-items-center univer-px-2`,children:/* @__PURE__ */ W(H,{checked:f.includes(e),indeterminate:m.includes(e),contentClassName:`univer-max-w-[70vw] univer-truncate`,onChange:()=>x(e),children:c})},e)})]}),/* @__PURE__ */ W(V,{className:`univer-w-full`,variant:`link`,disabled:y===`NotFilter`,onClick:()=>S(i.items,!0,[],!0),size:`middle`,children:l.t(`sheets-pivot-ui.dialog.filter.clearFilter`)}),/* @__PURE__ */ G(Nn,{children:[/* @__PURE__ */ W(V,{onClick:b,size:`middle`,children:l.t(`sheets-pivot-ui.dialog.filter.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:!f.length&&!m.length,onClick:()=>S(f,v,m),size:`middle`,children:l.t(`sheets-pivot-ui.dialog.filter.confirm`)})]})]})}const Ja=[{label:`sheets-pivot-ui.config.pageDownThenOver`,value:`false`},{label:`sheets-pivot-ui.config.pageOverThenDown`,value:`true`}],Ya=[{label:`sheets-pivot-ui.config.layoutTabular`,value:String(c.tabular)},{label:`sheets-pivot-ui.config.layoutCompact`,value:String(c.compact)},{label:`sheets-pivot-ui.config.layoutOutline`,value:String(c.outline)}],Xa=[{label:`sheets-pivot-ui.config.rowSubtotalTop`,value:String(d.top)},{label:`sheets-pivot-ui.config.rowSubtotalBottom`,value:String(d.bottom)}],Za=[{label:`sheets-pivot-ui.config.dateGroupingLegacy`,value:a.Legacy},{label:`sheets-pivot-ui.config.dateGroupingExcelLike`,value:a.ExcelLike}];function Qa(e){let{unitId:t,subUnitId:n,pivotTableId:r}=e,i=z(P),a=z(Ue),o=z(We),s=z(L),l=z(M),u=_r(()=>l.watchPivotTableChanges(t,n,r).pipe(hn(0)),[l,t,n,r]);B(u);let[f,p]=Y(!1),m=J(!1),h=l.getPivotTableConfig(t,n,r),g=v(h==null?void 0:h.fieldsConfig.options),[_,y]=Y(()=>{var e,i;let a=l.getPivotTableConfig(t,n,r),o=(a==null||(e=a.fieldsConfig)==null?void 0:e.options)??{};return{showRowSubtotal:o.showRowSubtotal??!0,showRowGrandTotal:o.showRowGrandTotal??!0,showColSubtotal:o.showColSubtotal??!0,showColGrandTotal:o.showColGrandTotal??!0,pageWrap:o.pageWrap??1,pageOverThenDown:o.pageOverThenDown??!1,repeatRowLabels:o.repeatRowLabels??!1,repeatColLabels:o.repeatColLabels??!1,layout:(a==null||(i=a.fieldsConfig)==null?void 0:i.layout)??c.tabular,rowSubtotalPosition:o.rowSubtotalPosition??d.top}});function x(e){let a={unitId:t,subUnitId:n,pivotTableId:r,options:e};return y(t=>({...t,...e})),i.executeCommand(ge.id,a).catch(e=>o.error(`[MobilePivotConfigPanel]`,e))}function S(e){let a={unitId:t,subUnitId:n,pivotTableId:r,layout:e};return y(t=>({...t,layout:e})),i.executeCommand(pe.id,a).catch(e=>o.error(`[MobilePivotConfigPanel]`,e))}async function C(e){if(!(m.current||e===g)){m.current=!0,p(!0);try{let o=l.getPivotTableConfig(t,n,r),c=l.getCollection(t,r);if(!o||!c||(Object.values(c.fields).some(b)||c.customFields.some(b))&&!await a.confirm({id:`sheet-pivot.confirm.change-date-grouping-mode`,title:{title:s.t(`sheets-pivot-ui.config.dateGroupingSwitchTitle`)},children:{title:s.t(`sheets-pivot-ui.config.dateGroupingSwitchMessage`)},cancelText:s.t(`sheets-pivot-ui.dialog.cancel`),confirmText:s.t(`sheets-pivot-ui.dialog.ok`)})||l.getPivotTableConfig(t,n,r)!==o||l.getCollection(t,r)!==c||v(o.fieldsConfig.options)===e)return;await i.executeCommand(ge.id,{unitId:t,subUnitId:n,pivotTableId:r,options:{dateGroupingMode:e}})}catch(e){o.error(`[MobilePivotConfigPanel]`,e)}finally{m.current=!1,p(!1)}}}let w=e=>e.map(e=>({...e,label:s.t(e.label)}));return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-5 univer-py-4`,children:[/* @__PURE__ */ G(`section`,{className:`univer-flex univer-flex-col univer-gap-3`,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.displaySection`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-10 univer-items-center univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm`,children:s.t(`sheets-pivot-ui.config.dateGroupingMode`)}),/* @__PURE__ */ W(Fn,{className:`univer-w-40`,value:g,options:w(Za),disabled:f,onChange:e=>C(e),size:`small`})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-10 univer-items-center univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm`,children:s.t(`sheets-pivot-ui.config.layout`)}),/* @__PURE__ */ W(Fn,{className:`univer-w-40`,value:String(_.layout),options:w(Ya),onChange:e=>S(Number(e)),size:`small`})]}),/* @__PURE__ */ W(H,{checked:_.repeatRowLabels,disabled:_.layout===c.compact,onChange:e=>x({repeatRowLabels:!!e}),children:s.t(`sheets-pivot-ui.config.repeatRowLabels`)}),/* @__PURE__ */ W(H,{checked:_.repeatColLabels,onChange:e=>x({repeatColLabels:!!e}),children:s.t(`sheets-pivot-ui.config.repeatColLabels`)})]}),/* @__PURE__ */ G(`section`,{className:`univer-flex univer-flex-col univer-gap-3`,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.totalsSection`)}),/* @__PURE__ */ W(H,{checked:_.showRowSubtotal,onChange:e=>x({showRowSubtotal:!!e}),children:s.t(`sheets-pivot-ui.config.showRowSubtotal`)}),_.layout===c.outline&&/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-10 univer-items-center univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm`,children:s.t(`sheets-pivot-ui.config.rowSubtotalPosition`)}),/* @__PURE__ */ W(Fn,{className:`univer-w-40`,value:String(_.rowSubtotalPosition),options:w(Xa),onChange:e=>x({rowSubtotalPosition:Number(e)}),size:`small`})]}),/* @__PURE__ */ W(H,{checked:_.showRowGrandTotal,onChange:e=>x({showRowGrandTotal:!!e}),children:s.t(`sheets-pivot-ui.config.showRowGrandTotal`)}),/* @__PURE__ */ W(H,{checked:_.showColSubtotal,onChange:e=>x({showColSubtotal:!!e}),children:s.t(`sheets-pivot-ui.config.showColSubtotal`)}),/* @__PURE__ */ W(H,{checked:_.showColGrandTotal,onChange:e=>x({showColGrandTotal:!!e}),children:s.t(`sheets-pivot-ui.config.showColGrandTotal`)})]}),/* @__PURE__ */ G(`section`,{className:`univer-flex univer-flex-col univer-gap-3`,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.pageSection`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-10 univer-items-center univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm`,children:s.t(`sheets-pivot-ui.config.pageWrap`)}),/* @__PURE__ */ W(An,{className:`univer-w-24`,value:_.pageWrap,min:1,max:20,onChange:e=>{let t=Number(e);return Number.isFinite(t)&&t>=1?x({pageWrap:t}):void 0},size:`small`,controls:!1})]}),/* @__PURE__ */ W(`p`,{className:`univer-text-xs univer-text-gray-600`,children:s.t(_.pageOverThenDown?`sheets-pivot-ui.config.pageWrapOverThenDownHelp`:`sheets-pivot-ui.config.pageWrapDownThenOverHelp`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-10 univer-items-center univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm`,children:s.t(`sheets-pivot-ui.config.pageDirection`)}),/* @__PURE__ */ W(Fn,{className:`univer-w-40`,value:String(_.pageOverThenDown),options:w(Ja),onChange:e=>x({pageOverThenDown:e===`true`}),size:`small`})]})]})]})}function $a(e,t,n,r){let i=[];return t>0&&i.push(`moveUp`),t<n-1&&i.push(`moveDown`),r?(i.push(e===`column`?`moveToRow`:`moveToColumn`),i.push(`remove`),i):(e!==`filter`&&i.push(`moveToFilter`),e!==`column`&&i.push(`moveToColumn`),e!==`row`&&i.push(`moveToRow`),e===`value`?i.push(`settings`):(i.push(`moveToValue`),i.push(`filter`)),i.push(`remove`),i)}const eo=[`filter`,`column`,`row`,`value`];function to(e,t){switch(t){case`filter`:return e.filterFields;case`column`:return e.columnFields;case`row`:return e.rowFields;case`value`:return e.valueFields;default:return[]}}function no(e){switch(e){case`filter`:return`sheets-pivot-ui.filter`;case`column`:return`sheets-pivot-ui.column`;case`row`:return`sheets-pivot-ui.row`;default:return`sheets-pivot-ui.value`}}function ro(e){switch(e){case`filter`:return`sheets-pivot-ui.mobile.filterDesc`;case`column`:return`sheets-pivot-ui.mobile.columnDesc`;case`row`:return`sheets-pivot-ui.mobile.rowDesc`;default:return`sheets-pivot-ui.valueDesc`}}function io(e){switch(e.area){case`filter`:return/* @__PURE__ */ W(ir,{});case`column`:return/* @__PURE__ */ W(dr,{});case`row`:return/* @__PURE__ */ W(nr,{});default:return/* @__PURE__ */ W(ar,{})}}function ao(e){switch(e){case`moveUp`:return`sheets-pivot-ui.mobile.moveUp`;case`moveDown`:return`sheets-pivot-ui.mobile.moveDown`;case`moveToFilter`:return`sheets-pivot-ui.mobile.moveToFilter`;case`moveToColumn`:return`sheets-pivot-ui.mobile.moveToColumn`;case`moveToRow`:return`sheets-pivot-ui.mobile.moveToRow`;case`moveToValue`:return`sheets-pivot-ui.mobile.moveToValue`;case`filter`:return`sheets-pivot-ui.filterField`;case`settings`:return`sheets-pivot-ui.fieldSettings`;default:return`sheets-pivot-ui.removeField`}}function oo(e){switch(e){case`moveToFilter`:return`filter`;case`moveToColumn`:return`column`;case`moveToRow`:return`row`;case`moveToValue`:return`value`;default:return null}}function so(e){let{area:t,field:n,index:r,fieldCount:i,info:a,pivotTableId:o,unitId:s,subUnitId:c,refresh:l}=e,u=z(P),d=z(L),f=n.tableFieldId===pa,p={pivotTableInfo:a,pivotTableId:o,commandService:u,unitId:s,subUnitId:c};async function m(e){if(e===`filter`){Ea(u,s,c,o,n.tableFieldId);return}if(e===`settings`){Da(u,o,n.tableFieldId,s,c,a);return}if(e===`remove`){await ya(p,n.tableFieldId,t),await l();return}let i=oo(e)??t,d=to(a,i).length;e===`moveUp`?d=r-1:e===`moveDown`&&(d=r+1),await Sa(p,n.tableFieldId,t,i,d),await l()}let h=$a(t,r,i,f).map(e=>({type:`item`,children:d.t(ao(e)),variant:e===`remove`?`destructive`:`default`,onSelect:()=>m(e)}));return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-12 univer-items-center univer-gap-3 univer-rounded-xl univer-px-3`,children:[/* @__PURE__ */ W(`bdi`,{className:`univer-min-w-0 univer-flex-1 univer-truncate univer-text-sm`,dir:`auto`,children:f?d.t(`sheets-pivot-ui.multipleValue`):n.displayName}),/* @__PURE__ */ W(Pn,{items:h,children:/* @__PURE__ */ W(`button`,{type:`button`,className:`univer-flex univer-size-10 univer-shrink-0 univer-items-center univer-justify-center univer-rounded-lg univer-border-0 univer-bg-transparent active:univer-bg-gray-100 dark:active:!univer-bg-gray-700`,children:/* @__PURE__ */ W(cr,{})})})]})}function co(e){let t=z(L);return/* @__PURE__ */ W(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,children:eo.map(n=>{let r=to(e.info,n);return/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ G(`div`,{className:`univer-mb-2 univer-flex univer-items-center univer-gap-2 univer-text-sm univer-font-medium`,children:[/* @__PURE__ */ W(io,{area:n}),t.t(no(n))]}),/* @__PURE__ */ W(`div`,{className:`univer-rounded-xl univer-bg-gray-50 univer-p-1 dark:!univer-bg-gray-800`,children:r.length?r.map((t,i)=>/* @__PURE__ */ W(so,{...e,area:n,field:t,index:i,fieldCount:r.length},t.tableFieldId)):/* @__PURE__ */ W(`div`,{className:`univer-p-4 univer-text-center univer-text-xs univer-text-gray-500`,children:t.t(ro(n))})})]},n)})})}function lo(e,t){switch(t){case`filter`:return e.filterFields.length;case`column`:return e.columnFields.length;case`row`:return e.rowFields.length;case`value`:return e.valueFields.length;default:return 0}}function uo(e){let t=`univer-size-4 univer-shrink-0 univer-text-gray-500`;switch(e.type){case n.number:return/* @__PURE__ */ W(lr,{className:t});case n.date:return/* @__PURE__ */ W(er,{className:t});default:return/* @__PURE__ */ W(pr,{className:t})}}function fo(e){let{field:t,info:r,pivotTableId:i,unitId:a,subUnitId:o,refresh:s}=e,c=z(P),l=z(L),u={pivotTableInfo:r,pivotTableId:i,commandService:c,unitId:a,subUnitId:o};async function d(e){if(e){let e=t.type===n.number?`value`:`row`;await Sa(u,t.dataFieldId,`source`,e,lo(r,e))}else await ya(u,t.dataFieldId,`source`);await s()}async function f(e){await Sa(u,t.dataFieldId,`source`,e,lo(r,e)),await s()}let p=[{type:`item`,children:l.t(`sheets-pivot-ui.addToRow`),onSelect:()=>f(`row`)},{type:`item`,children:l.t(`sheets-pivot-ui.addToColumn`),onSelect:()=>f(`column`)},{type:`item`,children:l.t(`sheets-pivot-ui.addToValue`),onSelect:()=>f(`value`)},{type:`item`,children:l.t(`sheets-pivot-ui.addToFilter`),onSelect:()=>f(`filter`)}];return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-h-12 univer-items-center univer-gap-3 univer-rounded-xl univer-px-2`,children:[/* @__PURE__ */ W(H,{checked:t.checked,onChange:e=>d(!!e)}),/* @__PURE__ */ W(uo,{type:t.type}),/* @__PURE__ */ W(`bdi`,{className:`univer-min-w-0 univer-flex-1 univer-truncate univer-text-sm`,dir:`auto`,children:t.name}),/* @__PURE__ */ W(Pn,{items:p,children:/* @__PURE__ */ W(`button`,{type:`button`,className:`univer-flex univer-size-10 univer-shrink-0 univer-items-center univer-justify-center univer-rounded-lg univer-border-0 univer-bg-transparent active:univer-bg-gray-100 dark:active:!univer-bg-gray-700`,children:/* @__PURE__ */ W(cr,{})})})]})}function po(e){let{info:t}=e,n=z(L),[r,i]=Y(``),a=r.trim().toLocaleLowerCase(),o=a?t.sourceList.filter(e=>e.name.toLocaleLowerCase().includes(a)):t.sourceList;return/* @__PURE__ */ G(`section`,{className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ G(`div`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.sourceFieldTile`)}),/* @__PURE__ */ W(`div`,{className:`univer-mt-1 univer-text-xs univer-text-gray-500`,children:n.t(`sheets-pivot-ui.mobile.sourceFieldDescription`)})]}),/* @__PURE__ */ W(kn,{allowClear:!0,value:r,placeholder:n.t(`sheets-pivot-ui.searchFieldPlaceholder`),slot:/* @__PURE__ */ W(fr,{}),onChange:i,size:`small`}),/* @__PURE__ */ W(`div`,{className:`univer-rounded-xl univer-bg-gray-50 univer-p-1 dark:!univer-bg-gray-800`,children:o.length?o.map(t=>/* @__PURE__ */ W(fo,{...e,field:t},t.id)):/* @__PURE__ */ W(`div`,{className:`univer-p-4 univer-text-center univer-text-sm univer-text-gray-500`,children:n.t(`sheets-pivot-ui.noMatchingFields`)})})]})}function mo(e){var t;let{sourceRangeInfo:n,positionInfo:r,pivotTableId:i,refresh:a}=e,o=z(P),s=z(We),c=z(L),l=z(F).getUnit(n.unitId),u=(l==null||(t=l.getSheetBySheetId(n.subUnitId))==null?void 0:t.getName())??n.sheetName,[d,f]=Y(n.range),[p,m]=Y(u),[h,g]=Y(``);q(()=>{f(n.range),m(u)},[u,n]);async function _(e){let t=e.split(`,`).filter(Boolean).map(vr)[0];if(!t||!l){g(c.t(`sheets-pivot-ui.msg.emptySourceRange`));return}let s=t.sheetName||n.sheetName,u=l.getSheetBySheetName(s),d=va(u,t.range);if(d!==2||!u){let e=d===0?`sheets-pivot-ui.msg.emptySourceRange`:`sheets-pivot-ui.msg.invalidSize`;g(c.t(e))}else g(``),f(t.range),m(s),await ba(o,i,{unitId:n.unitId,subUnitId:u.getSheetId(),range:t.range,sheetName:s},r.unitId,r.subUnitId),await a()}return/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:c.t(`sheets-pivot-ui.sourceRangeLabel`)}),/* @__PURE__ */ W(xr,{unitId:n.unitId,subUnitId:n.subUnitId,initialValue:br(p,d),maxRangeCount:1,keepSheetReference:!0,supportAcrossSheet:!0,onChange:(e,t)=>_(t).catch(e=>{s.error(`[MobilePivotSourceRange]`,e)})}),h&&/* @__PURE__ */ W(`div`,{className:`univer-mt-2 univer-text-xs univer-text-red-500`,children:h})]})}function ho(e){let{pivotTableId:t,version:n,unitId:r,subUnitId:i,panelInfo:a}=e,o=z(M),s=z(ye),c=z(We),l=_r(()=>o.watchPivotTableChanges(r,i,t).pipe(hn(0)),[o,r,i,t]),u=B(l),[d,f]=Y(a),p=K(async()=>{if(!o.getPivotTableConfig(r,i,t))return;let e=await s.getPivotDisplayConfig({unitId:r,subUnitId:i,pivotTableId:t,params:{type:k.Panel,panel:{pivotTableId:t}}});e.result.panel&&f(e.result.panel)},[o,t,s,i,r]);return q(()=>{p().catch(e=>c.error(`[MobilePivotPanel]`,e))},[u,c,p,n]),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-5 univer-py-4`,children:[/* @__PURE__ */ W(mo,{sourceRangeInfo:d.sourceRange,positionInfo:d.positionInfo,pivotTableId:t,refresh:p}),/* @__PURE__ */ W(po,{info:d,pivotTableId:t,unitId:r,subUnitId:i,refresh:p}),/* @__PURE__ */ W(co,{info:d,pivotTableId:t,unitId:r,subUnitId:i,refresh:p})]})}function go(e){let{className:t,unitId:n,subUnitId:r,pivotTableId:i}=e,[a,o]=Y(`fields`),s=z(L);return/* @__PURE__ */ G(`div`,{className:U(`univer-flex univer-size-full univer-min-h-0 univer-flex-col`,t),dir:s.getDirection(),children:[/* @__PURE__ */ W(Rn,{className:`univer-sticky univer-top-0 univer-z-10 univer-my-3 univer-w-full univer-shrink-0`,items:[{label:s.t(`sheets-pivot-ui.fieldPanel`),value:`fields`},{label:s.t(`sheets-pivot-ui.configPanel`),value:`config`}],value:a,onChange:o}),/* @__PURE__ */ W(`div`,{className:`univer-min-h-0 univer-flex-1 univer-overflow-y-auto`,children:a===`fields`?/* @__PURE__ */ W(ho,{...e}):/* @__PURE__ */ W(Qa,{unitId:n,subUnitId:r,pivotTableId:i})})]})}function _o(e,t){switch(e){case 1:return t.t(`sheets-pivot-ui.msg.invalidSize`);case 0:return t.t(`sheets-pivot-ui.msg.emptySourceRange`);default:return``}}function vo(e){let{unitId:t,subUnitId:n,sourceRange:r,positionRange:i,sourceSheetName:a,positionSheetName:o,onConfirm:s,onCancel:c}=e,l=z(L),u=z(F).getUnit(t),[d,f]=Y(r),[p,m]=Y(i),[h,g]=Y(a),[_,v]=Y(o),[y,b]=Y(A.New),[x,S]=Y(``),[C,w]=Y(!0);q(()=>{let e=va(u.getSheetBySheetName(h),d);S(_o(e,l))},[l,d,h,u]);function T(e){let t=e.split(`,`).filter(Boolean).map(vr)[0];t?(f(t.range),g(t.sheetName||h)):S(l.t(`sheets-pivot-ui.msg.emptySourceRange`))}function E(e){let t=e.split(`,`).filter(Boolean).map(vr)[0];if(!t){m(null);return}let n=t.sheetName||a;m(t.range),v(n),w(n!==h||!Ze.intersects(t.range,d))}function D(){if(x)return;let e;if(y===A.Existing){if(!p||!C)return;e={sourceRange:d,sourceSheetName:h,positionRange:p,positionSheetName:_,positionType:y}}else e={sourceRange:d,sourceSheetName:h,positionType:y};s(e)}return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-5`,dir:l.getDirection(),children:[/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:l.t(`sheets-pivot-ui.dialog.source.sourceData`)}),/* @__PURE__ */ W(xr,{unitId:t,subUnitId:n,initialValue:br(h,d),maxRangeCount:1,supportAcrossSheet:!0,keepSheetReference:!0,onChange:(e,t)=>T(t)}),x&&/* @__PURE__ */ W(`div`,{className:`univer-mt-2 univer-text-xs univer-text-red-500`,children:x})]}),/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:l.t(`sheets-pivot-ui.dialog.source.position`)}),/* @__PURE__ */ G(Ln,{className:`univer-flex univer-flex-col univer-gap-3`,value:y,onChange:e=>b(e),children:[/* @__PURE__ */ W(In,{value:A.New,children:l.t(`sheets-pivot-ui.dialog.source.newSheet`)}),/* @__PURE__ */ W(In,{value:A.Existing,children:l.t(`sheets-pivot-ui.dialog.source.existingSheet`)})]}),y===A.Existing&&/* @__PURE__ */ G(`div`,{className:`univer-mt-3`,children:[/* @__PURE__ */ W(xr,{unitId:t,subUnitId:n,initialValue:p?br(_,p):``,maxRangeCount:1,supportAcrossSheet:!0,keepSheetReference:!0,onChange:(e,t)=>E(t)}),!C&&/* @__PURE__ */ W(`div`,{className:`univer-mt-2 univer-text-xs univer-text-red-500`,children:l.t(`sheets-pivot-ui.dialog.source.intersect`)})]})]}),/* @__PURE__ */ G(Nn,{children:[/* @__PURE__ */ W(V,{onClick:c,size:`middle`,children:l.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,onClick:D,size:`middle`,children:l.t(`sheets-pivot-ui.dialog.ok`)})]})]})}let yo=class extends N{constructor(e,t){super(),[[Rr,vo],[Tr,go],[Dr,qa],[kr,Ka],[jr,Ga],[zr,la]].forEach(([t,n])=>{this.disposeWithMe(e.register(t,n))}),this.disposeWithMe(t.register({PivotTableIcon:ur}))}};yo=Q([Z(0,I(Ft)),Z(1,I(Vt))],yo);function bo(e){return{id:Vr.id,commandId:Vr.id,type:Ht.BUTTON,icon:`PivotTableIcon`,title:`sheets-pivot-ui.title`,tooltip:`sheets-pivot-ui.title`,hidden$:Gt(e,et.UNIVER_SHEET),disabled$:ln(e,cn(e,{workbookTypes:[Et],worksheetTypes:[At,kt],rangeTypes:[yt]}))}}const xo={[Ut.ORGANIZATION]:{[Vr.id]:{order:1,gridLayout:{row:2,column:1},menuItemFactory:bo}},[Lt.MAIN_AREA]:{[It.DATA]:{[Vr.id]:{order:1,menuItemFactory:bo}}}};let So=class extends N{constructor(e){super(),e.mergeMenu(xo)}};So=Q([Z(0,Rt)],So);let Co=class extends N{constructor(e,t,n,r){super(),this._sidebarService=n,this._dialogService=r,X(this,`_pivotTableId`,null),this.disposeWithMe(e.onCommandExecuted(e=>{e.id===na.id?this._pivotTableId=e.params.pivotTableId:e.id===ae.id&&e.params.pivotTableId===this._pivotTableId&&this._closePanel()}));let i=t.getCurrentUnitOfType(et.UNIVER_SHEET);i&&(this.disposeWithMe(i.activeSheet$.pipe(xn(1)).subscribe(()=>this._closePanel())),this.disposeWithMe(i.sheetDisposed$.subscribe(()=>this._closePanel()))),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(e=>{e.id===`UNIVER_SHEET_PIVOT_PANEL_ID`&&e.visible===!1&&(this._pivotTableId=null,this._closeChildDialogs())}))}_closePanel(){this._pivotTableId=null,this._sidebarService.close(Er),this._closeChildDialogs()}_closeChildDialogs(){this._dialogService.close(Or),this._dialogService.close(Ar),this._dialogService.close(Mr)}};Co=Q([Z(0,P),Z(1,F),Z(2,Bt),Z(3,R)],Co),new Path2D(`M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z`);var wo=class{static drawNoSetting(e,t,n,r){e.save(),Jn.drawWith(e,{radius:2,width:16,height:16,fill:r}),e.lineCap=`square`,e.strokeStyle=n,e.scale(t/16,t/16),e.beginPath(),e.lineWidth=1,e.lineCap=`round`,e.moveTo(3,4),e.lineTo(13,4),e.moveTo(4.5,8),e.lineTo(11.5,8),e.moveTo(6,12),e.lineTo(10,12),e.stroke(),e.restore()}static drawExpand(e,t,n,r,i){let a=(i-t)/2;e.save(),e.fillStyle=r,e.strokeStyle=n,e.beginPath(),e.moveTo(6,a),e.lineTo(4+t-2,a),e.arcTo(4+t,a,4+t,a+2,2),e.lineTo(4+t,a+t-2),e.arcTo(4+t,a+t,4+t-2,a+t,2),e.lineTo(6,a+t),e.arcTo(4,a+t,4,a+t-2,2),e.lineTo(4,a+2),e.arcTo(4,a,6,a,2),e.closePath(),e.stroke(),e.fill(),e.beginPath(),e.moveTo(4+t/2,a+2),e.lineTo(4+t/2,a+t-2),e.moveTo(6,a+t/2),e.lineTo(4+t-2,a+t/2),e.stroke(),e.restore()}static drawCollapse(e,t,n,r,i){let a=(i-t)/2;e.save(),e.fillStyle=r,e.strokeStyle=n,e.beginPath(),e.moveTo(6,a),e.lineTo(4+t-2,a),e.arcTo(4+t,a,4+t,a+2,2),e.lineTo(4+t,a+t-2),e.arcTo(4+t,a+t,4+t-2,a+t,2),e.lineTo(6,a+t),e.arcTo(4,a+t,4,a+t-2,2),e.lineTo(4,a+2),e.arcTo(4,a,6,a,2),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(6,a+t/2),e.lineTo(4+t-2,a+t/2),e.stroke(),e.restore()}static drawIconByPath(e,t,n,r){e.save(),e.strokeStyle=n,e.fillStyle=r,Jn.drawWith(e,{radius:2,width:16,height:16,fill:r}),t.forEach(t=>{let r=new Path2D(t);e.fillStyle=n,e.fill(r,`evenodd`)}),e.restore()}};const To=[`M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z`],Eo=[`M12.4008 13.1831C12.6907 13.1831 12.9258 12.9481 12.9258 12.6581V4.60873L14.013 5.69597C14.218 5.901 14.5505 5.901 14.7555 5.69597C14.9605 5.49094 14.9605 5.15853 14.7555 4.95351L12.7721 2.97017C12.5671 2.76515 12.2347 2.76515 12.0297 2.97017L10.0463 4.95351C9.84132 5.15853 9.84132 5.49094 10.0463 5.69597C10.2514 5.901 10.5838 5.901 10.7888 5.69597L11.8758 4.60901V12.6581C11.8758 12.9481 12.1108 13.1831 12.4008 13.1831Z`,`M1.28069 4.85447C0.842195 4.33439 1.21191 3.5391 1.89218 3.5391H8.59333C9.2736 3.5391 9.64331 4.33439 9.20482 4.85447L6.51052 8.0501V11.6601C6.51052 12.2245 5.94174 12.6114 5.41683 12.404L4.48092 12.0343C4.1756 11.9136 3.97498 11.6187 3.97498 11.2904V8.0501L1.28069 4.85447Z`],Do=[`M12.4008 2.81641C12.6907 2.81641 12.9258 3.05146 12.9258 3.34141V11.3908L14.013 10.3036C14.218 10.0986 14.5505 10.0986 14.7555 10.3036C14.9605 10.5086 14.9605 10.841 14.7555 11.046L12.7721 13.0294C12.5671 13.2344 12.2347 13.2344 12.0297 13.0294L10.0463 11.046C9.84132 10.841 9.84132 10.5086 10.0463 10.3036C10.2514 10.0986 10.5838 10.0986 10.7888 10.3036L11.8758 11.3905V3.34141C11.8758 3.05146 12.1108 2.81641 12.4008 2.81641Z`,`M1.28069 4.85444C0.842195 4.33435 1.21191 3.53906 1.89218 3.53906H8.59333C9.2736 3.53906 9.64331 4.33435 9.20482 4.85443L6.51052 8.05006V11.6601C6.51052 12.2245 5.94174 12.6113 5.41683 12.404L4.48092 12.0342C4.1756 11.9136 3.97498 11.6186 3.97498 11.2903V8.05006L1.28069 4.85444Z`],Oo=[`M11.9003 13.7046C11.9003 13.9969 11.6633 14.2339 11.371 14.2339C11.0787 14.2339 10.8417 13.9969 10.8417 13.7046V3.57272L9.74577 4.66862C9.53906 4.87534 9.20391 4.87534 8.9972 4.66862C8.79048 4.46191 8.79048 4.12676 8.9972 3.92005L10.9969 1.92039C11.2036 1.71368 11.5387 1.71368 11.7454 1.92039L13.7451 3.92005C13.9518 4.12676 13.9518 4.46191 13.7451 4.66862C13.5384 4.87534 13.2032 4.87534 12.9965 4.66862L11.9003 3.57243V13.7046Z`,`M2.69779 10.0113C2.40546 10.0113 2.16847 9.77429 2.16847 9.48196C2.16847 9.18962 2.40546 8.95264 2.69779 8.95264H6.67804C6.89213 8.95264 7.08514 9.0816 7.16707 9.2794C7.249 9.47719 7.20371 9.70486 7.05233 9.85624L3.97569 12.9329H6.67804C6.97038 12.9329 7.20736 13.1699 7.20736 13.4622C7.20736 13.7545 6.97038 13.9915 6.67804 13.9915H2.69779C2.4837 13.9915 2.29069 13.8626 2.20876 13.6648C2.12684 13.467 2.17212 13.2393 2.32351 13.0879L5.40015 10.0113H2.69779Z`,`M5.51638 2.58693C5.23363 1.81542 4.14248 1.81543 3.85973 2.58693L2.13245 7.29995C2.03185 7.57443 2.17281 7.87849 2.4473 7.97909C2.72178 8.07969 3.02584 7.93872 3.12644 7.66424L3.64346 6.25351L3.64504 6.25351H5.73266L6.24968 7.66424C6.35027 7.93872 6.65433 8.07969 6.92882 7.97909C7.2033 7.87849 7.34426 7.57443 7.24367 7.29995L5.51638 2.58693ZM5.34467 5.19487L4.68806 3.40325L4.03144 5.19487H5.34467Z`],ko=[`M11.9003 2.29495C11.9003 2.00261 11.6633 1.76562 11.371 1.76562C11.0787 1.76562 10.8417 2.00261 10.8417 2.29495V12.4268L9.74577 11.3309C9.53906 11.1242 9.20391 11.1242 8.9972 11.3309C8.79048 11.5376 8.79048 11.8727 8.9972 12.0795L10.9969 14.0791C11.2036 14.2858 11.5387 14.2858 11.7454 14.0791L13.7451 12.0795C13.9518 11.8727 13.9518 11.5376 13.7451 11.3309C13.5384 11.1242 13.2032 11.1242 12.9965 11.3309L11.9003 12.4271V2.29495Z`,`M2.69792 10.0113C2.40558 10.0113 2.16859 9.77429 2.16859 9.48196C2.16859 9.18962 2.40558 8.95264 2.69792 8.95264H6.67816C6.89225 8.95264 7.08526 9.0816 7.16719 9.2794C7.24912 9.47719 7.20384 9.70486 7.05245 9.85624L3.97581 12.9329H6.67816C6.9705 12.9329 7.20749 13.1699 7.20749 13.4622C7.20749 13.7545 6.9705 13.9915 6.67816 13.9915H2.69792C2.48383 13.9915 2.29082 13.8626 2.20889 13.6648C2.12696 13.467 2.17224 13.2393 2.32363 13.0879L5.40027 10.0113H2.69792Z`,`M5.5165 2.58693C5.23375 1.81542 4.1426 1.81543 3.85985 2.58693L2.13257 7.29995C2.03197 7.57443 2.17294 7.8785 2.44742 7.97909C2.7219 8.07969 3.02596 7.93872 3.12656 7.66424L3.64358 6.25351L3.64516 6.25351H5.73278L6.2498 7.66424C6.35039 7.93872 6.65446 8.07969 6.92894 7.97909C7.20342 7.8785 7.34438 7.57443 7.24379 7.29995L5.5165 2.58693ZM5.34479 5.19487L4.68818 3.40325L4.03156 5.19487H5.34479Z`],Ao=/* @__PURE__ */ new Set([t.FilterAll,t.FilterPartial,t.FilterSingle,t.FilterNoneSortNone,t.FilteredSortAsc,t.FilteredSortDesc,t.FilteredSortNone,t.FilterNoneSortAsc,t.FilterNoneSortDesc]),jo=/* @__PURE__ */ new Set([t.Expand,t.Collapse]);let Mo=class extends Yn{constructor(e,t,n,r){super(e,t),this._commandService=n,this._themeService=r,X(this,`_cellWidth`,0),X(this,`_cellHeight`,0),X(this,`_hovered`,!1),X(this,`_pivotParams`,void 0),this.setShapeProps(t),this.onPointerDown$.subscribeEvent(e=>this.onPointerDown(e)),this.onPointerEnter$.subscribeEvent(()=>this.onPointerEnter()),this.onPointerLeave$.subscribeEvent(()=>this.onPointerLeave())}setShapeProps(e){e.cellHeight!==void 0&&(this._cellHeight=e.cellHeight),e.cellWidth!==void 0&&(this._cellWidth=e.cellWidth),e.pivotParams!==void 0&&(this._pivotParams=e.pivotParams),this.transformByState({width:e.width,height:e.height})}onPointerDown(e){if(e.button===2)return;let{col:n,row:r,unitId:i,subUnitId:a,buttonType:o}=this._pivotParams;Ao.has(o)?setTimeout(()=>{this._commandService.executeCommand($i.id,{row:r,col:n,unitId:i,subUnitId:a})},200):this._commandService.executeCommand(ce.id,{row:r,col:n,unitId:i,subUnitId:a,collapse:o===t.Expand})}onPointerEnter(){this._hovered=!0,this.setCursor(Kn.POINTER),this.makeDirty(!0)}onPointerLeave(){this._hovered=!1,this.setCursor(Kn.DEFAULT),this.makeDirty(!0)}_draw(e){var n,r;if(!((n=this._pivotParams)!=null&&n.buttonType))return;let i=this._themeService.getColorFromTheme(`primary.600`),a=this._themeService.getColorFromTheme(`gray.50`);e.save();let o=new Path2D;o.rect(0,0,this._cellWidth,this._cellHeight),e.clip(o),((r=this._pivotParams)==null?void 0:r.buttonType)===t.Collapse?wo.drawExpand(e,12,i,a,this._cellHeight):this._pivotParams.buttonType===t.Expand?wo.drawCollapse(e,12,i,a,this._cellHeight):this._pivotParams.buttonType===t.FilterAll||this._pivotParams.buttonType===t.FilterNoneSortNone?wo.drawNoSetting(e,16,i,a):this._pivotParams.buttonType===t.FilterPartial||this._pivotParams.buttonType===t.FilterSingle||this._pivotParams.buttonType===t.FilteredSortNone?wo.drawIconByPath(e,To,i,a):this._pivotParams.buttonType===t.FilterNoneSortAsc?wo.drawIconByPath(e,Oo,i,a):this._pivotParams.buttonType===t.FilterNoneSortDesc?wo.drawIconByPath(e,ko,i,a):this._pivotParams.buttonType===t.FilteredSortAsc?wo.drawIconByPath(e,Eo,i,a):this._pivotParams.buttonType===t.FilteredSortDesc&&wo.drawIconByPath(e,Do,i,a),e.restore()}};Mo=Q([Z(2,P),Z(3,I(Qe))],Mo);let No=class extends Yn{constructor(e,t,n,r){super(e,t),this._commandService=n,this._themeService=r,X(this,`_cellWidth`,void 0),X(this,`_cellHeight`,void 0),X(this,`_pivotParams`,void 0),this._cellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._pivotParams=t.pivotParams,this.transformByState({width:t.width,height:t.height}),this.onPointerUp$.subscribeEvent(e=>this._handlePointerUp(e))}_handlePointerUp(e){if(e.button===2)return;let{col:n,row:r,unitId:i,subUnitId:a,buttonType:o}=this._pivotParams;if(Ao.has(o))return this._commandService.executeCommand($i.id,{row:r,col:n,unitId:i,subUnitId:a});if(jo.has(o))return this._commandService.executeCommand(ce.id,{row:r,col:n,unitId:i,subUnitId:a,collapse:o===t.Expand})}_draw(e){let n=this._pivotParams.buttonType,r=this._themeService.getColorFromTheme(`primary.600`),i=this._themeService.getColorFromTheme(`gray.50`);e.save();let a=new Path2D;a.rect(0,0,this._cellWidth,this._cellHeight),e.clip(a),e.translate(6,6),n===t.Collapse?wo.drawExpand(e,12,r,i,this._cellHeight):n===t.Expand?wo.drawCollapse(e,12,r,i,this._cellHeight):n===t.FilterAll||n===t.FilterNoneSortNone?wo.drawNoSetting(e,16,r,i):n===t.FilterPartial||n===t.FilterSingle||n===t.FilteredSortNone?wo.drawIconByPath(e,To,r,i):n===t.FilterNoneSortAsc?wo.drawIconByPath(e,Oo,r,i):n===t.FilterNoneSortDesc?wo.drawIconByPath(e,ko,r,i):n===t.FilteredSortAsc?wo.drawIconByPath(e,Eo,r,i):n===t.FilteredSortDesc&&wo.drawIconByPath(e,Do,r,i),e.restore()}};No=Q([Z(2,P),Z(3,I(Qe))],No);function Po(e,t,n){let{startX:r,startY:i,endX:a,endY:o}=n;return{left:(t===`filter`?e!==`rtl`:e===`rtl`)?a-16-1:r+1,top:t===`filter`?o-16-1:i+1}}let Fo=class extends N{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._context=e,this._injector=t,this._adaptorModel=n,this._skeletonManagerService=r,this._configModel=i,this._permissionController=a,this._permissionService=o,this._localeService=s,this._dialogService=c,this._contextMenuController=l,X(this,`_buttonShapes`,[]),this._initContextMenu(),this._initButtonRender(),this._initSkeleton()}dispose(){this._clearButtons(),super.dispose()}_clearButtons(){this._buttonShapes.forEach(e=>e.dispose()),this._buttonShapes.length=0}_initContextMenu(){if(!this._contextMenuController)return;let e=this._contextMenuController.contextMenuInterceptor.intercept(Zt,{handler:(e,t,n)=>{if(e||t.menuPosition!==Lt.MAIN_AREA)return n(e);let{col:r,row:i,subUnitId:a,unitId:o}=t;if(r==null||i==null)return n(e);let s=this._adaptorModel.getPivotTableIdByCell(o,a,i,r);return s?(this._openPivotActionPanel(o,a,s,i,r),!0):n(e)}});this.disposeWithMe(dt(e))}_openPivotActionPanel(e,t,n,r,i){let a=this._permissionController.permissionCheckWithRanges({workbookTypes:[Et],worksheetTypes:[kt],rangeTypes:[vt]},[{startRow:r,endRow:r,startColumn:i,endColumn:i}],e,t);this._dialogService.open({id:Br,title:{title:this._localeService.t(`sheets-pivot-ui.title`)},children:{label:{name:zr,props:{editable:a,pivotTableId:n,subUnitId:t,unitId:e}}},onClose:()=>this._dialogService.close(Br)})}_initButtonRender(){this.disposeWithMe(yn(this._adaptorModel.viewUpdate$.pipe(pn(0)),this._skeletonManagerService.currentSkeleton$,this._configModel.pivotConfigChange$,this._permissionService.permissionPointUpdate$.pipe(pn(100))).subscribe(()=>{let e=this._context.unit,t=this._skeletonManagerService.getCurrentSkeleton();if(!e||!t)return;let n=e.getActiveSheet(),r=e.getUnitId(),i=n.getSheetId(),a=this._localeService.getDirection(),{scene:o}=this._context;this._clearButtons(),this._adaptorModel.getSubUnitPivotMatrix(r,i).forValue((e,n,s)=>{if(!(s!=null&&s.pbt))return;let{startX:c,startY:l,endX:u,endY:d}=on(e,n,o,t),f=u-c,p=d-l;if(p<8||f<8||!this._permissionController.permissionCheckWithRanges({workbookTypes:[Et],worksheetTypes:[At,Dt,kt],rangeTypes:[yt,vt]},[{startRow:e,endRow:e,startColumn:n,endColumn:n}],r,i))return;let m;if(Ao.has(s.pbt))m=`filter`;else if(jo.has(s.pbt))m=`collapse`;else return;let h=Po(a,m,{startX:c,startY:l,endX:u,endY:d}),g={left:h.left-6,top:h.top-6,width:28,height:28,zIndex:5e3,cellWidth:f,cellHeight:p,pivotParams:{row:e,col:n,unitId:r,subUnitId:i,buttonType:s.pbt}},_=`sheets-mobile-pivot-button-${e}-${n}-${r}-${i}`;this._buttonShapes.push(this._injector.createInstance(No,_,g))}),this._buttonShapes.length&&o.addObjects(this._buttonShapes),o.makeDirty()}))}_initSkeleton(){var e;this.disposeWithMe(this._adaptorModel.markDirty$.subscribe(({unitId:e,subUnitId:t})=>{if(e===this._context.unitId&&(this._skeletonManagerService.makeDirty({sheetId:t}),this._context.unit.getActiveSheet().getSheetId()===t)){var n;this._skeletonManagerService.reCalculate(),(n=this._context.mainComponent)==null||n.makeDirty()}}));let t=this._context.unitId;this._context.unit.getSheets().forEach(e=>{var n;let r=e.getSheetId();(n=this._adaptorModel.getSubUnitPivotRenderCache(t,r))!=null&&n.size&&this._skeletonManagerService.makeDirty({sheetId:r})}),this._skeletonManagerService.reCalculate(),(e=this._context.mainComponent)==null||e.makeDirty()}};Fo=Q([Z(1,I(Ke)),Z(2,I(j)),Z(3,I(tn)),Z(4,I(M)),Z(5,I(Ct)),Z(6,I(Ge)),Z(7,I(L)),Z(8,R),Z(9,qe($t))],Fo);let Io=class extends N{constructor(e,t,n){super(),this._univerInstanceService=e,this._sheetsPivotTableAdaptorModel=t,this._sheetClipboardService=n,this._initialize()}_initialize(){let e=this,t,n;this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:se,onBeforeCopy(r,i){let a=e._univerInstanceService.getUnit(r,et.UNIVER_SHEET);a&&(t=e._sheetsPivotTableAdaptorModel.getSubUnitPivotMatrix(r,i),n=a.getStyles())},onAfterCopy(){t=null,n=null},getCellValueBySpecialMatrix(e,r){if(!t)return;let i=t==null?void 0:t.getValue(e,r);if(i){var a;return{...i,s:n==null?void 0:n.get(i.s),displayV:((a=i.v)==null?void 0:a.toString())||``}}}}))}};Io=Q([Z(0,I(F)),Z(1,I(j)),Z(2,Yt)],Io);const Lo=[ht.id,bt.id,xt.id,mt.id];let Ro=class extends N{constructor(e,t,n,r,i,a,o,s,c){var l;super(),this._injector=e,this._univerInstanceService=t,this._sheetsPivotTableAdaptorModel=n,this._sheetInterceptorService=r,this._confirmService=i,this._localeService=a,this._sheetsPivotTableConfigModel=o,this._messageService=s,this._configService=c,X(this,`_defaultOverride`,!1),this._initMoveRangeConfirmCheck(),this._initRowColOperationCheck(),this._defaultOverride=((l=this._configService.getConfig(oe))==null?void 0:l.defaultOverride)??!1}_initMoveRangeConfirmCheck(){this.disposeWithMe(this._sheetInterceptorService.interceptBeforeCommand({performCheck:async e=>{if(e.id===_t.id){let t=Nt(this._univerInstanceService);if(!t)return Promise.resolve(!1);let{unitId:n,subUnitId:r}=t,{fromRange:i,toRange:a}=e.params,o=this._sheetsPivotTableConfigModel.getSubUnitPivotConfigs(n,r);if(!(o!=null&&o.size))return Promise.resolve(!0);for(let[e,t]of o){let{targetCellInfo:o}=t,{row:s,col:c}=o,l=s-i.startRow,u=c-i.startColumn,d={row:a.startRow+l,col:a.startColumn+u},f=d.row-o.row,p=d.col-o.col,m=this._sheetsPivotTableAdaptorModel.getPivotItemRenderInfoCache(n,r,e),h=m==null?void 0:m.rangesInfo;if(!h)return Promise.resolve(!0);let g=[];Object.keys(h).forEach(e=>{h[e].forEach(e=>{let t={...e};t.startRow=e.startRow+f,t.endRow=e.endRow+f,t.startColumn=e.startColumn+p,t.endColumn=e.endColumn+p,g.push(t)})});let _=this._sheetInterceptorService.generateMutationsByRanges({unitId:n,subUnitId:r,ranges:g}),v=Te(this._injector,n,r,g);if(_.redos.length||v.shouldClear){if(this._defaultOverride)return Promise.resolve(!0);{let e=await this._confirmService.confirm({id:`sheet-pivot.confirm.add-sheet-pivot`,title:{title:this._localeService.t(`sheets-pivot-ui.perform.tips`)},children:{title:this._localeService.t(`sheets-pivot-ui.perform.info`)},cancelText:this._localeService.t(`sheets-pivot-ui.perform.cancel`),confirmText:this._localeService.t(`sheets-pivot-ui.perform.confirm`)});return Promise.resolve(e)}}}}return Promise.resolve(!0)}}))}_initRowColOperationCheck(){this.disposeWithMe(this._sheetInterceptorService.interceptBeforeCommand({performCheck:async e=>{if(Lo.includes(e.id)){let t=e.params,{range:n}=t,r=Nt(this._univerInstanceService),i=t.unitId||(r==null?void 0:r.unitId),a=t.subUnitId||(r==null?void 0:r.subUnitId);if(!i||!a)return Promise.resolve(!0);let o=this._sheetsPivotTableConfigModel.getSubUnitPivotConfigs(i,a);if(o!=null&&o.size)for(let[e,t]of o){let t=this._sheetsPivotTableAdaptorModel.getPivotItemRenderInfoCache(i,a,e);if(t!=null&&t.rangesInfo){for(let e of Object.keys(t.rangesInfo))if(t.rangesInfo[e].some(e=>Ze.intersects(e,n)))return this._messageService.show({type:jn.Error,content:this._localeService.t(`sheets-pivot-ui.perform.rowColError`)}),Promise.resolve(!1)}}}return Promise.resolve(!0)}}))}};Ro=Q([Z(0,I(Ke)),Z(1,I(F)),Z(2,I(j)),Z(3,I(St)),Z(4,I(Ue)),Z(5,I(L)),Z(6,I(M)),Z(7,I(zt)),Z(8,I(He))],Ro);const zo=[Cr.id,wr.id,Qt.id];let Bo=class extends N{constructor(e,t,n,r,i,a){super(),this._sheetsSelectionsService=e,this._univerInstanceService=t,this._sheetsPivotTableAdaptorModel=n,this._commandService=r,this._sheetsPivotTableConfigModel=i,this._localeService=a,this._initEditListener()}_initEditListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{if(zo.includes(e.id)){var t;let n=(t=this._sheetsSelectionsService.getCurrentLastSelection())==null?void 0:t.primary;if(!n)return;let{actualRow:r,actualColumn:i}=n,a=tt(r,i),o=Nt(this._univerInstanceService,e.params);if(!o)return;let{unitId:s,subUnitId:c}=o,l=this._sheetsPivotTableConfigModel.getSubUnitPivotConfigs(s,c);if(l!=null&&l.size)for(let[e]of l){let t=this._sheetsPivotTableAdaptorModel.getPivotItemRenderInfoCache(s,c,e);if(t!=null&&t.rangesInfo){for(let e of Object.keys(t.rangesInfo))if(t.rangesInfo[e].some(e=>Ze.intersects(e,a)))throw new Le(this._localeService.t(`sheets-pivot-ui.msg.editCellError`))}}}}))}};Bo=Q([Z(0,I(wt)),Z(1,I(F)),Z(2,I(j)),Z(3,I(P)),Z(4,I(M)),Z(5,I(L))],Bo);let Vo=class extends N{constructor(e,t,n,r){super(),this._sheetsPivotTableAdaptorModel=e,this._formatPainterService=t,this._messageService=n,this._localeService=r,this._initFormatPainterListener()}_initFormatPainterListener(){let e=this._sheetsPivotTableAdaptorModel,t=this._messageService,n=this._localeService;this._formatPainterService.addHook({id:`pivot-format-painter-hook`,onBeforeApply(r){let{redoMutationsInfo:i}=r;for(let r of i)if(r.id===pt.id){let{unitId:i,subUnitId:a,ranges:o}=r.params;for(let r of o)if(e.getIntersectsPivotTable(i,a,r).length>0)return t.show({type:jn.Error,content:n.t(`sheets-pivot-ui.msg.mergeCellError`)}),!1}return!0}})}};Vo=Q([Z(0,I(j)),Z(1,I(Jt)),Z(2,I(zt)),Z(3,I(L))],Vo);let Ho=class extends N{constructor(e,t,n){super(),this._sheetPrintInterceptorService=e,this._sheetsPivotTableAdaptorModel=t,this._sheetsPivotTableConfigModel=n,this._initPrintArea()}_initPrintArea(){this.disposeWithMe(this._sheetPrintInterceptorService.interceptor.intercept(this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_RANGE,{handler:(e,t,n)=>{let{unitId:r,subUnitId:i}=t,a=(e==null?void 0:e.startRow)??1/0,o=(e==null?void 0:e.endRow)??-1/0,s=(e==null?void 0:e.startColumn)??1/0,c=(e==null?void 0:e.endColumn)??-1/0,l=this._sheetsPivotTableConfigModel.getSubUnitPivotConfigs(r,i);if(!l)return n(e);for(let[e,t]of l){var u;let t=(u=this._sheetsPivotTableAdaptorModel.getPivotItemRenderInfoCache(r,i,e))==null?void 0:u.rangesInfo;t&&Object.values(t).forEach(e=>{e.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=e;a=Math.min(t,a),o=Math.max(n,o),s=Math.min(r,s),c=Math.max(i,c)})})}let d={startRow:a,endRow:o,startColumn:s,endColumn:c};return ct(d)?n(d):n(e)}}))}};Ho=Q([Z(0,I(en)),Z(1,I(j)),Z(2,I(M))],Ho);let Uo=class extends N{constructor(e,t,n){super(),this._mergeCellController=e,this._univerInstanceService=t,this._sheetsPivotTableConfigModel=n,this._initMenuInterceptor()}_initMenuInterceptor(){this.disposeWithMe(this._mergeCellController.interceptor.intercept(this._mergeCellController.interceptor.getInterceptPoints().MERGE_CELL_INTERCEPTOR_CHECK,{handler:(e,t)=>{let n=Nt(this._univerInstanceService);if(!n)return e;let{unitId:r,subUnitId:i}=n,a=this._sheetsPivotTableConfigModel.getSubUnitPivotConfigs(r,i),o=[];return a&&a.forEach((e,t)=>{var n;let a=(n=this._sheetsPivotTableConfigModel.getPivotTableRangeInfo(r,i,t))==null?void 0:n.rangeInfo;a&&Object.keys(a).forEach(e=>{let t=a[e];Array.isArray(t)&&o.push(...t)})}),o.length&&t.some(e=>o.some(t=>Ze.intersects(t,e)))?!0:e}}))}};Uo=Q([Z(0,I(gt)),Z(1,I(F)),Z(2,I(M))],Uo);let Wo=class extends Je{constructor(e=ia,t,n,r,i){super(),this._config=e,this._injector=t,this._commandService=n,this._renderManagerService=r,this._configService=i;let{menu:a,...o}=lt({},ia,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(ra,o),this._registerCommands()}onStarting(){[[yo],[So],[Co],[Uo],[Ro],[Ho],[Bo],[Vo],[ca],[Io]].forEach(e=>this._injector.add(e)),ft(this._injector,[[yo],[So],[Co],[ca]])}onRendered(){this._registerRenderModules(),ft(this._injector,[[Ro],[Ho],[Bo],[Vo],[Io]])}onSteady(){ft(this._injector,[[Uo]])}_registerCommands(){[na,Vr,$i,ea,Ur].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_registerRenderModules(){this.disposeWithMe(this._renderManagerService.registerRenderModule(et.UNIVER_SHEET,[Fo]))}};X(Wo,`pluginName`,`${se}_UI_PLUGIN`),X(Wo,`packageName`,Zi),X(Wo,`version`,Qi),X(Wo,`type`,et.UNIVER_SHEET),Wo=Q([ze(Gn,Xn,Tt,xe,rn,Wt),Z(1,I(Ke)),Z(2,P),Z(3,qn),Z(4,He)],Wo);const Go=[o.Year,o.Quarter,o.Month,o.Day,o.Hour,o.Minute,o.Second],Ko={[o.Year]:`sheets-pivot-ui.dateGroup.year`,[o.Quarter]:`sheets-pivot-ui.dateGroup.quarter`,[o.Month]:`sheets-pivot-ui.dateGroup.month`,[o.Day]:`sheets-pivot-ui.dateGroup.day`,[o.Hour]:`sheets-pivot-ui.dateGroup.hour`,[o.Minute]:`sheets-pivot-ui.dateGroup.minute`,[o.Second]:`sheets-pivot-ui.dateGroup.second`},qo=`univer-h-8 univer-rounded-md univer-border univer-border-gray-300 univer-bg-gray-0 univer-px-2 univer-text-sm univer-text-gray-900 dark:univer-bg-gray-700 dark:univer-text-gray-0`;function Jo({targetFieldName:e,dateSystem:t,grouping:n,onConfirm:r,onCancel:i}){let a=z(L),s=B(a.direction$,a.getDirection()),c=(e,n)=>{let r=e===void 0?null:at(e,{dateSystem:t});if(!r)return{date:``,time:n};let i=e=>String(e).padStart(2,`0`);return{date:`${r.year}-${i(r.month)}-${i(r.day)}`,time:`${i(r.hours)}:${i(r.minutes)}:${i(r.seconds)}`}},[l,u]=Y((n==null?void 0:n.units)??[o.Day]),[d,f]=Y((n==null?void 0:n.autoStart)??!0),[p,m]=Y((n==null?void 0:n.autoEnd)??!0),[h,g]=Y(()=>c(n==null?void 0:n.start,`00:00:00`).date),[_,v]=Y(()=>c(n==null?void 0:n.end,`23:59:59`).date),[y,b]=Y(()=>c(n==null?void 0:n.start,`00:00:00`).time),[x,S]=Y(()=>c(n==null?void 0:n.end,`23:59:59`).time),[C,w]=Y((n==null?void 0:n.daysInterval)??1),[T,E]=Y(!1),D=J(!1),O=l.some(e=>e===o.Hour||e===o.Minute||e===o.Second),ee=l.length===1&&l[0]===o.Day,te=(e,n,r)=>{let i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e),a=/^(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(n);return!i||!a?null:it({year:Number(i[1]),month:Number(i[2]),day:Number(i[3]),hours:O?Number(a[1]):r?23:0,minutes:O?Number(a[2]):r?59:0,seconds:O?Number(a[3]??0):r?59:0,fractionalSecond:r?.999:0},{dateSystem:t})},k=d?void 0:te(h,y,!1),ne=p?void 0:te(_,x,!0),A=l.length>0&&(d||k!==null)&&(p||ne!==null)&&(k==null||ne==null||k<=ne)&&(!ee||Number.isInteger(C)&&C>=1);return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,dir:s,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium`,children:e}),/* @__PURE__ */ G(`fieldset`,{children:[/* @__PURE__ */ W(`legend`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:a.t(`sheets-pivot-ui.dateGroup.groupBy`)}),/* @__PURE__ */ W(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2`,children:Go.map(e=>/* @__PURE__ */ W(H,{checked:l.includes(e),onChange:t=>u(n=>t?Go.filter(t=>t===e||n.includes(t)):n.filter(t=>t!==e)),children:a.t(Ko[e])},e))})]}),ee&&/* @__PURE__ */ G(`label`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-3 univer-text-sm`,children:[a.t(`sheets-pivot-ui.dateGroup.daysInterval`),/* @__PURE__ */ W(An,{className:`univer-w-24`,value:C,min:1,onChange:e=>w(Number(e))})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ W(H,{checked:d,onChange:e=>f(!!e),children:a.t(`sheets-pivot-ui.dateGroup.autoStart`)}),!d&&/* @__PURE__ */ G(`label`,{className:`univer-flex univer-items-center univer-gap-2 univer-text-sm`,children:[a.t(`sheets-pivot-ui.dateGroup.start`),/* @__PURE__ */ W(kn,{type:`date`,value:h,onChange:g}),O&&/* @__PURE__ */ W(`input`,{className:qo,type:`time`,step:1,value:y,onChange:e=>b(e.target.value)})]}),/* @__PURE__ */ W(H,{checked:p,onChange:e=>m(!!e),children:a.t(`sheets-pivot-ui.dateGroup.autoEnd`)}),!p&&/* @__PURE__ */ G(`label`,{className:`univer-flex univer-items-center univer-gap-2 univer-text-sm`,children:[a.t(`sheets-pivot-ui.dateGroup.end`),/* @__PURE__ */ W(kn,{type:`date`,value:_,onChange:v}),O&&/* @__PURE__ */ W(`input`,{className:qo,type:`time`,step:1,value:x,onChange:e=>S(e.target.value)})]})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[/* @__PURE__ */ W(V,{onClick:i,children:a.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:!A||T,onClick:async()=>{if(!A||D.current)return;let e={units:Go.filter(e=>l.includes(e)),autoStart:d,autoEnd:p};!d&&k!=null&&(e.start=k),!p&&ne!=null&&(e.end=ne),ee&&C>1&&(e.daysInterval=C),D.current=!0,E(!0);try{await r(e)}catch{}finally{D.current=!1,E(!1)}},children:a.t(`sheets-pivot-ui.dialog.ok`)})]})]})}function Yo(e){let t=e.operator===h.dateBetween||e.operator===h.dateNotBetween,n={type:s.CustomFilter,operator:e.operator,expected:t?[e.lower,e.upper]:e.lower,useWholeDay:e.useWholeDay};try{return g(n),n}catch{return}}function Xo(e,t){let n=at(e,{dateSystem:t});if(!n||n.day===0||n.year===1900&&n.month===2&&n.day===29)return;let r=new Date(2e3,0,1,12);return r.setFullYear(n.year,n.month-1,n.day),r}function Zo(e,t,n){let r=it({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hours:0,minutes:0,seconds:0,fractionalSecond:0},{dateSystem:n});return r===null?void 0:r+(e===void 0?0:e-Math.floor(e))}function Qo(e,t){return e===void 0||!Number.isFinite(t.getTime())?e:Math.floor(e)+(t.getHours()*3600+t.getMinutes()*60+t.getSeconds()+t.getMilliseconds()/1e3)/86400}const $o=[{value:h.dateEqual,label:`sheets-pivot-ui.dateFilter.equal`},{value:h.dateNotEqual,label:`sheets-pivot-ui.dateFilter.notEqual`},{value:h.dateNewerThan,label:`sheets-pivot-ui.dateFilter.after`},{value:h.dateNewerThanOrEqual,label:`sheets-pivot-ui.dateFilter.afterOrEqual`},{value:h.dateOlderThan,label:`sheets-pivot-ui.dateFilter.before`},{value:h.dateOlderThanOrEqual,label:`sheets-pivot-ui.dateFilter.beforeOrEqual`},{value:h.dateBetween,label:`sheets-pivot-ui.dateFilter.between`},{value:h.dateNotBetween,label:`sheets-pivot-ui.dateFilter.notBetween`}];function es({dateSystem:e,defaultDate:t,currentFilter:n,onConfirm:r,onCancel:i}){let a=z(L);B(a.currentLocale$);let o=B(a.direction$,a.getDirection()),[s,c]=Y((n==null?void 0:n.operator)??h.dateEqual),l=Array.isArray(n==null?void 0:n.expected)?n.expected[0]:n==null?void 0:n.expected,u=Array.isArray(n==null?void 0:n.expected)?n.expected[1]:void 0,[d,f]=Y(()=>l??t??Zo(void 0,/* @__PURE__ */ new Date,e)),[p,m]=Y(()=>u??l??t??Zo(void 0,/* @__PURE__ */ new Date,e)),[g,_]=Y((n==null?void 0:n.useWholeDay)===!0),[v,y]=Y(!1),[b,x]=Y(!1),S=J(!1),C=ee(d),w=ee(p),T=s===h.dateBetween||s===h.dateNotBetween,E=Yo({operator:s,lower:C,upper:w,useWholeDay:g}),D=E!==void 0&&n!==void 0&&s===n.operator&&g===(n.useWholeDay===!0)&&$e.diffValue(E.expected,n.expected);async function O(e){if(!S.current){S.current=!0,y(!0),x(!1);try{await r(e)||x(!0)}catch{x(!0)}finally{S.current=!1,y(!1)}}}function ee(e){return typeof e==`string`?e.trim()===``?void 0:Number(e):e}function te(e,t){t?m(e):f(e)}function k(t,n){let r=Zo(n?w:C,t,e);n?m(r):f(r)}function ne(e,t){let n=t?w:C;if(n===void 0)return;let r=Qo(n,e);t?m(r):f(r)}return/* @__PURE__ */ G(`div`,{dir:o,className:`univer-flex univer-min-w-0 univer-flex-col univer-gap-3`,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium`,children:a.t(`sheets-pivot-ui.dateFilter.title`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-1`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-xs`,children:a.t(`sheets-pivot-ui.dateFilter.rule`)}),/* @__PURE__ */ W(zn,{className:`univer-w-full`,value:String(s),options:$o.map(e=>({value:String(e.value),label:a.t(e.label)})),onChange:e=>c(Number(e))})]}),(T?[!1,!0]:[!1]).map(n=>{let r=n?w:C,i=r===void 0?void 0:Xo(r,e),o=(n?u:void 0)??l??t,s=o!==void 0&&!Xo(o,e),c=r===void 0?null:at(r,{dateSystem:e}),f=c?new Date(2e3,0,1,c.hours,c.minutes,c.seconds,Math.floor(c.fractionalSecond*1e3)):void 0,m=`sheets-pivot-ui.dateFilter.date`;return T&&(m=n?`sheets-pivot-ui.dateFilter.to`:`sheets-pivot-ui.dateFilter.from`),/* @__PURE__ */ G(`div`,{role:`group`,"aria-label":a.t(m),className:`univer-flex univer-min-w-0 univer-flex-col univer-gap-1`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-xs`,children:a.t(m)}),s?/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-1`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-xs univer-text-gray-500`,children:a.t(`sheets-pivot-ui.dateFilter.serial`)}),/* @__PURE__ */ W(kn,{value:String((n?p:d)??``),onChange:e=>te(e,n)})]}):/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-wrap univer-items-center univer-gap-2`,children:[/* @__PURE__ */ W(Dn,{value:i,onValueChange:e=>k(e,n)}),!g&&r!==void 0&&/* @__PURE__ */ W(Vn,{value:f,onValueChange:e=>ne(e,n)})]})]},String(n))}),/* @__PURE__ */ W(H,{checked:g,onChange:e=>_(e===!0),children:a.t(`sheets-pivot-ui.dateFilter.wholeDay`)}),b&&/* @__PURE__ */ W(`div`,{role:`alert`,className:`univer-text-xs univer-text-red-500`,children:a.t(`sheets-pivot-ui.dateFilter.failed`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-wrap univer-items-center univer-justify-between univer-gap-2`,children:[/* @__PURE__ */ W(V,{variant:`link`,disabled:v||!n,onClick:()=>O(void 0),children:a.t(`sheets-pivot-ui.dialog.filter.clearFilter`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-gap-2`,children:[/* @__PURE__ */ W(V,{disabled:v,onClick:i,children:a.t(`sheets-pivot-ui.dialog.filter.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:v||!E||D,onClick:()=>O(E),children:a.t(`sheets-pivot-ui.dialog.filter.confirm`)})]})]})]})}function ts(e){let{dialogId:t=Or,filterItemInfo:i,onClose:a,onSetFilter:o,onSetSort:s,onSetDateFilter:c,unitId:l,subUnitId:u}=e,{format:d,filterInfo:f,sortInfo:p}=i,m=i.conditionFilter??f,h=z(P),g=z(L);B(g.currentLocale$);let _=z(R),v=z(F),y=B(g.direction$,g.getDirection()),b=J(!0),[x,C]=Y(!1);q(()=>(b.current=!0,()=>{b.current=!1}),[]);let[w,T]=Y(()=>i?i.checkedItems??(f==null?void 0:f.list)??i.items:[]),[E,D]=Y(()=>i.partialItems??[]),O=E.length===0&&w.length===i.items.length,ee=w.length===0&&E.length===0,[te,k]=Y(()=>{if(i)return p==null?void 0:p.type}),ne=()=>{b.current&&(b.current=!1,a?a():_.close(t))};if(q(()=>{let e=v.getCurrentUnitOfType(et.UNIVER_SHEET);if(!e)return;let n=e.activeSheet$.subscribe(e=>{e&&e.getSheetId()!==u&&b.current&&(b.current=!1,a?a():_.close(t))});return()=>n==null?void 0:n.unsubscribe()},[t,_,a,u,v]),!i)return;let A=()=>{D([]),T(O?[]:i.items)},re=e=>{E.includes(e)?(D(E.filter(t=>t!==e)),T([...w,e])):w.includes(e)?T(w.filter(t=>t!==e)):T([...w,e])},ie=async()=>{let{tableFieldId:e,pivotTableId:t}=i;if(e&&t)try{(o?await o(w,O,E):await h.executeCommand(fe.id,{unitId:l,subUnitId:u,pivotTableId:t,tableFieldId:e,items:w,partialItems:E,isAll:O}))&&b.current&&ne()}catch{}},ae=()=>{ne()},oe=async()=>{let{tableFieldId:e,pivotTableId:t}=i;if(e&&t){T(i.items),D([]);try{(o?await o(i.items,!0,[],!0):await h.executeCommand(fe.id,{unitId:l,subUnitId:u,pivotTableId:t,tableFieldId:e,items:i.items,partialItems:[],isAll:!0,clearAllFilters:!0}))&&b.current&&ne()}catch{}}},se=async e=>{let{tableFieldId:t,pivotTableId:n}=i;if(!t||!n)return;let r={type:e};try{(s?await s(r):await h.executeCommand(_e.id,{unitId:l,subUnitId:u,pivotTableId:n,tableFieldId:t,info:r}))&&b.current&&(k(e),ne())}catch{}},ce=Ha(f,{items:i.items,conditionFilter:i.conditionFilter});async function ue(e){if(!b.current)return!1;let t=c?await c(e):await h.executeCommand(le.id,{unitId:l,subUnitId:u,pivotTableId:i.pivotTableId,tableFieldId:i.tableFieldId,filterInfo:e});return t&&b.current&&ne(),t}if(x){let e=v.getUnit(l),t=i.itemTypes.findIndex(e=>e===n.date),r=Number(i.items[t]);return/* @__PURE__ */ W(es,{dateSystem:(e==null?void 0:e.getDateSystem())??Re.Date1900,defaultDate:Number.isFinite(r)?r:void 0,currentFilter:S(m)?m:void 0,onConfirm:ue,onCancel:()=>C(!1)})}return/* @__PURE__ */ G(`div`,{dir:y,children:[i.supportsDateFilter&&/* @__PURE__ */ W(V,{className:`univer-mb-3 univer-w-full`,onClick:()=>C(!0),children:g.t(`sheets-pivot-ui.dateFilter.title`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex`,children:[/* @__PURE__ */ G(`div`,{className:U(`univer-flex univer-h-8 univer-w-[140px] univer-flex-1 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-l-md univer-text-center univer-text-sm hover:univer-bg-gray-100 rtl:univer-rounded-l-none rtl:univer-rounded-r-md dark:hover:!univer-bg-gray-700`,Un,{"univer-bg-gray-100 dark:!univer-bg-gray-700":te===r.ascending}),onClick:()=>se(r.ascending),children:[/* @__PURE__ */ W($n,{}),g.t(`sheets-pivot-ui.dialog.filter.ascending`)]}),/* @__PURE__ */ G(`div`,{className:U(`univer-flex univer-h-8 univer-w-[140px] univer-flex-1 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-r-md univer-text-center univer-text-sm hover:univer-bg-gray-100 rtl:univer-rounded-l-md rtl:univer-rounded-r-none dark:hover:!univer-bg-gray-700`,Un,{"univer-bg-gray-100 dark:!univer-bg-gray-700":te===r.descending}),onClick:()=>se(r.descending),children:[/* @__PURE__ */ W(rr,{}),g.t(`sheets-pivot-ui.dialog.filter.descending`)]})]}),/* @__PURE__ */ W(`div`,{className:U(`univer-mx-0 univer-mb-4 univer-mt-3 univer-h-[300px] univer-rounded-lg univer-p-2`,Un),children:/* @__PURE__ */ G(`div`,{className:U(`univer-h-full univer-overflow-y-auto`,Wn),children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-1 univer-box-border univer-h-7 univer-py-[5px] univer-pl-[22px] univer-pr-1 univer-text-sm rtl:univer-pl-1 rtl:univer-pr-[22px]`,children:/* @__PURE__ */ W(H,{checked:O,onChange:A,indeterminate:!O&&(w.length>0||E.length>0),children:g.t(`sheets-pivot-ui.dialog.filter.selectAll`)})}),i.items.map((e,t)=>{var r,a;let o=e,s=(r=i.itemLabels)==null?void 0:r[e],c=(a=i.itemTypes)==null?void 0:a[t],l=ma(e,c);return l?o=g.t(l):s===void 0?c===n.date&&d&&(o=ut.format(d,Number(e))):o=s,/* @__PURE__ */ W(`div`,{className:`univer-mb-1 univer-box-border univer-h-7 univer-py-1 univer-pl-[22px] univer-pr-1 univer-text-sm rtl:univer-pl-1 rtl:univer-pr-[22px]`,children:/* @__PURE__ */ W(H,{checked:w.includes(e),indeterminate:E.includes(e),onChange:()=>re(e),contentClassName:`univer-max-w-[200px] univer-truncate`,children:o})},e)})]})}),/* @__PURE__ */ G(En,{className:`univer-flex univer-items-center univer-justify-between`,children:[/* @__PURE__ */ W(`div`,{className:`univer-cursor-pointer univer-text-xs univer-text-primary-600`,children:/* @__PURE__ */ W(V,{variant:`link`,disabled:ce===`NotFilter`,onClick:oe,children:g.t(`sheets-pivot-ui.dialog.filter.clearFilter`)})}),/* @__PURE__ */ G(En,{className:`univer-flex univer-flex-1 univer-items-center univer-gap-3`,children:[/* @__PURE__ */ W(V,{onClick:ae,children:g.t(`sheets-pivot-ui.dialog.filter.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:ee,onClick:ie,children:g.t(`sheets-pivot-ui.dialog.filter.confirm`)})]})]})]})}function ns({name:e,onConfirm:t,onCancel:n}){let r=z(L),i=B(r.direction$,r.getDirection()),[a,o]=Y(e),[s,c]=Y(!1),l=J(!1);return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,dir:i,children:[/* @__PURE__ */ G(`label`,{className:`univer-flex univer-flex-col univer-gap-2 univer-text-sm`,children:[r.t(`sheets-pivot-ui.manualGroup.name`),/* @__PURE__ */ W(kn,{value:a,onChange:o})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[/* @__PURE__ */ W(V,{onClick:n,children:r.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:!a.trim()||s,onClick:async()=>{if(a.trim()&&!l.current){l.current=!0,c(!0);try{await t(a)}catch{}finally{l.current=!1,c(!1)}}},children:r.t(`sheets-pivot-ui.dialog.ok`)})]})]})}const rs=`univer-flex univer-items-center univer-justify-between univer-gap-3 univer-text-sm`;function is({targetFieldName:e,grouping:t,defaults$:n,onConfirm:r,onCancel:i}){let a=z(L),o=B(a.direction$,a.getDirection()),s=B(n),[c,l]=Y((t==null?void 0:t.autoStart)??!0),[u,d]=Y((t==null?void 0:t.autoEnd)??!0),[f,p]=Y((t==null?void 0:t.autoStart)===!1?String(t.start):void 0),[m,h]=Y((t==null?void 0:t.autoEnd)===!1?String(t.end):void 0),[g,_]=Y(t?String(t.interval):void 0),[v,y]=Y(!1),b=J(!1),x=e=>e===void 0||!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(e.trim())?NaN:Number(e),S={autoStart:c,autoEnd:u,start:c?s==null?void 0:s.start:x(f),end:u?s==null?void 0:s.end:x(m),interval:g===void 0||g.trim()===``?(s==null?void 0:s.interval)??0:x(g)},C=!!s&&ii(S),w=e=>{!e&&f===void 0&&(s==null?void 0:s.start)!==void 0&&p(String(s.start)),l(e)},T=e=>{!e&&m===void 0&&(s==null?void 0:s.end)!==void 0&&h(String(s.end)),d(e)};return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,dir:o,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium`,children:e}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ W(H,{checked:c,onChange:e=>w(!!e),children:a.t(`sheets-pivot-ui.numberGroup.autoStart`)}),/* @__PURE__ */ G(`label`,{className:rs,children:[a.t(`sheets-pivot-ui.numberGroup.start`),/* @__PURE__ */ W(kn,{className:`univer-w-32`,value:c?String((s==null?void 0:s.start)??``):f??``,disabled:c,onChange:p})]}),/* @__PURE__ */ W(H,{checked:u,onChange:e=>T(!!e),children:a.t(`sheets-pivot-ui.numberGroup.autoEnd`)}),/* @__PURE__ */ G(`label`,{className:rs,children:[a.t(`sheets-pivot-ui.numberGroup.end`),/* @__PURE__ */ W(kn,{className:`univer-w-32`,value:u?String((s==null?void 0:s.end)??``):m??``,disabled:u,onChange:h})]}),/* @__PURE__ */ G(`label`,{className:rs,children:[a.t(`sheets-pivot-ui.numberGroup.interval`),/* @__PURE__ */ W(kn,{className:`univer-w-32`,value:g??String((s==null?void 0:s.interval)??``),placeholder:String((s==null?void 0:s.interval)??``),onChange:_})]})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[/* @__PURE__ */ W(V,{onClick:i,children:a.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:!C||v,onClick:async()=>{if(C&&!b.current){b.current=!0,y(!0);try{await r(S)}catch{}finally{b.current=!1,y(!1)}}},children:a.t(`sheets-pivot-ui.dialog.ok`)})]})]})}const as=({handlePatternChange:e})=>{let t=z(L);return q(()=>{e(``)},[]),/* @__PURE__ */ W(`div`,{className:`univer-mt-1.5 univer-text-sm univer-leading-5 univer-text-gray-600 dark:!univer-text-gray-200`,children:t.t(`sheets-pivot-ui.dialog.numfmt.generalDesc`)})},os=({originPattern:e,handlePatternChange:t})=>{let n=z(L),r=nt.map(e=>({label:e,value:e})),[i,a]=Y(()=>ka(e||``,2)),[o,s]=Y(()=>ja(e??``)||r[0].value);return q(()=>{t($(`_("${o}"* #,##0${i>0?`.0`:``}_)`,i))},[]),/* @__PURE__ */ G(`div`,{className:`univer-mt-5`,children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between`,children:[/* @__PURE__ */ G(`div`,{className:`univer-w-[136px]`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.decimalPlaces`)}),/* @__PURE__ */ W(An,{className:`univer-box-border univer-h-8`,value:i,max:20,min:0,onChange:e=>{let n=e??0;a(n),t($(`_("${o}"* #,##0${n>0?`.0`:``}_)`,n))}})]}),/* @__PURE__ */ G(`div`,{className:`univer-w-[136px]`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.currencyTypes`)}),/* @__PURE__ */ W(zn,{options:r,value:o,onChange:e=>{s(e),t($(`_("${e}"* #,##0${i>0?`.0`:``}_)`,i))}})]})]}),/* @__PURE__ */ W(`div`,{className:`univer-mt-1.5 univer-text-sm univer-leading-5 univer-text-gray-600 dark:!univer-text-gray-200`,children:n.t(`sheets-pivot-ui.dialog.numfmt.accountingDesc`)})]})},ss=({originPattern:e,handlePatternChange:t})=>{let n=z(L),r=nt.map(e=>({label:e,value:e})),[i,a]=Y(()=>ka(e||``,2)),[o,s]=Y(()=>ja(e??``)||r[0].value),c=fa.map(e=>({label:e.label(o),value:e.suffix(o),color:e.color})),[l,u]=Y(()=>{var t;return((t=c.find(t=>st(t.value,e??``)))==null?void 0:t.value)||c[0].value});return q(()=>{t($(l,i))},[]),/* @__PURE__ */ G(`div`,{className:`univer-mt-5`,children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between`,children:[/* @__PURE__ */ G(`div`,{className:`univer-w-[136px]`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.decimalPlaces`)}),/* @__PURE__ */ W(An,{className:`univer-box-border univer-h-8`,value:i,max:20,min:0,onChange:e=>{e&&(a(e),t($(l,e)))}})]}),/* @__PURE__ */ G(`div`,{className:`univer-w-[136px]`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.currencyTypes`)}),/* @__PURE__ */ W(zn,{options:r,value:o,onChange:e=>{s(e);let n=fa.map(t=>({label:t.label(e),value:t.suffix(e),color:t.color}));u(n[0].value),t($(n[0].value,i))}})]})]}),/* @__PURE__ */ G(`div`,{className:`univer-mt-4`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.negativeNumberTypes`)}),/* @__PURE__ */ W(Bn,{className:`univer-rounded-lg univer-p-2`,options:c,value:l,onChange:e=>{u(e),t($(e,i))}}),/* @__PURE__ */ W(`div`,{className:`univer-mt-1.5 univer-text-sm univer-leading-5 univer-text-gray-600 dark:!univer-text-gray-200`,children:n.t(`sheets-pivot-ui.dialog.numfmt.currencyDesc`)})]})]})},cs=({originPattern:e,handlePatternChange:t})=>{let n=z(L),r=ua.map(e=>({label:e.label,value:e.suffix})),[i,a]=Y(()=>{if(e){let t=r.find(t=>t.value===e);if(t)return t.value}return r[0].value});return q(()=>{t(i)},[]),/* @__PURE__ */ W(`div`,{className:`univer-mt-5`,children:/* @__PURE__ */ G(`div`,{className:`univer-mt-5`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.dateTypes`)}),/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(Bn,{className:`univer-rounded-lg univer-p-2`,options:r,value:i,onChange:e=>{a(e),t(e)}})}),/* @__PURE__ */ W(`div`,{className:`univer-mt-1.5 univer-text-sm univer-leading-5 univer-text-gray-600 dark:!univer-text-gray-200`,children:n.t(`sheets-pivot-ui.dialog.numfmt.dateDesc`)})]})})},ls=({originPattern:e,handlePatternChange:t})=>{let n=z(L),[r,i]=Y(()=>ka(e||``,0)),a=da.map(e=>({label:e.label,value:e.suffix,color:e.color})),[o,s]=Y(()=>{let t=a.find(t=>st(t.value,e||``));return(t==null?void 0:t.value)||a[0].value});return q(()=>{t($(o,Number(r||0)))},[]),/* @__PURE__ */ G(`div`,{className:`univer-mt-5`,children:[/* @__PURE__ */ W(`div`,{className:`univer-flex univer-items-center univer-justify-between`,children:/* @__PURE__ */ G(`div`,{className:`univer-w-[136px]`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.decimalPlaces`)}),/* @__PURE__ */ W(An,{className:`univer-box-border univer-h-8`,value:r,max:20,min:0,onChange:e=>{e&&(i(e),t($(o,Number(e))))}})]})}),/* @__PURE__ */ G(`div`,{className:`univer-mt-4`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:n.t(`sheets-pivot-ui.dialog.numfmt.negativeNumberTypes`)}),/* @__PURE__ */ W(Bn,{className:`univer-rounded-lg univer-p-2`,options:a,value:o,onChange:e=>{i(ka(e,0)),s(e),t(e)}}),/* @__PURE__ */ W(`div`,{className:`univer-mt-1.5 univer-text-sm univer-leading-5 univer-text-gray-600 dark:!univer-text-gray-200`,children:n.t(`sheets-pivot-ui.dialog.numfmt.thousandthPercentileDesc`)})]})]})},us=({unitId:e,subUnitId:t,pivotTableId:n,tableFieldId:r,originPattern:i,tableFieldInfo:a,dataFieldInfo:o})=>{let s=z(L),c=z(R),l=s.getDirection(),u=_r(()=>[{label:`sheets-pivot-ui.dialog.numfmt.general`,component:as,key:`sheet.numfmt.general`},{label:`sheets-pivot-ui.dialog.numfmt.accounting`,component:os,key:`sheet.numfmt.accounting`},{label:`sheets-pivot-ui.dialog.numfmt.currency`,component:ss,key:`sheet.numfmt.currency`},{label:`sheets-pivot-ui.dialog.numfmt.date`,component:cs,key:`sheet.numfmt.date`},{label:`sheets-pivot-ui.dialog.numfmt.thousandthPercentile`,component:ls,key:`sheet.numfmt.thousandthPercentile`}].map(e=>({...e,label:s.t(e.label)})),[s]),d=u.map(e=>({label:e.label,value:e.key})),[f,p]=Y(()=>[Ma,Na,Pa,Ia,Ra].reduce((e,t,n)=>e||(t(i??``)?u[n].key:``),``)||u[0].key),[m,h]=Y(i),g=e=>h(e),_=e=>{p(e)},v=i=>({id:Ar,title:{title:s.t(`sheets-pivot-ui.fieldSettings`)},draggable:!0,mask:!1,maskClosable:!1,width:400,children:{label:kr,tableFieldId:r,pivotTableId:n,unitId:e,subUnitId:t,tableFieldInfo:a,dataFieldInfo:o,key:`field-setting-${r||``}`,closeFn:()=>{c.close(Ar)},format:i?m:``},onClose:()=>{c.close(Ar)}}),y=()=>{c.close(Mr);let e=v(!1);c.open(e)};return/* @__PURE__ */ G(`div`,{dir:l,children:[/* @__PURE__ */ W(`div`,{className:`univer-flex`,children:/* @__PURE__ */ G(`div`,{className:`univer-mb-5 univer-flex univer-h-6 univer-cursor-pointer univer-items-center univer-text-base univer-font-medium univer-leading-6`,onClick:y,children:[/* @__PURE__ */ W(Qn,{}),s.t(`sheets-pivot-ui.dialog.numfmt.fieldSetting`)]})}),/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-h-5 univer-text-sm univer-font-medium univer-leading-5`,children:s.t(`sheets-pivot-ui.dialog.numfmt.formatTypes`)}),/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(zn,{className:`univer-w-full`,value:f,options:d,onChange:e=>_(e)})}),/* @__PURE__ */ G(`div`,{children:[f===`sheet.numfmt.general`&&/* @__PURE__ */ W(as,{originPattern:i,handlePatternChange:g}),f===`sheet.numfmt.accounting`&&/* @__PURE__ */ W(os,{originPattern:i,handlePatternChange:g}),f===`sheet.numfmt.currency`&&/* @__PURE__ */ W(ss,{originPattern:i,handlePatternChange:g}),f===`sheet.numfmt.date`&&/* @__PURE__ */ W(cs,{originPattern:i,handlePatternChange:g}),f===`sheet.numfmt.thousandthPercentile`&&/* @__PURE__ */ W(ls,{originPattern:i,handlePatternChange:g})]}),/* @__PURE__ */ G(En,{className:`univer-mt-2 univer-flex univer-justify-end`,children:[/* @__PURE__ */ W(V,{onClick:y,children:s.t(`sheets-pivot-ui.dialog.numfmt.cancel`)}),/* @__PURE__ */ W(V,{className:`univer-ml-3 rtl:univer-ml-0 rtl:univer-mr-3`,variant:`primary`,onClick:()=>{c.close(Mr);let e=v(!0);c.open(e)},children:s.t(`sheets-pivot-ui.dialog.numfmt.confirm`)})]})]})};function ds(e){var t,n;let{scope:r,report:i,getCurrentReport:a,onChange:o}=e,s=z(L),c=z(Ue),l=z(be),u=z(Ge),d=z(We);B(u.permissionPointUpdate$);let[f,p]=Y(!1),m=J(!1),h=J(!0),g=JSON.stringify(r),_=J(g);_.current=g,q(()=>(h.current=!0,()=>{h.current=!1}),[]);let v=f||!i||((t=u.getPermissionPoint(new Et(r.unitId).id))==null?void 0:t.value)===!1||((n=u.getPermissionPoint(new Ot(r.unitId,r.subUnitId).id))==null?void 0:n.value)===!1,b=async e=>{if(m.current||v||!i||i.options.allowMultipleFilters===e)return;m.current=!0,p(!0);let t=$e.deepClone(i);try{if(!e&&y(i)){let e=await l.asyncInterceptor.fetchThroughAsyncInterceptors(te)({redos:[],undos:[],groups:[],validate:()=>void 0},r);if(!h.current||_.current!==g||!await c.confirm({id:`sheet-pivot.confirm.disable-multiple-filters`,title:{title:s.t(`sheets-pivot-ui.config.multipleFiltersTitle`)},children:{title:s.t(`sheets-pivot-ui.config.multipleFiltersClearWarning`)},cancelText:s.t(`sheets-pivot-ui.dialog.cancel`),confirmText:s.t(`sheets-pivot-ui.dialog.ok`)}))return;e==null||e.validate()}if(!h.current||_.current!==g||!$e.diffValue(t,a()))return;await o(e)}catch(e){d.error(`[PivotFilterOptions]`,e)}finally{m.current=!1,h.current&&p(!1)}};return/* @__PURE__ */ G(`section`,{className:`univer-flex univer-flex-col univer-gap-3`,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.filteringSection`)}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-items-start univer-gap-2 univer-text-sm`,children:[/* @__PURE__ */ W(H,{checked:(i==null?void 0:i.options.allowMultipleFilters)===!0,disabled:v,onChange:e=>b(!!e)}),/* @__PURE__ */ W(`span`,{children:s.t(`sheets-pivot-ui.config.allowMultipleFilters`)})]})]})}const fs=[{label:`sheets-pivot-ui.config.pageDownThenOver`,value:`false`},{label:`sheets-pivot-ui.config.pageOverThenDown`,value:`true`}],ps=[{label:`sheets-pivot-ui.config.layoutTabular`,value:String(c.tabular)},{label:`sheets-pivot-ui.config.layoutCompact`,value:String(c.compact)},{label:`sheets-pivot-ui.config.layoutOutline`,value:String(c.outline)}],ms=[{label:`sheets-pivot-ui.config.rowSubtotalTop`,value:String(d.top)},{label:`sheets-pivot-ui.config.rowSubtotalBottom`,value:String(d.bottom)}],hs=[{label:`sheets-pivot-ui.config.dateGroupingLegacy`,value:a.Legacy},{label:`sheets-pivot-ui.config.dateGroupingExcelLike`,value:a.ExcelLike}];function gs(e){let{unitId:t,subUnitId:n,pivotTableId:r}=e,i=z(P),a=z(Ue),o=z(We),s=z(L),l=z(M),u=_r(()=>l.watchPivotTableChanges(t,n,r).pipe(hn(0)),[l,t,n,r]);B(u);let[f,p]=Y(!1),m=J(!1),h=l.getPivotTableConfig(t,n,r),g=v(h==null?void 0:h.fieldsConfig.options),[_,y]=Y(()=>{var e,i;let a=l.getPivotTableConfig(t,n,r),o=(a==null||(e=a.fieldsConfig)==null?void 0:e.options)??{};return{showRowSubtotal:o.showRowSubtotal??!0,showRowGrandTotal:o.showRowGrandTotal??!0,showColSubtotal:o.showColSubtotal??!0,showColGrandTotal:o.showColGrandTotal??!0,pageWrap:o.pageWrap??1,pageOverThenDown:o.pageOverThenDown??!1,repeatRowLabels:o.repeatRowLabels??!1,repeatColLabels:o.repeatColLabels??!1,layout:(a==null||(i=a.fieldsConfig)==null?void 0:i.layout)??c.tabular,rowSubtotalPosition:o.rowSubtotalPosition??d.top}}),x=e=>{let a={unitId:t,subUnitId:n,pivotTableId:r,options:e};i.executeCommand(ge.id,a).catch(e=>o.error(`[PivotConfigPanel]`,e)),y(t=>({...t,...e}))},S=e=>{let a={unitId:t,subUnitId:n,pivotTableId:r,layout:e};i.executeCommand(pe.id,a).catch(e=>o.error(`[PivotConfigPanel]`,e)),y(t=>({...t,layout:e}))},C=async e=>{if(!(m.current||e===g)){m.current=!0,p(!0);try{let o=l.getPivotTableConfig(t,n,r),c=l.getCollection(t,r);if(!o||!c||(Object.values(c.fields).some(b)||c.customFields.some(b))&&!await a.confirm({id:`sheet-pivot.confirm.change-date-grouping-mode`,title:{title:s.t(`sheets-pivot-ui.config.dateGroupingSwitchTitle`)},children:{title:s.t(`sheets-pivot-ui.config.dateGroupingSwitchMessage`)},cancelText:s.t(`sheets-pivot-ui.dialog.cancel`),confirmText:s.t(`sheets-pivot-ui.dialog.ok`)})||l.getPivotTableConfig(t,n,r)!==o||l.getCollection(t,r)!==c||v(o.fieldsConfig.options)===e)return;await i.executeCommand(ge.id,{unitId:t,subUnitId:n,pivotTableId:r,options:{dateGroupingMode:e}})}catch(e){o.error(`[PivotConfigPanel]`,e)}finally{m.current=!1,p(!1)}}};return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4 univer-py-4`,children:[/* @__PURE__ */ W(ds,{scope:{unitId:t,subUnitId:n,pivotTableId:r},report:h==null?void 0:h.fieldsConfig,getCurrentReport:()=>{var e;return(e=l.getPivotTableConfig(t,n,r))==null?void 0:e.fieldsConfig},onChange:e=>i.executeCommand(ge.id,{unitId:t,subUnitId:n,pivotTableId:r,options:{allowMultipleFilters:e}})}),/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.displaySection`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-2`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.dateGroupingMode`)}),/* @__PURE__ */ W(zn,{className:`univer-w-36`,value:g,options:hs.map(e=>({...e,label:s.t(e.label)})),disabled:f,onChange:e=>C(e)})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-2`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.layout`)}),/* @__PURE__ */ W(zn,{className:`univer-w-36`,value:String(_.layout),options:ps.map(e=>({...e,label:s.t(e.label)})),onChange:e=>S(Number(e))})]}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-text-sm univer-text-gray-600`,children:[/* @__PURE__ */ W(H,{checked:_.repeatRowLabels,disabled:_.layout===c.compact,onChange:e=>x({repeatRowLabels:!!e})}),s.t(`sheets-pivot-ui.config.repeatRowLabels`)]}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-text-sm univer-text-gray-600`,children:[/* @__PURE__ */ W(H,{checked:_.repeatColLabels,onChange:e=>x({repeatColLabels:!!e})}),s.t(`sheets-pivot-ui.config.repeatColLabels`)]})]})]}),/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ W(`div`,{className:U(`univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-600`),children:s.t(`sheets-pivot-ui.config.totalsSection`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ G(`label`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-text-sm univer-text-gray-600`,children:[/* @__PURE__ */ W(H,{checked:_.showRowSubtotal,onChange:e=>x({showRowSubtotal:!!e})}),s.t(`sheets-pivot-ui.config.showRowSubtotal`)]}),_.layout===c.outline&&/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-2`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.rowSubtotalPosition`)}),/* @__PURE__ */ W(zn,{className:`univer-w-36`,value:String(_.rowSubtotalPosition),options:ms.map(e=>({...e,label:s.t(e.label)})),onChange:e=>x({rowSubtotalPosition:Number(e)})})]}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-text-sm univer-text-gray-600`,children:[/* @__PURE__ */ W(H,{checked:_.showRowGrandTotal,onChange:e=>x({showRowGrandTotal:!!e})}),s.t(`sheets-pivot-ui.config.showRowGrandTotal`)]}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-text-sm univer-text-gray-600`,children:[/* @__PURE__ */ W(H,{checked:_.showColSubtotal,onChange:e=>x({showColSubtotal:!!e})}),s.t(`sheets-pivot-ui.config.showColSubtotal`)]}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-text-sm univer-text-gray-600`,children:[/* @__PURE__ */ W(H,{checked:_.showColGrandTotal,onChange:e=>x({showColGrandTotal:!!e})}),s.t(`sheets-pivot-ui.config.showColGrandTotal`)]})]})]}),/* @__PURE__ */ G(`section`,{children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.pageSection`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-3`,children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-2`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.pageWrap`)}),/* @__PURE__ */ W(An,{className:`univer-w-24`,value:_.pageWrap,min:1,max:20,onChange:e=>{let t=Number(e);Number.isFinite(t)&&t>=1&&x({pageWrap:t})}})]}),/* @__PURE__ */ W(`p`,{className:`univer-text-xs univer-text-gray-600`,children:s.t(_.pageOverThenDown?`sheets-pivot-ui.config.pageWrapOverThenDownHelp`:`sheets-pivot-ui.config.pageWrapDownThenOverHelp`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-gap-2`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-text-gray-600`,children:s.t(`sheets-pivot-ui.config.pageDirection`)}),/* @__PURE__ */ W(zn,{className:`univer-w-36`,value:String(_.pageOverThenDown),options:fs.map(e=>({...e,label:s.t(e.label)})),onChange:e=>x({pageOverThenDown:e===`true`})})]})]})]})]})}let _s=class extends N{constructor(e,t,n,r,i,a,o,s){super(),this._sheetsSelectionsService=e,this._univerInstanceService=t,this._sheetsPivotTableAdaptorModel=n,this._commandService=r,this._sidebarService=i,this._dialogService=a,this._injector=o,this._permissionService=s,X(this,`_pivotTableId`,void 0),X(this,`_pivotTablePanelVisible$`,new fn),X(this,`pivotTablePanelVisible$`,this._pivotTablePanelVisible$.asObservable()),X(this,`_isRangeSelectorFocus`,!1),X(this,`_isRangeSelector2Focus`,!1),this._initPanelOpen(),this._initSheetChange()}setIsRangeSelectorFocus(e){this._isRangeSelectorFocus=e}setIsRangeSelector2Focus(e){this._isRangeSelector2Focus=e}_setPivotTableId(e){this._pivotTableId=e}_closePivotPanel(){this._isRangeSelectorFocus||this._isRangeSelector2Focus||(this._setPivotTableId(void 0),this._sidebarService.close(Er))}_initPanelOpen(){let e=this._univerInstanceService.getCurrentUnitOfType(et.UNIVER_SHEET);if(e){let t=e.activeSheet$;this.disposeWithMe(yn(t,this._sheetsSelectionsService.selectionMoveEnd$).subscribe(()=>{let e=this._sheetsSelectionsService.getCurrentSelections();if(!e)return;let t=e[e.length-1];if(!t)return;let n=t.primary;if(!n)return;let r=this._univerInstanceService.getCurrentUnitOfType(et.UNIVER_SHEET),i=r==null?void 0:r.getActiveSheet();if(!r||!i)return;let a=r.getUnitId(),o=i.getSheetId(),s=this._sheetsPivotTableAdaptorModel.getPivotTableIdByCell(a,o,n.startRow,n.startColumn);if(s){var c,l;let e=(c=this._sheetsPivotTableAdaptorModel.getPivotItemRenderInfoCache(a,o,s))==null?void 0:c.rangesInfo,t=Fe(e),n=jt(this._injector,a,o,t),r=(l=this._permissionService.getPermissionPoint(new kt(a,o).id))==null?void 0:l.value;if(!n||!r)return;this._setPivotTableId(s),this._pivotTablePanelVisible$.next(!0),this._commandService.executeCommand(na.id,{pivotTableId:s})}else this._closePivotPanel()})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{e.id===ae.id&&e.params.pivotTableId===this._pivotTableId&&this._sidebarService.close(Er)}))}}_initSheetChange(){let e=this._univerInstanceService.getCurrentUnitOfType(et.UNIVER_SHEET);e&&this.disposeWithMe(e.sheetDisposed$.subscribe(()=>{this._sidebarService.close()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(e=>{if(e.id===`UNIVER_SHEET_PIVOT_PANEL_ID`){let t=!!e.visible;this._pivotTablePanelVisible$.next(t),t||this._dialogService.close(Ar)}})),this.disposeWithMe(this._dialogService.getDialogs$().subscribe(e=>{let t=e.find(e=>e.id===Rr);t&&t.open===!1&&this._dialogService.close(Rr)}))}};_s=Q([Z(0,I(wt)),Z(1,I(F)),Z(2,I(j)),Z(3,I(P)),Z(4,I(Bt)),Z(5,I(R)),Z(6,I(Ke)),Z(7,I(Ge))],_s);const vs=hr(null),ys=hr(null);function bs(e,t){return e===t?!0:!e||!t?!1:e.droppableId===t.droppableId&&e.index===t.index}function xs(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-univer-dnd-droppable-id]`);return t instanceof HTMLElement?t:null}function Ss(e,t,n,r){let i=Array.from(e.querySelectorAll(`[data-univer-dnd-item="true"]`)).filter(e=>{let t=e.dataset.univerDndId;return t?t!==n.draggableId||n.source.droppableId!==r:!1});if(!i.length)return 0;for(let e=0;e<i.length-1;e++){let n=i[e].getBoundingClientRect();if(t<n.top+n.height/2)return e}let a=i.length-1,o=i[a].getBoundingClientRect();return t<o.top+o.height*.35?a:i.length}function Cs(){let e=gr(vs);if(!e)throw Error(`Draggable/Droppable must be used inside DragDropContext`);return e}function ws(e){let{children:t,onDragEnd:n,onDragStart:r,onDragUpdate:i}=e,[a,o]=Y(null),s=J(null),c=K((e,t)=>{let n={draggableId:e,source:t,destination:null};s.current=n,o(n),r==null||r({draggableId:e,source:t}),i==null||i({draggableId:e,source:t,destination:null})},[r,i]),l=K(e=>{let t=s.current;if(!t||bs(t.destination,e))return;let n={...t,destination:e};s.current=n,o(n),i==null||i({draggableId:n.draggableId,source:n.source,destination:n.destination})},[i]),u=K(async(e,t)=>{let r=s.current;r&&(s.current=null,o(null),await(n==null?void 0:n({draggableId:r.draggableId,source:r.source,destination:t===void 0?r.destination:t,reason:e})))},[n]);q(()=>{if(!a)return;let e=e=>{let t=xs(e.target);t&&t.dataset.univerDndDropDisabled!==`true`||l(null)};return window.addEventListener(`dragover`,e,!0),()=>{window.removeEventListener(`dragover`,e,!0)}},[a,l]);let d=_r(()=>({activeDrag:a,startDrag:c,updateDestination:l,endDrag:u}),[a,c,l,u]);return/* @__PURE__ */ W(vs.Provider,{value:d,children:t})}function Ts(e){var t;let{children:n,droppableId:r,isDropDisabled:i=!1}=e,{activeDrag:a,updateDestination:o,endDrag:s}=Cs(),c=J(null),l={innerRef:K(e=>{c.current=e},[]),droppableProps:{onDragOver:K(e=>{if(!a||i||!c.current)return;e.preventDefault();let t=Ss(c.current,e.clientY,a,r);o({droppableId:r,index:t})},[a,i,r,o]),onDrop:K(e=>{var t;if(!a||i||!c.current)return;e.preventDefault();let n=(((t=a.destination)==null?void 0:t.droppableId)===r?a.destination:null)??{droppableId:r,index:Ss(c.current,e.clientY,a,r)};return s(`DROP`,n)},[a,s,i,r]),"data-univer-dnd-droppable-id":r,"data-univer-dnd-drop-disabled":String(i)},placeholder:null},u={isDraggingOver:!!(a&&((t=a.destination)==null?void 0:t.droppableId)===r)};return/* @__PURE__ */ W(ys.Provider,{value:r,children:n(l,u)})}function Es(e){var t;let{children:n,draggableId:r,index:i,isDragDisabled:a=!1}=e,{activeDrag:o,startDrag:s,updateDestination:c,endDrag:l}=Cs(),u=gr(ys),d=J(null),f=J(null),p=J(!1),m=J(null),h=J(null),g=J(!1),_=J(null),v=J(null),y=J(null),b=K(e=>{d.current=e},[]),x=(o==null?void 0:o.draggableId)===r,S=K(()=>{h.current&&=(window.clearTimeout(h.current),null)},[]),C=K(()=>{S(),y.current=null,m.current&&=(m.current(),null),_.current&&=(_.current.remove(),null),v.current=null,p.current=!1},[S]);q(()=>C,[C]);let w=K((e,t)=>{if(_.current)return;let n=d.current;if(!n)return;let r=n.getBoundingClientRect(),i=e>0?Math.max(0,e-r.left):12,a=t>0?Math.max(0,t-r.top):12,o=n.cloneNode(!0);if(!(o instanceof HTMLDivElement))return;let s=o;s.style.position=`fixed`,s.style.left=`0px`,s.style.top=`0px`,s.style.width=`${r.width}px`,s.style.height=`${r.height}px`,s.style.pointerEvents=`none`,s.style.opacity=`0.9`,s.style.zIndex=`2147483647`,s.style.boxSizing=`border-box`,s.style.transform=`translate(${Math.max(0,e-i)}px, ${Math.max(0,t-a)}px)`,document.body.appendChild(s),_.current=s,v.current={x:i,y:a}},[]),T=K((e,t)=>{let n=_.current,r=v.current;n&&r&&(n.style.transform=`translate(${Math.max(0,e-r.x)}px, ${Math.max(0,t-r.y)}px)`)},[]),E=K((e,t)=>{let n=xs(document.elementFromPoint(e,t));if(!n||n.dataset.univerDndDropDisabled===`true`)return null;let a=n.dataset.univerDndDroppableId;return a?{droppableId:a,index:Ss(n,t,{draggableId:r,source:{droppableId:u??``,index:i},destination:null},a)}:null},[r,u,i]),D=K((e,t,n,o)=>{if(p.current||g.current||a||!u)return;p.current=!0,S(),g.current=!1;try{var l;(l=d.current)==null||l.setPointerCapture(t)}catch{}w(n,o),s(r,{droppableId:u,index:i});let f=E(n,o);c(f);try{e.preventDefault()}catch{}},[S,r,u,i,a,w,E,s,c]),O=K(e=>{if(a||!u||e.pointerType===`mouse`&&e.button!==0)return;g.current=!1;let t=e.pointerId;y.current={pointerId:t,pointerType:e.pointerType,startX:e.clientX,startY:e.clientY},S(),e.pointerType!==`mouse`&&(h.current=window.setTimeout(()=>{let n=y.current;n&&n.pointerId===t&&D(e.nativeEvent,n.pointerId,n.startX,n.startY)},150));let n=e=>{let t=y.current;if(!t||e.pointerId!==t.pointerId)return;if(!p.current){if(g.current){C();return}if(t.pointerType===`mouse`){let n=e.clientX-t.startX,r=e.clientY-t.startY;n*n+r*r>=16&&D(e,t.pointerId,e.clientX,e.clientY)}return}T(e.clientX,e.clientY);let n=E(e.clientX,e.clientY);c(n);try{e.preventDefault()}catch{}},r=e=>{let t=y.current;if(!t||e.pointerId!==t.pointerId)return;let n=p.current?E(e.clientX,e.clientY):null,r=p.current?l(n?`DROP`:`CANCEL`,n):Promise.resolve();return C(),r};window.addEventListener(`pointermove`,n,{capture:!0,passive:!1}),window.addEventListener(`pointerup`,r,{capture:!0}),window.addEventListener(`pointercancel`,r,{capture:!0}),m.current=()=>{window.removeEventListener(`pointermove`,n,!0),window.removeEventListener(`pointerup`,r,!0),window.removeEventListener(`pointercancel`,r,!0)}},[C,S,u,l,a,E,D,c,T]),ee=K(e=>{let t=e.dataTransfer;if(!t||typeof t.setDragImage!=`function`)return;let n=e.currentTarget,r=n.cloneNode(!0);if(!(r instanceof HTMLDivElement))return;let i=r;i.style.position=`fixed`,i.style.left=`-9999px`,i.style.top=`-9999px`,i.style.width=`${n.getBoundingClientRect().width}px`,i.style.pointerEvents=`none`,i.style.opacity=`0.95`,i.style.zIndex=`2147483647`,document.body.appendChild(i);let a=n.getBoundingClientRect(),o=e.clientX>0?Math.max(0,e.clientX-a.left):12,s=e.clientY>0?Math.max(0,e.clientY-a.top):12;t.setDragImage(i,o,s),f.current&&f.current!==i&&f.current.remove(),f.current=i},[]),te=K(e=>{if(p.current||a||!u){e.preventDefault();return}g.current=!0,S(),y.current=null,m.current&&=(m.current(),null);let t=e.dataTransfer;if(t){try{t.effectAllowed=`move`}catch{}try{t.setData(`text/plain`,r)}catch{}}try{ee(e)}catch{}s(r,{droppableId:u,index:i})},[ee,S,r,u,i,a,s]),k=K(()=>(f.current&&=(f.current.remove(),null),l(`CANCEL`,null)),[l]);return n({innerRef:b,draggableProps:{draggable:!a,onDragStart:te,onDragEnd:k,style:x?{opacity:1}:void 0,"data-univer-dnd-item":`true`,"data-univer-dnd-id":r,"data-univer-dnd-index":String(i)},dragHandleProps:{onPointerDown:O}},{isDragging:x,draggingOver:o==null||(t=o.destination)==null?void 0:t.droppableId})}function Ds(e,t){switch(e){case`filter`:return t.t(`sheets-pivot-ui.filter`);case`row`:return t.t(`sheets-pivot-ui.row`);case`column`:return t.t(`sheets-pivot-ui.column`);case`value`:return t.t(`sheets-pivot-ui.value`)}}function Os(e){switch(e){case`filter`:return/* @__PURE__ */ W(ir,{className:`univer-flex univer-flex-row univer-gap-4`});case`row`:return/* @__PURE__ */ W(nr,{className:`univer-flex univer-flex-row univer-gap-4`});case`column`:return/* @__PURE__ */ W(dr,{className:`univer-flex univer-flex-row univer-gap-4`});case`value`:return/* @__PURE__ */ W(ar,{className:`univer-flex univer-flex-row univer-gap-4`})}}function ks(e){switch(e){case`filter`:return/* @__PURE__ */ G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 32 32`,fill:`none`,children:[/* @__PURE__ */ W(`path`,{d:`M4.99957 1.875C2.84556 1.875 1.67491 4.3932 3.06336 6.04001L11.5946 16.1587V26.4187C11.5946 27.4582 12.2298 28.3922 13.1966 28.7741L16.1601 29.9449C17.8221 30.6015 19.6232 29.3766 19.6232 27.5895V16.1587L28.1544 6.04C29.5428 4.3932 28.3722 1.875 26.2182 1.875H4.99957Z`,fill:`#ECECEC`}),/* @__PURE__ */ W(`rect`,{x:`21.9404`,y:`17.8544`,width:`7.59766`,height:`2.2793`,rx:`1.13965`,fill:`#274FEE`}),/* @__PURE__ */ W(`rect`,{x:`21.9404`,y:`21.9067`,width:`7.59766`,height:`2.2793`,rx:`1.13965`,fill:`#274FEE`}),/* @__PURE__ */ W(`rect`,{x:`21.9404`,y:`25.959`,width:`7.59766`,height:`2.2793`,rx:`1.13965`,fill:`#274FEE`})]});case`row`:return/* @__PURE__ */ G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 32 32`,fill:`none`,children:[/* @__PURE__ */ W(`path`,{d:`M2 12.3661C2 12.0347 2.26863 11.7661 2.6 11.7661H9.24705C9.57842 11.7661 9.84705 12.0347 9.84705 12.3661V29.278C9.84705 29.6093 9.57842 29.878 9.24705 29.878H4C2.89543 29.878 2 28.9825 2 27.878V12.3661Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M2 4.0863C2 2.98173 2.89543 2.0863 4 2.0863H9.24705C9.57842 2.0863 9.84705 2.35493 9.84705 2.6863V8.73981C9.84705 9.07118 9.57842 9.33981 9.24705 9.33981H2.6C2.26863 9.33981 2 9.07118 2 8.73981V4.0863Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M12.2983 12.4011C12.2982 12.0697 12.5669 11.8009 12.8983 11.8009L29.3931 11.8009C29.7243 11.8009 29.9929 12.0694 29.9931 12.4007L29.9993 27.9129C29.9997 29.0178 29.1042 29.9137 27.9993 29.9137H12.9051C12.5738 29.9137 12.3053 29.6452 12.3051 29.314L12.2983 12.4011Z`,fill:`#ECECEC`}),/* @__PURE__ */ W(`path`,{d:`M12.2517 2.6863C12.2517 2.35493 12.5203 2.0863 12.8517 2.0863H27.9582C29.0628 2.0863 29.9582 2.98173 29.9582 4.0863V8.73627C29.9582 9.06764 29.6896 9.33627 29.3582 9.33627H12.8517C12.5203 9.33627 12.2517 9.06764 12.2517 8.73627L12.2517 2.6863Z`,fill:`#274FEE`})]});case`column`:return/* @__PURE__ */ G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 32 32`,fill:`none`,children:[/* @__PURE__ */ W(`path`,{d:`M2 12.3661C2 12.0347 2.26863 11.7661 2.6 11.7661H9.24705C9.57842 11.7661 9.84705 12.0347 9.84705 12.3661V29.278C9.84705 29.6093 9.57842 29.878 9.24705 29.878H4C2.89543 29.878 2 28.9825 2 27.878V12.3661Z`,fill:`#274FEE`}),/* @__PURE__ */ W(`path`,{d:`M2 4.0863C2 2.98173 2.89543 2.0863 4 2.0863H9.24705C9.57842 2.0863 9.84705 2.35493 9.84705 2.6863V8.73981C9.84705 9.07118 9.57842 9.33981 9.24705 9.33981H2.6C2.26863 9.33981 2 9.07118 2 8.73981V4.0863Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M12.2637 2.6863C12.2637 2.35493 12.5323 2.0863 12.8637 2.0863H27.9702C29.0748 2.0863 29.9702 2.98173 29.9702 4.0863V8.73627C29.9702 9.06764 29.7016 9.33627 29.3702 9.33627H12.8637C12.5323 9.33627 12.2637 9.06764 12.2637 8.73627L12.2637 2.6863Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M12.2982 12.4011C12.2981 12.0697 12.5667 11.8009 12.8982 11.8009L29.3929 11.8009C29.7242 11.8009 29.9928 12.0694 29.9929 12.4007L29.9992 27.9129C29.9996 29.0178 29.104 29.9137 27.9992 29.9137H12.905C12.5737 29.9137 12.3051 29.6452 12.305 29.314L12.2982 12.4011Z`,fill:`#ECECEC`})]});case`value`:return/* @__PURE__ */ G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 32 32`,fill:`none`,children:[/* @__PURE__ */ W(`path`,{d:`M2 12.3661C2 12.0347 2.26863 11.7661 2.6 11.7661H9.24705C9.57842 11.7661 9.84705 12.0347 9.84705 12.3661V29.278C9.84705 29.6093 9.57842 29.878 9.24705 29.878H4C2.89543 29.878 2 28.9825 2 27.878V12.3661Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M2 4.0863C2 2.98173 2.89543 2.0863 4 2.0863H9.24705C9.57842 2.0863 9.84705 2.35493 9.84705 2.6863V8.73981C9.84705 9.07118 9.57842 9.33981 9.24705 9.33981H2.6C2.26863 9.33981 2 9.07118 2 8.73981V4.0863Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M12.2637 2.6863C12.2637 2.35493 12.5323 2.0863 12.8637 2.0863H27.9702C29.0748 2.0863 29.9702 2.98173 29.9702 4.0863V8.73627C29.9702 9.06764 29.7016 9.33627 29.3702 9.33627H12.8637C12.5323 9.33627 12.2637 9.06764 12.2637 8.73627L12.2637 2.6863Z`,fill:`#D8D8D8`}),/* @__PURE__ */ W(`path`,{d:`M12.2982 12.4011C12.2981 12.0697 12.5667 11.8009 12.8982 11.8009L29.3929 11.8009C29.7242 11.8009 29.9928 12.0694 29.9929 12.4007L29.9992 27.9129C29.9996 29.0178 29.104 29.9137 27.9992 29.9137H12.905C12.5737 29.9137 12.3051 29.6452 12.305 29.314L12.2982 12.4011Z`,fill:`#274FEE`})]})}}function As(e,t){switch(e){case`filter`:return t.t(`sheets-pivot-ui.filterDesc`);case`row`:return t.t(`sheets-pivot-ui.rowDesc`);case`column`:return t.t(`sheets-pivot-ui.columnDesc`);case`value`:return t.t(`sheets-pivot-ui.valueDesc`)}}function js(e){let t=z(L),{areaType:n}=e,r=As(n,t),i=ks(n);return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-h-[140px] univer-flex-col univer-items-center univer-justify-center univer-gap-1 univer-self-stretch univer-px-2`,children:[/* @__PURE__ */ W(`div`,{className:`univer-size-8`,children:i}),/* @__PURE__ */ W(`div`,{className:`univer-text-center univer-text-xs univer-leading-4 univer-text-gray-600 dark:!univer-text-gray-200`,children:r})]})}function Ms(e){let{areaType:t,items:n,positionInfo:r,pivotTableId:i,pivotTableInfo:a}=e,o=z(L);return/* @__PURE__ */ G(`div`,{className:`univer-min-h-[200px] univer-flex-1 univer-p-1`,children:[/* @__PURE__ */ G(`div`,{className:`univer-mb-2 univer-mt-0 univer-flex univer-w-full univer-text-sm univer-leading-4 univer-text-gray-900`,children:[Os(t),/* @__PURE__ */ W(`span`,{className:`univer-inline-block univer-align-top`,children:Ds(t,o)})]}),/* @__PURE__ */ W(Ts,{droppableId:`${t}`,isCombineEnabled:!1,isDropDisabled:!1,ignoreContainerClipping:!1,direction:`vertical`,children:(e,o)=>/* @__PURE__ */ W(`div`,{className:U(`univer-box-border univer-h-[161px] univer-w-full univer-flex-col univer-items-center univer-justify-center univer-overflow-x-hidden univer-rounded-lg univer-bg-gray-50 univer-py-2 dark:!univer-bg-gray-900`,Un,{"univer-border-primary-600":o.isDraggingOver}),children:/* @__PURE__ */ W(`div`,{className:U(`univer-h-full univer-overflow-y-auto`,Wn),children:/* @__PURE__ */ G(`div`,{ref:e.innerRef,className:`univer-box-border univer-h-full univer-px-2`,...e.droppableProps,children:[n.length>0&&n.map((e,n)=>/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(Es,{isDragDisabled:!1,draggableId:e.tableFieldId,index:n,children:(n,o)=>/* @__PURE__ */ W(mr,{children:/* @__PURE__ */ W(`div`,{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,style:n.draggableProps.style,className:U(`univer-flex univer-items-center univer-gap-1 univer-self-stretch univer-border univer-border-transparent univer-p-0.5 univer-leading-4 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,o.draggingOver&&`univer-border-primary-600`),children:/* @__PURE__ */ W(Ns,{pivotTableId:i,positionInfo:r,item:e,areaType:t,pivotTableInfo:a})})})},e.tableFieldId)},e.tableFieldId)),n.length===0&&/* @__PURE__ */ W(js,{areaType:t})]})})})})]})}function Ns(e){let{areaType:t,item:n,positionInfo:r,pivotTableId:i,pivotTableInfo:a}=e,{unitId:o,subUnitId:s}=r,c=n.tableFieldId===pa,l=z(P),u=z(L),d=()=>{if(c){let e=(a.valueFields||[]).map(e=>e.tableFieldId);Ca({pivotTableId:i,unitId:o,subUnitId:s,commandService:l},e)}else Ca({pivotTableId:i,unitId:o,subUnitId:s,commandService:l},[n.tableFieldId])},f=()=>{o&&s&&Ea(l,o,s,i,n.tableFieldId)},p=()=>{o&&s&&Da(l,i,n.tableFieldId,o,s,a)},h=e=>{let t=e===`column`?m.Row:m.Column,n=e===`column`?a.rowFields.length:a.columnFields.length;wa({pivotTableId:i,unitId:o,subUnitId:s,commandService:l},t,n)},g=/* @__PURE__ */ G(`div`,{className:`univer-inline-flex univer-flex-col univer-rounded-lg univer-border univer-border-gray-200 univer-bg-gray-0 univer-p-2 univer-shadow-lg`,children:[/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 dark:!univer-text-gray-0`,onClick:()=>{d()},children:u.t(`sheets-pivot-ui.removeField`)}),t!==`value`&&!c&&/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 dark:!univer-text-gray-0`,onClick:()=>{f()},children:u.t(`sheets-pivot-ui.filterField`)}),c&&/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 dark:!univer-text-gray-0`,onClick:()=>{h(t)},children:t===`column`?u.t(`sheets-pivot-ui.moveToRow`):u.t(`sheets-pivot-ui.moveToColumn`)}),t===`value`&&/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 dark:!univer-text-gray-0`,onClick:()=>{p()},children:u.t(`sheets-pivot-ui.fieldSettings`)})]}),_=c?u.t(`sheets-pivot-ui.multipleValue`):n.displayName,v=/* @__PURE__ */ W(`bdi`,{dir:`auto`,children:_});return/* @__PURE__ */ G(mr,{children:[/* @__PURE__ */ W(or,{}),/* @__PURE__ */ W(`div`,{className:`univer-max-w-[66px] univer-flex-1 univer-shrink-0 univer-truncate univer-text-xs univer-leading-4 univer-text-gray-800 dark:!univer-text-gray-100`,children:/* @__PURE__ */ W(Hn,{title:v,children:v})}),/* @__PURE__ */ W(`div`,{className:`univer-cursor-pointer`,children:/* @__PURE__ */ W(On,{align:`end`,overlay:g,children:/* @__PURE__ */ W(`span`,{children:/* @__PURE__ */ W(cr,{})})})})]})}function Ps(e){var t;let n=z(F),r=z(L),i=z(P),a=z(_s),{sourceRangeInfo:o,refreshHandler:s,pivotTableId:c,positionInfo:l}=e,{unitId:u,range:d,subUnitId:f}=o,p=n.getUnit(u),m=(p==null||(t=p.getSheetBySheetId(f))==null?void 0:t.getName())??``,[h,g]=Y(void 0),_=J(h);_.current=h;let[v,y]=Y(d),[b,x]=Y(m),[S,C]=Y(!1);q(()=>{a.setIsRangeSelectorFocus(S)},[S,a]),q(()=>{y(o.range),x(m)},[o,m]);let w=_r(()=>rt(async e=>{let t=e.split(`,`).filter(e=>!!e).map(vr);if(!t[0])return;let n=t[0];if(!p||_.current)return;let r=n.sheetName||o.sheetName;y(n.range),x(r);let a={unitId:u,subUnitId:p.getSheetBySheetName(r).getSheetId(),range:{...n.range},sheetName:r};await ba(i,c,a,l.unitId,l.subUnitId),s()},300,{leading:!1,maxWait:1e3,trailing:!0}),[]);return/* @__PURE__ */ G(`div`,{className:`univer-mb-4`,children:[/* @__PURE__ */ G(`div`,{className:`univer-mb-2 univer-flex univer-h-5 univer-justify-between univer-text-sm univer-leading-5`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-justify univer-text-gray-900 dark:!univer-text-gray-0`,children:r.t(`sheets-pivot-ui.sourceRangeLabel`)}),/* @__PURE__ */ W(`span`,{className:`univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200`,children:r.t(`sheets-pivot-ui.sourceRangePlaceholder`)})]}),/* @__PURE__ */ G(`div`,{className:`univer-relative`,children:[/* @__PURE__ */ W(Sr,{unitId:u,subUnitId:f,initialValue:br(b,v),onChange:(e,t)=>{br(b,v)!==t&&w(t)},keepSheetReference:!0,supportAcrossSheet:!0,onVerify:(e,t)=>{let n=t.split(`,`).filter(e=>!!e);if(!n[0]){g(r.t(`sheets-pivot-ui.msg.emptySourceRange`));return}if(!e){g(r.t(`sheets-pivot-ui.msg.invalidSize`));return}let i=vr(n[0]),a=i.sheetName||o.sheetName;if(p)switch(va(p.getSheetBySheetName(a),i.range)){case 2:g(void 0);break;case 0:g(r.t(`sheets-pivot-ui.msg.emptySourceRange`));break;case 1:g(r.t(`sheets-pivot-ui.msg.invalidSize`))}},maxRangeCount:1,onFocusChange:e=>{C(e)},onRangeSelectorDialogVisibleChange:e=>{C(!!e)}}),h?/* @__PURE__ */ W(`div`,{className:`univer-my-1 univer-text-xs univer-text-red-500`,children:h}):null]})]})}function Fs(e){let{type:t}=e;switch(t){case n.text:return/* @__PURE__ */ W(pr,{className:`univer-mx-1.5 univer-my-0 univer-h-4 univer-text-xs univer-text-gray-200 dark:!univer-text-gray-600`});case n.number:return/* @__PURE__ */ W(lr,{className:`univer-mx-1.5 univer-my-0 univer-h-4 univer-text-xs univer-text-gray-200 dark:!univer-text-gray-600`});case n.date:return/* @__PURE__ */ W(er,{className:`univer-mx-1.5 univer-my-0 univer-h-4 univer-text-xs univer-text-gray-200 dark:!univer-text-gray-600`})}}function Is(e){if(!e)return!1;if(e.type===s.RecordFilter){var t;return e.dateRange!==void 0||(((t=e.selection)==null?void 0:t.mode)??Ve.All)!==Ve.All}return e.type!==s.ManualFilter||e.isAll!==!0}function Ls(e){let{name:t,dataFieldId:r,checked:i,type:a,refreshHandler:o,pivotTableId:s,draggingId:c,pivotTableInfo:l,unitId:u,subUnitId:d}=e,[f,m]=Y(!1),h=z(P),g=z(L);if(!l)return null;let{rowFields:_,columnFields:v,filterFields:y,valueFields:b}=l,x=l.hiddenFields??[],S=[..._,...v,...y,...b,...x],C=x.find(e=>e.dataFieldId===r),w=async e=>{let t=!!e,i=!1;if(t){let e={pivotTableId:s,dataFieldId:r,fieldArea:a===n.number?p.Value:p.Row,unitId:u,subUnitId:d,index:a===n.number?b.length:_.length};i=await h.executeCommand(T.id,e)}else{let e=[];S.forEach(t=>{t.dataFieldId===r&&e.push(t.tableFieldId)}),i=await h.executeCommand(re.id,{pivotTableId:s,fieldIds:e,unitId:u,subUnitId:d})}i&&o()},E=async e=>{let t=!1,n=``;if([..._,...v,...y,...x].forEach(e=>{e.dataFieldId===r&&(t=!0,n=e.tableFieldId)}),t&&e!==p.Value){if(s){let t=za(l,e),r={pivotTableId:s,area:e,index:t,fieldId:n,unitId:u,subUnitId:d};await h.executeCommand(O.id,r)&&o()}}else if(s){let t={pivotTableId:s,dataFieldId:r,fieldArea:e,unitId:u,subUnitId:d,index:za(l,e)};await h.executeCommand(T.id,t)&&o()}};return/* @__PURE__ */ G(`div`,{className:U(`univer-group univer-relative univer-box-border univer-flex univer-h-8 univer-w-full univer-flex-row univer-items-center univer-rounded-md univer-px-1 univer-py-2 univer-leading-4 univer-transition-all hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-flex univer-bg-gray-100 dark:!univer-bg-gray-700":c===r}),id:`source-${r}`,onContextMenu:e=>{e.preventDefault(),m(!0)},children:[/* @__PURE__ */ W(`span`,{className:`univer-mr-2 univer-w-4 rtl:univer-ml-2 rtl:univer-mr-0`,children:/* @__PURE__ */ W(or,{})}),/* @__PURE__ */ W(H,{className:`univer-w-[14px] univer-text-sm univer-text-gray-200`,checked:i,onChange:w}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-min-w-0 univer-flex-1 univer-items-center univer-text-xs univer-leading-4 univer-text-gray-900 dark:!univer-text-gray-0`,children:[/* @__PURE__ */ W(Fs,{type:a}),/* @__PURE__ */ W(`span`,{className:`univer-truncate`,children:t})]}),/* @__PURE__ */ W(On,{align:`end`,side:`bottom`,open:f,onOpenChange:m,overlay:/* @__PURE__ */ G(`div`,{children:[Is(C==null?void 0:C.filterInfo)&&/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:async()=>{C&&(m(!1),await h.executeCommand(fe.id,{unitId:u,subUnitId:d,pivotTableId:s,tableFieldId:C.tableFieldId,items:[],partialItems:[],isAll:!0})&&o())},children:g.t(`sheets-pivot-ui.dialog.filter.clearFilter`)}),/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:()=>{m(!1),E(p.Row)},children:g.t(`sheets-pivot-ui.addToRow`)}),/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:()=>{m(!1),E(p.Column)},children:g.t(`sheets-pivot-ui.addToColumn`)}),/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:()=>{m(!1),E(p.Value)},children:g.t(`sheets-pivot-ui.addToValue`)}),/* @__PURE__ */ W(`div`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-self-stretch univer-px-2 univer-py-1.5 univer-text-sm univer-leading-5 univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:()=>{m(!1),E(p.Filter)},children:g.t(`sheets-pivot-ui.addToFilter`)})]}),children:/* @__PURE__ */ W(`div`,{className:U(`univer-ml-1 univer-flex univer-size-5 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-md univer-transition-opacity hover:univer-bg-gray-200 rtl:univer-ml-0 rtl:univer-mr-1 dark:hover:!univer-bg-gray-700`,{"univer-opacity-100":f,"univer-opacity-0 group-hover:univer-opacity-100":!f}),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:/* @__PURE__ */ W(sr,{className:`univer-text-gray-400 dark:!univer-text-gray-500`})})})]},r)}function Rs(e){let{sourceList:t,refreshHandler:n,pivotTableId:r,pivotTableInfo:i,unitId:a,draggingId:o,subUnitId:s}=e,c=z(L),[l,u]=Y(``),d=l.trim().toLocaleLowerCase(),f=d?t.filter(e=>e.name.toLocaleLowerCase().includes(d)):t;return/* @__PURE__ */ G(`div`,{className:`univer-mb-4 univer-flex univer-min-h-0 univer-flex-1 univer-flex-col`,children:[/* @__PURE__ */ W(`p`,{className:`univer-mb-1 univer-mt-0 univer-text-sm univer-font-medium univer-leading-5 univer-text-gray-900 dark:!univer-text-gray-0`,children:c.t(`sheets-pivot-ui.sourceFieldTile`)}),/* @__PURE__ */ W(`p`,{className:`univer-mb-2 univer-mt-0 univer-text-xs univer-leading-4 univer-text-gray-600 dark:!univer-text-gray-200`,children:c.t(`sheets-pivot-ui.sourceFieldDescription`)}),/* @__PURE__ */ W(kn,{allowClear:!0,className:`univer-mb-2`,placeholder:c.t(`sheets-pivot-ui.searchFieldPlaceholder`),slot:/* @__PURE__ */ W(fr,{}),value:l,onChange:u}),/* @__PURE__ */ W(`div`,{className:U(`univer-box-border univer-min-h-0 univer-flex-1 univer-rounded-lg univer-bg-gray-0 univer-p-2 dark:!univer-bg-gray-900`,Un),children:/* @__PURE__ */ W(`div`,{className:U(`univer-relative univer-h-full univer-overflow-y-auto`,Wn),"data-testid":`pivot-source-field-viewport`,children:/* @__PURE__ */ W(Ts,{droppableId:`source`,direction:`vertical`,isCombineEnabled:!1,ignoreContainerClipping:!1,isDropDisabled:!0,children:e=>/* @__PURE__ */ G(`div`,{ref:e.innerRef,className:`univer-box-border univer-h-full univer-px-2`,...e.droppableProps,children:[f.map((e,t)=>/* @__PURE__ */ W(`div`,{className:`univer-relative univer-flex univer-h-8 univer-w-full univer-items-center univer-gap-1 univer-self-stretch univer-border univer-border-transparent univer-p-0.5 univer-leading-4 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,children:/* @__PURE__ */ W(Es,{draggableId:e.id,isDragDisabled:!1,index:t,children:({innerRef:t,draggableProps:c,dragHandleProps:l})=>/* @__PURE__ */ W(`div`,{ref:t,...c,...l,className:`univer-h-8 univer-w-full`,style:c.style,children:/* @__PURE__ */ W(Ls,{draggingId:o,unitId:a,subUnitId:s,...e,refreshHandler:n,pivotTableId:r,pivotTableInfo:i})})},e.id)},e.id)),f.length===0&&/* @__PURE__ */ W(`div`,{className:`univer-py-4 univer-text-center univer-text-xs univer-text-gray-500`,children:c.t(`sheets-pivot-ui.noMatchingFields`)})]})})})})]})}function zs(e){let{pivotTableId:t,version:n,unitId:r,subUnitId:i,panelInfo:a}=e,o=z(M),s=_r(()=>o.watchPivotTableChanges(r,i,t).pipe(hn(0)),[o,r,i,t]),c=B(s),l=z(ye),u=z(_s),d=B(u.pivotTablePanelVisible$,!0),f=z(P),p=z(We),[m,h]=Y(a),[g,_]=Y(null),v=K(async()=>{if(!o.getPivotTableConfig(r,i,t))return;let e=await l.getPivotDisplayConfig({unitId:r,subUnitId:i,pivotTableId:t,params:{type:k.Panel,panel:{pivotTableId:t}}});e.result.panel&&h(e.result.panel)},[t,l,o,i,r]);q(()=>{v().catch(e=>p.error(`[PivotPanel]`,e))},[p,c,t,v,n]);let y=async e=>{let{source:n,destination:a,draggableId:o}=e;_(null);let s={pivotTableInfo:m,pivotTableId:t,commandService:f,unitId:r,subUnitId:i},c=n.droppableId;if(a&&a.droppableId){let e=a.droppableId;await Sa(s,o,c,e,a.index),await v()}a===null&&(await ya(s,o,c),await v())},b=e=>{_({draggingId:e.draggableId})},x=e=>{let{draggableId:t,destination:n,source:r}=e;_({draggingId:t,destination:n,source:r})};if(!d||!m)return null;let{sourceList:S,rowFields:C,columnFields:w,filterFields:T,valueFields:E,sourceRange:D,positionInfo:O}=m;return/* @__PURE__ */ G(`div`,{className:U(`univer-mt-4 univer-flex univer-h-[calc(100%-16px)] univer-min-h-0 univer-w-full univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden`,Wn),children:[/* @__PURE__ */ W(Ps,{sourceRangeInfo:D,pivotTableId:t,refreshHandler:v,positionInfo:O}),/* @__PURE__ */ G(ws,{onDragEnd:y,onDragStart:b,onDragUpdate:x,children:[/* @__PURE__ */ W(Rs,{draggingId:(g==null?void 0:g.draggingId)??``,sourceList:S,refreshHandler:v,pivotTableId:t,pivotTableInfo:m,unitId:r,subUnitId:i}),/* @__PURE__ */ W(Bs,{rowFields:C,columnFields:w,filterFields:T,valueFields:E,refreshHandler:v,positionInfo:O,pivotTableId:t,pivotTableInfo:m})]})]})}function Bs(e){let{rowFields:t,columnFields:n,filterFields:r,valueFields:i,refreshHandler:a,pivotTableInfo:o,positionInfo:s,pivotTableId:c}=e;return/* @__PURE__ */ G(`div`,{className:`univer-shrink-0`,"data-testid":`pivot-field-areas`,children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-row univer-gap-4`,children:[/* @__PURE__ */ W(Ms,{areaType:`filter`,items:r,positionInfo:s,pivotTableId:c,pivotTableInfo:o,refreshHandler:a}),/* @__PURE__ */ W(Ms,{areaType:`column`,items:n,positionInfo:s,pivotTableId:c,pivotTableInfo:o,refreshHandler:a})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-row univer-gap-4`,children:[/* @__PURE__ */ W(Ms,{areaType:`row`,items:t,positionInfo:s,pivotTableId:c,pivotTableInfo:o,refreshHandler:a}),/* @__PURE__ */ W(Ms,{areaType:`value`,items:i,positionInfo:s,pivotTableId:c,pivotTableInfo:o,refreshHandler:a})]})]})}function Vs(e){let{className:t,unitId:n,subUnitId:r,pivotTableId:i}=e,[a,o]=Y(0),s=z(L),c=s.getDirection();return/* @__PURE__ */ G(`div`,{className:U(`univer-flex univer-size-full univer-min-h-0 univer-flex-col`,t),dir:c,children:[/* @__PURE__ */ W(Rn,{className:`univer-my-3 univer-w-full univer-shrink-0`,items:[{label:s.t(`sheets-pivot-ui.fieldPanel`),value:0},{label:s.t(`sheets-pivot-ui.configPanel`),value:1}],value:a,onChange:o}),/* @__PURE__ */ W(`div`,{className:U(`univer-min-h-0 univer-flex-1`,a===0?`univer-overflow-hidden`:`univer-overflow-auto`),children:a===0?/* @__PURE__ */ W(zs,{...e}):/* @__PURE__ */ W(gs,{unitId:n,subUnitId:r,pivotTableId:i})})]})}function Hs(e){let{unitId:t,subUnitId:n,pivotTableId:r,tableFieldId:i,type:a}=e,o=JSON.stringify([t,n,r,i,a]);return/* @__PURE__ */ W(Us,{...e},o)}function Us({unitId:e,subUnitId:t,pivotTableId:r,tableFieldId:i,type:a,baseItems:o,onConfirm:s,onCancel:c}){var u;let d=z(M),f=z(L),p=B(f.direction$,f.getDirection()),m=ci.find(e=>e.type===a),h=d.getPivotTableConfig(e,t,r),g=h==null||(u=h.fieldsConfig.measure[i])==null?void 0:u.showDataAs,_=()=>{var e;if((g==null?void 0:g.type)!==a||!g.baseFieldId)return``;if(g.baseItemType===l.previous)return`relative:previous`;if(g.baseItemType===l.next)return`relative:next`;let t=((e=o[g.baseFieldId])==null?void 0:e.items.indexOf(g.baseItem))??-1;return t<0?``:`item:${t}`},[v,y]=Y((g==null?void 0:g.type)===a?g.baseFieldId:``),[b,x]=Y(_),S=J(!1),[C,w]=Y(!1),T=d.getPivotTableConfig(e,t,r),E=d.getCollection(e,r),D=T==null?void 0:T.fieldsConfig.measure[i],O=!!(D&&E&&(E.fields[D.dataFieldId]||E.customFields.find(e=>e.id===D.dataFieldId))),ee=(T&&E&&m?ui(T,E,m):[]).filter(e=>{let t=o[e];return(m==null?void 0:m.baseItemMode)===`none`||!!(t&&((m==null?void 0:m.baseItemMode)===`item-or-relative`||t.items.length>0))}),te=ee.map(e=>({label:T.fieldsConfig.dimension[e].displayName,value:e})),k=T==null?void 0:T.fieldsConfig.dimension[v],ne=k&&E&&(E.fields[k.dataFieldId]??E.customFields.find(e=>e.id===k.dataFieldId)),A=o[v],re=(A==null?void 0:A.items.map((e,t)=>{var r;let i=A.itemTypes[t],a=(r=A.itemLabels)==null?void 0:r[e],o=ma(e,i),s=e;return o?s=f.t(o):a===void 0?i===n.other?s=f.t(`sheets-pivot-ui.showValuesAs.other`):(i===n.date||i===n.number)&&A.format&&(s=ut.format(A.format,Number(e))):s=a,{label:s,value:`item:${t}`,itemKey:e}}))??[];(m==null?void 0:m.baseItemMode)===`item-or-relative`&&re.push({label:f.t(`sheets-pivot-ui.showValuesAs.previous`),value:`relative:previous`,itemKey:``,itemType:l.previous},{label:f.t(`sheets-pivot-ui.showValuesAs.next`),value:`relative:next`,itemKey:``,itemType:l.next});let ie=re.find(e=>e.value===b),ae=!!(m!=null&&m.baseItemMode&&m.baseItemMode!==`none`),oe=!!(m&&T&&E&&O&&T.fieldsConfig.valueFields.includes(i)&&ee.includes(v)&&ne&&(!ae||ie));return/* @__PURE__ */ G(`div`,{dir:p,children:[/* @__PURE__ */ G(`div`,{className:`univer-mb-4`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:f.t(`sheets-pivot-ui.showValuesAs.baseField`)}),/* @__PURE__ */ W(zn,{className:`univer-w-full`,value:v,options:te,onChange:e=>{y(e),x(``)}})]}),ae&&/* @__PURE__ */ G(`div`,{className:`univer-mb-4`,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-text-sm univer-font-medium`,children:f.t(`sheets-pivot-ui.showValuesAs.baseItem`)}),/* @__PURE__ */ W(zn,{className:`univer-w-full`,value:b,options:re,disabled:!v,onChange:x})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[/* @__PURE__ */ W(V,{onClick:c,children:f.t(`sheets-pivot-ui.showValuesAs.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:!oe||C,onClick:async()=>{let n=d.getPivotTableConfig(e,t,r),o=d.getCollection(e,r),c=n==null?void 0:n.fieldsConfig.measure[i];if(!m||!n||!o||!c||S.current||!n.fieldsConfig.valueFields.includes(i)||!(o.fields[c.dataFieldId]||o.customFields.find(e=>e.id===c.dataFieldId))||!ui(n,o,m).includes(v)||ae&&!ie)return;let l={type:a,baseFieldId:v,baseItem:(ie==null?void 0:ie.itemKey)??``};(ie==null?void 0:ie.itemType)!==void 0&&(l.baseItemType=ie.itemType),S.current=!0,w(!0);try{await s(l)}catch{}finally{S.current=!1,w(!1)}},children:f.t(`sheets-pivot-ui.showValuesAs.ok`)})]})]})}const Ws=e=>{let[t,n]=Y(!1),r=z(_s);return q(()=>{r.setIsRangeSelector2Focus(t)},[t,r]),/* @__PURE__ */ W(Sr,{...e,onFocusChange:t=>{var r;(r=e.onFocusChange)==null||r.call(e,t),n(t)}})},Gs=(e,t,n,r,i,a)=>/* @__PURE__ */ W(Ws,{unitId:e,subUnitId:t,initialValue:r,onChange:(e,t)=>n(t),maxRangeCount:1,supportAcrossSheet:!0,keepSheetReference:!0}),Ks=(e,t)=>{switch(e){case 1:return t.t(`sheets-pivot-ui.msg.invalidSize`);case 0:return t.t(`sheets-pivot-ui.msg.emptySourceRange`);default:return``}};function qs(e){let{unitId:t,sourceRange:n,positionRange:r,sourceSheetName:i,positionSheetName:a,onConfirm:o,onCancel:s}=e,c=z(L),l=z(F),u=c.getDirection(),d=l.getUnit(t),f=_r(()=>d.getActiveSheet().getSheetId(),[d]),[p,m]=Y(n),[h,g]=Y(r),[_,v]=Y(i),[y,b]=Y(a),x=J(void 0),[S,C]=Y(),[w,T]=Y(A.New),[E,D]=Y(!0),[O,ee]=Y(!0),[te,k]=Y(void 0);q(()=>{let e=va(d.getSheetBySheetName(_),p);ee(e===2),k(Ks(e,c))},[p,_,d,c]);let ne=e=>{if(br(_,p)===e)return;let t=e.split(`,`).filter(e=>!!e).map(vr);if(Array.isArray(t)&&t.length>0){let{range:e,sheetName:n}=t[0];m(e),v(n)}t[0]||k(c.t(`sheets-pivot-ui.msg.emptySourceRange`))},re=Gs(t,f,e=>{if(h&&br(y,h)===e)return;let t=e.split(`,`).filter(e=>!!e).map(vr);if(t.length===0){g(null);return}let n=t[0];g(n.range),b(n.sheetName||i),n.sheetName===i&&Ze.intersects(n.range,p)?D(!1):D(!0)},h?br(y,h):``,!1,S),ie=()=>!!(p&&h&&_&&y&&w===A.Existing&&E&&O)||!!(p&&_&&w===A.New&&O);return q(()=>{C(x.current)},[]),/* @__PURE__ */ G(`div`,{ref:x,dir:u,children:[/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-h-5 univer-text-sm univer-font-medium`,children:c.t(`sheets-pivot-ui.dialog.source.sourceData`)}),Gs(t,f,ne,br(_,p),!0,S),te&&/* @__PURE__ */ W(`div`,{className:`univer-mt-2 univer-h-5 univer-text-xs univer-text-red-400`,children:te}),/* @__PURE__ */ W(`div`,{className:`univer-mb-2 univer-mt-5 univer-h-5 univer-text-sm univer-font-medium`,children:c.t(`sheets-pivot-ui.dialog.source.position`)}),/* @__PURE__ */ G(Ln,{value:w,onChange:e=>T(e),className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ W(In,{value:A.New,children:c.t(`sheets-pivot-ui.dialog.source.newSheet`)}),/* @__PURE__ */ W(In,{value:A.Existing,children:c.t(`sheets-pivot-ui.dialog.source.existingSheet`)})]}),w===A.Existing&&/* @__PURE__ */ G(mr,{children:[re,!E&&/* @__PURE__ */ W(`span`,{className:`univer-h-5 univer-text-sm univer-text-red-400`,children:c.t(`sheets-pivot-ui.dialog.source.intersect`)})]}),/* @__PURE__ */ W(`footer`,{className:`univer-mt-5`,children:/* @__PURE__ */ G(En,{className:`univer-flex univer-justify-end univer-gap-2`,children:[/* @__PURE__ */ W(V,{onClick:()=>s(),children:c.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,onClick:()=>{ie()&&(w===A.Existing?o({sourceRange:p,sourceSheetName:_,positionRange:h,positionSheetName:y,positionType:w}):o({sourceRange:p,sourceSheetName:_,positionType:w}))},children:c.t(`sheets-pivot-ui.dialog.ok`)})]})})]})}qs.componentKey=Rr;const Js=[{id:`equal`,localeKey:`sheets-pivot-ui.valueFilter.equal`,operator:h.valueEqual},{id:`notEqual`,localeKey:`sheets-pivot-ui.valueFilter.notEqual`,operator:h.valueNotEqual},{id:`greaterThan`,localeKey:`sheets-pivot-ui.valueFilter.greaterThan`,operator:h.valueGreaterThan},{id:`greaterThanOrEqual`,localeKey:`sheets-pivot-ui.valueFilter.greaterThanOrEqual`,operator:h.valueGreaterThanOrEqual},{id:`lessThan`,localeKey:`sheets-pivot-ui.valueFilter.lessThan`,operator:h.valueLessThan},{id:`lessThanOrEqual`,localeKey:`sheets-pivot-ui.valueFilter.lessThanOrEqual`,operator:h.valueLessThanOrEqual},{id:`between`,localeKey:`sheets-pivot-ui.valueFilter.between`,operator:h.valueBetween,isBetween:!0},{id:`notBetween`,localeKey:`sheets-pivot-ui.valueFilter.notBetween`,operator:h.valueNotBetween,isBetween:!0},{id:`topCount`,localeKey:`sheets-pivot-ui.valueFilter.topCount`,operator:h.count,isCount:!0},{id:`bottomCount`,localeKey:`sheets-pivot-ui.valueFilter.bottomCount`,operator:h.count,isBottom:!0,isCount:!0},{id:`topPercent`,localeKey:`sheets-pivot-ui.valueFilter.topPercent`,operator:h.percent,isPercent:!0},{id:`bottomPercent`,localeKey:`sheets-pivot-ui.valueFilter.bottomPercent`,operator:h.percent,isBottom:!0,isPercent:!0}];function Ys({targetFieldId:e,targetFieldName:t,valueFields:n,defaultValueFieldId:r,currentFilter:i,onConfirm:a,onClear:o,onCancel:s}){function c(e){var t;return(e==null?void 0:e.operator)===h.count?e.isBottom?`bottomCount`:`topCount`:(e==null?void 0:e.operator)===h.percent?e.isBottom?`bottomPercent`:`topPercent`:((t=Js.find(t=>t.operator===(e==null?void 0:e.operator)))==null?void 0:t.id)??`greaterThan`}let l=z(L),u=B(l.direction$,l.getDirection()),d=i==null?void 0:i.expected,[f,p]=Y(()=>{let e=i==null?void 0:i.valueFieldId;return e&&n.some(t=>t.id===e)?e:r&&n.some(e=>e.id===r)?r:n.length===1?n[0].id:``}),[m,g]=Y(()=>c(i)),[_,v]=Y(()=>String(Array.isArray(d)?d[0]:d??0)),[y,b]=Y(()=>String(Array.isArray(d)?d[1]:0)),x=J(!1),[S,C]=Y(!1),w=Js.find(e=>e.id===m),T=_.trim()!==``&&Number.isFinite(Number(_)),E=!w.isBetween||y.trim()!==``&&Number.isFinite(Number(y)),D=!w.isCount||Number.isInteger(Number(_))&&Number(_)>=1,O=!w.isPercent||Number(_)>=0&&Number(_)<=100,ee=!!(n.some(e=>e.id===f)&&T&&E&&D&&O),te=async e=>{if(!x.current){x.current=!0,C(!0);try{await e()}catch{}finally{x.current=!1,C(!1)}}},k=()=>te(async()=>{if(!ee)return;let e={operator:w.operator,expected:w.isBetween?[Number(_),Number(y)]:Number(_),valueFieldId:f};w.isBottom&&(e.isBottom=!0),await a(e)}),ne=()=>te(o);return/* @__PURE__ */ G(`div`,{className:`univer-flex univer-flex-col univer-gap-4`,"data-target-field-id":e,dir:u,children:[/* @__PURE__ */ W(`div`,{className:`univer-text-sm univer-font-medium`,children:/* @__PURE__ */ W(`bdi`,{dir:`auto`,children:t})}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-flex-col univer-gap-2 univer-text-sm`,children:[l.t(`sheets-pivot-ui.valueFilter.valueField`),/* @__PURE__ */ W(zn,{"aria-label":l.t(`sheets-pivot-ui.valueFilter.valueField`),"data-testid":`pivot-value-filter-value-field`,value:f,options:[{value:``,label:l.t(`sheets-pivot-ui.valueFilter.selectValueField`)},...n.map(e=>({value:e.id,label:e.label}))],onChange:p})]}),/* @__PURE__ */ G(`label`,{className:`univer-flex univer-flex-col univer-gap-2 univer-text-sm`,children:[l.t(`sheets-pivot-ui.valueFilter.condition`),/* @__PURE__ */ W(zn,{"aria-label":l.t(`sheets-pivot-ui.valueFilter.condition`),"data-testid":`pivot-value-filter-rule`,value:m,options:Js.map(e=>({value:e.id,label:l.t(e.localeKey)})),onChange:e=>g(e)})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-gap-2`,children:[/* @__PURE__ */ W(kn,{"aria-label":l.t(`sheets-pivot-ui.valueFilter.condition`),"aria-invalid":!T||!D||!O,className:`univer-min-w-0 univer-flex-1`,"data-testid":`pivot-value-filter-expected`,inputMode:`decimal`,value:_,onChange:v}),w.isBetween&&/* @__PURE__ */ W(kn,{"aria-label":l.t(`sheets-pivot-ui.valueFilter.condition`),"aria-invalid":!E,className:`univer-min-w-0 univer-flex-1`,"data-testid":`pivot-value-filter-expected`,inputMode:`decimal`,value:y,onChange:b})]}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-justify-between univer-gap-3`,children:[/* @__PURE__ */ W(V,{"data-testid":`pivot-value-filter-clear`,disabled:S,onClick:ne,children:l.t(`sheets-pivot-ui.valueFilter.clear`)}),/* @__PURE__ */ G(`div`,{className:`univer-flex univer-gap-3`,children:[/* @__PURE__ */ W(V,{disabled:S,onClick:s,children:l.t(`sheets-pivot-ui.valueFilter.cancel`)}),/* @__PURE__ */ W(V,{"data-testid":`pivot-value-filter-confirm`,variant:`primary`,disabled:!ee||S,onClick:k,children:l.t(`sheets-pivot-ui.valueFilter.ok`)})]})]})]})}function Xs(e){let{pivotTableId:t,tableFieldId:n,closeFn:r,unitId:i,subUnitId:a,format:o,tableFieldInfo:s,dataFieldInfo:c,version:l}=e,[u,d]=Y(s.displayName),[f,p]=Y(s.subTotalType),m=z(L),h=z(P),g=z(R),_={...z(M).getTextInfo()};for(let e of[`sheets-pivot-ui.averageName`,`sheets-pivot-ui.countName`,`sheets-pivot-ui.countNumsName`,`sheets-pivot-ui.maxName`,`sheets-pivot-ui.minName`,`sheets-pivot-ui.productName`,`sheets-pivot-ui.stdDevName`,`sheets-pivot-ui.stdDevpName`,`sheets-pivot-ui.sumName`,`sheets-pivot-ui.varName`,`sheets-pivot-ui.varpName`])_[e]=m.t(e);if(q(()=>{d(s.displayName),p(s.subTotalType)},[l]),!s||!c)return;let v=c.name,y=m.getDirection(),b=o??s.format,x=Oa.map(e=>({value:`${e.type}`,type:e.type,label:m.t(e.textKey)})),S=e=>{let t=e;if(Array.isArray(e)&&(t=e[0]),t!==void 0){let e=Number(t);p(e),Ba(v,u,_)&&d(Va(v,_,e))}};return/* @__PURE__ */ G(`div`,{dir:y,children:[/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-self-stretch univer-leading-5`,children:[/* @__PURE__ */ W(`span`,{className:`univer-text-sm univer-font-medium univer-leading-5 univer-text-gray-900`,children:m.t(`sheets-pivot-ui.dialog.fieldName`)}),/* @__PURE__ */ W(`span`,{className:`univer-text-xs univer-leading-4 univer-text-gray-600`,children:ha(m.t(`sheets-pivot-ui.dialog.sourceName`),v)})]}),/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(kn,{className:`univer-mb-5 univer-mt-2 univer-box-border univer-h-8 univer-w-full univer-rounded-md univer-py-1.5 univer-text-sm univer-leading-5`,value:u,onChange:e=>d(e)})}),/* @__PURE__ */ W(`label`,{className:`univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0`,children:m.t(`sheets-pivot-ui.dialog.summarizeBy`)}),/* @__PURE__ */ W(`div`,{className:U(`univer-h-40 univer-flex-1 univer-overflow-y-auto univer-rounded-lg`,Un,Wn),children:x.map(e=>/* @__PURE__ */ G(`div`,{className:`univer-flex univer-items-center univer-gap-1.5 univer-self-stretch univer-rounded-md univer-px-2 univer-py-1.5 univer-text-sm univer-capitalize univer-leading-5`,onClick:()=>S(e.value),children:[/* @__PURE__ */ W(`span`,{className:`univer-w-4 univer-text-base univer-text-primary-600`,children:/* @__PURE__ */ W(tr,{className:U({"univer-hidden":f!==e.type})})}),/* @__PURE__ */ W(`span`,{children:e.label})]},e.type))}),/* @__PURE__ */ W(`footer`,{className:`univer-mt-5`,children:/* @__PURE__ */ G(En,{className:`univer-flex univer-items-center univer-justify-between univer-self-stretch`,children:[/* @__PURE__ */ W(V,{className:`univer-flex univer-h-8 univer-cursor-pointer univer-items-center univer-justify-center univer-gap-1.5 univer-rounded univer-border-none univer-bg-gray-0 univer-px-3 univer-text-primary-600`,onClick:()=>{let e={id:Ar,draggable:!0,mask:!1,maskClosable:!1,width:400,children:{label:jr,unitId:i,subUnitId:a,pivotTableId:t,tableFieldId:n,originPattern:b,tableFieldInfo:s,dataFieldInfo:c},dialogStyles:{header:{padding:`20px 24px 0`,height:0},body:{padding:`0 24px 20px`}},closable:!1,onClose:()=>{g.close(Ar)}};g.open(e)},children:m.t(`sheets-pivot-ui.dialog.format`)}),/* @__PURE__ */ G(En,{className:`univer-flex univer-flex-1 univer-gap-2 univer-text-sm rtl:univer-flex-row-reverse`,children:[/* @__PURE__ */ W(V,{onClick:()=>{r&&r()},children:m.t(`sheets-pivot-ui.dialog.cancel`)}),/* @__PURE__ */ W(V,{variant:`primary`,disabled:u===``,onClick:()=>{let e=s.displayName,o=s.subTotalType,l=s.format,d=e===u?void 0:u,p=o===f?void 0:f,m=l===b?void 0:b;if(e!==u||o!==f||l!==m){let e={displayName:d,subtotalType:p,format:m,tableFieldId:n,pivotTableId:t,unitId:i,subUnitId:a,tableFieldInfo:s,dataFieldInfo:c};h.executeCommand(Se.id,e)}r&&r()},children:m.t(`sheets-pivot-ui.dialog.ok`)})]})]})})]})}let Zs=class extends N{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[Rr,qs],[Tr,Vs],[Dr,ts],[kr,Xs],[jr,us],[Nr,Hs],[Pr,Ys],[Fr,Jo],[Ir,is],[Lr,ns]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({PivotTableIcon:ur}))}};Zs=Q([Z(0,I(Ft)),Z(1,I(Vt))],Zs);let Qs=class extends N{constructor(e){super(),this._menuManagerService=e,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(Xi)}};Qs=Q([Z(0,Rt)],Qs);let $s=class extends N{constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this._context=e,this._injector=t,this._sheetsPivotTableAdaptorModel=n,this._sheetSkeletonManagerService=r,this._sheetsPivotTableConfigModel=i,this._commandService=a,this._sheetPermissionCheckController=o,this._permissionService=s,this._localeService=c,this._selectionsService=l,this._cellAlerts=u,X(this,`_pivotButtonShapesArr`,[]),this._initButtonRender(),this._initSkeleton(),this._initListener(),this._initBlockedPivotAlert()}_initBlockedPivotAlert(){let e=`SHEET_PIVOT_BLOCKED:${this._context.unitId}`;this.disposeWithMe(yn(this._selectionsService.selectionChanged$,this._context.unit.activeSheet$,this._sheetsPivotTableAdaptorModel.viewUpdate$).pipe(pn(0)).subscribe(()=>{var t,n,r;let{unitId:i,unit:a}=this._context,o=this._selectionsService.currentSelectionParam,s=(t=a.getActiveSheet())==null?void 0:t.getSheetId(),c=(n=this._selectionsService.getCurrentSelections())==null||(n=n.slice(-1)[0])==null?void 0:n.primary;if(!s||!c||(o==null?void 0:o.unitId)!==i||o.sheetId!==s){this._cellAlerts.removeAlert(e);return}let{actualRow:l,actualColumn:u}=c,d=this._sheetsPivotTableAdaptorModel,f=d.getPivotTableIdByCell(i,s,l,u),p=f&&((r=d.getPivotItemRenderInfoCache(i,s,f))==null?void 0:r.blockedRange);if(!p){this._cellAlerts.removeAlert(e);return}let m=`sheets-pivot-ui.perform.blocked`;p.reason===`pivot`?m=`sheets-pivot-ui.perform.blockedByPivot`:p.reason===`merge`&&(m=`sheets-pivot-ui.perform.blockedByMerge`),this._cellAlerts.showAlert({key:e,type:qt.ERROR,title:this._localeService.t(`sheets-pivot-ui.perform.tips`),message:this._localeService.t(m,yr(p)),location:{unitId:i,subUnitId:s,row:l,col:u},width:260,height:96})})),this.disposeWithMe(()=>this._cellAlerts.removeAlert(e))}_initButtonRender(){this.disposeWithMe(yn(this._sheetsPivotTableAdaptorModel.viewUpdate$.pipe(pn(0)),this._sheetSkeletonManagerService.currentSkeleton$,this._sheetsPivotTableConfigModel.pivotConfigChange$,this._permissionService.permissionPointUpdate$.pipe(pn(100))).subscribe(()=>{if(!this._context.unit)return;let e=this._context.unitId,t=this._context.unit.getActiveSheet().getSheetId(),{scene:n}=this._context,r=this._localeService.getDirection(),i=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!i)return;let a=this._pivotButtonShapesArr;a.forEach(e=>e.dispose()),a.splice(0,a.length),this._sheetsPivotTableAdaptorModel.getSubUnitPivotMatrix(e,t).forValue((o,s,c)=>{if(c!=null&&c.pbt){let l=`sheets-pivot-button-${o}-${s}-${e}-${t}`,{startX:u,startY:d,endX:f,endY:p}=on(o,s,n,i),m=f-u,h=p-d;if(h<8||m<8||this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Et],worksheetTypes:[At,Dt,kt],rangeTypes:[yt,vt]},[{startRow:o,endRow:o,startColumn:s,endColumn:s}],e,t)===!1)return;let g;if(Ao.has(c.pbt)){let{left:n,top:i}=Po(r,`filter`,{startX:u,startY:d,endX:f,endY:p});g={left:n,top:i,height:16,width:16,zIndex:5e3,cellWidth:m,cellHeight:h,pivotParams:{col:s,row:o,unitId:e,subUnitId:t,buttonType:c.pbt}}}else if(jo.has(c.pbt)){let{left:n,top:i}=Po(r,`collapse`,{startX:u,startY:d,endX:f,endY:p});g={left:n,top:i,height:16,width:16,zIndex:5e3,cellWidth:m,cellHeight:h,pivotParams:{col:s,row:o,unitId:e,subUnitId:t,buttonType:c.pbt}}}else return;let _=this._injector.createInstance(Mo,l,g);a.push(_)}}),a.length&&n.addObjects(a),n.makeDirty()}))}_initSkeleton(){var e;this.disposeWithMe(this._sheetsPivotTableAdaptorModel.markDirty$.subscribe(({unitId:e,subUnitId:t})=>{if(e===this._context.unitId&&(this._sheetSkeletonManagerService.makeDirty({sheetId:t}),this._context.unit.getActiveSheet().getSheetId()===t)){var n;this._sheetSkeletonManagerService.reCalculate(),(n=this._context.mainComponent)==null||n.makeDirty()}}));let t=this._context.unitId;this._context.unit.getSheets().forEach(e=>{var n;let r=e.getSheetId();(n=this._sheetsPivotTableAdaptorModel.getSubUnitPivotRenderCache(t,r))!=null&&n.size&&this._sheetSkeletonManagerService.makeDirty({sheetId:r})}),this._sheetSkeletonManagerService.reCalculate(),(e=this._context.mainComponent)==null||e.makeDirty()}_initListener(){let e=new Be,{spreadsheet:t}=un(this._context.unit,this._context);e.add(t.onDblclick$.subscribeEvent(e=>{if(e.button===2)return;let t=this._sheetSkeletonManagerService.getCurrentSkeleton();if(t==null)return;let n=this._context.scene,{row:r,column:i}=sn(e.offsetX,e.offsetY,n,t);this._commandService.executeCommand(ne.id,{row:r,col:i})}))}};$s=Q([Z(1,I(Ke)),Z(2,I(j)),Z(3,I(tn)),Z(4,I(M)),Z(5,I(P)),Z(6,I(Ct)),Z(7,I(Ge)),Z(8,I(L)),Z(9,I(wt)),Z(10,I(Kt))],$s);var ec=class e extends Yn{constructor(e){super(`SHEET_PIVOT_MOVE_KEY`),X(this,`_moveType`,void 0),this._moveType=e}_draw(t){this.width!==0&&this.height!==0&&e.drawWith(t,this)}static drawWith(e,t){let n=t._moveType;if(e.save(),e.strokeStyle=`#8bc34a`,e.lineWidth=2,n===`row`){let n=t.width;if(!n)return;e.beginPath(),e.moveTo(0,0),e.lineTo(0+n,0),e.moveTo(0,-10),e.lineTo(0,10),e.moveTo(0+n,-10),e.lineTo(0+n,10)}else{let n=t.height;if(!n)return;e.moveTo(0,0),e.lineTo(0,0+n),e.moveTo(-10,0),e.lineTo(10,0),e.moveTo(-10,0+n),e.lineTo(10,0+n)}e.stroke(),e.restore()}};let tc=class extends N{constructor(e,t,n,r,i,a){super(),this._context=e,this._sheetsPivotTableAdaptorModel=t,this._sheetSkeletonManagerService=n,this._commandService=r,this._selectionRenderService=i,this._sheetsSelectionsService=a,X(this,`_pivotSelectionMoveShape`,void 0),X(this,`_scenePointerMoveSubscribe`,void 0),X(this,`_scenePointerUpSubscribe`,void 0),X(this,`_selectionControl`,void 0),X(this,`_moveStartRange`,void 0),X(this,`_moveStartCellIndex`,void 0),X(this,`_moveRowOrCol`,`row`),X(this,`_targetRange`,void 0),X(this,`_movePivotId`,void 0),this._initControl()}_controlMoving(e,t){let n=this._context.scene,r=n.getScrollXYInfoByViewport(Zn.FromArray([e,t])),{scaleX:i,scaleY:a}=n.getAncestorScale(),o=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!o||!this._moveStartRange||!this._moveStartCellIndex)return;let{row:s,column:c}=o.getCellIndexByOffset(e,t,i,a,r);if(this._moveRowOrCol===`row`){var l;let e=0,t=0,n=this._moveStartRange.endColumn-this._moveStartRange.startColumn+1;if(this._moveStartCellIndex.column===this._moveStartRange.startColumn)e=c,t=c+n-1;else if(this._moveStartCellIndex.column===this._moveStartRange.endColumn)t=c,e=c-n+1;else{let r=this._moveStartCellIndex.column-this._moveStartRange.startColumn;e=c-r,t=c-r+n-1}let r=o.getCellWithCoordByIndex(s,e),i=o.getCellWithCoordByIndex(s,t),{startX:a,endY:u}=r,{endX:d}=i;this._targetRange={startRow:s,endRow:s,startColumn:e,endColumn:t},(l=this._pivotSelectionMoveShape)==null||l.transformByState({left:a,top:u,width:d-a,height:20})}else{var u;let e=0,t=0,n=this._moveStartRange.endRow-this._moveStartRange.startRow+1;if(this._moveStartCellIndex.row===this._moveStartRange.startRow)e=s,t=s+n-1;else if(this._moveStartCellIndex.row===this._moveStartRange.endRow)t=s,e=s-n+1;else{let r=this._moveStartCellIndex.row-this._moveStartRange.startRow;e=s-r,t=s-r+n-1}let r=o.getCellWithCoordByIndex(e,c),i=o.getCellWithCoordByIndex(t,c),{startX:a,startY:l}=r,{endY:d}=i;this._targetRange={startColumn:c,endColumn:c,startRow:e,endRow:t},(u=this._pivotSelectionMoveShape)==null||u.transformByState({left:a,top:l,width:20,height:d-l})}}_controlPointerDownHandler(e){var t,n,r;(t=this._selectionControl)==null||t.setControlExtensionDisable(!1),this._context.scene.setCursor(Kn.DEFAULT);let i=this._sheetsSelectionsService.getCurrentSelections();if(!i.length||i.length>1)return;let a=i[0].range,o=this._context.unit,s=o.getActiveSheet(),c=o.getUnitId(),l=s.getSheetId(),u=this._sheetsPivotTableAdaptorModel.getSubUnitPivotRenderCache(c,l);if(!(u!=null&&u.size))return;let d=Array.from(u).find(([e,t])=>{let{rangesInfo:n}=t;if(!n)return!1;let{rowRanges:r,colRanges:i}=n,o=r[0],s=i[0],c=!1;return o&&(c=Ze.realContain(o,a),this._moveRowOrCol=`row`),!c&&s&&(c=Ze.realContain(s,a),this._moveRowOrCol=`col`),c});if(!d)return;this._movePivotId=d[0],this._pivotSelectionMoveShape||(this._pivotSelectionMoveShape=new ec(this._moveRowOrCol),this._context.scene.addObject(this._pivotSelectionMoveShape));let f=this._context.scene,p=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!p)return;let{offsetX:m,offsetY:h}=e,g=f.getCoordRelativeToViewport(Zn.FromArray([m,h])),{x:_,y:v}=g,y=f.getScrollXYInfoByViewport(g),{scaleX:b,scaleY:x}=f.getAncestorScale(),{row:S,column:C}=p.getCellIndexByOffset(_,v,b,x,y),w=(n=this._selectionControl)==null?void 0:n.model.getRange();if(this._moveStartRange=w,!w)return;let T=0;T=S<w.startRow?w.startRow:S>w.endRow?w.endRow:S;let E=0;E=C<w.startColumn?w.startColumn:C>w.endColumn?w.endColumn:C,this._moveStartCellIndex={row:T,column:E},(r=this._selectionControl)==null||r.setControlExtensionDisable(!0),this._scenePointerMoveSubscribe=f.onPointerMove$.subscribeEvent(e=>{let{offsetX:t,offsetY:n}=e,{x:r,y:i}=f.getCoordRelativeToViewport(Zn.FromArray([t,n]));this._controlMoving(r,i),f.setCursor(Kn.MOVE)}),this._scenePointerUpSubscribe=f.onPointerUp$.subscribeEvent(e=>{var t,n,r;(t=this._scenePointerMoveSubscribe)==null||t.unsubscribe(),this._scenePointerMoveSubscribe=null,(n=this._selectionControl)==null||n.setControlExtensionDisable(!1),this._selectionControl=null,f.setCursor(Kn.DEFAULT),f.removeObject(this._pivotSelectionMoveShape),this._pivotSelectionMoveShape=null,this._updatePivotSort(),(r=this._scenePointerUpSubscribe)==null||r.unsubscribe(),this._scenePointerUpSubscribe=null})}_updatePivotSort(){if(!this._moveStartRange||!this._targetRange||!this._movePivotId)return;let e=this._context.unit.getUnitId(),n=this._context.unit.getActiveSheet().getSheetId();if(this._moveRowOrCol===`row`){var i;let o=(i=this._sheetsPivotTableAdaptorModel.getSubUnitPivotRenderCache(e,n))==null?void 0:i.get(this._movePivotId);if(!o)return;let s=this._sheetsPivotTableAdaptorModel.getSubUnitPivotMatrix(e,n);if(!s)return;let c=[],l=``,{headerMap:u,rangesInfo:d}=o;for(let e=this._moveStartRange.startColumn;e<=this._moveStartRange.endColumn;e++){var a;let n=u==null||(a=u.rowHeaderMap)==null?void 0:a[e];if(!n)continue;l=n.tableFieldId;let r=d==null?void 0:d.rowRanges,i=r==null?void 0:r[0];if(!i)continue;let o={...i,startColumn:e,endColumn:e};for(let n=o.startRow;n<=o.endRow;n++){let r=s.getValue(n,e);if(!r)continue;let{v:i,pbt:a}=r;i&&a!==t.Subtotal&&a!==t.GrandTotal&&(typeof i==`string`?c[n]=i:typeof i==`number`&&(c[n]=i.toString()))}break}if(!l)return;let f=this._moveStartRange.startRow,p=this._moveStartRange.endRow-this._moveStartRange.startRow+1,m=this._targetRange.startRow;if(f<m){let e=c.splice(f,p);c.splice(m-p,0,...e)}else{let e=c.splice(f,p);c.splice(m,0,...e)}let h=c.filter(e=>e!==void 0);this._commandService.executeCommand(_e.id,{unitId:e,subUnitId:n,pivotTableId:this._movePivotId,tableFieldId:l,info:{type:r.custom,customOrder:h}})}else{var o;let i=(o=this._sheetsPivotTableAdaptorModel.getSubUnitPivotRenderCache(e,n))==null?void 0:o.get(this._movePivotId);if(!i)return;let a=this._sheetsPivotTableAdaptorModel.getSubUnitPivotMatrix(e,n);if(!a)return;let c=[],l=``,{headerMap:u,rangesInfo:d}=i;for(let e=this._moveStartRange.startRow;e<=this._moveStartRange.endRow;e++){var s;let n=u==null||(s=u.colHeaderMap)==null?void 0:s[e];if(!n)continue;l=n.tableFieldId;let r=d==null?void 0:d.colRanges,o=r==null?void 0:r[0];if(!o)continue;let f={...o,startRow:e,endRow:e};for(let n=f.startColumn;n<=f.endColumn;n++){let r=a.getValue(e,n);if(!r)continue;let{v:o,pbt:s}=r;if(o&&s!==t.Subtotal&&s!==t.GrandTotal){if(typeof o==`string`){let e=i.projection?Ae(i.projection,n):n;c[e]=o}else if(typeof o==`number`){let e=i.projection?Ae(i.projection,n):n;c[e]=o.toString()}}}break}if(!l)return;let f=i.projection?je(i.projection,this._moveStartRange):this._moveStartRange,p=i.projection?je(i.projection,this._targetRange):this._targetRange,m=f.startColumn,h=this._moveStartRange.endColumn-this._moveStartRange.startColumn+1,g=p.startColumn;if(m<g){let e=c.splice(m,h);c.splice(g-h,0,...e)}else{let e=c.splice(m,h);c.splice(g,0,...e)}let _=c.filter(e=>e!==void 0);this._commandService.executeCommand(_e.id,{unitId:e,subUnitId:n,pivotTableId:this._movePivotId,tableFieldId:l,info:{type:r.custom,customOrder:_}})}}_initControl(){this.disposeWithMe(this._sheetsSelectionsService.selectionMoveEnd$.subscribe(()=>{let e=this._selectionRenderService.getSelectionControls();if(this._selectionControl=e[e.length-1],this._selectionControl&&this._selectionControl.setControlExtensionDisable(!1),!this._selectionControl)return;let{leftControl:t,rightControl:n,topControl:r,bottomControl:i}=this._selectionControl;[t,n,r,i].forEach(e=>{e.onPointerDown$.subscribeEvent(this._controlPointerDownHandler.bind(this))})}))}dispose(){var e,t;(e=this._scenePointerMoveSubscribe)==null||e.unsubscribe(),this._scenePointerMoveSubscribe=null,(t=this._scenePointerUpSubscribe)==null||t.unsubscribe(),this._scenePointerUpSubscribe=null,this._selectionControl=null,this._moveStartRange=null,this._moveStartCellIndex=null,this._targetRange=null,super.dispose()}};tc=Q([Z(1,I(j)),Z(2,I(tn)),Z(3,I(P)),Z(4,Xt),Z(5,I(wt))],tc);let nc=class extends Je{constructor(e=ia,t,n,r,i){super(),this._config=e,this._injector=t,this._commandService=n,this._renderManagerService=r,this._configService=i;let{menu:a,...o}=lt({},ia,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(ra,o),this._initRegisterCommand()}onStarting(){this._injector.add([Zs]),this._injector.get(Zs),[[Qs],[Uo],[Ro],[_s],[Ho],[Bo],[Vo],[ca],[Io]].forEach(e=>this._injector.add(e)),this._injector.get(ca)}onReady(){this._registerRenderModules(),this._injector.get(Qs)}onRendered(){this._injector.get(Ro),this._injector.get(_s),this._injector.get(Ho),this._injector.get(Bo),this._injector.get(Vo),this._injector.get(Io)}onSteady(){this._injector.get(Uo)}_registerRenderModules(){[[$s],[tc]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(et.UNIVER_SHEET,e))})}_initRegisterCommand(){[na,Vr,$i,ea,Ur,qr,ti,ni,ri,si,li,vi].forEach(e=>this._commandService.registerCommand(e))}};X(nc,`pluginName`,`${se}_UI_PLUGIN`),X(nc,`packageName`,Zi),X(nc,`version`,Qi),X(nc,`type`,et.UNIVER_SHEET),nc=Q([ze(Gn,Xn,Tt,xe,an),Z(1,I(Ke)),Z(2,I(P)),Z(3,qn),Z(4,He)],nc);export{ws as DragDropContext,Es as Draggable,Ts as Droppable,Vr as OpenPivotTableRangeSelectorPanelOperation,ds as PivotFilterOptions,ts as PivotFilterPanel,Xi as SheetsPivotTableUIMenuSchema,Wo as UniverSheetsPivotTableMobileUIPlugin,nc as UniverSheetsPivotTableUIPlugin};