@univerjs/ui 0.2.4-alpha.0 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +13 -13
- package/lib/es/index.js +1206 -1172
- package/lib/types/services/contextmenu/contextmenu.service.d.ts +6 -0
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +2 -1
- package/lib/types/services/shortcut/keycode.d.ts +3 -1
- package/lib/umd/index.js +14 -14
- package/package.json +12 -12
package/lib/cjs/index.js
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Xa=s,Qa=Symbol.for("react.element"),Ja=Symbol.for("react.fragment"),Ka=Object.prototype.hasOwnProperty,es=Xa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ts={key:!0,ref:!0,__self:!0,__source:!0};function A6(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ka.call(t,r)&&!ts.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Qa,type:e,key:o,ref:a,props:i,_owner:es.current}}ft.Fragment=Ja;ft.jsx=A6;ft.jsxs=A6;V6.exports=ft;var g=V6.exports;function Kn(e){return typeof e=="function"?e():e}function Oe(e,t,n,r){if(typeof e=="function"&&!r)throw new Error("[useObservable]: expect deps when observable is a function! Otherwise it would cause an infinite loop.");const i=s.useRef(null),o=s.useRef(!1),a=s.useMemo(()=>e,[...typeof r<"u"?r:[e]]),[c,h]=s.useState(0),v=s.useRef((()=>{let p;return a&&Kn(a).subscribe(m=>{o.current=!0,p=m}).unsubscribe(),p!=null?p:t})());if(s.useEffect(()=>{let p=null;return a&&(i.current=Kn(a),p=i.current.subscribe(d=>{v.current=d,h(m=>m+1)})),()=>p==null?void 0:p.unsubscribe()},[a]),n&&!o.current)throw new Error("[useObservable]: expect shouldHaveSyncValue but not getting a sync value!");return v.current}function ze(e){const{title:t,icon:n,label:r,value:i,value$:o}=e,a=u.useDependency(u.LocaleService),c=u.useDependency(qe),h=[];let v=0,p=i;o&&(p=Oe(o,void 0,!0));let d;re.isObservable(n)?d=Oe(n,void 0,!0):d=n;let m=!1;if(p&&typeof p=="string"&&(m=new u.ColorKit(p).isValid),n){const _=c.get(d!=null?d:"");_&&h.push(g.jsx(_,{extend:{colorChannel1:m?p:"rgb(var(--primary-color))"}},v++))}if(r){const _=typeof r=="string",L=_?{...e}:{...r==null?void 0:r.props,...e},x=_?r:r==null?void 0:r.name,w=c.get(x);w?h.push(g.jsx(w,{...L,value:p},v++)):h.push(g.jsx("span",{children:a.t(x)},v++))}return t&&h.push(g.jsx("span",{children:typeof t=="string"?a.t(t):t},v++)),g.jsx(g.Fragment,{children:h})}const ns="univer-ui-plugin-sheets-font-family",rs="univer-ui-plugin-sheets-font-family-item",j6={uiPluginSheetsFontFamily:ns,uiPluginSheetsFontFamilyItem:rs},is=e=>{const{value:t}=e,n=u.useDependency(u.LocaleService),r=s.useMemo(()=>{var o;let i=n.t(`fontFamily.${((o=`${t}`)!=null?o:"").replace(/\s/g,"")}`);return i.startsWith("fontFamily.")&&typeof t=="string"&&(i=t.split(",")[0]),i},[t]);return g.jsx("div",{className:j6.uiPluginSheetsFontFamily,style:{fontFamily:t},children:r})},os=e=>{var r;const{value:t}=e,n=u.useDependency(u.LocaleService);return g.jsx("span",{className:j6.uiPluginSheetsFontFamilyItem,style:{fontFamily:t},children:n.t(`fontFamily.${((r=`${t}`)!=null?r:"").replace(/\s/g,"")}`)})},as=[{value:"Arial"},{value:"Times New Roman"},{value:"Tahoma"},{value:"Verdana"},{value:"Microsoft YaHei"},{value:"SimSun"},{value:"SimHei"},{value:"Kaiti"},{value:"FangSong"},{value:"NSimSun"},{value:"STXinwei"},{value:"STXingkai"},{value:"STLiti"}],ss="univer-ui-plugin-sheets-font-size",ls="univer-ui-plugin-sheets-font-size-input",er={uiPluginSheetsFontSize:ss,uiPluginSheetsFontSizeInput:ls},cs=e=>{const{value:t,min:n,max:r,onChange:i,disabled$:o}=e,a=Oe(o),[c,h]=s.useState(Number(t!=null?t:0)),v=s.useMemo(()=>Number(t!=null?t:c),[t]);function p(m){m!==null&&h(m)}function d(m){m.stopPropagation(),m.code==="Enter"&&i(c.toString())}return g.jsx("div",{className:er.uiPluginSheetsFontSize,children:g.jsx(ue.InputNumber,{className:er.uiPluginSheetsFontSizeInput,value:v,controls:!1,min:n,max:r,onKeyDown:d,onChange:p,disabled:a})})},us=[{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"20",value:20},{label:"22",value:22},{label:"24",value:24},{label:"26",value:26},{label:"28",value:28},{label:"36",value:36},{label:"48",value:48},{label:"72",value:72}];var P6={};Object.defineProperty(P6,"__esModule",{value:!0});var $6=P6.default=fs;function fs(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function k6(e){const t=s.useRef(e);return t.current=e,s.useCallback((...n)=>t.current(...n),[])}function B6(e,t){const n=k6(()=>{if(!e||!t)return;const r=e.style,i=e.getBoundingClientRect(),{y:o}=i,a=t.getBoundingClientRect(),c=e.scrollHeight>i.height,h=o<0||o+i.height>a.height;if(!h&&!c){r.overflowY="",r.maxHeight="";return}h&&(r.overflowY="scroll",r.maxHeight=o<0?`${e.scrollHeight+o}px`:`${a.height-o}px`)});s.useEffect(()=>{if(!$6()||!e||!t)return;n();const r=ue.resizeObserverCtor(n);return r.observe(e),()=>{r.unobserve(e)}},[e,t])}function ds(e,t,...n){return e.t(t)}const tr="univer.command.copy",vn={id:tr,name:tr,multi:!0,priority:0,type:u.CommandType.COMMAND,preconditions:()=>!1,handler:async()=>!0},nr="univer.command.cut",gn={id:nr,name:nr,multi:!0,priority:0,type:u.CommandType.COMMAND,preconditions:()=>!1,handler:async()=>!0},rr="univer.command.paste",mn={id:rr,name:rr,multi:!0,priority:0,type:u.CommandType.COMMAND,preconditions:()=>!1,handler:async()=>!0};function hs(e,t,n){return window.addEventListener(e,t,n),u.toDisposable(()=>window.removeEventListener(e,t,n))}var ps=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,gs=(e,t,n,r)=>{for(var i=r>1?void 0:r?vs(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ps(t,n,i),i},z1=(e,t)=>(n,r)=>t(n,r,e);class ms{constructor(t){A(this,"_focus",!1);A(this,"_valueLegality",!0);A(this,"_openForSheetUnitId");A(this,"_openForSheetSubUnitId");this._param=t,this._openForSheetUnitId=this._param.openForSheetUnitId,this._openForSheetSubUnitId=this._param.openForSheetSubUnitId}get documentDataModel(){return this._param.documentDataModel}get editorUnitId(){return this._param.editorUnitId}get cancelDefaultResizeListener(){return this._param.cancelDefaultResizeListener}get render(){return this._param.render}isSingleChoice(){return this._param.isSingleChoice}setOpenForSheetUnitId(t){this._openForSheetUnitId=t}getOpenForSheetUnitId(){return this._openForSheetUnitId}setOpenForSheetSubUnitId(t){this._openForSheetSubUnitId=t}getOpenForSheetSubUnitId(){return this._openForSheetSubUnitId}isValueLegality(){return this._valueLegality===!0}setValueLegality(t=!0){this._valueLegality=t}isFocus(){return this._focus}setFocus(t=!1){this._focus=t}isSingle(){return this._param.isSingle===!0||this.onlyInputRange()}isReadOnly(){return this._param.isReadonly===!0}onlyInputContent(){return this._param.onlyInputContent===!0}onlyInputFormula(){return this._param.onlyInputFormula===!0}onlyInputRange(){return this._param.onlyInputRange===!0}getBoundingClientRect(){return this._param.editorDom.getBoundingClientRect()}isVisible(){return this._param.visible}isSheetEditor(){return this._param.isSheetEditor===!0}getValue(){var n;return(((n=this._param.documentDataModel.getBody())==null?void 0:n.dataStream)||"").replace(/\r\n/g,"").replace(/\n/g,"").replace(/\n/g,"")}getBody(){return this._param.documentDataModel.getBody()}update(t){this._param={...this._param,...t}}verticalAlign(){var a,c;const t=(a=this._param)==null?void 0:a.documentDataModel;if(t==null)return;const{width:n,height:r}=this._param.editorDom.getBoundingClientRect();if(r===0||n===0)return;if(!this.isSingle()){t.updateDocumentDataPageSize(n,void 0);return}let i=u.DEFAULT_STYLES.fs;(c=this._param.canvasStyle)!=null&&c.fontSize&&(i=this._param.canvasStyle.fontSize);const o=(r-i*4/3)/2-2;t.updateDocumentDataMargin({t:o<0?0:o}),t.updateDocumentDataPageSize(void 0,void 0)}updateCanvasStyle(){var r;const t=this._param.documentDataModel;if(t==null)return;const n={};(r=this._param.canvasStyle)!=null&&r.fontSize&&(n.textStyle==null&&(n.textStyle={}),n.textStyle.fs=this._param.canvasStyle.fontSize),t.updateDocumentStyle(n)}}exports.EditorService=class extends u.Disposable{constructor(n,r,i,o){super();A(this,"_editors",new Map);A(this,"_focusEditorUnitId");A(this,"_state$",new re.Subject);A(this,"state$",this._state$.asObservable());A(this,"_currentSheetUnitId");A(this,"_currentSheetSubUnitId");A(this,"_inputFormula$",new re.Subject);A(this,"inputFormula$",this._inputFormula$.asObservable());A(this,"_resize$",new re.Subject);A(this,"resize$",this._resize$.asObservable());A(this,"_closeRangePrompt$",new re.Subject);A(this,"closeRangePrompt$",this._closeRangePrompt$.asObservable());A(this,"_blur$",new re.Subject);A(this,"blur$",this._blur$.asObservable());A(this,"_focus$",new re.Subject);A(this,"focus$",this._focus$.asObservable());A(this,"_setValue$",new re.Subject);A(this,"setValue$",this._setValue$.asObservable());A(this,"_valueChange$",new re.Subject);A(this,"valueChange$",this._valueChange$.asObservable());A(this,"_focusStyle$",new re.Subject);A(this,"focusStyle$",this._focusStyle$.asObservable());A(this,"_singleSelection$",new re.Subject);A(this,"singleSelection$",this._singleSelection$.asObservable());A(this,"_spreadsheetFocusState",!1);this._univerInstanceService=n,this._renderManagerService=r,this._lexerTreeBuilder=i,this._contextService=o}setFocusId(n){this._focusEditorUnitId=n}getFocusId(){return this._focusEditorUnitId}getFocusEditor(){if(this._focusEditorUnitId)return this.getEditor(this._focusEditorUnitId)}isEditor(n){return this._editors.has(n)}isSheetEditor(n){const r=this._editors.get(n);return!!(r&&r.isSheetEditor())}closeRangePrompt(){const n=this._univerInstanceService.getCurrentUniverDocInstance();if(!n)return;const r=n.getUnitId();this._contextService.setContextValue(u.EDITOR_ACTIVATED,!1),this._contextService.setContextValue(u.FOCUSING_EDITOR_STANDALONE,!1),!(!this.isEditor(r)||this.isSheetEditor(r))&&(this.changeSpreadsheetFocusState(!1),this.blur())}changeSpreadsheetFocusState(n){this._spreadsheetFocusState=n}getSpreadsheetFocusState(){return this._spreadsheetFocusState}focusStyle(n){const r=this.getEditor(n);if(!r)return!1;r.setFocus(!0),this._contextService.setContextValue(u.EDITOR_ACTIVATED,!0),this._contextService.setContextValue(u.FOCUSING_EDITOR_STANDALONE,!0),this._contextService.setContextValue(u.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,r.isSingle()),this._spreadsheetFocusState||this.singleSelection(r.isSingleChoice()),this._focusStyle$.next(n),this.setFocusId(n)}singleSelection(n){this._singleSelection$.next(n)}selectionChangingState(){const n=this.getFocusId();if(n==null)return!0;const r=this.getEditor(n);return!r||r.isSheetEditor()?!0:r.onlyInputRange()!==!0&&r.onlyInputFormula()!==!0?(this.blur(),!0):r.onlyInputFormula()===!0&&this._contextService.getContextValue(u.FOCUSING_EDITOR_INPUT_FORMULA)!==!0?(this.blur(),!0):!this.getSpreadsheetFocusState()}blur(){this._spreadsheetFocusState||(this._closeRangePrompt$.next(null),this.singleSelection(!1),this.setFocusId(null),this._contextService.setContextValue(u.EDITOR_ACTIVATED,!1),this._contextService.setContextValue(u.FOCUSING_EDITOR_STANDALONE,!1)),this.getAllEditor().forEach(n=>{n.setFocus(!1)}),this._focusStyle$.next(),this._blur$.next(null)}focus(n){if(n==null){const o=this._univerInstanceService.getCurrentUniverDocInstance();if(!o)return;n=o.getUnitId()}const r=this.getEditor(n);if(r==null)return;this._univerInstanceService.setCurrentUnitForType(n);const i=r.getValue().length;this.focusStyle(n),this._focus$.next({startOffset:i-2,endOffset:i-2})}setFormula(n,r){r==null&&(r=this._getCurrentEditorUnitId()),this._inputFormula$.next({formulaString:n,editorUnitId:r})}setValue(n,r){r==null&&(r=this._getCurrentEditorUnitId()),this.setValueNoRefresh(n,r),this._refreshValueChange(r)}setValueNoRefresh(n,r){this._setValue$.next({body:{dataStream:n},editorUnitId:r}),this.resize(r)}getValue(n){const r=this.getEditor(n);if(r!=null)return r.getValue()}setRichValue(n,r){r==null&&(r=this._getCurrentEditorUnitId()),this._setValue$.next({body:n,editorUnitId:r}),this._refreshValueChange(r)}getRichValue(n){const r=this.getEditor(n);if(r!=null)return r.getBody()}dispose(){this._state$.complete(),this._editors.clear(),super.dispose()}getEditor(n){return n==null&&(n=this._getCurrentEditorUnitId()),this._editors.get(n)}getAllEditor(){return this._editors}getFirstEditor(){return[...this.getAllEditor().values()][0]}resize(n){const r=this.getEditor(n);r!=null&&(r.verticalAlign(),this._resize$.next(n))}isVisible(n){var r;return(r=this.getEditor(n))==null?void 0:r.isVisible()}setOperationSheetUnitId(n){this._currentSheetUnitId=n}getOperationSheetUnitId(){return this._currentSheetUnitId}setOperationSheetSubUnitId(n){this._currentSheetSubUnitId=n}getOperationSheetSubUnitId(){return this._currentSheetSubUnitId}register(n,r){var p,d,m,_;const{initialSnapshot:i,editorUnitId:o,canvasStyle:a={}}=n,c=this._univerInstanceService.createUnit(u.UniverInstanceType.UNIVER_DOC,i||this._getBlank(o));let h=this._renderManagerService.getRenderById(o);h==null&&(this._renderManagerService.create(o),h=this._renderManagerService.getRenderById(o)),h.engine.setContainer(r);const v=new ms({...n,render:h,documentDataModel:c,editorDom:r,canvasStyle:a});return this._editors.set(o,v),(_=(m=(d=(p=h.mainComponent)==null?void 0:p.getScene())==null?void 0:d.getViewports())==null?void 0:m[0].getScrollBar())==null||_.dispose(),v.isSheetEditor()||(v.verticalAlign(),v.updateCanvasStyle()),u.toDisposable(()=>{this._unRegister(o)})}_unRegister(n){const r=this._editors.get(n);if(r==null)return;if(this._renderManagerService.removeRender(n),r.documentDataModel.dispose(),this._editors.delete(n),this._univerInstanceService.disposeUnit(n),this._univerInstanceService.getAllUnitsForType(u.UniverInstanceType.UNIVER_SHEET).length>0){const o=this._univerInstanceService.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET);this._univerInstanceService.focusUnit(o.getUnitId())}}refreshValueChange(n){this._refreshValueChange(n)}checkValueLegality(n){const r=this._editors.get(n);if(r==null)return!0;let i=r.getValue();if(r.setValueLegality(),i=i.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\n/g,""),i.length===0)return!0;if(r.onlyInputFormula()){if(i.substring(0,1)!==i1.operatorToken.EQUALS)return r.setValueLegality(!1),!1;const o=this._lexerTreeBuilder.checkIfAddBracket(i);r.setValueLegality(o===0)}else if(r.onlyInputRange()){const o=i.split(",");if(r.isSingleChoice()&&o.length>1)return r.setValueLegality(!1),!1;r.setValueLegality(i1.isReferenceStrings(i))}return r.isValueLegality()}_refreshValueChange(n){const r=this.getEditor(n);r!=null&&this._valueChange$.next(r)}_getCurrentEditorUnitId(){return this._univerInstanceService.getCurrentUniverDocInstance().getUnitId()}_refresh(n){this._state$.next(n)}_getBlank(n){return{id:n,body:{dataStream:`${u.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],paragraphs:[{startIndex:0}]},documentStyle:{renderConfig:{verticalAlign:u.VerticalAlign.TOP,horizontalAlign:u.HorizontalAlign.LEFT},marginLeft:3,marginTop:0,marginRight:3}}}};exports.EditorService=gs([z1(0,u.IUniverInstanceService),z1(1,v1.IRenderManagerService),z1(2,u.Inject(i1.LexerTreeBuilder)),z1(3,u.IContextService)],exports.EditorService);const E1=u.createIdentifier("univer.editor.service");var Cs=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,Ss=(e,t,n,r)=>{for(var i=r>1?void 0:r?bs(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Cs(t,n,i),i},Wt=(e,t)=>(n,r)=>t(n,r,e);const _s="FOCUSING_UNIVER",ys=["univer-app-layout","univer-toolbar-btn","univer-menu-item","univer-button","univer-sheet-bar-btn","univer-render-canvas"],o1=u.createIdentifier("ui.layout-service");exports.DesktopLayoutService=class extends u.Disposable{constructor(n,r,i){super();A(this,"_rootContainerElement",null);A(this,"_isFocused",!1);A(this,"_focusHandlers",new Map);A(this,"_canvasContainers",[]);A(this,"_allContainers",[]);this._contextService=n,this._univerInstanceService=r,this._editorService=i,this._initUniverFocusListener(),this._initEditorStatus()}get isFocused(){return this._isFocused}get rootContainerElement(){return this._rootContainerElement}focus(){const n=this._univerInstanceService.getFocusedUnit();if(!n)return;let r;n instanceof u.Workbook?r=this._focusHandlers.get(u.UniverInstanceType.UNIVER_SHEET):n instanceof u.DocumentDataModel?r=this._focusHandlers.get(u.UniverInstanceType.UNIVER_DOC):n instanceof u.SlideDataModel&&(r=this._focusHandlers.get(u.UniverInstanceType.UNIVER_SLIDE)),r&&r(n.getUnitId())}registerFocusHandler(n,r){if(this._focusHandlers.has(n))throw new Error(`[DesktopLayoutService]: handler of type ${n} bas been registered!`);return this._focusHandlers.set(n,r),u.toDisposable(()=>this._focusHandlers.delete(n))}registerCanvasElement(n){if(this._canvasContainers.indexOf(n)===-1)return this._canvasContainers.push(n),u.toDisposable(()=>u.remove(this._canvasContainers,n));throw new Error("[DesktopLayoutService]: canvas container already registered!")}getCanvasElement(){return this._canvasContainers[0]}registerRootContainerElement(n){if(this._rootContainerElement)throw new Error("[DesktopLayoutService]: root container already registered!");this._rootContainerElement=n;const r=this.registerContainerElement(n);return u.toDisposable(()=>{this._rootContainerElement=null,r.dispose()})}registerContainerElement(n){if(this._allContainers.indexOf(n)===-1)return this._allContainers.push(n),u.toDisposable(()=>u.remove(this._allContainers,n));throw new Error("[LayoutService]: container already registered!")}checkElementInCurrentContainers(n){return this._allContainers.some(r=>r.contains(n))}checkCanvasIsFocused(){return this._canvasContainers.some(n=>n===document.activeElement||n.contains(document.activeElement))}_initUniverFocusListener(){this.disposeWithMe(re.fromEvent(window,"focusin").subscribe(n=>{const r=n.target;if(ys.some(i=>r.classList.contains(i))){this._blurSheetEditor(),queueMicrotask(()=>this.focus());return}r&&this.checkElementInCurrentContainers(r)?this._isFocused=!0:this._isFocused=!1,this._contextService.setContextValue(_s,this._isFocused),this._contextService.setContextValue(u.FOCUSING_UNIVER_EDITOR,ir())}))}_initEditorStatus(){this._contextService.setContextValue(u.FOCUSING_UNIVER_EDITOR,ir())}_blurSheetEditor(){const n=this._editorService.getFocusEditor();n&&n.isSheetEditor()!==!0&&this._editorService.blur()}};exports.DesktopLayoutService=Ss([u.OnLifecycle(u.LifecycleStages.Ready,o1),Wt(0,u.IContextService),Wt(1,u.IUniverInstanceService),Wt(2,E1)],exports.DesktopLayoutService);function ir(){var e;return!!((e=document.activeElement)!=null&&e.classList.contains("univer-editor"))}const dt=u.createIdentifier("ui.platform.service");class Cn{get isMac(){return/Mac/.test(navigator.appVersion)}get isWindows(){return/Windows/.test(navigator.appVersion)}get isLinux(){return/Linux/.test(navigator.appVersion)}}var u1=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.ARROW_LEFT=37]="ARROW_LEFT",e[e.ARROW_UP=38]="ARROW_UP",e[e.ARROW_RIGHT=39]="ARROW_RIGHT",e[e.ARROW_DOWN=40]="ARROW_DOWN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUM_LOCK=144]="NUM_LOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.MINUS=189]="MINUS",e[e.EQUAL=187]="EQUAL",e[e.BACK_SLASH=220]="BACK_SLASH",e))(u1||{});const Ls={8:"Backspace",9:"Tab",13:"Enter",46:"Del",27:"Esc",32:"Space",37:"←",39:"→",38:"↑",40:"↓",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",189:"-",187:"=",220:"\\"};var Pe=(e=>(e[e.SHIFT=1024]="SHIFT",e[e.ALT=2048]="ALT",e[e.CTRL_COMMAND=4096]="CTRL_COMMAND",e[e.MAC_CTRL=8192]="MAC_CTRL",e))(Pe||{}),Es=Object.defineProperty,ws=Object.getOwnPropertyDescriptor,Ms=(e,t,n,r)=>{for(var i=r>1?void 0:r?ws(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Es(t,n,i),i},Z1=(e,t)=>(n,r)=>t(n,r,e);const g1=u.createIdentifier("univer.shortcut");exports.ShortcutService=class extends u.Disposable{constructor(n,r,i,o){super();A(this,"_shortCutMapping",new Map);A(this,"_commandIDMapping",new Map);A(this,"_shortcutChanged$",new re.Subject);A(this,"shortcutChanged$",this._shortcutChanged$.asObservable());A(this,"_forceEscaped",!1);A(this,"_disable",!1);this._commandService=n,this._platformService=r,this._contextService=i,this._layoutService=o,this.disposeWithMe(hs("keydown",a=>{this._resolveKeyboardEvent(a)},{capture:!0}))}setDisable(n){this._disable=n}getAllShortcuts(){return Array.from(this._shortCutMapping.values()).map(n=>Array.from(n.values())).flat()}registerShortcut(n){const r=this._getBindingFromItem(n),i=this._shortCutMapping.get(r);i?i.add(n):this._shortCutMapping.set(r,new Set([n]));const o=n.id,a=this._commandIDMapping.get(o);return a?a.add(n):this._commandIDMapping.set(o,new Set([n])),this._emitShortcutChanged(),u.toDisposable(()=>{var c,h,v,p;(c=this._shortCutMapping.get(r))==null||c.delete(n),((h=this._shortCutMapping.get(r))==null?void 0:h.size)===0&&this._shortCutMapping.delete(r),(v=this._commandIDMapping.get(o))==null||v.delete(n),((p=this._commandIDMapping.get(o))==null?void 0:p.size)===0&&this._commandIDMapping.delete(o),this._emitShortcutChanged()})}getShortcutDisplayOfCommand(n){const r=this._commandIDMapping.get(n);return r?this.getShortcutDisplay(r.values().next().value):null}getShortcutDisplay(n){var v;const r=this._getBindingFromItem(n),i=r&Pe.CTRL_COMMAND,o=r&Pe.SHIFT,a=r&Pe.ALT,c=r&Pe.MAC_CTRL,h=(v=Ls[r&255])!=null?v:"<->";return this._platformService.isMac?`${i?"⌘":""}${o?"⇧":""}${a?"⌥":""}${c?"⌃":""}${h}`:`${i?"Ctrl+":""}${o?"Shift+":""}${a?"Alt+":""}${h}`}_emitShortcutChanged(){this._shortcutChanged$.next()}forceEscape(){return this._forceEscaped=!0,u.toDisposable(()=>this._forceEscaped=!1)}_resolveKeyboardEvent(n){if(this._forceEscaped||this._disable||this._layoutService&&!this._layoutService.checkElementInCurrentContainers(n.target))return;this._dispatch(n)&&n.preventDefault()}_dispatch(n){const r=this._deriveBindingFromEvent(n);if(r===null)return!1;const i=this._shortCutMapping.get(r);if(i===void 0)return!1;const o=Array.from(i).sort((a,c)=>{var h,v;return((h=c.priority)!=null?h:0)-((v=a.priority)!=null?v:0)}).find(a=>{var c,h;return(h=(c=a.preconditions)==null?void 0:c.call(a,this._contextService))!=null?h:!0});return o?(this._commandService.executeCommand(o.id,o.staticParameters),!0):!1}_getBindingFromItem(n){return this._platformService.isMac&&n.mac?n.mac:this._platformService.isWindows&&n.win?n.win:this._platformService.isLinux&&n.linux?n.linux:n.binding}_deriveBindingFromEvent(n){const{shiftKey:r,metaKey:i,altKey:o,keyCode:a}=n;let c=a;return r&&(c|=Pe.SHIFT),o&&(c|=Pe.ALT),(this._platformService.isMac?i:n.ctrlKey)&&(c|=Pe.CTRL_COMMAND),this._platformService.isMac&&n.ctrlKey&&(c|=Pe.MAC_CTRL),c}};exports.ShortcutService=Ms([Z1(0,u.ICommandService),Z1(1,dt),Z1(2,u.IContextService),Z1(3,u.Optional(o1))],exports.ShortcutService);function U6(e,t){return!t||!e||(["group","type","icon","title","tooltip","positions"].forEach(i=>{t[i]!==void 0&&(e[i]=t[i])}),["hidden","disabled","activated"].forEach(i=>{Rs(e,`${i}$`,t[i])})),e}function Rs(e,t,n){if(n!==void 0&&e[t]){const r=e[t].pipe(re.switchMap(()=>new re.BehaviorSubject(n)));e[t]=r}}var xs=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,Os=(e,t,n,r)=>{for(var i=r>1?void 0:r?Is(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&xs(t,n,i),i},Hs=(e,t)=>(n,r)=>t(n,r,e);const a1=u.createIdentifier("univer.menu-service");exports.MenuService=class extends u.Disposable{constructor(n){super();A(this,"_menuItemMap",new Map);A(this,"_menuByPositions",new Map);A(this,"_menuConfigs",new Map);A(this,"_menuChanged$",new re.BehaviorSubject(void 0));A(this,"menuChanged$",this._menuChanged$.asObservable());this._shortcutService=n}dispose(){this._menuItemMap.clear(),this._menuChanged$.complete()}addMenuItem(n,r){if(this._menuItemMap.has(n.id))throw new Error(`Menu item with the same id ${n.id} has already been added!`);const i=r==null?void 0:r[n.id];return this._menuItemMap.set(n.id,U6(n,i)),Array.isArray(n.positions)?n.positions.forEach(o=>this._appendMenuToPosition(n,o)):this._appendMenuToPosition(n,n.positions),this._menuChanged$.next(),u.toDisposable(()=>{if(this._menuItemMap.delete(n.id),Array.isArray(n.positions))n.positions.forEach(o=>{const a=this._menuByPositions.get(o);if(!a)return;const c=a.findIndex(h=>h[0]===n.id);c>-1&&a.splice(c,1)});else{const o=this._menuByPositions.get(n.positions);if(!o)return;const a=o.findIndex(c=>c[0]===n.id);a>-1&&o.splice(a,1)}this._menuChanged$.next()})}getMenuItems(n){if(this._menuByPositions.has(n)){const r=this._menuByPositions.get(n);if(r)return[...r.values()].map(i=>this._getDisplayMenuItems(i[1]))}return[]}setMenuItem(n){this._menuItemMap.set(n.id,n),this._menuChanged$.next()}getMenuItem(n){return this._menuItemMap.has(n)?this._menuItemMap.get(n):null}setMenuConfigs(n,r){this._menuConfigs.set(n,r)}getMenuConfig(n){return this._menuConfigs.has(n)?this._menuConfigs.get(n):null}_getDisplayMenuItems(n){const r=this._shortcutService.getShortcutDisplayOfCommand(n.id);return r?{...n,shortcut:r}:n}_appendMenuToPosition(n,r){this._menuByPositions.has(r)||this._menuByPositions.set(r,[]);const i=this._menuByPositions.get(r);if(i.findIndex(o=>o[0]===n.id)>-1)throw new Error(`Menu item with the same id ${n.id} has already been added!`);i.push([n.id,n])}};exports.MenuService=Os([Hs(0,g1)],exports.MenuService);const F6={id:"sheet.operation.set-editor-resize",type:u.CommandType.OPERATION,handler:(e,t)=>!0};var Ye=(e=>(e.VOID="void",e.TOOLBAR_START="uiToolbar.start",e.TOOLBAR_INSERT="uiToolbar.insert",e.TOOLBAR_FORMULAS="uiToolbar.formulas",e.TOOLBAR_DATA="uiToolbar.data",e.TOOLBAR_VIEW="uiToolbar.view",e.TOOLBAR_OTHERS="uiToolbar.others",e.CONTEXT_MENU="contextMenu",e))(Ye||{}),c1=(e=>(e[e.TOOLBAR_HISTORY=0]="TOOLBAR_HISTORY",e[e.TOOLBAR_FORMAT=1]="TOOLBAR_FORMAT",e[e.TOOLBAR_LAYOUT=2]="TOOLBAR_LAYOUT",e[e.TOOLBAR_FORMULAS_INSERT=3]="TOOLBAR_FORMULAS_INSERT",e[e.TOOLBAR_FORMULAS_VIEW=4]="TOOLBAR_FORMULAS_VIEW",e[e.TOOLBAR_FILE=5]="TOOLBAR_FILE",e[e.TOOLBAR_OTHERS=6]="TOOLBAR_OTHERS",e[e.CONTEXT_MENU_FORMAT=7]="CONTEXT_MENU_FORMAT",e[e.CONTEXT_MENU_LAYOUT=8]="CONTEXT_MENU_LAYOUT",e[e.CONTEXT_MENU_DATA=9]="CONTEXT_MENU_DATA",e[e.CONTEXT_MENU_OTHERS=10]="CONTEXT_MENU_OTHERS",e))(c1||{}),ke=(e=>(e[e.BUTTON=0]="BUTTON",e[e.SELECTOR=1]="SELECTOR",e[e.BUTTON_SELECTOR=2]="BUTTON_SELECTOR",e[e.SUBITEMS=3]="SUBITEMS",e))(ke||{});function Ts(e){const t=e.get(u.IUndoRedoService);return{id:u.UndoCommand.id,group:c1.TOOLBAR_HISTORY,type:ke.BUTTON,icon:"UndoSingle",title:"Undo",tooltip:"toolbar.undo",positions:[Ye.TOOLBAR_START],disabled$:t.undoRedoStatus$.pipe(Ar.map(n=>n.undos<=0))}}function Ds(e){const t=e.get(u.IUndoRedoService);return{id:u.RedoCommand.id,group:c1.TOOLBAR_HISTORY,type:ke.BUTTON,icon:"RedoSingle",title:"Redo",tooltip:"toolbar.redo",positions:[Ye.TOOLBAR_START],disabled$:t.undoRedoStatus$.pipe(Ar.map(n=>n.redos<=0))}}var Ns=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,As=(e,t,n,r)=>{for(var i=r>1?void 0:r?Vs(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Ns(t,n,i),i},W1=(e,t)=>(n,r)=>t(n,r,e);function ht(e){return e.getContextValue(u.FOCUSING_UNIVER_EDITOR)}const z6={id:vn.id,description:"shortcut.copy",group:"1_common-edit",binding:u1.C|Pe.CTRL_COMMAND,preconditions:ht},Z6={id:gn.id,description:"shortcut.cut",group:"1_common-edit",binding:u1.X|Pe.CTRL_COMMAND,preconditions:ht},js={id:mn.id,description:"shortcut.paste",group:"1_common-edit",binding:u1.V|Pe.CTRL_COMMAND,preconditions:()=>!1},W6={id:u.UndoCommand.id,description:"shortcut.undo",group:"1_common-edit",binding:u1.Z|Pe.CTRL_COMMAND,preconditions:ht},G6={id:u.RedoCommand.id,description:"shortcut.redo",group:"1_common-edit",binding:u1.Y|Pe.CTRL_COMMAND,preconditions:ht};exports.SharedController=class extends u.Disposable{constructor(t,n,r,i,o){super(),this._config=t,this._injector=n,this._menuService=r,this._shortcutService=i,this._commandService=o,this.initialize()}initialize(){this._registerCommands(),this._registerShortcuts(),this._registerMenus()}_registerMenus(){var n,r;const t=(r=(n=this._config)==null?void 0:n.menu)!=null?r:{};[Ts,Ds].forEach(i=>{this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(i),t))})}_registerCommands(){[gn,vn,mn,F6].forEach(t=>this.disposeWithMe(this._commandService.registerMultipleCommand(t)))}_registerShortcuts(){const t=[W6,G6];t.push(Z6,z6,js),t.forEach(n=>this.disposeWithMe(this._shortcutService.registerShortcut(n)))}};exports.SharedController=As([u.OnLifecycle(u.LifecycleStages.Ready,exports.SharedController),W1(1,u.Inject(u.Injector)),W1(2,a1),W1(3,g1),W1(4,u.ICommandService)],exports.SharedController);const pt=u.createIdentifier("univer.ui.ui-controller");u.runOnLifecycle(u.LifecycleStages.Ready,pt);const Y6="UNIVER_UI_CONFIG_KEY";var N1={},q6={exports:{}},X6={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(X6);var V1=X6.exports;(function(e){var t=V1.default;function n(i){if(typeof WeakMap!="function")return null;var o=new WeakMap,a=new WeakMap;return(n=function(h){return h?a:o})(i)}function r(i,o){if(!o&&i&&i.__esModule)return i;if(i===null||t(i)!="object"&&typeof i!="function")return{default:i};var a=n(o);if(a&&a.has(i))return a.get(i);var c={__proto__:null},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in i)if(v!=="default"&&{}.hasOwnProperty.call(i,v)){var p=h?Object.getOwnPropertyDescriptor(i,v):null;p&&(p.get||p.set)?Object.defineProperty(c,v,p):c[v]=i[v]}return c.default=i,a&&a.set(i,c),c}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(q6);var Ps=q6.exports,Q6={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Q6);var $s=Q6.exports,J6={exports:{}};(function(e){var t=V1.default;function n(){e.exports=n=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,c=Object.defineProperty||function(T,M,I){T[M]=I.value},h=typeof Symbol=="function"?Symbol:{},v=h.iterator||"@@iterator",p=h.asyncIterator||"@@asyncIterator",d=h.toStringTag||"@@toStringTag";function m(T,M,I){return Object.defineProperty(T,M,{value:I,enumerable:!0,configurable:!0,writable:!0}),T[M]}try{m({},"")}catch{m=function(I,B,G){return I[B]=G}}function _(T,M,I,B){var G=M&&M.prototype instanceof J?M:J,W=Object.create(G.prototype),q=new oe(B||[]);return c(W,"_invoke",{value:ie(T,I,q)}),W}function L(T,M,I){try{return{type:"normal",arg:T.call(M,I)}}catch(B){return{type:"throw",arg:B}}}i.wrap=_;var x="suspendedStart",w="suspendedYield",j="executing",Z="completed",U={};function J(){}function E(){}function D(){}var k={};m(k,v,function(){return this});var $=Object.getPrototypeOf,F=$&&$($(he([])));F&&F!==o&&a.call(F,v)&&(k=F);var z=D.prototype=J.prototype=Object.create(k);function Y(T){["next","throw","return"].forEach(function(M){m(T,M,function(I){return this._invoke(M,I)})})}function ne(T,M){function I(G,W,q,se){var _e=L(T[G],T,W);if(_e.type!=="throw"){var Me=_e.arg,Ee=Me.value;return Ee&&t(Ee)=="object"&&a.call(Ee,"__await")?M.resolve(Ee.__await).then(function(fe){I("next",fe,q,se)},function(fe){I("throw",fe,q,se)}):M.resolve(Ee).then(function(fe){Me.value=fe,q(Me)},function(fe){return I("throw",fe,q,se)})}se(_e.arg)}var B;c(this,"_invoke",{value:function(W,q){function se(){return new M(function(_e,Me){I(W,q,_e,Me)})}return B=B?B.then(se,se):se()}})}function ie(T,M,I){var B=x;return function(G,W){if(B===j)throw Error("Generator is already running");if(B===Z){if(G==="throw")throw W;return{value:r,done:!0}}for(I.method=G,I.arg=W;;){var q=I.delegate;if(q){var se=ce(q,I);if(se){if(se===U)continue;return se}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(B===x)throw B=Z,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);B=j;var _e=L(T,M,I);if(_e.type==="normal"){if(B=I.done?Z:w,_e.arg===U)continue;return{value:_e.arg,done:I.done}}_e.type==="throw"&&(B=Z,I.method="throw",I.arg=_e.arg)}}}function ce(T,M){var I=M.method,B=T.iterator[I];if(B===r)return M.delegate=null,I==="throw"&&T.iterator.return&&(M.method="return",M.arg=r,ce(T,M),M.method==="throw")||I!=="return"&&(M.method="throw",M.arg=new TypeError("The iterator does not provide a '"+I+"' method")),U;var G=L(B,T.iterator,M.arg);if(G.type==="throw")return M.method="throw",M.arg=G.arg,M.delegate=null,U;var W=G.arg;return W?W.done?(M[T.resultName]=W.value,M.next=T.nextLoc,M.method!=="return"&&(M.method="next",M.arg=r),M.delegate=null,U):W:(M.method="throw",M.arg=new TypeError("iterator result is not an object"),M.delegate=null,U)}function ae(T){var M={tryLoc:T[0]};1 in T&&(M.catchLoc=T[1]),2 in T&&(M.finallyLoc=T[2],M.afterLoc=T[3]),this.tryEntries.push(M)}function Q(T){var M=T.completion||{};M.type="normal",delete M.arg,T.completion=M}function oe(T){this.tryEntries=[{tryLoc:"root"}],T.forEach(ae,this),this.reset(!0)}function he(T){if(T||T===""){var M=T[v];if(M)return M.call(T);if(typeof T.next=="function")return T;if(!isNaN(T.length)){var I=-1,B=function G(){for(;++I<T.length;)if(a.call(T,I))return G.value=T[I],G.done=!1,G;return G.value=r,G.done=!0,G};return B.next=B}}throw new TypeError(t(T)+" is not iterable")}return E.prototype=D,c(z,"constructor",{value:D,configurable:!0}),c(D,"constructor",{value:E,configurable:!0}),E.displayName=m(D,d,"GeneratorFunction"),i.isGeneratorFunction=function(T){var M=typeof T=="function"&&T.constructor;return!!M&&(M===E||(M.displayName||M.name)==="GeneratorFunction")},i.mark=function(T){return Object.setPrototypeOf?Object.setPrototypeOf(T,D):(T.__proto__=D,m(T,d,"GeneratorFunction")),T.prototype=Object.create(z),T},i.awrap=function(T){return{__await:T}},Y(ne.prototype),m(ne.prototype,p,function(){return this}),i.AsyncIterator=ne,i.async=function(T,M,I,B,G){G===void 0&&(G=Promise);var W=new ne(_(T,M,I,B),G);return i.isGeneratorFunction(M)?W:W.next().then(function(q){return q.done?q.value:W.next()})},Y(z),m(z,d,"Generator"),m(z,v,function(){return this}),m(z,"toString",function(){return"[object Generator]"}),i.keys=function(T){var M=Object(T),I=[];for(var B in M)I.push(B);return I.reverse(),function G(){for(;I.length;){var W=I.pop();if(W in M)return G.value=W,G.done=!1,G}return G.done=!0,G}},i.values=he,oe.prototype={constructor:oe,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Q),!M)for(var I in this)I.charAt(0)==="t"&&a.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=r)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var I=this;function B(Me,Ee){return q.type="throw",q.arg=M,I.next=Me,Ee&&(I.method="next",I.arg=r),!!Ee}for(var G=this.tryEntries.length-1;G>=0;--G){var W=this.tryEntries[G],q=W.completion;if(W.tryLoc==="root")return B("end");if(W.tryLoc<=this.prev){var se=a.call(W,"catchLoc"),_e=a.call(W,"finallyLoc");if(se&&_e){if(this.prev<W.catchLoc)return B(W.catchLoc,!0);if(this.prev<W.finallyLoc)return B(W.finallyLoc)}else if(se){if(this.prev<W.catchLoc)return B(W.catchLoc,!0)}else{if(!_e)throw Error("try statement without catch or finally");if(this.prev<W.finallyLoc)return B(W.finallyLoc)}}}},abrupt:function(M,I){for(var B=this.tryEntries.length-1;B>=0;--B){var G=this.tryEntries[B];if(G.tryLoc<=this.prev&&a.call(G,"finallyLoc")&&this.prev<G.finallyLoc){var W=G;break}}W&&(M==="break"||M==="continue")&&W.tryLoc<=I&&I<=W.finallyLoc&&(W=null);var q=W?W.completion:{};return q.type=M,q.arg=I,W?(this.method="next",this.next=W.finallyLoc,U):this.complete(q)},complete:function(M,I){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&I&&(this.next=I),U},finish:function(M){for(var I=this.tryEntries.length-1;I>=0;--I){var B=this.tryEntries[I];if(B.finallyLoc===M)return this.complete(B.completion,B.afterLoc),Q(B),U}},catch:function(M){for(var I=this.tryEntries.length-1;I>=0;--I){var B=this.tryEntries[I];if(B.tryLoc===M){var G=B.completion;if(G.type==="throw"){var W=G.arg;Q(B)}return W}}throw Error("illegal catch attempt")},delegateYield:function(M,I,B){return this.delegate={iterator:he(M),resultName:I,nextLoc:B},this.method==="next"&&(this.arg=r),U}},i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(J6);var ks=J6.exports,K6={exports:{}};(function(e){function t(r,i,o,a,c,h,v){try{var p=r[h](v),d=p.value}catch(m){return void o(m)}p.done?i(d):Promise.resolve(d).then(a,c)}function n(r){return function(){var i=this,o=arguments;return new Promise(function(a,c){var h=r.apply(i,o);function v(d){t(h,a,c,v,p,"next",d)}function p(d){t(h,a,c,v,p,"throw",d)}v(void 0)})}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(K6);var Bs=K6.exports,ei={exports:{}},ti={exports:{}},ni={exports:{}},ri={exports:{}};(function(e){var t=V1.default;function n(r,i){if(t(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,i||"default");if(t(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ri);var Us=ri.exports;(function(e){var t=V1.default,n=Us;function r(i){var o=n(i,"string");return t(o)=="symbol"?o:o+""}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ni);var Fs=ni.exports;(function(e){var t=Fs;function n(r,i,o){return(i=t(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ti);var zs=ti.exports;(function(e){var t=zs;function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);o&&(c=c.filter(function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable})),a.push.apply(a,c)}return a}function r(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?n(Object(a),!0).forEach(function(c){t(i,c,a[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(a,c))})}return i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ei);var Zs=ei.exports,Ws=Ps.default,vt=$s.default;Object.defineProperty(N1,"__esModule",{value:!0});N1._r=n2;N1._u=a2;var K1=N1.render=r2,ii=N1.unmount=s2,ot=vt(ks),oi=vt(Bs),Gs=vt(V1),Ys=vt(Zs),qs=Ws(H1),A1=(0,Ys.default)({},qs),Xs=A1.version,Qs=A1.render,Js=A1.unmountComponentAtNode,gt;try{var Ks=Number((Xs||"").split(".")[0]);Ks>=18&&(gt=A1.createRoot)}catch{}function or(e){var t=A1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&(0,Gs.default)(t)==="object"&&(t.usingClientEntryPoint=e)}var at="__rc_react_root__";function e2(e,t){or(!0);var n=t[at]||gt(t);or(!1),n.render(e),t[at]=n}function t2(e,t){Qs(e,t)}function n2(e,t){}function r2(e,t){if(gt){e2(e,t);return}t2(e,t)}function i2(e){return Kt.apply(this,arguments)}function Kt(){return Kt=(0,oi.default)((0,ot.default)().mark(function e(t){return(0,ot.default)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[at])===null||i===void 0||i.unmount(),delete t[at]}));case 1:case"end":return r.stop()}},e)})),Kt.apply(this,arguments)}function o2(e){Js(e)}function a2(e){}function s2(e){return en.apply(this,arguments)}function en(){return en=(0,oi.default)((0,ot.default)().mark(function e(t){return(0,ot.default)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(gt===void 0){r.next=2;break}return r.abrupt("return",i2(t));case 2:o2(t);case 3:case"end":return r.stop()}},e)})),en.apply(this,arguments)}var we=(e=>(e.GLOBAL="global",e.HEADER="header",e.HEADER_MENU="header-menu",e.CONTENT="content",e.FOOTER="footer",e.LEFT_SIDEBAR="left-sidebar",e.FLOATING="floating",e))(we||{});const n1=u.createIdentifier("ui.parts.service");class bn extends u.Disposable{constructor(){super(...arguments);A(this,"_componentsByPart",new Map);A(this,"_componentRegistered$",new re.Subject);A(this,"componentRegistered$",this._componentRegistered$.asObservable())}dispose(){super.dispose(),this._componentRegistered$.complete()}registerComponent(n,r){const i=r(),o=(this._componentsByPart.get(n)||this._componentsByPart.set(n,new Set).get(n)).add(i);return this._componentRegistered$.next(n),u.toDisposable(()=>{o.delete(i),o.size===0&&this._componentsByPart.delete(n),this._componentRegistered$.next(n)})}getComponents(n){return new Set([...this._componentsByPart.get(n)||new Set])}}const mt=u.createIdentifier("ui.popup.service");class Sn extends u.Disposable{constructor(){super(...arguments);A(this,"_popupMap",new Map);A(this,"_popups$",new re.BehaviorSubject([]));A(this,"popups$",this._popups$.asObservable())}get popups(){return Array.from(this._popupMap.entries())}_update(){this._popups$.next(Array.from(this._popupMap.entries()))}dispose(){super.dispose(),this._popups$.next([]),this._popups$.complete(),this._popupMap.clear()}addPopup(n){const r=u.Tools.generateRandomId();return this._popupMap.set(r,n),this._update(),r}removePopup(n){this._popupMap.delete(n)&&this._update()}removeAll(){this._popupMap.clear(),this._update()}}const l2=({popup:e,children:t})=>{const n=Oe(e.anchorRect$,e.anchorRect),r=Oe(e.excludeRects$,e.excludeRects),{bottom:i,left:o,right:a,top:c}=n,{offset:h}=e,v=s.useMemo(()=>{const[p=0,d=0]=h!=null?h:[];return{left:o-p,right:a+p,top:c-d,bottom:i+d}},[i,o,a,c,h]);return g.jsx(ue.RectPopup,{anchorRect:v,direction:e.direction,onClickOutside:e.onClickOutside,excludeOutside:e.excludeOutside,excludeRects:r,closeOnSelfTarget:e.closeOnSelfTarget,children:t})};function _n(){const e=u.useDependency(mt),t=u.useDependency(qe);return Oe(e.popups$,void 0,!0).map(r=>{const[i,o]=r,a=t.get(o.componentKey);return g.jsx(l2,{popup:o,children:a?g.jsx(a,{popup:o}):null},i)})}class Ct{constructor(){A(this,"_domLayerMap",new Map);A(this,"_domLayers$",new re.BehaviorSubject([]));A(this,"domLayers$",this._domLayers$.asObservable())}get domLayers(){return Array.from(this._domLayerMap.entries())}_notice(){this._domLayers$.next(Array.from(this._domLayerMap.entries()))}addFloatDom(t){this._domLayerMap.set(t.id,t),this._notice()}removeFloatDom(t){this._domLayerMap.delete(t)&&this._notice()}removeAll(){this._domLayerMap.clear(),this._notice()}}const c2="univer-float-dom-wrapper",u2="univer-float-dom",ar={floatDomWrapper:c2,floatDom:u2},f2=s.memo(e=>{const{layer:t,id:n}=e,r=u.useDependency(qe),i=Oe(t.position$),o=typeof t.componentKey=="string"?r.get(t.componentKey):t.componentKey;return i?g.jsx("div",{className:ar.floatDomWrapper,style:{position:"absolute",top:i.startY,left:i.startX,width:Math.max(i.endX-i.startX-2,0),height:Math.max(i.endY-i.startY-2,0),transform:`rotate(${i.rotate}deg)`,overflow:"hidden"},onPointerMove:a=>{t.onPointerMove(a.nativeEvent)},onPointerDown:a=>{t.onPointerDown(a.nativeEvent)},onPointerUp:a=>{t.onPointerUp(a.nativeEvent)},onWheel:a=>{t.onWheel(a.nativeEvent)},children:g.jsx("div",{id:n,className:ar.floatDom,style:{width:i.width,height:i.height,position:"absolute",...i.absolute.left?{left:0}:{right:0},...i.absolute.top?{top:0}:{bottom:0}},children:o?g.jsx(o,{...t.props}):null})}):null}),yn=()=>{const e=u.useDependency(Ct),t=Oe(e.domLayers$);return g.jsx(g.Fragment,{children:t==null?void 0:t.map(n=>g.jsx(f2,{id:n[0],layer:n[1]},n[0]))})},w1=u.createIdentifier("ui.message.service");function Be(e){const{components:t,fallback:n,sharedProps:r}=e;return!t||t.size===0?n!=null?n:null:Array.from(t.values()).map((i,o)=>{var a;return s.createElement(i,{key:`${(a=i.displayName)!=null?a:o}`,...r})})}function Fe(e,t){var o;const n=(o=t==null?void 0:t.get(n1))!=null?o:u.useDependency(n1),r=s.useRef(0),i=Oe(()=>n.componentRegistered$.pipe(re.filter(a=>a===e),re.map(()=>r.current+=1),re.startWith(r.current+=1)),void 0,void 0,[n,e]);return s.useMemo(()=>n.getComponents(e),[i])}const d2="univer-menu-item-no-hover",h2="univer-menu-item-active",p2="univer-menu-item-activated",v2="univer-menu-item-content",g2="univer-menu-item-selectable",m2="univer-menu-item-selectable-icon",C2="univer-menu-item-more-icon",Qe={menuItemNoHover:d2,menuItemActive:h2,menuItemActivated:p2,menuItemContent:v2,menuItemSelectable:g2,menuItemSelectableIcon:m2,menuItemMoreIcon:C2};function ai(e){const{menuType:t,onOptionSelect:n}=e,r=u.useDependency(a1);if(!t)return null;if(Array.isArray(t)){const a=t.map(c=>r.getMenuItems(c)).map(c=>c.reduce((h,v)=>{var p,d;return v.group?(h[v.group]=(p=h[v.group])!=null?p:[],h[v.group].push(v)):(h[c1.CONTEXT_MENU_OTHERS]=(d=h[c1.CONTEXT_MENU_OTHERS])!=null?d:[],h[c1.CONTEXT_MENU_OTHERS].push(v)),h},{}));return g.jsx(g.Fragment,{children:a.map(c=>Object.keys(c).map(h=>g.jsx(ue.MenuItemGroup,{eventKey:h,children:c[h].map(v=>g.jsx(sr,{menuItem:v,onClick:p=>{n==null||n({value:"",label:v.id,...p})}},v.id))},h)))})}return r.getMenuItems(t).map(o=>g.jsx(sr,{menuItem:o,onClick:a=>{n==null||n({value:"",label:o.id,...a})}},o.id))}function si(e){var o;const{options:t,value:n,onOptionSelect:r,parentKey:i}=e;return(o=t==null?void 0:t.map((a,c)=>{var m,_,L;const h=`${i}-${(m=a.label)!=null?m:a.id}-${c}`,v=x=>{r==null||r({value:x,label:a==null?void 0:a.label})},p=()=>{typeof a.value>"u"||r==null||r({...a})},d=Ue({[Qe.menuItemNoHover]:typeof a.label!="string"&&!((_=a.label)!=null&&_.hoverable)});return g.jsx(ue.MenuItem,{disabled:a.disabled,eventKey:h,className:d,onClick:p,children:g.jsxs("span",{className:Ue(Qe.menuItemContent,{[Qe.menuItemSelectable]:!(typeof a.label!="string"&&!((L=a.label)!=null&&L.hoverable))}),children:[typeof n<"u"&&String(n)===String(a.value)&&g.jsx("span",{className:Qe.menuItemSelectableIcon,children:g.jsx(e3,{style:{color:"rgb(var(--success-color))"}})}),g.jsx(ze,{value$:a.value$,value:a.value,label:a.label,icon:a.icon,onChange:v})]})},h)}))!=null?o:g.jsx(g.Fragment,{})}const st=e=>{const{overViewport:t,...n}=e,[r,i]=s.useState(),o=u.useDependency(o1);return B6(t==="scroll"?r:null,o.rootContainerElement),g.jsxs(ue.Menu,{ref:a=>(a==null?void 0:a.list)&&i(a.list),selectable:!1,children:[g.jsx(si,{...n}),g.jsx(ai,{...n})]})};function sr({menuItem:e,onClick:t}){const n=u.useDependency(a1),r=Oe(e.disabled$,!1),i=Oe(e.activated$,!1),o=Oe(e.hidden$,!1),a=Oe(e.value$),c=e,h=Oe(re.isObservable(c.selections)?c.selections:void 0),[v,p]=s.useState(a);if(o)return null;const d=w=>{const j=u.isRealNum(w)&&typeof w=="string"?Number.parseInt(w):w;p(j)},m=()=>{const w=e,{title:j,label:Z}=w;return g.jsx(ue.MenuItem,{eventKey:w.id,disabled:r,className:Ue({[Qe.menuItemActivated]:i}),onClick:()=>{t({value:v,id:w.id})},children:g.jsx("span",{className:Qe.menuItemContent,children:g.jsx(ze,{value:a,title:j,label:Z,icon:w.icon,onChange:d})})},w.id)},_=()=>{var j;const w=(j=h!=null?h:c.selections)!=null?j:[];return w.length>0?g.jsx(ue.SubMenu,{eventKey:c.id,popupOffset:[18,0],title:g.jsxs("span",{className:Qe.menuItemContent,children:[g.jsx(ze,{title:c.title,value:v,onChange:d,icon:c.icon,label:c.label}),c.shortcut&&` (${c.shortcut})`]}),expandIcon:g.jsx(Qt,{className:Qe.menuItemMoreIcon}),children:w.length>0&&g.jsx(si,{parentKey:c.id,menuType:c.id,options:w,onOptionSelect:Z=>{t({value:Z.value,id:c.id})}})},c.id):g.jsx(ue.MenuItem,{eventKey:c.id,children:g.jsxs("span",{className:Qe.menuItemContent,children:[g.jsx(ze,{title:c.title,value:v,icon:c.icon,label:c.label,onChange:d}),c.shortcut&&` (${c.shortcut})`]})},c.id)},L=e.id?n.getMenuItems(e.id):[],x=()=>{const w=e;return g.jsx(ue.SubMenu,{eventKey:w.id,popupOffset:[18,0],title:g.jsx("span",{className:Qe.menuItemContent,children:g.jsx(ze,{title:w.title,icon:w.icon,label:w.label,onChange:d})}),expandIcon:g.jsx(Qt,{className:Qe.menuItemMoreIcon}),children:L.length&&g.jsx(ai,{menuType:w.id,parentKey:w.id,onOptionSelect:t})},w.id)};return g.jsxs(g.Fragment,{children:[e.type===ke.SELECTOR&&_(),e.type===ke.SUBITEMS&&x(),e.type===ke.BUTTON&&m()]})}const j1=u.createIdentifier("ui.contextmenu.service");class Ln extends u.Disposable{constructor(){super(...arguments);A(this,"_currentHandler",null);A(this,"disabled",!1)}disable(){this.disabled=!0}enable(){this.disabled=!1}triggerContextMenu(n,r){var i;n.stopPropagation(),!this.disabled&&((i=this._currentHandler)==null||i.handleContextMenu(n,r))}registerContextMenuHandler(n){if(this._currentHandler)throw new Error("There is already a context menu handler!");return this._currentHandler=n,u.toDisposable(()=>this._currentHandler=null)}}function li(){const e=s.useRef(null),[t,n]=s.useState(!1),[r,i]=s.useState(""),[o,a]=s.useState([0,0]),c=u.useDependency(j1),h=u.useDependency(u.ICommandService),v=u.useInjector();s.useEffect(()=>{const m=c.registerContextMenuHandler({handleContextMenu:p});function _(L){e.current&&!e.current.contains(L.target)&&d()}return document.addEventListener("pointerdown",_),document.addEventListener("wheel",d),()=>{document.removeEventListener("pointerdown",_),document.removeEventListener("wheel",d),m.dispose()}},[c]);function p(m,_){i(_),a([m.clientX,m.clientY]),n(!0)}function d(){n(!1)}return g.jsx(ue.Popup,{visible:t,offset:o,children:g.jsx("section",{ref:e,children:r&&g.jsx(st,{menuType:[r],onOptionSelect:m=>{const{label:_,value:L}=m;h&&h.executeCommand(_,{value:L}),v.get(v1.ITextSelectionRenderManager).focus(),n(!1)}})})})}const b2="univer-toolbar-btn",S2="univer-toolbar-btn-active",lr={toolbarBtn:b2,toolbarBtnActive:S2};function ci(e){const{children:t,className:n,style:r,disabled:i=!1,active:o=!1,onClick:a,onDoubleClick:c,...h}=e,v=m=>{if(i){m.preventDefault();return}a&&a(m)},p=m=>{if(i){m.preventDefault();return}c&&c(m)},d=Ue(lr.toolbarBtn,{[`${lr.toolbarBtn}-active`]:o},n);return g.jsx("button",{className:d,style:r,disabled:i,onClick:v,onDoubleClick:p,...h,children:t})}const _2="univer-headerbar",y2="univer-header-menu",L2="univer-menubar",E2="univer-menubar-item",w2="univer-menubar-item-active",M2="univer-toolbar",R2="univer-toolbar-container",x2="univer-toolbar-more",I2="univer-toolbar-more-container",O2="univer-toolbar-group",H2="univer-toolbar-item-select-button",T2="univer-toolbar-item-select-button-disabled",D2="univer-toolbar-item-select-button-activated",N2="univer-toolbar-item-select-button-label",V2="univer-toolbar-item-select-button-arrow",A2="univer-toolbar-item-select",j2="univer-toolbar-item-select-disabled",P2="univer-toolbar-item-select-activated",$2="univer-toolbar-item-select-arrow",k2="univer-toolbar-item-select-arrow-disabled",B2="univer-toolbar-item-select-arrow-activated",Le={headerbar:_2,headerMenu:y2,menubar:L2,menubarItem:E2,menubarItemActive:w2,toolbar:M2,toolbarContainer:R2,toolbarMore:x2,toolbarMoreContainer:I2,toolbarGroup:O2,toolbarItemSelectButton:H2,toolbarItemSelectButtonDisabled:T2,toolbarItemSelectButtonActivated:D2,toolbarItemSelectButtonLabel:N2,toolbarItemSelectButtonArrow:V2,toolbarItemSelect:A2,toolbarItemSelectDisabled:j2,toolbarItemSelectActivated:P2,toolbarItemSelectArrow:$2,toolbarItemSelectArrowDisabled:k2,toolbarItemSelectArrowActivated:B2};function ui(e){const t=u.useDependency(a1),[n,r]=s.useState(Ye.TOOLBAR_START),[i,o]=s.useState([]),[a,c]=s.useState([]);s.useEffect(()=>{var m,_;const v=(_=(m=i.find(L=>L.name===n))==null?void 0:m.menuItems)!=null?_:[],d=re.combineLatest(v.map(L=>{var x;return(x=L.hidden$)!=null?x:new re.Observable(w=>w.next(!1))})).pipe(re.map(L=>v.filter((x,w)=>!L[w]))).subscribe(L=>c(L));return()=>d.unsubscribe()},[i,n]),s.useEffect(()=>{const v=t.menuChanged$.subscribe(()=>{const p=[];for(const d of e){const m=t.getMenuItems(d);m.length&&p.push({name:d,menuItems:m})}o(p)});return()=>v.unsubscribe()},[t,n,e]);const h=s.useMemo(()=>{var v,p;return(p=(v=i.find(d=>d.name===n))==null?void 0:v.menuItems.reduce((d,m)=>{var L;const _=(L=m.group)!=null?L:c1.TOOLBAR_OTHERS;return d[_]||(d[_]=[]),d[_].push(m),d},{}))!=null?p:{}},[i,n]);return{setCategory:r,category:n,visibleItems:a,groups:i,groupsByKey:h}}function fi(e){const{disabled$:t,hidden$:n,activated$:r,value$:i}=e,[o,a]=s.useState(),[c,h]=s.useState(!1),[v,p]=s.useState(!1),[d,m]=s.useState(!1);return s.useEffect(()=>{const _=[];return t&&_.push(t.subscribe(L=>h(L))),n&&_.push(n.subscribe(L=>m(L))),r&&_.push(r.subscribe(L=>p(L))),i&&_.push(i.subscribe(L=>a(L))),()=>_.forEach(L=>L.unsubscribe())},[r,t,n,i]),{disabled:c,value:o,activated:v,hidden:d}}function di(e){const t=s.useRef({}),n=s.useRef(null),[r,i]=s.useState([]);return s.useEffect(()=>{function o(){var _,L;const h=(L=(_=n.current)==null?void 0:_.clientWidth)!=null?L:0;let v=0;if(n.current){const x=Number.parseInt(getComputedStyle(n.current.firstElementChild).gap,10);v=Number.isNaN(x)?0:x}const p=Object.entries(t.current).filter(([x,w])=>w.el&&w.key&&e.find(j=>j.id===w.key)).map(([x,w])=>{var j;return{key:w.key,width:((j=w.el)==null?void 0:j.clientWidth)+v}}),d=[];let m=182;for(const x of p)m+=x.width,m>h&&d.push(x.key);i(d)}o();const a=new ResizeObserver(()=>o()),c=n.current;return c&&a.observe(c),()=>{c&&a.unobserve(c)}},[e]),{toolbarRef:n,toolbarItemRefs:t,collapsedId:r}}const Gt=s.forwardRef((e,t)=>{const n=u.useDependency(u.LocaleService),r=u.useDependency(u.ICommandService),i=u.useDependency(o1),o=u.useDependency(qe),[a,c]=s.useState(!1),[h,v]=s.useState(!1),{value:p,hidden:d,disabled:m,activated:_}=fi(e),L=(Q,oe)=>{i.focus(),r.executeCommand(Q,oe)};function x(Q){c(Q)}function w(Q){v(Q),Q||c(!1)}const{tooltip:j,shortcut:Z,icon:U,title:J,label:E,id:D}=e,k=n.t(j!=null?j:"")+(Z?` (${Z})`:""),{selections:$}=e,F=s.useMemo(()=>re.isObservable($)?$:new re.Observable(Q=>{Q.next($)}),[$]),z=Oe(F),Y=s.useMemo(()=>re.isObservable(U)?U:new re.Observable(Q=>{var he,T;const oe=(T=(he=z==null?void 0:z.find(M=>M.value===p))==null?void 0:he.icon)!=null?T:U;Q.next(oe)}),[U,z,p]),ne=Oe(Y,void 0,!0);function ie(Q){function oe(M){if(m)return;let I=D;const B=M;M.id&&(I=M.id),L(I,B)}function he(M){if(m)return;L(D,{value:M})}function T(){m||Q===ke.BUTTON_SELECTOR&&L(D,{value:p})}return Q===ke.BUTTON_SELECTOR?g.jsxs("div",{className:Ue(Le.toolbarItemSelectButton,{[Le.toolbarItemSelectButtonDisabled]:m,[Le.toolbarItemSelectButtonActivated]:_}),"data-disabled":m,children:[g.jsx("div",{className:Le.toolbarItemSelectButtonLabel,onClick:T,children:g.jsx(ze,{icon:ne,title:J,value:p,label:E,onChange:he})}),g.jsx(ue.Dropdown,{overlay:g.jsx(st,{overViewport:"scroll",menuType:D,options:z,onOptionSelect:oe,value:p}),onVisibleChange:w,disabled:m,children:g.jsx("div",{className:Ue(Le.toolbarItemSelectButtonArrow,{[Le.toolbarItemSelectButtonArrowDisabled]:m,[Le.toolbarItemSelectButtonArrowActivated]:_}),"data-disabled":m,children:g.jsx(it,{})})})]}):g.jsx(ue.Dropdown,{overlay:g.jsx(st,{overViewport:"scroll",menuType:D,options:z,onOptionSelect:oe,value:p}),onVisibleChange:w,disabled:m,children:g.jsxs("div",{className:Ue(Le.toolbarItemSelect,{[Le.toolbarItemSelectDisabled]:m,[Le.toolbarItemSelectActivated]:_}),children:[g.jsx(ze,{icon:ne,title:J,value:p,label:E,onChange:he}),g.jsx("div",{className:Ue(Le.toolbarItemSelectArrow,{[Le.toolbarItemSelectArrowDisabled]:m}),children:g.jsx(it,{})})]})})}function ce(){var oe;const Q=o.get(typeof E=="string"?E:(oe=E==null?void 0:E.name)!=null?oe:"");return g.jsx(ci,{className:Le.toolbarItemTextButton,active:_,disabled:m,onClick:()=>L(e.id),onDoubleClick:()=>e.subId&&L(e.subId),children:Q?g.jsx(ze,{title:J,value:p,label:E}):g.jsx(ze,{icon:U})})}function ae(){switch(e.type){case ke.BUTTON_SELECTOR:case ke.SELECTOR:case ke.SUBITEMS:return ie(e.type);case ke.BUTTON:default:return ce()}}return d?null:g.jsx(ue.Tooltip,{ref:t,visible:h?!1:a,title:k,placement:"bottom",onVisibleChange:x,children:g.jsx("div",{children:ae()})})}),U2=[Ye.TOOLBAR_START,Ye.TOOLBAR_INSERT,Ye.TOOLBAR_FORMULAS,Ye.TOOLBAR_DATA,Ye.TOOLBAR_VIEW,Ye.TOOLBAR_OTHERS];function hi(e){const{headerMenuComponents:t}=e,n=u.useDependency(u.LocaleService),{setCategory:r,visibleItems:i,groups:o,category:a,groupsByKey:c}=ui(U2),{toolbarItemRefs:h,toolbarRef:v,collapsedId:p}=di(i),d=s.useMemo(()=>t&&t.size>0||o.length>1,[t,o]);return g.jsxs(g.Fragment,{children:[d?g.jsxs("header",{className:Le.headerbar,children:[g.jsx("div",{className:Le.menubar,children:o.length>1&&o.map((m,_)=>g.jsx("a",{className:Ue(Le.menubarItem,{[Le.menubarItemActive]:m.name===a}),onClick:()=>{r(m.name)},children:n.t(m.name)},_))}),g.jsx("div",{className:Le.headerMenu,children:g.jsx(Be,{components:t})})]}):null,g.jsx("div",{ref:v,className:Le.toolbar,children:g.jsxs("div",{className:Le.toolbarContainer,children:[Object.entries(c).filter(([m,_])=>_.filter(x=>!p.includes(x.id)).length).map(([m,_])=>g.jsx("div",{className:Le.toolbarGroup,children:_.map(L=>!p.includes(L.id)&&g.jsx(Gt,{...L},L.id))},m)),p.length>0&&g.jsx(ue.Tooltip,{title:n.t("more"),placement:"bottom",children:g.jsx("div",{children:g.jsx(ue.Dropdown,{forceRender:!0,className:Le.toolbarMore,overlay:g.jsx("div",{className:Le.toolbarMoreContainer,onClick:m=>m.stopPropagation(),children:Object.entries(c).map(([m,_])=>g.jsx("div",{className:Le.toolbarGroup,children:_.map(L=>p.includes(L.id)&&g.jsx(Gt,{...L},L.id))},m))}),children:g.jsx("span",{children:g.jsx(ci,{className:Le.toolbarItemTextButton,children:g.jsx(q3,{})})})})})})]})}),g.jsx("div",{className:Le.toolbarContainer,style:{position:"absolute",top:-9999,left:-9999,opacity:0},children:Object.entries(c).map(([m,_])=>g.jsx("div",{className:Le.toolbarGroup,children:_.map(L=>g.jsx(Gt,{ref:x=>{h.current[L.id]={el:x==null?void 0:x.nativeElement,key:L.id}},...L},L.id))},m))})]})}const P1=u.createIdentifier("univer.sidebar-service"),F2="univer-sidebar",z2="univer-sidebar-open",Z2="univer-sidebar-container",W2="univer-sidebar-header",G2="univer-sidebar-header-close",Y2="univer-sidebar-body",q2="univer-sidebar-footer",d1={sidebar:F2,sidebarOpen:z2,sidebarContainer:Z2,sidebarHeader:W2,sidebarHeaderClose:G2,sidebarBody:Y2,sidebarFooter:q2};function En(){const e=u.useDependency(P1),t=Oe(e.sidebarOptions$),n=s.useRef(null),r=s.useMemo(()=>{if(!t)return null;const c={...t};for(const h of["children","header","footer"]){const v=h;if(t[v]){const p=t[v];p&&(c[v]=g.jsx(ze,{...p}))}}return c},[t]);s.useEffect(()=>{const c=v=>{e.scrollEvent$.next(v)},h=n.current;return h&&h.addEventListener("scroll",c),()=>{h==null||h.removeEventListener("scroll",c)}},[e]);const i=Ue(d1.sidebar,{[d1.sidebarOpen]:r==null?void 0:r.visible}),o=s.useMemo(()=>r!=null&&r.visible?typeof r.width=="number"?`${r.width}px`:r.width:0,[r]);function a(){var h;const c={...t,visible:!1};e.sidebarOptions$.next(c),(h=c==null?void 0:c.onClose)==null||h.call(c)}return g.jsx("section",{className:i,style:{width:o},children:g.jsxs("section",{className:d1.sidebarContainer,ref:n,children:[g.jsxs("header",{className:d1.sidebarHeader,children:[r==null?void 0:r.header,g.jsx("a",{className:d1.sidebarHeaderClose,onClick:a,children:g.jsx(D1,{})})]}),g.jsx("section",{className:d1.sidebarBody,children:r==null?void 0:r.children}),(r==null?void 0:r.footer)&&g.jsx("footer",{className:d1.sidebarFooter,children:r.footer})]})})}const bt=u.createIdentifier("univer.zen-zone-service"),X2="univer-zen-zone",Q2="univer-zen-zone-open",J2="univer-zen-zone-close",Yt={zenZone:X2,zenZoneOpen:Q2,zenZoneClose:J2};function wn(){const e=u.useDependency(bt),[t,n]=s.useState(!1),[r,i]=s.useState(),o=u.useDependency(qe);s.useEffect(()=>{const h=[e.visible$.subscribe(v=>{n(v)}),e.componentKey$.subscribe(v=>{i(v)})];return()=>{h.forEach(v=>{v.unsubscribe()})}},[]);const a=Ue(Yt.zenZone,t?Yt.zenZoneOpen:Yt.zenZoneClose),c=s.useMemo(()=>{const h=o.get(r!=null?r:"");if(h)return h},[r]);return g.jsx("section",{className:a,children:c&&g.jsx(c,{})})}const St=u.createIdentifier("univer.global-zone-service"),K2="univer-global-zone",e4="univer-global-zone-open",t4="univer-global-zone-close",cr={globalZone:K2,globalZoneOpen:e4,globalZoneClose:t4};function pi(){const e=u.useDependency(St),[t,n]=s.useState(!1),r=Oe(e.componentKey$,e.componentKey),i=u.useDependency(qe),o=Ue(cr.globalZone,cr.globalZoneOpen),a=s.useMemo(()=>{const c=i.get(r!=null?r:"");if(c)return c},[r,i]);return s.useEffect(()=>{const c=e.visible$.subscribe(h=>{n(h)});return()=>{c.unsubscribe()}},[e.visible$]),t?g.jsx("section",{className:o,children:a&&g.jsx(a,{})}):null}const Mn=new Set([pi]),n4="univer-workbench-layout",r4="univer-workbench-container",i4="univer-workbench-container-header",o4="univer-workbench-container-wrapper",a4="univer-workbench-container-content",s4="univer-workbench-container-canvas",l4="univer-workbench-container-left-sidebar",c4="univer-workbench-container-sidebar",r1={workbenchLayout:n4,workbenchContainer:r4,workbenchContainerHeader:i4,workbenchContainerWrapper:o4,workbenchContainerContent:a4,workbenchContainerCanvas:s4,workbenchContainerLeftSidebar:l4,workbenchContainerSidebar:c4};function u4(e){const{header:t=!0,toolbar:n=!0,footer:r=!0,contextMenu:i=!0,mountContainer:o,onRendered:a}=e,c=u.useDependency(u.LocaleService),h=u.useDependency(u.ThemeService),v=u.useDependency(w1),p=s.useRef(null),d=Fe(we.FOOTER),m=Fe(we.HEADER),_=Fe(we.HEADER_MENU),L=Fe(we.CONTENT),x=Fe(we.LEFT_SIDEBAR),w=Fe(we.GLOBAL);s.useEffect(()=>{h.getCurrentTheme()||h.setTheme(ue.defaultTheme)},[]),s.useEffect(()=>{p.current&&(a==null||a(p.current))},[a]);const[j,Z]=s.useState(c.getLocales()),U=s.useMemo(()=>document.createElement("div"),[]);return s.useEffect(()=>{document.body.appendChild(U),v.setContainer(U);const J=[c.localeChanged$.subscribe(()=>{Z(c.getLocales())}),h.currentTheme$.subscribe(E=>{ue.themeInstance.setTheme(o,E),U&&ue.themeInstance.setTheme(U,E)})];return()=>{J.forEach(E=>E.unsubscribe()),document.body.removeChild(U)}},[c,v,o,U,h.currentTheme$]),g.jsxs(ue.ConfigProvider,{locale:j==null?void 0:j.design,mountContainer:U,children:[g.jsxs("div",{className:r1.workbenchLayout,tabIndex:-1,onBlur:J=>J.stopPropagation(),children:[t&&n&&g.jsx("header",{className:r1.workbenchContainerHeader,children:g.jsx(hi,{headerMenuComponents:_})}),g.jsxs("section",{className:r1.workbenchContainer,children:[g.jsxs("div",{className:r1.workbenchContainerWrapper,children:[g.jsx("aside",{className:r1.workbenchContainerLeftSidebar,children:g.jsx(Be,{components:x},"left-sidebar")}),g.jsxs("section",{className:r1.workbenchContainerContent,children:[g.jsx("header",{children:t&&g.jsx(Be,{components:m},"header")}),g.jsx("section",{className:r1.workbenchContainerCanvas,ref:p,"data-range-selector":!0,onContextMenu:J=>J.preventDefault(),children:g.jsx(Be,{components:L},"content")})]}),g.jsx("aside",{className:r1.workbenchContainerSidebar,children:g.jsx(En,{})})]}),r&&g.jsx("footer",{className:r1.workbenchFooter,children:g.jsx(Be,{components:d,sharedProps:{contextMenu:i}},"footer")}),g.jsx(wn,{})]})]}),g.jsx(Be,{components:w},"global"),g.jsx(Be,{components:Mn},"built-in-global"),i&&g.jsx(li,{}),g.jsx(f4,{})]})}function f4(){const{mountContainer:e}=s.useContext(ue.ConfigContext),t=Fe(we.FLOATING);return H1.createPortal(g.jsx(Be,{components:t},"floating"),e)}var d4=Object.defineProperty,h4=Object.getOwnPropertyDescriptor,p4=(e,t,n,r)=>{for(var i=r>1?void 0:r?h4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&d4(t,n,i),i},C1=(e,t)=>(n,r)=>t(n,r,e);const v4=3e3;exports.DesktopUIController=class extends u.Disposable{constructor(t,n,r,i,o,a,c){super(),this._config=t,this._renderManagerService=n,this._injector=r,this._lifecycleService=i,this._uiPartsService=o,this._configService=a,this._layoutService=c,this._configService.setConfig(Y6,this._config),this._initBuiltinComponents(),Promise.resolve().then(()=>this._bootstrapWorkbench())}_bootstrapWorkbench(){this.disposeWithMe(g4(this._injector,this._config,(t,n)=>{this._layoutService&&(this.disposeWithMe(this._layoutService.registerRootContainerElement(n)),this.disposeWithMe(this._layoutService.registerCanvasElement(t))),this._renderManagerService.currentRender$.subscribe(r=>{if(r){const i=this._renderManagerService.getRenderById(r);if(!i.unitId||u.isInternalEditorID(i.unitId))return;i.engine.setContainer(t)}}),setTimeout(()=>{const r=this._renderManagerService.getRenderAll();for(const[i,o]of r)u.isInternalEditorID(i)||!o.isRenderUnit||o.engine.setContainer(t);this._lifecycleService.stage=u.LifecycleStages.Rendered,setTimeout(()=>this._lifecycleService.stage=u.LifecycleStages.Steady,v4)},300)}))}_initBuiltinComponents(){this.disposeWithMe(this._uiPartsService.registerComponent(we.FLOATING,()=>u.connectInjector(_n,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(we.CONTENT,()=>u.connectInjector(yn,this._injector)))}};exports.DesktopUIController=p4([u.OnLifecycle(u.LifecycleStages.Ready,exports.DesktopUIController),C1(1,v1.IRenderManagerService),C1(2,u.Inject(u.Injector)),C1(3,u.Inject(u.LifecycleService)),C1(4,n1),C1(5,u.IConfigService),C1(6,u.Optional(o1))],exports.DesktopUIController);function g4(e,t,n){let r;const i=t.container;if(typeof i=="string"){const h=document.getElementById(i);h?r=h:r=ur(i)}else i instanceof HTMLElement?r=i:r=ur("univer");const o=u.connectInjector(u4,e),a=h=>n(h,r);function c(){K1(g.jsx(o,{...t,mountContainer:r,onRendered:a}),r)}return c(),u.toDisposable(()=>{K1(g.jsx("div",{}),r),setTimeout(()=>K1(g.jsx("div",{}),r),200),setTimeout(()=>ii(r),500)})}function ur(e){const t=document.createElement("div");return t.id=e,t}const $1=u.createIdentifier("ui.notification.service");var m4=Object.defineProperty,C4=Object.getOwnPropertyDescriptor,b4=(e,t,n,r)=>{for(var i=r>1?void 0:r?C4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&m4(t,n,i),i},S4=(e,t)=>(n,r)=>t(n,r,e);const Rn=u.createIdentifier("univer.ui.before-close-service");exports.DesktopBeforeCloseService=class{constructor(t){A(this,"_beforeUnloadCallbacks",[]);A(this,"_onCloseCallbacks",[]);this._notificationService=t,this._init()}registerBeforeClose(t){return this._beforeUnloadCallbacks.push(t),{dispose:()=>{this._beforeUnloadCallbacks=this._beforeUnloadCallbacks.filter(n=>n!==t)}}}registerOnClose(t){return this._onCloseCallbacks.push(t),{dispose:()=>{this._onCloseCallbacks=this._onCloseCallbacks.filter(n=>n!==t)}}}_init(){window.addEventListener("beforeunload",t=>{const n=this._beforeUnloadCallbacks.map(r=>r()).filter(r=>!!r).join(`
|
|
10
|
-
`);if(n)return this._notificationService.show({type:"error",title:"Some changes are not saved",content:n}),typeof t>"u"&&(t=window.event),t.returnValue=n,n}),window.addEventListener("unload",()=>{this._onCloseCallbacks.forEach(t=>t())})}};exports.DesktopBeforeCloseService=
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I1(e){return
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(e,t){return
|
|
9
|
+
*/var Xa=s,Qa=Symbol.for("react.element"),Ja=Symbol.for("react.fragment"),Ka=Object.prototype.hasOwnProperty,es=Xa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ts={key:!0,ref:!0,__self:!0,__source:!0};function A6(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ka.call(t,r)&&!ts.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Qa,type:e,key:o,ref:a,props:i,_owner:es.current}}ft.Fragment=Ja;ft.jsx=A6;ft.jsxs=A6;V6.exports=ft;var g=V6.exports;function Kn(e){return typeof e=="function"?e():e}function Oe(e,t,n,r){if(typeof e=="function"&&!r)throw new Error("[useObservable]: expect deps when observable is a function! Otherwise it would cause an infinite loop.");const i=s.useRef(null),o=s.useRef(!1),a=s.useMemo(()=>e,[...typeof r<"u"?r:[e]]),[c,h]=s.useState(0),v=s.useRef((()=>{let p;return a&&Kn(a).subscribe(m=>{o.current=!0,p=m}).unsubscribe(),p!=null?p:t})());if(s.useEffect(()=>{let p=null;return a&&(i.current=Kn(a),p=i.current.subscribe(f=>{v.current=f,h(m=>m+1)})),()=>p==null?void 0:p.unsubscribe()},[a]),n&&!o.current)throw new Error("[useObservable]: expect shouldHaveSyncValue but not getting a sync value!");return v.current}function ze(e){const{title:t,icon:n,label:r,value:i,value$:o}=e,a=u.useDependency(u.LocaleService),c=u.useDependency(qe),h=[];let v=0,p=i;o&&(p=Oe(o,void 0,!0));let f;re.isObservable(n)?f=Oe(n,void 0,!0):f=n;let m=!1;if(p&&typeof p=="string"&&(m=new u.ColorKit(p).isValid),n){const _=c.get(f!=null?f:"");_&&h.push(g.jsx(_,{extend:{colorChannel1:m?p:"rgb(var(--primary-color))"}},v++))}if(r){const _=typeof r=="string",L=_?{...e}:{...r==null?void 0:r.props,...e},x=_?r:r==null?void 0:r.name,w=c.get(x);w?h.push(g.jsx(w,{...L,value:p},v++)):h.push(g.jsx("span",{children:a.t(x)},v++))}return t&&h.push(g.jsx("span",{children:typeof t=="string"?a.t(t):t},v++)),g.jsx(g.Fragment,{children:h})}const ns="univer-ui-plugin-sheets-font-family",rs="univer-ui-plugin-sheets-font-family-item",j6={uiPluginSheetsFontFamily:ns,uiPluginSheetsFontFamilyItem:rs},is=e=>{const{value:t}=e,n=u.useDependency(u.LocaleService),r=s.useMemo(()=>{var o;let i=n.t(`fontFamily.${((o=`${t}`)!=null?o:"").replace(/\s/g,"")}`);return i.startsWith("fontFamily.")&&typeof t=="string"&&(i=t.split(",")[0]),i},[t]);return g.jsx("div",{className:j6.uiPluginSheetsFontFamily,style:{fontFamily:t},children:r})},os=e=>{var r;const{value:t}=e,n=u.useDependency(u.LocaleService);return g.jsx("span",{className:j6.uiPluginSheetsFontFamilyItem,style:{fontFamily:t},children:n.t(`fontFamily.${((r=`${t}`)!=null?r:"").replace(/\s/g,"")}`)})},as=[{value:"Arial"},{value:"Times New Roman"},{value:"Tahoma"},{value:"Verdana"},{value:"Microsoft YaHei"},{value:"SimSun"},{value:"SimHei"},{value:"Kaiti"},{value:"FangSong"},{value:"NSimSun"},{value:"STXinwei"},{value:"STXingkai"},{value:"STLiti"}],ss="univer-ui-plugin-sheets-font-size",ls="univer-ui-plugin-sheets-font-size-input",er={uiPluginSheetsFontSize:ss,uiPluginSheetsFontSizeInput:ls},cs=e=>{const{value:t,min:n,max:r,onChange:i,disabled$:o}=e,a=Oe(o),[c,h]=s.useState(Number(t!=null?t:0)),v=s.useMemo(()=>Number(t!=null?t:c),[t]);function p(m){m!==null&&h(m)}function f(m){m.stopPropagation(),m.code==="Enter"&&i(c.toString())}return g.jsx("div",{className:er.uiPluginSheetsFontSize,children:g.jsx(ue.InputNumber,{className:er.uiPluginSheetsFontSizeInput,value:v,controls:!1,min:n,max:r,onKeyDown:f,onChange:p,disabled:a})})},us=[{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"20",value:20},{label:"22",value:22},{label:"24",value:24},{label:"26",value:26},{label:"28",value:28},{label:"36",value:36},{label:"48",value:48},{label:"72",value:72}];var P6={};Object.defineProperty(P6,"__esModule",{value:!0});var $6=P6.default=fs;function fs(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function k6(e){const t=s.useRef(e);return t.current=e,s.useCallback((...n)=>t.current(...n),[])}function B6(e,t){const n=k6(()=>{if(!e||!t)return;const r=e.style,i=e.getBoundingClientRect(),{y:o}=i,a=t.getBoundingClientRect(),c=e.scrollHeight>i.height,h=o<0||o+i.height>a.height;if(!h&&!c){r.overflowY="",r.maxHeight="";return}h&&(r.overflowY="scroll",r.maxHeight=o<0?`${e.scrollHeight+o}px`:`${a.height-o}px`)});s.useEffect(()=>{if(!$6()||!e||!t)return;n();const r=ue.resizeObserverCtor(n);return r.observe(e),()=>{r.unobserve(e)}},[e,t])}function ds(e,t,...n){return e.t(t)}const tr="univer.command.copy",vn={id:tr,name:tr,multi:!0,priority:0,type:u.CommandType.COMMAND,preconditions:()=>!1,handler:async()=>!0},nr="univer.command.cut",gn={id:nr,name:nr,multi:!0,priority:0,type:u.CommandType.COMMAND,preconditions:()=>!1,handler:async()=>!0},rr="univer.command.paste",mn={id:rr,name:rr,multi:!0,priority:0,type:u.CommandType.COMMAND,preconditions:()=>!1,handler:async()=>!0};function hs(e,t,n){return window.addEventListener(e,t,n),u.toDisposable(()=>window.removeEventListener(e,t,n))}var ps=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,gs=(e,t,n,r)=>{for(var i=r>1?void 0:r?vs(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ps(t,n,i),i},z1=(e,t)=>(n,r)=>t(n,r,e);class ms{constructor(t){A(this,"_focus",!1);A(this,"_valueLegality",!0);A(this,"_openForSheetUnitId");A(this,"_openForSheetSubUnitId");this._param=t,this._openForSheetUnitId=this._param.openForSheetUnitId,this._openForSheetSubUnitId=this._param.openForSheetSubUnitId}get documentDataModel(){return this._param.documentDataModel}get editorUnitId(){return this._param.editorUnitId}get cancelDefaultResizeListener(){return this._param.cancelDefaultResizeListener}get render(){return this._param.render}isSingleChoice(){return this._param.isSingleChoice}setOpenForSheetUnitId(t){this._openForSheetUnitId=t}getOpenForSheetUnitId(){return this._openForSheetUnitId}setOpenForSheetSubUnitId(t){this._openForSheetSubUnitId=t}getOpenForSheetSubUnitId(){return this._openForSheetSubUnitId}isValueLegality(){return this._valueLegality===!0}setValueLegality(t=!0){this._valueLegality=t}isFocus(){return this._focus}setFocus(t=!1){this._focus=t}isSingle(){return this._param.isSingle===!0||this.onlyInputRange()}isReadOnly(){return this._param.isReadonly===!0}onlyInputContent(){return this._param.onlyInputContent===!0}onlyInputFormula(){return this._param.onlyInputFormula===!0}onlyInputRange(){return this._param.onlyInputRange===!0}getBoundingClientRect(){return this._param.editorDom.getBoundingClientRect()}isVisible(){return this._param.visible}isSheetEditor(){return this._param.isSheetEditor===!0}getValue(){var n;return(((n=this._param.documentDataModel.getBody())==null?void 0:n.dataStream)||"").replace(/\r\n/g,"").replace(/\n/g,"").replace(/\n/g,"")}getBody(){return this._param.documentDataModel.getBody()}update(t){this._param={...this._param,...t}}verticalAlign(){var a,c;const t=(a=this._param)==null?void 0:a.documentDataModel;if(t==null)return;const{width:n,height:r}=this._param.editorDom.getBoundingClientRect();if(r===0||n===0)return;if(!this.isSingle()){t.updateDocumentDataPageSize(n,void 0);return}let i=u.DEFAULT_STYLES.fs;(c=this._param.canvasStyle)!=null&&c.fontSize&&(i=this._param.canvasStyle.fontSize);const o=(r-i*4/3)/2-2;t.updateDocumentDataMargin({t:o<0?0:o}),t.updateDocumentDataPageSize(void 0,void 0)}updateCanvasStyle(){var r;const t=this._param.documentDataModel;if(t==null)return;const n={};(r=this._param.canvasStyle)!=null&&r.fontSize&&(n.textStyle==null&&(n.textStyle={}),n.textStyle.fs=this._param.canvasStyle.fontSize),t.updateDocumentStyle(n)}}exports.EditorService=class extends u.Disposable{constructor(n,r,i,o){super();A(this,"_editors",new Map);A(this,"_focusEditorUnitId");A(this,"_state$",new re.Subject);A(this,"state$",this._state$.asObservable());A(this,"_currentSheetUnitId");A(this,"_currentSheetSubUnitId");A(this,"_inputFormula$",new re.Subject);A(this,"inputFormula$",this._inputFormula$.asObservable());A(this,"_resize$",new re.Subject);A(this,"resize$",this._resize$.asObservable());A(this,"_closeRangePrompt$",new re.Subject);A(this,"closeRangePrompt$",this._closeRangePrompt$.asObservable());A(this,"_blur$",new re.Subject);A(this,"blur$",this._blur$.asObservable());A(this,"_focus$",new re.Subject);A(this,"focus$",this._focus$.asObservable());A(this,"_setValue$",new re.Subject);A(this,"setValue$",this._setValue$.asObservable());A(this,"_valueChange$",new re.Subject);A(this,"valueChange$",this._valueChange$.asObservable());A(this,"_focusStyle$",new re.Subject);A(this,"focusStyle$",this._focusStyle$.asObservable());A(this,"_singleSelection$",new re.Subject);A(this,"singleSelection$",this._singleSelection$.asObservable());A(this,"_spreadsheetFocusState",!1);this._univerInstanceService=n,this._renderManagerService=r,this._lexerTreeBuilder=i,this._contextService=o}setFocusId(n){this._focusEditorUnitId=n}getFocusId(){return this._focusEditorUnitId}getFocusEditor(){if(this._focusEditorUnitId)return this.getEditor(this._focusEditorUnitId)}isEditor(n){return this._editors.has(n)}isSheetEditor(n){const r=this._editors.get(n);return!!(r&&r.isSheetEditor())}closeRangePrompt(){const n=this._univerInstanceService.getCurrentUniverDocInstance();if(!n)return;const r=n.getUnitId();this._contextService.setContextValue(u.EDITOR_ACTIVATED,!1),this._contextService.setContextValue(u.FOCUSING_EDITOR_STANDALONE,!1),!(!this.isEditor(r)||this.isSheetEditor(r))&&(this.changeSpreadsheetFocusState(!1),this.blur())}changeSpreadsheetFocusState(n){this._spreadsheetFocusState=n}getSpreadsheetFocusState(){return this._spreadsheetFocusState}focusStyle(n){const r=this.getEditor(n);if(!r)return!1;r.setFocus(!0),this._contextService.setContextValue(u.EDITOR_ACTIVATED,!0),this._contextService.setContextValue(u.FOCUSING_EDITOR_STANDALONE,!0),this._contextService.setContextValue(u.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,r.isSingle()),this._spreadsheetFocusState||this.singleSelection(r.isSingleChoice()),this._focusStyle$.next(n),this.setFocusId(n)}singleSelection(n){this._singleSelection$.next(n)}selectionChangingState(){const n=this.getFocusId();if(n==null)return!0;const r=this.getEditor(n);return!r||r.isSheetEditor()?!0:r.onlyInputRange()!==!0&&r.onlyInputFormula()!==!0?(this.blur(),!0):r.onlyInputFormula()===!0&&this._contextService.getContextValue(u.FOCUSING_EDITOR_INPUT_FORMULA)!==!0?(this.blur(),!0):!this.getSpreadsheetFocusState()}blur(){this._spreadsheetFocusState||(this._closeRangePrompt$.next(null),this.singleSelection(!1),this.setFocusId(null),this._contextService.setContextValue(u.EDITOR_ACTIVATED,!1),this._contextService.setContextValue(u.FOCUSING_EDITOR_STANDALONE,!1)),this.getAllEditor().forEach(n=>{n.setFocus(!1)}),this._focusStyle$.next(),this._blur$.next(null)}focus(n){if(n==null){const o=this._univerInstanceService.getCurrentUniverDocInstance();if(!o)return;n=o.getUnitId()}const r=this.getEditor(n);if(r==null)return;this._univerInstanceService.setCurrentUnitForType(n);const i=r.getValue().length;this.focusStyle(n),this._focus$.next({startOffset:i-2,endOffset:i-2})}setFormula(n,r){r==null&&(r=this._getCurrentEditorUnitId()),this._inputFormula$.next({formulaString:n,editorUnitId:r})}setValue(n,r){r==null&&(r=this._getCurrentEditorUnitId()),this.setValueNoRefresh(n,r),this._refreshValueChange(r)}setValueNoRefresh(n,r){this._setValue$.next({body:{dataStream:n},editorUnitId:r}),this.resize(r)}getValue(n){const r=this.getEditor(n);if(r!=null)return r.getValue()}setRichValue(n,r){r==null&&(r=this._getCurrentEditorUnitId()),this._setValue$.next({body:n,editorUnitId:r}),this._refreshValueChange(r)}getRichValue(n){const r=this.getEditor(n);if(r!=null)return r.getBody()}dispose(){this._state$.complete(),this._editors.clear(),super.dispose()}getEditor(n){return n==null&&(n=this._getCurrentEditorUnitId()),this._editors.get(n)}getAllEditor(){return this._editors}getFirstEditor(){return[...this.getAllEditor().values()][0]}resize(n){const r=this.getEditor(n);r!=null&&(r.verticalAlign(),this._resize$.next(n))}isVisible(n){var r;return(r=this.getEditor(n))==null?void 0:r.isVisible()}setOperationSheetUnitId(n){this._currentSheetUnitId=n}getOperationSheetUnitId(){return this._currentSheetUnitId}setOperationSheetSubUnitId(n){this._currentSheetSubUnitId=n}getOperationSheetSubUnitId(){return this._currentSheetSubUnitId}register(n,r){var p,f,m,_;const{initialSnapshot:i,editorUnitId:o,canvasStyle:a={}}=n,c=this._univerInstanceService.createUnit(u.UniverInstanceType.UNIVER_DOC,i||this._getBlank(o));let h=this._renderManagerService.getRenderById(o);h==null&&(this._renderManagerService.create(o),h=this._renderManagerService.getRenderById(o)),h.engine.setContainer(r);const v=new ms({...n,render:h,documentDataModel:c,editorDom:r,canvasStyle:a});return this._editors.set(o,v),(_=(m=(f=(p=h.mainComponent)==null?void 0:p.getScene())==null?void 0:f.getViewports())==null?void 0:m[0].getScrollBar())==null||_.dispose(),v.isSheetEditor()||(v.verticalAlign(),v.updateCanvasStyle()),u.toDisposable(()=>{this._unRegister(o)})}_unRegister(n){const r=this._editors.get(n);if(r==null)return;if(this._renderManagerService.removeRender(n),r.documentDataModel.dispose(),this._editors.delete(n),this._univerInstanceService.disposeUnit(n),this._univerInstanceService.getAllUnitsForType(u.UniverInstanceType.UNIVER_SHEET).length>0){const o=this._univerInstanceService.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET);this._univerInstanceService.focusUnit(o.getUnitId())}}refreshValueChange(n){this._refreshValueChange(n)}checkValueLegality(n){const r=this._editors.get(n);if(r==null)return!0;let i=r.getValue();if(r.setValueLegality(),i=i.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\n/g,""),i.length===0)return!0;if(r.onlyInputFormula()){if(i.substring(0,1)!==i1.operatorToken.EQUALS)return r.setValueLegality(!1),!1;const o=this._lexerTreeBuilder.checkIfAddBracket(i);r.setValueLegality(o===0)}else if(r.onlyInputRange()){const o=i.split(",");if(r.isSingleChoice()&&o.length>1)return r.setValueLegality(!1),!1;r.setValueLegality(i1.isReferenceStrings(i))}return r.isValueLegality()}_refreshValueChange(n){const r=this.getEditor(n);r!=null&&this._valueChange$.next(r)}_getCurrentEditorUnitId(){return this._univerInstanceService.getCurrentUniverDocInstance().getUnitId()}_refresh(n){this._state$.next(n)}_getBlank(n){return{id:n,body:{dataStream:`${u.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],paragraphs:[{startIndex:0}]},documentStyle:{renderConfig:{verticalAlign:u.VerticalAlign.TOP,horizontalAlign:u.HorizontalAlign.LEFT},marginLeft:3,marginTop:0,marginRight:3}}}};exports.EditorService=gs([z1(0,u.IUniverInstanceService),z1(1,v1.IRenderManagerService),z1(2,u.Inject(i1.LexerTreeBuilder)),z1(3,u.IContextService)],exports.EditorService);const E1=u.createIdentifier("univer.editor.service");var Cs=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,Ss=(e,t,n,r)=>{for(var i=r>1?void 0:r?bs(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Cs(t,n,i),i},Wt=(e,t)=>(n,r)=>t(n,r,e);const _s="FOCUSING_UNIVER",ys=["univer-app-layout","univer-toolbar-btn","univer-menu-item","univer-button","univer-sheet-bar-btn","univer-render-canvas","univer-workbench-layout"],Ls=["univer-editor","univer-range-selector","univer-range-selector-editor","univer-render-canvas","univer-text-editor-container-placeholder"],o1=u.createIdentifier("ui.layout-service");exports.DesktopLayoutService=class extends u.Disposable{constructor(n,r,i){super();A(this,"_rootContainerElement",null);A(this,"_isFocused",!1);A(this,"_focusHandlers",new Map);A(this,"_canvasContainers",[]);A(this,"_allContainers",[]);this._contextService=n,this._univerInstanceService=r,this._editorService=i,this._initUniverFocusListener(),this._initEditorStatus()}get isFocused(){return this._isFocused}get rootContainerElement(){return this._rootContainerElement}focus(){const n=this._univerInstanceService.getFocusedUnit();if(!n)return;let r;n instanceof u.Workbook?r=this._focusHandlers.get(u.UniverInstanceType.UNIVER_SHEET):n instanceof u.DocumentDataModel?r=this._focusHandlers.get(u.UniverInstanceType.UNIVER_DOC):n instanceof u.SlideDataModel&&(r=this._focusHandlers.get(u.UniverInstanceType.UNIVER_SLIDE)),r&&r(n.getUnitId())}registerFocusHandler(n,r){if(this._focusHandlers.has(n))throw new Error(`[DesktopLayoutService]: handler of type ${n} bas been registered!`);return this._focusHandlers.set(n,r),u.toDisposable(()=>this._focusHandlers.delete(n))}registerCanvasElement(n){if(this._canvasContainers.indexOf(n)===-1)return this._canvasContainers.push(n),u.toDisposable(()=>u.remove(this._canvasContainers,n));throw new Error("[DesktopLayoutService]: canvas container already registered!")}getCanvasElement(){return this._canvasContainers[0]}registerRootContainerElement(n){if(this._rootContainerElement)throw new Error("[DesktopLayoutService]: root container already registered!");this._rootContainerElement=n;const r=this.registerContainerElement(n);return u.toDisposable(()=>{this._rootContainerElement=null,r.dispose()})}registerContainerElement(n){if(this._allContainers.indexOf(n)===-1)return this._allContainers.push(n),u.toDisposable(()=>u.remove(this._allContainers,n));throw new Error("[LayoutService]: container already registered!")}checkElementInCurrentContainers(n){return this._allContainers.some(r=>r.contains(n))}checkCanvasIsFocused(){return this._canvasContainers.some(n=>n===document.activeElement||n.contains(document.activeElement))}_initUniverFocusListener(){this.disposeWithMe(re.fromEvent(window,"focusin").subscribe(n=>{const r=n.target;if(this._blurSheetEditor(r),ys.some(i=>r.classList.contains(i))){queueMicrotask(()=>this.focus());return}r&&this.checkElementInCurrentContainers(r)?this._isFocused=!0:this._isFocused=!1,this._contextService.setContextValue(_s,this._isFocused),this._contextService.setContextValue(u.FOCUSING_UNIVER_EDITOR,ir())}))}_initEditorStatus(){this._contextService.setContextValue(u.FOCUSING_UNIVER_EDITOR,ir())}_blurSheetEditor(n){if(Ls.some(i=>n.classList.contains(i)))return;const r=this._editorService.getFocusEditor();r&&r.isSheetEditor()!==!0&&this._editorService.blur()}};exports.DesktopLayoutService=Ss([u.OnLifecycle(u.LifecycleStages.Ready,o1),Wt(0,u.IContextService),Wt(1,u.IUniverInstanceService),Wt(2,E1)],exports.DesktopLayoutService);function ir(){var e;return!!((e=document.activeElement)!=null&&e.classList.contains("univer-editor"))}const dt=u.createIdentifier("ui.platform.service");class Cn{get isMac(){return/Mac/.test(navigator.appVersion)}get isWindows(){return/Windows/.test(navigator.appVersion)}get isLinux(){return/Linux/.test(navigator.appVersion)}}var u1=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.ARROW_LEFT=37]="ARROW_LEFT",e[e.ARROW_UP=38]="ARROW_UP",e[e.ARROW_RIGHT=39]="ARROW_RIGHT",e[e.ARROW_DOWN=40]="ARROW_DOWN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUM_LOCK=144]="NUM_LOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.EQUAL=187]="EQUAL",e[e.COMMA=188]="COMMA",e[e.MINUS=189]="MINUS",e[e.PERIOD=190]="PERIOD",e[e.BACK_SLASH=220]="BACK_SLASH",e))(u1||{});const Es={8:"Backspace",9:"Tab",13:"Enter",46:"Del",27:"Esc",32:"Space",37:"←",39:"→",38:"↑",40:"↓",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",189:"-",187:"=",190:".",188:",",220:"\\"};var Pe=(e=>(e[e.SHIFT=1024]="SHIFT",e[e.ALT=2048]="ALT",e[e.CTRL_COMMAND=4096]="CTRL_COMMAND",e[e.MAC_CTRL=8192]="MAC_CTRL",e))(Pe||{}),ws=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,Rs=(e,t,n,r)=>{for(var i=r>1?void 0:r?Ms(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ws(t,n,i),i},Z1=(e,t)=>(n,r)=>t(n,r,e);const g1=u.createIdentifier("univer.shortcut");exports.ShortcutService=class extends u.Disposable{constructor(n,r,i,o){super();A(this,"_shortCutMapping",new Map);A(this,"_commandIDMapping",new Map);A(this,"_shortcutChanged$",new re.Subject);A(this,"shortcutChanged$",this._shortcutChanged$.asObservable());A(this,"_forceEscaped",!1);A(this,"_disable",!1);this._commandService=n,this._platformService=r,this._contextService=i,this._layoutService=o,this.disposeWithMe(hs("keydown",a=>{this._resolveKeyboardEvent(a)},{capture:!0}))}setDisable(n){this._disable=n}getAllShortcuts(){return Array.from(this._shortCutMapping.values()).map(n=>Array.from(n.values())).flat()}registerShortcut(n){const r=this._getBindingFromItem(n),i=this._shortCutMapping.get(r);i?i.add(n):this._shortCutMapping.set(r,new Set([n]));const o=n.id,a=this._commandIDMapping.get(o);return a?a.add(n):this._commandIDMapping.set(o,new Set([n])),this._emitShortcutChanged(),u.toDisposable(()=>{var c,h,v,p;(c=this._shortCutMapping.get(r))==null||c.delete(n),((h=this._shortCutMapping.get(r))==null?void 0:h.size)===0&&this._shortCutMapping.delete(r),(v=this._commandIDMapping.get(o))==null||v.delete(n),((p=this._commandIDMapping.get(o))==null?void 0:p.size)===0&&this._commandIDMapping.delete(o),this._emitShortcutChanged()})}getShortcutDisplayOfCommand(n){const r=this._commandIDMapping.get(n);return r?this.getShortcutDisplay(r.values().next().value):null}getShortcutDisplay(n){var v;const r=this._getBindingFromItem(n),i=r&Pe.CTRL_COMMAND,o=r&Pe.SHIFT,a=r&Pe.ALT,c=r&Pe.MAC_CTRL,h=(v=Es[r&255])!=null?v:"<->";return this._platformService.isMac?`${i?"⌘":""}${o?"⇧":""}${a?"⌥":""}${c?"⌃":""}${h}`:`${i?"Ctrl+":""}${o?"Shift+":""}${a?"Alt+":""}${h}`}_emitShortcutChanged(){this._shortcutChanged$.next()}forceEscape(){return this._forceEscaped=!0,u.toDisposable(()=>this._forceEscaped=!1)}_resolveKeyboardEvent(n){if(this._forceEscaped||this._disable||this._layoutService&&!this._layoutService.checkElementInCurrentContainers(n.target))return;this._dispatch(n)&&n.preventDefault()}_dispatch(n){const r=this._deriveBindingFromEvent(n);if(r===null)return!1;const i=this._shortCutMapping.get(r);if(i===void 0)return!1;const o=Array.from(i).sort((a,c)=>{var h,v;return((h=c.priority)!=null?h:0)-((v=a.priority)!=null?v:0)}).find(a=>{var c,h;return(h=(c=a.preconditions)==null?void 0:c.call(a,this._contextService))!=null?h:!0});return o?(this._commandService.executeCommand(o.id,o.staticParameters),!0):!1}_getBindingFromItem(n){return this._platformService.isMac&&n.mac?n.mac:this._platformService.isWindows&&n.win?n.win:this._platformService.isLinux&&n.linux?n.linux:n.binding}_deriveBindingFromEvent(n){const{shiftKey:r,metaKey:i,altKey:o,keyCode:a}=n;let c=a;return r&&(c|=Pe.SHIFT),o&&(c|=Pe.ALT),(this._platformService.isMac?i:n.ctrlKey)&&(c|=Pe.CTRL_COMMAND),this._platformService.isMac&&n.ctrlKey&&(c|=Pe.MAC_CTRL),c}};exports.ShortcutService=Rs([Z1(0,u.ICommandService),Z1(1,dt),Z1(2,u.IContextService),Z1(3,u.Optional(o1))],exports.ShortcutService);function U6(e,t){return!t||!e||(["group","type","icon","title","tooltip","positions"].forEach(i=>{t[i]!==void 0&&(e[i]=t[i])}),["hidden","disabled","activated"].forEach(i=>{xs(e,`${i}$`,t[i])})),e}function xs(e,t,n){if(n!==void 0&&e[t]){const r=e[t].pipe(re.switchMap(()=>new re.BehaviorSubject(n)));e[t]=r}}var Is=Object.defineProperty,Os=Object.getOwnPropertyDescriptor,Hs=(e,t,n,r)=>{for(var i=r>1?void 0:r?Os(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Is(t,n,i),i},Ts=(e,t)=>(n,r)=>t(n,r,e);const a1=u.createIdentifier("univer.menu-service");exports.MenuService=class extends u.Disposable{constructor(n){super();A(this,"_menuItemMap",new Map);A(this,"_menuByPositions",new Map);A(this,"_menuConfigs",new Map);A(this,"_menuChanged$",new re.BehaviorSubject(void 0));A(this,"menuChanged$",this._menuChanged$.asObservable());this._shortcutService=n}dispose(){this._menuItemMap.clear(),this._menuChanged$.complete()}addMenuItem(n,r){if(this._menuItemMap.has(n.id))throw new Error(`Menu item with the same id ${n.id} has already been added!`);const i=r==null?void 0:r[n.id];return this._menuItemMap.set(n.id,U6(n,i)),Array.isArray(n.positions)?n.positions.forEach(o=>this._appendMenuToPosition(n,o)):this._appendMenuToPosition(n,n.positions),this._menuChanged$.next(),u.toDisposable(()=>{if(this._menuItemMap.delete(n.id),Array.isArray(n.positions))n.positions.forEach(o=>{const a=this._menuByPositions.get(o);if(!a)return;const c=a.findIndex(h=>h[0]===n.id);c>-1&&a.splice(c,1)});else{const o=this._menuByPositions.get(n.positions);if(!o)return;const a=o.findIndex(c=>c[0]===n.id);a>-1&&o.splice(a,1)}this._menuChanged$.next()})}getMenuItems(n){if(this._menuByPositions.has(n)){const r=this._menuByPositions.get(n);if(r)return[...r.values()].map(i=>this._getDisplayMenuItems(i[1]))}return[]}setMenuItem(n){this._menuItemMap.set(n.id,n),this._menuChanged$.next()}getMenuItem(n){return this._menuItemMap.has(n)?this._menuItemMap.get(n):null}setMenuConfigs(n,r){this._menuConfigs.set(n,r)}getMenuConfig(n){return this._menuConfigs.has(n)?this._menuConfigs.get(n):null}_getDisplayMenuItems(n){const r=this._shortcutService.getShortcutDisplayOfCommand(n.id);return r?{...n,shortcut:r}:n}_appendMenuToPosition(n,r){this._menuByPositions.has(r)||this._menuByPositions.set(r,[]);const i=this._menuByPositions.get(r);if(i.findIndex(o=>o[0]===n.id)>-1)throw new Error(`Menu item with the same id ${n.id} has already been added!`);i.push([n.id,n])}};exports.MenuService=Hs([Ts(0,g1)],exports.MenuService);const F6={id:"sheet.operation.set-editor-resize",type:u.CommandType.OPERATION,handler:(e,t)=>!0};var Ye=(e=>(e.VOID="void",e.TOOLBAR_START="uiToolbar.start",e.TOOLBAR_INSERT="uiToolbar.insert",e.TOOLBAR_FORMULAS="uiToolbar.formulas",e.TOOLBAR_DATA="uiToolbar.data",e.TOOLBAR_VIEW="uiToolbar.view",e.TOOLBAR_OTHERS="uiToolbar.others",e.CONTEXT_MENU="contextMenu",e))(Ye||{}),c1=(e=>(e[e.TOOLBAR_HISTORY=0]="TOOLBAR_HISTORY",e[e.TOOLBAR_FORMAT=1]="TOOLBAR_FORMAT",e[e.TOOLBAR_LAYOUT=2]="TOOLBAR_LAYOUT",e[e.TOOLBAR_FORMULAS_INSERT=3]="TOOLBAR_FORMULAS_INSERT",e[e.TOOLBAR_FORMULAS_VIEW=4]="TOOLBAR_FORMULAS_VIEW",e[e.TOOLBAR_FILE=5]="TOOLBAR_FILE",e[e.TOOLBAR_OTHERS=6]="TOOLBAR_OTHERS",e[e.CONTEXT_MENU_FORMAT=7]="CONTEXT_MENU_FORMAT",e[e.CONTEXT_MENU_LAYOUT=8]="CONTEXT_MENU_LAYOUT",e[e.CONTEXT_MENU_DATA=9]="CONTEXT_MENU_DATA",e[e.CONTEXT_MENU_OTHERS=10]="CONTEXT_MENU_OTHERS",e))(c1||{}),ke=(e=>(e[e.BUTTON=0]="BUTTON",e[e.SELECTOR=1]="SELECTOR",e[e.BUTTON_SELECTOR=2]="BUTTON_SELECTOR",e[e.SUBITEMS=3]="SUBITEMS",e))(ke||{});function Ds(e){const t=e.get(u.IUndoRedoService);return{id:u.UndoCommand.id,group:c1.TOOLBAR_HISTORY,type:ke.BUTTON,icon:"UndoSingle",title:"Undo",tooltip:"toolbar.undo",positions:[Ye.TOOLBAR_START],disabled$:t.undoRedoStatus$.pipe(Ar.map(n=>n.undos<=0))}}function Ns(e){const t=e.get(u.IUndoRedoService);return{id:u.RedoCommand.id,group:c1.TOOLBAR_HISTORY,type:ke.BUTTON,icon:"RedoSingle",title:"Redo",tooltip:"toolbar.redo",positions:[Ye.TOOLBAR_START],disabled$:t.undoRedoStatus$.pipe(Ar.map(n=>n.redos<=0))}}var Vs=Object.defineProperty,As=Object.getOwnPropertyDescriptor,js=(e,t,n,r)=>{for(var i=r>1?void 0:r?As(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Vs(t,n,i),i},W1=(e,t)=>(n,r)=>t(n,r,e);function ht(e){return e.getContextValue(u.FOCUSING_UNIVER_EDITOR)}const z6={id:vn.id,description:"shortcut.copy",group:"1_common-edit",binding:u1.C|Pe.CTRL_COMMAND,preconditions:ht},Z6={id:gn.id,description:"shortcut.cut",group:"1_common-edit",binding:u1.X|Pe.CTRL_COMMAND,preconditions:ht},Ps={id:mn.id,description:"shortcut.paste",group:"1_common-edit",binding:u1.V|Pe.CTRL_COMMAND,preconditions:()=>!1},W6={id:u.UndoCommand.id,description:"shortcut.undo",group:"1_common-edit",binding:u1.Z|Pe.CTRL_COMMAND,preconditions:ht},G6={id:u.RedoCommand.id,description:"shortcut.redo",group:"1_common-edit",binding:u1.Y|Pe.CTRL_COMMAND,preconditions:ht};exports.SharedController=class extends u.Disposable{constructor(t,n,r,i,o){super(),this._config=t,this._injector=n,this._menuService=r,this._shortcutService=i,this._commandService=o,this.initialize()}initialize(){this._registerCommands(),this._registerShortcuts(),this._registerMenus()}_registerMenus(){var n,r;const t=(r=(n=this._config)==null?void 0:n.menu)!=null?r:{};[Ds,Ns].forEach(i=>{this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(i),t))})}_registerCommands(){[gn,vn,mn,F6].forEach(t=>this.disposeWithMe(this._commandService.registerMultipleCommand(t)))}_registerShortcuts(){const t=[W6,G6];t.push(Z6,z6,Ps),t.forEach(n=>this.disposeWithMe(this._shortcutService.registerShortcut(n)))}};exports.SharedController=js([u.OnLifecycle(u.LifecycleStages.Ready,exports.SharedController),W1(1,u.Inject(u.Injector)),W1(2,a1),W1(3,g1),W1(4,u.ICommandService)],exports.SharedController);const pt=u.createIdentifier("univer.ui.ui-controller");u.runOnLifecycle(u.LifecycleStages.Ready,pt);const Y6="UNIVER_UI_CONFIG_KEY";var N1={},q6={exports:{}},X6={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(X6);var V1=X6.exports;(function(e){var t=V1.default;function n(i){if(typeof WeakMap!="function")return null;var o=new WeakMap,a=new WeakMap;return(n=function(h){return h?a:o})(i)}function r(i,o){if(!o&&i&&i.__esModule)return i;if(i===null||t(i)!="object"&&typeof i!="function")return{default:i};var a=n(o);if(a&&a.has(i))return a.get(i);var c={__proto__:null},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in i)if(v!=="default"&&{}.hasOwnProperty.call(i,v)){var p=h?Object.getOwnPropertyDescriptor(i,v):null;p&&(p.get||p.set)?Object.defineProperty(c,v,p):c[v]=i[v]}return c.default=i,a&&a.set(i,c),c}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(q6);var $s=q6.exports,Q6={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Q6);var ks=Q6.exports,J6={exports:{}};(function(e){var t=V1.default;function n(){e.exports=n=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,c=Object.defineProperty||function(T,M,I){T[M]=I.value},h=typeof Symbol=="function"?Symbol:{},v=h.iterator||"@@iterator",p=h.asyncIterator||"@@asyncIterator",f=h.toStringTag||"@@toStringTag";function m(T,M,I){return Object.defineProperty(T,M,{value:I,enumerable:!0,configurable:!0,writable:!0}),T[M]}try{m({},"")}catch{m=function(I,B,G){return I[B]=G}}function _(T,M,I,B){var G=M&&M.prototype instanceof J?M:J,W=Object.create(G.prototype),q=new oe(B||[]);return c(W,"_invoke",{value:ie(T,I,q)}),W}function L(T,M,I){try{return{type:"normal",arg:T.call(M,I)}}catch(B){return{type:"throw",arg:B}}}i.wrap=_;var x="suspendedStart",w="suspendedYield",j="executing",Z="completed",U={};function J(){}function E(){}function D(){}var k={};m(k,v,function(){return this});var $=Object.getPrototypeOf,F=$&&$($(he([])));F&&F!==o&&a.call(F,v)&&(k=F);var z=D.prototype=J.prototype=Object.create(k);function Y(T){["next","throw","return"].forEach(function(M){m(T,M,function(I){return this._invoke(M,I)})})}function ne(T,M){function I(G,W,q,se){var _e=L(T[G],T,W);if(_e.type!=="throw"){var Me=_e.arg,Ee=Me.value;return Ee&&t(Ee)=="object"&&a.call(Ee,"__await")?M.resolve(Ee.__await).then(function(fe){I("next",fe,q,se)},function(fe){I("throw",fe,q,se)}):M.resolve(Ee).then(function(fe){Me.value=fe,q(Me)},function(fe){return I("throw",fe,q,se)})}se(_e.arg)}var B;c(this,"_invoke",{value:function(W,q){function se(){return new M(function(_e,Me){I(W,q,_e,Me)})}return B=B?B.then(se,se):se()}})}function ie(T,M,I){var B=x;return function(G,W){if(B===j)throw Error("Generator is already running");if(B===Z){if(G==="throw")throw W;return{value:r,done:!0}}for(I.method=G,I.arg=W;;){var q=I.delegate;if(q){var se=ce(q,I);if(se){if(se===U)continue;return se}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(B===x)throw B=Z,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);B=j;var _e=L(T,M,I);if(_e.type==="normal"){if(B=I.done?Z:w,_e.arg===U)continue;return{value:_e.arg,done:I.done}}_e.type==="throw"&&(B=Z,I.method="throw",I.arg=_e.arg)}}}function ce(T,M){var I=M.method,B=T.iterator[I];if(B===r)return M.delegate=null,I==="throw"&&T.iterator.return&&(M.method="return",M.arg=r,ce(T,M),M.method==="throw")||I!=="return"&&(M.method="throw",M.arg=new TypeError("The iterator does not provide a '"+I+"' method")),U;var G=L(B,T.iterator,M.arg);if(G.type==="throw")return M.method="throw",M.arg=G.arg,M.delegate=null,U;var W=G.arg;return W?W.done?(M[T.resultName]=W.value,M.next=T.nextLoc,M.method!=="return"&&(M.method="next",M.arg=r),M.delegate=null,U):W:(M.method="throw",M.arg=new TypeError("iterator result is not an object"),M.delegate=null,U)}function ae(T){var M={tryLoc:T[0]};1 in T&&(M.catchLoc=T[1]),2 in T&&(M.finallyLoc=T[2],M.afterLoc=T[3]),this.tryEntries.push(M)}function Q(T){var M=T.completion||{};M.type="normal",delete M.arg,T.completion=M}function oe(T){this.tryEntries=[{tryLoc:"root"}],T.forEach(ae,this),this.reset(!0)}function he(T){if(T||T===""){var M=T[v];if(M)return M.call(T);if(typeof T.next=="function")return T;if(!isNaN(T.length)){var I=-1,B=function G(){for(;++I<T.length;)if(a.call(T,I))return G.value=T[I],G.done=!1,G;return G.value=r,G.done=!0,G};return B.next=B}}throw new TypeError(t(T)+" is not iterable")}return E.prototype=D,c(z,"constructor",{value:D,configurable:!0}),c(D,"constructor",{value:E,configurable:!0}),E.displayName=m(D,f,"GeneratorFunction"),i.isGeneratorFunction=function(T){var M=typeof T=="function"&&T.constructor;return!!M&&(M===E||(M.displayName||M.name)==="GeneratorFunction")},i.mark=function(T){return Object.setPrototypeOf?Object.setPrototypeOf(T,D):(T.__proto__=D,m(T,f,"GeneratorFunction")),T.prototype=Object.create(z),T},i.awrap=function(T){return{__await:T}},Y(ne.prototype),m(ne.prototype,p,function(){return this}),i.AsyncIterator=ne,i.async=function(T,M,I,B,G){G===void 0&&(G=Promise);var W=new ne(_(T,M,I,B),G);return i.isGeneratorFunction(M)?W:W.next().then(function(q){return q.done?q.value:W.next()})},Y(z),m(z,f,"Generator"),m(z,v,function(){return this}),m(z,"toString",function(){return"[object Generator]"}),i.keys=function(T){var M=Object(T),I=[];for(var B in M)I.push(B);return I.reverse(),function G(){for(;I.length;){var W=I.pop();if(W in M)return G.value=W,G.done=!1,G}return G.done=!0,G}},i.values=he,oe.prototype={constructor:oe,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Q),!M)for(var I in this)I.charAt(0)==="t"&&a.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=r)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var I=this;function B(Me,Ee){return q.type="throw",q.arg=M,I.next=Me,Ee&&(I.method="next",I.arg=r),!!Ee}for(var G=this.tryEntries.length-1;G>=0;--G){var W=this.tryEntries[G],q=W.completion;if(W.tryLoc==="root")return B("end");if(W.tryLoc<=this.prev){var se=a.call(W,"catchLoc"),_e=a.call(W,"finallyLoc");if(se&&_e){if(this.prev<W.catchLoc)return B(W.catchLoc,!0);if(this.prev<W.finallyLoc)return B(W.finallyLoc)}else if(se){if(this.prev<W.catchLoc)return B(W.catchLoc,!0)}else{if(!_e)throw Error("try statement without catch or finally");if(this.prev<W.finallyLoc)return B(W.finallyLoc)}}}},abrupt:function(M,I){for(var B=this.tryEntries.length-1;B>=0;--B){var G=this.tryEntries[B];if(G.tryLoc<=this.prev&&a.call(G,"finallyLoc")&&this.prev<G.finallyLoc){var W=G;break}}W&&(M==="break"||M==="continue")&&W.tryLoc<=I&&I<=W.finallyLoc&&(W=null);var q=W?W.completion:{};return q.type=M,q.arg=I,W?(this.method="next",this.next=W.finallyLoc,U):this.complete(q)},complete:function(M,I){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&I&&(this.next=I),U},finish:function(M){for(var I=this.tryEntries.length-1;I>=0;--I){var B=this.tryEntries[I];if(B.finallyLoc===M)return this.complete(B.completion,B.afterLoc),Q(B),U}},catch:function(M){for(var I=this.tryEntries.length-1;I>=0;--I){var B=this.tryEntries[I];if(B.tryLoc===M){var G=B.completion;if(G.type==="throw"){var W=G.arg;Q(B)}return W}}throw Error("illegal catch attempt")},delegateYield:function(M,I,B){return this.delegate={iterator:he(M),resultName:I,nextLoc:B},this.method==="next"&&(this.arg=r),U}},i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(J6);var Bs=J6.exports,K6={exports:{}};(function(e){function t(r,i,o,a,c,h,v){try{var p=r[h](v),f=p.value}catch(m){return void o(m)}p.done?i(f):Promise.resolve(f).then(a,c)}function n(r){return function(){var i=this,o=arguments;return new Promise(function(a,c){var h=r.apply(i,o);function v(f){t(h,a,c,v,p,"next",f)}function p(f){t(h,a,c,v,p,"throw",f)}v(void 0)})}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(K6);var Us=K6.exports,ei={exports:{}},ti={exports:{}},ni={exports:{}},ri={exports:{}};(function(e){var t=V1.default;function n(r,i){if(t(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,i||"default");if(t(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ri);var Fs=ri.exports;(function(e){var t=V1.default,n=Fs;function r(i){var o=n(i,"string");return t(o)=="symbol"?o:o+""}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ni);var zs=ni.exports;(function(e){var t=zs;function n(r,i,o){return(i=t(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ti);var Zs=ti.exports;(function(e){var t=Zs;function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);o&&(c=c.filter(function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable})),a.push.apply(a,c)}return a}function r(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?n(Object(a),!0).forEach(function(c){t(i,c,a[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(a,c))})}return i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ei);var Ws=ei.exports,Gs=$s.default,vt=ks.default;Object.defineProperty(N1,"__esModule",{value:!0});N1._r=r2;N1._u=s2;var K1=N1.render=i2,ii=N1.unmount=l2,ot=vt(Bs),oi=vt(Us),Ys=vt(V1),qs=vt(Ws),Xs=Gs(H1),A1=(0,qs.default)({},Xs),Qs=A1.version,Js=A1.render,Ks=A1.unmountComponentAtNode,gt;try{var e2=Number((Qs||"").split(".")[0]);e2>=18&&(gt=A1.createRoot)}catch{}function or(e){var t=A1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&(0,Ys.default)(t)==="object"&&(t.usingClientEntryPoint=e)}var at="__rc_react_root__";function t2(e,t){or(!0);var n=t[at]||gt(t);or(!1),n.render(e),t[at]=n}function n2(e,t){Js(e,t)}function r2(e,t){}function i2(e,t){if(gt){t2(e,t);return}n2(e,t)}function o2(e){return Kt.apply(this,arguments)}function Kt(){return Kt=(0,oi.default)((0,ot.default)().mark(function e(t){return(0,ot.default)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[at])===null||i===void 0||i.unmount(),delete t[at]}));case 1:case"end":return r.stop()}},e)})),Kt.apply(this,arguments)}function a2(e){Ks(e)}function s2(e){}function l2(e){return en.apply(this,arguments)}function en(){return en=(0,oi.default)((0,ot.default)().mark(function e(t){return(0,ot.default)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(gt===void 0){r.next=2;break}return r.abrupt("return",o2(t));case 2:a2(t);case 3:case"end":return r.stop()}},e)})),en.apply(this,arguments)}var we=(e=>(e.GLOBAL="global",e.HEADER="header",e.HEADER_MENU="header-menu",e.CONTENT="content",e.FOOTER="footer",e.LEFT_SIDEBAR="left-sidebar",e.FLOATING="floating",e))(we||{});const n1=u.createIdentifier("ui.parts.service");class bn extends u.Disposable{constructor(){super(...arguments);A(this,"_componentsByPart",new Map);A(this,"_componentRegistered$",new re.Subject);A(this,"componentRegistered$",this._componentRegistered$.asObservable())}dispose(){super.dispose(),this._componentRegistered$.complete()}registerComponent(n,r){const i=r(),o=(this._componentsByPart.get(n)||this._componentsByPart.set(n,new Set).get(n)).add(i);return this._componentRegistered$.next(n),u.toDisposable(()=>{o.delete(i),o.size===0&&this._componentsByPart.delete(n),this._componentRegistered$.next(n)})}getComponents(n){return new Set([...this._componentsByPart.get(n)||new Set])}}const mt=u.createIdentifier("ui.popup.service");class Sn extends u.Disposable{constructor(){super(...arguments);A(this,"_popupMap",new Map);A(this,"_popups$",new re.BehaviorSubject([]));A(this,"popups$",this._popups$.asObservable())}get popups(){return Array.from(this._popupMap.entries())}_update(){this._popups$.next(Array.from(this._popupMap.entries()))}dispose(){super.dispose(),this._popups$.next([]),this._popups$.complete(),this._popupMap.clear()}addPopup(n){const r=u.Tools.generateRandomId();return this._popupMap.set(r,n),this._update(),r}removePopup(n){this._popupMap.delete(n)&&this._update()}removeAll(){this._popupMap.clear(),this._update()}}const c2=({popup:e,children:t})=>{const n=Oe(e.anchorRect$,e.anchorRect),r=Oe(e.excludeRects$,e.excludeRects),{bottom:i,left:o,right:a,top:c}=n,{offset:h}=e,v=s.useMemo(()=>{const[p=0,f=0]=h!=null?h:[];return{left:o-p,right:a+p,top:c-f,bottom:i+f}},[i,o,a,c,h]);return g.jsx(ue.RectPopup,{anchorRect:v,direction:e.direction,onClickOutside:e.onClickOutside,excludeOutside:e.excludeOutside,excludeRects:r,closeOnSelfTarget:e.closeOnSelfTarget,children:t})};function _n(){const e=u.useDependency(mt),t=u.useDependency(qe);return Oe(e.popups$,void 0,!0).map(r=>{const[i,o]=r,a=t.get(o.componentKey);return g.jsx(c2,{popup:o,children:a?g.jsx(a,{popup:o}):null},i)})}class Ct{constructor(){A(this,"_domLayerMap",new Map);A(this,"_domLayers$",new re.BehaviorSubject([]));A(this,"domLayers$",this._domLayers$.asObservable())}get domLayers(){return Array.from(this._domLayerMap.entries())}_notice(){this._domLayers$.next(Array.from(this._domLayerMap.entries()))}addFloatDom(t){this._domLayerMap.set(t.id,t),this._notice()}removeFloatDom(t){this._domLayerMap.delete(t)&&this._notice()}removeAll(){this._domLayerMap.clear(),this._notice()}}const u2="univer-float-dom-wrapper",f2="univer-float-dom",ar={floatDomWrapper:u2,floatDom:f2},d2=s.memo(e=>{const{layer:t,id:n}=e,r=u.useDependency(qe),i=Oe(t.position$),o=typeof t.componentKey=="string"?r.get(t.componentKey):t.componentKey,a={data:t.data,...t.props};return i?g.jsx("div",{className:ar.floatDomWrapper,style:{position:"absolute",top:i.startY,left:i.startX,width:Math.max(i.endX-i.startX-2,0),height:Math.max(i.endY-i.startY-2,0),transform:`rotate(${i.rotate}deg)`,overflow:"hidden"},onPointerMove:c=>{t.onPointerMove(c.nativeEvent)},onPointerDown:c=>{t.onPointerDown(c.nativeEvent)},onPointerUp:c=>{t.onPointerUp(c.nativeEvent)},onWheel:c=>{t.onWheel(c.nativeEvent)},children:g.jsx("div",{id:n,className:ar.floatDom,style:{width:i.width,height:i.height,position:"absolute",...i.absolute.left?{left:0}:{right:0},...i.absolute.top?{top:0}:{bottom:0}},children:o?g.jsx(o,{...a}):null})}):null}),yn=()=>{const e=u.useDependency(Ct),t=Oe(e.domLayers$);return g.jsx(g.Fragment,{children:t==null?void 0:t.map(n=>g.jsx(d2,{id:n[0],layer:n[1]},n[0]))})},w1=u.createIdentifier("ui.message.service");function Be(e){const{components:t,fallback:n,sharedProps:r}=e;return!t||t.size===0?n!=null?n:null:Array.from(t.values()).map((i,o)=>{var a;return s.createElement(i,{key:`${(a=i.displayName)!=null?a:o}`,...r})})}function Fe(e,t){var o;const n=(o=t==null?void 0:t.get(n1))!=null?o:u.useDependency(n1),r=s.useRef(0),i=Oe(()=>n.componentRegistered$.pipe(re.filter(a=>a===e),re.map(()=>r.current+=1),re.startWith(r.current+=1)),void 0,void 0,[n,e]);return s.useMemo(()=>n.getComponents(e),[i])}const h2="univer-menu-item-no-hover",p2="univer-menu-item-active",v2="univer-menu-item-activated",g2="univer-menu-item-content",m2="univer-menu-item-selectable",C2="univer-menu-item-selectable-icon",b2="univer-menu-item-more-icon",Qe={menuItemNoHover:h2,menuItemActive:p2,menuItemActivated:v2,menuItemContent:g2,menuItemSelectable:m2,menuItemSelectableIcon:C2,menuItemMoreIcon:b2};function ai(e){const{menuType:t,onOptionSelect:n}=e,r=u.useDependency(a1);if(!t)return null;if(Array.isArray(t)){const a=t.map(c=>r.getMenuItems(c)).map(c=>c.reduce((h,v)=>{var p,f;return v.group?(h[v.group]=(p=h[v.group])!=null?p:[],h[v.group].push(v)):(h[c1.CONTEXT_MENU_OTHERS]=(f=h[c1.CONTEXT_MENU_OTHERS])!=null?f:[],h[c1.CONTEXT_MENU_OTHERS].push(v)),h},{}));return g.jsx(g.Fragment,{children:a.map(c=>Object.keys(c).map(h=>g.jsx(ue.MenuItemGroup,{eventKey:h,children:c[h].map(v=>g.jsx(sr,{menuItem:v,onClick:p=>{n==null||n({value:"",label:v.id,...p})}},v.id))},h)))})}return r.getMenuItems(t).map(o=>g.jsx(sr,{menuItem:o,onClick:a=>{n==null||n({value:"",label:o.id,...a})}},o.id))}function si(e){var o;const{options:t,value:n,onOptionSelect:r,parentKey:i}=e;return(o=t==null?void 0:t.map((a,c)=>{var m,_,L;const h=`${i}-${(m=a.label)!=null?m:a.id}-${c}`,v=x=>{r==null||r({value:x,label:a==null?void 0:a.label})},p=()=>{typeof a.value>"u"||r==null||r({...a})},f=Ue({[Qe.menuItemNoHover]:typeof a.label!="string"&&!((_=a.label)!=null&&_.hoverable)});return g.jsx(ue.MenuItem,{disabled:a.disabled,eventKey:h,className:f,onClick:p,children:g.jsxs("span",{className:Ue(Qe.menuItemContent,{[Qe.menuItemSelectable]:!(typeof a.label!="string"&&!((L=a.label)!=null&&L.hoverable))}),children:[typeof n<"u"&&String(n)===String(a.value)&&g.jsx("span",{className:Qe.menuItemSelectableIcon,children:g.jsx(e3,{style:{color:"rgb(var(--success-color))"}})}),g.jsx(ze,{value$:a.value$,value:a.value,label:a.label,icon:a.icon,onChange:v})]})},h)}))!=null?o:g.jsx(g.Fragment,{})}const st=e=>{const{overViewport:t,...n}=e,[r,i]=s.useState(),o=u.useDependency(o1);return B6(t==="scroll"?r:null,o.rootContainerElement),g.jsxs(ue.Menu,{ref:a=>(a==null?void 0:a.list)&&i(a.list),selectable:!1,children:[g.jsx(si,{...n}),g.jsx(ai,{...n})]})};function sr({menuItem:e,onClick:t}){const n=u.useDependency(a1),r=Oe(e.disabled$,!1),i=Oe(e.activated$,!1),o=Oe(e.hidden$,!1),a=Oe(e.value$),c=e,h=Oe(re.isObservable(c.selections)?c.selections:void 0),[v,p]=s.useState(a);if(o)return null;const f=w=>{const j=u.isRealNum(w)&&typeof w=="string"?Number.parseInt(w):w;p(j)},m=()=>{const w=e,{title:j,label:Z}=w;return g.jsx(ue.MenuItem,{eventKey:w.id,disabled:r,className:Ue({[Qe.menuItemActivated]:i}),onClick:()=>{t({value:v,id:w.id})},children:g.jsx("span",{className:Qe.menuItemContent,children:g.jsx(ze,{value:a,title:j,label:Z,icon:w.icon,onChange:f})})},w.id)},_=()=>{var j;const w=(j=h!=null?h:c.selections)!=null?j:[];return w.length>0?g.jsx(ue.SubMenu,{eventKey:c.id,popupOffset:[18,0],title:g.jsxs("span",{className:Qe.menuItemContent,children:[g.jsx(ze,{title:c.title,value:v,onChange:f,icon:c.icon,label:c.label}),c.shortcut&&` (${c.shortcut})`]}),expandIcon:g.jsx(Qt,{className:Qe.menuItemMoreIcon}),children:w.length>0&&g.jsx(si,{parentKey:c.id,menuType:c.id,options:w,onOptionSelect:Z=>{t({value:Z.value,id:c.id})}})},c.id):g.jsx(ue.MenuItem,{eventKey:c.id,children:g.jsxs("span",{className:Qe.menuItemContent,children:[g.jsx(ze,{title:c.title,value:v,icon:c.icon,label:c.label,onChange:f}),c.shortcut&&` (${c.shortcut})`]})},c.id)},L=e.id?n.getMenuItems(e.id):[],x=()=>{const w=e;return g.jsx(ue.SubMenu,{eventKey:w.id,popupOffset:[18,0],title:g.jsx("span",{className:Qe.menuItemContent,children:g.jsx(ze,{title:w.title,icon:w.icon,label:w.label,onChange:f})}),expandIcon:g.jsx(Qt,{className:Qe.menuItemMoreIcon}),children:L.length&&g.jsx(ai,{menuType:w.id,parentKey:w.id,onOptionSelect:t})},w.id)};return g.jsxs(g.Fragment,{children:[e.type===ke.SELECTOR&&_(),e.type===ke.SUBITEMS&&x(),e.type===ke.BUTTON&&m()]})}const j1=u.createIdentifier("ui.contextmenu.service");class Ln extends u.Disposable{constructor(){super(...arguments);A(this,"_currentHandler",null);A(this,"disabled",!1)}get visible(){var n,r;return(r=(n=this._currentHandler)==null?void 0:n.visible)!=null?r:!1}disable(){this.disabled=!0}enable(){this.disabled=!1}triggerContextMenu(n,r){var i;n.stopPropagation(),!this.disabled&&((i=this._currentHandler)==null||i.handleContextMenu(n,r))}hideContextMenu(){var n;(n=this._currentHandler)==null||n.hideContextMenu()}registerContextMenuHandler(n){if(this._currentHandler)throw new Error("There is already a context menu handler!");return this._currentHandler=n,u.toDisposable(()=>this._currentHandler=null)}}function li(){const e=s.useRef(null),[t,n]=s.useState(!1),[r,i]=s.useState(""),[o,a]=s.useState([0,0]),c=s.useRef(t),h=u.useDependency(j1),v=u.useDependency(u.ICommandService),p=u.useInjector();c.current=t,s.useEffect(()=>{const _=h.registerContextMenuHandler({handleContextMenu:f,hideContextMenu(){n(!1)},get visible(){return c.current}});function L(x){e.current&&!e.current.contains(x.target)&&m()}return document.addEventListener("pointerdown",L),document.addEventListener("wheel",m),()=>{document.removeEventListener("pointerdown",L),document.removeEventListener("wheel",m),_.dispose()}},[h]);function f(_,L){i(L),a([_.clientX,_.clientY]),n(!0)}function m(){n(!1)}return g.jsx(ue.Popup,{visible:t,offset:o,children:g.jsx("section",{ref:e,children:r&&g.jsx(st,{menuType:[r],onOptionSelect:_=>{const{label:L,value:x}=_;v&&v.executeCommand(L,{value:x}),p.get(v1.ITextSelectionRenderManager).focus(),n(!1)}})})})}const S2="univer-toolbar-btn",_2="univer-toolbar-btn-active",lr={toolbarBtn:S2,toolbarBtnActive:_2};function ci(e){const{children:t,className:n,style:r,disabled:i=!1,active:o=!1,onClick:a,onDoubleClick:c,...h}=e,v=m=>{if(i){m.preventDefault();return}a&&a(m)},p=m=>{if(i){m.preventDefault();return}c&&c(m)},f=Ue(lr.toolbarBtn,{[`${lr.toolbarBtn}-active`]:o},n);return g.jsx("button",{className:f,style:r,disabled:i,onClick:v,onDoubleClick:p,...h,children:t})}const y2="univer-headerbar",L2="univer-header-menu",E2="univer-menubar",w2="univer-menubar-item",M2="univer-menubar-item-active",R2="univer-toolbar",x2="univer-toolbar-container",I2="univer-toolbar-more",O2="univer-toolbar-more-container",H2="univer-toolbar-group",T2="univer-toolbar-item-select-button",D2="univer-toolbar-item-select-button-disabled",N2="univer-toolbar-item-select-button-activated",V2="univer-toolbar-item-select-button-label",A2="univer-toolbar-item-select-button-arrow",j2="univer-toolbar-item-select",P2="univer-toolbar-item-select-disabled",$2="univer-toolbar-item-select-activated",k2="univer-toolbar-item-select-arrow",B2="univer-toolbar-item-select-arrow-disabled",U2="univer-toolbar-item-select-arrow-activated",Le={headerbar:y2,headerMenu:L2,menubar:E2,menubarItem:w2,menubarItemActive:M2,toolbar:R2,toolbarContainer:x2,toolbarMore:I2,toolbarMoreContainer:O2,toolbarGroup:H2,toolbarItemSelectButton:T2,toolbarItemSelectButtonDisabled:D2,toolbarItemSelectButtonActivated:N2,toolbarItemSelectButtonLabel:V2,toolbarItemSelectButtonArrow:A2,toolbarItemSelect:j2,toolbarItemSelectDisabled:P2,toolbarItemSelectActivated:$2,toolbarItemSelectArrow:k2,toolbarItemSelectArrowDisabled:B2,toolbarItemSelectArrowActivated:U2};function ui(e){const t=u.useDependency(a1),[n,r]=s.useState(Ye.TOOLBAR_START),[i,o]=s.useState([]),[a,c]=s.useState([]);s.useEffect(()=>{var m,_;const v=(_=(m=i.find(L=>L.name===n))==null?void 0:m.menuItems)!=null?_:[],f=re.combineLatest(v.map(L=>{var x;return(x=L.hidden$)!=null?x:new re.Observable(w=>w.next(!1))})).pipe(re.map(L=>v.filter((x,w)=>!L[w]))).subscribe(L=>c(L));return()=>f.unsubscribe()},[i,n]),s.useEffect(()=>{const v=t.menuChanged$.subscribe(()=>{const p=[];for(const f of e){const m=t.getMenuItems(f);m.length&&p.push({name:f,menuItems:m})}o(p)});return()=>v.unsubscribe()},[t,n,e]);const h=s.useMemo(()=>{var v,p;return(p=(v=i.find(f=>f.name===n))==null?void 0:v.menuItems.reduce((f,m)=>{var L;const _=(L=m.group)!=null?L:c1.TOOLBAR_OTHERS;return f[_]||(f[_]=[]),f[_].push(m),f},{}))!=null?p:{}},[i,n]);return{setCategory:r,category:n,visibleItems:a,groups:i,groupsByKey:h}}function fi(e){const{disabled$:t,hidden$:n,activated$:r,value$:i}=e,[o,a]=s.useState(),[c,h]=s.useState(!1),[v,p]=s.useState(!1),[f,m]=s.useState(!1);return s.useEffect(()=>{const _=[];return t&&_.push(t.subscribe(L=>h(L))),n&&_.push(n.subscribe(L=>m(L))),r&&_.push(r.subscribe(L=>p(L))),i&&_.push(i.subscribe(L=>a(L))),()=>_.forEach(L=>L.unsubscribe())},[r,t,n,i]),{disabled:c,value:o,activated:v,hidden:f}}function di(e){const t=s.useRef({}),n=s.useRef(null),[r,i]=s.useState([]);return s.useEffect(()=>{function o(){var _,L;const h=(L=(_=n.current)==null?void 0:_.clientWidth)!=null?L:0;let v=0;if(n.current){const x=Number.parseInt(getComputedStyle(n.current.firstElementChild).gap,10);v=Number.isNaN(x)?0:x}const p=Object.entries(t.current).filter(([x,w])=>w.el&&w.key&&e.find(j=>j.id===w.key)).map(([x,w])=>{var j;return{key:w.key,width:((j=w.el)==null?void 0:j.clientWidth)+v}}),f=[];let m=182;for(const x of p)m+=x.width,m>h&&f.push(x.key);i(f)}o();const a=new ResizeObserver(()=>o()),c=n.current;return c&&a.observe(c),()=>{c&&a.unobserve(c)}},[e]),{toolbarRef:n,toolbarItemRefs:t,collapsedId:r}}const Gt=s.forwardRef((e,t)=>{const n=u.useDependency(u.LocaleService),r=u.useDependency(u.ICommandService),i=u.useDependency(o1),o=u.useDependency(qe),[a,c]=s.useState(!1),[h,v]=s.useState(!1),{value:p,hidden:f,disabled:m,activated:_}=fi(e),L=(Q,oe)=>{i.focus(),r.executeCommand(Q,oe)};function x(Q){c(Q)}function w(Q){v(Q),Q||c(!1)}const{tooltip:j,shortcut:Z,icon:U,title:J,label:E,id:D}=e,k=n.t(j!=null?j:"")+(Z?` (${Z})`:""),{selections:$}=e,F=s.useMemo(()=>re.isObservable($)?$:new re.Observable(Q=>{Q.next($)}),[$]),z=Oe(F),Y=s.useMemo(()=>re.isObservable(U)?U:new re.Observable(Q=>{var he,T;const oe=(T=(he=z==null?void 0:z.find(M=>M.value===p))==null?void 0:he.icon)!=null?T:U;Q.next(oe)}),[U,z,p]),ne=Oe(Y,void 0,!0);function ie(Q){function oe(M){if(m)return;let I=D;const B=M;M.id&&(I=M.id),L(I,B)}function he(M){if(m)return;L(D,{value:M})}function T(){m||Q===ke.BUTTON_SELECTOR&&L(D,{value:p})}return Q===ke.BUTTON_SELECTOR?g.jsxs("div",{className:Ue(Le.toolbarItemSelectButton,{[Le.toolbarItemSelectButtonDisabled]:m,[Le.toolbarItemSelectButtonActivated]:_}),"data-disabled":m,children:[g.jsx("div",{className:Le.toolbarItemSelectButtonLabel,onClick:T,children:g.jsx(ze,{icon:ne,title:J,value:p,label:E,onChange:he})}),g.jsx(ue.Dropdown,{overlay:g.jsx(st,{overViewport:"scroll",menuType:D,options:z,onOptionSelect:oe,value:p}),onVisibleChange:w,disabled:m,children:g.jsx("div",{className:Ue(Le.toolbarItemSelectButtonArrow,{[Le.toolbarItemSelectButtonArrowDisabled]:m,[Le.toolbarItemSelectButtonArrowActivated]:_}),"data-disabled":m,children:g.jsx(it,{})})})]}):g.jsx(ue.Dropdown,{overlay:g.jsx(st,{overViewport:"scroll",menuType:D,options:z,onOptionSelect:oe,value:p}),onVisibleChange:w,disabled:m,children:g.jsxs("div",{className:Ue(Le.toolbarItemSelect,{[Le.toolbarItemSelectDisabled]:m,[Le.toolbarItemSelectActivated]:_}),children:[g.jsx(ze,{icon:ne,title:J,value:p,label:E,onChange:he}),g.jsx("div",{className:Ue(Le.toolbarItemSelectArrow,{[Le.toolbarItemSelectArrowDisabled]:m}),children:g.jsx(it,{})})]})})}function ce(){var oe;const Q=o.get(typeof E=="string"?E:(oe=E==null?void 0:E.name)!=null?oe:"");return g.jsx(ci,{className:Le.toolbarItemTextButton,active:_,disabled:m,onClick:()=>L(e.id),onDoubleClick:()=>e.subId&&L(e.subId),children:Q?g.jsx(ze,{title:J,value:p,label:E}):g.jsx(ze,{icon:U})})}function ae(){switch(e.type){case ke.BUTTON_SELECTOR:case ke.SELECTOR:case ke.SUBITEMS:return ie(e.type);case ke.BUTTON:default:return ce()}}return f?null:g.jsx(ue.Tooltip,{ref:t,visible:h?!1:a,title:k,placement:"bottom",onVisibleChange:x,children:g.jsx("div",{children:ae()})})}),F2=[Ye.TOOLBAR_START,Ye.TOOLBAR_INSERT,Ye.TOOLBAR_FORMULAS,Ye.TOOLBAR_DATA,Ye.TOOLBAR_VIEW,Ye.TOOLBAR_OTHERS];function hi(e){const{headerMenuComponents:t}=e,n=u.useDependency(u.LocaleService),{setCategory:r,visibleItems:i,groups:o,category:a,groupsByKey:c}=ui(F2),{toolbarItemRefs:h,toolbarRef:v,collapsedId:p}=di(i),f=s.useMemo(()=>t&&t.size>0||o.length>1,[t,o]);return g.jsxs(g.Fragment,{children:[f?g.jsxs("header",{className:Le.headerbar,children:[g.jsx("div",{className:Le.menubar,children:o.length>1&&o.map((m,_)=>g.jsx("a",{className:Ue(Le.menubarItem,{[Le.menubarItemActive]:m.name===a}),onClick:()=>{r(m.name)},children:n.t(m.name)},_))}),g.jsx("div",{className:Le.headerMenu,children:g.jsx(Be,{components:t})})]}):null,g.jsx("div",{ref:v,className:Le.toolbar,children:g.jsxs("div",{className:Le.toolbarContainer,children:[Object.entries(c).filter(([m,_])=>_.filter(x=>!p.includes(x.id)).length).map(([m,_])=>g.jsx("div",{className:Le.toolbarGroup,children:_.map(L=>!p.includes(L.id)&&g.jsx(Gt,{...L},L.id))},m)),p.length>0&&g.jsx(ue.Tooltip,{title:n.t("more"),placement:"bottom",children:g.jsx("div",{children:g.jsx(ue.Dropdown,{forceRender:!0,className:Le.toolbarMore,overlay:g.jsx("div",{className:Le.toolbarMoreContainer,onClick:m=>m.stopPropagation(),children:Object.entries(c).map(([m,_])=>g.jsx("div",{className:Le.toolbarGroup,children:_.map(L=>p.includes(L.id)&&g.jsx(Gt,{...L},L.id))},m))}),children:g.jsx("span",{children:g.jsx(ci,{className:Le.toolbarItemTextButton,children:g.jsx(q3,{})})})})})})]})}),g.jsx("div",{className:Le.toolbarContainer,style:{position:"absolute",top:-9999,left:-9999,opacity:0},children:Object.entries(c).map(([m,_])=>g.jsx("div",{className:Le.toolbarGroup,children:_.map(L=>g.jsx(Gt,{ref:x=>{h.current[L.id]={el:x==null?void 0:x.nativeElement,key:L.id}},...L},L.id))},m))})]})}const P1=u.createIdentifier("univer.sidebar-service"),z2="univer-sidebar",Z2="univer-sidebar-open",W2="univer-sidebar-container",G2="univer-sidebar-header",Y2="univer-sidebar-header-close",q2="univer-sidebar-body",X2="univer-sidebar-footer",d1={sidebar:z2,sidebarOpen:Z2,sidebarContainer:W2,sidebarHeader:G2,sidebarHeaderClose:Y2,sidebarBody:q2,sidebarFooter:X2};function En(){const e=u.useDependency(P1),t=Oe(e.sidebarOptions$),n=s.useRef(null),r=s.useMemo(()=>{if(!t)return null;const c={...t};for(const h of["children","header","footer"]){const v=h;if(t[v]){const p=t[v];p&&(c[v]=g.jsx(ze,{...p}))}}return c},[t]);s.useEffect(()=>{const c=v=>{e.scrollEvent$.next(v)},h=n.current;return h&&h.addEventListener("scroll",c),()=>{h==null||h.removeEventListener("scroll",c)}},[e]);const i=Ue(d1.sidebar,{[d1.sidebarOpen]:r==null?void 0:r.visible}),o=s.useMemo(()=>r!=null&&r.visible?typeof r.width=="number"?`${r.width}px`:r.width:0,[r]);function a(){var h;const c={...t,visible:!1};e.sidebarOptions$.next(c),(h=c==null?void 0:c.onClose)==null||h.call(c)}return g.jsx("section",{className:i,style:{width:o},children:g.jsxs("section",{className:d1.sidebarContainer,ref:n,children:[g.jsxs("header",{className:d1.sidebarHeader,children:[r==null?void 0:r.header,g.jsx("a",{className:d1.sidebarHeaderClose,onClick:a,children:g.jsx(D1,{})})]}),g.jsx("section",{className:d1.sidebarBody,children:r==null?void 0:r.children}),(r==null?void 0:r.footer)&&g.jsx("footer",{className:d1.sidebarFooter,children:r.footer})]})})}const bt=u.createIdentifier("univer.zen-zone-service"),Q2="univer-zen-zone",J2="univer-zen-zone-open",K2="univer-zen-zone-close",Yt={zenZone:Q2,zenZoneOpen:J2,zenZoneClose:K2};function wn(){const e=u.useDependency(bt),[t,n]=s.useState(!1),[r,i]=s.useState(),o=u.useDependency(qe);s.useEffect(()=>{const h=[e.visible$.subscribe(v=>{n(v)}),e.componentKey$.subscribe(v=>{i(v)})];return()=>{h.forEach(v=>{v.unsubscribe()})}},[]);const a=Ue(Yt.zenZone,t?Yt.zenZoneOpen:Yt.zenZoneClose),c=s.useMemo(()=>{const h=o.get(r!=null?r:"");if(h)return h},[r]);return g.jsx("section",{className:a,children:c&&g.jsx(c,{})})}const St=u.createIdentifier("univer.global-zone-service"),e4="univer-global-zone",t4="univer-global-zone-open",n4="univer-global-zone-close",cr={globalZone:e4,globalZoneOpen:t4,globalZoneClose:n4};function pi(){const e=u.useDependency(St),[t,n]=s.useState(!1),r=Oe(e.componentKey$,e.componentKey),i=u.useDependency(qe),o=Ue(cr.globalZone,cr.globalZoneOpen),a=s.useMemo(()=>{const c=i.get(r!=null?r:"");if(c)return c},[r,i]);return s.useEffect(()=>{const c=e.visible$.subscribe(h=>{n(h)});return()=>{c.unsubscribe()}},[e.visible$]),t?g.jsx("section",{className:o,children:a&&g.jsx(a,{})}):null}const Mn=new Set([pi]),r4="univer-workbench-layout",i4="univer-workbench-container",o4="univer-workbench-container-header",a4="univer-workbench-container-wrapper",s4="univer-workbench-container-content",l4="univer-workbench-container-canvas",c4="univer-workbench-container-left-sidebar",u4="univer-workbench-container-sidebar",r1={workbenchLayout:r4,workbenchContainer:i4,workbenchContainerHeader:o4,workbenchContainerWrapper:a4,workbenchContainerContent:s4,workbenchContainerCanvas:l4,workbenchContainerLeftSidebar:c4,workbenchContainerSidebar:u4};function f4(e){const{header:t=!0,toolbar:n=!0,footer:r=!0,contextMenu:i=!0,mountContainer:o,onRendered:a}=e,c=u.useDependency(u.LocaleService),h=u.useDependency(u.ThemeService),v=u.useDependency(w1),p=s.useRef(null),f=Fe(we.FOOTER),m=Fe(we.HEADER),_=Fe(we.HEADER_MENU),L=Fe(we.CONTENT),x=Fe(we.LEFT_SIDEBAR),w=Fe(we.GLOBAL);s.useEffect(()=>{h.getCurrentTheme()||h.setTheme(ue.defaultTheme)},[]),s.useEffect(()=>{p.current&&(a==null||a(p.current))},[a]);const[j,Z]=s.useState(c.getLocales()),U=s.useMemo(()=>document.createElement("div"),[]);return s.useEffect(()=>{document.body.appendChild(U),v.setContainer(U);const J=[c.localeChanged$.subscribe(()=>{Z(c.getLocales())}),h.currentTheme$.subscribe(E=>{ue.themeInstance.setTheme(o,E),U&&ue.themeInstance.setTheme(U,E)})];return()=>{J.forEach(E=>E.unsubscribe()),document.body.removeChild(U)}},[c,v,o,U,h.currentTheme$]),g.jsxs(ue.ConfigProvider,{locale:j==null?void 0:j.design,mountContainer:U,children:[g.jsxs("div",{className:r1.workbenchLayout,tabIndex:-1,onBlur:J=>J.stopPropagation(),children:[t&&n&&g.jsx("header",{className:r1.workbenchContainerHeader,children:g.jsx(hi,{headerMenuComponents:_})}),g.jsxs("section",{className:r1.workbenchContainer,children:[g.jsxs("div",{className:r1.workbenchContainerWrapper,children:[g.jsx("aside",{className:r1.workbenchContainerLeftSidebar,children:g.jsx(Be,{components:x},"left-sidebar")}),g.jsxs("section",{className:r1.workbenchContainerContent,children:[g.jsx("header",{children:t&&g.jsx(Be,{components:m},"header")}),g.jsx("section",{className:r1.workbenchContainerCanvas,ref:p,"data-range-selector":!0,onContextMenu:J=>J.preventDefault(),children:g.jsx(Be,{components:L},"content")})]}),g.jsx("aside",{className:r1.workbenchContainerSidebar,children:g.jsx(En,{})})]}),r&&g.jsx("footer",{className:r1.workbenchFooter,children:g.jsx(Be,{components:f,sharedProps:{contextMenu:i}},"footer")}),g.jsx(wn,{})]})]}),g.jsx(Be,{components:w},"global"),g.jsx(Be,{components:Mn},"built-in-global"),i&&g.jsx(li,{}),g.jsx(d4,{})]})}function d4(){const{mountContainer:e}=s.useContext(ue.ConfigContext),t=Fe(we.FLOATING);return H1.createPortal(g.jsx(Be,{components:t},"floating"),e)}var h4=Object.defineProperty,p4=Object.getOwnPropertyDescriptor,v4=(e,t,n,r)=>{for(var i=r>1?void 0:r?p4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&h4(t,n,i),i},C1=(e,t)=>(n,r)=>t(n,r,e);const g4=3e3;exports.DesktopUIController=class extends u.Disposable{constructor(t,n,r,i,o,a,c){super(),this._config=t,this._renderManagerService=n,this._injector=r,this._lifecycleService=i,this._uiPartsService=o,this._configService=a,this._layoutService=c,this._configService.setConfig(Y6,this._config),this._initBuiltinComponents(),Promise.resolve().then(()=>this._bootstrapWorkbench())}_bootstrapWorkbench(){this.disposeWithMe(m4(this._injector,this._config,(t,n)=>{this._layoutService&&(this.disposeWithMe(this._layoutService.registerRootContainerElement(n)),this.disposeWithMe(this._layoutService.registerCanvasElement(t))),this._renderManagerService.currentRender$.subscribe(r=>{if(r){const i=this._renderManagerService.getRenderById(r);if(!i.unitId||u.isInternalEditorID(i.unitId))return;i.engine.setContainer(t)}}),setTimeout(()=>{const r=this._renderManagerService.getRenderAll();for(const[i,o]of r)u.isInternalEditorID(i)||!o.isRenderUnit||o.engine.setContainer(t);this._lifecycleService.stage=u.LifecycleStages.Rendered,setTimeout(()=>this._lifecycleService.stage=u.LifecycleStages.Steady,g4)},300)}))}_initBuiltinComponents(){this.disposeWithMe(this._uiPartsService.registerComponent(we.FLOATING,()=>u.connectInjector(_n,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(we.CONTENT,()=>u.connectInjector(yn,this._injector)))}};exports.DesktopUIController=v4([u.OnLifecycle(u.LifecycleStages.Ready,exports.DesktopUIController),C1(1,v1.IRenderManagerService),C1(2,u.Inject(u.Injector)),C1(3,u.Inject(u.LifecycleService)),C1(4,n1),C1(5,u.IConfigService),C1(6,u.Optional(o1))],exports.DesktopUIController);function m4(e,t,n){let r;const i=t.container;if(typeof i=="string"){const h=document.getElementById(i);h?r=h:r=ur(i)}else i instanceof HTMLElement?r=i:r=ur("univer");const o=u.connectInjector(f4,e),a=h=>n(h,r);function c(){K1(g.jsx(o,{...t,mountContainer:r,onRendered:a}),r)}return c(),u.toDisposable(()=>{K1(g.jsx("div",{}),r),setTimeout(()=>K1(g.jsx("div",{}),r),200),setTimeout(()=>ii(r),500)})}function ur(e){const t=document.createElement("div");return t.id=e,t}const $1=u.createIdentifier("ui.notification.service");var C4=Object.defineProperty,b4=Object.getOwnPropertyDescriptor,S4=(e,t,n,r)=>{for(var i=r>1?void 0:r?b4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&C4(t,n,i),i},_4=(e,t)=>(n,r)=>t(n,r,e);const Rn=u.createIdentifier("univer.ui.before-close-service");exports.DesktopBeforeCloseService=class{constructor(t){A(this,"_beforeUnloadCallbacks",[]);A(this,"_onCloseCallbacks",[]);this._notificationService=t,this._init()}registerBeforeClose(t){return this._beforeUnloadCallbacks.push(t),{dispose:()=>{this._beforeUnloadCallbacks=this._beforeUnloadCallbacks.filter(n=>n!==t)}}}registerOnClose(t){return this._onCloseCallbacks.push(t),{dispose:()=>{this._onCloseCallbacks=this._onCloseCallbacks.filter(n=>n!==t)}}}_init(){window.addEventListener("beforeunload",t=>{const n=this._beforeUnloadCallbacks.map(r=>r()).filter(r=>!!r).join(`
|
|
10
|
+
`);if(n)return this._notificationService.show({type:"error",title:"Some changes are not saved",content:n}),typeof t>"u"&&(t=window.event),t.returnValue=n,n}),window.addEventListener("unload",()=>{this._onCloseCallbacks.forEach(t=>t())})}};exports.DesktopBeforeCloseService=S4([_4(0,$1)],exports.DesktopBeforeCloseService);function y4(){return typeof navigator.clipboard<"u"&&typeof navigator.clipboard.readText<"u"}var L4=Object.defineProperty,E4=Object.getOwnPropertyDescriptor,w4=(e,t,n,r)=>{for(var i=r>1?void 0:r?E4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&L4(t,n,i),i},qt=(e,t)=>(n,r)=>t(n,r,e);const tn="text/plain",nn="text/html",xn=u.createIdentifier("univer.clipboard-interface-service");exports.BrowserClipboardService=class extends u.Disposable{constructor(t,n,r){super(),this._localeService=t,this._logService=n,this._notificationService=r}get supportClipboard(){return y4()}async write(t,n){if(!this.supportClipboard)return this._legacyCopyHtml(n);try{return await navigator.clipboard.write([new ClipboardItem({[tn]:new Blob([t],{type:tn}),[nn]:new Blob([n],{type:nn})})])}catch(r){this._logService.error("[BrowserClipboardService]",r),this._showClipboardAuthenticationNotification()}}async writeText(t){if(!this.supportClipboard)return this._legacyCopyText(t);try{return await navigator.clipboard.writeText(t)}catch(n){this._logService.error("[BrowserClipboardService]",n),this._showClipboardAuthenticationNotification()}}async read(){if(!this.supportClipboard)throw new Error("[BrowserClipboardService] read() is not supported on this platform.");try{return navigator.clipboard.read()}catch(t){return this._logService.error("[BrowserClipboardService]",t),this._showClipboardAuthenticationNotification(),[]}}async readText(){if(!this.supportClipboard)throw new Error("[BrowserClipboardService] read() is not supported on this platform.");try{return await navigator.clipboard.readText()}catch(t){return this._logService.error("[BrowserClipboardService]",t),this._showClipboardAuthenticationNotification(),""}}_legacyCopyHtml(t){const n=document.activeElement,r=R4();document.body.appendChild(r),r.innerHTML=t;try{fr(r),document.execCommand("copy")}finally{n instanceof HTMLElement&&n.focus(),document.body.removeChild(r)}}_legacyCopyText(t){const n=document.activeElement,r=M4();document.body.appendChild(r),r.value=t;try{fr(r),document.execCommand("copy")}finally{n instanceof HTMLElement&&n.focus(),document.body.removeChild(r)}}_showClipboardAuthenticationNotification(){var t;(t=this._notificationService)==null||t.show({type:"warning",title:this._localeService.t("clipboard.authentication.title"),content:this._localeService.t("clipboard.authentication.content")})}};exports.BrowserClipboardService=w4([qt(0,u.Inject(u.LocaleService)),qt(1,u.ILogService),qt(2,u.Optional($1))],exports.BrowserClipboardService);function M4(){const e=document.createElement("textarea");return e.style.position="absolute",e.style.height="1px",e.style.width="1px",e.style.opacity="0",e.readOnly=!0,e}function R4(){const e=document.createElement("div");return e.contentEditable="true",e.style.position="absolute",e.style.opacity="0",e.style.height="1px",e.style.width="1px",e}function fr(e){if(e instanceof HTMLTextAreaElement){const r=e.hasAttribute("readonly");return r||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),r||e.removeAttribute("readonly"),e.value}e.hasAttribute("contenteditable")&&e.focus();const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();if(!n)throw new Error;return n.removeAllRanges(),n.addRange(t),n.toString()}const _t=u.createIdentifier("univer.confirm-service");function x4(){const e=u.useDependency(_t),[t,n]=s.useState([]);s.useEffect(()=>{const i=e.confirmOptions$.subscribe(o=>{n(o)});return()=>{i.unsubscribe()}},[]);const r=t.map(i=>{const{children:o,title:a,...c}=i,h=c;for(const v of["children","title"]){const p=v,f=i[p];f&&(h[p]=g.jsx(ze,{...f}))}return h});return r==null?void 0:r.map((i,o)=>g.jsx(ue.Confirm,{...i},o))}var I4=Object.defineProperty,O4=Object.getOwnPropertyDescriptor,H4=(e,t,n,r)=>{for(var i=r>1?void 0:r?O4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&I4(t,n,i),i},dr=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopConfirmService=class extends u.Disposable{constructor(n,r){super();A(this,"_confirmOptions",[]);A(this,"confirmOptions$",new re.Subject);this._injector=n,this._uiPartsService=r,this._initUIPart()}open(n){return this._confirmOptions.find(r=>r.id===n.id)?this._confirmOptions=this._confirmOptions.map(r=>({...r.id===n.id?n:r,visible:r.id===n.id?!0:r.visible})):this._confirmOptions.push({...n,visible:!0}),this.confirmOptions$.next(this._confirmOptions),u.toDisposable(()=>{this._confirmOptions=[],this.confirmOptions$.next([])})}confirm(n){return new Promise(r=>{const i=this.open({...n,onConfirm:()=>{i.dispose(),r(!0)},onClose:()=>{i.dispose(),r(!1)}})})}close(n){this._confirmOptions=this._confirmOptions.map(r=>({...r,visible:r.id===n?!1:r.visible})),this.confirmOptions$.next([...this._confirmOptions])}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(we.GLOBAL,()=>u.connectInjector(x4,this._injector)))}};exports.DesktopConfirmService=H4([dr(0,u.Inject(u.Injector)),dr(1,n1)],exports.DesktopConfirmService);const yt=u.createIdentifier("univer.ui.dialog-service");function T4(){const e=u.useDependency(yt),[t,n]=s.useState([]);s.useEffect(()=>{const o=e.getDialogs$().subscribe(a=>{n(a)});return()=>o.unsubscribe()},[e]);const r=t.map(i=>{const{children:o,title:a,closeIcon:c,footer:h,...v}=i,p=v;for(const f of["children","title","closeIcon","footer"]){const m=f,_=i[m];_&&(p[m]=g.jsx(ze,{..._}))}return p});return g.jsx(g.Fragment,{children:r==null?void 0:r.map(i=>g.jsx(ue.Dialog,{...i},i.id))})}var D4=Object.defineProperty,N4=Object.getOwnPropertyDescriptor,V4=(e,t,n,r)=>{for(var i=r>1?void 0:r?N4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&D4(t,n,i),i},hr=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopDialogService=class extends u.Disposable{constructor(n,r){super();A(this,"_dialogOptions",[]);A(this,"_dialogOptions$",new re.Subject);this._injector=n,this._uiPartsService=r,this._initUIPart()}dispose(){super.dispose(),this._dialogOptions$.complete()}open(n){return this._dialogOptions.find(r=>r.id===n.id)?this._dialogOptions=this._dialogOptions.map(r=>({...r.id===n.id?n:r,visible:r.id===n.id?!0:r.visible})):this._dialogOptions.push({...n,visible:!0}),this._dialogOptions$.next(this._dialogOptions),u.toDisposable(()=>{this._dialogOptions=[],this._dialogOptions$.next([])})}close(n){this._dialogOptions=this._dialogOptions.map(r=>({...r,visible:r.id===n?!1:r.visible})),this._dialogOptions$.next([...this._dialogOptions])}getDialogs$(){return this._dialogOptions$.asObservable()}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(we.GLOBAL,()=>u.connectInjector(T4,this._injector)))}};exports.DesktopDialogService=V4([hr(0,u.Inject(u.Injector)),hr(1,n1)],exports.DesktopDialogService);class In{constructor(){A(this,"_portalContainer",$6()?document.body:void 0);A(this,"_message")}dispose(){var t;(t=this._message)==null||t.dispose()}setContainer(t){this._message||(this._portalContainer=t,this._message=new ue.Message(t))}getContainer(){return this._portalContainer}show(t){if(!this._portalContainer)throw new Error("[DesktopMessageService]: no container to show message!");if(!this._message)throw new Error("[DesktopMessageService]: no message implementation!");const{type:n,...r}=t;return this._message[n](r)}}function rn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A4(e){if(Array.isArray(e))return rn(e)}function j4(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vi(e,t){if(e){if(typeof e=="string")return rn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rn(e,t):void 0}}function P4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I1(e){return A4(e)||j4(e)||vi(e)||P4()}function $4(e){if(Array.isArray(e))return e}function k4(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,c=[],h=!0,v=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;h=!1}else for(;!(h=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);h=!0);}catch(p){v=!0,i=p}finally{try{if(!h&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(v)throw i}}return c}}function B4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(e,t){return $4(e)||k4(e,t)||vi(e,t)||B4()}function U4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lt(e,t){if(e==null)return{};var n,r,i=U4(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ze(e){"@babel/helpers - typeof";return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function F4(e,t){if(Ze(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ze(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gi(e){var t=F4(e,"string");return Ze(t)=="symbol"?t:t+""}function Ne(e,t,n){return(t=gi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pr(Object(n),!0).forEach(function(r){Ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p1(){return p1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p1.apply(null,arguments)}var mi={exports:{}};/*!
|
|
13
13
|
Copyright (c) 2018 Jed Watson.
|
|
14
14
|
Licensed under the MIT License (MIT), see
|
|
15
15
|
http://jedwatson.github.io/classnames
|
|
16
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(o=i(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var c in o)t.call(o,c)&&o[c]&&(a=i(a,c));return a}function i(o,a){return a?o?o+" "+a:o+a:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(mi);var
|
|
16
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(o=i(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var c in o)t.call(o,c)&&o[c]&&(a=i(a,c));return a}function i(o,a){return a?o?o+" "+a:o+a:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(mi);var z4=mi.exports;const O1=N6(z4);function vr(e){return e instanceof HTMLElement||e instanceof SVGElement}function Z4(e){return e&&Ze(e)==="object"&&vr(e.nativeElement)?e.nativeElement:vr(e)?e:null}function W4(e){var t=Z4(e);if(t)return t;if(e instanceof s.Component){var n;return(n=H1.findDOMNode)===null||n===void 0?void 0:n.call(H1,e)}return null}var Ci={exports:{}},be={};/**
|
|
17
17
|
* @license React
|
|
18
18
|
* react-is.production.min.js
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the MIT license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/var On=Symbol.for("react.element"),Hn=Symbol.for("react.portal"),Lt=Symbol.for("react.fragment"),Et=Symbol.for("react.strict_mode"),wt=Symbol.for("react.profiler"),Mt=Symbol.for("react.provider"),Rt=Symbol.for("react.context"),W4=Symbol.for("react.server_context"),xt=Symbol.for("react.forward_ref"),It=Symbol.for("react.suspense"),Ot=Symbol.for("react.suspense_list"),Ht=Symbol.for("react.memo"),Tt=Symbol.for("react.lazy"),G4=Symbol.for("react.offscreen"),bi;bi=Symbol.for("react.module.reference");function Xe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case On:switch(e=e.type,e){case Lt:case wt:case Et:case It:case Ot:return e;default:switch(e=e&&e.$$typeof,e){case W4:case Rt:case xt:case Tt:case Ht:case Mt:return e;default:return t}}case Hn:return t}}}be.ContextConsumer=Rt;be.ContextProvider=Mt;be.Element=On;be.ForwardRef=xt;be.Fragment=Lt;be.Lazy=Tt;be.Memo=Ht;be.Portal=Hn;be.Profiler=wt;be.StrictMode=Et;be.Suspense=It;be.SuspenseList=Ot;be.isAsyncMode=function(){return!1};be.isConcurrentMode=function(){return!1};be.isContextConsumer=function(e){return Xe(e)===Rt};be.isContextProvider=function(e){return Xe(e)===Mt};be.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===On};be.isForwardRef=function(e){return Xe(e)===xt};be.isFragment=function(e){return Xe(e)===Lt};be.isLazy=function(e){return Xe(e)===Tt};be.isMemo=function(e){return Xe(e)===Ht};be.isPortal=function(e){return Xe(e)===Hn};be.isProfiler=function(e){return Xe(e)===wt};be.isStrictMode=function(e){return Xe(e)===Et};be.isSuspense=function(e){return Xe(e)===It};be.isSuspenseList=function(e){return Xe(e)===Ot};be.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Lt||e===wt||e===Et||e===It||e===Ot||e===G4||typeof e=="object"&&e!==null&&(e.$$typeof===Tt||e.$$typeof===Ht||e.$$typeof===Mt||e.$$typeof===Rt||e.$$typeof===xt||e.$$typeof===bi||e.getModuleId!==void 0)};be.typeOf=Xe;Ci.exports=be;var et=Ci.exports,Y4=function(t,n){typeof t=="function"?t(n):Ze(t)==="object"&&t&&"current"in t&&(t.current=n)},q4=function(t){var n,r,i=et.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==et.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==et.ForwardRef)};function gr(e){return s.isValidElement(e)&&!et.isFragment(e)}Number(s.version.split(".")[0])>=19;var X4=K.createContext({});function Si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gi(r.key),r)}}function _i(e,t,n){return t&&mr(e.prototype,t),n&&mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},on(e,t)}function yi(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&on(e,t)}function ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ct(e)}function Li(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Li=function(){return!!e})()}function an(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q4(e,t){if(t&&(Ze(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return an(e)}function Ei(e){var t=Li();return function(){var n,r=ct(e);if(t){var i=ct(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Q4(this,n)}}var J4=function(e){yi(n,e);var t=Ei(n);function n(){return Si(this,n),t.apply(this,arguments)}return _i(n,[{key:"render",value:function(){return this.props.children}}]),n}(K.Component);function K4(e){var t=K.useRef();t.current=e;var n=K.useCallback(function(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(o))},[]);return n}function Tn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function tt(e){var t=K.useRef(!1),n=K.useState(e),r=He(n,2),i=r[0],o=r[1];K.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(c,h){h&&t.current||o(c)}return[i,a]}var l1="none",G1="appear",Y1="enter",q1="leave",Cr="none",Je="prepare",y1="start",L1="active",Dn="end",wi="prepared";function br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function e0(e,t){var n={animationend:br("Animation","AnimationEnd"),transitionend:br("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var t0=e0(Tn(),typeof window<"u"?window:{}),Mi={};if(Tn()){var n0=document.createElement("div");Mi=n0.style}var X1={};function Ri(e){if(X1[e])return X1[e];var t=t0[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var o=n[i];if(Object.prototype.hasOwnProperty.call(t,o)&&o in Mi)return X1[e]=t[o],X1[e]}return""}var xi=Ri("animationend"),Ii=Ri("transitionend"),Oi=!!(xi&&Ii),Sr=xi||"animationend",_r=Ii||"transitionend";function yr(e,t){if(!e)return null;if(Ze(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const r0=function(e){var t=s.useRef();function n(i){i&&(i.removeEventListener(_r,e),i.removeEventListener(Sr,e))}function r(i){t.current&&t.current!==i&&n(t.current),i&&i!==t.current&&(i.addEventListener(_r,e),i.addEventListener(Sr,e),t.current=i)}return K.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var Hi=Tn()?s.useLayoutEffect:s.useEffect,Ti=function(t){return+setTimeout(t,16)},Di=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(Ti=function(t){return window.requestAnimationFrame(t)},Di=function(t){return window.cancelAnimationFrame(t)});var Lr=0,Nn=new Map;function Ni(e){Nn.delete(e)}var sn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Lr+=1;var r=Lr;function i(o){if(o===0)Ni(r),t();else{var a=Ti(function(){i(o-1)});Nn.set(r,a)}}return i(n),r};sn.cancel=function(e){var t=Nn.get(e);return Ni(e),Di(t)};const i0=function(){var e=K.useRef(null);function t(){sn.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var o=sn(function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)});e.current=o}return K.useEffect(function(){return function(){t()}},[]),[n,t]};var o0=[Je,y1,L1,Dn],a0=[Je,wi],Vi=!1,s0=!0;function Ai(e){return e===L1||e===Dn}const l0=function(e,t,n){var r=tt(Cr),i=He(r,2),o=i[0],a=i[1],c=i0(),h=He(c,2),v=h[0],p=h[1];function d(){a(Je,!0)}var m=t?a0:o0;return Hi(function(){if(o!==Cr&&o!==Dn){var _=m.indexOf(o),L=m[_+1],x=n(o);x===Vi?a(L,!0):L&&v(function(w){function j(){w.isCanceled()||a(L,!0)}x===!0?j():Promise.resolve(x).then(j)})}},[e,o]),K.useEffect(function(){return function(){p()}},[]),[d,o]};function c0(e,t,n,r){var i=r.motionEnter,o=i===void 0?!0:i,a=r.motionAppear,c=a===void 0?!0:a,h=r.motionLeave,v=h===void 0?!0:h,p=r.motionDeadline,d=r.motionLeaveImmediately,m=r.onAppearPrepare,_=r.onEnterPrepare,L=r.onLeavePrepare,x=r.onAppearStart,w=r.onEnterStart,j=r.onLeaveStart,Z=r.onAppearActive,U=r.onEnterActive,J=r.onLeaveActive,E=r.onAppearEnd,D=r.onEnterEnd,k=r.onLeaveEnd,$=r.onVisibleChanged,F=tt(),z=He(F,2),Y=z[0],ne=z[1],ie=tt(l1),ce=He(ie,2),ae=ce[0],Q=ce[1],oe=tt(null),he=He(oe,2),T=he[0],M=he[1],I=s.useRef(!1),B=s.useRef(null);function G(){return n()}var W=s.useRef(!1);function q(){Q(l1,!0),M(null,!0)}var se=K4(function(me){if(ae!==l1){var ye=G();if(!(me&&!me.deadline&&me.target!==ye)){var Se=W.current,je;ae===G1&&Se?je=E==null?void 0:E(ye,me):ae===Y1&&Se?je=D==null?void 0:D(ye,me):ae===q1&&Se&&(je=k==null?void 0:k(ye,me)),Se&&je!==!1&&q()}}}),_e=r0(se),Me=He(_e,1),Ee=Me[0],fe=function(ye){switch(ye){case G1:return Ne(Ne(Ne({},Je,m),y1,x),L1,Z);case Y1:return Ne(Ne(Ne({},Je,_),y1,w),L1,U);case q1:return Ne(Ne(Ne({},Je,L),y1,j),L1,J);default:return{}}},Ve=K.useMemo(function(){return fe(ae)},[ae]),$e=l0(ae,!e,function(me){if(me===Je){var ye=Ve[Je];return ye?ye(G()):Vi}if(ee in Ve){var Se;M(((Se=Ve[ee])===null||Se===void 0?void 0:Se.call(Ve,G(),null))||null)}return ee===L1&&ae!==l1&&(Ee(G()),p>0&&(clearTimeout(B.current),B.current=setTimeout(function(){se({deadline:!0})},p))),ee===wi&&q(),s0}),Ae=He($e,2),Ie=Ae[0],ee=Ae[1],de=Ai(ee);W.current=de,Hi(function(){ne(t);var me=I.current;I.current=!0;var ye;!me&&t&&c&&(ye=G1),me&&t&&o&&(ye=Y1),(me&&!t&&v||!me&&d&&!t&&v)&&(ye=q1);var Se=fe(ye);ye&&(e||Se[Je])?(Q(ye),Ie()):Q(l1)},[t]),s.useEffect(function(){(ae===G1&&!c||ae===Y1&&!o||ae===q1&&!v)&&Q(l1)},[c,o,v]),s.useEffect(function(){return function(){I.current=!1,clearTimeout(B.current)}},[]);var pe=K.useRef(!1);s.useEffect(function(){Y&&(pe.current=!0),Y!==void 0&&ae===l1&&((pe.current||Y)&&($==null||$(Y)),pe.current=!0)},[Y,ae]);var Te=T;return Ve[Je]&&ee===y1&&(Te=ge({transition:"none"},Te)),[ae,ee,Te,Y!=null?Y:t]}function u0(e){var t=e;Ze(e)==="object"&&(t=e.transitionSupport);function n(i,o){return!!(i.motionName&&t&&o!==!1)}var r=K.forwardRef(function(i,o){var a=i.visible,c=a===void 0?!0:a,h=i.removeOnLeave,v=h===void 0?!0:h,p=i.forceRender,d=i.children,m=i.motionName,_=i.leavedClassName,L=i.eventProps,x=K.useContext(X4),w=x.motion,j=n(i,w),Z=s.useRef(),U=s.useRef();function J(){try{return Z.current instanceof HTMLElement?Z.current:Z4(U.current)}catch{return null}}var E=c0(j,c,J,i),D=He(E,4),k=D[0],$=D[1],F=D[2],z=D[3],Y=K.useRef(z);z&&(Y.current=!0);var ne=K.useCallback(function(T){Z.current=T,Y4(o,T)},[o]),ie,ce=ge(ge({},L),{},{visible:c});if(!d)ie=null;else if(k===l1)z?ie=d(ge({},ce),ne):!v&&Y.current&&_?ie=d(ge(ge({},ce),{},{className:_}),ne):p||!v&&!_?ie=d(ge(ge({},ce),{},{style:{display:"none"}}),ne):ie=null;else{var ae;$===Je?ae="prepare":Ai($)?ae="active":$===y1&&(ae="start");var Q=yr(m,"".concat(k,"-").concat(ae));ie=d(ge(ge({},ce),{},{className:O1(yr(m,k),Ne(Ne({},Q,Q&&ae),m,typeof m=="string")),style:F}),ne)}if(K.isValidElement(ie)&&q4(ie)){var oe=ie,he=oe.ref;he||(ie=K.cloneElement(ie,{ref:ne}))}return K.createElement(J4,{ref:U},ie)});return r.displayName="CSSMotion",r}const f0=u0(Oi);var ln="add",cn="keep",un="remove",Xt="removed";function d0(e){var t;return e&&Ze(e)==="object"&&"key"in e?t=e:t={key:e},ge(ge({},t),{},{key:String(t.key)})}function fn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(d0)}function h0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,o=fn(e),a=fn(t);o.forEach(function(v){for(var p=!1,d=r;d<i;d+=1){var m=a[d];if(m.key===v.key){r<d&&(n=n.concat(a.slice(r,d).map(function(_){return ge(ge({},_),{},{status:ln})})),r=d),n.push(ge(ge({},m),{},{status:cn})),r+=1,p=!0;break}}p||n.push(ge(ge({},v),{},{status:un}))}),r<i&&(n=n.concat(a.slice(r).map(function(v){return ge(ge({},v),{},{status:ln})})));var c={};n.forEach(function(v){var p=v.key;c[p]=(c[p]||0)+1});var h=Object.keys(c).filter(function(v){return c[v]>1});return h.forEach(function(v){n=n.filter(function(p){var d=p.key,m=p.status;return d!==v||m!==un}),n.forEach(function(p){p.key===v&&(p.status=cn)})}),n}var p0=["component","children","onVisibleChanged","onAllRemoved"],v0=["status"],g0=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function m0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f0,n=function(r){yi(o,r);var i=Ei(o);function o(){var a;Si(this,o);for(var c=arguments.length,h=new Array(c),v=0;v<c;v++)h[v]=arguments[v];return a=i.call.apply(i,[this].concat(h)),Ne(an(a),"state",{keyEntities:[]}),Ne(an(a),"removeKey",function(p){var d=a.state.keyEntities,m=d.map(function(_){return _.key!==p?_:ge(ge({},_),{},{status:Xt})});return a.setState({keyEntities:m}),m.filter(function(_){var L=_.status;return L!==Xt}).length}),a}return _i(o,[{key:"render",value:function(){var c=this,h=this.state.keyEntities,v=this.props,p=v.component,d=v.children,m=v.onVisibleChanged,_=v.onAllRemoved,L=lt(v,p0),x=p||K.Fragment,w={};return g0.forEach(function(j){w[j]=L[j],delete L[j]}),delete L.keys,K.createElement(x,L,h.map(function(j,Z){var U=j.status,J=lt(j,v0),E=U===ln||U===cn;return K.createElement(t,p1({},w,{key:J.key,visible:E,eventProps:J,onVisibleChanged:function(k){if(m==null||m(k,{key:J.key}),!k){var $=c.removeKey(J.key);$===0&&_&&_()}}}),function(D,k){return d(ge(ge({},D),{},{index:Z}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(c,h){var v=c.keys,p=h.keyEntities,d=fn(v),m=h0(p,d);return{keyEntities:m.filter(function(_){var L=p.find(function(x){var w=x.key;return _.key===w});return!(L&&L.status===Xt&&_.status===un)})}}}]),o}(K.Component);return Ne(n,"defaultProps",{component:"div"}),n}const C0=m0(Oi);var te={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=te.F1&&n<=te.F12)return!1;switch(n){case te.ALT:case te.CAPS_LOCK:case te.CONTEXT_MENU:case te.CTRL:case te.DOWN:case te.END:case te.ESC:case te.HOME:case te.INSERT:case te.LEFT:case te.MAC_FF_META:case te.META:case te.NUMLOCK:case te.NUM_CENTER:case te.PAGE_DOWN:case te.PAGE_UP:case te.PAUSE:case te.PRINT_SCREEN:case te.RIGHT:case te.SHIFT:case te.UP:case te.WIN_KEY:case te.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=te.ZERO&&t<=te.NINE||t>=te.NUM_ZERO&&t<=te.NUM_MULTIPLY||t>=te.A&&t<=te.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case te.SPACE:case te.QUESTION_MARK:case te.NUM_PLUS:case te.NUM_MINUS:case te.NUM_PERIOD:case te.NUM_DIVISION:case te.SEMICOLON:case te.DASH:case te.EQUALS:case te.COMMA:case te.PERIOD:case te.SLASH:case te.APOSTROPHE:case te.SINGLE_QUOTE:case te.OPEN_SQUARE_BRACKET:case te.BACKSLASH:case te.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},b0=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
24
|
+
*/var On=Symbol.for("react.element"),Hn=Symbol.for("react.portal"),Lt=Symbol.for("react.fragment"),Et=Symbol.for("react.strict_mode"),wt=Symbol.for("react.profiler"),Mt=Symbol.for("react.provider"),Rt=Symbol.for("react.context"),G4=Symbol.for("react.server_context"),xt=Symbol.for("react.forward_ref"),It=Symbol.for("react.suspense"),Ot=Symbol.for("react.suspense_list"),Ht=Symbol.for("react.memo"),Tt=Symbol.for("react.lazy"),Y4=Symbol.for("react.offscreen"),bi;bi=Symbol.for("react.module.reference");function Xe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case On:switch(e=e.type,e){case Lt:case wt:case Et:case It:case Ot:return e;default:switch(e=e&&e.$$typeof,e){case G4:case Rt:case xt:case Tt:case Ht:case Mt:return e;default:return t}}case Hn:return t}}}be.ContextConsumer=Rt;be.ContextProvider=Mt;be.Element=On;be.ForwardRef=xt;be.Fragment=Lt;be.Lazy=Tt;be.Memo=Ht;be.Portal=Hn;be.Profiler=wt;be.StrictMode=Et;be.Suspense=It;be.SuspenseList=Ot;be.isAsyncMode=function(){return!1};be.isConcurrentMode=function(){return!1};be.isContextConsumer=function(e){return Xe(e)===Rt};be.isContextProvider=function(e){return Xe(e)===Mt};be.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===On};be.isForwardRef=function(e){return Xe(e)===xt};be.isFragment=function(e){return Xe(e)===Lt};be.isLazy=function(e){return Xe(e)===Tt};be.isMemo=function(e){return Xe(e)===Ht};be.isPortal=function(e){return Xe(e)===Hn};be.isProfiler=function(e){return Xe(e)===wt};be.isStrictMode=function(e){return Xe(e)===Et};be.isSuspense=function(e){return Xe(e)===It};be.isSuspenseList=function(e){return Xe(e)===Ot};be.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Lt||e===wt||e===Et||e===It||e===Ot||e===Y4||typeof e=="object"&&e!==null&&(e.$$typeof===Tt||e.$$typeof===Ht||e.$$typeof===Mt||e.$$typeof===Rt||e.$$typeof===xt||e.$$typeof===bi||e.getModuleId!==void 0)};be.typeOf=Xe;Ci.exports=be;var et=Ci.exports,q4=function(t,n){typeof t=="function"?t(n):Ze(t)==="object"&&t&&"current"in t&&(t.current=n)},X4=function(t){var n,r,i=et.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==et.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==et.ForwardRef)};function gr(e){return s.isValidElement(e)&&!et.isFragment(e)}Number(s.version.split(".")[0])>=19;var Q4=K.createContext({});function Si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gi(r.key),r)}}function _i(e,t,n){return t&&mr(e.prototype,t),n&&mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},on(e,t)}function yi(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&on(e,t)}function ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ct(e)}function Li(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Li=function(){return!!e})()}function an(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J4(e,t){if(t&&(Ze(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return an(e)}function Ei(e){var t=Li();return function(){var n,r=ct(e);if(t){var i=ct(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return J4(this,n)}}var K4=function(e){yi(n,e);var t=Ei(n);function n(){return Si(this,n),t.apply(this,arguments)}return _i(n,[{key:"render",value:function(){return this.props.children}}]),n}(K.Component);function e0(e){var t=K.useRef();t.current=e;var n=K.useCallback(function(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(o))},[]);return n}function Tn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function tt(e){var t=K.useRef(!1),n=K.useState(e),r=He(n,2),i=r[0],o=r[1];K.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(c,h){h&&t.current||o(c)}return[i,a]}var l1="none",G1="appear",Y1="enter",q1="leave",Cr="none",Je="prepare",y1="start",L1="active",Dn="end",wi="prepared";function br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function t0(e,t){var n={animationend:br("Animation","AnimationEnd"),transitionend:br("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var n0=t0(Tn(),typeof window<"u"?window:{}),Mi={};if(Tn()){var r0=document.createElement("div");Mi=r0.style}var X1={};function Ri(e){if(X1[e])return X1[e];var t=n0[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var o=n[i];if(Object.prototype.hasOwnProperty.call(t,o)&&o in Mi)return X1[e]=t[o],X1[e]}return""}var xi=Ri("animationend"),Ii=Ri("transitionend"),Oi=!!(xi&&Ii),Sr=xi||"animationend",_r=Ii||"transitionend";function yr(e,t){if(!e)return null;if(Ze(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const i0=function(e){var t=s.useRef();function n(i){i&&(i.removeEventListener(_r,e),i.removeEventListener(Sr,e))}function r(i){t.current&&t.current!==i&&n(t.current),i&&i!==t.current&&(i.addEventListener(_r,e),i.addEventListener(Sr,e),t.current=i)}return K.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var Hi=Tn()?s.useLayoutEffect:s.useEffect,Ti=function(t){return+setTimeout(t,16)},Di=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(Ti=function(t){return window.requestAnimationFrame(t)},Di=function(t){return window.cancelAnimationFrame(t)});var Lr=0,Nn=new Map;function Ni(e){Nn.delete(e)}var sn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Lr+=1;var r=Lr;function i(o){if(o===0)Ni(r),t();else{var a=Ti(function(){i(o-1)});Nn.set(r,a)}}return i(n),r};sn.cancel=function(e){var t=Nn.get(e);return Ni(e),Di(t)};const o0=function(){var e=K.useRef(null);function t(){sn.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var o=sn(function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)});e.current=o}return K.useEffect(function(){return function(){t()}},[]),[n,t]};var a0=[Je,y1,L1,Dn],s0=[Je,wi],Vi=!1,l0=!0;function Ai(e){return e===L1||e===Dn}const c0=function(e,t,n){var r=tt(Cr),i=He(r,2),o=i[0],a=i[1],c=o0(),h=He(c,2),v=h[0],p=h[1];function f(){a(Je,!0)}var m=t?s0:a0;return Hi(function(){if(o!==Cr&&o!==Dn){var _=m.indexOf(o),L=m[_+1],x=n(o);x===Vi?a(L,!0):L&&v(function(w){function j(){w.isCanceled()||a(L,!0)}x===!0?j():Promise.resolve(x).then(j)})}},[e,o]),K.useEffect(function(){return function(){p()}},[]),[f,o]};function u0(e,t,n,r){var i=r.motionEnter,o=i===void 0?!0:i,a=r.motionAppear,c=a===void 0?!0:a,h=r.motionLeave,v=h===void 0?!0:h,p=r.motionDeadline,f=r.motionLeaveImmediately,m=r.onAppearPrepare,_=r.onEnterPrepare,L=r.onLeavePrepare,x=r.onAppearStart,w=r.onEnterStart,j=r.onLeaveStart,Z=r.onAppearActive,U=r.onEnterActive,J=r.onLeaveActive,E=r.onAppearEnd,D=r.onEnterEnd,k=r.onLeaveEnd,$=r.onVisibleChanged,F=tt(),z=He(F,2),Y=z[0],ne=z[1],ie=tt(l1),ce=He(ie,2),ae=ce[0],Q=ce[1],oe=tt(null),he=He(oe,2),T=he[0],M=he[1],I=s.useRef(!1),B=s.useRef(null);function G(){return n()}var W=s.useRef(!1);function q(){Q(l1,!0),M(null,!0)}var se=e0(function(me){if(ae!==l1){var ye=G();if(!(me&&!me.deadline&&me.target!==ye)){var Se=W.current,je;ae===G1&&Se?je=E==null?void 0:E(ye,me):ae===Y1&&Se?je=D==null?void 0:D(ye,me):ae===q1&&Se&&(je=k==null?void 0:k(ye,me)),Se&&je!==!1&&q()}}}),_e=i0(se),Me=He(_e,1),Ee=Me[0],fe=function(ye){switch(ye){case G1:return Ne(Ne(Ne({},Je,m),y1,x),L1,Z);case Y1:return Ne(Ne(Ne({},Je,_),y1,w),L1,U);case q1:return Ne(Ne(Ne({},Je,L),y1,j),L1,J);default:return{}}},Ve=K.useMemo(function(){return fe(ae)},[ae]),$e=c0(ae,!e,function(me){if(me===Je){var ye=Ve[Je];return ye?ye(G()):Vi}if(ee in Ve){var Se;M(((Se=Ve[ee])===null||Se===void 0?void 0:Se.call(Ve,G(),null))||null)}return ee===L1&&ae!==l1&&(Ee(G()),p>0&&(clearTimeout(B.current),B.current=setTimeout(function(){se({deadline:!0})},p))),ee===wi&&q(),l0}),Ae=He($e,2),Ie=Ae[0],ee=Ae[1],de=Ai(ee);W.current=de,Hi(function(){ne(t);var me=I.current;I.current=!0;var ye;!me&&t&&c&&(ye=G1),me&&t&&o&&(ye=Y1),(me&&!t&&v||!me&&f&&!t&&v)&&(ye=q1);var Se=fe(ye);ye&&(e||Se[Je])?(Q(ye),Ie()):Q(l1)},[t]),s.useEffect(function(){(ae===G1&&!c||ae===Y1&&!o||ae===q1&&!v)&&Q(l1)},[c,o,v]),s.useEffect(function(){return function(){I.current=!1,clearTimeout(B.current)}},[]);var pe=K.useRef(!1);s.useEffect(function(){Y&&(pe.current=!0),Y!==void 0&&ae===l1&&((pe.current||Y)&&($==null||$(Y)),pe.current=!0)},[Y,ae]);var Te=T;return Ve[Je]&&ee===y1&&(Te=ge({transition:"none"},Te)),[ae,ee,Te,Y!=null?Y:t]}function f0(e){var t=e;Ze(e)==="object"&&(t=e.transitionSupport);function n(i,o){return!!(i.motionName&&t&&o!==!1)}var r=K.forwardRef(function(i,o){var a=i.visible,c=a===void 0?!0:a,h=i.removeOnLeave,v=h===void 0?!0:h,p=i.forceRender,f=i.children,m=i.motionName,_=i.leavedClassName,L=i.eventProps,x=K.useContext(Q4),w=x.motion,j=n(i,w),Z=s.useRef(),U=s.useRef();function J(){try{return Z.current instanceof HTMLElement?Z.current:W4(U.current)}catch{return null}}var E=u0(j,c,J,i),D=He(E,4),k=D[0],$=D[1],F=D[2],z=D[3],Y=K.useRef(z);z&&(Y.current=!0);var ne=K.useCallback(function(T){Z.current=T,q4(o,T)},[o]),ie,ce=ge(ge({},L),{},{visible:c});if(!f)ie=null;else if(k===l1)z?ie=f(ge({},ce),ne):!v&&Y.current&&_?ie=f(ge(ge({},ce),{},{className:_}),ne):p||!v&&!_?ie=f(ge(ge({},ce),{},{style:{display:"none"}}),ne):ie=null;else{var ae;$===Je?ae="prepare":Ai($)?ae="active":$===y1&&(ae="start");var Q=yr(m,"".concat(k,"-").concat(ae));ie=f(ge(ge({},ce),{},{className:O1(yr(m,k),Ne(Ne({},Q,Q&&ae),m,typeof m=="string")),style:F}),ne)}if(K.isValidElement(ie)&&X4(ie)){var oe=ie,he=oe.ref;he||(ie=K.cloneElement(ie,{ref:ne}))}return K.createElement(K4,{ref:U},ie)});return r.displayName="CSSMotion",r}const d0=f0(Oi);var ln="add",cn="keep",un="remove",Xt="removed";function h0(e){var t;return e&&Ze(e)==="object"&&"key"in e?t=e:t={key:e},ge(ge({},t),{},{key:String(t.key)})}function fn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(h0)}function p0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,o=fn(e),a=fn(t);o.forEach(function(v){for(var p=!1,f=r;f<i;f+=1){var m=a[f];if(m.key===v.key){r<f&&(n=n.concat(a.slice(r,f).map(function(_){return ge(ge({},_),{},{status:ln})})),r=f),n.push(ge(ge({},m),{},{status:cn})),r+=1,p=!0;break}}p||n.push(ge(ge({},v),{},{status:un}))}),r<i&&(n=n.concat(a.slice(r).map(function(v){return ge(ge({},v),{},{status:ln})})));var c={};n.forEach(function(v){var p=v.key;c[p]=(c[p]||0)+1});var h=Object.keys(c).filter(function(v){return c[v]>1});return h.forEach(function(v){n=n.filter(function(p){var f=p.key,m=p.status;return f!==v||m!==un}),n.forEach(function(p){p.key===v&&(p.status=cn)})}),n}var v0=["component","children","onVisibleChanged","onAllRemoved"],g0=["status"],m0=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function C0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d0,n=function(r){yi(o,r);var i=Ei(o);function o(){var a;Si(this,o);for(var c=arguments.length,h=new Array(c),v=0;v<c;v++)h[v]=arguments[v];return a=i.call.apply(i,[this].concat(h)),Ne(an(a),"state",{keyEntities:[]}),Ne(an(a),"removeKey",function(p){var f=a.state.keyEntities,m=f.map(function(_){return _.key!==p?_:ge(ge({},_),{},{status:Xt})});return a.setState({keyEntities:m}),m.filter(function(_){var L=_.status;return L!==Xt}).length}),a}return _i(o,[{key:"render",value:function(){var c=this,h=this.state.keyEntities,v=this.props,p=v.component,f=v.children,m=v.onVisibleChanged,_=v.onAllRemoved,L=lt(v,v0),x=p||K.Fragment,w={};return m0.forEach(function(j){w[j]=L[j],delete L[j]}),delete L.keys,K.createElement(x,L,h.map(function(j,Z){var U=j.status,J=lt(j,g0),E=U===ln||U===cn;return K.createElement(t,p1({},w,{key:J.key,visible:E,eventProps:J,onVisibleChanged:function(k){if(m==null||m(k,{key:J.key}),!k){var $=c.removeKey(J.key);$===0&&_&&_()}}}),function(D,k){return f(ge(ge({},D),{},{index:Z}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(c,h){var v=c.keys,p=h.keyEntities,f=fn(v),m=p0(p,f);return{keyEntities:m.filter(function(_){var L=p.find(function(x){var w=x.key;return _.key===w});return!(L&&L.status===Xt&&_.status===un)})}}}]),o}(K.Component);return Ne(n,"defaultProps",{component:"div"}),n}const b0=C0(Oi);var te={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=te.F1&&n<=te.F12)return!1;switch(n){case te.ALT:case te.CAPS_LOCK:case te.CONTEXT_MENU:case te.CTRL:case te.DOWN:case te.END:case te.ESC:case te.HOME:case te.INSERT:case te.LEFT:case te.MAC_FF_META:case te.META:case te.NUMLOCK:case te.NUM_CENTER:case te.PAGE_DOWN:case te.PAGE_UP:case te.PAUSE:case te.PRINT_SCREEN:case te.RIGHT:case te.SHIFT:case te.UP:case te.WIN_KEY:case te.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=te.ZERO&&t<=te.NINE||t>=te.NUM_ZERO&&t<=te.NUM_MULTIPLY||t>=te.A&&t<=te.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case te.SPACE:case te.QUESTION_MARK:case te.NUM_PLUS:case te.NUM_MINUS:case te.NUM_PERIOD:case te.NUM_DIVISION:case te.SEMICOLON:case te.DASH:case te.EQUALS:case te.COMMA:case te.PERIOD:case te.SLASH:case te.APOSTROPHE:case te.SINGLE_QUOTE:case te.OPEN_SQUARE_BRACKET:case te.BACKSLASH:case te.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},S0=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
25
25
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
26
26
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
27
27
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
@@ -32,19 +32,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
32
32
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
33
33
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
34
34
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
35
|
-
summary tabIndex target title type useMap value width wmode wrap`,
|
|
35
|
+
summary tabIndex target title type useMap value width wmode wrap`,_0=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
36
36
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
37
37
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
38
38
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
39
39
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
40
40
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
41
|
-
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,_0="".concat(b0," ").concat(S0).split(/[\s\n]+/),y0="aria-",L0="data-";function Er(e,t){return e.indexOf(t)===0}function E0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=ge({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||Er(i,y0))||n.data&&Er(i,L0)||n.attr&&_0.includes(i))&&(r[i]=e[i])}),r}var w0=K.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,i=e.className,o=e.duration,a=o===void 0?4.5:o,c=e.showProgress,h=e.pauseOnHover,v=h===void 0?!0:h,p=e.eventKey,d=e.content,m=e.closable,_=e.closeIcon,L=_===void 0?"x":_,x=e.props,w=e.onClick,j=e.onNoticeClose,Z=e.times,U=e.hovering,J=K.useState(!1),E=He(J,2),D=E[0],k=E[1],$=K.useState(0),F=He($,2),z=F[0],Y=F[1],ne=K.useState(0),ie=He(ne,2),ce=ie[0],ae=ie[1],Q=U||D,oe=a>0&&c,he=function(){j(p)},T=function(q){(q.key==="Enter"||q.code==="Enter"||q.keyCode===te.ENTER)&&he()};K.useEffect(function(){if(!Q&&a>0){var W=Date.now()-ce,q=setTimeout(function(){he()},a*1e3-ce);return function(){v&&clearTimeout(q),ae(Date.now()-W)}}},[a,Q,Z]),K.useEffect(function(){if(!Q&&oe&&(v||ce===0)){var W=performance.now(),q,se=function _e(){cancelAnimationFrame(q),q=requestAnimationFrame(function(Me){var Ee=Me+ce-W,fe=Math.min(Ee/(a*1e3),1);Y(fe*100),fe<1&&_e()})};return se(),function(){v&&cancelAnimationFrame(q)}}},[a,ce,Q,oe,Z]);var M=K.useMemo(function(){return Ze(m)==="object"&&m!==null?m:m?{closeIcon:L}:{}},[m,L]),I=E0(M,!0),B=100-(!z||z<0?0:z>100?100:z),G="".concat(n,"-notice");return K.createElement("div",p1({},x,{ref:t,className:O1(G,i,Ne({},"".concat(G,"-closable"),m)),style:r,onMouseEnter:function(q){var se;k(!0),x==null||(se=x.onMouseEnter)===null||se===void 0||se.call(x,q)},onMouseLeave:function(q){var se;k(!1),x==null||(se=x.onMouseLeave)===null||se===void 0||se.call(x,q)},onClick:w}),K.createElement("div",{className:"".concat(G,"-content")},d),m&&K.createElement("a",p1({tabIndex:0,className:"".concat(G,"-close"),onKeyDown:T,"aria-label":"Close"},I,{onClick:function(q){q.preventDefault(),q.stopPropagation(),he()}}),M.closeIcon),oe&&K.createElement("progress",{className:"".concat(G,"-progress"),max:"100",value:B},B+"%"))}),M0=s.createContext({}),wr=8,Mr=3,Rr=16,R0=function(t){var n={offset:wr,threshold:Mr,gap:Rr};if(t&&Ze(t)==="object"){var r,i,o;n.offset=(r=t.offset)!==null&&r!==void 0?r:wr,n.threshold=(i=t.threshold)!==null&&i!==void 0?i:Mr,n.gap=(o=t.gap)!==null&&o!==void 0?o:Rr}return[!!t,n]},x0=["className","style","classNames","styles"],I0=function(t){var n=t.configList,r=t.placement,i=t.prefixCls,o=t.className,a=t.style,c=t.motion,h=t.onAllNoticeRemoved,v=t.onNoticeClose,p=t.stack,d=s.useContext(M0),m=d.classNames,_=s.useRef({}),L=s.useState(null),x=He(L,2),w=x[0],j=x[1],Z=s.useState([]),U=He(Z,2),J=U[0],E=U[1],D=n.map(function(Q){return{config:Q,key:String(Q.key)}}),k=R0(p),$=He(k,2),F=$[0],z=$[1],Y=z.offset,ne=z.threshold,ie=z.gap,ce=F&&(J.length>0||D.length<=ne),ae=typeof c=="function"?c(r):c;return s.useEffect(function(){F&&J.length>1&&E(function(Q){return Q.filter(function(oe){return D.some(function(he){var T=he.key;return oe===T})})})},[J,D,F]),s.useEffect(function(){var Q;if(F&&_.current[(Q=D[D.length-1])===null||Q===void 0?void 0:Q.key]){var oe;j(_.current[(oe=D[D.length-1])===null||oe===void 0?void 0:oe.key])}},[D,F]),s.createElement(C0,p1({key:r,className:O1(i,"".concat(i,"-").concat(r),m==null?void 0:m.list,o,Ne(Ne({},"".concat(i,"-stack"),!!F),"".concat(i,"-stack-expanded"),ce)),style:a,keys:D,motionAppear:!0},ae,{onAllRemoved:function(){h(r)}}),function(Q,oe){var he=Q.config,T=Q.className,M=Q.style,I=Q.index,B=he,G=B.key,W=B.times,q=String(G),se=he,_e=se.className,Me=se.style,Ee=se.classNames,fe=se.styles,Ve=lt(se,x0),$e=D.findIndex(function(f1){return f1.key===q}),Ae={};if(F){var Ie=D.length-1-($e>-1?$e:I-1),ee=r==="top"||r==="bottom"?"-50%":"0";if(Ie>0){var de,pe,Te;Ae.height=ce?(de=_.current[q])===null||de===void 0?void 0:de.offsetHeight:w==null?void 0:w.offsetHeight;for(var me=0,ye=0;ye<Ie;ye++){var Se;me+=((Se=_.current[D[D.length-1-ye].key])===null||Se===void 0?void 0:Se.offsetHeight)+ie}var je=(ce?me:Ie*Y)*(r.startsWith("top")?1:-1),k1=!ce&&w!==null&&w!==void 0&&w.offsetWidth&&(pe=_.current[q])!==null&&pe!==void 0&&pe.offsetWidth?((w==null?void 0:w.offsetWidth)-Y*2*(Ie<3?Ie:3))/((Te=_.current[q])===null||Te===void 0?void 0:Te.offsetWidth):1;Ae.transform="translate3d(".concat(ee,", ").concat(je,"px, 0) scaleX(").concat(k1,")")}else Ae.transform="translate3d(".concat(ee,", 0, 0)")}return s.createElement("div",{ref:oe,className:O1("".concat(i,"-notice-wrapper"),T,Ee==null?void 0:Ee.wrapper),style:ge(ge(ge({},M),Ae),fe==null?void 0:fe.wrapper),onMouseEnter:function(){return E(function(e1){return e1.includes(q)?e1:[].concat(I1(e1),[q])})},onMouseLeave:function(){return E(function(e1){return e1.filter(function(B1){return B1!==q})})}},s.createElement(w0,p1({},Ve,{ref:function(e1){$e>-1?_.current[q]=e1:delete _.current[q]},prefixCls:i,classNames:Ee,styles:fe,className:O1(_e,m==null?void 0:m.notice),style:Me,times:W,key:G,eventKey:G,onNoticeClose:v,hovering:F&&J.length>0})))})},O0=K.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-notification":n,i=e.container,o=e.motion,a=e.maxCount,c=e.className,h=e.style,v=e.onAllRemoved,p=e.stack,d=e.renderNotifications,m=K.useState([]),_=He(m,2),L=_[0],x=_[1],w=function(F){var z,Y=L.find(function(ne){return ne.key===F});Y==null||(z=Y.onClose)===null||z===void 0||z.call(Y),x(function(ne){return ne.filter(function(ie){return ie.key!==F})})};K.useImperativeHandle(t,function(){return{open:function(F){x(function(z){var Y=I1(z),ne=Y.findIndex(function(ae){return ae.key===F.key}),ie=ge({},F);if(ne>=0){var ce;ie.times=(((ce=z[ne])===null||ce===void 0?void 0:ce.times)||0)+1,Y[ne]=ie}else ie.times=0,Y.push(ie);return a>0&&Y.length>a&&(Y=Y.slice(-a)),Y})},close:function(F){w(F)},destroy:function(){x([])}}});var j=K.useState({}),Z=He(j,2),U=Z[0],J=Z[1];K.useEffect(function(){var $={};L.forEach(function(F){var z=F.placement,Y=z===void 0?"topRight":z;Y&&($[Y]=$[Y]||[],$[Y].push(F))}),Object.keys(U).forEach(function(F){$[F]=$[F]||[]}),J($)},[L]);var E=function(F){J(function(z){var Y=ge({},z),ne=Y[F]||[];return ne.length||delete Y[F],Y})},D=K.useRef(!1);if(K.useEffect(function(){Object.keys(U).length>0?D.current=!0:D.current&&(v==null||v(),D.current=!1)},[U]),!i)return null;var k=Object.keys(U);return H1.createPortal(K.createElement(K.Fragment,null,k.map(function($){var F=U[$],z=K.createElement(I0,{key:$,configList:F,placement:$,prefixCls:r,className:c==null?void 0:c($),style:h==null?void 0:h($),motion:o,onNoticeClose:w,onAllNoticeRemoved:E,stack:p});return d?d(z,{prefixCls:r,key:$}):z})),i)}),H0=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],T0=function(){return document.body},xr=0;function D0(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(i){i&&Object.keys(i).forEach(function(o){var a=i[o];a!==void 0&&(e[o]=a)})}),e}function N0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getContainer,n=t===void 0?T0:t,r=e.motion,i=e.prefixCls,o=e.maxCount,a=e.className,c=e.style,h=e.onAllRemoved,v=e.stack,p=e.renderNotifications,d=lt(e,H0),m=K.useState(),_=He(m,2),L=_[0],x=_[1],w=K.useRef(),j=K.createElement(O0,{container:L,ref:w,prefixCls:i,motion:r,maxCount:o,className:a,style:c,onAllRemoved:h,stack:v,renderNotifications:p}),Z=K.useState([]),U=He(Z,2),J=U[0],E=U[1],D=K.useMemo(function(){return{open:function($){var F=D0(d,$);(F.key===null||F.key===void 0)&&(F.key="rc-notification-".concat(xr),xr+=1),E(function(z){return[].concat(I1(z),[{type:"open",config:F}])})},close:function($){E(function(F){return[].concat(I1(F),[{type:"close",key:$}])})},destroy:function(){E(function($){return[].concat(I1($),[{type:"destroy"}])})}}},[]);return K.useEffect(function(){x(n())}),K.useEffect(function(){w.current&&J.length&&(J.forEach(function(k){switch(k.type){case"open":w.current.open(k.config);break;case"close":w.current.close(k.key);break;case"destroy":w.current.destroy();break}}),E(function(k){return k.filter(function($){return!J.includes($)})}))},[J]),[D,j]}const V0="univer-notification",A0="univer-notification-notice",j0="univer-notification-notice-wrapper",P0="univer-notification-notice-content",$0="univer-notification-notice-close",k0="univer-notification-icon",B0="univer-notification-icon-success",U0="univer-notification-icon-info",F0="univer-notification-icon-warning",z0="univer-notification-icon-error",Z0="univer-notification-content-container",W0="univer-notification-title",G0="univer-notification-content",Y0="univer-notification-content-ellipsis",q0="univer-notification-top",X0="univer-notification-topLeft",Q0="univer-notification-topRight",J0="univer-notification-bottom",K0="univer-notification-bottomRight",e5="univer-notification-bottomLeft",t5="univer-notification-fade",n5="univer-notification-fade-appear-prepare",r5="univer-notification-fade-appear-start",i5="univer-notification-fade-appear-active",o5="univer-notification-fade-appear",a5="univer-notification-fade-enter",s5="univer-notification-fade-leave",l5="univer-notification-fade-enter-active",c5="univer-notification-fade-in",u5="univer-notification-fade-leave-active",f5="univer-notification-fade-out",Ke={notification:V0,notificationNotice:A0,notificationNoticeWrapper:j0,notificationNoticeContent:P0,notificationNoticeClose:$0,notificationIcon:k0,notificationIconSuccess:B0,notificationIconInfo:U0,notificationIconWarning:F0,notificationIconError:z0,notificationContentContainer:Z0,notificationTitle:W0,notificationContent:G0,notificationContentEllipsis:Y0,notificationTop:q0,notificationTopLeft:X0,notificationTopRight:Q0,notificationBottom:J0,notificationBottomRight:K0,notificationBottomLeft:e5,notificationFade:t5,notificationFadeAppearPrepare:n5,notificationFadeAppearStart:r5,notificationFadeAppearActive:i5,notificationFadeAppear:o5,notificationFadeEnter:a5,notificationFadeLeave:s5,notificationFadeEnterActive:l5,notificationFadeIn:c5,notificationFadeLeaveActive:u5,notificationFadeOut:f5},d5={success:g.jsx(S6,{className:Ke.notificationIconSuccess}),info:g.jsx(Jt,{className:Ke.notificationIconInfo}),warning:g.jsx(Jt,{className:Ke.notificationIconWarning}),error:g.jsx(g3,{className:Ke.notificationIconError})},ji=new re.Subject,h5=e=>{const{type:t,content:n,title:r,lines:i=0}=e,o=Ue(Ke.notificationContent,{[Ke.notificationContentEllipsis]:i!==0});return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:Ke.notificationIcon,children:d5[t]}),g.jsxs("div",{className:Ke.notificationContentContainer,children:[g.jsx("span",{className:Ke.notificationTitle,children:r}),g.jsx("span",{className:o,style:{WebkitLineClamp:i},children:n})]})]})};function p5(){const{mountContainer:e}=s.useContext(ue.ConfigContext);if(!e)return null;const[t,n]=N0({prefixCls:Ke.notification,maxCount:3,closeIcon:g.jsx(D1,{}),getContainer:()=>e,motion:{motionName:Ke.notificationFade,motionAppear:!0,motionEnter:!0,motionLeave:!0}}),r=s.useRef(ji);return s.useEffect(()=>{const i=r.current.subscribe(o=>{var a,c,h;t.open({content:g.jsx(h5,{content:o.content,type:o.type,title:o.title,lines:o.lines}),key:o.key,placement:(a=o.placement)!=null?a:"topRight",duration:(c=o.duration)!=null?c:4.5,closable:(h=o.closable)!=null?h:!0})});return()=>{i.unsubscribe()}},[t]),g.jsx(g.Fragment,{children:n})}const v5={show:e=>{ji.next(e)}};var g5=Object.defineProperty,m5=Object.getOwnPropertyDescriptor,C5=(e,t,n,r)=>{for(var i=r>1?void 0:r?m5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&g5(t,n,i),i},Ir=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopNotificationService=class extends u.Disposable{constructor(t,n){super(),this._injector=t,this._uiPartsService=n,this._initUIPart()}show(t){return v5.show(t),u.toDisposable(()=>{})}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(we.GLOBAL,()=>u.connectInjector(p5,this._injector)))}};exports.DesktopNotificationService=C5([Ir(0,u.Inject(u.Injector)),Ir(1,n1)],exports.DesktopNotificationService);var b5=Object.defineProperty,S5=Object.getOwnPropertyDescriptor,_5=(e,t,n,r)=>{for(var i=r>1?void 0:r?S5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&b5(t,n,i),i},y5=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopGlobalZoneService=class{constructor(t){A(this,"visible$",new re.Subject);A(this,"componentKey$",new re.Subject);A(this,"_componentKey","");this._componentManager=t}get componentKey(){return this._componentKey}set(t,n){return this._componentManager.register(t,n),this.componentKey$.next(t),this._componentKey=t,u.toDisposable(()=>{this._componentManager.delete(t),this.visible$.complete(),this.componentKey$.complete()})}open(){this.visible$.next(!0)}close(){this.visible$.next(!1)}};exports.DesktopGlobalZoneService=_5([y5(0,u.Inject(qe))],exports.DesktopGlobalZoneService);class Vn{constructor(){A(this,"_sidebarOptions",{});A(this,"sidebarOptions$",new re.Subject);A(this,"scrollEvent$",new re.Subject)}open(t){return this._sidebarOptions={...t,visible:!0},this.sidebarOptions$.next(this._sidebarOptions),u.toDisposable(()=>{this.close()})}close(){this._sidebarOptions={...this._sidebarOptions,visible:!1},this.sidebarOptions$.next(this._sidebarOptions),this._sidebarOptions.onClose&&this._sidebarOptions.onClose()}}var L5=Object.defineProperty,E5=Object.getOwnPropertyDescriptor,w5=(e,t,n,r)=>{for(var i=r>1?void 0:r?E5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&L5(t,n,i),i},Or=(e,t)=>(n,r)=>t(n,r,e);exports.ErrorController=class extends u.Disposable{constructor(t,n){super(),this._errorService=t,this._messageService=n,this.disposeWithMe(u.toDisposable(this._errorService.error$.subscribe(r=>{this._messageService.show({content:r.errorKey,type:ue.MessageType.Error})})))}};exports.ErrorController=w5([u.OnLifecycle(u.LifecycleStages.Starting,exports.ErrorController),Or(0,u.Inject(u.ErrorService)),Or(1,w1)],exports.ErrorController);class Dt extends u.Disposable{constructor(){super(...arguments);A(this,"_open$",new re.BehaviorSubject(!1));A(this,"open$",this._open$.pipe(re.distinctUntilChanged()))}get isOpen(){return this._open$.getValue()}dispose(){super.dispose(),this._open$.next(!1),this._open$.complete()}open(){this._open$.next(!0)}close(){this._open$.next(!1)}}const Pi="ShortcutPanel",Nt={id:"base-ui.operation.toggle-shortcut-panel",type:u.CommandType.OPERATION,handler:e=>{const t=e.get(Dt),n=e.get(P1);return t.isOpen?(t.close(),n.close()):(t.open(),n.open({header:{title:"shortcut-panel.title"},children:{label:Pi}})),!0}},M5="univer-shortcut-panel-group-title",R5="univer-shortcut-panel-item",x5="univer-shortcut-panel-item-title",I5="univer-shortcut-panel-item-shortcut",b1={shortcutPanelGroupTitle:M5,shortcutPanelItem:R5,shortcutPanelItemTitle:x5,shortcutPanelItemShortcut:I5};function O5(){const e=u.useDependency(g1),t=u.useDependency(u.LocaleService),n=F9.useObservable(t.currentLocale$),[r,i]=s.useState([]),o=s.useCallback(()=>{var v;const a=new Map,c=e.getAllShortcuts().filter(p=>!!p.group);for(const p of c){const d=p.group,m={title:t.t((v=p.description)!=null?v:p.id),shortcut:e.getShortcutDisplay(p)};if(!/\d+_[a-zA-Z0-9]/.test(d))throw new Error(`[ShortcutPanel]: Invalid shortcut group: ${d}!`);a.has(d)||a.set(d,[]),a.get(d).push(m)}const h=Array.from(a.entries()).map(([p,d])=>{const m=p.split("_")[0],_=p.slice(m.length+1);return{sequence:+m,name:t.t(_),items:d}}).sort((p,d)=>p.sequence-d.sequence);i(h)},[e,t,n]);return s.useEffect(()=>{o();const a=e.shortcutChanged$.subscribe(()=>o());return()=>a.unsubscribe()},[e,o]),g.jsx("div",{className:b1.shortcutPanel,children:r.map(a=>g.jsxs("div",{className:b1.shortcutPanelGroup,children:[g.jsx("div",{className:b1.shortcutPanelGroupTitle,children:a.name}),a.items.map((c,h)=>g.jsxs("div",{className:b1.shortcutPanelItem,children:[g.jsx("span",{className:b1.shortcutPanelItemTitle,children:c.title}),g.jsx("span",{className:b1.shortcutPanelItemShortcut,children:c.shortcut})]},`${c.title}-${c.shortcut}`))]},a.name))})}function H5(e){return{id:Nt.id,title:"toggle-shortcut-panel",tooltip:"toggle-shortcut-panel",icon:"KeyboardSingle",type:ke.BUTTON,positions:[Ye.TOOLBAR_START],hidden$:D6(e,u.UniverInstanceType.UNIVER_SHEET)}}var T5=Object.defineProperty,D5=Object.getOwnPropertyDescriptor,N5=(e,t,n,r)=>{for(var i=r>1?void 0:r?D5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&T5(t,n,i),i},x1=(e,t)=>(n,r)=>t(n,r,e);const V5={id:Nt.id,binding:Pe.CTRL_COMMAND|u1.BACK_SLASH,description:"shortcut.shortcut-panel",group:"10_global-shortcut"};exports.ShortcutPanelController=class extends u.Disposable{constructor(t,n,r,i,o,a){super(),this._config=t;const{menu:c={}}=this._config;this.disposeWithMe(o.addMenuItem(n.invoke(H5),c)),this.disposeWithMe(r.register(Pi,O5)),this.disposeWithMe(a.registerCommand(Nt)),this.disposeWithMe(i.registerShortcut(V5))}};exports.ShortcutPanelController=N5([u.OnLifecycle(u.LifecycleStages.Steady,exports.ShortcutPanelController),x1(1,u.Inject(u.Injector)),x1(2,u.Inject(qe)),x1(3,g1),x1(4,a1),x1(5,u.ICommandService)],exports.ShortcutPanelController);function Q1(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $i={exports:{}};/*!
|
|
41
|
+
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,y0="".concat(S0," ").concat(_0).split(/[\s\n]+/),L0="aria-",E0="data-";function Er(e,t){return e.indexOf(t)===0}function w0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=ge({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||Er(i,L0))||n.data&&Er(i,E0)||n.attr&&y0.includes(i))&&(r[i]=e[i])}),r}var M0=K.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,i=e.className,o=e.duration,a=o===void 0?4.5:o,c=e.showProgress,h=e.pauseOnHover,v=h===void 0?!0:h,p=e.eventKey,f=e.content,m=e.closable,_=e.closeIcon,L=_===void 0?"x":_,x=e.props,w=e.onClick,j=e.onNoticeClose,Z=e.times,U=e.hovering,J=K.useState(!1),E=He(J,2),D=E[0],k=E[1],$=K.useState(0),F=He($,2),z=F[0],Y=F[1],ne=K.useState(0),ie=He(ne,2),ce=ie[0],ae=ie[1],Q=U||D,oe=a>0&&c,he=function(){j(p)},T=function(q){(q.key==="Enter"||q.code==="Enter"||q.keyCode===te.ENTER)&&he()};K.useEffect(function(){if(!Q&&a>0){var W=Date.now()-ce,q=setTimeout(function(){he()},a*1e3-ce);return function(){v&&clearTimeout(q),ae(Date.now()-W)}}},[a,Q,Z]),K.useEffect(function(){if(!Q&&oe&&(v||ce===0)){var W=performance.now(),q,se=function _e(){cancelAnimationFrame(q),q=requestAnimationFrame(function(Me){var Ee=Me+ce-W,fe=Math.min(Ee/(a*1e3),1);Y(fe*100),fe<1&&_e()})};return se(),function(){v&&cancelAnimationFrame(q)}}},[a,ce,Q,oe,Z]);var M=K.useMemo(function(){return Ze(m)==="object"&&m!==null?m:m?{closeIcon:L}:{}},[m,L]),I=w0(M,!0),B=100-(!z||z<0?0:z>100?100:z),G="".concat(n,"-notice");return K.createElement("div",p1({},x,{ref:t,className:O1(G,i,Ne({},"".concat(G,"-closable"),m)),style:r,onMouseEnter:function(q){var se;k(!0),x==null||(se=x.onMouseEnter)===null||se===void 0||se.call(x,q)},onMouseLeave:function(q){var se;k(!1),x==null||(se=x.onMouseLeave)===null||se===void 0||se.call(x,q)},onClick:w}),K.createElement("div",{className:"".concat(G,"-content")},f),m&&K.createElement("a",p1({tabIndex:0,className:"".concat(G,"-close"),onKeyDown:T,"aria-label":"Close"},I,{onClick:function(q){q.preventDefault(),q.stopPropagation(),he()}}),M.closeIcon),oe&&K.createElement("progress",{className:"".concat(G,"-progress"),max:"100",value:B},B+"%"))}),R0=s.createContext({}),wr=8,Mr=3,Rr=16,x0=function(t){var n={offset:wr,threshold:Mr,gap:Rr};if(t&&Ze(t)==="object"){var r,i,o;n.offset=(r=t.offset)!==null&&r!==void 0?r:wr,n.threshold=(i=t.threshold)!==null&&i!==void 0?i:Mr,n.gap=(o=t.gap)!==null&&o!==void 0?o:Rr}return[!!t,n]},I0=["className","style","classNames","styles"],O0=function(t){var n=t.configList,r=t.placement,i=t.prefixCls,o=t.className,a=t.style,c=t.motion,h=t.onAllNoticeRemoved,v=t.onNoticeClose,p=t.stack,f=s.useContext(R0),m=f.classNames,_=s.useRef({}),L=s.useState(null),x=He(L,2),w=x[0],j=x[1],Z=s.useState([]),U=He(Z,2),J=U[0],E=U[1],D=n.map(function(Q){return{config:Q,key:String(Q.key)}}),k=x0(p),$=He(k,2),F=$[0],z=$[1],Y=z.offset,ne=z.threshold,ie=z.gap,ce=F&&(J.length>0||D.length<=ne),ae=typeof c=="function"?c(r):c;return s.useEffect(function(){F&&J.length>1&&E(function(Q){return Q.filter(function(oe){return D.some(function(he){var T=he.key;return oe===T})})})},[J,D,F]),s.useEffect(function(){var Q;if(F&&_.current[(Q=D[D.length-1])===null||Q===void 0?void 0:Q.key]){var oe;j(_.current[(oe=D[D.length-1])===null||oe===void 0?void 0:oe.key])}},[D,F]),s.createElement(b0,p1({key:r,className:O1(i,"".concat(i,"-").concat(r),m==null?void 0:m.list,o,Ne(Ne({},"".concat(i,"-stack"),!!F),"".concat(i,"-stack-expanded"),ce)),style:a,keys:D,motionAppear:!0},ae,{onAllRemoved:function(){h(r)}}),function(Q,oe){var he=Q.config,T=Q.className,M=Q.style,I=Q.index,B=he,G=B.key,W=B.times,q=String(G),se=he,_e=se.className,Me=se.style,Ee=se.classNames,fe=se.styles,Ve=lt(se,I0),$e=D.findIndex(function(f1){return f1.key===q}),Ae={};if(F){var Ie=D.length-1-($e>-1?$e:I-1),ee=r==="top"||r==="bottom"?"-50%":"0";if(Ie>0){var de,pe,Te;Ae.height=ce?(de=_.current[q])===null||de===void 0?void 0:de.offsetHeight:w==null?void 0:w.offsetHeight;for(var me=0,ye=0;ye<Ie;ye++){var Se;me+=((Se=_.current[D[D.length-1-ye].key])===null||Se===void 0?void 0:Se.offsetHeight)+ie}var je=(ce?me:Ie*Y)*(r.startsWith("top")?1:-1),k1=!ce&&w!==null&&w!==void 0&&w.offsetWidth&&(pe=_.current[q])!==null&&pe!==void 0&&pe.offsetWidth?((w==null?void 0:w.offsetWidth)-Y*2*(Ie<3?Ie:3))/((Te=_.current[q])===null||Te===void 0?void 0:Te.offsetWidth):1;Ae.transform="translate3d(".concat(ee,", ").concat(je,"px, 0) scaleX(").concat(k1,")")}else Ae.transform="translate3d(".concat(ee,", 0, 0)")}return s.createElement("div",{ref:oe,className:O1("".concat(i,"-notice-wrapper"),T,Ee==null?void 0:Ee.wrapper),style:ge(ge(ge({},M),Ae),fe==null?void 0:fe.wrapper),onMouseEnter:function(){return E(function(e1){return e1.includes(q)?e1:[].concat(I1(e1),[q])})},onMouseLeave:function(){return E(function(e1){return e1.filter(function(B1){return B1!==q})})}},s.createElement(M0,p1({},Ve,{ref:function(e1){$e>-1?_.current[q]=e1:delete _.current[q]},prefixCls:i,classNames:Ee,styles:fe,className:O1(_e,m==null?void 0:m.notice),style:Me,times:W,key:G,eventKey:G,onNoticeClose:v,hovering:F&&J.length>0})))})},H0=K.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-notification":n,i=e.container,o=e.motion,a=e.maxCount,c=e.className,h=e.style,v=e.onAllRemoved,p=e.stack,f=e.renderNotifications,m=K.useState([]),_=He(m,2),L=_[0],x=_[1],w=function(F){var z,Y=L.find(function(ne){return ne.key===F});Y==null||(z=Y.onClose)===null||z===void 0||z.call(Y),x(function(ne){return ne.filter(function(ie){return ie.key!==F})})};K.useImperativeHandle(t,function(){return{open:function(F){x(function(z){var Y=I1(z),ne=Y.findIndex(function(ae){return ae.key===F.key}),ie=ge({},F);if(ne>=0){var ce;ie.times=(((ce=z[ne])===null||ce===void 0?void 0:ce.times)||0)+1,Y[ne]=ie}else ie.times=0,Y.push(ie);return a>0&&Y.length>a&&(Y=Y.slice(-a)),Y})},close:function(F){w(F)},destroy:function(){x([])}}});var j=K.useState({}),Z=He(j,2),U=Z[0],J=Z[1];K.useEffect(function(){var $={};L.forEach(function(F){var z=F.placement,Y=z===void 0?"topRight":z;Y&&($[Y]=$[Y]||[],$[Y].push(F))}),Object.keys(U).forEach(function(F){$[F]=$[F]||[]}),J($)},[L]);var E=function(F){J(function(z){var Y=ge({},z),ne=Y[F]||[];return ne.length||delete Y[F],Y})},D=K.useRef(!1);if(K.useEffect(function(){Object.keys(U).length>0?D.current=!0:D.current&&(v==null||v(),D.current=!1)},[U]),!i)return null;var k=Object.keys(U);return H1.createPortal(K.createElement(K.Fragment,null,k.map(function($){var F=U[$],z=K.createElement(O0,{key:$,configList:F,placement:$,prefixCls:r,className:c==null?void 0:c($),style:h==null?void 0:h($),motion:o,onNoticeClose:w,onAllNoticeRemoved:E,stack:p});return f?f(z,{prefixCls:r,key:$}):z})),i)}),T0=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],D0=function(){return document.body},xr=0;function N0(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(i){i&&Object.keys(i).forEach(function(o){var a=i[o];a!==void 0&&(e[o]=a)})}),e}function V0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getContainer,n=t===void 0?D0:t,r=e.motion,i=e.prefixCls,o=e.maxCount,a=e.className,c=e.style,h=e.onAllRemoved,v=e.stack,p=e.renderNotifications,f=lt(e,T0),m=K.useState(),_=He(m,2),L=_[0],x=_[1],w=K.useRef(),j=K.createElement(H0,{container:L,ref:w,prefixCls:i,motion:r,maxCount:o,className:a,style:c,onAllRemoved:h,stack:v,renderNotifications:p}),Z=K.useState([]),U=He(Z,2),J=U[0],E=U[1],D=K.useMemo(function(){return{open:function($){var F=N0(f,$);(F.key===null||F.key===void 0)&&(F.key="rc-notification-".concat(xr),xr+=1),E(function(z){return[].concat(I1(z),[{type:"open",config:F}])})},close:function($){E(function(F){return[].concat(I1(F),[{type:"close",key:$}])})},destroy:function(){E(function($){return[].concat(I1($),[{type:"destroy"}])})}}},[]);return K.useEffect(function(){x(n())}),K.useEffect(function(){w.current&&J.length&&(J.forEach(function(k){switch(k.type){case"open":w.current.open(k.config);break;case"close":w.current.close(k.key);break;case"destroy":w.current.destroy();break}}),E(function(k){return k.filter(function($){return!J.includes($)})}))},[J]),[D,j]}const A0="univer-notification",j0="univer-notification-notice",P0="univer-notification-notice-wrapper",$0="univer-notification-notice-content",k0="univer-notification-notice-close",B0="univer-notification-icon",U0="univer-notification-icon-success",F0="univer-notification-icon-info",z0="univer-notification-icon-warning",Z0="univer-notification-icon-error",W0="univer-notification-content-container",G0="univer-notification-title",Y0="univer-notification-content",q0="univer-notification-content-ellipsis",X0="univer-notification-top",Q0="univer-notification-topLeft",J0="univer-notification-topRight",K0="univer-notification-bottom",e5="univer-notification-bottomRight",t5="univer-notification-bottomLeft",n5="univer-notification-fade",r5="univer-notification-fade-appear-prepare",i5="univer-notification-fade-appear-start",o5="univer-notification-fade-appear-active",a5="univer-notification-fade-appear",s5="univer-notification-fade-enter",l5="univer-notification-fade-leave",c5="univer-notification-fade-enter-active",u5="univer-notification-fade-in",f5="univer-notification-fade-leave-active",d5="univer-notification-fade-out",Ke={notification:A0,notificationNotice:j0,notificationNoticeWrapper:P0,notificationNoticeContent:$0,notificationNoticeClose:k0,notificationIcon:B0,notificationIconSuccess:U0,notificationIconInfo:F0,notificationIconWarning:z0,notificationIconError:Z0,notificationContentContainer:W0,notificationTitle:G0,notificationContent:Y0,notificationContentEllipsis:q0,notificationTop:X0,notificationTopLeft:Q0,notificationTopRight:J0,notificationBottom:K0,notificationBottomRight:e5,notificationBottomLeft:t5,notificationFade:n5,notificationFadeAppearPrepare:r5,notificationFadeAppearStart:i5,notificationFadeAppearActive:o5,notificationFadeAppear:a5,notificationFadeEnter:s5,notificationFadeLeave:l5,notificationFadeEnterActive:c5,notificationFadeIn:u5,notificationFadeLeaveActive:f5,notificationFadeOut:d5},h5={success:g.jsx(S6,{className:Ke.notificationIconSuccess}),info:g.jsx(Jt,{className:Ke.notificationIconInfo}),warning:g.jsx(Jt,{className:Ke.notificationIconWarning}),error:g.jsx(g3,{className:Ke.notificationIconError})},ji=new re.Subject,p5=e=>{const{type:t,content:n,title:r,lines:i=0}=e,o=Ue(Ke.notificationContent,{[Ke.notificationContentEllipsis]:i!==0});return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:Ke.notificationIcon,children:h5[t]}),g.jsxs("div",{className:Ke.notificationContentContainer,children:[g.jsx("span",{className:Ke.notificationTitle,children:r}),g.jsx("span",{className:o,style:{WebkitLineClamp:i},children:n})]})]})};function v5(){const{mountContainer:e}=s.useContext(ue.ConfigContext);if(!e)return null;const[t,n]=V0({prefixCls:Ke.notification,maxCount:3,closeIcon:g.jsx(D1,{}),getContainer:()=>e,motion:{motionName:Ke.notificationFade,motionAppear:!0,motionEnter:!0,motionLeave:!0}}),r=s.useRef(ji);return s.useEffect(()=>{const i=r.current.subscribe(o=>{var a,c,h;t.open({content:g.jsx(p5,{content:o.content,type:o.type,title:o.title,lines:o.lines}),key:o.key,placement:(a=o.placement)!=null?a:"topRight",duration:(c=o.duration)!=null?c:4.5,closable:(h=o.closable)!=null?h:!0})});return()=>{i.unsubscribe()}},[t]),g.jsx(g.Fragment,{children:n})}const g5={show:e=>{ji.next(e)}};var m5=Object.defineProperty,C5=Object.getOwnPropertyDescriptor,b5=(e,t,n,r)=>{for(var i=r>1?void 0:r?C5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&m5(t,n,i),i},Ir=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopNotificationService=class extends u.Disposable{constructor(t,n){super(),this._injector=t,this._uiPartsService=n,this._initUIPart()}show(t){return g5.show(t),u.toDisposable(()=>{})}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(we.GLOBAL,()=>u.connectInjector(v5,this._injector)))}};exports.DesktopNotificationService=b5([Ir(0,u.Inject(u.Injector)),Ir(1,n1)],exports.DesktopNotificationService);var S5=Object.defineProperty,_5=Object.getOwnPropertyDescriptor,y5=(e,t,n,r)=>{for(var i=r>1?void 0:r?_5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&S5(t,n,i),i},L5=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopGlobalZoneService=class{constructor(t){A(this,"visible$",new re.Subject);A(this,"componentKey$",new re.Subject);A(this,"_componentKey","");this._componentManager=t}get componentKey(){return this._componentKey}set(t,n){return this._componentManager.register(t,n),this.componentKey$.next(t),this._componentKey=t,u.toDisposable(()=>{this._componentManager.delete(t),this.visible$.complete(),this.componentKey$.complete()})}open(){this.visible$.next(!0)}close(){this.visible$.next(!1)}};exports.DesktopGlobalZoneService=y5([L5(0,u.Inject(qe))],exports.DesktopGlobalZoneService);class Vn{constructor(){A(this,"_sidebarOptions",{});A(this,"sidebarOptions$",new re.Subject);A(this,"scrollEvent$",new re.Subject)}open(t){return this._sidebarOptions={...t,visible:!0},this.sidebarOptions$.next(this._sidebarOptions),u.toDisposable(()=>{this.close()})}close(){this._sidebarOptions={...this._sidebarOptions,visible:!1},this.sidebarOptions$.next(this._sidebarOptions),this._sidebarOptions.onClose&&this._sidebarOptions.onClose()}}var E5=Object.defineProperty,w5=Object.getOwnPropertyDescriptor,M5=(e,t,n,r)=>{for(var i=r>1?void 0:r?w5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&E5(t,n,i),i},Or=(e,t)=>(n,r)=>t(n,r,e);exports.ErrorController=class extends u.Disposable{constructor(t,n){super(),this._errorService=t,this._messageService=n,this.disposeWithMe(u.toDisposable(this._errorService.error$.subscribe(r=>{this._messageService.show({content:r.errorKey,type:ue.MessageType.Error})})))}};exports.ErrorController=M5([u.OnLifecycle(u.LifecycleStages.Starting,exports.ErrorController),Or(0,u.Inject(u.ErrorService)),Or(1,w1)],exports.ErrorController);class Dt extends u.Disposable{constructor(){super(...arguments);A(this,"_open$",new re.BehaviorSubject(!1));A(this,"open$",this._open$.pipe(re.distinctUntilChanged()))}get isOpen(){return this._open$.getValue()}dispose(){super.dispose(),this._open$.next(!1),this._open$.complete()}open(){this._open$.next(!0)}close(){this._open$.next(!1)}}const Pi="ShortcutPanel",Nt={id:"base-ui.operation.toggle-shortcut-panel",type:u.CommandType.OPERATION,handler:e=>{const t=e.get(Dt),n=e.get(P1);return t.isOpen?(t.close(),n.close()):(t.open(),n.open({header:{title:"shortcut-panel.title"},children:{label:Pi}})),!0}},R5="univer-shortcut-panel-group-title",x5="univer-shortcut-panel-item",I5="univer-shortcut-panel-item-title",O5="univer-shortcut-panel-item-shortcut",b1={shortcutPanelGroupTitle:R5,shortcutPanelItem:x5,shortcutPanelItemTitle:I5,shortcutPanelItemShortcut:O5};function H5(){const e=u.useDependency(g1),t=u.useDependency(u.LocaleService),n=F9.useObservable(t.currentLocale$),[r,i]=s.useState([]),o=s.useCallback(()=>{var v;const a=new Map,c=e.getAllShortcuts().filter(p=>!!p.group);for(const p of c){const f=p.group,m={title:t.t((v=p.description)!=null?v:p.id),shortcut:e.getShortcutDisplay(p)};if(!/\d+_[a-zA-Z0-9]/.test(f))throw new Error(`[ShortcutPanel]: Invalid shortcut group: ${f}!`);a.has(f)||a.set(f,[]),a.get(f).push(m)}const h=Array.from(a.entries()).map(([p,f])=>{const m=p.split("_")[0],_=p.slice(m.length+1);return{sequence:+m,name:t.t(_),items:f}}).sort((p,f)=>p.sequence-f.sequence);i(h)},[e,t,n]);return s.useEffect(()=>{o();const a=e.shortcutChanged$.subscribe(()=>o());return()=>a.unsubscribe()},[e,o]),g.jsx("div",{className:b1.shortcutPanel,children:r.map(a=>g.jsxs("div",{className:b1.shortcutPanelGroup,children:[g.jsx("div",{className:b1.shortcutPanelGroupTitle,children:a.name}),a.items.map((c,h)=>g.jsxs("div",{className:b1.shortcutPanelItem,children:[g.jsx("span",{className:b1.shortcutPanelItemTitle,children:c.title}),g.jsx("span",{className:b1.shortcutPanelItemShortcut,children:c.shortcut})]},`${c.title}-${c.shortcut}`))]},a.name))})}function T5(e){return{id:Nt.id,title:"toggle-shortcut-panel",tooltip:"toggle-shortcut-panel",icon:"KeyboardSingle",type:ke.BUTTON,positions:[Ye.TOOLBAR_START],hidden$:D6(e,u.UniverInstanceType.UNIVER_SHEET)}}var D5=Object.defineProperty,N5=Object.getOwnPropertyDescriptor,V5=(e,t,n,r)=>{for(var i=r>1?void 0:r?N5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&D5(t,n,i),i},x1=(e,t)=>(n,r)=>t(n,r,e);const A5={id:Nt.id,binding:Pe.CTRL_COMMAND|u1.BACK_SLASH,description:"shortcut.shortcut-panel",group:"10_global-shortcut"};exports.ShortcutPanelController=class extends u.Disposable{constructor(t,n,r,i,o,a){super(),this._config=t;const{menu:c={}}=this._config;this.disposeWithMe(o.addMenuItem(n.invoke(T5),c)),this.disposeWithMe(r.register(Pi,H5)),this.disposeWithMe(a.registerCommand(Nt)),this.disposeWithMe(i.registerShortcut(A5))}};exports.ShortcutPanelController=V5([u.OnLifecycle(u.LifecycleStages.Steady,exports.ShortcutPanelController),x1(1,u.Inject(u.Injector)),x1(2,u.Inject(qe)),x1(3,g1),x1(4,a1),x1(5,u.ICommandService)],exports.ShortcutPanelController);function Q1(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $i={exports:{}};/*!
|
|
42
42
|
localForage -- Offline Storage, Improved
|
|
43
43
|
Version 1.10.0
|
|
44
44
|
https://localforage.github.io/localForage
|
|
45
45
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
46
|
-
*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,o){function a(v,p){if(!i[v]){if(!r[v]){var d=typeof Q1=="function"&&Q1;if(!p&&d)return d(v,!0);if(c)return c(v,!0);var m=new Error("Cannot find module '"+v+"'");throw m.code="MODULE_NOT_FOUND",m}var _=i[v]={exports:{}};r[v][0].call(_.exports,function(L){var x=r[v][1][L];return a(x||L)},_,_.exports,n,r,i,o)}return i[v].exports}for(var c=typeof Q1=="function"&&Q1,h=0;h<o.length;h++)a(o[h]);return a}({1:[function(n,r,i){(function(o){var a=o.MutationObserver||o.WebKitMutationObserver,c;if(a){var h=0,v=new a(L),p=o.document.createTextNode("");v.observe(p,{characterData:!0}),c=function(){p.data=h=++h%2}}else if(!o.setImmediate&&typeof o.MessageChannel<"u"){var d=new o.MessageChannel;d.port1.onmessage=L,c=function(){d.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?c=function(){var w=o.document.createElement("script");w.onreadystatechange=function(){L(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},o.document.documentElement.appendChild(w)}:c=function(){setTimeout(L,0)};var m,_=[];function L(){m=!0;for(var w,j,Z=_.length;Z;){for(j=_,_=[],w=-1;++w<Z;)j[w]();Z=_.length}m=!1}r.exports=x;function x(w){_.push(w)===1&&!m&&c()}}).call(this,typeof F1<"u"?F1:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var o=n(1);function a(){}var c={},h=["REJECTED"],v=["FULFILLED"],p=["PENDING"];r.exports=d;function d(E){if(typeof E!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,E!==a&&x(this,E)}d.prototype.catch=function(E){return this.then(null,E)},d.prototype.then=function(E,D){if(typeof E!="function"&&this.state===v||typeof D!="function"&&this.state===h)return this;var k=new this.constructor(a);if(this.state!==p){var $=this.state===v?E:D;_(k,$,this.outcome)}else this.queue.push(new m(k,E,D));return k};function m(E,D,k){this.promise=E,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}m.prototype.callFulfilled=function(E){c.resolve(this.promise,E)},m.prototype.otherCallFulfilled=function(E){_(this.promise,this.onFulfilled,E)},m.prototype.callRejected=function(E){c.reject(this.promise,E)},m.prototype.otherCallRejected=function(E){_(this.promise,this.onRejected,E)};function _(E,D,k){o(function(){var $;try{$=D(k)}catch(F){return c.reject(E,F)}$===E?c.reject(E,new TypeError("Cannot resolve promise with itself")):c.resolve(E,$)})}c.resolve=function(E,D){var k=w(L,D);if(k.status==="error")return c.reject(E,k.value);var $=k.value;if($)x(E,$);else{E.state=v,E.outcome=D;for(var F=-1,z=E.queue.length;++F<z;)E.queue[F].callFulfilled(D)}return E},c.reject=function(E,D){E.state=h,E.outcome=D;for(var k=-1,$=E.queue.length;++k<$;)E.queue[k].callRejected(D);return E};function L(E){var D=E&&E.then;if(E&&(typeof E=="object"||typeof E=="function")&&typeof D=="function")return function(){D.apply(E,arguments)}}function x(E,D){var k=!1;function $(ne){k||(k=!0,c.reject(E,ne))}function F(ne){k||(k=!0,c.resolve(E,ne))}function z(){D(F,$)}var Y=w(z);Y.status==="error"&&$(Y.value)}function w(E,D){var k={};try{k.value=E(D),k.status="success"}catch($){k.status="error",k.value=$}return k}d.resolve=j;function j(E){return E instanceof this?E:c.resolve(new this(a),E)}d.reject=Z;function Z(E){var D=new this(a);return c.reject(D,E)}d.all=U;function U(E){var D=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=E.length,$=!1;if(!k)return this.resolve([]);for(var F=new Array(k),z=0,Y=-1,ne=new this(a);++Y<k;)ie(E[Y],Y);return ne;function ie(ce,ae){D.resolve(ce).then(Q,function(oe){$||($=!0,c.reject(ne,oe))});function Q(oe){F[ae]=oe,++z===k&&!$&&($=!0,c.resolve(ne,F))}}}d.race=J;function J(E){var D=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=E.length,$=!1;if(!k)return this.resolve([]);for(var F=-1,z=new this(a);++F<k;)Y(E[F]);return z;function Y(ne){D.resolve(ne).then(function(ie){$||($=!0,c.resolve(z,ie))},function(ie){$||($=!0,c.reject(z,ie))})}}},{1:1}],3:[function(n,r,i){(function(o){typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,typeof F1<"u"?F1:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function a(l,C){if(!(l instanceof C))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=c();function v(){try{if(!h||!h.open)return!1;var l=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),C=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||C)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function p(l,C){l=l||[],C=C||{};try{return new Blob(l,C)}catch(b){if(b.name!=="TypeError")throw b;for(var f=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,S=new f,y=0;y<l.length;y+=1)S.append(l[y]);return S.getBlob(C.type)}}typeof Promise>"u"&&n(3);var d=Promise;function m(l,C){C&&l.then(function(f){C(null,f)},function(f){C(f)})}function _(l,C,f){typeof C=="function"&&l.then(C),typeof f=="function"&&l.catch(f)}function L(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function x(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",j=void 0,Z={},U=Object.prototype.toString,J="readonly",E="readwrite";function D(l){for(var C=l.length,f=new ArrayBuffer(C),S=new Uint8Array(f),y=0;y<C;y++)S[y]=l.charCodeAt(y);return f}function k(l){return new d(function(C){var f=l.transaction(w,E),S=p([""]);f.objectStore(w).put(S,"key"),f.onabort=function(y){y.preventDefault(),y.stopPropagation(),C(!1)},f.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),b=navigator.userAgent.match(/Edge\//);C(b||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function $(l){return typeof j=="boolean"?d.resolve(j):k(l).then(function(C){return j=C,j})}function F(l){var C=Z[l.name],f={};f.promise=new d(function(S,y){f.resolve=S,f.reject=y}),C.deferredOperations.push(f),C.dbReady?C.dbReady=C.dbReady.then(function(){return f.promise}):C.dbReady=f.promise}function z(l){var C=Z[l.name],f=C.deferredOperations.pop();if(f)return f.resolve(),f.promise}function Y(l,C){var f=Z[l.name],S=f.deferredOperations.pop();if(S)return S.reject(C),S.promise}function ne(l,C){return new d(function(f,S){if(Z[l.name]=Z[l.name]||B(),l.db)if(C)F(l),l.db.close();else return f(l.db);var y=[l.name];C&&y.push(l.version);var b=h.open.apply(h,y);C&&(b.onupgradeneeded=function(R){var H=b.result;try{H.createObjectStore(l.storeName),R.oldVersion<=1&&H.createObjectStore(w)}catch(N){if(N.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw N}}),b.onerror=function(R){R.preventDefault(),S(b.error)},b.onsuccess=function(){var R=b.result;R.onversionchange=function(H){H.target.close()},f(R),z(l)}})}function ie(l){return ne(l,!1)}function ce(l){return ne(l,!0)}function ae(l,C){if(!l.db)return!0;var f=!l.db.objectStoreNames.contains(l.storeName),S=l.version<l.db.version,y=l.version>l.db.version;if(S&&(l.version!==C&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),y||f){if(f){var b=l.db.version+1;b>l.version&&(l.version=b)}return!0}return!1}function Q(l){return new d(function(C,f){var S=new FileReader;S.onerror=f,S.onloadend=function(y){var b=btoa(y.target.result||"");C({__local_forage_encoded_blob:!0,data:b,type:l.type})},S.readAsBinaryString(l)})}function oe(l){var C=D(atob(l.data));return p([C],{type:l.type})}function he(l){return l&&l.__local_forage_encoded_blob}function T(l){var C=this,f=C._initReady().then(function(){var S=Z[C._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return _(f,l,l),f}function M(l){F(l);for(var C=Z[l.name],f=C.forages,S=0;S<f.length;S++){var y=f[S];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return l.db=null,ie(l).then(function(b){return l.db=b,ae(l)?ce(l):b}).then(function(b){l.db=C.db=b;for(var R=0;R<f.length;R++)f[R]._dbInfo.db=b}).catch(function(b){throw Y(l,b),b})}function I(l,C,f,S){S===void 0&&(S=1);try{var y=l.db.transaction(l.storeName,C);f(null,y)}catch(b){if(S>0&&(!l.db||b.name==="InvalidStateError"||b.name==="NotFoundError"))return d.resolve().then(function(){if(!l.db||b.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),ce(l)}).then(function(){return M(l).then(function(){I(l,C,f,S-1)})}).catch(f);f(b)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function G(l){var C=this,f={db:null};if(l)for(var S in l)f[S]=l[S];var y=Z[f.name];y||(y=B(),Z[f.name]=y),y.forages.push(C),C._initReady||(C._initReady=C.ready,C.ready=T);var b=[];function R(){return d.resolve()}for(var H=0;H<y.forages.length;H++){var N=y.forages[H];N!==C&&b.push(N._initReady().catch(R))}var V=y.forages.slice(0);return d.all(b).then(function(){return f.db=y.db,ie(f)}).then(function(P){return f.db=P,ae(f,C._defaultConfig.version)?ce(f):P}).then(function(P){f.db=y.db=P,C._dbInfo=f;for(var X=0;X<V.length;X++){var le=V[X];le!==C&&(le._dbInfo.db=f.db,le._dbInfo.version=f.version)}})}function W(l,C){var f=this;l=L(l);var S=new d(function(y,b){f.ready().then(function(){I(f._dbInfo,J,function(R,H){if(R)return b(R);try{var N=H.objectStore(f._dbInfo.storeName),V=N.get(l);V.onsuccess=function(){var P=V.result;P===void 0&&(P=null),he(P)&&(P=oe(P)),y(P)},V.onerror=function(){b(V.error)}}catch(P){b(P)}})}).catch(b)});return m(S,C),S}function q(l,C){var f=this,S=new d(function(y,b){f.ready().then(function(){I(f._dbInfo,J,function(R,H){if(R)return b(R);try{var N=H.objectStore(f._dbInfo.storeName),V=N.openCursor(),P=1;V.onsuccess=function(){var X=V.result;if(X){var le=X.value;he(le)&&(le=oe(le));var ve=l(le,X.key,P++);ve!==void 0?y(ve):X.continue()}else y()},V.onerror=function(){b(V.error)}}catch(X){b(X)}})}).catch(b)});return m(S,C),S}function se(l,C,f){var S=this;l=L(l);var y=new d(function(b,R){var H;S.ready().then(function(){return H=S._dbInfo,U.call(C)==="[object Blob]"?$(H.db).then(function(N){return N?C:Q(C)}):C}).then(function(N){I(S._dbInfo,E,function(V,P){if(V)return R(V);try{var X=P.objectStore(S._dbInfo.storeName);N===null&&(N=void 0);var le=X.put(N,l);P.oncomplete=function(){N===void 0&&(N=null),b(N)},P.onabort=P.onerror=function(){var ve=le.error?le.error:le.transaction.error;R(ve)}}catch(ve){R(ve)}})}).catch(R)});return m(y,f),y}function _e(l,C){var f=this;l=L(l);var S=new d(function(y,b){f.ready().then(function(){I(f._dbInfo,E,function(R,H){if(R)return b(R);try{var N=H.objectStore(f._dbInfo.storeName),V=N.delete(l);H.oncomplete=function(){y()},H.onerror=function(){b(V.error)},H.onabort=function(){var P=V.error?V.error:V.transaction.error;b(P)}}catch(P){b(P)}})}).catch(b)});return m(S,C),S}function Me(l){var C=this,f=new d(function(S,y){C.ready().then(function(){I(C._dbInfo,E,function(b,R){if(b)return y(b);try{var H=R.objectStore(C._dbInfo.storeName),N=H.clear();R.oncomplete=function(){S()},R.onabort=R.onerror=function(){var V=N.error?N.error:N.transaction.error;y(V)}}catch(V){y(V)}})}).catch(y)});return m(f,l),f}function Ee(l){var C=this,f=new d(function(S,y){C.ready().then(function(){I(C._dbInfo,J,function(b,R){if(b)return y(b);try{var H=R.objectStore(C._dbInfo.storeName),N=H.count();N.onsuccess=function(){S(N.result)},N.onerror=function(){y(N.error)}}catch(V){y(V)}})}).catch(y)});return m(f,l),f}function fe(l,C){var f=this,S=new d(function(y,b){if(l<0){y(null);return}f.ready().then(function(){I(f._dbInfo,J,function(R,H){if(R)return b(R);try{var N=H.objectStore(f._dbInfo.storeName),V=!1,P=N.openKeyCursor();P.onsuccess=function(){var X=P.result;if(!X){y(null);return}l===0||V?y(X.key):(V=!0,X.advance(l))},P.onerror=function(){b(P.error)}}catch(X){b(X)}})}).catch(b)});return m(S,C),S}function Ve(l){var C=this,f=new d(function(S,y){C.ready().then(function(){I(C._dbInfo,J,function(b,R){if(b)return y(b);try{var H=R.objectStore(C._dbInfo.storeName),N=H.openKeyCursor(),V=[];N.onsuccess=function(){var P=N.result;if(!P){S(V);return}V.push(P.key),P.continue()},N.onerror=function(){y(N.error)}}catch(P){y(P)}})}).catch(y)});return m(f,l),f}function $e(l,C){C=x.apply(this,arguments);var f=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||f.name,l.storeName=l.storeName||f.storeName);var S=this,y;if(!l.name)y=d.reject("Invalid arguments");else{var b=l.name===f.name&&S._dbInfo.db,R=b?d.resolve(S._dbInfo.db):ie(l).then(function(H){var N=Z[l.name],V=N.forages;N.db=H;for(var P=0;P<V.length;P++)V[P]._dbInfo.db=H;return H});l.storeName?y=R.then(function(H){if(H.objectStoreNames.contains(l.storeName)){var N=H.version+1;F(l);var V=Z[l.name],P=V.forages;H.close();for(var X=0;X<P.length;X++){var le=P[X];le._dbInfo.db=null,le._dbInfo.version=N}var ve=new d(function(Ce,xe){var Re=h.open(l.name,N);Re.onerror=function(We){var R1=Re.result;R1.close(),xe(We)},Re.onupgradeneeded=function(){var We=Re.result;We.deleteObjectStore(l.storeName)},Re.onsuccess=function(){var We=Re.result;We.close(),Ce(We)}});return ve.then(function(Ce){V.db=Ce;for(var xe=0;xe<P.length;xe++){var Re=P[xe];Re._dbInfo.db=Ce,z(Re._dbInfo)}}).catch(function(Ce){throw(Y(l,Ce)||d.resolve()).catch(function(){}),Ce})}}):y=R.then(function(H){F(l);var N=Z[l.name],V=N.forages;H.close();for(var P=0;P<V.length;P++){var X=V[P];X._dbInfo.db=null}var le=new d(function(ve,Ce){var xe=h.deleteDatabase(l.name);xe.onerror=function(){var Re=xe.result;Re&&Re.close(),Ce(xe.error)},xe.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},xe.onsuccess=function(){var Re=xe.result;Re&&Re.close(),ve(Re)}});return le.then(function(ve){N.db=ve;for(var Ce=0;Ce<V.length;Ce++){var xe=V[Ce];z(xe._dbInfo)}}).catch(function(ve){throw(Y(l,ve)||d.resolve()).catch(function(){}),ve})})}return m(y,C),y}var Ae={_driver:"asyncStorage",_initStorage:G,_support:v(),iterate:q,getItem:W,setItem:se,removeItem:_e,clear:Me,length:Ee,key:fe,keys:Ve,dropInstance:$e};function Ie(){return typeof openDatabase=="function"}var ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de="~~local_forage_type~",pe=/^~~local_forage_type~([^~]+)~/,Te="__lfsc__:",me=Te.length,ye="arbf",Se="blob",je="si08",k1="ui08",f1="uic8",e1="si16",B1="si32",kn="ur16",Bn="ui32",Un="fl32",Fn="fl64",zn=me+ye.length,Zn=Object.prototype.toString;function Wn(l){var C=l.length*.75,f=l.length,S,y=0,b,R,H,N;l[l.length-1]==="="&&(C--,l[l.length-2]==="="&&C--);var V=new ArrayBuffer(C),P=new Uint8Array(V);for(S=0;S<f;S+=4)b=ee.indexOf(l[S]),R=ee.indexOf(l[S+1]),H=ee.indexOf(l[S+2]),N=ee.indexOf(l[S+3]),P[y++]=b<<2|R>>4,P[y++]=(R&15)<<4|H>>2,P[y++]=(H&3)<<6|N&63;return V}function Pt(l){var C=new Uint8Array(l),f="",S;for(S=0;S<C.length;S+=3)f+=ee[C[S]>>2],f+=ee[(C[S]&3)<<4|C[S+1]>>4],f+=ee[(C[S+1]&15)<<2|C[S+2]>>6],f+=ee[C[S+2]&63];return C.length%3===2?f=f.substring(0,f.length-1)+"=":C.length%3===1&&(f=f.substring(0,f.length-2)+"=="),f}function Xi(l,C){var f="";if(l&&(f=Zn.call(l)),l&&(f==="[object ArrayBuffer]"||l.buffer&&Zn.call(l.buffer)==="[object ArrayBuffer]")){var S,y=Te;l instanceof ArrayBuffer?(S=l,y+=ye):(S=l.buffer,f==="[object Int8Array]"?y+=je:f==="[object Uint8Array]"?y+=k1:f==="[object Uint8ClampedArray]"?y+=f1:f==="[object Int16Array]"?y+=e1:f==="[object Uint16Array]"?y+=kn:f==="[object Int32Array]"?y+=B1:f==="[object Uint32Array]"?y+=Bn:f==="[object Float32Array]"?y+=Un:f==="[object Float64Array]"?y+=Fn:C(new Error("Failed to get type for BinaryArray"))),C(y+Pt(S))}else if(f==="[object Blob]"){var b=new FileReader;b.onload=function(){var R=de+l.type+"~"+Pt(this.result);C(Te+Se+R)},b.readAsArrayBuffer(l)}else try{C(JSON.stringify(l))}catch(R){console.error("Couldn't convert value into a JSON string: ",l),C(null,R)}}function Qi(l){if(l.substring(0,me)!==Te)return JSON.parse(l);var C=l.substring(zn),f=l.substring(me,zn),S;if(f===Se&&pe.test(C)){var y=C.match(pe);S=y[1],C=C.substring(y[0].length)}var b=Wn(C);switch(f){case ye:return b;case Se:return p([b],{type:S});case je:return new Int8Array(b);case k1:return new Uint8Array(b);case f1:return new Uint8ClampedArray(b);case e1:return new Int16Array(b);case kn:return new Uint16Array(b);case B1:return new Int32Array(b);case Bn:return new Uint32Array(b);case Un:return new Float32Array(b);case Fn:return new Float64Array(b);default:throw new Error("Unkown type: "+f)}}var $t={serialize:Xi,deserialize:Qi,stringToBuffer:Wn,bufferToString:Pt};function Gn(l,C,f,S){l.executeSql("CREATE TABLE IF NOT EXISTS "+C.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],f,S)}function Ji(l){var C=this,f={db:null};if(l)for(var S in l)f[S]=typeof l[S]!="string"?l[S].toString():l[S];var y=new d(function(b,R){try{f.db=openDatabase(f.name,String(f.version),f.description,f.size)}catch(H){return R(H)}f.db.transaction(function(H){Gn(H,f,function(){C._dbInfo=f,b()},function(N,V){R(V)})},R)});return f.serializer=$t,y}function s1(l,C,f,S,y,b){l.executeSql(f,S,y,function(R,H){H.code===H.SYNTAX_ERR?R.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[C.storeName],function(N,V){V.rows.length?b(N,H):Gn(N,C,function(){N.executeSql(f,S,y,b)},b)},b):b(R,H)},b)}function Ki(l,C){var f=this;l=L(l);var S=new d(function(y,b){f.ready().then(function(){var R=f._dbInfo;R.db.transaction(function(H){s1(H,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[l],function(N,V){var P=V.rows.length?V.rows.item(0).value:null;P&&(P=R.serializer.deserialize(P)),y(P)},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function e9(l,C){var f=this,S=new d(function(y,b){f.ready().then(function(){var R=f._dbInfo;R.db.transaction(function(H){s1(H,R,"SELECT * FROM "+R.storeName,[],function(N,V){for(var P=V.rows,X=P.length,le=0;le<X;le++){var ve=P.item(le),Ce=ve.value;if(Ce&&(Ce=R.serializer.deserialize(Ce)),Ce=l(Ce,ve.key,le+1),Ce!==void 0){y(Ce);return}}y()},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function Yn(l,C,f,S){var y=this;l=L(l);var b=new d(function(R,H){y.ready().then(function(){C===void 0&&(C=null);var N=C,V=y._dbInfo;V.serializer.serialize(C,function(P,X){X?H(X):V.db.transaction(function(le){s1(le,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[l,P],function(){R(N)},function(ve,Ce){H(Ce)})},function(le){if(le.code===le.QUOTA_ERR){if(S>0){R(Yn.apply(y,[l,N,f,S-1]));return}H(le)}})})}).catch(H)});return m(b,f),b}function t9(l,C,f){return Yn.apply(this,[l,C,f,1])}function n9(l,C){var f=this;l=L(l);var S=new d(function(y,b){f.ready().then(function(){var R=f._dbInfo;R.db.transaction(function(H){s1(H,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[l],function(){y()},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function r9(l){var C=this,f=new d(function(S,y){C.ready().then(function(){var b=C._dbInfo;b.db.transaction(function(R){s1(R,b,"DELETE FROM "+b.storeName,[],function(){S()},function(H,N){y(N)})})}).catch(y)});return m(f,l),f}function i9(l){var C=this,f=new d(function(S,y){C.ready().then(function(){var b=C._dbInfo;b.db.transaction(function(R){s1(R,b,"SELECT COUNT(key) as c FROM "+b.storeName,[],function(H,N){var V=N.rows.item(0).c;S(V)},function(H,N){y(N)})})}).catch(y)});return m(f,l),f}function o9(l,C){var f=this,S=new d(function(y,b){f.ready().then(function(){var R=f._dbInfo;R.db.transaction(function(H){s1(H,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[l+1],function(N,V){var P=V.rows.length?V.rows.item(0).key:null;y(P)},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function a9(l){var C=this,f=new d(function(S,y){C.ready().then(function(){var b=C._dbInfo;b.db.transaction(function(R){s1(R,b,"SELECT key FROM "+b.storeName,[],function(H,N){for(var V=[],P=0;P<N.rows.length;P++)V.push(N.rows.item(P).key);S(V)},function(H,N){y(N)})})}).catch(y)});return m(f,l),f}function s9(l){return new d(function(C,f){l.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,b){for(var R=[],H=0;H<b.rows.length;H++)R.push(b.rows.item(H).name);C({db:l,storeNames:R})},function(y,b){f(b)})},function(S){f(S)})})}function l9(l,C){C=x.apply(this,arguments);var f=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||f.name,l.storeName=l.storeName||f.storeName);var S=this,y;return l.name?y=new d(function(b){var R;l.name===f.name?R=S._dbInfo.db:R=openDatabase(l.name,"","",0),l.storeName?b({db:R,storeNames:[l.storeName]}):b(s9(R))}).then(function(b){return new d(function(R,H){b.db.transaction(function(N){function V(ve){return new d(function(Ce,xe){N.executeSql("DROP TABLE IF EXISTS "+ve,[],function(){Ce()},function(Re,We){xe(We)})})}for(var P=[],X=0,le=b.storeNames.length;X<le;X++)P.push(V(b.storeNames[X]));d.all(P).then(function(){R()}).catch(function(ve){H(ve)})},function(N){H(N)})})}):y=d.reject("Invalid arguments"),m(y,C),y}var c9={_driver:"webSQLStorage",_initStorage:Ji,_support:Ie(),iterate:e9,getItem:Ki,setItem:t9,removeItem:n9,clear:r9,length:i9,key:o9,keys:a9,dropInstance:l9};function u9(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qn(l,C){var f=l.name+"/";return l.storeName!==C.storeName&&(f+=l.storeName+"/"),f}function f9(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch{return!0}}function d9(){return!f9()||localStorage.length>0}function h9(l){var C=this,f={};if(l)for(var S in l)f[S]=l[S];return f.keyPrefix=qn(l,C._defaultConfig),d9()?(C._dbInfo=f,f.serializer=$t,d.resolve()):d.reject()}function p9(l){var C=this,f=C.ready().then(function(){for(var S=C._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var b=localStorage.key(y);b.indexOf(S)===0&&localStorage.removeItem(b)}});return m(f,l),f}function v9(l,C){var f=this;l=L(l);var S=f.ready().then(function(){var y=f._dbInfo,b=localStorage.getItem(y.keyPrefix+l);return b&&(b=y.serializer.deserialize(b)),b});return m(S,C),S}function g9(l,C){var f=this,S=f.ready().then(function(){for(var y=f._dbInfo,b=y.keyPrefix,R=b.length,H=localStorage.length,N=1,V=0;V<H;V++){var P=localStorage.key(V);if(P.indexOf(b)===0){var X=localStorage.getItem(P);if(X&&(X=y.serializer.deserialize(X)),X=l(X,P.substring(R),N++),X!==void 0)return X}}});return m(S,C),S}function m9(l,C){var f=this,S=f.ready().then(function(){var y=f._dbInfo,b;try{b=localStorage.key(l)}catch{b=null}return b&&(b=b.substring(y.keyPrefix.length)),b});return m(S,C),S}function C9(l){var C=this,f=C.ready().then(function(){for(var S=C._dbInfo,y=localStorage.length,b=[],R=0;R<y;R++){var H=localStorage.key(R);H.indexOf(S.keyPrefix)===0&&b.push(H.substring(S.keyPrefix.length))}return b});return m(f,l),f}function b9(l){var C=this,f=C.keys().then(function(S){return S.length});return m(f,l),f}function S9(l,C){var f=this;l=L(l);var S=f.ready().then(function(){var y=f._dbInfo;localStorage.removeItem(y.keyPrefix+l)});return m(S,C),S}function _9(l,C,f){var S=this;l=L(l);var y=S.ready().then(function(){C===void 0&&(C=null);var b=C;return new d(function(R,H){var N=S._dbInfo;N.serializer.serialize(C,function(V,P){if(P)H(P);else try{localStorage.setItem(N.keyPrefix+l,V),R(b)}catch(X){(X.name==="QuotaExceededError"||X.name==="NS_ERROR_DOM_QUOTA_REACHED")&&H(X),H(X)}})})});return m(y,f),y}function y9(l,C){if(C=x.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var f=this.config();l.name=l.name||f.name,l.storeName=l.storeName||f.storeName}var S=this,y;return l.name?y=new d(function(b){l.storeName?b(qn(l,S._defaultConfig)):b(l.name+"/")}).then(function(b){for(var R=localStorage.length-1;R>=0;R--){var H=localStorage.key(R);H.indexOf(b)===0&&localStorage.removeItem(H)}}):y=d.reject("Invalid arguments"),m(y,C),y}var L9={_driver:"localStorageWrapper",_initStorage:h9,_support:u9(),iterate:g9,getItem:v9,setItem:_9,removeItem:S9,clear:p9,length:b9,key:m9,keys:C9,dropInstance:y9},E9=function(C,f){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},w9=function(C,f){for(var S=C.length,y=0;y<S;){if(E9(C[y],f))return!0;y++}return!1},Xn=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},M1={},Qn={},m1={INDEXEDDB:Ae,WEBSQL:c9,LOCALSTORAGE:L9},M9=[m1.INDEXEDDB._driver,m1.WEBSQL._driver,m1.LOCALSTORAGE._driver],U1=["dropInstance"],kt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(U1),R9={description:"",driver:M9.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function x9(l,C){l[C]=function(){var f=arguments;return l.ready().then(function(){return l[C].apply(l,f)})}}function Bt(){for(var l=1;l<arguments.length;l++){var C=arguments[l];if(C)for(var f in C)C.hasOwnProperty(f)&&(Xn(C[f])?arguments[0][f]=C[f].slice():arguments[0][f]=C[f])}return arguments[0]}var I9=function(){function l(C){a(this,l);for(var f in m1)if(m1.hasOwnProperty(f)){var S=m1[f],y=S._driver;this[f]=y,M1[y]||this.defineDriver(S)}this._defaultConfig=Bt({},R9),this._config=Bt({},this._defaultConfig,C),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(f){if((typeof f>"u"?"undefined":o(f))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in f){if(S==="storeName"&&(f[S]=f[S].replace(/\W/g,"_")),S==="version"&&typeof f[S]!="number")return new Error("Database version must be a number.");this._config[S]=f[S]}return"driver"in f&&f.driver?this.setDriver(this._config.driver):!0}else return typeof f=="string"?this._config[f]:this._config},l.prototype.defineDriver=function(f,S,y){var b=new d(function(R,H){try{var N=f._driver,V=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!f._driver){H(V);return}for(var P=kt.concat("_initStorage"),X=0,le=P.length;X<le;X++){var ve=P[X],Ce=!w9(U1,ve);if((Ce||f[ve])&&typeof f[ve]!="function"){H(V);return}}var xe=function(){for(var R1=function(T9){return function(){var D9=new Error("Method "+T9+" is not implemented by the current driver"),Jn=d.reject(D9);return m(Jn,arguments[arguments.length-1]),Jn}},Ut=0,H9=U1.length;Ut<H9;Ut++){var Ft=U1[Ut];f[Ft]||(f[Ft]=R1(Ft))}};xe();var Re=function(R1){M1[N]&&console.info("Redefining LocalForage driver: "+N),M1[N]=f,Qn[N]=R1,R()};"_support"in f?f._support&&typeof f._support=="function"?f._support().then(Re,H):Re(!!f._support):Re(!0)}catch(We){H(We)}});return _(b,S,y),b},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(f,S,y){var b=M1[f]?d.resolve(M1[f]):d.reject(new Error("Driver not found."));return _(b,S,y),b},l.prototype.getSerializer=function(f){var S=d.resolve($t);return _(S,f),S},l.prototype.ready=function(f){var S=this,y=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return _(y,f,f),y},l.prototype.setDriver=function(f,S,y){var b=this;Xn(f)||(f=[f]);var R=this._getSupportedDrivers(f);function H(){b._config.driver=b.driver()}function N(X){return b._extend(X),H(),b._ready=b._initStorage(b._config),b._ready}function V(X){return function(){var le=0;function ve(){for(;le<X.length;){var Ce=X[le];return le++,b._dbInfo=null,b._ready=null,b.getDriver(Ce).then(N).catch(ve)}H();var xe=new Error("No available storage method found.");return b._driverSet=d.reject(xe),b._driverSet}return ve()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=P.then(function(){var X=R[0];return b._dbInfo=null,b._ready=null,b.getDriver(X).then(function(le){b._driver=le._driver,H(),b._wrapLibraryMethodsWithReady(),b._initDriver=V(R)})}).catch(function(){H();var X=new Error("No available storage method found.");return b._driverSet=d.reject(X),b._driverSet}),_(this._driverSet,S,y),this._driverSet},l.prototype.supports=function(f){return!!Qn[f]},l.prototype._extend=function(f){Bt(this,f)},l.prototype._getSupportedDrivers=function(f){for(var S=[],y=0,b=f.length;y<b;y++){var R=f[y];this.supports(R)&&S.push(R)}return S},l.prototype._wrapLibraryMethodsWithReady=function(){for(var f=0,S=kt.length;f<S;f++)x9(this,kt[f])},l.prototype.createInstance=function(f){return new l(f)},l}(),O9=new I9;r.exports=O9},{3:3}]},{},[4])(4)})})($i);var A5=$i.exports;const h1=N6(A5);class An{getItem(t){return h1.getItem(t)}setItem(t,n){return h1.setItem(t,n)}removeItem(t){return h1.removeItem(t)}clear(){return h1.clear()}key(t){return h1.key(t)}keys(){return h1.keys()}iterate(t){return h1.iterate(t)}}var j5=Object.defineProperty,P5=Object.getOwnPropertyDescriptor,$5=(e,t,n,r)=>{for(var i=r>1?void 0:r?P5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&j5(t,n,i),i},k5=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopZenZoneService=class{constructor(t){A(this,"visible$",new re.Subject);A(this,"componentKey$",new re.Subject);A(this,"_visible",!1);this._componentManager=t}get visible(){return this._visible}set(t,n){return this._componentManager.register(t,n),this.componentKey$.next(t),u.toDisposable(()=>{this._componentManager.delete(t),this.visible$.complete(),this.componentKey$.complete()})}open(){this._visible=!0,this.visible$.next(!0)}close(){this._visible=!1,this.visible$.next(!1)}};exports.DesktopZenZoneService=$5([k5(0,u.Inject(qe))],exports.DesktopZenZoneService);class jn extends u.Disposable{constructor(){super(...arguments);A(this,"_currentSelectorId");A(this,"_selectionChange$",new re.Subject);A(this,"selectionChange$",this._selectionChange$.asObservable());A(this,"_openSelector$",new re.Subject);A(this,"openSelector$",this._openSelector$.asObservable())}setCurrentSelectorId(n){this._currentSelectorId=n}getCurrentSelectorId(){return this._currentSelectorId}selectionChange(n){this._currentSelectorId&&this._selectionChange$.next(n)}openSelector(){this._openSelector$.next(null)}}const Vt=u.createIdentifier("univer.range-selector.service");class Pn extends u.Disposable{constructor(){super(...arguments);A(this,"_taskCount",0);A(this,"_progressChange$",new re.Subject);A(this,"_progressVisible$",new re.Subject);A(this,"progressChange$",this._progressChange$.asObservable());A(this,"progressVisible$",this._progressVisible$.asObservable())}dispose(){super.dispose(),this._clear(),this._progressChange$.complete(),this._progressVisible$.complete()}pushTask(n){if(this._taskCount===0)return;const{count:r}=n;if(r<=0)return;const i=Math.min(1,r/this._taskCount);this._progressChange$.next({step:i}),this._taskCount-=r,this._taskCount<0&&(this._taskCount=0),this._taskCount===0&&this._progressVisible$.next(!1)}insertTaskCount(n){n<=0||(this._taskCount===0&&this._progressVisible$.next(!0),this._taskCount+=n)}complete(){this._taskCount!==0&&(this._progressChange$.next({step:1}),this._clear(),this._progressVisible$.next(!1))}stop(){this._taskCount!==0&&(this._clear(),this._progressVisible$.next(!1))}getTaskCount(){return this._taskCount}_clear(){this._taskCount=0}}const At=u.createIdentifier("univer.progress.service");var ki=Object.defineProperty,B5=Object.getOwnPropertyDescriptor,U5=(e,t,n)=>t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F5=(e,t,n,r)=>{for(var i=r>1?void 0:r?B5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ki(t,n,i),i},Hr=(e,t)=>(n,r)=>t(n,r,e),z5=(e,t,n)=>U5(e,t+"",n);const Bi="UNIVER_UI_PLUGIN",Ui="DISABLE_AUTO_FOCUS";exports.UniverUIPlugin=class extends u.Plugin{constructor(t={},n,r){super(),this._config=t,this._contextService=n,this._injector=r,this._config=u.Tools.deepMerge({},this._config),this._config.disableAutoFocus&&this._contextService.setContextValue(Ui,!0)}onStarting(t){u.mergeOverrideWithDependencies([[qe],[T1],[Dt],[n1,{useClass:bn}],[o1,{useClass:exports.DesktopLayoutService}],[g1,{useClass:exports.ShortcutService}],[dt,{useClass:Cn}],[a1,{useClass:exports.MenuService}],[j1,{useClass:Ln}],[xn,{useClass:exports.BrowserClipboardService,lazy:!0}],[$1,{useClass:exports.DesktopNotificationService,lazy:!0}],[yt,{useClass:exports.DesktopDialogService,lazy:!0}],[_t,{useClass:exports.DesktopConfirmService,lazy:!0}],[P1,{useClass:Vn,lazy:!0}],[bt,{useClass:exports.DesktopZenZoneService,lazy:!0}],[St,{useClass:exports.DesktopGlobalZoneService,lazy:!0}],[w1,{useClass:In,lazy:!0}],[u.ILocalStorageService,{useClass:An,lazy:!0}],[Rn,{useClass:exports.DesktopBeforeCloseService}],[E1,{useClass:exports.EditorService}],[Vt,{useClass:jn}],[mt,{useClass:Sn}],[At,{useClass:Pn}],[Ct],[pt,{useFactory:r=>r.createInstance(exports.DesktopUIController,this._config),deps:[u.Injector]}],[exports.SharedController,{useFactory:()=>this._injector.createInstance(exports.SharedController,this._config)}],[exports.ErrorController],[exports.ShortcutPanelController,{useFactory:()=>this._injector.createInstance(exports.ShortcutPanelController,this._config)}]],this._config.override).forEach(r=>t.add(r))}};z5(exports.UniverUIPlugin,"pluginName",Bi);exports.UniverUIPlugin=F5([u.DependentOn(v1.UniverRenderEnginePlugin),Hr(1,u.IContextService),Hr(2,u.Inject(u.Injector))],exports.UniverUIPlugin);const Z5="univer-app-layout",W5="univer-app-header",G5="univer-app-container",Y5="univer-app-container-header",q5="univer-app-container-wrapper",X5="univer-app-container-content",Q5="univer-app-container-canvas",J5="univer-app-container-left-sidebar",K5="univer-app-container-sidebar",t1={appLayout:Z5,appHeader:W5,appContainer:G5,appContainerHeader:Y5,appContainerWrapper:q5,appContainerContent:X5,appContainerCanvas:Q5,appContainerLeftSidebar:J5,appContainerSidebar:K5},el="univer-mobile-menu-container",tl="univer-mobile-menu-item",nt={mobileMenuContainer:el,mobileMenuItem:tl};function nl(e){const{menuType:t,onOptionSelect:n}=e,r=u.useDependency(a1);if(!t)return null;const i=u.makeArray(t).map(r.getMenuItems.bind(r)).flat();return g.jsx("div",{className:nt.mobileMenuContainer,style:{gridTemplateColumns:`repeat(${Math.min(2,i.length)}, 48px)`},children:i.map(o=>g.jsx(rl,{menuItem:o,onClick:a=>n==null?void 0:n({value:"",label:o.id,...a})},o.id))})}function rl(e){const{menuItem:t,onClick:n}=e,{id:r,type:i,title:o,label:a,icon:c}=t;if(i!==ke.BUTTON)throw new Error(`[MobileMenuItem]: on mobile devices only "BUTTON" type menu items are supported. Please check "${r}".`);const h=u.useObservable(t.disabled$,!1),v=u.useObservable(t.activated$,!1),p=u.useObservable(t.hidden$,!1),d=u.useObservable(t.value$),m=Ue.clsx(nt.mobileMenuItem,{[nt.mobileMenuItemActivated]:v,[nt.mobileMenuItemHidden]:p});return g.jsx("button",{type:"button",className:m,disabled:h,onClick:()=>n({id:r}),children:g.jsx(ze,{value:d,title:o,label:a,icon:c})},r)}function Fi(){const[e,t]=s.useState(!1),[n,r]=s.useState(""),[i,o]=s.useState([0,0]),a=u.useDependency(j1),c=u.useDependency(u.ICommandService);s.useEffect(()=>{const p=a.registerContextMenuHandler({handleContextMenu:h});return document.addEventListener("pointerdown",v),document.addEventListener("wheel",v),()=>{document.removeEventListener("pointerdown",v),document.removeEventListener("wheel",v),p.dispose()}},[a]);function h(p,d){r(d),o([p.clientX,p.clientY]),t(!0)}function v(){t(!1)}return g.jsx(ue.Popup,{visible:e,offset:i,children:g.jsx("section",{onPointerDown:p=>p.stopPropagation(),children:n&&g.jsx(nl,{menuType:[n],onOptionSelect:p=>{const{label:d,value:m}=p;c&&c.executeCommand(d,{value:m}),t(!1)}})})})}function il(e){const{header:t=!0,footer:n=!0,contextMenu:r=!0,mountContainer:i,onRendered:o}=e,a=u.useDependency(u.LocaleService),c=u.useDependency(u.ThemeService),h=u.useDependency(w1),v=s.useRef(null),p=Fe(we.FOOTER),d=Fe(we.HEADER);Fe(we.HEADER_MENU);const m=Fe(we.CONTENT),_=Fe(we.LEFT_SIDEBAR),L=Fe(we.GLOBAL);s.useEffect(()=>{c.getCurrentTheme()||c.setTheme(ue.defaultTheme)},[]),s.useEffect(()=>{v.current&&(o==null||o(v.current))},[o]);const[x,w]=s.useState(a.getLocales()),j=s.useMemo(()=>document.createElement("div"),[]);return s.useEffect(()=>{document.body.appendChild(j),h.setContainer(j);const Z=[a.localeChanged$.subscribe(()=>{w(a.getLocales())}),c.currentTheme$.subscribe(U=>{ue.themeInstance.setTheme(i,U),j&&ue.themeInstance.setTheme(j,U)})];return()=>{Z.forEach(U=>U.unsubscribe()),document.body.removeChild(j)}},[a,h,i,j,c.currentTheme$]),g.jsxs(ue.ConfigProvider,{locale:x==null?void 0:x.design,mountContainer:j,children:[g.jsxs("div",{className:t1.appLayout,tabIndex:-1,onBlur:Z=>Z.stopPropagation(),children:[t&&g.jsx("header",{className:t1.appContainerHeader}),g.jsxs("section",{className:t1.appContainer,children:[g.jsxs("div",{className:t1.appContainerWrapper,children:[g.jsx("aside",{className:t1.appContainerLeftSidebar,children:g.jsx(Be,{components:_},"left-sidebar")}),g.jsxs("section",{className:t1.appContainerContent,children:[g.jsx("header",{className:t1.appHeader,children:t&&g.jsx(Be,{components:d},"header")}),g.jsx("section",{className:t1.appContainerCanvas,ref:v,"data-range-selector":!0,onContextMenu:Z=>Z.preventDefault(),children:g.jsx(Be,{components:m},"content")})]}),g.jsx("aside",{className:t1.appContainerSidebar,children:g.jsx(En,{})})]}),n&&g.jsx("footer",{className:t1.appFooter,children:g.jsx(Be,{components:p},"footer")}),g.jsx(wn,{})]})]}),g.jsx(Be,{components:L},"global"),g.jsx(Be,{components:Mn},"built-in-global"),r&&g.jsx(Fi,{})]})}var ol=Object.defineProperty,al=Object.getOwnPropertyDescriptor,sl=(e,t,n,r)=>{for(var i=r>1?void 0:r?al(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ol(t,n,i),i},S1=(e,t)=>(n,r)=>t(n,r,e);const ll=3e3;let dn=class extends u.Disposable{constructor(e,t,n,r,i,o,a){super(),this._config=e,this._instanceService=t,this._renderManagerService=n,this._injector=r,this._lifecycleService=i,this._uiPartsService=o,this._layoutService=a,this._initBuiltinComponents(),Promise.resolve().then(()=>this._bootstrapWorkbench())}_bootstrapWorkbench(){this.disposeWithMe(cl(this._injector,this._config,(e,t)=>{this._layoutService&&(this.disposeWithMe(this._layoutService.registerRootContainerElement(t)),this.disposeWithMe(this._layoutService.registerCanvasElement(e))),this._renderManagerService.currentRender$.subscribe(n=>{if(n){const r=this._renderManagerService.getRenderById(n);if(!r.unitId||this._instanceService.getUnitType(r.unitId)!==u.UniverInstanceType.UNIVER_SHEET)return;r.engine.setContainer(e)}}),setTimeout(()=>{var r;const n=(r=this._renderManagerService.getFirst())==null?void 0:r.engine;n==null||n.setContainer(e),this._lifecycleService.stage=u.LifecycleStages.Rendered,setTimeout(()=>this._lifecycleService.stage=u.LifecycleStages.Steady,ll)},300)}))}_initBuiltinComponents(){this.disposeWithMe(this._uiPartsService.registerComponent(we.CONTENT,()=>u.connectInjector(_n,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(we.CONTENT,()=>u.connectInjector(yn,this._injector)))}};dn=sl([S1(1,u.IUniverInstanceService),S1(2,v1.IRenderManagerService),S1(3,u.Inject(u.Injector)),S1(4,u.Inject(u.LifecycleService)),S1(5,n1),S1(6,u.Optional(o1))],dn);function cl(e,t,n){let r;const i=t.container;if(typeof i=="string"){const h=document.getElementById(i);h?r=h:r=Tr(i)}else i instanceof HTMLElement?r=i:r=Tr("univer");const o=u.connectInjector(il,e),a=h=>n(h,r);function c(){K1(g.jsx(o,{...t,mountContainer:r,onRendered:a}),r)}return c(),u.toDisposable(()=>{ii(r)})}function Tr(e){const t=document.createElement("div");return t.id=e,t}var zi=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,fl=(e,t,n)=>t in e?zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dl=(e,t,n,r)=>{for(var i=r>1?void 0:r?ul(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&zi(t,n,i),i},hl=(e,t)=>(n,r)=>t(n,r,e),pl=(e,t,n)=>fl(e,t+"",n);const vl="UNIVER_MOBILE_UI_PLUGIN";exports.UniverMobileUIPlugin=class extends u.Plugin{constructor(t,n){super(),this._config=t,this._injector=n}onStarting(t){u.mergeOverrideWithDependencies([[qe],[T1],[Dt],[n1,{useClass:bn}],[o1,{useClass:exports.DesktopLayoutService}],[g1,{useClass:exports.ShortcutService}],[dt,{useClass:Cn}],[a1,{useClass:exports.MenuService}],[j1,{useClass:Ln}],[xn,{useClass:exports.BrowserClipboardService,lazy:!0}],[$1,{useClass:exports.DesktopNotificationService,lazy:!0}],[yt,{useClass:exports.DesktopDialogService,lazy:!0}],[_t,{useClass:exports.DesktopConfirmService,lazy:!0}],[P1,{useClass:Vn,lazy:!0}],[bt,{useClass:exports.DesktopZenZoneService,lazy:!0}],[St,{useClass:exports.DesktopGlobalZoneService,lazy:!0}],[w1,{useClass:In,lazy:!0}],[u.ILocalStorageService,{useClass:An,lazy:!0}],[Rn,{useClass:exports.DesktopBeforeCloseService}],[E1,{useClass:exports.EditorService}],[Vt,{useClass:jn}],[mt,{useClass:Sn}],[At,{useClass:Pn}],[Ct],[pt,{useFactory:r=>r.createInstance(dn,this._config),deps:[u.Injector]}],[exports.SharedController,{useFactory:()=>this._injector.createInstance(exports.SharedController,this._config)}],[exports.ErrorController]],this._config.override).forEach(r=>t.add(r))}};pl(exports.UniverMobileUIPlugin,"pluginName",vl);exports.UniverMobileUIPlugin=dl([u.DependentOn(v1.UniverRenderEnginePlugin),hl(1,u.Inject(u.Injector))],exports.UniverMobileUIPlugin);function rt(e){return e.length===0?e:e.replace(/^\s+|\s+$/gm,"")}function Zi(e){if(!e)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0")return!1;const n=e.getBoundingClientRect();return!(n.width===0||n.height===0||n.bottom<0||n.top>window.innerHeight||n.right<0||n.left>window.innerWidth)}const gl=.75,Dr=78,Nr=9,Wi="rgba(0,0,0,0)",Gi="rgb(0,0,0)";function $n(e){var c;let t=e.childNodes;if(t.length===0)return e.textContent;if(t[0].nodeName==="DIV"&&(t=t[0].childNodes),t.length===1&&t[0].nodeName==="#text")return t[0].textContent;const n=[];let r=0,i=0,o=e.textContent||"";o+=`\r
|
|
47
|
-
`;for(let h=0;h<t.length;h++){let v=t[`${h}`],p;v.nodeName==="#text"?(p=(c=v.textContent)!=null?c:"",v=v.parentElement):p=v.innerText;const
|
|
48
|
-
`))}function
|
|
49
|
-
`),o=i[0].split(" ").length;for(let a=0;a<i.length;a++)i[a].split(" ").length<o||t.push(i[a].split(" "));for(let a=0;a<t.length;a++)for(let c=0;c<t[a].length;c++)t[a][c].length?t[a][c]={v:t[a][c]||"",m:t[a][c]||""}:t[a][c]=null;return t}function
|
|
50
|
-
`,"").split("}");for(let i=0;i<r.length;i++){if(!r[i])continue;let o=r[i].split("{")[0].trim();o.includes(".")&&(o=o.slice(1));const a=r[i].split("{")[1].trim();t[o]=a}return t}function El(e){const t=Math.round(e*gl);return t<Nr?Nr:t>Dr?Dr:t}function wl(e){const t=/font-family:\s*(?:"([^"]+)"|'([^']+)'|([^;]+))/i,n=e.match(t);return n?(n[1]||n[2]||n[3]).trim():null}const Ml="univer-text-editor-container",Rl="univer-text-editor-container-active",xl="univer-text-editor-container-error",Il="univer-text-editor-container-disabled",Ol="univer-text-editor-container-placeholder",Hl="univer-text-editor-validation-error",_1={textEditorContainer:Ml,textEditorContainerActive:Rl,textEditorContainerError:xl,textEditorContainerDisabled:Il,textEditorContainerPlaceholder:Ol,textEditorValidationError:Hl},Tl=new Set(["snapshot","resizeCallBack","cancelDefaultResizeListener","isSheetEditor","canvasStyle","isSingle","isReadonly","onlyInputFormula","onlyInputRange","value","onlyInputContent","isSingleChoice","openForSheetUnitId","openForSheetSubUnitId","onChange","onActive","onValid","placeholder"]);function qi(e){const{id:t,snapshot:n,resizeCallBack:r,cancelDefaultResizeListener:i,isSheetEditor:o=!1,canvasStyle:a={},value:c,isSingle:h=!0,isReadonly:v=!1,onlyInputFormula:p=!1,onlyInputRange:d=!1,onlyInputContent:m=!1,isSingleChoice:_=!1,openForSheetUnitId:L,openForSheetSubUnitId:x,onChange:w,onActive:j,onValid:Z,isValueValid:U=!0,placeholder:J}=e,E=u.useDependency(E1),D=u.useDependency(u.LocaleService),[k,$]=s.useState(""),[F,z]=s.useState(""),[Y,ne]=s.useState(U),[ie,ce]=s.useState([0,0]),ae=s.useRef(null),[Q,oe]=s.useState(!1);if(!u.isInternalEditorID(t))throw new Error("Invalid editor ID");s.useEffect(()=>{const B=ae.current;if(!B)return;const G=new ResizeObserver(()=>{i!==!0&&E.resize(t),r&&r(B)});G.observe(B);const W=E.register({editorUnitId:t,initialSnapshot:n,cancelDefaultResizeListener:i,isSheetEditor:o,canvasStyle:a,isSingle:h,isReadonly:v,isSingleChoice:_,onlyInputFormula:p,onlyInputRange:d,onlyInputContent:m,openForSheetUnitId:L,openForSheetSubUnitId:x},B);E.setValueNoRefresh(c||"",t),$(J||"");const q=u.debounce(fe=>{oe(fe),j&&j(fe)},30),se=160,_e=u.debounce(fe=>{const Ve=fe.editorUnitId,$e=E.checkValueLegality(Ve);setTimeout(()=>{const Ie=fe.getBoundingClientRect();ce([Ie.left,Ie.top-16]),Ie.left+Ie.top>0&&ne($e),fe.onlyInputFormula()?z(D.t("textEditor.formulaError")):z(D.t("textEditor.rangeError"))},se),E.getValue(Ve)!==c&&(Z&&Z($e),w&&w(E.getValue(t)))},30),Me=E.focusStyle$.subscribe(fe=>{let Ve=!1;fe===t&&(Ve=!0),q(Ve),setTimeout(()=>{if(!Zi(B))ne(!0);else{const $e=E.getEditor(t);$e&&_e($e)}},se)}),Ee=E.valueChange$.subscribe(fe=>{fe.isSheetEditor()||fe.editorUnitId===t&&_e(fe)});return()=>{G.unobserve(B),G.disconnect(),W.dispose(),Me==null||Me.unsubscribe(),Ee==null||Ee.unsubscribe()}},[]),s.useEffect(()=>{const B=E.getEditor(t);B!=null&&B.update({isReadonly:v,isSingle:h,isSingleChoice:_,onlyInputContent:m,onlyInputFormula:p,onlyInputRange:d,openForSheetSubUnitId:x,openForSheetUnitId:L})},[v,h,_,m,p,d,x,L]),s.useEffect(()=>{c!=null&&E.setValueNoRefresh(c,t)},[c]),s.useEffect(()=>{ne(U)},[U]);function he(){const B=E.getValue(t);return!(B==null||B==="")}const T=Object.fromEntries(Object.entries(e).filter(([B])=>!Tl.has(B)));let M=_1.textEditorContainer;e.className!=null&&(M=e.className);let I="";return e.className==null&&(v?I=` ${_1.textEditorContainerDisabled}`:Y?Q&&(I=` ${_1.textEditorContainerActive}`):I=` ${_1.textEditorContainerError}`),g.jsx(g.Fragment,{children:g.jsxs("div",{...T,className:M+I,ref:ae,children:[g.jsx("div",{style:{display:Y?"none":"block"},className:_1.textEditorValidationError,children:F}),g.jsx("div",{style:{display:he()?"none":"unset"},className:_1.textEditorContainerPlaceholder,children:k})]})})}const Dl="univer-range-selector",Nl="univer-range-selector-editor",Vl="univer-range-selector-icon",Al="univer-range-selector-active",jl="univer-range-selector-error",Pl="univer-range-selector-disabled",$l="univer-range-selector-modal",kl="univer-range-selector-modal-container",Bl="univer-range-selector-modal-container-input",Ul="univer-range-selector-modal-container-input-active",Fl="univer-range-selector-modal-container-button",zl="univer-range-selector-modal-container-delete-button",Zl="univer-range-selector-modal-add",Wl="univer-range-selector-modal-add-button",De={rangeSelector:Dl,rangeSelectorEditor:Nl,rangeSelectorIcon:Vl,rangeSelectorActive:Al,rangeSelectorError:jl,rangeSelectorDisabled:Pl,rangeSelectorModal:$l,rangeSelectorModalContainer:kl,rangeSelectorModalContainerInput:Bl,rangeSelectorModalContainerInputActive:Ul,rangeSelectorModalContainerButton:Fl,rangeSelectorModalContainerDeleteButton:zl,rangeSelectorModalAdd:Zl,rangeSelectorModalAddButton:Wl};function Gl(e){const{onChange:t,id:n,value:r="",width:i=220,placeholder:o="",size:a="middle",onActive:c,onValid:h,isSingleChoice:v=!1,openForSheetUnitId:p,openForSheetSubUnitId:d,isReadonly:m=!1,className:_,textEditorClassName:L}=e,[x,w]=s.useState([""]),j=ee=>{w(de=>[...de,ee])},Z=ee=>{w(de=>de.filter((pe,Te)=>Te!==ee))},U=(ee,de)=>{w(pe=>pe.map((Te,me)=>me===ee?de:Te))},J=ee=>{w(de=>{const pe=[...de];return pe.length>0&&(pe[pe.length-1]=ee),pe})},E=u.useDependency(E1),D=u.useDependency(Vt),k=u.useDependency(u.IUniverInstanceService),[$,F]=s.useState(!1),z=u.useDependency(u.LocaleService),[Y,ne]=s.useState(!1),[ie,ce]=s.useState(!0),[ae,Q]=s.useState(r),[oe,he]=s.useState(-1),T=s.useRef(null),M=s.useRef(-1),I=s.useRef(p),B=s.useRef(d),G=s.useRef(v),W=s.useRef(m);s.useEffect(()=>{const ee=T.current;if(!ee)return;const de=new ResizeObserver(()=>{E.resize(n)});de.observe(ee);let pe=1;const Te=D.selectionChange$.subscribe(me=>{if(D.getCurrentSelectorId()!==n)return;if(me.length===0){pe=0;return}const ye=me.length-pe;if(pe=me.length,ye<0)return;const Se=me[me.length-1];let je="";Se.unitId===I.current&&Se.sheetId===B.current?je=i1.serializeRange(Se.range):Se.unitId===I.current?je=i1.serializeRangeWithSheet(Se.sheetName,Se.range):je=i1.serializeRangeWithSpreadsheet(Se.unitId,Se.sheetName,Se.range),ye>=1&&!G.current?(j(je),he(-1)):M.current===-1?J(je):U(M.current,je)});return()=>{Te.unsubscribe(),de.unobserve(ee)}},[]),s.useEffect(()=>{I.current=p,B.current=d,G.current=v,W.current=m},[p,d,v,m]),s.useEffect(()=>{M.current=oe},[oe]);function q(){F(!1),D.setCurrentSelectorId(null)}function se(){W.current!==!0&&(E.closeRangePrompt(),D.setCurrentSelectorId(n),F(!0),ae.length>0?w(ie?ae.split(","):[""]):D.openSelector())}function _e(ee){ne(ee),c&&c(ee)}function Me(ee){ce(ee),h&&h(ee)}function Ee(){if(W.current===!0){q();return}let ee="";const de=x.filter(pe=>i1.isReferenceStringWithEffectiveColumn(pe.trim()));if(de.length===1){const pe=de[0];i1.isReferenceStringWithEffectiveColumn(pe.trim())&&(ee=pe.trim())}else ee=de.join(",");E.setValue(ee,n),q()}function fe(){j(""),he(-1)}function Ve(ee){var de,pe;return((pe=(de=k.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET))==null?void 0:de.getSheetBySheetName(ee))==null?void 0:pe.getSheetId())||""}function $e(ee){if(Q(ee||""),ee==null){t&&t([]);return}const de=i1.getRangeWithRefsString(ee,Ve);t&&t(de||[])}let Ae=De.rangeSelector;m?Ae=`${De.rangeSelector} ${De.rangeSelectorDisabled}`:ie?Y&&(Ae=`${De.rangeSelector} ${De.rangeSelectorActive}`):Ae=`${De.rangeSelector} ${De.rangeSelectorError}`,L&&(Ae=`${Ae} ${L}`);let Ie=28;return a==="mini"?Ie=20:a==="small"?Ie=24:a==="large"&&(Ie=32),g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:Ae,ref:T,style:{width:i,height:Ie},children:[g.jsx(qi,{placeholder:o,value:r,isReadonly:m,isSingleChoice:v,openForSheetUnitId:p,openForSheetSubUnitId:d,onValid:Me,onActive:_e,onChange:$e,id:n,onlyInputRange:!0,canvasStyle:{fontSize:10},className:De.rangeSelectorEditor}),g.jsx(ue.Tooltip,{title:z.t("rangeSelector.buttonTooltip"),placement:"bottom",children:g.jsx("button",{className:De.rangeSelectorIcon,onClick:se,children:g.jsx(g6,{})})})]}),g.jsx(ue.Dialog,{width:"328px",visible:$,title:z.t("rangeSelector.title"),draggable:!0,closeIcon:g.jsx(D1,{}),footer:g.jsxs("footer",{children:[g.jsx(ue.Button,{onClick:q,children:z.t("rangeSelector.cancel")}),g.jsx(ue.Button,{style:{marginLeft:10},onClick:Ee,type:"primary",children:z.t("rangeSelector.confirm")})]}),onClose:q,children:g.jsxs("div",{className:Ue(De.rangeSelectorModal,_),children:[x.map((ee,de)=>g.jsxs("div",{className:De.rangeSelectorModalContainer,children:[g.jsx("div",{style:{width:x.length===1?"280px":"252px"},className:De.rangeSelectorModalContainerInput,children:g.jsx(ue.Input,{className:oe===de||x.length-1===de&&oe===-1?De.rangeSelectorModalContainerInputActive:"",placeholder:z.t("rangeSelector.placeHolder"),affixWrapperStyle:{width:"100%"},onClick:()=>he(de),value:ee,onChange:pe=>U(de,pe)},`input${de}`)}),g.jsx("div",{style:{display:x.length===1?"none":"inline-block"},className:De.rangeSelectorModalContainerButton,children:g.jsx(h3,{className:De.rangeSelectorModalContainerDeleteButton,onClick:()=>Z(de)})})]},de)),g.jsx("div",{style:{display:v?"none":"unset"},className:De.rangeSelectorModalAdd,children:g.jsxs(ue.Button,{type:"link",size:"small",onClick:fe,className:De.rangeSelectorModalAddButton,children:[g.jsx(O3,{}),g.jsx("span",{children:z.t("rangeSelector.addAnotherRange")})]})})]})})]})}const Yl="univer-progress-bar",ql="univer-progress-bar-container",Xl="univer-progress-bar-inner",Ql="univer-progress-bar-close-button",J1={progressBar:Yl,progressBarContainer:ql,progressBarInner:Xl,progressBarCloseButton:Ql};function Jl(e){const{barColor:t}=e,n=u.useDependency(At),r=s.useRef(null),[i,o]=s.useState(!1);s.useEffect(()=>{const c=n.progressVisible$.subscribe(v=>{v?o(v):setTimeout(()=>{o(v),r.current&&(r.current.style.width="0%")},500)}),h=n.progressChange$.subscribe(v=>{const{step:p}=v;if(r.current){const d=Number.parseFloat(r.current.style.width)||0,m=d+(100-d)*p;r.current.style.width=`${m}%`}});return()=>{c.unsubscribe(),h.unsubscribe()}},[]);function a(){n.stop()}return g.jsxs("div",{className:J1.progressBarContainer,style:{display:i?"flex":"none"},children:[g.jsx("div",{className:J1.progressBar,children:g.jsx("div",{ref:r,className:J1.progressBarInner,style:{backgroundColor:t}})}),g.jsx("div",{className:J1.progressBarCloseButton,onClick:a,children:g.jsx(D1,{})})]})}const Kl="UNI_DISABLE_CHANGING_FOCUS";exports.BuiltInUIPart=we;exports.CanvasFloatDomService=Ct;exports.CanvasPopup=_n;exports.CanvasPopupService=Sn;exports.ComponentContainer=Be;exports.ComponentManager=qe;exports.ContextMenu=li;exports.ContextMenuService=Ln;exports.CopyCommand=vn;exports.CopyShortcutItem=z6;exports.CustomLabel=ze;exports.CutCommand=gn;exports.CutShortcutItem=Z6;exports.DEFAULT_BACKGROUND_COLOR_RGB=Gi;exports.DEFAULT_BACKGROUND_COLOR_RGBA=Wi;exports.DISABLE_AUTO_FOCUS_KEY=Ui;exports.DesktopLocalStorageService=An;exports.DesktopMessageService=In;exports.DesktopSidebarService=Vn;exports.FONT_FAMILY_LIST=as;exports.FONT_SIZE_LIST=us;exports.FloatDom=yn;exports.FontFamily=is;exports.FontFamilyItem=os;exports.FontSize=cs;exports.GlobalZone=pi;exports.HTML_CLIPBOARD_MIME_TYPE=nn;exports.IBeforeCloseService=Rn;exports.ICanvasPopupService=mt;exports.IClipboardInterfaceService=xn;exports.IConfirmService=_t;exports.IContextMenuService=j1;exports.IDialogService=yt;exports.IEditorService=E1;exports.IGlobalZoneService=St;exports.ILayoutService=o1;exports.IMenuService=a1;exports.IMessageService=w1;exports.INotificationService=$1;exports.IPlatformService=dt;exports.IProgressService=At;exports.IRangeSelectorService=Vt;exports.IShortcutService=g1;exports.ISidebarService=P1;exports.IUIController=pt;exports.IUIPartsService=n1;exports.IZenZoneService=bt;exports.KeyCode=u1;exports.Menu=st;exports.MenuGroup=c1;exports.MenuItemType=ke;exports.MenuPosition=Ye;exports.MetaKeys=Pe;exports.MobileContextMenu=Fi;exports.PLAIN_TEXT_CLIPBOARD_MIME_TYPE=tn;exports.PasteCommand=mn;exports.PlatformService=Cn;exports.ProgressBar=Jl;exports.ProgressService=Pn;exports.RangeSelector=Gl;exports.RangeSelectorService=jn;exports.RedoShortcutItem=G6;exports.SetEditorResizeOperation=F6;exports.ShortcutPanelService=Dt;exports.Sidebar=En;exports.TextEditor=qi;exports.ToggleShortcutPanelOperation=Nt;exports.Toolbar=hi;exports.UIPartsService=bn;exports.UI_CONFIG_KEY=Y6;exports.UNIVER_UI_PLUGIN_NAME=Bi;exports.UNI_DISABLE_CHANGING_FOCUS_KEY=Kl;exports.UndoShortcutItem=W6;exports.VueComponentWrapper=T6;exports.ZIndexManager=T1;exports.ZenZone=wn;exports.builtInGlobalComponents=Mn;exports.getHeaderFooterMenuHiddenObservable=qa;exports.getMenuHiddenObservable=D6;exports.handelExcelToJson=yl;exports.handelTableToJson=bl;exports.handleDomToJson=$n;exports.handlePlainToJson=Sl;exports.handleStringToStyle=jt;exports.handleTableColgroup=ml;exports.handleTableMergeData=_l;exports.handleTableRowGroup=Cl;exports.isElementVisible=Zi;exports.mergeMenuConfigs=U6;exports.splitSpanText=Yi;exports.t=ds;exports.textTrim=rt;exports.useComponentsOfPart=Fe;exports.useEvent=k6;exports.useObservable=Oe;exports.useScrollYOverContainer=B6;exports.useToolbarCollapseObserver=di;exports.useToolbarGroups=ui;exports.useToolbarItemStatus=fi;
|
|
46
|
+
*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,o){function a(v,p){if(!i[v]){if(!r[v]){var f=typeof Q1=="function"&&Q1;if(!p&&f)return f(v,!0);if(c)return c(v,!0);var m=new Error("Cannot find module '"+v+"'");throw m.code="MODULE_NOT_FOUND",m}var _=i[v]={exports:{}};r[v][0].call(_.exports,function(L){var x=r[v][1][L];return a(x||L)},_,_.exports,n,r,i,o)}return i[v].exports}for(var c=typeof Q1=="function"&&Q1,h=0;h<o.length;h++)a(o[h]);return a}({1:[function(n,r,i){(function(o){var a=o.MutationObserver||o.WebKitMutationObserver,c;if(a){var h=0,v=new a(L),p=o.document.createTextNode("");v.observe(p,{characterData:!0}),c=function(){p.data=h=++h%2}}else if(!o.setImmediate&&typeof o.MessageChannel<"u"){var f=new o.MessageChannel;f.port1.onmessage=L,c=function(){f.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?c=function(){var w=o.document.createElement("script");w.onreadystatechange=function(){L(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},o.document.documentElement.appendChild(w)}:c=function(){setTimeout(L,0)};var m,_=[];function L(){m=!0;for(var w,j,Z=_.length;Z;){for(j=_,_=[],w=-1;++w<Z;)j[w]();Z=_.length}m=!1}r.exports=x;function x(w){_.push(w)===1&&!m&&c()}}).call(this,typeof F1<"u"?F1:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var o=n(1);function a(){}var c={},h=["REJECTED"],v=["FULFILLED"],p=["PENDING"];r.exports=f;function f(E){if(typeof E!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,E!==a&&x(this,E)}f.prototype.catch=function(E){return this.then(null,E)},f.prototype.then=function(E,D){if(typeof E!="function"&&this.state===v||typeof D!="function"&&this.state===h)return this;var k=new this.constructor(a);if(this.state!==p){var $=this.state===v?E:D;_(k,$,this.outcome)}else this.queue.push(new m(k,E,D));return k};function m(E,D,k){this.promise=E,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}m.prototype.callFulfilled=function(E){c.resolve(this.promise,E)},m.prototype.otherCallFulfilled=function(E){_(this.promise,this.onFulfilled,E)},m.prototype.callRejected=function(E){c.reject(this.promise,E)},m.prototype.otherCallRejected=function(E){_(this.promise,this.onRejected,E)};function _(E,D,k){o(function(){var $;try{$=D(k)}catch(F){return c.reject(E,F)}$===E?c.reject(E,new TypeError("Cannot resolve promise with itself")):c.resolve(E,$)})}c.resolve=function(E,D){var k=w(L,D);if(k.status==="error")return c.reject(E,k.value);var $=k.value;if($)x(E,$);else{E.state=v,E.outcome=D;for(var F=-1,z=E.queue.length;++F<z;)E.queue[F].callFulfilled(D)}return E},c.reject=function(E,D){E.state=h,E.outcome=D;for(var k=-1,$=E.queue.length;++k<$;)E.queue[k].callRejected(D);return E};function L(E){var D=E&&E.then;if(E&&(typeof E=="object"||typeof E=="function")&&typeof D=="function")return function(){D.apply(E,arguments)}}function x(E,D){var k=!1;function $(ne){k||(k=!0,c.reject(E,ne))}function F(ne){k||(k=!0,c.resolve(E,ne))}function z(){D(F,$)}var Y=w(z);Y.status==="error"&&$(Y.value)}function w(E,D){var k={};try{k.value=E(D),k.status="success"}catch($){k.status="error",k.value=$}return k}f.resolve=j;function j(E){return E instanceof this?E:c.resolve(new this(a),E)}f.reject=Z;function Z(E){var D=new this(a);return c.reject(D,E)}f.all=U;function U(E){var D=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=E.length,$=!1;if(!k)return this.resolve([]);for(var F=new Array(k),z=0,Y=-1,ne=new this(a);++Y<k;)ie(E[Y],Y);return ne;function ie(ce,ae){D.resolve(ce).then(Q,function(oe){$||($=!0,c.reject(ne,oe))});function Q(oe){F[ae]=oe,++z===k&&!$&&($=!0,c.resolve(ne,F))}}}f.race=J;function J(E){var D=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=E.length,$=!1;if(!k)return this.resolve([]);for(var F=-1,z=new this(a);++F<k;)Y(E[F]);return z;function Y(ne){D.resolve(ne).then(function(ie){$||($=!0,c.resolve(z,ie))},function(ie){$||($=!0,c.reject(z,ie))})}}},{1:1}],3:[function(n,r,i){(function(o){typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,typeof F1<"u"?F1:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function a(l,C){if(!(l instanceof C))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=c();function v(){try{if(!h||!h.open)return!1;var l=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),C=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||C)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function p(l,C){l=l||[],C=C||{};try{return new Blob(l,C)}catch(b){if(b.name!=="TypeError")throw b;for(var d=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,S=new d,y=0;y<l.length;y+=1)S.append(l[y]);return S.getBlob(C.type)}}typeof Promise>"u"&&n(3);var f=Promise;function m(l,C){C&&l.then(function(d){C(null,d)},function(d){C(d)})}function _(l,C,d){typeof C=="function"&&l.then(C),typeof d=="function"&&l.catch(d)}function L(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function x(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",j=void 0,Z={},U=Object.prototype.toString,J="readonly",E="readwrite";function D(l){for(var C=l.length,d=new ArrayBuffer(C),S=new Uint8Array(d),y=0;y<C;y++)S[y]=l.charCodeAt(y);return d}function k(l){return new f(function(C){var d=l.transaction(w,E),S=p([""]);d.objectStore(w).put(S,"key"),d.onabort=function(y){y.preventDefault(),y.stopPropagation(),C(!1)},d.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),b=navigator.userAgent.match(/Edge\//);C(b||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function $(l){return typeof j=="boolean"?f.resolve(j):k(l).then(function(C){return j=C,j})}function F(l){var C=Z[l.name],d={};d.promise=new f(function(S,y){d.resolve=S,d.reject=y}),C.deferredOperations.push(d),C.dbReady?C.dbReady=C.dbReady.then(function(){return d.promise}):C.dbReady=d.promise}function z(l){var C=Z[l.name],d=C.deferredOperations.pop();if(d)return d.resolve(),d.promise}function Y(l,C){var d=Z[l.name],S=d.deferredOperations.pop();if(S)return S.reject(C),S.promise}function ne(l,C){return new f(function(d,S){if(Z[l.name]=Z[l.name]||B(),l.db)if(C)F(l),l.db.close();else return d(l.db);var y=[l.name];C&&y.push(l.version);var b=h.open.apply(h,y);C&&(b.onupgradeneeded=function(R){var H=b.result;try{H.createObjectStore(l.storeName),R.oldVersion<=1&&H.createObjectStore(w)}catch(N){if(N.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw N}}),b.onerror=function(R){R.preventDefault(),S(b.error)},b.onsuccess=function(){var R=b.result;R.onversionchange=function(H){H.target.close()},d(R),z(l)}})}function ie(l){return ne(l,!1)}function ce(l){return ne(l,!0)}function ae(l,C){if(!l.db)return!0;var d=!l.db.objectStoreNames.contains(l.storeName),S=l.version<l.db.version,y=l.version>l.db.version;if(S&&(l.version!==C&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),y||d){if(d){var b=l.db.version+1;b>l.version&&(l.version=b)}return!0}return!1}function Q(l){return new f(function(C,d){var S=new FileReader;S.onerror=d,S.onloadend=function(y){var b=btoa(y.target.result||"");C({__local_forage_encoded_blob:!0,data:b,type:l.type})},S.readAsBinaryString(l)})}function oe(l){var C=D(atob(l.data));return p([C],{type:l.type})}function he(l){return l&&l.__local_forage_encoded_blob}function T(l){var C=this,d=C._initReady().then(function(){var S=Z[C._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return _(d,l,l),d}function M(l){F(l);for(var C=Z[l.name],d=C.forages,S=0;S<d.length;S++){var y=d[S];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return l.db=null,ie(l).then(function(b){return l.db=b,ae(l)?ce(l):b}).then(function(b){l.db=C.db=b;for(var R=0;R<d.length;R++)d[R]._dbInfo.db=b}).catch(function(b){throw Y(l,b),b})}function I(l,C,d,S){S===void 0&&(S=1);try{var y=l.db.transaction(l.storeName,C);d(null,y)}catch(b){if(S>0&&(!l.db||b.name==="InvalidStateError"||b.name==="NotFoundError"))return f.resolve().then(function(){if(!l.db||b.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),ce(l)}).then(function(){return M(l).then(function(){I(l,C,d,S-1)})}).catch(d);d(b)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function G(l){var C=this,d={db:null};if(l)for(var S in l)d[S]=l[S];var y=Z[d.name];y||(y=B(),Z[d.name]=y),y.forages.push(C),C._initReady||(C._initReady=C.ready,C.ready=T);var b=[];function R(){return f.resolve()}for(var H=0;H<y.forages.length;H++){var N=y.forages[H];N!==C&&b.push(N._initReady().catch(R))}var V=y.forages.slice(0);return f.all(b).then(function(){return d.db=y.db,ie(d)}).then(function(P){return d.db=P,ae(d,C._defaultConfig.version)?ce(d):P}).then(function(P){d.db=y.db=P,C._dbInfo=d;for(var X=0;X<V.length;X++){var le=V[X];le!==C&&(le._dbInfo.db=d.db,le._dbInfo.version=d.version)}})}function W(l,C){var d=this;l=L(l);var S=new f(function(y,b){d.ready().then(function(){I(d._dbInfo,J,function(R,H){if(R)return b(R);try{var N=H.objectStore(d._dbInfo.storeName),V=N.get(l);V.onsuccess=function(){var P=V.result;P===void 0&&(P=null),he(P)&&(P=oe(P)),y(P)},V.onerror=function(){b(V.error)}}catch(P){b(P)}})}).catch(b)});return m(S,C),S}function q(l,C){var d=this,S=new f(function(y,b){d.ready().then(function(){I(d._dbInfo,J,function(R,H){if(R)return b(R);try{var N=H.objectStore(d._dbInfo.storeName),V=N.openCursor(),P=1;V.onsuccess=function(){var X=V.result;if(X){var le=X.value;he(le)&&(le=oe(le));var ve=l(le,X.key,P++);ve!==void 0?y(ve):X.continue()}else y()},V.onerror=function(){b(V.error)}}catch(X){b(X)}})}).catch(b)});return m(S,C),S}function se(l,C,d){var S=this;l=L(l);var y=new f(function(b,R){var H;S.ready().then(function(){return H=S._dbInfo,U.call(C)==="[object Blob]"?$(H.db).then(function(N){return N?C:Q(C)}):C}).then(function(N){I(S._dbInfo,E,function(V,P){if(V)return R(V);try{var X=P.objectStore(S._dbInfo.storeName);N===null&&(N=void 0);var le=X.put(N,l);P.oncomplete=function(){N===void 0&&(N=null),b(N)},P.onabort=P.onerror=function(){var ve=le.error?le.error:le.transaction.error;R(ve)}}catch(ve){R(ve)}})}).catch(R)});return m(y,d),y}function _e(l,C){var d=this;l=L(l);var S=new f(function(y,b){d.ready().then(function(){I(d._dbInfo,E,function(R,H){if(R)return b(R);try{var N=H.objectStore(d._dbInfo.storeName),V=N.delete(l);H.oncomplete=function(){y()},H.onerror=function(){b(V.error)},H.onabort=function(){var P=V.error?V.error:V.transaction.error;b(P)}}catch(P){b(P)}})}).catch(b)});return m(S,C),S}function Me(l){var C=this,d=new f(function(S,y){C.ready().then(function(){I(C._dbInfo,E,function(b,R){if(b)return y(b);try{var H=R.objectStore(C._dbInfo.storeName),N=H.clear();R.oncomplete=function(){S()},R.onabort=R.onerror=function(){var V=N.error?N.error:N.transaction.error;y(V)}}catch(V){y(V)}})}).catch(y)});return m(d,l),d}function Ee(l){var C=this,d=new f(function(S,y){C.ready().then(function(){I(C._dbInfo,J,function(b,R){if(b)return y(b);try{var H=R.objectStore(C._dbInfo.storeName),N=H.count();N.onsuccess=function(){S(N.result)},N.onerror=function(){y(N.error)}}catch(V){y(V)}})}).catch(y)});return m(d,l),d}function fe(l,C){var d=this,S=new f(function(y,b){if(l<0){y(null);return}d.ready().then(function(){I(d._dbInfo,J,function(R,H){if(R)return b(R);try{var N=H.objectStore(d._dbInfo.storeName),V=!1,P=N.openKeyCursor();P.onsuccess=function(){var X=P.result;if(!X){y(null);return}l===0||V?y(X.key):(V=!0,X.advance(l))},P.onerror=function(){b(P.error)}}catch(X){b(X)}})}).catch(b)});return m(S,C),S}function Ve(l){var C=this,d=new f(function(S,y){C.ready().then(function(){I(C._dbInfo,J,function(b,R){if(b)return y(b);try{var H=R.objectStore(C._dbInfo.storeName),N=H.openKeyCursor(),V=[];N.onsuccess=function(){var P=N.result;if(!P){S(V);return}V.push(P.key),P.continue()},N.onerror=function(){y(N.error)}}catch(P){y(P)}})}).catch(y)});return m(d,l),d}function $e(l,C){C=x.apply(this,arguments);var d=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||d.name,l.storeName=l.storeName||d.storeName);var S=this,y;if(!l.name)y=f.reject("Invalid arguments");else{var b=l.name===d.name&&S._dbInfo.db,R=b?f.resolve(S._dbInfo.db):ie(l).then(function(H){var N=Z[l.name],V=N.forages;N.db=H;for(var P=0;P<V.length;P++)V[P]._dbInfo.db=H;return H});l.storeName?y=R.then(function(H){if(H.objectStoreNames.contains(l.storeName)){var N=H.version+1;F(l);var V=Z[l.name],P=V.forages;H.close();for(var X=0;X<P.length;X++){var le=P[X];le._dbInfo.db=null,le._dbInfo.version=N}var ve=new f(function(Ce,xe){var Re=h.open(l.name,N);Re.onerror=function(We){var R1=Re.result;R1.close(),xe(We)},Re.onupgradeneeded=function(){var We=Re.result;We.deleteObjectStore(l.storeName)},Re.onsuccess=function(){var We=Re.result;We.close(),Ce(We)}});return ve.then(function(Ce){V.db=Ce;for(var xe=0;xe<P.length;xe++){var Re=P[xe];Re._dbInfo.db=Ce,z(Re._dbInfo)}}).catch(function(Ce){throw(Y(l,Ce)||f.resolve()).catch(function(){}),Ce})}}):y=R.then(function(H){F(l);var N=Z[l.name],V=N.forages;H.close();for(var P=0;P<V.length;P++){var X=V[P];X._dbInfo.db=null}var le=new f(function(ve,Ce){var xe=h.deleteDatabase(l.name);xe.onerror=function(){var Re=xe.result;Re&&Re.close(),Ce(xe.error)},xe.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},xe.onsuccess=function(){var Re=xe.result;Re&&Re.close(),ve(Re)}});return le.then(function(ve){N.db=ve;for(var Ce=0;Ce<V.length;Ce++){var xe=V[Ce];z(xe._dbInfo)}}).catch(function(ve){throw(Y(l,ve)||f.resolve()).catch(function(){}),ve})})}return m(y,C),y}var Ae={_driver:"asyncStorage",_initStorage:G,_support:v(),iterate:q,getItem:W,setItem:se,removeItem:_e,clear:Me,length:Ee,key:fe,keys:Ve,dropInstance:$e};function Ie(){return typeof openDatabase=="function"}var ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de="~~local_forage_type~",pe=/^~~local_forage_type~([^~]+)~/,Te="__lfsc__:",me=Te.length,ye="arbf",Se="blob",je="si08",k1="ui08",f1="uic8",e1="si16",B1="si32",kn="ur16",Bn="ui32",Un="fl32",Fn="fl64",zn=me+ye.length,Zn=Object.prototype.toString;function Wn(l){var C=l.length*.75,d=l.length,S,y=0,b,R,H,N;l[l.length-1]==="="&&(C--,l[l.length-2]==="="&&C--);var V=new ArrayBuffer(C),P=new Uint8Array(V);for(S=0;S<d;S+=4)b=ee.indexOf(l[S]),R=ee.indexOf(l[S+1]),H=ee.indexOf(l[S+2]),N=ee.indexOf(l[S+3]),P[y++]=b<<2|R>>4,P[y++]=(R&15)<<4|H>>2,P[y++]=(H&3)<<6|N&63;return V}function Pt(l){var C=new Uint8Array(l),d="",S;for(S=0;S<C.length;S+=3)d+=ee[C[S]>>2],d+=ee[(C[S]&3)<<4|C[S+1]>>4],d+=ee[(C[S+1]&15)<<2|C[S+2]>>6],d+=ee[C[S+2]&63];return C.length%3===2?d=d.substring(0,d.length-1)+"=":C.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}function Xi(l,C){var d="";if(l&&(d=Zn.call(l)),l&&(d==="[object ArrayBuffer]"||l.buffer&&Zn.call(l.buffer)==="[object ArrayBuffer]")){var S,y=Te;l instanceof ArrayBuffer?(S=l,y+=ye):(S=l.buffer,d==="[object Int8Array]"?y+=je:d==="[object Uint8Array]"?y+=k1:d==="[object Uint8ClampedArray]"?y+=f1:d==="[object Int16Array]"?y+=e1:d==="[object Uint16Array]"?y+=kn:d==="[object Int32Array]"?y+=B1:d==="[object Uint32Array]"?y+=Bn:d==="[object Float32Array]"?y+=Un:d==="[object Float64Array]"?y+=Fn:C(new Error("Failed to get type for BinaryArray"))),C(y+Pt(S))}else if(d==="[object Blob]"){var b=new FileReader;b.onload=function(){var R=de+l.type+"~"+Pt(this.result);C(Te+Se+R)},b.readAsArrayBuffer(l)}else try{C(JSON.stringify(l))}catch(R){console.error("Couldn't convert value into a JSON string: ",l),C(null,R)}}function Qi(l){if(l.substring(0,me)!==Te)return JSON.parse(l);var C=l.substring(zn),d=l.substring(me,zn),S;if(d===Se&&pe.test(C)){var y=C.match(pe);S=y[1],C=C.substring(y[0].length)}var b=Wn(C);switch(d){case ye:return b;case Se:return p([b],{type:S});case je:return new Int8Array(b);case k1:return new Uint8Array(b);case f1:return new Uint8ClampedArray(b);case e1:return new Int16Array(b);case kn:return new Uint16Array(b);case B1:return new Int32Array(b);case Bn:return new Uint32Array(b);case Un:return new Float32Array(b);case Fn:return new Float64Array(b);default:throw new Error("Unkown type: "+d)}}var $t={serialize:Xi,deserialize:Qi,stringToBuffer:Wn,bufferToString:Pt};function Gn(l,C,d,S){l.executeSql("CREATE TABLE IF NOT EXISTS "+C.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],d,S)}function Ji(l){var C=this,d={db:null};if(l)for(var S in l)d[S]=typeof l[S]!="string"?l[S].toString():l[S];var y=new f(function(b,R){try{d.db=openDatabase(d.name,String(d.version),d.description,d.size)}catch(H){return R(H)}d.db.transaction(function(H){Gn(H,d,function(){C._dbInfo=d,b()},function(N,V){R(V)})},R)});return d.serializer=$t,y}function s1(l,C,d,S,y,b){l.executeSql(d,S,y,function(R,H){H.code===H.SYNTAX_ERR?R.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[C.storeName],function(N,V){V.rows.length?b(N,H):Gn(N,C,function(){N.executeSql(d,S,y,b)},b)},b):b(R,H)},b)}function Ki(l,C){var d=this;l=L(l);var S=new f(function(y,b){d.ready().then(function(){var R=d._dbInfo;R.db.transaction(function(H){s1(H,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[l],function(N,V){var P=V.rows.length?V.rows.item(0).value:null;P&&(P=R.serializer.deserialize(P)),y(P)},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function e9(l,C){var d=this,S=new f(function(y,b){d.ready().then(function(){var R=d._dbInfo;R.db.transaction(function(H){s1(H,R,"SELECT * FROM "+R.storeName,[],function(N,V){for(var P=V.rows,X=P.length,le=0;le<X;le++){var ve=P.item(le),Ce=ve.value;if(Ce&&(Ce=R.serializer.deserialize(Ce)),Ce=l(Ce,ve.key,le+1),Ce!==void 0){y(Ce);return}}y()},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function Yn(l,C,d,S){var y=this;l=L(l);var b=new f(function(R,H){y.ready().then(function(){C===void 0&&(C=null);var N=C,V=y._dbInfo;V.serializer.serialize(C,function(P,X){X?H(X):V.db.transaction(function(le){s1(le,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[l,P],function(){R(N)},function(ve,Ce){H(Ce)})},function(le){if(le.code===le.QUOTA_ERR){if(S>0){R(Yn.apply(y,[l,N,d,S-1]));return}H(le)}})})}).catch(H)});return m(b,d),b}function t9(l,C,d){return Yn.apply(this,[l,C,d,1])}function n9(l,C){var d=this;l=L(l);var S=new f(function(y,b){d.ready().then(function(){var R=d._dbInfo;R.db.transaction(function(H){s1(H,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[l],function(){y()},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function r9(l){var C=this,d=new f(function(S,y){C.ready().then(function(){var b=C._dbInfo;b.db.transaction(function(R){s1(R,b,"DELETE FROM "+b.storeName,[],function(){S()},function(H,N){y(N)})})}).catch(y)});return m(d,l),d}function i9(l){var C=this,d=new f(function(S,y){C.ready().then(function(){var b=C._dbInfo;b.db.transaction(function(R){s1(R,b,"SELECT COUNT(key) as c FROM "+b.storeName,[],function(H,N){var V=N.rows.item(0).c;S(V)},function(H,N){y(N)})})}).catch(y)});return m(d,l),d}function o9(l,C){var d=this,S=new f(function(y,b){d.ready().then(function(){var R=d._dbInfo;R.db.transaction(function(H){s1(H,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[l+1],function(N,V){var P=V.rows.length?V.rows.item(0).key:null;y(P)},function(N,V){b(V)})})}).catch(b)});return m(S,C),S}function a9(l){var C=this,d=new f(function(S,y){C.ready().then(function(){var b=C._dbInfo;b.db.transaction(function(R){s1(R,b,"SELECT key FROM "+b.storeName,[],function(H,N){for(var V=[],P=0;P<N.rows.length;P++)V.push(N.rows.item(P).key);S(V)},function(H,N){y(N)})})}).catch(y)});return m(d,l),d}function s9(l){return new f(function(C,d){l.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,b){for(var R=[],H=0;H<b.rows.length;H++)R.push(b.rows.item(H).name);C({db:l,storeNames:R})},function(y,b){d(b)})},function(S){d(S)})})}function l9(l,C){C=x.apply(this,arguments);var d=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||d.name,l.storeName=l.storeName||d.storeName);var S=this,y;return l.name?y=new f(function(b){var R;l.name===d.name?R=S._dbInfo.db:R=openDatabase(l.name,"","",0),l.storeName?b({db:R,storeNames:[l.storeName]}):b(s9(R))}).then(function(b){return new f(function(R,H){b.db.transaction(function(N){function V(ve){return new f(function(Ce,xe){N.executeSql("DROP TABLE IF EXISTS "+ve,[],function(){Ce()},function(Re,We){xe(We)})})}for(var P=[],X=0,le=b.storeNames.length;X<le;X++)P.push(V(b.storeNames[X]));f.all(P).then(function(){R()}).catch(function(ve){H(ve)})},function(N){H(N)})})}):y=f.reject("Invalid arguments"),m(y,C),y}var c9={_driver:"webSQLStorage",_initStorage:Ji,_support:Ie(),iterate:e9,getItem:Ki,setItem:t9,removeItem:n9,clear:r9,length:i9,key:o9,keys:a9,dropInstance:l9};function u9(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qn(l,C){var d=l.name+"/";return l.storeName!==C.storeName&&(d+=l.storeName+"/"),d}function f9(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch{return!0}}function d9(){return!f9()||localStorage.length>0}function h9(l){var C=this,d={};if(l)for(var S in l)d[S]=l[S];return d.keyPrefix=qn(l,C._defaultConfig),d9()?(C._dbInfo=d,d.serializer=$t,f.resolve()):f.reject()}function p9(l){var C=this,d=C.ready().then(function(){for(var S=C._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var b=localStorage.key(y);b.indexOf(S)===0&&localStorage.removeItem(b)}});return m(d,l),d}function v9(l,C){var d=this;l=L(l);var S=d.ready().then(function(){var y=d._dbInfo,b=localStorage.getItem(y.keyPrefix+l);return b&&(b=y.serializer.deserialize(b)),b});return m(S,C),S}function g9(l,C){var d=this,S=d.ready().then(function(){for(var y=d._dbInfo,b=y.keyPrefix,R=b.length,H=localStorage.length,N=1,V=0;V<H;V++){var P=localStorage.key(V);if(P.indexOf(b)===0){var X=localStorage.getItem(P);if(X&&(X=y.serializer.deserialize(X)),X=l(X,P.substring(R),N++),X!==void 0)return X}}});return m(S,C),S}function m9(l,C){var d=this,S=d.ready().then(function(){var y=d._dbInfo,b;try{b=localStorage.key(l)}catch{b=null}return b&&(b=b.substring(y.keyPrefix.length)),b});return m(S,C),S}function C9(l){var C=this,d=C.ready().then(function(){for(var S=C._dbInfo,y=localStorage.length,b=[],R=0;R<y;R++){var H=localStorage.key(R);H.indexOf(S.keyPrefix)===0&&b.push(H.substring(S.keyPrefix.length))}return b});return m(d,l),d}function b9(l){var C=this,d=C.keys().then(function(S){return S.length});return m(d,l),d}function S9(l,C){var d=this;l=L(l);var S=d.ready().then(function(){var y=d._dbInfo;localStorage.removeItem(y.keyPrefix+l)});return m(S,C),S}function _9(l,C,d){var S=this;l=L(l);var y=S.ready().then(function(){C===void 0&&(C=null);var b=C;return new f(function(R,H){var N=S._dbInfo;N.serializer.serialize(C,function(V,P){if(P)H(P);else try{localStorage.setItem(N.keyPrefix+l,V),R(b)}catch(X){(X.name==="QuotaExceededError"||X.name==="NS_ERROR_DOM_QUOTA_REACHED")&&H(X),H(X)}})})});return m(y,d),y}function y9(l,C){if(C=x.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var d=this.config();l.name=l.name||d.name,l.storeName=l.storeName||d.storeName}var S=this,y;return l.name?y=new f(function(b){l.storeName?b(qn(l,S._defaultConfig)):b(l.name+"/")}).then(function(b){for(var R=localStorage.length-1;R>=0;R--){var H=localStorage.key(R);H.indexOf(b)===0&&localStorage.removeItem(H)}}):y=f.reject("Invalid arguments"),m(y,C),y}var L9={_driver:"localStorageWrapper",_initStorage:h9,_support:u9(),iterate:g9,getItem:v9,setItem:_9,removeItem:S9,clear:p9,length:b9,key:m9,keys:C9,dropInstance:y9},E9=function(C,d){return C===d||typeof C=="number"&&typeof d=="number"&&isNaN(C)&&isNaN(d)},w9=function(C,d){for(var S=C.length,y=0;y<S;){if(E9(C[y],d))return!0;y++}return!1},Xn=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},M1={},Qn={},m1={INDEXEDDB:Ae,WEBSQL:c9,LOCALSTORAGE:L9},M9=[m1.INDEXEDDB._driver,m1.WEBSQL._driver,m1.LOCALSTORAGE._driver],U1=["dropInstance"],kt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(U1),R9={description:"",driver:M9.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function x9(l,C){l[C]=function(){var d=arguments;return l.ready().then(function(){return l[C].apply(l,d)})}}function Bt(){for(var l=1;l<arguments.length;l++){var C=arguments[l];if(C)for(var d in C)C.hasOwnProperty(d)&&(Xn(C[d])?arguments[0][d]=C[d].slice():arguments[0][d]=C[d])}return arguments[0]}var I9=function(){function l(C){a(this,l);for(var d in m1)if(m1.hasOwnProperty(d)){var S=m1[d],y=S._driver;this[d]=y,M1[y]||this.defineDriver(S)}this._defaultConfig=Bt({},R9),this._config=Bt({},this._defaultConfig,C),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(d){if((typeof d>"u"?"undefined":o(d))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in d){if(S==="storeName"&&(d[S]=d[S].replace(/\W/g,"_")),S==="version"&&typeof d[S]!="number")return new Error("Database version must be a number.");this._config[S]=d[S]}return"driver"in d&&d.driver?this.setDriver(this._config.driver):!0}else return typeof d=="string"?this._config[d]:this._config},l.prototype.defineDriver=function(d,S,y){var b=new f(function(R,H){try{var N=d._driver,V=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!d._driver){H(V);return}for(var P=kt.concat("_initStorage"),X=0,le=P.length;X<le;X++){var ve=P[X],Ce=!w9(U1,ve);if((Ce||d[ve])&&typeof d[ve]!="function"){H(V);return}}var xe=function(){for(var R1=function(T9){return function(){var D9=new Error("Method "+T9+" is not implemented by the current driver"),Jn=f.reject(D9);return m(Jn,arguments[arguments.length-1]),Jn}},Ut=0,H9=U1.length;Ut<H9;Ut++){var Ft=U1[Ut];d[Ft]||(d[Ft]=R1(Ft))}};xe();var Re=function(R1){M1[N]&&console.info("Redefining LocalForage driver: "+N),M1[N]=d,Qn[N]=R1,R()};"_support"in d?d._support&&typeof d._support=="function"?d._support().then(Re,H):Re(!!d._support):Re(!0)}catch(We){H(We)}});return _(b,S,y),b},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(d,S,y){var b=M1[d]?f.resolve(M1[d]):f.reject(new Error("Driver not found."));return _(b,S,y),b},l.prototype.getSerializer=function(d){var S=f.resolve($t);return _(S,d),S},l.prototype.ready=function(d){var S=this,y=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return _(y,d,d),y},l.prototype.setDriver=function(d,S,y){var b=this;Xn(d)||(d=[d]);var R=this._getSupportedDrivers(d);function H(){b._config.driver=b.driver()}function N(X){return b._extend(X),H(),b._ready=b._initStorage(b._config),b._ready}function V(X){return function(){var le=0;function ve(){for(;le<X.length;){var Ce=X[le];return le++,b._dbInfo=null,b._ready=null,b.getDriver(Ce).then(N).catch(ve)}H();var xe=new Error("No available storage method found.");return b._driverSet=f.reject(xe),b._driverSet}return ve()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=P.then(function(){var X=R[0];return b._dbInfo=null,b._ready=null,b.getDriver(X).then(function(le){b._driver=le._driver,H(),b._wrapLibraryMethodsWithReady(),b._initDriver=V(R)})}).catch(function(){H();var X=new Error("No available storage method found.");return b._driverSet=f.reject(X),b._driverSet}),_(this._driverSet,S,y),this._driverSet},l.prototype.supports=function(d){return!!Qn[d]},l.prototype._extend=function(d){Bt(this,d)},l.prototype._getSupportedDrivers=function(d){for(var S=[],y=0,b=d.length;y<b;y++){var R=d[y];this.supports(R)&&S.push(R)}return S},l.prototype._wrapLibraryMethodsWithReady=function(){for(var d=0,S=kt.length;d<S;d++)x9(this,kt[d])},l.prototype.createInstance=function(d){return new l(d)},l}(),O9=new I9;r.exports=O9},{3:3}]},{},[4])(4)})})($i);var j5=$i.exports;const h1=N6(j5);class An{getItem(t){return h1.getItem(t)}setItem(t,n){return h1.setItem(t,n)}removeItem(t){return h1.removeItem(t)}clear(){return h1.clear()}key(t){return h1.key(t)}keys(){return h1.keys()}iterate(t){return h1.iterate(t)}}var P5=Object.defineProperty,$5=Object.getOwnPropertyDescriptor,k5=(e,t,n,r)=>{for(var i=r>1?void 0:r?$5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&P5(t,n,i),i},B5=(e,t)=>(n,r)=>t(n,r,e);exports.DesktopZenZoneService=class{constructor(t){A(this,"visible$",new re.Subject);A(this,"componentKey$",new re.Subject);A(this,"_visible",!1);this._componentManager=t}get visible(){return this._visible}set(t,n){return this._componentManager.register(t,n),this.componentKey$.next(t),u.toDisposable(()=>{this._componentManager.delete(t),this.visible$.complete(),this.componentKey$.complete()})}open(){this._visible=!0,this.visible$.next(!0)}close(){this._visible=!1,this.visible$.next(!1)}};exports.DesktopZenZoneService=k5([B5(0,u.Inject(qe))],exports.DesktopZenZoneService);class jn extends u.Disposable{constructor(){super(...arguments);A(this,"_currentSelectorId");A(this,"_selectionChange$",new re.Subject);A(this,"selectionChange$",this._selectionChange$.asObservable());A(this,"_openSelector$",new re.Subject);A(this,"openSelector$",this._openSelector$.asObservable())}setCurrentSelectorId(n){this._currentSelectorId=n}getCurrentSelectorId(){return this._currentSelectorId}selectionChange(n){this._currentSelectorId&&this._selectionChange$.next(n)}openSelector(){this._openSelector$.next(null)}}const Vt=u.createIdentifier("univer.range-selector.service");class Pn extends u.Disposable{constructor(){super(...arguments);A(this,"_taskCount",0);A(this,"_progressChange$",new re.Subject);A(this,"_progressVisible$",new re.Subject);A(this,"progressChange$",this._progressChange$.asObservable());A(this,"progressVisible$",this._progressVisible$.asObservable())}dispose(){super.dispose(),this._clear(),this._progressChange$.complete(),this._progressVisible$.complete()}pushTask(n){if(this._taskCount===0)return;const{count:r}=n;if(r<=0)return;const i=Math.min(1,r/this._taskCount);this._progressChange$.next({step:i}),this._taskCount-=r,this._taskCount<0&&(this._taskCount=0),this._taskCount===0&&this._progressVisible$.next(!1)}insertTaskCount(n){n<=0||(this._taskCount===0&&this._progressVisible$.next(!0),this._taskCount+=n)}complete(){this._taskCount!==0&&(this._progressChange$.next({step:1}),this._clear(),this._progressVisible$.next(!1))}stop(){this._taskCount!==0&&(this._clear(),this._progressVisible$.next(!1))}getTaskCount(){return this._taskCount}_clear(){this._taskCount=0}}const At=u.createIdentifier("univer.progress.service");var ki=Object.defineProperty,U5=Object.getOwnPropertyDescriptor,F5=(e,t,n)=>t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z5=(e,t,n,r)=>{for(var i=r>1?void 0:r?U5(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ki(t,n,i),i},Hr=(e,t)=>(n,r)=>t(n,r,e),Z5=(e,t,n)=>F5(e,t+"",n);const Bi="UNIVER_UI_PLUGIN",Ui="DISABLE_AUTO_FOCUS";exports.UniverUIPlugin=class extends u.Plugin{constructor(t={},n,r){super(),this._config=t,this._contextService=n,this._injector=r,this._config=u.Tools.deepMerge({},this._config),this._config.disableAutoFocus&&this._contextService.setContextValue(Ui,!0)}onStarting(t){u.mergeOverrideWithDependencies([[qe],[T1],[Dt],[n1,{useClass:bn}],[o1,{useClass:exports.DesktopLayoutService}],[g1,{useClass:exports.ShortcutService}],[dt,{useClass:Cn}],[a1,{useClass:exports.MenuService}],[j1,{useClass:Ln}],[xn,{useClass:exports.BrowserClipboardService,lazy:!0}],[$1,{useClass:exports.DesktopNotificationService,lazy:!0}],[yt,{useClass:exports.DesktopDialogService,lazy:!0}],[_t,{useClass:exports.DesktopConfirmService,lazy:!0}],[P1,{useClass:Vn,lazy:!0}],[bt,{useClass:exports.DesktopZenZoneService,lazy:!0}],[St,{useClass:exports.DesktopGlobalZoneService,lazy:!0}],[w1,{useClass:In,lazy:!0}],[u.ILocalStorageService,{useClass:An,lazy:!0}],[Rn,{useClass:exports.DesktopBeforeCloseService}],[E1,{useClass:exports.EditorService}],[Vt,{useClass:jn}],[mt,{useClass:Sn}],[At,{useClass:Pn}],[Ct],[pt,{useFactory:r=>r.createInstance(exports.DesktopUIController,this._config),deps:[u.Injector]}],[exports.SharedController,{useFactory:()=>this._injector.createInstance(exports.SharedController,this._config)}],[exports.ErrorController],[exports.ShortcutPanelController,{useFactory:()=>this._injector.createInstance(exports.ShortcutPanelController,this._config)}]],this._config.override).forEach(r=>t.add(r))}};Z5(exports.UniverUIPlugin,"pluginName",Bi);exports.UniverUIPlugin=z5([u.DependentOn(v1.UniverRenderEnginePlugin),Hr(1,u.IContextService),Hr(2,u.Inject(u.Injector))],exports.UniverUIPlugin);const W5="univer-app-layout",G5="univer-app-header",Y5="univer-app-container",q5="univer-app-container-header",X5="univer-app-container-wrapper",Q5="univer-app-container-content",J5="univer-app-container-canvas",K5="univer-app-container-left-sidebar",el="univer-app-container-sidebar",t1={appLayout:W5,appHeader:G5,appContainer:Y5,appContainerHeader:q5,appContainerWrapper:X5,appContainerContent:Q5,appContainerCanvas:J5,appContainerLeftSidebar:K5,appContainerSidebar:el},tl="univer-mobile-menu-container",nl="univer-mobile-menu-item",nt={mobileMenuContainer:tl,mobileMenuItem:nl};function rl(e){const{menuType:t,onOptionSelect:n}=e,r=u.useDependency(a1);if(!t)return null;const i=u.makeArray(t).map(r.getMenuItems.bind(r)).flat();return g.jsx("div",{className:nt.mobileMenuContainer,style:{gridTemplateColumns:`repeat(${Math.min(2,i.length)}, 48px)`},children:i.map(o=>g.jsx(il,{menuItem:o,onClick:a=>n==null?void 0:n({value:"",label:o.id,...a})},o.id))})}function il(e){const{menuItem:t,onClick:n}=e,{id:r,type:i,title:o,label:a,icon:c}=t;if(i!==ke.BUTTON)throw new Error(`[MobileMenuItem]: on mobile devices only "BUTTON" type menu items are supported. Please check "${r}".`);const h=u.useObservable(t.disabled$,!1),v=u.useObservable(t.activated$,!1),p=u.useObservable(t.hidden$,!1),f=u.useObservable(t.value$),m=Ue.clsx(nt.mobileMenuItem,{[nt.mobileMenuItemActivated]:v,[nt.mobileMenuItemHidden]:p});return g.jsx("button",{type:"button",className:m,disabled:h,onClick:()=>n({id:r}),children:g.jsx(ze,{value:f,title:o,label:a,icon:c})},r)}function Fi(){const[e,t]=s.useState(!1),[n,r]=s.useState(""),[i,o]=s.useState([0,0]),a=s.useRef(e),c=u.useDependency(j1),h=u.useDependency(u.ICommandService);a.current=e,s.useEffect(()=>{const f=c.registerContextMenuHandler({handleContextMenu:v,hideContextMenu(){t(!1)},get visible(){return a.current}});return document.addEventListener("pointerdown",p),document.addEventListener("wheel",p),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("wheel",p),f.dispose()}},[c]);function v(f,m){r(m),o([f.clientX,f.clientY]),t(!0)}function p(){t(!1)}return g.jsx(ue.Popup,{visible:e,offset:i,children:g.jsx("section",{onPointerDown:f=>f.stopPropagation(),children:n&&g.jsx(rl,{menuType:[n],onOptionSelect:f=>{const{label:m,value:_}=f;h&&h.executeCommand(m,{value:_}),t(!1)}})})})}function ol(e){const{header:t=!0,footer:n=!0,contextMenu:r=!0,mountContainer:i,onRendered:o}=e,a=u.useDependency(u.LocaleService),c=u.useDependency(u.ThemeService),h=u.useDependency(w1),v=s.useRef(null),p=Fe(we.FOOTER),f=Fe(we.HEADER);Fe(we.HEADER_MENU);const m=Fe(we.CONTENT),_=Fe(we.LEFT_SIDEBAR),L=Fe(we.GLOBAL);s.useEffect(()=>{c.getCurrentTheme()||c.setTheme(ue.defaultTheme)},[]),s.useEffect(()=>{v.current&&(o==null||o(v.current))},[o]);const[x,w]=s.useState(a.getLocales()),j=s.useMemo(()=>document.createElement("div"),[]);return s.useEffect(()=>{document.body.appendChild(j),h.setContainer(j);const Z=[a.localeChanged$.subscribe(()=>{w(a.getLocales())}),c.currentTheme$.subscribe(U=>{ue.themeInstance.setTheme(i,U),j&&ue.themeInstance.setTheme(j,U)})];return()=>{Z.forEach(U=>U.unsubscribe()),document.body.removeChild(j)}},[a,h,i,j,c.currentTheme$]),g.jsxs(ue.ConfigProvider,{locale:x==null?void 0:x.design,mountContainer:j,children:[g.jsxs("div",{className:t1.appLayout,tabIndex:-1,onBlur:Z=>Z.stopPropagation(),children:[t&&g.jsx("header",{className:t1.appContainerHeader}),g.jsxs("section",{className:t1.appContainer,children:[g.jsxs("div",{className:t1.appContainerWrapper,children:[g.jsx("aside",{className:t1.appContainerLeftSidebar,children:g.jsx(Be,{components:_},"left-sidebar")}),g.jsxs("section",{className:t1.appContainerContent,children:[g.jsx("header",{className:t1.appHeader,children:t&&g.jsx(Be,{components:f},"header")}),g.jsx("section",{className:t1.appContainerCanvas,ref:v,"data-range-selector":!0,onContextMenu:Z=>Z.preventDefault(),children:g.jsx(Be,{components:m},"content")})]}),g.jsx("aside",{className:t1.appContainerSidebar,children:g.jsx(En,{})})]}),n&&g.jsx("footer",{className:t1.appFooter,children:g.jsx(Be,{components:p},"footer")}),g.jsx(wn,{})]})]}),g.jsx(Be,{components:L},"global"),g.jsx(Be,{components:Mn},"built-in-global"),r&&g.jsx(Fi,{})]})}var al=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,ll=(e,t,n,r)=>{for(var i=r>1?void 0:r?sl(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&al(t,n,i),i},S1=(e,t)=>(n,r)=>t(n,r,e);const cl=3e3;let dn=class extends u.Disposable{constructor(e,t,n,r,i,o,a){super(),this._config=e,this._instanceService=t,this._renderManagerService=n,this._injector=r,this._lifecycleService=i,this._uiPartsService=o,this._layoutService=a,this._initBuiltinComponents(),Promise.resolve().then(()=>this._bootstrapWorkbench())}_bootstrapWorkbench(){this.disposeWithMe(ul(this._injector,this._config,(e,t)=>{this._layoutService&&(this.disposeWithMe(this._layoutService.registerRootContainerElement(t)),this.disposeWithMe(this._layoutService.registerCanvasElement(e))),this._renderManagerService.currentRender$.subscribe(n=>{if(n){const r=this._renderManagerService.getRenderById(n);if(!r.unitId||this._instanceService.getUnitType(r.unitId)!==u.UniverInstanceType.UNIVER_SHEET)return;r.engine.setContainer(e)}}),setTimeout(()=>{var r;const n=(r=this._renderManagerService.getFirst())==null?void 0:r.engine;n==null||n.setContainer(e),this._lifecycleService.stage=u.LifecycleStages.Rendered,setTimeout(()=>this._lifecycleService.stage=u.LifecycleStages.Steady,cl)},300)}))}_initBuiltinComponents(){this.disposeWithMe(this._uiPartsService.registerComponent(we.CONTENT,()=>u.connectInjector(_n,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(we.CONTENT,()=>u.connectInjector(yn,this._injector)))}};dn=ll([S1(1,u.IUniverInstanceService),S1(2,v1.IRenderManagerService),S1(3,u.Inject(u.Injector)),S1(4,u.Inject(u.LifecycleService)),S1(5,n1),S1(6,u.Optional(o1))],dn);function ul(e,t,n){let r;const i=t.container;if(typeof i=="string"){const h=document.getElementById(i);h?r=h:r=Tr(i)}else i instanceof HTMLElement?r=i:r=Tr("univer");const o=u.connectInjector(ol,e),a=h=>n(h,r);function c(){K1(g.jsx(o,{...t,mountContainer:r,onRendered:a}),r)}return c(),u.toDisposable(()=>{ii(r)})}function Tr(e){const t=document.createElement("div");return t.id=e,t}var zi=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,dl=(e,t,n)=>t in e?zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hl=(e,t,n,r)=>{for(var i=r>1?void 0:r?fl(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&zi(t,n,i),i},pl=(e,t)=>(n,r)=>t(n,r,e),vl=(e,t,n)=>dl(e,t+"",n);const gl="UNIVER_MOBILE_UI_PLUGIN";exports.UniverMobileUIPlugin=class extends u.Plugin{constructor(t,n){super(),this._config=t,this._injector=n}onStarting(t){u.mergeOverrideWithDependencies([[qe],[T1],[Dt],[n1,{useClass:bn}],[o1,{useClass:exports.DesktopLayoutService}],[g1,{useClass:exports.ShortcutService}],[dt,{useClass:Cn}],[a1,{useClass:exports.MenuService}],[j1,{useClass:Ln}],[xn,{useClass:exports.BrowserClipboardService,lazy:!0}],[$1,{useClass:exports.DesktopNotificationService,lazy:!0}],[yt,{useClass:exports.DesktopDialogService,lazy:!0}],[_t,{useClass:exports.DesktopConfirmService,lazy:!0}],[P1,{useClass:Vn,lazy:!0}],[bt,{useClass:exports.DesktopZenZoneService,lazy:!0}],[St,{useClass:exports.DesktopGlobalZoneService,lazy:!0}],[w1,{useClass:In,lazy:!0}],[u.ILocalStorageService,{useClass:An,lazy:!0}],[Rn,{useClass:exports.DesktopBeforeCloseService}],[E1,{useClass:exports.EditorService}],[Vt,{useClass:jn}],[mt,{useClass:Sn}],[At,{useClass:Pn}],[Ct],[pt,{useFactory:r=>r.createInstance(dn,this._config),deps:[u.Injector]}],[exports.SharedController,{useFactory:()=>this._injector.createInstance(exports.SharedController,this._config)}],[exports.ErrorController]],this._config.override).forEach(r=>t.add(r))}};vl(exports.UniverMobileUIPlugin,"pluginName",gl);exports.UniverMobileUIPlugin=hl([u.DependentOn(v1.UniverRenderEnginePlugin),pl(1,u.Inject(u.Injector))],exports.UniverMobileUIPlugin);function rt(e){return e.length===0?e:e.replace(/^\s+|\s+$/gm,"")}function Zi(e){if(!e)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0")return!1;const n=e.getBoundingClientRect();return!(n.width===0||n.height===0||n.bottom<0||n.top>window.innerHeight||n.right<0||n.left>window.innerWidth)}const ml=.75,Dr=78,Nr=9,Wi="rgba(0,0,0,0)",Gi="rgb(0,0,0)";function $n(e){var c;let t=e.childNodes;if(t.length===0)return e.textContent;if(t[0].nodeName==="DIV"&&(t=t[0].childNodes),t.length===1&&t[0].nodeName==="#text")return t[0].textContent;const n=[];let r=0,i=0,o=e.textContent||"";o+=`\r
|
|
47
|
+
`;for(let h=0;h<t.length;h++){let v=t[`${h}`],p;v.nodeName==="#text"?(p=(c=v.textContent)!=null?c:"",v=v.parentElement):p=v.innerText;const f=jt(v);Yi(p).forEach(_=>{const L=_.length;i+=L,r=i-L;const x=u.Tools.generateRandomId(6);n.push({sId:x,st:r,ed:i-1,ts:f})})}return u.Tools.generateRandomId(6),{id:u.Tools.generateRandomId(6),body:{dataStream:o,textRuns:n},documentStyle:{}}}function jt(e,t=""){var a,c;let n=(c=(a=e==null?void 0:e.style)==null?void 0:a.cssText)!=null?c:"";if(n+=t,n=n.replace(/[\r\n]+/g,""),n.length===0)return{};const r=n.split(";"),i={},o={t:"",r:"",b:"",l:""};return r.forEach(h=>{var m;const v=h;h=h.toLowerCase();const p=rt(h.substr(0,h.indexOf(":"))),f=rt(h.substr(h.indexOf(":")+1));if(p==="font-weight")f==="bold"||f==="700"?i.bl=1:i.bl=0;else if(p==="font-style")f==="italic"?i.it=1:i.it=0;else if(p==="font-family"){const _=rt(v),L=Ml(_);i.ff=L}else if(p==="font-size"){let _=Number.parseInt(f);n.indexOf("vertical-align")>-1&&(n.indexOf("sub")>-1||n.indexOf("sup")>-1)&&(_*=2),f.indexOf("px")!==-1&&(_=wl(Number.parseInt(f,10))),i.fs=_}else if(p==="color"){const _=new u.ColorKit(f);i.cl={rgb:_.isValid?_.toRgbString():"rgb(0,0,0)"}}else if(p==="background"||p==="background-color"){const _=new u.ColorKit(f);if(_){const L=_.toRgbString();L!==Wi&&L!==Gi&&(i.bg={rgb:_.toRgbString()})}}else if(p==="text-decoration-line")f==="underline"?(i.ul||(i.ul={s:1}),i.ul.s=1):f==="line-through"?(i.st||(i.st={s:1}),i.st.s=1):f==="overline"&&(i.ol||(i.ol={s:1}),i.ol.s=1);else if(p==="text-decoration-color")i.hasOwnProperty("ul")&&(i.ul||(i.ul={s:1,cl:{rgb:f}}),i.ul.cl={rgb:f}),i.hasOwnProperty("st")&&(i.st||(i.st={s:1,cl:{rgb:f}}),i.st.cl={rgb:f}),i.hasOwnProperty("ol")&&(i.ol||(i.ol={s:1,cl:{rgb:f}}),i.ol.cl={rgb:f});else if(p==="text-decoration-style")i.hasOwnProperty("ul")&&(i.ul||(i.ul={s:1,t:Number(f)}),i.ul.t=Number(f)),i.hasOwnProperty("st")&&(i.st||(i.st={s:1,t:Number(f)}),i.st.t=Number(f)),i.hasOwnProperty("ol")&&(i.ol||(i.ol={s:1,t:Number(f)}),i.ol.t=Number(f));else if(p==="text-decoration"||p==="univer-strike"){const _=(m=f.split(" "))==null?void 0:m[0];_==="underline"?(i.ul||(i.ul={s:1}),i.ul.s=1):_==="line-through"?(i.st||(i.st={s:1}),i.st.s=1):_==="overline"&&(i.ol||(i.ol={s:1}),i.ol.s=1)}if(p==="univer-underline"&&(i.ul={s:1}),p==="vertical-align"&&(f==="sub"?i.va=u.BaselineOffset.SUBSCRIPT:f==="super"?i.va=u.BaselineOffset.SUPERSCRIPT:f==="top"?i.vt=1:f==="middle"?i.vt=2:f==="bottom"?i.vt=3:i.va=u.BaselineOffset.NORMAL),p==="transform"){const _=f.split(")"),L=_.findIndex(x=>x.includes("rotate"));if(L>-1){const x=_[L].match(/\d+/g);let w=0,j=0;x!=null&&x.length&&(w=+x[0]),e!=null&&e.dataset.vertical&&(j=+e.dataset.vertical),i.tr={a:w,v:j}}}if(p==="text-align"&&(f==="left"?i.ht=1:f==="center"?i.ht=2:f==="right"?i.ht=3:f==="justify"?i.ht=4:i.ht=0),i.tb!==1&&(p==="overflow-wrap"||p==="word-wrap"?f==="break-word"&&(i.tb=3):p==="text-overflow"?f==="clip"&&(i.tb=2):p==="text-break"&&f==="overflow"&&(i.tb=1)),p==="white-space"&&(f==="nowrap"?i.tb=1:f==="normal"?i.tb=3:f==="clip"&&(i.tb=2)),p==="border-color"){const _=Vr(f,")");if(i.bd)for(const L in _)i.bd[L].cl.rgb=_[L];else{i.bd={b:{cl:{rgb:"#000"},s:0},t:{cl:{rgb:"#000"},s:0},l:{cl:{rgb:"#000"},s:0},r:{cl:{rgb:"#000"},s:0}};for(const L in _)i.bd[L].cl.rgb=_[L]}}if(p==="border-width"||p==="border-style"){const _=Vr(f," ");for(const L in _)o[L]+=` ${_[L]}`;i.bd?(i.bd.b.s=u.getBorderStyleType(o.b),i.bd.t.s=u.getBorderStyleType(o.t),i.bd.l.s=u.getBorderStyleType(o.l),i.bd.r.s=u.getBorderStyleType(o.r)):i.bd={b:{cl:{rgb:"#000"},s:u.getBorderStyleType(o.b)},t:{cl:{rgb:"#000"},s:u.getBorderStyleType(o.t)},l:{cl:{rgb:"#000"},s:u.getBorderStyleType(o.l)},r:{cl:{rgb:"#000"},s:u.getBorderStyleType(o.r)}}}if(p==="border-bottom"||p==="border-top"||p==="border-left"||p==="border-right"||p==="border"){i.bd||(i.bd={});const _=f.split(" "),L=`${_[0]} ${_[1]}`;_.splice(0,2);const x=_.join("");if(u.getBorderStyleType(L)!==u.BorderStyleTypes.NONE&&x){const j={cl:{rgb:x},s:u.getBorderStyleType(L)};p==="border-bottom"?i.bd.b=f==="none"?null:j:p==="border-top"?i.bd.t=f==="none"?null:j:p==="border-left"?i.bd.l=f==="none"?null:j:p==="border-right"?i.bd.r=f==="none"?null:j:p==="border"&&(i.bd={r:f==="none"?null:j,t:f==="none"?null:j,b:f==="none"?null:j,l:f==="none"?null:j})}}else if(p==="--data-rotate"){const _=/[+-]?\d+/,L=f.match(_);f==="(0deg ,1)"?i.tr={a:0,v:1}:L&&(i.tr={a:Number(L[0])})}}),Object.keys(i).forEach(h=>{typeof i[h]=="object"&&!Object.keys(i[h]).length&&delete i[h]}),i}function Vr(e,t){let n;t===" "?n=e.trim().split(t):n=e.trim().split(t).slice(0,-1),n.forEach(i=>`${i.trim()})`);let r={};return n.length===1?r={t:n[0],r:n[0],b:n[0],l:n[0]}:n.length===2?r={t:n[0],r:n[1],b:n[0],l:n[1]}:n.length===3?r={t:n[0],r:n[1],b:n[2],l:n[1]}:n.length===4&&(r={t:n[0],r:n[1],b:n[2],l:n[3]}),r}function Yi(e){if(e==="")return[e];const t=/(?:(\n+.+)|(.+))/g;return e.match(t).map(i=>i.replace(/\n/g,`\r
|
|
48
|
+
`))}function Cl(e){const t=document.createElement("DIV"),n=[];t.innerHTML=e;const r=t.querySelectorAll("table col");if(!r.length)return[];for(let i=0;i<r.length;i++){const o=r[i],a=o.getAttribute("span");if(a&&+a>1)for(let c=0;c<+a;c++){const h=ut(o.getAttribute("width"),72);n.push(h)}else{const c=ut(o.getAttribute("width"),72);n.push(c)}}return n}function ut(e,t){if(!e)return t;let n;return e.includes("pt")?n=v1.ptToPx(Number.parseFloat(e)):e.includes("px")?n=Number.parseFloat(e):n=Number.parseFloat(e)*72/96,n}function bl(e){const t=document.createElement("DIV"),n=[];t.innerHTML=e;const r=t.querySelectorAll("table tr");if(!r.length)return[];for(let i=0;i<r.length;i++){const a=r[i].querySelectorAll("td");let c=ut(a[0].style.height,19);for(let h=0;h<a.length;h++){const v=a[h].getAttribute("rowSpan");if(!(v&&+v>1)){c=ut(a[h].style.height,19);break}}n.push(c)}return n}function Sl(e){let t=[];const n=document.createElement("DIV");if(n.innerHTML=e,t=new Array(n.querySelectorAll("table tr").length),!t.length)return[];let r=0;const i=n.querySelectorAll("table tr");i[0].querySelectorAll("td").forEach(c=>{let h=0;const v=c.getAttribute("colSpan");v!==null?h=+v:h=1,r+=h});for(let c=0;c<t.length;c++)t[c]=new Array(r);let a=0;return i.forEach(c=>{let h=0;c.querySelectorAll("td").forEach(v=>{var _,L;const p={};if(v.querySelectorAll("span").length||v.querySelectorAll("font").length){const x=$n(v);typeof x!="string"&&(p.p=x)}const f=v.innerText;f.trim().length===0?p.v="":p.v=f;const m=jt(v);for(u.Tools.isPlainObject(m)&&(p.s=m);h<r&&t[a][h]!=null;)h++;if(h!==r){if(t[a][h]==null){t[a][h]=p;const x=(_=Number(v.getAttribute("rowSpan")))!=null?_:1,w=(L=Number(v.getAttribute("colSpan")))!=null?L:1;if(x>1||w>1){const j={rs:+x-1,cs:+w-1,r:a,c:h};t[a][h].mc=j;for(let Z=0;Z<x;Z++)for(let U=0;U<w;U++)Z===0&&U===0||(t[a+Z][h+U]={mc:null})}}h++}}),a++}),t}function _l(e){const t=[],n=document.createElement("DIV");n.innerHTML=e;const i=e.replace(/\r/g,"").split(`
|
|
49
|
+
`),o=i[0].split(" ").length;for(let a=0;a<i.length;a++)i[a].split(" ").length<o||t.push(i[a].split(" "));for(let a=0;a<t.length;a++)for(let c=0;c<t[a].length;c++)t[a][c].length?t[a][c]={v:t[a][c]||"",m:t[a][c]||""}:t[a][c]=null;return t}function yl(e,t){e.length,e[0].length;let n=0,r=0;t&&(n=t.startRow,r=t.startColumn);const i=[];for(let o=0;o<e.length;o++)for(let a=0;a<e[o].length;a++)if(e[o][a]&&typeof e[o][a]=="object"&&"mc"in e[o][a])if(e[o][a].mc){const c=e[o][a].mc,h=c.r+n,v=h+c.rs,p=c.c+r,f=p+c.cs;i.push({startRow:h,endRow:v,startColumn:p,endColumn:f}),delete e[o][a].mc}else e[o][a]=null;return{data:e,mergeData:i}}function Ll(e){var v;let t=[];const n=document.createElement("html");n.innerHTML=e;const r=(v=n.querySelector("style"))==null?void 0:v.innerText;if(!r)return;const i=El(r);if(t=new Array(n.querySelectorAll("table tr").length),!t.length)return[];let o=0;const a=n.querySelectorAll("table tr");a[0].querySelectorAll("td").forEach(p=>{let f=0;const m=p.getAttribute("colSpan");m!==null?f=+m:f=1,o+=f});for(let p=0;p<t.length;p++)t[p]=new Array(o);let h=0;return a.forEach(p=>{let f=0;p.querySelectorAll("td").forEach(m=>{var j,Z;const _={};if(m.querySelectorAll("span").length||m.querySelectorAll("font").length){const U=$n(m);typeof U!="string"&&(_.p=U)}const L=m.innerText;L.trim().length===0?_.v="":_.v=L;let x="";for(const U in i)m.classList.contains(U)&&(x+=i[U]);const w=jt(m,x);for(u.Tools.isPlainObject(w)&&(_.s=w);f<o&&t[h][f]!=null;)f++;if(f!==o){if(t[h][f]==null){t[h][f]=_;const U=(j=Number(m.getAttribute("rowSpan")))!=null?j:1,J=(Z=Number(m.getAttribute("colSpan")))!=null?Z:1;if(U>1||J>1){const E={rs:+U-1,cs:+J-1,r:h,c:f};t[h][f].mc=E;for(let D=0;D<U;D++)for(let k=0;k<J;k++)D===0&&k===0||(t[h+D][f+k]={mc:null})}}f++}}),h++}),t}function El(e){const t={},n=e.replaceAll("<!--","").replaceAll("-->","").trim(),r=n==null?void 0:n.replaceAll(" ","").replaceAll(`
|
|
50
|
+
`,"").split("}");for(let i=0;i<r.length;i++){if(!r[i])continue;let o=r[i].split("{")[0].trim();o.includes(".")&&(o=o.slice(1));const a=r[i].split("{")[1].trim();t[o]=a}return t}function wl(e){const t=Math.round(e*ml);return t<Nr?Nr:t>Dr?Dr:t}function Ml(e){const t=/font-family:\s*(?:"([^"]+)"|'([^']+)'|([^;]+))/i,n=e.match(t);return n?(n[1]||n[2]||n[3]).trim():null}const Rl="univer-text-editor-container",xl="univer-text-editor-container-active",Il="univer-text-editor-container-error",Ol="univer-text-editor-container-disabled",Hl="univer-text-editor-container-placeholder",Tl="univer-text-editor-validation-error",_1={textEditorContainer:Rl,textEditorContainerActive:xl,textEditorContainerError:Il,textEditorContainerDisabled:Ol,textEditorContainerPlaceholder:Hl,textEditorValidationError:Tl},Dl=new Set(["snapshot","resizeCallBack","cancelDefaultResizeListener","isSheetEditor","canvasStyle","isSingle","isReadonly","onlyInputFormula","onlyInputRange","value","onlyInputContent","isSingleChoice","openForSheetUnitId","openForSheetSubUnitId","onChange","onActive","onValid","placeholder"]);function qi(e){const{id:t,snapshot:n,resizeCallBack:r,cancelDefaultResizeListener:i,isSheetEditor:o=!1,canvasStyle:a={},value:c,isSingle:h=!0,isReadonly:v=!1,onlyInputFormula:p=!1,onlyInputRange:f=!1,onlyInputContent:m=!1,isSingleChoice:_=!1,openForSheetUnitId:L,openForSheetSubUnitId:x,onChange:w,onActive:j,onValid:Z,isValueValid:U=!0,placeholder:J}=e,E=u.useDependency(E1),D=u.useDependency(u.LocaleService),[k,$]=s.useState(""),[F,z]=s.useState(""),[Y,ne]=s.useState(U),[ie,ce]=s.useState([0,0]),ae=s.useRef(null),[Q,oe]=s.useState(!1);if(!u.isInternalEditorID(t))throw new Error("Invalid editor ID");s.useEffect(()=>{const B=ae.current;if(!B)return;const G=new ResizeObserver(()=>{i!==!0&&E.resize(t),r&&r(B)});G.observe(B);const W=E.register({editorUnitId:t,initialSnapshot:n,cancelDefaultResizeListener:i,isSheetEditor:o,canvasStyle:a,isSingle:h,isReadonly:v,isSingleChoice:_,onlyInputFormula:p,onlyInputRange:f,onlyInputContent:m,openForSheetUnitId:L,openForSheetSubUnitId:x},B);E.setValueNoRefresh(c||"",t),$(J||"");const q=u.debounce(fe=>{oe(fe),j&&j(fe)},30),se=160,_e=u.debounce(fe=>{const Ve=fe.editorUnitId,$e=E.checkValueLegality(Ve);setTimeout(()=>{const Ie=fe.getBoundingClientRect();ce([Ie.left,Ie.top-16]),Ie.left+Ie.top>0&&ne($e),fe.onlyInputFormula()?z(D.t("textEditor.formulaError")):z(D.t("textEditor.rangeError"))},se),E.getValue(Ve)!==c&&(Z&&Z($e),w&&w(E.getValue(t)))},30),Me=E.focusStyle$.subscribe(fe=>{let Ve=!1;fe===t&&(Ve=!0),q(Ve),setTimeout(()=>{if(!Zi(B))ne(!0);else{const $e=E.getEditor(t);$e&&_e($e)}},se)}),Ee=E.valueChange$.subscribe(fe=>{fe.isSheetEditor()||fe.editorUnitId===t&&_e(fe)});return()=>{G.unobserve(B),G.disconnect(),W.dispose(),Me==null||Me.unsubscribe(),Ee==null||Ee.unsubscribe()}},[]),s.useEffect(()=>{const B=E.getEditor(t);B!=null&&B.update({isReadonly:v,isSingle:h,isSingleChoice:_,onlyInputContent:m,onlyInputFormula:p,onlyInputRange:f,openForSheetSubUnitId:x,openForSheetUnitId:L})},[v,h,_,m,p,f,x,L]),s.useEffect(()=>{c!=null&&E.setValueNoRefresh(c,t)},[c]),s.useEffect(()=>{ne(U)},[U]);function he(){const B=E.getValue(t);return!(B==null||B==="")}const T=Object.fromEntries(Object.entries(e).filter(([B])=>!Dl.has(B)));let M=_1.textEditorContainer;e.className!=null&&(M=e.className);let I="";return e.className==null&&(v?I=` ${_1.textEditorContainerDisabled}`:Y?Q&&(I=` ${_1.textEditorContainerActive}`):I=` ${_1.textEditorContainerError}`),g.jsx(g.Fragment,{children:g.jsxs("div",{...T,className:M+I,ref:ae,children:[g.jsx("div",{style:{display:Y?"none":"block"},className:_1.textEditorValidationError,children:F}),g.jsx("div",{style:{display:he()?"none":"unset"},className:_1.textEditorContainerPlaceholder,children:k})]})})}const Nl="univer-range-selector",Vl="univer-range-selector-editor",Al="univer-range-selector-icon",jl="univer-range-selector-active",Pl="univer-range-selector-error",$l="univer-range-selector-disabled",kl="univer-range-selector-modal",Bl="univer-range-selector-modal-container",Ul="univer-range-selector-modal-container-input",Fl="univer-range-selector-modal-container-input-active",zl="univer-range-selector-modal-container-button",Zl="univer-range-selector-modal-container-delete-button",Wl="univer-range-selector-modal-add",Gl="univer-range-selector-modal-add-button",De={rangeSelector:Nl,rangeSelectorEditor:Vl,rangeSelectorIcon:Al,rangeSelectorActive:jl,rangeSelectorError:Pl,rangeSelectorDisabled:$l,rangeSelectorModal:kl,rangeSelectorModalContainer:Bl,rangeSelectorModalContainerInput:Ul,rangeSelectorModalContainerInputActive:Fl,rangeSelectorModalContainerButton:zl,rangeSelectorModalContainerDeleteButton:Zl,rangeSelectorModalAdd:Wl,rangeSelectorModalAddButton:Gl};function Yl(e){const{onChange:t,id:n,value:r="",width:i=220,placeholder:o="",size:a="middle",onActive:c,onValid:h,isSingleChoice:v=!1,openForSheetUnitId:p,openForSheetSubUnitId:f,isReadonly:m=!1,className:_,textEditorClassName:L}=e,[x,w]=s.useState([""]),j=ee=>{w(de=>[...de,ee])},Z=ee=>{w(de=>de.filter((pe,Te)=>Te!==ee))},U=(ee,de)=>{w(pe=>pe.map((Te,me)=>me===ee?de:Te))},J=ee=>{w(de=>{const pe=[...de];return pe.length>0&&(pe[pe.length-1]=ee),pe})},E=u.useDependency(E1),D=u.useDependency(Vt),k=u.useDependency(u.IUniverInstanceService),[$,F]=s.useState(!1),z=u.useDependency(u.LocaleService),[Y,ne]=s.useState(!1),[ie,ce]=s.useState(!0),[ae,Q]=s.useState(r),[oe,he]=s.useState(-1),T=s.useRef(null),M=s.useRef(-1),I=s.useRef(p),B=s.useRef(f),G=s.useRef(v),W=s.useRef(m);s.useEffect(()=>{const ee=T.current;if(!ee)return;const de=new ResizeObserver(()=>{E.resize(n)});de.observe(ee);let pe=1;const Te=D.selectionChange$.subscribe(me=>{if(D.getCurrentSelectorId()!==n)return;if(me.length===0){pe=0;return}const ye=me.length-pe;if(pe=me.length,ye<0)return;const Se=me[me.length-1];let je="";Se.unitId===I.current&&Se.sheetId===B.current?je=i1.serializeRange(Se.range):Se.unitId===I.current?je=i1.serializeRangeWithSheet(Se.sheetName,Se.range):je=i1.serializeRangeWithSpreadsheet(Se.unitId,Se.sheetName,Se.range),ye>=1&&!G.current?(j(je),he(-1)):M.current===-1?J(je):U(M.current,je)});return()=>{Te.unsubscribe(),de.unobserve(ee)}},[]),s.useEffect(()=>{I.current=p,B.current=f,G.current=v,W.current=m},[p,f,v,m]),s.useEffect(()=>{M.current=oe},[oe]);function q(){F(!1),D.setCurrentSelectorId(null)}function se(){W.current!==!0&&(E.closeRangePrompt(),D.setCurrentSelectorId(n),F(!0),ae.length>0?w(ie?ae.split(","):[""]):D.openSelector())}function _e(ee){ne(ee),c&&c(ee)}function Me(ee){ce(ee),h&&h(ee)}function Ee(){if(W.current===!0){q();return}let ee="";const de=x.filter(pe=>i1.isReferenceStringWithEffectiveColumn(pe.trim()));if(de.length===1){const pe=de[0];i1.isReferenceStringWithEffectiveColumn(pe.trim())&&(ee=pe.trim())}else ee=de.join(",");E.setValue(ee,n),q()}function fe(){j(""),he(-1)}function Ve(ee){var de,pe;return((pe=(de=k.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET))==null?void 0:de.getSheetBySheetName(ee))==null?void 0:pe.getSheetId())||""}function $e(ee){if(Q(ee||""),ee==null){t&&t([]);return}const de=i1.getRangeWithRefsString(ee,Ve);t&&t(de||[])}let Ae=De.rangeSelector;m?Ae=`${De.rangeSelector} ${De.rangeSelectorDisabled}`:ie?Y&&(Ae=`${De.rangeSelector} ${De.rangeSelectorActive}`):Ae=`${De.rangeSelector} ${De.rangeSelectorError}`,L&&(Ae=`${Ae} ${L}`);let Ie=28;return a==="mini"?Ie=20:a==="small"?Ie=24:a==="large"&&(Ie=32),g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:Ae,ref:T,style:{width:i,height:Ie},children:[g.jsx(qi,{placeholder:o,value:r,isReadonly:m,isSingleChoice:v,openForSheetUnitId:p,openForSheetSubUnitId:f,onValid:Me,onActive:_e,onChange:$e,id:n,onlyInputRange:!0,canvasStyle:{fontSize:10},className:De.rangeSelectorEditor}),g.jsx(ue.Tooltip,{title:z.t("rangeSelector.buttonTooltip"),placement:"bottom",children:g.jsx("button",{className:De.rangeSelectorIcon,onClick:se,children:g.jsx(g6,{})})})]}),g.jsx(ue.Dialog,{width:"328px",visible:$,title:z.t("rangeSelector.title"),draggable:!0,closeIcon:g.jsx(D1,{}),footer:g.jsxs("footer",{children:[g.jsx(ue.Button,{onClick:q,children:z.t("rangeSelector.cancel")}),g.jsx(ue.Button,{style:{marginLeft:10},onClick:Ee,type:"primary",children:z.t("rangeSelector.confirm")})]}),onClose:q,children:g.jsxs("div",{className:Ue(De.rangeSelectorModal,_),children:[x.map((ee,de)=>g.jsxs("div",{className:De.rangeSelectorModalContainer,children:[g.jsx("div",{style:{width:x.length===1?"280px":"252px"},className:De.rangeSelectorModalContainerInput,children:g.jsx(ue.Input,{className:oe===de||x.length-1===de&&oe===-1?De.rangeSelectorModalContainerInputActive:"",placeholder:z.t("rangeSelector.placeHolder"),affixWrapperStyle:{width:"100%"},onClick:()=>he(de),value:ee,onChange:pe=>U(de,pe)},`input${de}`)}),g.jsx("div",{style:{display:x.length===1?"none":"inline-block"},className:De.rangeSelectorModalContainerButton,children:g.jsx(h3,{className:De.rangeSelectorModalContainerDeleteButton,onClick:()=>Z(de)})})]},de)),g.jsx("div",{style:{display:v?"none":"unset"},className:De.rangeSelectorModalAdd,children:g.jsxs(ue.Button,{type:"link",size:"small",onClick:fe,className:De.rangeSelectorModalAddButton,children:[g.jsx(O3,{}),g.jsx("span",{children:z.t("rangeSelector.addAnotherRange")})]})})]})})]})}const ql="univer-progress-bar",Xl="univer-progress-bar-container",Ql="univer-progress-bar-inner",Jl="univer-progress-bar-close-button",J1={progressBar:ql,progressBarContainer:Xl,progressBarInner:Ql,progressBarCloseButton:Jl};function Kl(e){const{barColor:t}=e,n=u.useDependency(At),r=s.useRef(null),[i,o]=s.useState(!1);s.useEffect(()=>{const c=n.progressVisible$.subscribe(v=>{v?o(v):setTimeout(()=>{o(v),r.current&&(r.current.style.width="0%")},500)}),h=n.progressChange$.subscribe(v=>{const{step:p}=v;if(r.current){const f=Number.parseFloat(r.current.style.width)||0,m=f+(100-f)*p;r.current.style.width=`${m}%`}});return()=>{c.unsubscribe(),h.unsubscribe()}},[]);function a(){n.stop()}return g.jsxs("div",{className:J1.progressBarContainer,style:{display:i?"flex":"none"},children:[g.jsx("div",{className:J1.progressBar,children:g.jsx("div",{ref:r,className:J1.progressBarInner,style:{backgroundColor:t}})}),g.jsx("div",{className:J1.progressBarCloseButton,onClick:a,children:g.jsx(D1,{})})]})}const e8="UNI_DISABLE_CHANGING_FOCUS";exports.BuiltInUIPart=we;exports.CanvasFloatDomService=Ct;exports.CanvasPopup=_n;exports.CanvasPopupService=Sn;exports.ComponentContainer=Be;exports.ComponentManager=qe;exports.ContextMenu=li;exports.ContextMenuService=Ln;exports.CopyCommand=vn;exports.CopyShortcutItem=z6;exports.CustomLabel=ze;exports.CutCommand=gn;exports.CutShortcutItem=Z6;exports.DEFAULT_BACKGROUND_COLOR_RGB=Gi;exports.DEFAULT_BACKGROUND_COLOR_RGBA=Wi;exports.DISABLE_AUTO_FOCUS_KEY=Ui;exports.DesktopLocalStorageService=An;exports.DesktopMessageService=In;exports.DesktopSidebarService=Vn;exports.FONT_FAMILY_LIST=as;exports.FONT_SIZE_LIST=us;exports.FloatDom=yn;exports.FontFamily=is;exports.FontFamilyItem=os;exports.FontSize=cs;exports.GlobalZone=pi;exports.HTML_CLIPBOARD_MIME_TYPE=nn;exports.IBeforeCloseService=Rn;exports.ICanvasPopupService=mt;exports.IClipboardInterfaceService=xn;exports.IConfirmService=_t;exports.IContextMenuService=j1;exports.IDialogService=yt;exports.IEditorService=E1;exports.IGlobalZoneService=St;exports.ILayoutService=o1;exports.IMenuService=a1;exports.IMessageService=w1;exports.INotificationService=$1;exports.IPlatformService=dt;exports.IProgressService=At;exports.IRangeSelectorService=Vt;exports.IShortcutService=g1;exports.ISidebarService=P1;exports.IUIController=pt;exports.IUIPartsService=n1;exports.IZenZoneService=bt;exports.KeyCode=u1;exports.Menu=st;exports.MenuGroup=c1;exports.MenuItemType=ke;exports.MenuPosition=Ye;exports.MetaKeys=Pe;exports.MobileContextMenu=Fi;exports.PLAIN_TEXT_CLIPBOARD_MIME_TYPE=tn;exports.PasteCommand=mn;exports.PlatformService=Cn;exports.ProgressBar=Kl;exports.ProgressService=Pn;exports.RangeSelector=Yl;exports.RangeSelectorService=jn;exports.RedoShortcutItem=G6;exports.SetEditorResizeOperation=F6;exports.ShortcutPanelService=Dt;exports.Sidebar=En;exports.TextEditor=qi;exports.ToggleShortcutPanelOperation=Nt;exports.Toolbar=hi;exports.UIPartsService=bn;exports.UI_CONFIG_KEY=Y6;exports.UNIVER_UI_PLUGIN_NAME=Bi;exports.UNI_DISABLE_CHANGING_FOCUS_KEY=e8;exports.UndoShortcutItem=W6;exports.VueComponentWrapper=T6;exports.ZIndexManager=T1;exports.ZenZone=wn;exports.builtInGlobalComponents=Mn;exports.getHeaderFooterMenuHiddenObservable=qa;exports.getMenuHiddenObservable=D6;exports.handelExcelToJson=Ll;exports.handelTableToJson=Sl;exports.handleDomToJson=$n;exports.handlePlainToJson=_l;exports.handleStringToStyle=jt;exports.handleTableColgroup=Cl;exports.handleTableMergeData=yl;exports.handleTableRowGroup=bl;exports.isElementVisible=Zi;exports.mergeMenuConfigs=U6;exports.splitSpanText=Yi;exports.t=ds;exports.textTrim=rt;exports.useComponentsOfPart=Fe;exports.useEvent=k6;exports.useObservable=Oe;exports.useScrollYOverContainer=B6;exports.useToolbarCollapseObserver=di;exports.useToolbarGroups=ui;exports.useToolbarItemStatus=fi;
|