@univerjs/sheets-hyper-link-ui 0.24.0 → 0.25.0
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 +34 -33
- package/lib/cjs/locale/ar-SA.js +36 -0
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +36 -0
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +36 -0
- package/lib/cjs/locale/it-IT.js +36 -0
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +36 -0
- package/lib/cjs/locale/pt-BR.js +36 -0
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +36 -0
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +35 -34
- package/lib/es/locale/ar-SA.js +35 -0
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +35 -0
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +35 -0
- package/lib/es/locale/it-IT.js +35 -0
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +35 -0
- package/lib/es/locale/pt-BR.js +35 -0
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +35 -0
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/index.js +35 -34
- package/lib/locale/ar-SA.js +35 -0
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +35 -0
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +35 -0
- package/lib/locale/it-IT.js +35 -0
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +35 -0
- package/lib/locale/pt-BR.js +35 -0
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +35 -0
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +1 -1
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +16 -16
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/sheets-hyper-link"),require("@univerjs/sheets-hyper-link-ui"),require("@univerjs/sheets/facade")):typeof define==`function`&&define.amd?define([`@univerjs/sheets-hyper-link`,`@univerjs/sheets-hyper-link-ui`,`@univerjs/sheets/facade`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsHyperLink,e.UniverSheetsHyperLinkUi,e.UniverSheetsFacade))})(this,function(e,t,n){var r=class extends n.FWorkbook{navigateToSheetHyperlink(n){let r=this._injector.get(e.SheetsHyperLinkParserService),i=this._injector.get(t.SheetsHyperLinkResolverService),a=r.parseHyperLink(n);i.navigate(a)}};n.FWorkbook.extend(r)});
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`@univerjs/sheets-ui`),require(`@univerjs/docs`),require(`@univerjs/docs-ui`),require(`@univerjs/engine-render`),require(`@univerjs/ui`),require(`rxjs`),require(`@univerjs/design`),require(`@univerjs/engine-formula`),require(`@univerjs/sheets-formula-ui`),require(`@univerjs/sheets-hyper-link`),require(`react`),require(`react/jsx-runtime`),require(`@univerjs/sheets-data-validation`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/sheets-ui`,`@univerjs/docs`,`@univerjs/docs-ui`,`@univerjs/engine-render`,`@univerjs/ui`,`rxjs`,`@univerjs/design`,`@univerjs/engine-formula`,`@univerjs/sheets-formula-ui`,`@univerjs/sheets-hyper-link`,`react`,`react/jsx-runtime`,`@univerjs/sheets-data-validation`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsHyperLinkUi={},e.UniverCore,e.UniverSheets,e.UniverSheetsUi,e.UniverDocs,e.UniverDocsUi,e.UniverEngineRender,e.UniverUi,e.rxjs,e.UniverDesign,e.UniverEngineFormula,e.UniverSheetsFormulaUi,e.UniverSheetsHyperLink,e.React,e.React,e.UniverSheetsDataValidation))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function g(e){return t.Tools.isLegalUrl(e)}function _(e){return/^[a-zA-Z]+:\/\//.test(e)}function v(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function y(e){if(g(e)){let t=_(e)?e:v(e)?`mailto://${e}`:`http://${e}`,n;try{n=new URL(t)}catch{return e}return n.hostname===location.hostname&&n.port===location.port&&n.protocol===location.protocol&&n.pathname===location.pathname&&n.hash&&!n.search?n.hash:t}return e}let b=`sheets-hyper-link-ui.config`;Symbol(b);let x={};function S(e,t){return function(n,r){t(n,r,e)}}function C(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function w(e,n){let r=n.getMergeData(),i=n.getMaxColumns()-1,a=n.getMaxRows()-1;if(i<e.endColumn&&(e.endColumn=i),a<e.endRow&&(e.endRow=a),e.rangeType===t.RANGE_TYPE.COLUMN||t.RANGE_TYPE.ROW)return e;let o=[];return r.forEach(n=>{t.Rectangle.intersects(e,n)&&o.push(n)}),t.Rectangle.realUnion(e,...o)}let T=class{constructor(e,t,n,r,i,a){this._univerInstanceService=e,this._commandService=t,this._definedNamesService=n,this._messageService=r,this._localeService=i,this._configService=a}navigate(e){switch(e.type){case f.SheetHyperLinkType.URL:this.navigateToOtherWebsite(e.url);break;default:this._navigateToUniver(e.searchObj)}}_navigateToUniver(e){let{gid:n,range:r,rangeid:i}=e,a=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!a)return;let o=a.getUnitId();if(i){let e=this._definedNamesService.getValueById(o,i);if(!e)return;let{formulaOrRefString:t}=e,n=this._definedNamesService.getWorksheetByRef(o,t);if(!n){this._messageService.show({content:this._localeService.t(`hyperLink.message.refError`),type:l.MessageType.Error});return}if(n.isSheetHidden()){this._messageService.show({content:this._localeService.t(`hyperLink.message.hiddenSheet`),type:l.MessageType.Error});return}this.navigateToDefineName(o,i)}if(n){if(r){let e=(0,u.deserializeRangeWithSheet)(r);(0,t.isValidRange)(e.range)&&r!==f.ERROR_RANGE&&this.navigateToRange(o,n,e.range);return}this.navigateToSheetById(o,n)}}async navigateToRange(e,t,i,a){let o=await this.navigateToSheetById(e,t);if(o){let s=w(i,o);await this._commandService.executeCommand(n.SetSelectionsOperation.id,{unitId:e,subUnitId:t,selections:[{range:s,primary:null}]}),await this._commandService.executeCommand(r.ScrollToRangeOperation.id,{range:s,forceTop:a})}}async navigateToSheetById(e,r){let i=this._univerInstanceService.getUnit(e,t.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;let a=i.getActiveSheet();if(!a)return!1;if(a.getSheetId()===r)return a;let o=i.getSheetBySheetId(r);return o?i.getHiddenWorksheets().indexOf(r)>-1?(this._messageService.show({content:this._localeService.t(`hyperLink.message.hiddenSheet`),type:l.MessageType.Error}),!1):await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:r})?o:!1:(this._messageService.show({content:this._localeService.t(`hyperLink.message.noSheet`),type:l.MessageType.Error}),!1)}async navigateToDefineName(e,t){return this._definedNamesService.focusRange(e,t),!0}async navigateToOtherWebsite(e){var t;let n=this._configService.getConfig(b);if(!(n==null||(t=n.urlHandler)==null)&&t.navigateToOtherWebsite)return n.urlHandler.navigateToOtherWebsite(e);window.open(e,`_blank`,`noopener noreferrer`)}};T=C([S(0,t.IUniverInstanceService),S(1,t.ICommandService),S(2,u.IDefinedNamesService),S(3,s.IMessageService),S(4,(0,t.Inject)(t.LocaleService)),S(5,t.IConfigService)],T);function E(e){"@babel/helpers - typeof";return E=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},E(e)}function D(e,t){if(E(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(E(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function O(e){var t=D(e,`string`);return E(t)==`symbol`?t:t+``}function k(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ee=class extends t.Disposable{constructor(...e){super(...e),k(this,`_customHyperLinks`,new Map)}isBuiltInLinkType(e){return e!==f.SheetHyperLinkType.URL}getOptions(){return Array.from(this._customHyperLinks.values()).map(({option:e})=>e)}findCustomHyperLink(e){return Array.from(this._customHyperLinks.values()).find(t=>t.match(e))}registerCustomHyperLink(e){this._customHyperLinks.set(e.type,e)}getCustomHyperLink(e){return this._customHyperLinks.get(e)}removeCustomHyperLink(e){let{_customHyperLinks:t}=this;t.delete(e)}dispose(){super.dispose(),this._customHyperLinks.clear()}};function te(e){return e.trim().length===0}function ne(e,n){let[r]=e.split(`,`).map(u.deserializeRangeWithSheet);return!r||!(0,t.isValidRange)(r.range)?``:(r.sheetName||(r.sheetName=n),(0,u.serializeRangeToRefString)(r))}let A=()=>{var e;let[c,h]=(0,p.useState)(``),[_,v]=(0,p.useState)(!1),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(!0),[w,E]=(0,p.useState)(f.SheetHyperLinkType.URL),[D,O]=(0,p.useState)(``),k=(0,s.useDependency)(t.LocaleService),A=(0,s.useDependency)(u.IDefinedNamesService),j=(0,s.useDependency)(r.IEditorBridgeService),M=(0,s.useDependency)(t.IUniverInstanceService),N=(0,s.useDependency)(H),P=(0,s.useObservable)(N.currentEditing$),re=(0,s.useDependency)(f.SheetsHyperLinkParserService),ie=(0,s.useDependency)(T),F=(0,s.useDependency)(t.ICommandService),I=(0,s.useDependency)(ee),ae=(0,p.useMemo)(()=>I.getOptions(),[I]),L=(0,s.useDependency)(s.IZenZoneService),R=(0,s.useDependency)(o.IRenderManagerService),oe=(0,s.useDependency)(r.IMarkSelectionService),se=(0,s.useDependency)(i.DocSelectionManagerService),z=(0,s.useDependency)(t.IContextService),ce=(0,s.useDependency)(t.ThemeService),le=(0,s.useDependency)(i.DocSelectionManagerService),[ue,de]=(0,p.useState)(!1),fe=(0,s.useDependency)(n.SheetsSelectionsService),B=(0,p.useMemo)(()=>fe.getCurrentSelections(),[]),V=(0,p.useMemo)(()=>{if(!I.isBuiltInLinkType(w))return I.getCustomHyperLink(w)},[I,w]),[U,pe]=(0,p.useState)(!1),[W,me]=(0,p.useState)(!1),G=(0,p.useRef)(!1),q=M.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET),J=(q==null?void 0:q.getActiveSheet().getSheetId())||``,Y=(0,p.useCallback)(e=>{x(e.replaceAll(t.DataStreamTreeTokenType.CUSTOM_RANGE_START,``).replaceAll(t.DataStreamTreeTokenType.CUSTOM_RANGE_END,``))},[x]);(0,p.useEffect)(()=>{if((P==null?void 0:P.row)!==void 0&&P.col!==void 0){let{customRange:y,row:b,col:x}=P,{label:S}=P;typeof S==`number`&&(S=`${S}`);let w;if(y){var e,n,r,i;w={id:(e=y==null?void 0:y.rangeId)==null?``:e,display:(n=S)==null?``:n,payload:(r=y==null||(i=y.properties)==null?void 0:i.url)==null?``:r,row:b,column:x}}else if(P.type===`viewing`){var a,o,s,c;let e=M.getUnit(P.unitId),n=e==null?void 0:e.getSheetBySheetId(P.subUnitId),r=n==null?void 0:n.getCellRaw(P.row,P.col),i=r==null||(a=r.p)==null||(a=a.body)==null||(a=a.customRanges)==null?void 0:a.find(e=>{var n;return e.rangeType===t.CustomRangeType.HYPERLINK&&((n=e.properties)==null?void 0:n.url)}),l=r==null?void 0:r.v;r&&(!t.BuildTextUtils.transform.isEmptyDocument((o=r.p)==null||(o=o.body)==null?void 0:o.dataStream)||t.Tools.isDefine(l))&&C(!1),w={id:``,display:``,payload:(s=i==null||(c=i.properties)==null?void 0:c.url)==null?``:s,row:b,column:x}}else{var l,d,p,m,g;let e=M.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC),n=se.getActiveTextRange(),r=e==null?void 0:e.getBody(),i=n&&r?n:null,a=i&&((l=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(i,(d=r==null?void 0:r.customRanges)==null?[]:d))==null?void 0:l[0]);C(!1),w={id:``,display:(p=S)==null?``:p,payload:(m=a==null||(g=a.properties)==null?void 0:g.url)==null?``:m,row:b,column:x}}h(w.id);let T=I.findCustomHyperLink(w);if(T){let e=T.convert(w);E(e.type),O(e.payload),Y(e.display);return}Y(w.display);let D=re.parseHyperLink(w.payload);switch(E(D.type===f.SheetHyperLinkType.INVALID?f.SheetHyperLinkType.RANGE:D.type),D.type){case f.SheetHyperLinkType.URL:O(D.url),D.url===w.display&&(G.current=!0);break;case f.SheetHyperLinkType.RANGE:{var _,v;let e=D.searchObj,t=(0,u.serializeRangeWithSheet)(e.gid?(_=(v=M.getUnit(P.unitId))==null||(v=v.getSheetBySheetId(e.gid))==null?void 0:v.getName())==null?``:_:``,(0,u.deserializeRangeWithSheet)(e.range).range);O(t),t===w.display&&(G.current=!0);break}case f.SheetHyperLinkType.SHEET:{let e=D.searchObj;O(e.gid);break}case f.SheetHyperLinkType.DEFINE_NAME:{let e=D.searchObj;O(e.rangeid);break}default:O(``);break}}},[P,ie,I,se,M]),(0,p.useEffect)(()=>{let e=null;if(P&&!P.customRangeId&&P.type===`viewing`&&t.Tools.isDefine(P.row)&&t.Tools.isDefine(P.col)){let n=M.getUnit(P.unitId,t.UniverInstanceType.UNIVER_SHEET),r=n==null?void 0:n.getSheetBySheetId(P.subUnitId),i=r==null?void 0:r.getMergedCell(P.row,P.col),a=new t.ColorKit(ce.getColorFromTheme(`primary.600`)).toRgb();e=oe.addShape({range:i==null?{startColumn:P.col,endColumn:P.col,startRow:P.row,endRow:P.row}:i,style:{fill:`rgb(${a.r}, ${a.g}, ${a.b}, 0.12)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1)}return()=>{e&&oe.removeShape(e)}},[P,oe,ce,M]),(0,p.useEffect)(()=>{me(w===f.SheetHyperLinkType.RANGE)},[w]),(0,p.useEffect)(()=>{let e=(P==null?void 0:P.type)===`zen_mode`?R.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY):R.getRenderById(j.getCurrentEditorId()),n=new t.DisposableCollection;if(e){let t=e.with(a.DocSelectionRenderService);t.setReserveRangesStatus(!0),n.add(()=>{t.setReserveRangesStatus(!1)})}return()=>{j.disableForceKeepVisible(),n.dispose()}},[P==null?void 0:P.type,j,R]),(0,p.useEffect)(()=>(W&&N.setIsKeepVisible(W),N.setIsKeepVisible(ue),()=>{N.setIsKeepVisible(!1)}),[W,ue,N]),(0,p.useEffect)(()=>()=>{L.temporaryHidden&&(L.show(),z.setContextValue(t.FOCUSING_SHEET,!1))},[z,L]),(0,p.useEffect)(()=>{if(W)return j.enableForceKeepVisible(),()=>{j.disableForceKeepVisible()}},[W,j]);let X=[{label:k.t(`hyperLink.form.link`),value:f.SheetHyperLinkType.URL},{label:k.t(`hyperLink.form.range`),value:f.SheetHyperLinkType.RANGE},{label:k.t(`hyperLink.form.worksheet`),value:f.SheetHyperLinkType.SHEET},{label:k.t(`hyperLink.form.definedName`),value:f.SheetHyperLinkType.DEFINE_NAME},...ae];if(!q)return;let he=q.getHiddenWorksheets(),ge=q.getSheets().map(e=>({label:e.getName(),value:e.getSheetId()})).filter(e=>he.indexOf(e.value)===-1),Z=Object.values((e=A.getDefinedNameMap(q.getUnitId()))==null?{}:e).map(e=>({label:e.name,value:e.id})),Q=(e,t)=>{if(e===f.SheetHyperLinkType.URL)return y(t);if(e===f.SheetHyperLinkType.RANGE){let e=(0,u.deserializeRangeWithSheet)(t),n=q.getSheetBySheetName(e.sheetName);if(n)return`#gid=${n.getSheetId()}&range=${(0,u.serializeRange)(e.range)}`}return`#${e}=${t}`},_e=(0,s.useEvent)(e=>{var t;let n=ne(e,((t=q.getActiveSheet())==null?void 0:t.getName())||``);if(!n){O(``);return}O(n),n&&(G.current||!b)&&(Y(n),G.current=!0)}),ve=async()=>{if(S&&te(b)||!D||w===f.SheetHyperLinkType.URL&&!g(D)){pe(!0);return}if(P)if(c){let e=P.type===`zen_mode`||P.type===`editing`?f.UpdateRichHyperLinkCommand.id:f.UpdateHyperLinkCommand.id;await F.executeCommand(e,{id:c,unitId:P.unitId,subUnitId:P.subUnitId,payload:{display:S?b:``,payload:Q(w,D)},row:P.row,column:P.col,documentId:P.type===`zen_mode`?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:j.getCurrentEditorId()})}else{let e=P.type===`zen_mode`||P.type===`editing`?f.AddRichHyperLinkCommand.id:f.AddHyperLinkCommand.id;await F.executeCommand(e,{unitId:P.unitId,subUnitId:P.subUnitId,link:{id:(0,t.generateRandomId)(),row:P.row,column:P.col,payload:Q(w,D),display:S?b:``},documentId:P.type===`zen_mode`?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:j.getCurrentEditorId()})}(P==null?void 0:P.type)===`viewing`&&(await F.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:P.unitId,subUnitId:P.subUnitId}),await F.executeCommand(r.ScrollToRangeOperation.id,{range:{startRow:Math.max(P.row-1,0),endRow:P.row+1,startColumn:Math.max(P.col-1,0),endColumn:P.col+1}})),F.executeCommand(K.id)};return P?(0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-white univer-p-4 univer-shadow-md dark:!univer-bg-gray-900`,l.borderClassName),children:[S?(0,m.jsx)(l.FormLayout,{label:k.t(`hyperLink.form.label`),error:U&&te(b)?k.t(`hyperLink.form.inputError`):``,children:(0,m.jsx)(l.Input,{value:b,onChange:e=>{Y(e),G.current=!1},placeholder:k.t(`hyperLink.form.labelPlaceholder`),autoFocus:!0,onKeyDown:e=>{e.keyCode===s.KeyCode.ENTER&&ve()}})}):null,(0,m.jsx)(l.FormLayout,{label:k.t(`hyperLink.form.type`),children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:X,value:w,onChange:e=>{E(e),O(``)}})}),w===f.SheetHyperLinkType.URL&&(0,m.jsx)(l.FormLayout,{error:U?D?g(D)?``:k.t(`hyperLink.form.linkError`):k.t(`hyperLink.form.inputError`):``,children:(0,m.jsx)(l.Input,{value:D,onChange:e=>{O(e),e&&(G.current||!b||b===e)&&(Y(e),G.current=!0)},placeholder:k.t(`hyperLink.form.linkPlaceholder`),autoFocus:!0,onKeyDown:e=>{e.keyCode===s.KeyCode.ENTER&&ve()}})}),w===f.SheetHyperLinkType.RANGE&&(0,m.jsx)(l.FormLayout,{error:U&&!D?k.t(`hyperLink.form.inputError`):``,children:(0,m.jsx)(d.RangeSelector,{unitId:q.getUnitId(),subUnitId:J,maxRangeCount:1,supportAcrossSheet:!0,initialValue:D,resetRange:B,onChange:(e,t)=>_e(t),onRangeSelectorDialogVisibleChange:async e=>{if(de(e),e)P.type===`zen_mode`&&(L.hide(),z.setContextValue(t.FOCUSING_SHEET,!0)),P.type!==`viewing`&&j.enableForceKeepVisible(),v(!0);else{if(await ie.navigateToRange(P.unitId,P.subUnitId,{startRow:P.row,endRow:P.row,startColumn:P.col,endColumn:P.col},!0),P.type===`zen_mode`){var r,i;await F.executeCommand(n.SetSelectionsOperation.id,{unitId:P.unitId,subUnitId:P.subUnitId,selections:[{range:{startRow:P.row,endRow:P.row,startColumn:P.col,endColumn:P.col}}]}),L.show(),z.setContextValue(t.FOCUSING_SHEET,!1);let e=(r=R.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:r.with(a.DocBackScrollRenderController),o=(i=le.getTextRanges({unitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))==null?void 0:i[0];e&&o&&(e.scrollToRange(o),le.refreshSelection({unitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))}j.disableForceKeepVisible(),v(!1)}},onFocusChange:e=>me(e)})}),w===f.SheetHyperLinkType.SHEET&&(0,m.jsx)(l.FormLayout,{error:U&&!D?k.t(`hyperLink.form.selectError`):``,children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:ge,value:D,onChange:e=>{var t,n;O(e);let r=(t=ge.find(t=>t.value===e))==null?void 0:t.label,i=(n=ge.find(e=>e.value===D))==null?void 0:n.label;r&&(G.current||!b||b===i)&&(Y(r),G.current=!0)}})}),w===f.SheetHyperLinkType.DEFINE_NAME&&(0,m.jsx)(l.FormLayout,{error:U&&!D?k.t(`hyperLink.form.selectError`):``,children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:Z,value:D,onChange:e=>{var t,n;O(e);let r=(t=Z.find(t=>t.value===e))==null?void 0:t.label,i=(n=Z.find(e=>e.value===D))==null?void 0:n.label;r&&(G.current||!b||b===i)&&(Y(r),G.current=!0)}})}),(V==null?void 0:V.Form)&&(0,m.jsx)(V.Form,{linkId:c,payload:D,display:b,showError:U,setByPayload:G,setDisplay:e=>{Y(e),G.current=!0},setPayload:O}),(0,m.jsxs)(`div`,{className:`univer-flex univer-flex-row univer-justify-end univer-gap-2`,children:[(0,m.jsx)(l.Button,{onClick:()=>{P&&ie.navigateToRange(P.unitId,P.subUnitId,{startRow:P.row,endRow:P.row,startColumn:P.col,endColumn:P.col},!0),F.executeCommand(K.id)},children:k.t(`hyperLink.form.cancel`)}),(0,m.jsx)(l.Button,{variant:`primary`,onClick:async()=>{ve()},children:k.t(`hyperLink.form.ok`)})]})]}):null};A.componentKey=`univer.sheet.cell-link-edit`;function j({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,p.useRef)(`_${re()}`);return M(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function M(e,t,n,r,i){return(0,p.createElement)(e.tag,{key:t,...N(e,n,i),...r},(P(e,n).children||[]).map((r,a)=>M(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function N(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function P(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function re(){return Math.random().toString(36).substring(2,8)}j.displayName=`UniverIcon`;let ie={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},F=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`all-border-icon`,ref:t,icon:ie}))});F.displayName=`AllBorderIcon`;let I={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ae=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`copy-icon`,ref:t,icon:I}))});ae.displayName=`CopyIcon`;let L={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z`}}]},R=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`link-icon`,ref:t,icon:L}))});R.displayName=`LinkIcon`;let oe={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z`}}]},se=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`unlink-icon`,ref:t,icon:oe}))});se.displayName=`UnlinkIcon`;let z={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},ce=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`write-icon`,ref:t,icon:z}))});ce.displayName=`WriteIcon`;let le={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#35BD4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#32A846`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ue=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`xlsx-multi-icon`,ref:t,icon:le}))});ue.displayName=`XlsxMultiIcon`;let de={[f.SheetHyperLinkType.URL]:(0,m.jsx)(R,{}),[f.SheetHyperLinkType.SHEET]:(0,m.jsx)(ue,{className:`univer-text-green-500`}),[f.SheetHyperLinkType.RANGE]:(0,m.jsx)(F,{}),[f.SheetHyperLinkType.DEFINE_NAME]:(0,m.jsx)(F,{}),[f.SheetHyperLinkType.INVALID]:(0,m.jsx)(F,{})},fe=e=>{var n,i;let a=(0,s.useDependency)(H),o=(0,s.useDependency)(t.ICommandService),c=(0,s.useDependency)(s.IMessageService),u=(0,s.useDependency)(t.LocaleService),d=(0,s.useDependency)(T),p=(0,s.useDependency)(r.IEditorBridgeService),h=(0,s.useDependency)(f.SheetsHyperLinkParserService),g=(0,s.useDependency)(s.IZenZoneService),{customRange:_,row:v,col:y,unitId:b,subUnitId:x,editPermission:S,copyPermission:C,type:w}=e;if(!(!(_==null||(n=_.properties)==null)&&n.url))return null;let E=h.parseHyperLink((i=_.properties.url)==null?``:i),D=E.type===f.SheetHyperLinkType.INVALID;return(0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900`,l.borderClassName),onClick:()=>a.hideCurrentPopup(),children:[(0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600`,{"univer-text-red-500":D}),onClick:()=>{g.visible||D||d.navigate(E)},children:[(0,m.jsx)(`div`,{className:`univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white`,children:de[E.type]}),(0,m.jsx)(l.Tooltip,{showIfEllipsis:!0,title:E.name,asChild:!0,children:(0,m.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:E.name})})]}),(0,m.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center`,children:[C&&(0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-text-red-500":D}),onClick:()=>{if(!D){if(E.type!==f.SheetHyperLinkType.URL){let e=new URL(window.location.href);e.hash=E.url.slice(1),navigator.clipboard.writeText(e.href)}else navigator.clipboard.writeText(E.url);c.show({content:u.t(`hyperLink.message.coped`),type:l.MessageType.Info})}},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`hyperLink.popup.copy`),children:(0,m.jsx)(ae,{className:`dark:!univer-text-white`})})}),S&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,onClick:()=>{o.executeCommand(G.id,{unitId:b,subUnitId:x,row:v,col:y,customRangeId:_.rangeId,type:w})},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`hyperLink.popup.edit`),children:(0,m.jsx)(ce,{className:`dark:!univer-text-white`})})}),(0,m.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,onClick:()=>{let e=w===`editing`||w===`zen_mode`?f.CancelRichHyperLinkCommand.id:f.CancelHyperLinkCommand.id;o.syncExecuteCommand(e,{unitId:b,subUnitId:x,id:_.rangeId,row:v,column:y,documentId:w===`zen_mode`?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:p.getCurrentEditorId()})&&a.hideCurrentPopup(void 0,!0)},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`hyperLink.popup.cancel`),children:(0,m.jsx)(se,{className:`dark:!univer-text-white`})})})]})]})]})},B=()=>{let e=(0,s.useDependency)(H),[n,r]=(0,p.useState)(null),i=(0,s.useDependency)(t.IUniverInstanceService);if((0,p.useEffect)(()=>{r(e.currentPopup);let t=e.currentPopup$.subscribe(e=>{r(e)});return()=>{t.unsubscribe()}},[e.currentPopup,e.currentPopup$]),!n)return null;if(n.showAll){var a;let e=i.getUnit(n.unitId,t.UniverInstanceType.UNIVER_SHEET),r=e==null?void 0:e.getSheetBySheetId(n.subUnitId),o=r==null?void 0:r.getCell(n.row,n.col),s=o==null||(a=o.p)==null||(a=a.body)==null?void 0:a.customRanges;return s!=null&&s.length?(0,m.jsx)(`div`,{children:s.map(e=>(0,m.jsx)(fe,{...n,customRange:e},e.rangeId))}):null}return(0,m.jsx)(fe,{...n})};B.componentKey=`univer.sheet.cell-link-popup`;let V=(e,t)=>{var n,r;return e.unitId===t.unitId&&e.subUnitId===t.subUnitId&&e.row===t.row&&e.col===t.col&&((n=e.customRange)==null?void 0:n.rangeId)===((r=t.customRange)==null?void 0:r.rangeId)&&e.type===t.type},H=class extends t.Disposable{get currentPopup(){return this._currentPopup}get currentEditing(){return this._currentEditing$.getValue()}constructor(e,t,n,r,i,a,o){super(),this._sheetCanvasPopManagerService=e,this._injector=t,this._univerInstanceService=n,this._editorBridgeService=r,this._textSelectionManagerService=i,this._docCanvasPopManagerService=a,this._zenZoneService=o,k(this,`_currentPopup`,null),k(this,`_currentPopup$`,new c.Subject),k(this,`currentPopup$`,this._currentPopup$.asObservable()),k(this,`_currentEditingPopup`,null),k(this,`_currentEditing$`,new c.BehaviorSubject(null)),k(this,`currentEditing$`,this._currentEditing$.asObservable()),k(this,`_isKeepVisible`,!1),this.disposeWithMe(()=>{this.hideCurrentPopup(),this.endEditing(),this._currentEditing$.complete(),this._currentPopup$.complete()})}setIsKeepVisible(e){this._isKeepVisible=e}getIsKeepVisible(){return this._isKeepVisible}showPopup(e){if(this._currentPopup&&V(e,this._currentPopup)||(this.hideCurrentPopup(void 0,!0),e.type!==`zen_mode`&&this._zenZoneService.visible))return;let n=this._currentEditing$.getValue();if(n&&V(e,n))return;let{unitId:r,subUnitId:i,row:a,col:o,customRangeRect:s,customRange:c}=e,l,u={componentKey:B.componentKey,direction:`bottom`,onClickOutside:()=>{this.hideCurrentPopup()},onClick:()=>{this.hideCurrentPopup(e.type,!0)}};if(e.type===`editing`){if(!c)return;l=s&&this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(s,u)}else if(e.type===`zen_mode`){if(!c)return;l=this._docCanvasPopManagerService.attachPopupToRange({startOffset:c.startIndex,endOffset:c.endIndex+1,collapsed:!1},u,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.showAll)l=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,u,r,i);else{if(!c)return;l=s&&this._sheetCanvasPopManagerService.attachPopupByPosition(s,u,e)}if(l){if(this._currentPopup){var d;(d=this._currentPopup.disposable)==null||d.dispose()}this._currentPopup={unitId:r,subUnitId:i,disposable:l,row:a,col:o,editPermission:!!e.editPermission,copyPermission:!!e.copyPermission,customRange:c,type:e.type,showAll:e.showAll},this._currentPopup$.next(this._currentPopup)}}hideCurrentPopup(e,t){if(this._currentPopup&&((!e||e===this._currentPopup.type)&&this._currentPopup.disposable.canDispose()||t)){var n;(n=this._currentPopup)==null||(n=n.disposable)==null||n.dispose(),this._currentPopup=null,this._currentPopup$.next(null)}}dispose(){super.dispose(),this.hideCurrentPopup(),this.endEditing(),this._currentPopup$.complete(),this._currentEditing$.complete()}_getEditingRange(){let e=this._editorBridgeService.isVisible().visible,n=this._editorBridgeService.getEditCellState();if(e&&n){var r,i,a;let e=this._textSelectionManagerService.getActiveTextRange(),o=(r=n.documentLayoutObject.documentModel)==null?void 0:r.getBody();if(!o)return null;if(!e||e.collapsed)return{startOffset:0,endOffset:o.dataStream.length-2,collapsed:o.dataStream.length-2==0,label:t.BuildTextUtils.transform.getPlainText(o.dataStream)};let s=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(e,(i=(a=o.customRanges)==null?void 0:a.filter(e=>e.rangeType===t.CustomRangeType.HYPERLINK))==null?[]:i),c=e.startOffset,l=e.endOffset;return s.forEach(e=>{c=Math.min(c,e.startIndex),l=Math.max(l,e.endIndex+1)}),{startOffset:c,endOffset:l,collapsed:c===l,label:t.BuildTextUtils.transform.getPlainText(o.dataStream.slice(c,l))}}return null}get _editPopup(){return{componentKey:A.componentKey,direction:`vertical`,onClickOutside:()=>{this.endEditing()},onContextMenu:()=>{this.endEditing()},hiddenType:`hide`}}startAddEditing(e){let{unitId:n,subUnitId:r,type:i}=e;if(i===`zen_mode`){var s;let n=this._univerInstanceService.getUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,t.UniverInstanceType.UNIVER_DOC);if(!n)return;let r=this._textSelectionManagerService.getActiveTextRange();if(!r)return;this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange(r,this._editPopup,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);let i=(s=n.getBody())==null?void 0:s.dataStream.slice(r.startOffset,r.endOffset);this._currentEditing$.next({...e,label:i})}else if(i===`editing`){var c;let i=this._getEditingRange();if(!i)return;this._textSelectionManagerService.replaceDocRanges([{...i}],{unitId:t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY});let s=this._injector.get(o.IRenderManagerService).getRenderById(t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(!s)return;let l=(0,a.calcDocRangePositions)(i,s);if(!(l!=null&&l.length))return;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(l.pop(),this._editPopup,n,r),this._currentEditing$.next({...e,label:(c=i==null?void 0:i.label)==null?``:c})}else{var l,u,d;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,n,r);let i=this._univerInstanceService.getUnit(n,t.UniverInstanceType.UNIVER_SHEET),a=i==null?void 0:i.getSheetBySheetId(r),o=a==null?void 0:a.getCellRaw(e.row,e.col);this._currentEditing$.next({...e,label:o!=null&&o.p?t.BuildTextUtils.transform.getPlainText((l=(u=o.p.body)==null?void 0:u.dataStream)==null?``:l):((d=o==null?void 0:o.v)==null?``:d).toString()})}}startEditing(e){var n;(n=this._currentEditingPopup)==null||n.dispose(),this.hideCurrentPopup(void 0,!0);let{unitId:i,subUnitId:a}=e,o,s;if(e.type===`zen_mode`){var c,l;let n=this._univerInstanceService.getUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,t.UniverInstanceType.UNIVER_DOC);if(o=n==null||(c=n.getBody())==null||(c=c.customRanges)==null?void 0:c.find(t=>t.rangeId===e.customRangeId),s=o?n==null||(l=n.getBody())==null?void 0:l.dataStream.slice(o.startIndex,o.endIndex+1):``,!o||!s)return;this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange({startOffset:o.startIndex,endOffset:o.endIndex,collapsed:!1},this._editPopup,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.type===`editing`){var u;let t=(0,r.getEditingCustomRangePosition)(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!t||!((u=t.rects)!=null&&u.length))return;o=t.customRange,s=t.label,this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(t.rects.pop(),this._editPopup,i,a)}else{var d;let n=this._univerInstanceService.getUnit(i,t.UniverInstanceType.UNIVER_SHEET),c=n==null?void 0:n.getSheetBySheetId(a),l=c==null?void 0:c.getCellRaw(e.row,e.col),u=n==null?void 0:n.getStyles().getStyleByCell(l),f=u==null?void 0:u.tr,p=(0,r.getCustomRangePosition)(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!p||!((d=p.rects)!=null&&d.length))return;o=p.customRange,s=p.label,f?this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,i,a):this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupByPosition(p.rects.pop(),this._editPopup,{unitId:i,subUnitId:a,row:e.row,col:e.col})}this._currentEditing$.next({...e,customRange:o,label:s})}endEditing(e){if(this.getIsKeepVisible())return;let t=this._currentEditing$.getValue();if(t&&(!e||e===t.type)){var n;(n=this._currentEditingPopup)==null||n.dispose(),this._currentEditing$.next(null)}}};H=C([S(0,(0,t.Inject)(r.SheetCanvasPopManagerService)),S(1,(0,t.Inject)(t.Injector)),S(2,t.IUniverInstanceService),S(3,r.IEditorBridgeService),S(4,(0,t.Inject)(i.DocSelectionManagerService)),S(5,(0,t.Inject)(a.DocCanvasPopManagerService)),S(6,s.IZenZoneService)],H);let U=new Set([t.DataValidationType.CHECKBOX,t.DataValidationType.LIST,t.DataValidationType.LIST_MULTIPLE]),pe=(e,t,n,r)=>{var i,a;let o=t.getCell(n,r);if(o!=null&&o.f||o!=null&&o.si||!(o==null||(i=o.p)==null||(i=i.body)==null||(i=i.customBlocks)==null)&&i.length)return 1;let s=e.has(h.SheetDataValidationModel)?e.get(h.SheetDataValidationModel):null,c=s==null?void 0:s.getRuleByLocation(t.getUnitId(),t.getSheetId(),n,r);return c&&U.has(c.type)?!0:!(o==null||(a=o.p)==null||(a=a.drawingsOrder)==null)&&a.length?2:0},W=e=>{let r=e.get(t.IUniverInstanceService).getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!r)return!0;let i=r.getActiveSheet(),a=e.get(n.SheetsSelectionsService).getCurrentSelections();if(!a.length)return!0;let o=a[0].range.startRow,s=a[0].range.startColumn;return pe(e,i,o,s)===1},me=e=>{let n=e.get(i.DocSelectionManagerService),r=e.get(t.IUniverInstanceService),a=n.getTextRanges();if(!(a!=null&&a.length))return!0;let o=r.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC);return!!(!o||a.every(e=>e.collapsed)||!o.getSelfOrHeaderFooterModel(a[0].segmentId).getBody())},G={type:t.CommandType.OPERATION,id:`sheet.operation.open-hyper-link-edit-panel`,handler(e,t){if(!t)return!1;let n=e.get(H);return t.customRangeId?n.startEditing(t):n.startAddEditing(t),!0}},K={type:t.CommandType.OPERATION,id:`sheet.operation.close-hyper-link-popup`,handler(e){return e.get(H).endEditing(),!0}},q={type:t.CommandType.OPERATION,id:`sheet.operation.insert-hyper-link`,handler(e){var i;let a=e.get(t.IUniverInstanceService),o=(0,n.getSheetCommandTarget)(a),s=e.get(r.IEditorBridgeService);if(!o)return!1;let c=e.get(t.ICommandService),l=e.get(n.SheetsSelectionsService).getCurrentLastSelection();if(!l)return!1;let u=l.range.startRow,d=l.range.startColumn,f=s.isVisible(),p=((i=a.getFocusedUnit())==null?void 0:i.getUnitId())===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY;return c.executeCommand(G.id,{unitId:o.unitId,subUnitId:o.subUnitId,row:u,col:d,type:p?`zen_mode`:f.visible?`editing`:`viewing`})}},J={type:t.CommandType.OPERATION,id:`sheet.operation.insert-hyper-link-toolbar`,handler(e){if(W(e))return!1;let n=e.get(t.ICommandService);return e.get(H).currentEditing?n.executeCommand(K.id):n.executeCommand(q.id)}},Y=`SHEET_HYPER_LINK_UI_PLUGIN`,X=class extends t.Disposable{registerPlainTextFilter(e){this._plainTextFilter.add(e)}removePlainTextFilter(e){this._plainTextFilter.delete(e)}_filterPlainText(e){return Array.from(this._plainTextFilter).every(t=>t(e))}constructor(e,t,n,r){super(),this._sheetClipboardService=e,this._hyperLinkModel=t,this._injector=n,this._resolverService=r,k(this,`_plainTextFilter`,new Set),k(this,`_copyInfo`,void 0),this._initCopyPaste(),this.disposeWithMe(()=>{this._plainTextFilter.clear()})}_initCopyPaste(){this._sheetClipboardService.addClipboardHook({id:Y,onBeforeCopy:(e,t,n)=>this._collect(e,t,n),onPasteCells:(e,t,n,i)=>{let{copyType:a=r.COPY_TYPE.COPY,pasteType:o}=i,{range:s}=e||{},{range:c,unitId:l,subUnitId:u}=t;return this._generateMutations(c,{copyType:a,pasteType:o,copyRange:s,unitId:l,subUnitId:u})},onPastePlainText:(e,n)=>{let i=this._filterPlainText(n);if(g(n)&&i){let{range:n,unitId:i,subUnitId:a}=e,{ranges:[o],mapFunc:s}=(0,r.virtualizeDiscreteRanges)([n]),c=[],l=[];return t.Range.foreach(o,(e,t)=>{let{row:n,col:r}=s(e,t),o=this._hyperLinkModel.getHyperLinkByLocation(i,a,n,r);o&&c.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:i,subUnitId:a,id:o.id}}),o&&l.push({id:f.AddHyperLinkMutation.id,params:{unitId:i,subUnitId:a,link:o}})}),{redos:c,undos:l}}return{undos:[],redos:[]}},priority:99})}_collect(e,r,i){let a=new t.ObjectMatrix;this._copyInfo={unitId:e,subUnitId:r,matrix:a};let o=this._injector.invoke(t=>(0,n.rangeToDiscreteRange)(i,t,e,r));if(!o)return;let{rows:s,cols:c}=o;s.forEach((t,n)=>{c.forEach((i,o)=>{var s;let c=this._hyperLinkModel.getHyperLinkByLocation(e,r,t,i);a.setValue(n,o,(s=c==null?void 0:c.id)==null?``:s)})})}_generateMutations(e,n){if(!this._copyInfo||!this._copyInfo||!this._copyInfo.matrix.getSizeOf()||!n.copyRange||[r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_COL_WIDTH,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMAT,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMULA].includes(n.pasteType))return{redos:[],undos:[]};let{unitId:i,subUnitId:a}=this._copyInfo,o=[],s=[],{ranges:[c,l],mapFunc:u}=(0,r.virtualizeDiscreteRanges)([n.copyRange,e]);return(0,r.getRepeatRange)(c,l,!0).forEach(({startRange:e})=>{var r;(r=this._copyInfo)==null||r.matrix.forValue((r,c,l)=>{let d=t.Rectangle.getPositionRange({startRow:r,endRow:r,startColumn:c,endColumn:c},e),p=this._hyperLinkModel.getHyperLink(i,a,l),{row:m,col:h}=u(d.startRow,d.startColumn),g=this._hyperLinkModel.getHyperLinkByLocation(n.unitId,n.subUnitId,m,h),_=(0,t.generateRandomId)();g&&o.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,id:g.id}}),p&&(o.push({id:f.AddHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,link:{...p,id:_,row:m,column:h}}}),s.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,id:_}})),g&&s.push({id:f.AddHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,link:g}})})}),{redos:o,undos:s}}};X=C([S(0,r.ISheetClipboardService),S(1,(0,t.Inject)(f.HyperLinkModel)),S(2,(0,t.Inject)(t.Injector)),S(3,(0,t.Inject)(T))],X);let he=(e,i=t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)=>{var s;let l=e.get(t.IUniverInstanceService),u=(s=e.get(o.IRenderManagerService).getRenderById(i))==null?void 0:s.with(a.DocSelectionRenderService);return u?u.textSelectionInner$.pipe((0,c.map)(()=>{let t=e.get(r.IEditorBridgeService).getEditCellState();if(!t)return!0;let i=(0,n.getSheetCommandTarget)(l,{unitId:t.unitId,subUnitId:t.sheetId});return!(i!=null&&i.worksheet)||pe(e,i.worksheet,t.row,t.column)===1?!0:me(e)})):(0,c.of)(!0)},ge=e=>{var i;let a=e.get(t.IUniverInstanceService),o=e.has(r.IEditorBridgeService)?e.get(r.IEditorBridgeService):null;return((i=o==null?void 0:o.currentEditCellState$.pipe((0,c.map)(t=>{if(!t)return 1;let r=(0,n.getSheetCommandTarget)(a,{unitId:t.unitId,subUnitId:t.sheetId});return r?pe(e,r.worksheet,t.row,t.column):1}),(0,c.switchMap)(n=>n===1?(0,c.of)(!0):(0,c.combineLatest)([o?o.visible$:(0,c.of)(null),a.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC)]).pipe((0,c.switchMap)(([r,i])=>r!=null&&r.visible?(i==null?void 0:i.getUnitId())===t.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY?(0,c.of)(!0):he(e,t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY):(0,c.of)(n!==0))))))==null?(0,c.of)(!0):i).pipe((0,c.switchMap)(t=>t?(0,c.of)(!0):(0,r.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetSetCellValuePermission,n.WorksheetInsertHyperlinkPermission],rangeTypes:[n.RangeProtectionPermissionEditPoint]},!0)))},Z={commandId:q.id,type:s.MenuItemType.BUTTON,title:`hyperLink.menu.add`,icon:`LinkIcon`},Q=e=>`${e}-zen-editor`,_e=e=>({...Z,id:Z.commandId,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:ge(e)}),ve=e=>({...Z,id:Q(Z.commandId),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:he(e)}),ye={tooltip:`hyperLink.form.addTitle`,commandId:J.id,type:s.MenuItemType.BUTTON,icon:`LinkIcon`},be=e=>({...ye,id:ye.commandId,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:ge(e)}),xe=e=>({...ye,id:Q(ye.commandId),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:he(e)}),Se={id:J.id,binding:s.KeyCode.K|s.MetaKeys.CTRL_COMMAND,preconditions:r.whenSheetEditorFocused};var Ce=`@univerjs/sheets-hyper-link-ui`,we=`0.24.0`;let Te=class extends t.Disposable{constructor(e,t){super(),this._autoFillService=e,this._hyperLinkModel=t,this._initAutoFill()}_initAutoFill(){let e=()=>({redos:[],undos:[]}),i=(e,i)=>{let{source:a,target:o,unitId:s,subUnitId:c}=e,l=(0,r.virtualizeDiscreteRanges)([a,o]),[u,d]=l.ranges,{mapFunc:p}=l,m={row:u.startRow,col:u.startColumn},h=n.AutoFillTools.getAutoFillRepeatRange(u,d),g=[],_=[];return h.forEach(e=>{let r=e.repeatStartCell,a=e.relativeRange,o={startRow:m.row,startColumn:m.col,endColumn:m.col,endRow:m.row},l={startRow:r.row,startColumn:r.col,endColumn:r.col,endRow:r.row};t.Range.foreach(a,(e,r)=>{let a=t.Rectangle.getPositionRange({startRow:e,startColumn:r,endColumn:r,endRow:e},o),{row:u,col:d}=p(a.startRow,a.startColumn),m=this._hyperLinkModel.getHyperLinkByLocation(s,c,u,d),h=t.Rectangle.getPositionRange({startRow:e,startColumn:r,endColumn:r,endRow:e},l),{row:v,col:y}=p(h.startRow,h.startColumn),b=(0,t.generateRandomId)(),x=this._hyperLinkModel.getHyperLinkByLocation(s,c,v,y);x&&g.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:s,subUnitId:c,id:x.id}}),(n.AUTO_FILL_APPLY_TYPE.COPY===i||n.AUTO_FILL_APPLY_TYPE.SERIES===i)&&m&&(g.push({id:f.AddHyperLinkMutation.id,params:{unitId:s,subUnitId:c,link:{...m,id:b,row:v,column:y}}}),_.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:s,subUnitId:c,id:b}})),x&&_.push({id:f.AddHyperLinkMutation.id,params:{unitId:s,subUnitId:c,link:x}})})}),{undos:_,redos:g}},a={id:Y,onFillData:(t,r,a)=>a===n.AUTO_FILL_APPLY_TYPE.COPY||a===n.AUTO_FILL_APPLY_TYPE.ONLY_FORMAT||a===n.AUTO_FILL_APPLY_TYPE.SERIES?i(t,a):e()};this.disposeWithMe(this._autoFillService.addHook(a))}};Te=C([S(0,n.IAutoFillService),S(1,(0,t.Inject)(f.HyperLinkModel))],Te);let Ee=class extends t.Disposable{constructor(e,t,n){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===Se.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookEditablePermission],rangeTypes:[n.RangeProtectionPermissionEditPoint],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetSetCellValuePermission,n.WorksheetInsertHyperlinkPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.hyperLinkErr`)))}))}};Ee=C([S(0,(0,t.Inject)(t.LocaleService)),S(1,t.ICommandService),S(2,(0,t.Inject)(n.SheetPermissionCheckController))],Ee);let De=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._hoverManagerService=e,this._sheetsHyperLinkPopupService=t,this._renderManagerService=n,this._permissionService=r,this._sheetPermissionCheckController=i,this._commandService=a,this._editorBridgeService=o,this._textSelectionManagerService=s,this._univerInstanceService=c,this._zenZoneService=l,this._initHoverListener(),this._initCommandListener(),this._initHoverEditingListener(),this._initTextSelectionListener(),this._initZenEditor()}_getLinkPermission(e){let{unitId:r,subUnitId:i,row:a,col:o}=e,s=this._univerInstanceService.getUnit(r,t.UniverInstanceType.UNIVER_SHEET),c=s==null?void 0:s.getSheetBySheetId(i);if(!c)return{viewPermission:!1,editPermission:!1,copyPermission:!1};let l=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookViewPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],r,i),u=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetInsertHyperlinkPermission],rangeTypes:[n.RangeProtectionPermissionEditPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],r,i),d=c.getCellRaw(a,o);d!=null&&d.f&&d.f.startsWith(`=HYPERLINK(`)&&(u=!1);let f=this._permissionService.composePermission([new n.WorkbookCopyPermission(r).id,new n.WorksheetCopyPermission(r,i).id]).every(e=>e.value);return{viewPermission:l,editPermission:u,copyPermission:f}}_initHoverListener(){this.disposeWithMe(this._hoverManagerService.currentRichText$.pipe((0,c.debounceTime)(200)).subscribe(e=>{var n,i,a;if(!e||((n=e.customRange)==null?void 0:n.rangeType)!==t.CustomRangeType.HYPERLINK){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let{unitId:o,subUnitId:s,row:c,col:l}=e,u=this._renderManagerService.getRenderById(o);if(!u)return;let d=this._univerInstanceService.getUnit(o,t.UniverInstanceType.UNIVER_SHEET),f=d==null?void 0:d.getSheetBySheetId(s);if(!f)return;if(!u.with(r.HoverRenderController).active){this._sheetsHyperLinkPopupService.hideCurrentPopup(`viewing`);return}let p=u==null||(i=u.with(r.SheetSkeletonManagerService).getSkeletonParam(s))==null?void 0:i.skeleton,m=l,h=c,g=h,_=m;p&&p.overflowCache.forValue((e,n,r)=>{t.Rectangle.contains(r,{startColumn:m,endColumn:m,startRow:h,endRow:h})&&(g=e,_=n)});let{viewPermission:v,editPermission:y,copyPermission:b}=this._getLinkPermission(e);if(!v){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let x=f.getCellStyleOnly(g,_),S=d.getStyles().getStyleByCell(x),C=S==null||(a=S.tr)==null?void 0:a.a;if(!C&&!e.customRange){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}this._sheetsHyperLinkPopupService.showPopup({row:g,col:_,editPermission:y,copyPermission:b,customRange:e.customRange,customRangeRect:e.rect,type:`viewing`,unitId:o,subUnitId:s,showAll:!!C})}))}_initHoverEditingListener(){let e=null;this.disposeWithMe(this._editorBridgeService.currentEditCellState$.pipe((0,c.switchMap)(e=>this._editorBridgeService.visible$.pipe((0,c.map)(t=>({visible:t,state:e}))))).subscribe(({visible:n,state:i})=>{if(!i||i.editorUnitId!==t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)return;if(!n.visible){e==null||e.unsubscribe(),this._sheetsHyperLinkPopupService.hideCurrentPopup(`editing`),this._sheetsHyperLinkPopupService.endEditing(`editing`);return}let{editorUnitId:o,unitId:s,sheetId:l,row:u,column:d}=i,f=this._renderManagerService.getRenderById(o);if(!f)return;let{editPermission:p,viewPermission:m,copyPermission:h}=this._getLinkPermission({unitId:s,subUnitId:l,row:u,col:d}),g=f.with(a.DocEventManagerService);m&&(e==null||e.unsubscribe(),e=g.hoverCustomRanges$.pipe((0,c.debounceTime)(200)).subscribe(e=>{var n;let i=e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK);if(!i){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let a=i.rects[i.rects.length-1];if(!(!((n=this._renderManagerService.getRenderById(s))==null||(n=n.with(r.SheetSkeletonManagerService).getSkeletonParam(l))==null)&&n.skeleton)||!a)return;let o=f.engine.getCanvasElement().getBoundingClientRect();this._sheetsHyperLinkPopupService.showPopup({unitId:s,subUnitId:l,row:u,col:d,customRange:i.range,customRangeRect:{left:a.left+o.left,top:a.top+o.top,bottom:a.bottom+o.top,right:a.right+o.left},editPermission:p,copyPermission:h,type:`editing`})}))})),this.disposeWithMe(()=>{e==null||e.unsubscribe()})}_initZenEditor(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e?(this._sheetsHyperLinkPopupService.hideCurrentPopup(`viewing`),this._sheetsHyperLinkPopupService.hideCurrentPopup(`editing`),this._sheetsHyperLinkPopupService.endEditing(`editing`),this._sheetsHyperLinkPopupService.hideCurrentPopup(`viewing`)):(this._sheetsHyperLinkPopupService.hideCurrentPopup(`zen_mode`),this._sheetsHyperLinkPopupService.endEditing(`zen_mode`))})),this.disposeWithMe(this._univerInstanceService.focused$.pipe((0,c.switchMap)(e=>{let n=e===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY?this._renderManagerService.getRenderById(e):null;return n?n.with(a.DocEventManagerService).hoverCustomRanges$.pipe((0,c.debounceTime)(200)):new c.Observable(e=>{e.next(null)})})).subscribe(e=>{let n=e==null?void 0:e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK),r=this._editorBridgeService.getEditCellState();if(n&&r){let{unitId:e,sheetId:t,row:i,column:a}=r,{editPermission:o,viewPermission:s,copyPermission:c}=this._getLinkPermission({unitId:e,subUnitId:t,row:i,col:a});s&&this._sheetsHyperLinkPopupService.showPopup({type:`zen_mode`,unitId:e,subUnitId:t,row:i,col:a,customRange:n.range,editPermission:o,copyPermission:c})}else this._sheetsHyperLinkPopupService.hideCurrentPopup(`zen_mode`)}))}_initTextSelectionListener(){this.disposeWithMe(this._textSelectionManagerService.textSelection$.subscribe(e=>{e&&e.unitId===t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&this._sheetsHyperLinkPopupService.endEditing(`editing`)}))}_initCommandListener(){let e=[n.ClearSelectionContentCommand.id,n.ClearSelectionAllCommand.id,n.ClearSelectionFormatCommand.id];this.disposeWithMe(this._commandService.onCommandExecuted(t=>{e.includes(t.id)&&this._sheetsHyperLinkPopupService.hideCurrentPopup()}))}};De=C([S(0,(0,t.Inject)(r.HoverManagerService)),S(1,(0,t.Inject)(H)),S(2,(0,t.Inject)(o.IRenderManagerService)),S(3,(0,t.Inject)(t.IPermissionService)),S(4,(0,t.Inject)(n.SheetPermissionCheckController)),S(5,t.ICommandService),S(6,r.IEditorBridgeService),S(7,(0,t.Inject)(i.DocSelectionManagerService)),S(8,t.IUniverInstanceService),S(9,s.IZenZoneService)],De);let Oe=class extends t.Disposable{constructor(e,t){super(),this._context=e,this._hyperLinkModel=t,this._initSkeletonChange()}_initSkeletonChange(){let e=()=>{var e;(e=this._context.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe((0,c.debounceTime)(16)).subscribe(()=>{e()}))}};Oe=C([S(1,(0,t.Inject)(f.HyperLinkModel))],Oe);let ke={[s.RibbonInsertGroup.MEDIA]:{[J.id]:{order:1,menuItemFactory:be},[Q(J.id)]:{order:1,menuItemFactory:xe}},[s.ContextMenuPosition.MAIN_AREA]:{[s.ContextMenuGroup.OTHERS]:{order:1,[J.id]:{order:0,menuItemFactory:_e},[Q(J.id)]:{order:0,menuItemFactory:ve}}}},Ae=class extends t.Disposable{constructor(e,t,n,r,i){super(),this._componentManager=e,this._commandService=t,this._menuManagerService=n,this._injector=r,this._shortcutService=i,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortCut()}_initComponents(){[[B.componentKey,B],[A.componentKey,A],[`LinkIcon`,R]].forEach(([e,t])=>{this._componentManager.register(e,t)})}_initCommands(){[G,K,q,J].forEach(e=>{this._commandService.registerCommand(e)})}_initMenus(){this._menuManagerService.mergeMenu(ke)}_initShortCut(){this._shortcutService.registerShortcut(Se)}};Ae=C([S(0,(0,t.Inject)(s.ComponentManager)),S(1,t.ICommandService),S(2,s.IMenuManagerService),S(3,(0,t.Inject)(t.Injector)),S(4,(0,t.Inject)(s.IShortcutService))],Ae);let je=class extends t.Disposable{constructor(e,t){super(),this._parserService=e,this._resolverService=t,this._handleInitUrl()}_handleInitUrl(){let e=location.hash;if(e){let t=this._parserService.parseHyperLink(e);this._resolverService.navigate(t)}}};je=C([S(0,(0,t.Inject)(f.SheetsHyperLinkParserService)),S(1,(0,t.Inject)(T))],je);let $=class extends t.Plugin{constructor(e=x,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},x,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(b,a)}onStarting(){[[T],[H],[ee],[De],[Ae],[Te],[X],[Ee],[je]].forEach(e=>this._injector.add(e))}onReady(){this._injector.get(o.IRenderManagerService).registerRenderModule(t.UniverInstanceType.UNIVER_SHEET,[Oe]),this._injector.get(Te),this._injector.get(X),this._injector.get(Ae)}onRendered(){this._injector.get(Ee),this._injector.get(je),this._injector.get(De)}};k($,`pluginName`,Y),k($,`packageName`,Ce),k($,`version`,we),k($,`type`,t.UniverInstanceType.UNIVER_SHEET),$=C([(0,t.DependentOn)(f.UniverSheetsHyperLinkPlugin,a.UniverDocsUIPlugin),S(1,(0,t.Inject)(t.Injector)),S(2,t.IConfigService)],$),e.CloseHyperLinkPopupOperation=K,e.InsertHyperLinkOperation=q,e.InsertLinkShortcut=Se,e.OpenHyperLinkEditPanelOperation=G,Object.defineProperty(e,`SheetsHyperLinkCopyPasteController`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,`SheetsHyperLinkPopupService`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,`SheetsHyperLinkResolverService`,{enumerable:!0,get:function(){return T}}),e.SheetsHyperLinkSidePanelService=ee,Object.defineProperty(e,`UniverSheetsHyperLinkUIPlugin`,{enumerable:!0,get:function(){return $}})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula-ui"),require("@univerjs/sheets-hyper-link"),require("react"),require("react/jsx-runtime"),require("@univerjs/sheets-data-validation")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/sheets-ui`,`@univerjs/docs`,`@univerjs/docs-ui`,`@univerjs/engine-render`,`@univerjs/ui`,`rxjs`,`@univerjs/design`,`@univerjs/engine-formula`,`@univerjs/sheets-formula-ui`,`@univerjs/sheets-hyper-link`,`react`,`react/jsx-runtime`,`@univerjs/sheets-data-validation`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsHyperLinkUi={},e.UniverCore,e.UniverSheets,e.UniverSheetsUi,e.UniverDocs,e.UniverDocsUi,e.UniverEngineRender,e.UniverUi,e.rxjs,e.UniverDesign,e.UniverEngineFormula,e.UniverSheetsFormulaUi,e.UniverSheetsHyperLink,e.React,e.React,e.UniverSheetsDataValidation))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function g(e){return t.Tools.isLegalUrl(e)}function _(e){return/^[a-zA-Z]+:\/\//.test(e)}function v(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function y(e){if(g(e)){let t=_(e)?e:v(e)?`mailto://${e}`:`http://${e}`,n;try{n=new URL(t)}catch{return e}return n.hostname===location.hostname&&n.port===location.port&&n.protocol===location.protocol&&n.pathname===location.pathname&&n.hash&&!n.search?n.hash:t}return e}let b=`sheets-hyper-link-ui.config`,x={};function S(e,t){return function(n,r){t(n,r,e)}}function C(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function w(e,n){let r=n.getMergeData(),i=n.getMaxColumns()-1,a=n.getMaxRows()-1;if(i<e.endColumn&&(e.endColumn=i),a<e.endRow&&(e.endRow=a),e.rangeType===t.RANGE_TYPE.COLUMN||t.RANGE_TYPE.ROW)return e;let o=[];return r.forEach(n=>{t.Rectangle.intersects(e,n)&&o.push(n)}),t.Rectangle.realUnion(e,...o)}let T=class{constructor(e,t,n,r,i,a){this._univerInstanceService=e,this._commandService=t,this._definedNamesService=n,this._messageService=r,this._localeService=i,this._configService=a}navigate(e){switch(e.type){case f.SheetHyperLinkType.URL:this.navigateToOtherWebsite(e.url);break;default:this._navigateToUniver(e.searchObj)}}_navigateToUniver(e){let{gid:n,range:r,rangeid:i}=e,a=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!a)return;let o=a.getUnitId();if(i){let e=this._definedNamesService.getValueById(o,i);if(!e)return;let{formulaOrRefString:t}=e,n=this._definedNamesService.getWorksheetByRef(o,t);if(!n){this._messageService.show({content:this._localeService.t(`sheets-hyper-link-ui.message.refError`),type:l.MessageType.Error});return}if(n.isSheetHidden()){this._messageService.show({content:this._localeService.t(`sheets-hyper-link-ui.message.hiddenSheet`),type:l.MessageType.Error});return}this.navigateToDefineName(o,i)}if(n){if(r){let e=(0,u.deserializeRangeWithSheet)(r);(0,t.isValidRange)(e.range)&&r!==f.ERROR_RANGE&&this.navigateToRange(o,n,e.range);return}this.navigateToSheetById(o,n)}}async navigateToRange(e,t,i,a){let o=await this.navigateToSheetById(e,t);if(o){let s=w(i,o);await this._commandService.executeCommand(n.SetSelectionsOperation.id,{unitId:e,subUnitId:t,selections:[{range:s,primary:null}]}),await this._commandService.executeCommand(r.ScrollToRangeOperation.id,{range:s,forceTop:a})}}async navigateToSheetById(e,r){let i=this._univerInstanceService.getUnit(e,t.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;let a=i.getActiveSheet();if(!a)return!1;if(a.getSheetId()===r)return a;let o=i.getSheetBySheetId(r);return o?i.getHiddenWorksheets().indexOf(r)>-1?(this._messageService.show({content:this._localeService.t(`sheets-hyper-link-ui.message.hiddenSheet`),type:l.MessageType.Error}),!1):await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:r})?o:!1:(this._messageService.show({content:this._localeService.t(`sheets-hyper-link-ui.message.noSheet`),type:l.MessageType.Error}),!1)}async navigateToDefineName(e,t){return this._definedNamesService.focusRange(e,t),!0}async navigateToOtherWebsite(e){var n;if(!(0,t.isSafeUrl)(e))return;let r=this._configService.getConfig(b);if(!(r==null||(n=r.urlHandler)==null)&&n.navigateToOtherWebsite)return r.urlHandler.navigateToOtherWebsite(e);window.open(e,`_blank`,`noopener noreferrer`)}};T=C([S(0,t.IUniverInstanceService),S(1,t.ICommandService),S(2,u.IDefinedNamesService),S(3,s.IMessageService),S(4,(0,t.Inject)(t.LocaleService)),S(5,t.IConfigService)],T);function E(e){"@babel/helpers - typeof";return E=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},E(e)}function D(e,t){if(E(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(E(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function O(e){var t=D(e,`string`);return E(t)==`symbol`?t:t+``}function k(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ee=class extends t.Disposable{constructor(...e){super(...e),k(this,`_customHyperLinks`,new Map)}isBuiltInLinkType(e){return e!==f.SheetHyperLinkType.URL}getOptions(){return Array.from(this._customHyperLinks.values()).map(({option:e})=>e)}findCustomHyperLink(e){return Array.from(this._customHyperLinks.values()).find(t=>t.match(e))}registerCustomHyperLink(e){this._customHyperLinks.set(e.type,e)}getCustomHyperLink(e){return this._customHyperLinks.get(e)}removeCustomHyperLink(e){let{_customHyperLinks:t}=this;t.delete(e)}dispose(){super.dispose(),this._customHyperLinks.clear()}};function te(e){return e.trim().length===0}function ne(e,n){let[r]=e.split(`,`).map(u.deserializeRangeWithSheet);return!r||!(0,t.isValidRange)(r.range)?``:(r.sheetName||(r.sheetName=n),(0,u.serializeRangeToRefString)(r))}let A=()=>{var e;let[c,h]=(0,p.useState)(``),[_,v]=(0,p.useState)(!1),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(!0),[w,E]=(0,p.useState)(f.SheetHyperLinkType.URL),[D,O]=(0,p.useState)(``),k=(0,s.useDependency)(t.LocaleService),A=(0,s.useDependency)(u.IDefinedNamesService),j=(0,s.useDependency)(r.IEditorBridgeService),M=(0,s.useDependency)(t.IUniverInstanceService),N=(0,s.useDependency)(H),P=(0,s.useObservable)(N.currentEditing$),re=(0,s.useDependency)(f.SheetsHyperLinkParserService),ie=(0,s.useDependency)(T),F=(0,s.useDependency)(t.ICommandService),I=(0,s.useDependency)(ee),ae=(0,p.useMemo)(()=>I.getOptions(),[I]),L=(0,s.useDependency)(s.IZenZoneService),R=(0,s.useDependency)(o.IRenderManagerService),oe=(0,s.useDependency)(r.IMarkSelectionService),se=(0,s.useDependency)(i.DocSelectionManagerService),z=(0,s.useDependency)(t.IContextService),ce=(0,s.useDependency)(t.ThemeService),le=(0,s.useDependency)(i.DocSelectionManagerService),[ue,de]=(0,p.useState)(!1),fe=(0,s.useDependency)(n.SheetsSelectionsService),B=(0,p.useMemo)(()=>fe.getCurrentSelections(),[]),V=(0,p.useMemo)(()=>{if(!I.isBuiltInLinkType(w))return I.getCustomHyperLink(w)},[I,w]),[U,pe]=(0,p.useState)(!1),[W,me]=(0,p.useState)(!1),G=(0,p.useRef)(!1),q=M.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET),J=(q==null?void 0:q.getActiveSheet().getSheetId())||``,Y=(0,p.useCallback)(e=>{x(e.replaceAll(t.DataStreamTreeTokenType.CUSTOM_RANGE_START,``).replaceAll(t.DataStreamTreeTokenType.CUSTOM_RANGE_END,``))},[x]);(0,p.useEffect)(()=>{if((P==null?void 0:P.row)!==void 0&&P.col!==void 0){let{customRange:y,row:b,col:x}=P,{label:S}=P;typeof S==`number`&&(S=`${S}`);let w;if(y){var e,n,r,i;w={id:(e=y==null?void 0:y.rangeId)==null?``:e,display:(n=S)==null?``:n,payload:(r=y==null||(i=y.properties)==null?void 0:i.url)==null?``:r,row:b,column:x}}else if(P.type===`viewing`){var a,o,s,c;let e=M.getUnit(P.unitId),n=e==null?void 0:e.getSheetBySheetId(P.subUnitId),r=n==null?void 0:n.getCellRaw(P.row,P.col),i=r==null||(a=r.p)==null||(a=a.body)==null||(a=a.customRanges)==null?void 0:a.find(e=>{var n;return e.rangeType===t.CustomRangeType.HYPERLINK&&((n=e.properties)==null?void 0:n.url)}),l=r==null?void 0:r.v;r&&(!t.BuildTextUtils.transform.isEmptyDocument((o=r.p)==null||(o=o.body)==null?void 0:o.dataStream)||t.Tools.isDefine(l))&&C(!1),w={id:``,display:``,payload:(s=i==null||(c=i.properties)==null?void 0:c.url)==null?``:s,row:b,column:x}}else{var l,d,p,m,g;let e=M.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC),n=se.getActiveTextRange(),r=e==null?void 0:e.getBody(),i=n&&r?n:null,a=i&&((l=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(i,(d=r==null?void 0:r.customRanges)==null?[]:d))==null?void 0:l[0]);C(!1),w={id:``,display:(p=S)==null?``:p,payload:(m=a==null||(g=a.properties)==null?void 0:g.url)==null?``:m,row:b,column:x}}h(w.id);let T=I.findCustomHyperLink(w);if(T){let e=T.convert(w);E(e.type),O(e.payload),Y(e.display);return}Y(w.display);let D=re.parseHyperLink(w.payload);switch(E(D.type===f.SheetHyperLinkType.INVALID?f.SheetHyperLinkType.RANGE:D.type),D.type){case f.SheetHyperLinkType.URL:O(D.url),D.url===w.display&&(G.current=!0);break;case f.SheetHyperLinkType.RANGE:{var _,v;let e=D.searchObj,t=(0,u.serializeRangeWithSheet)(e.gid?(_=(v=M.getUnit(P.unitId))==null||(v=v.getSheetBySheetId(e.gid))==null?void 0:v.getName())==null?``:_:``,(0,u.deserializeRangeWithSheet)(e.range).range);O(t),t===w.display&&(G.current=!0);break}case f.SheetHyperLinkType.SHEET:{let e=D.searchObj;O(e.gid);break}case f.SheetHyperLinkType.DEFINE_NAME:{let e=D.searchObj;O(e.rangeid);break}default:O(``);break}}},[P,ie,I,se,M]),(0,p.useEffect)(()=>{let e=null;if(P&&!P.customRangeId&&P.type===`viewing`&&t.Tools.isDefine(P.row)&&t.Tools.isDefine(P.col)){let n=M.getUnit(P.unitId,t.UniverInstanceType.UNIVER_SHEET),r=n==null?void 0:n.getSheetBySheetId(P.subUnitId),i=r==null?void 0:r.getMergedCell(P.row,P.col),a=new t.ColorKit(ce.getColorFromTheme(`primary.600`)).toRgb();e=oe.addShape({range:i==null?{startColumn:P.col,endColumn:P.col,startRow:P.row,endRow:P.row}:i,style:{fill:`rgb(${a.r}, ${a.g}, ${a.b}, 0.12)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1)}return()=>{e&&oe.removeShape(e)}},[P,oe,ce,M]),(0,p.useEffect)(()=>{me(w===f.SheetHyperLinkType.RANGE)},[w]),(0,p.useEffect)(()=>{let e=(P==null?void 0:P.type)===`zen_mode`?R.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY):R.getRenderById(j.getCurrentEditorId()),n=new t.DisposableCollection;if(e){let t=e.with(a.DocSelectionRenderService);t.setReserveRangesStatus(!0),n.add(()=>{t.setReserveRangesStatus(!1)})}return()=>{j.disableForceKeepVisible(),n.dispose()}},[P==null?void 0:P.type,j,R]),(0,p.useEffect)(()=>(W&&N.setIsKeepVisible(W),N.setIsKeepVisible(ue),()=>{N.setIsKeepVisible(!1)}),[W,ue,N]),(0,p.useEffect)(()=>()=>{L.temporaryHidden&&(L.show(),z.setContextValue(t.FOCUSING_SHEET,!1))},[z,L]),(0,p.useEffect)(()=>{if(W)return j.enableForceKeepVisible(),()=>{j.disableForceKeepVisible()}},[W,j]);let X=[{label:k.t(`sheets-hyper-link-ui.form.link`),value:f.SheetHyperLinkType.URL},{label:k.t(`sheets-hyper-link-ui.form.range`),value:f.SheetHyperLinkType.RANGE},{label:k.t(`sheets-hyper-link-ui.form.worksheet`),value:f.SheetHyperLinkType.SHEET},{label:k.t(`sheets-hyper-link-ui.form.definedName`),value:f.SheetHyperLinkType.DEFINE_NAME},...ae];if(!q)return;let he=q.getHiddenWorksheets(),ge=q.getSheets().map(e=>({label:e.getName(),value:e.getSheetId()})).filter(e=>he.indexOf(e.value)===-1),Z=Object.values((e=A.getDefinedNameMap(q.getUnitId()))==null?{}:e).map(e=>({label:e.name,value:e.id})),Q=(e,t)=>{if(e===f.SheetHyperLinkType.URL)return y(t);if(e===f.SheetHyperLinkType.RANGE){let e=(0,u.deserializeRangeWithSheet)(t),n=q.getSheetBySheetName(e.sheetName);if(n)return`#gid=${n.getSheetId()}&range=${(0,u.serializeRange)(e.range)}`}return`#${e}=${t}`},_e=(0,s.useEvent)(e=>{var t;let n=ne(e,((t=q.getActiveSheet())==null?void 0:t.getName())||``);if(!n){O(``);return}O(n),n&&(G.current||!b)&&(Y(n),G.current=!0)}),ve=async()=>{if(S&&te(b)||!D||w===f.SheetHyperLinkType.URL&&!g(D)){pe(!0);return}if(P)if(c){let e=P.type===`zen_mode`||P.type===`editing`?f.UpdateRichHyperLinkCommand.id:f.UpdateHyperLinkCommand.id;await F.executeCommand(e,{id:c,unitId:P.unitId,subUnitId:P.subUnitId,payload:{display:S?b:``,payload:Q(w,D)},row:P.row,column:P.col,documentId:P.type===`zen_mode`?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:j.getCurrentEditorId()})}else{let e=P.type===`zen_mode`||P.type===`editing`?f.AddRichHyperLinkCommand.id:f.AddHyperLinkCommand.id;await F.executeCommand(e,{unitId:P.unitId,subUnitId:P.subUnitId,link:{id:(0,t.generateRandomId)(),row:P.row,column:P.col,payload:Q(w,D),display:S?b:``},documentId:P.type===`zen_mode`?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:j.getCurrentEditorId()})}(P==null?void 0:P.type)===`viewing`&&(await F.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:P.unitId,subUnitId:P.subUnitId}),await F.executeCommand(r.ScrollToRangeOperation.id,{range:{startRow:Math.max(P.row-1,0),endRow:P.row+1,startColumn:Math.max(P.col-1,0),endColumn:P.col+1}})),F.executeCommand(K.id)};return P?(0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-white univer-p-4 univer-shadow-md dark:!univer-bg-gray-900`,l.borderClassName),children:[S?(0,m.jsx)(l.FormLayout,{label:k.t(`sheets-hyper-link-ui.form.label`),error:U&&te(b)?k.t(`sheets-hyper-link-ui.form.inputError`):``,children:(0,m.jsx)(l.Input,{value:b,onChange:e=>{Y(e),G.current=!1},placeholder:k.t(`sheets-hyper-link-ui.form.labelPlaceholder`),autoFocus:!0,onKeyDown:e=>{e.keyCode===s.KeyCode.ENTER&&ve()}})}):null,(0,m.jsx)(l.FormLayout,{label:k.t(`sheets-hyper-link-ui.form.type`),children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:X,value:w,onChange:e=>{E(e),O(``)}})}),w===f.SheetHyperLinkType.URL&&(0,m.jsx)(l.FormLayout,{error:U?D?g(D)?``:k.t(`sheets-hyper-link-ui.form.linkError`):k.t(`sheets-hyper-link-ui.form.inputError`):``,children:(0,m.jsx)(l.Input,{value:D,onChange:e=>{O(e),e&&(G.current||!b||b===e)&&(Y(e),G.current=!0)},placeholder:k.t(`sheets-hyper-link-ui.form.linkPlaceholder`),autoFocus:!0,onKeyDown:e=>{e.keyCode===s.KeyCode.ENTER&&ve()}})}),w===f.SheetHyperLinkType.RANGE&&(0,m.jsx)(l.FormLayout,{error:U&&!D?k.t(`sheets-hyper-link-ui.form.inputError`):``,children:(0,m.jsx)(d.RangeSelector,{unitId:q.getUnitId(),subUnitId:J,maxRangeCount:1,supportAcrossSheet:!0,initialValue:D,resetRange:B,onChange:(e,t)=>_e(t),onRangeSelectorDialogVisibleChange:async e=>{if(de(e),e)P.type===`zen_mode`&&(L.hide(),z.setContextValue(t.FOCUSING_SHEET,!0)),P.type!==`viewing`&&j.enableForceKeepVisible(),v(!0);else{if(await ie.navigateToRange(P.unitId,P.subUnitId,{startRow:P.row,endRow:P.row,startColumn:P.col,endColumn:P.col},!0),P.type===`zen_mode`){var r,i;await F.executeCommand(n.SetSelectionsOperation.id,{unitId:P.unitId,subUnitId:P.subUnitId,selections:[{range:{startRow:P.row,endRow:P.row,startColumn:P.col,endColumn:P.col}}]}),L.show(),z.setContextValue(t.FOCUSING_SHEET,!1);let e=(r=R.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:r.with(a.DocBackScrollRenderController),o=(i=le.getTextRanges({unitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))==null?void 0:i[0];e&&o&&(e.scrollToRange(o),le.refreshSelection({unitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))}j.disableForceKeepVisible(),v(!1)}},onFocusChange:e=>me(e)})}),w===f.SheetHyperLinkType.SHEET&&(0,m.jsx)(l.FormLayout,{error:U&&!D?k.t(`sheets-hyper-link-ui.form.selectError`):``,children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:ge,value:D,onChange:e=>{var t,n;O(e);let r=(t=ge.find(t=>t.value===e))==null?void 0:t.label,i=(n=ge.find(e=>e.value===D))==null?void 0:n.label;r&&(G.current||!b||b===i)&&(Y(r),G.current=!0)}})}),w===f.SheetHyperLinkType.DEFINE_NAME&&(0,m.jsx)(l.FormLayout,{error:U&&!D?k.t(`sheets-hyper-link-ui.form.selectError`):``,children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:Z,value:D,onChange:e=>{var t,n;O(e);let r=(t=Z.find(t=>t.value===e))==null?void 0:t.label,i=(n=Z.find(e=>e.value===D))==null?void 0:n.label;r&&(G.current||!b||b===i)&&(Y(r),G.current=!0)}})}),(V==null?void 0:V.Form)&&(0,m.jsx)(V.Form,{linkId:c,payload:D,display:b,showError:U,setByPayload:G,setDisplay:e=>{Y(e),G.current=!0},setPayload:O}),(0,m.jsxs)(`div`,{className:`univer-flex univer-flex-row univer-justify-end univer-gap-2`,children:[(0,m.jsx)(l.Button,{onClick:()=>{P&&ie.navigateToRange(P.unitId,P.subUnitId,{startRow:P.row,endRow:P.row,startColumn:P.col,endColumn:P.col},!0),F.executeCommand(K.id)},children:k.t(`sheets-hyper-link-ui.form.cancel`)}),(0,m.jsx)(l.Button,{variant:`primary`,onClick:async()=>{ve()},children:k.t(`sheets-hyper-link-ui.form.ok`)})]})]}):null};A.componentKey=`univer.sheet.cell-link-edit`;function j({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,p.useRef)(`_${re()}`);return M(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function M(e,t,n,r,i){return(0,p.createElement)(e.tag,{key:t,...N(e,n,i),...r},(P(e,n).children||[]).map((r,a)=>M(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function N(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function P(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function re(){return Math.random().toString(36).substring(2,8)}j.displayName=`UniverIcon`;let ie={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},F=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`all-border-icon`,ref:t,icon:ie}))});F.displayName=`AllBorderIcon`;let I={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ae=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`copy-icon`,ref:t,icon:I}))});ae.displayName=`CopyIcon`;let L={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z`}}]},R=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`link-icon`,ref:t,icon:L}))});R.displayName=`LinkIcon`;let oe={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z`}}]},se=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`unlink-icon`,ref:t,icon:oe}))});se.displayName=`UnlinkIcon`;let z={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},ce=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`write-icon`,ref:t,icon:z}))});ce.displayName=`WriteIcon`;let le={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#35BD4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#32A846`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ue=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(j,Object.assign({},e,{id:`xlsx-multi-icon`,ref:t,icon:le}))});ue.displayName=`XlsxMultiIcon`;let de={[f.SheetHyperLinkType.URL]:(0,m.jsx)(R,{}),[f.SheetHyperLinkType.SHEET]:(0,m.jsx)(ue,{className:`univer-text-green-500`}),[f.SheetHyperLinkType.RANGE]:(0,m.jsx)(F,{}),[f.SheetHyperLinkType.DEFINE_NAME]:(0,m.jsx)(F,{}),[f.SheetHyperLinkType.INVALID]:(0,m.jsx)(F,{})},fe=e=>{var n,i;let a=(0,s.useDependency)(H),o=(0,s.useDependency)(t.ICommandService),c=(0,s.useDependency)(s.IMessageService),u=(0,s.useDependency)(t.LocaleService),d=(0,s.useDependency)(T),p=(0,s.useDependency)(r.IEditorBridgeService),h=(0,s.useDependency)(f.SheetsHyperLinkParserService),g=(0,s.useDependency)(s.IZenZoneService),{customRange:_,row:v,col:y,unitId:b,subUnitId:x,editPermission:S,copyPermission:C,type:w}=e;if(!(!(_==null||(n=_.properties)==null)&&n.url))return null;let E=h.parseHyperLink((i=_.properties.url)==null?``:i),D=E.type===f.SheetHyperLinkType.INVALID;return(0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900`,l.borderClassName),onClick:()=>a.hideCurrentPopup(),children:[(0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600`,{"univer-text-red-500":D}),onClick:()=>{g.visible||D||d.navigate(E)},children:[(0,m.jsx)(`div`,{className:`univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white`,children:de[E.type]}),(0,m.jsx)(l.Tooltip,{showIfEllipsis:!0,title:E.name,asChild:!0,children:(0,m.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:E.name})})]}),(0,m.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center`,children:[C&&(0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-text-red-500":D}),onClick:()=>{if(!D){if(E.type!==f.SheetHyperLinkType.URL){let e=new URL(window.location.href);e.hash=E.url.slice(1),navigator.clipboard.writeText(e.href)}else navigator.clipboard.writeText(E.url);c.show({content:u.t(`sheets-hyper-link-ui.message.coped`),type:l.MessageType.Info})}},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`sheets-hyper-link-ui.popup.copy`),children:(0,m.jsx)(ae,{className:`dark:!univer-text-white`})})}),S&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,onClick:()=>{o.executeCommand(G.id,{unitId:b,subUnitId:x,row:v,col:y,customRangeId:_.rangeId,type:w})},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`sheets-hyper-link-ui.popup.edit`),children:(0,m.jsx)(ce,{className:`dark:!univer-text-white`})})}),(0,m.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,onClick:()=>{let e=w===`editing`||w===`zen_mode`?f.CancelRichHyperLinkCommand.id:f.CancelHyperLinkCommand.id;o.syncExecuteCommand(e,{unitId:b,subUnitId:x,id:_.rangeId,row:v,column:y,documentId:w===`zen_mode`?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:p.getCurrentEditorId()})&&a.hideCurrentPopup(void 0,!0)},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`sheets-hyper-link-ui.popup.cancel`),children:(0,m.jsx)(se,{className:`dark:!univer-text-white`})})})]})]})]})},B=()=>{let e=(0,s.useDependency)(H),[n,r]=(0,p.useState)(null),i=(0,s.useDependency)(t.IUniverInstanceService);if((0,p.useEffect)(()=>{r(e.currentPopup);let t=e.currentPopup$.subscribe(e=>{r(e)});return()=>{t.unsubscribe()}},[e.currentPopup,e.currentPopup$]),!n)return null;if(n.showAll){var a;let e=i.getUnit(n.unitId,t.UniverInstanceType.UNIVER_SHEET),r=e==null?void 0:e.getSheetBySheetId(n.subUnitId),o=r==null?void 0:r.getCell(n.row,n.col),s=o==null||(a=o.p)==null||(a=a.body)==null?void 0:a.customRanges;return s!=null&&s.length?(0,m.jsx)(`div`,{children:s.map(e=>(0,m.jsx)(fe,{...n,customRange:e},e.rangeId))}):null}return(0,m.jsx)(fe,{...n})};B.componentKey=`univer.sheet.cell-link-popup`;let V=(e,t)=>{var n,r;return e.unitId===t.unitId&&e.subUnitId===t.subUnitId&&e.row===t.row&&e.col===t.col&&((n=e.customRange)==null?void 0:n.rangeId)===((r=t.customRange)==null?void 0:r.rangeId)&&e.type===t.type},H=class extends t.Disposable{get currentPopup(){return this._currentPopup}get currentEditing(){return this._currentEditing$.getValue()}constructor(e,t,n,r,i,a,o){super(),this._sheetCanvasPopManagerService=e,this._injector=t,this._univerInstanceService=n,this._editorBridgeService=r,this._textSelectionManagerService=i,this._docCanvasPopManagerService=a,this._zenZoneService=o,k(this,`_currentPopup`,null),k(this,`_currentPopup$`,new c.Subject),k(this,`currentPopup$`,this._currentPopup$.asObservable()),k(this,`_currentEditingPopup`,null),k(this,`_currentEditing$`,new c.BehaviorSubject(null)),k(this,`currentEditing$`,this._currentEditing$.asObservable()),k(this,`_isKeepVisible`,!1),this.disposeWithMe(()=>{this.hideCurrentPopup(),this.endEditing(),this._currentEditing$.complete(),this._currentPopup$.complete()})}setIsKeepVisible(e){this._isKeepVisible=e}getIsKeepVisible(){return this._isKeepVisible}showPopup(e){if(this._currentPopup&&V(e,this._currentPopup)||(this.hideCurrentPopup(void 0,!0),e.type!==`zen_mode`&&this._zenZoneService.visible))return;let n=this._currentEditing$.getValue();if(n&&V(e,n))return;let{unitId:r,subUnitId:i,row:a,col:o,customRangeRect:s,customRange:c}=e,l,u={componentKey:B.componentKey,direction:`bottom`,onClickOutside:()=>{this.hideCurrentPopup()},onClick:()=>{this.hideCurrentPopup(e.type,!0)}};if(e.type===`editing`){if(!c)return;l=s&&this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(s,u)}else if(e.type===`zen_mode`){if(!c)return;l=this._docCanvasPopManagerService.attachPopupToRange({startOffset:c.startIndex,endOffset:c.endIndex+1,collapsed:!1},u,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.showAll)l=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,u,r,i);else{if(!c)return;l=s&&this._sheetCanvasPopManagerService.attachPopupByPosition(s,u,e)}if(l){if(this._currentPopup){var d;(d=this._currentPopup.disposable)==null||d.dispose()}this._currentPopup={unitId:r,subUnitId:i,disposable:l,row:a,col:o,editPermission:!!e.editPermission,copyPermission:!!e.copyPermission,customRange:c,type:e.type,showAll:e.showAll},this._currentPopup$.next(this._currentPopup)}}hideCurrentPopup(e,t){if(this._currentPopup&&((!e||e===this._currentPopup.type)&&this._currentPopup.disposable.canDispose()||t)){var n;(n=this._currentPopup)==null||(n=n.disposable)==null||n.dispose(),this._currentPopup=null,this._currentPopup$.next(null)}}dispose(){super.dispose(),this.hideCurrentPopup(),this.endEditing(),this._currentPopup$.complete(),this._currentEditing$.complete()}_getEditingRange(){let e=this._editorBridgeService.isVisible().visible,n=this._editorBridgeService.getEditCellState();if(e&&n){var r,i,a;let e=this._textSelectionManagerService.getActiveTextRange(),o=(r=n.documentLayoutObject.documentModel)==null?void 0:r.getBody();if(!o)return null;if(!e||e.collapsed)return{startOffset:0,endOffset:o.dataStream.length-2,collapsed:o.dataStream.length-2==0,label:t.BuildTextUtils.transform.getPlainText(o.dataStream)};let s=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(e,(i=(a=o.customRanges)==null?void 0:a.filter(e=>e.rangeType===t.CustomRangeType.HYPERLINK))==null?[]:i),c=e.startOffset,l=e.endOffset;return s.forEach(e=>{c=Math.min(c,e.startIndex),l=Math.max(l,e.endIndex+1)}),{startOffset:c,endOffset:l,collapsed:c===l,label:t.BuildTextUtils.transform.getPlainText(o.dataStream.slice(c,l))}}return null}get _editPopup(){return{componentKey:A.componentKey,direction:`vertical`,onClickOutside:()=>{this.endEditing()},onContextMenu:()=>{this.endEditing()},hiddenType:`hide`}}startAddEditing(e){let{unitId:n,subUnitId:r,type:i}=e;if(i===`zen_mode`){var s;let n=this._univerInstanceService.getUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,t.UniverInstanceType.UNIVER_DOC);if(!n)return;let r=this._textSelectionManagerService.getActiveTextRange();if(!r)return;this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange(r,this._editPopup,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);let i=(s=n.getBody())==null?void 0:s.dataStream.slice(r.startOffset,r.endOffset);this._currentEditing$.next({...e,label:i})}else if(i===`editing`){var c;let i=this._getEditingRange();if(!i)return;this._textSelectionManagerService.replaceDocRanges([{...i}],{unitId:t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY});let s=this._injector.get(o.IRenderManagerService).getRenderById(t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(!s)return;let l=(0,a.calcDocRangePositions)(i,s);if(!(l!=null&&l.length))return;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(l.pop(),this._editPopup,n,r),this._currentEditing$.next({...e,label:(c=i==null?void 0:i.label)==null?``:c})}else{var l,u,d;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,n,r);let i=this._univerInstanceService.getUnit(n,t.UniverInstanceType.UNIVER_SHEET),a=i==null?void 0:i.getSheetBySheetId(r),o=a==null?void 0:a.getCellRaw(e.row,e.col);this._currentEditing$.next({...e,label:o!=null&&o.p?t.BuildTextUtils.transform.getPlainText((l=(u=o.p.body)==null?void 0:u.dataStream)==null?``:l):((d=o==null?void 0:o.v)==null?``:d).toString()})}}startEditing(e){var n;(n=this._currentEditingPopup)==null||n.dispose(),this.hideCurrentPopup(void 0,!0);let{unitId:i,subUnitId:a}=e,o,s;if(e.type===`zen_mode`){var c,l;let n=this._univerInstanceService.getUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,t.UniverInstanceType.UNIVER_DOC);if(o=n==null||(c=n.getBody())==null||(c=c.customRanges)==null?void 0:c.find(t=>t.rangeId===e.customRangeId),s=o?n==null||(l=n.getBody())==null?void 0:l.dataStream.slice(o.startIndex,o.endIndex+1):``,!o||!s)return;this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange({startOffset:o.startIndex,endOffset:o.endIndex,collapsed:!1},this._editPopup,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.type===`editing`){var u;let t=(0,r.getEditingCustomRangePosition)(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!t||!((u=t.rects)!=null&&u.length))return;o=t.customRange,s=t.label,this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(t.rects.pop(),this._editPopup,i,a)}else{var d;let n=this._univerInstanceService.getUnit(i,t.UniverInstanceType.UNIVER_SHEET),c=n==null?void 0:n.getSheetBySheetId(a),l=c==null?void 0:c.getCellRaw(e.row,e.col),u=n==null?void 0:n.getStyles().getStyleByCell(l),f=u==null?void 0:u.tr,p=(0,r.getCustomRangePosition)(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!p||!((d=p.rects)!=null&&d.length))return;o=p.customRange,s=p.label,f?this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,i,a):this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupByPosition(p.rects.pop(),this._editPopup,{unitId:i,subUnitId:a,row:e.row,col:e.col})}this._currentEditing$.next({...e,customRange:o,label:s})}endEditing(e){if(this.getIsKeepVisible())return;let t=this._currentEditing$.getValue();if(t&&(!e||e===t.type)){var n;(n=this._currentEditingPopup)==null||n.dispose(),this._currentEditing$.next(null)}}};H=C([S(0,(0,t.Inject)(r.SheetCanvasPopManagerService)),S(1,(0,t.Inject)(t.Injector)),S(2,t.IUniverInstanceService),S(3,r.IEditorBridgeService),S(4,(0,t.Inject)(i.DocSelectionManagerService)),S(5,(0,t.Inject)(a.DocCanvasPopManagerService)),S(6,s.IZenZoneService)],H);let U=new Set([t.DataValidationType.CHECKBOX,t.DataValidationType.LIST,t.DataValidationType.LIST_MULTIPLE]),pe=(e,t,n,r)=>{var i,a;let o=t.getCell(n,r);if(o!=null&&o.f||o!=null&&o.si||!(o==null||(i=o.p)==null||(i=i.body)==null||(i=i.customBlocks)==null)&&i.length)return 1;let s=e.has(h.SheetDataValidationModel)?e.get(h.SheetDataValidationModel):null,c=s==null?void 0:s.getRuleByLocation(t.getUnitId(),t.getSheetId(),n,r);return c&&U.has(c.type)?!0:!(o==null||(a=o.p)==null||(a=a.drawingsOrder)==null)&&a.length?2:0},W=e=>{let r=e.get(t.IUniverInstanceService).getCurrentUnitOfType(t.UniverInstanceType.UNIVER_SHEET);if(!r)return!0;let i=r.getActiveSheet(),a=e.get(n.SheetsSelectionsService).getCurrentSelections();if(!a.length)return!0;let o=a[0].range.startRow,s=a[0].range.startColumn;return pe(e,i,o,s)===1},me=e=>{let n=e.get(i.DocSelectionManagerService),r=e.get(t.IUniverInstanceService),a=n.getTextRanges();if(!(a!=null&&a.length))return!0;let o=r.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC);return!!(!o||a.every(e=>e.collapsed)||!o.getSelfOrHeaderFooterModel(a[0].segmentId).getBody())},G={type:t.CommandType.OPERATION,id:`sheet.operation.open-hyper-link-edit-panel`,handler(e,t){if(!t)return!1;let n=e.get(H);return t.customRangeId?n.startEditing(t):n.startAddEditing(t),!0}},K={type:t.CommandType.OPERATION,id:`sheet.operation.close-hyper-link-popup`,handler(e){return e.get(H).endEditing(),!0}},q={type:t.CommandType.OPERATION,id:`sheet.operation.insert-hyper-link`,handler(e){var i;let a=e.get(t.IUniverInstanceService),o=(0,n.getSheetCommandTarget)(a),s=e.get(r.IEditorBridgeService);if(!o)return!1;let c=e.get(t.ICommandService),l=e.get(n.SheetsSelectionsService).getCurrentLastSelection();if(!l)return!1;let u=l.range.startRow,d=l.range.startColumn,f=s.isVisible(),p=((i=a.getFocusedUnit())==null?void 0:i.getUnitId())===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY;return c.executeCommand(G.id,{unitId:o.unitId,subUnitId:o.subUnitId,row:u,col:d,type:p?`zen_mode`:f.visible?`editing`:`viewing`})}},J={type:t.CommandType.OPERATION,id:`sheet.operation.insert-hyper-link-toolbar`,handler(e){if(W(e))return!1;let n=e.get(t.ICommandService);return e.get(H).currentEditing?n.executeCommand(K.id):n.executeCommand(q.id)}},Y=`SHEET_HYPER_LINK_UI_PLUGIN`,X=class extends t.Disposable{registerPlainTextFilter(e){this._plainTextFilter.add(e)}removePlainTextFilter(e){this._plainTextFilter.delete(e)}_filterPlainText(e){return Array.from(this._plainTextFilter).every(t=>t(e))}constructor(e,t,n,r){super(),this._sheetClipboardService=e,this._hyperLinkModel=t,this._injector=n,this._resolverService=r,k(this,`_plainTextFilter`,new Set),k(this,`_copyInfo`,void 0),this._initCopyPaste(),this.disposeWithMe(()=>{this._plainTextFilter.clear()})}_initCopyPaste(){this._sheetClipboardService.addClipboardHook({id:Y,onBeforeCopy:(e,t,n)=>this._collect(e,t,n),onPasteCells:(e,t,n,i)=>{let{copyType:a=r.COPY_TYPE.COPY,pasteType:o}=i,{range:s}=e||{},{range:c,unitId:l,subUnitId:u}=t;return this._generateMutations(c,{copyType:a,pasteType:o,copyRange:s,unitId:l,subUnitId:u})},onPastePlainText:(e,n)=>{let i=this._filterPlainText(n);if(g(n)&&i){let{range:n,unitId:i,subUnitId:a}=e,{ranges:[o],mapFunc:s}=(0,r.virtualizeDiscreteRanges)([n]),c=[],l=[];return t.Range.foreach(o,(e,t)=>{let{row:n,col:r}=s(e,t),o=this._hyperLinkModel.getHyperLinkByLocation(i,a,n,r);o&&c.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:i,subUnitId:a,id:o.id}}),o&&l.push({id:f.AddHyperLinkMutation.id,params:{unitId:i,subUnitId:a,link:o}})}),{redos:c,undos:l}}return{undos:[],redos:[]}},priority:99})}_collect(e,r,i){let a=new t.ObjectMatrix;this._copyInfo={unitId:e,subUnitId:r,matrix:a};let o=this._injector.invoke(t=>(0,n.rangeToDiscreteRange)(i,t,e,r));if(!o)return;let{rows:s,cols:c}=o;s.forEach((t,n)=>{c.forEach((i,o)=>{var s;let c=this._hyperLinkModel.getHyperLinkByLocation(e,r,t,i);a.setValue(n,o,(s=c==null?void 0:c.id)==null?``:s)})})}_generateMutations(e,n){if(!this._copyInfo||!this._copyInfo||!this._copyInfo.matrix.getSizeOf()||!n.copyRange||[r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_COL_WIDTH,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMAT,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMULA].includes(n.pasteType))return{redos:[],undos:[]};let{unitId:i,subUnitId:a}=this._copyInfo,o=[],s=[],{ranges:[c,l],mapFunc:u}=(0,r.virtualizeDiscreteRanges)([n.copyRange,e]);return(0,r.getRepeatRange)(c,l,!0).forEach(({startRange:e})=>{var r;(r=this._copyInfo)==null||r.matrix.forValue((r,c,l)=>{let d=t.Rectangle.getPositionRange({startRow:r,endRow:r,startColumn:c,endColumn:c},e),p=this._hyperLinkModel.getHyperLink(i,a,l),{row:m,col:h}=u(d.startRow,d.startColumn),g=this._hyperLinkModel.getHyperLinkByLocation(n.unitId,n.subUnitId,m,h),_=(0,t.generateRandomId)();g&&o.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,id:g.id}}),p&&(o.push({id:f.AddHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,link:{...p,id:_,row:m,column:h}}}),s.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,id:_}})),g&&s.push({id:f.AddHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,link:g}})})}),{redos:o,undos:s}}};X=C([S(0,r.ISheetClipboardService),S(1,(0,t.Inject)(f.HyperLinkModel)),S(2,(0,t.Inject)(t.Injector)),S(3,(0,t.Inject)(T))],X);let he=(e,i=t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)=>{var s;let l=e.get(t.IUniverInstanceService),u=(s=e.get(o.IRenderManagerService).getRenderById(i))==null?void 0:s.with(a.DocSelectionRenderService);return u?u.textSelectionInner$.pipe((0,c.map)(()=>{let t=e.get(r.IEditorBridgeService).getEditCellState();if(!t)return!0;let i=(0,n.getSheetCommandTarget)(l,{unitId:t.unitId,subUnitId:t.sheetId});return!(i!=null&&i.worksheet)||pe(e,i.worksheet,t.row,t.column)===1?!0:me(e)})):(0,c.of)(!0)},ge=e=>{var i;let a=e.get(t.IUniverInstanceService),o=e.has(r.IEditorBridgeService)?e.get(r.IEditorBridgeService):null;return((i=o==null?void 0:o.currentEditCellState$.pipe((0,c.map)(t=>{if(!t)return 1;let r=(0,n.getSheetCommandTarget)(a,{unitId:t.unitId,subUnitId:t.sheetId});return r?pe(e,r.worksheet,t.row,t.column):1}),(0,c.switchMap)(n=>n===1?(0,c.of)(!0):(0,c.combineLatest)([o?o.visible$:(0,c.of)(null),a.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC)]).pipe((0,c.switchMap)(([r,i])=>r!=null&&r.visible?(i==null?void 0:i.getUnitId())===t.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY?(0,c.of)(!0):he(e,t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY):(0,c.of)(n!==0))))))==null?(0,c.of)(!0):i).pipe((0,c.switchMap)(t=>t?(0,c.of)(!0):(0,r.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetSetCellValuePermission,n.WorksheetInsertHyperlinkPermission],rangeTypes:[n.RangeProtectionPermissionEditPoint]},!0)))},Z={commandId:q.id,type:s.MenuItemType.BUTTON,title:`sheets-hyper-link-ui.menu.add`,icon:`LinkIcon`},Q=e=>`${e}-zen-editor`,_e=e=>({...Z,id:Z.commandId,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:ge(e)}),ve=e=>({...Z,id:Q(Z.commandId),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:he(e)}),ye={tooltip:`sheets-hyper-link-ui.form.addTitle`,commandId:J.id,type:s.MenuItemType.BUTTON,icon:`LinkIcon`},be=e=>({...ye,id:ye.commandId,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:ge(e)}),xe=e=>({...ye,id:Q(ye.commandId),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:he(e)}),Se={id:J.id,binding:s.KeyCode.K|s.MetaKeys.CTRL_COMMAND,preconditions:r.whenSheetEditorFocused};var Ce=`@univerjs/sheets-hyper-link-ui`,we=`0.25.0`;let Te=class extends t.Disposable{constructor(e,t){super(),this._autoFillService=e,this._hyperLinkModel=t,this._initAutoFill()}_initAutoFill(){let e=()=>({redos:[],undos:[]}),i=(e,i)=>{let{source:a,target:o,unitId:s,subUnitId:c}=e,l=(0,r.virtualizeDiscreteRanges)([a,o]),[u,d]=l.ranges,{mapFunc:p}=l,m={row:u.startRow,col:u.startColumn},h=n.AutoFillTools.getAutoFillRepeatRange(u,d),g=[],_=[];return h.forEach(e=>{let r=e.repeatStartCell,a=e.relativeRange,o={startRow:m.row,startColumn:m.col,endColumn:m.col,endRow:m.row},l={startRow:r.row,startColumn:r.col,endColumn:r.col,endRow:r.row};t.Range.foreach(a,(e,r)=>{let a=t.Rectangle.getPositionRange({startRow:e,startColumn:r,endColumn:r,endRow:e},o),{row:u,col:d}=p(a.startRow,a.startColumn),m=this._hyperLinkModel.getHyperLinkByLocation(s,c,u,d),h=t.Rectangle.getPositionRange({startRow:e,startColumn:r,endColumn:r,endRow:e},l),{row:v,col:y}=p(h.startRow,h.startColumn),b=(0,t.generateRandomId)(),x=this._hyperLinkModel.getHyperLinkByLocation(s,c,v,y);x&&g.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:s,subUnitId:c,id:x.id}}),(n.AUTO_FILL_APPLY_TYPE.COPY===i||n.AUTO_FILL_APPLY_TYPE.SERIES===i)&&m&&(g.push({id:f.AddHyperLinkMutation.id,params:{unitId:s,subUnitId:c,link:{...m,id:b,row:v,column:y}}}),_.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:s,subUnitId:c,id:b}})),x&&_.push({id:f.AddHyperLinkMutation.id,params:{unitId:s,subUnitId:c,link:x}})})}),{undos:_,redos:g}},a={id:Y,onFillData:(t,r,a)=>a===n.AUTO_FILL_APPLY_TYPE.COPY||a===n.AUTO_FILL_APPLY_TYPE.ONLY_FORMAT||a===n.AUTO_FILL_APPLY_TYPE.SERIES?i(t,a):e()};this.disposeWithMe(this._autoFillService.addHook(a))}};Te=C([S(0,n.IAutoFillService),S(1,(0,t.Inject)(f.HyperLinkModel))],Te);let Ee=class extends t.Disposable{constructor(e,t,n){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===Se.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookEditablePermission],rangeTypes:[n.RangeProtectionPermissionEditPoint],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetSetCellValuePermission,n.WorksheetInsertHyperlinkPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`sheets-hyper-link-ui.permission.hyperLinkErr`)))}))}};Ee=C([S(0,(0,t.Inject)(t.LocaleService)),S(1,t.ICommandService),S(2,(0,t.Inject)(n.SheetPermissionCheckController))],Ee);let De=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._hoverManagerService=e,this._sheetsHyperLinkPopupService=t,this._renderManagerService=n,this._permissionService=r,this._sheetPermissionCheckController=i,this._commandService=a,this._editorBridgeService=o,this._textSelectionManagerService=s,this._univerInstanceService=c,this._zenZoneService=l,this._initHoverListener(),this._initCommandListener(),this._initHoverEditingListener(),this._initTextSelectionListener(),this._initZenEditor()}_getLinkPermission(e){let{unitId:r,subUnitId:i,row:a,col:o}=e,s=this._univerInstanceService.getUnit(r,t.UniverInstanceType.UNIVER_SHEET),c=s==null?void 0:s.getSheetBySheetId(i);if(!c)return{viewPermission:!1,editPermission:!1,copyPermission:!1};let l=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookViewPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],r,i),u=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetInsertHyperlinkPermission],rangeTypes:[n.RangeProtectionPermissionEditPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],r,i),d=c.getCellRaw(a,o);d!=null&&d.f&&d.f.startsWith(`=HYPERLINK(`)&&(u=!1);let f=this._permissionService.composePermission([new n.WorkbookCopyPermission(r).id,new n.WorksheetCopyPermission(r,i).id]).every(e=>e.value);return{viewPermission:l,editPermission:u,copyPermission:f}}_initHoverListener(){this.disposeWithMe(this._hoverManagerService.currentRichText$.pipe((0,c.debounceTime)(200)).subscribe(e=>{var n,i,a;if(!e||((n=e.customRange)==null?void 0:n.rangeType)!==t.CustomRangeType.HYPERLINK){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let{unitId:o,subUnitId:s,row:c,col:l}=e,u=this._renderManagerService.getRenderById(o);if(!u)return;let d=this._univerInstanceService.getUnit(o,t.UniverInstanceType.UNIVER_SHEET),f=d==null?void 0:d.getSheetBySheetId(s);if(!f)return;if(!u.with(r.HoverRenderController).active){this._sheetsHyperLinkPopupService.hideCurrentPopup(`viewing`);return}let p=u==null||(i=u.with(r.SheetSkeletonManagerService).getSkeletonParam(s))==null?void 0:i.skeleton,m=l,h=c,g=h,_=m;p&&p.overflowCache.forValue((e,n,r)=>{t.Rectangle.contains(r,{startColumn:m,endColumn:m,startRow:h,endRow:h})&&(g=e,_=n)});let{viewPermission:v,editPermission:y,copyPermission:b}=this._getLinkPermission(e);if(!v){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let x=f.getCellStyleOnly(g,_),S=d.getStyles().getStyleByCell(x),C=S==null||(a=S.tr)==null?void 0:a.a;if(!C&&!e.customRange){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}this._sheetsHyperLinkPopupService.showPopup({row:g,col:_,editPermission:y,copyPermission:b,customRange:e.customRange,customRangeRect:e.rect,type:`viewing`,unitId:o,subUnitId:s,showAll:!!C})}))}_initHoverEditingListener(){let e=null;this.disposeWithMe(this._editorBridgeService.currentEditCellState$.pipe((0,c.switchMap)(e=>this._editorBridgeService.visible$.pipe((0,c.map)(t=>({visible:t,state:e}))))).subscribe(({visible:n,state:i})=>{if(!i||i.editorUnitId!==t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)return;if(!n.visible){e==null||e.unsubscribe(),this._sheetsHyperLinkPopupService.hideCurrentPopup(`editing`),this._sheetsHyperLinkPopupService.endEditing(`editing`);return}let{editorUnitId:o,unitId:s,sheetId:l,row:u,column:d}=i,f=this._renderManagerService.getRenderById(o);if(!f)return;let{editPermission:p,viewPermission:m,copyPermission:h}=this._getLinkPermission({unitId:s,subUnitId:l,row:u,col:d}),g=f.with(a.DocEventManagerService);m&&(e==null||e.unsubscribe(),e=g.hoverCustomRanges$.pipe((0,c.debounceTime)(200)).subscribe(e=>{var n;let i=e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK);if(!i){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let a=i.rects[i.rects.length-1];if(!(!((n=this._renderManagerService.getRenderById(s))==null||(n=n.with(r.SheetSkeletonManagerService).getSkeletonParam(l))==null)&&n.skeleton)||!a)return;let o=f.engine.getCanvasElement().getBoundingClientRect();this._sheetsHyperLinkPopupService.showPopup({unitId:s,subUnitId:l,row:u,col:d,customRange:i.range,customRangeRect:{left:a.left+o.left,top:a.top+o.top,bottom:a.bottom+o.top,right:a.right+o.left},editPermission:p,copyPermission:h,type:`editing`})}))})),this.disposeWithMe(()=>{e==null||e.unsubscribe()})}_initZenEditor(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e?(this._sheetsHyperLinkPopupService.hideCurrentPopup(`viewing`),this._sheetsHyperLinkPopupService.hideCurrentPopup(`editing`),this._sheetsHyperLinkPopupService.endEditing(`editing`),this._sheetsHyperLinkPopupService.hideCurrentPopup(`viewing`)):(this._sheetsHyperLinkPopupService.hideCurrentPopup(`zen_mode`),this._sheetsHyperLinkPopupService.endEditing(`zen_mode`))})),this.disposeWithMe(this._univerInstanceService.focused$.pipe((0,c.switchMap)(e=>{let n=e===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY?this._renderManagerService.getRenderById(e):null;return n?n.with(a.DocEventManagerService).hoverCustomRanges$.pipe((0,c.debounceTime)(200)):new c.Observable(e=>{e.next(null)})})).subscribe(e=>{let n=e==null?void 0:e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK),r=this._editorBridgeService.getEditCellState();if(n&&r){let{unitId:e,sheetId:t,row:i,column:a}=r,{editPermission:o,viewPermission:s,copyPermission:c}=this._getLinkPermission({unitId:e,subUnitId:t,row:i,col:a});s&&this._sheetsHyperLinkPopupService.showPopup({type:`zen_mode`,unitId:e,subUnitId:t,row:i,col:a,customRange:n.range,editPermission:o,copyPermission:c})}else this._sheetsHyperLinkPopupService.hideCurrentPopup(`zen_mode`)}))}_initTextSelectionListener(){this.disposeWithMe(this._textSelectionManagerService.textSelection$.subscribe(e=>{e&&e.unitId===t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&this._sheetsHyperLinkPopupService.endEditing(`editing`)}))}_initCommandListener(){let e=[n.ClearSelectionContentCommand.id,n.ClearSelectionAllCommand.id,n.ClearSelectionFormatCommand.id];this.disposeWithMe(this._commandService.onCommandExecuted(t=>{e.includes(t.id)&&this._sheetsHyperLinkPopupService.hideCurrentPopup()}))}};De=C([S(0,(0,t.Inject)(r.HoverManagerService)),S(1,(0,t.Inject)(H)),S(2,(0,t.Inject)(o.IRenderManagerService)),S(3,(0,t.Inject)(t.IPermissionService)),S(4,(0,t.Inject)(n.SheetPermissionCheckController)),S(5,t.ICommandService),S(6,r.IEditorBridgeService),S(7,(0,t.Inject)(i.DocSelectionManagerService)),S(8,t.IUniverInstanceService),S(9,s.IZenZoneService)],De);let Oe=class extends t.Disposable{constructor(e,t){super(),this._context=e,this._hyperLinkModel=t,this._initSkeletonChange()}_initSkeletonChange(){let e=()=>{var e;(e=this._context.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe((0,c.debounceTime)(16)).subscribe(()=>{e()}))}};Oe=C([S(1,(0,t.Inject)(f.HyperLinkModel))],Oe);let ke={[s.RibbonInsertGroup.MEDIA]:{[J.id]:{order:1,menuItemFactory:be},[Q(J.id)]:{order:1,menuItemFactory:xe}},[s.ContextMenuPosition.MAIN_AREA]:{[s.ContextMenuGroup.OTHERS]:{order:1,[J.id]:{order:0,menuItemFactory:_e},[Q(J.id)]:{order:0,menuItemFactory:ve}}}},Ae=class extends t.Disposable{constructor(e,t,n,r,i){super(),this._componentManager=e,this._commandService=t,this._menuManagerService=n,this._injector=r,this._shortcutService=i,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortCut()}_initComponents(){[[B.componentKey,B],[A.componentKey,A],[`LinkIcon`,R]].forEach(([e,t])=>{this._componentManager.register(e,t)})}_initCommands(){[G,K,q,J].forEach(e=>{this._commandService.registerCommand(e)})}_initMenus(){this._menuManagerService.mergeMenu(ke)}_initShortCut(){this._shortcutService.registerShortcut(Se)}};Ae=C([S(0,(0,t.Inject)(s.ComponentManager)),S(1,t.ICommandService),S(2,s.IMenuManagerService),S(3,(0,t.Inject)(t.Injector)),S(4,(0,t.Inject)(s.IShortcutService))],Ae);let je=class extends t.Disposable{constructor(e,t){super(),this._parserService=e,this._resolverService=t,this._handleInitUrl()}_handleInitUrl(){let e=location.hash;if(e){let t=this._parserService.parseHyperLink(e);this._resolverService.navigate(t)}}};je=C([S(0,(0,t.Inject)(f.SheetsHyperLinkParserService)),S(1,(0,t.Inject)(T))],je);let $=class extends t.Plugin{constructor(e=x,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},x,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(b,a)}onStarting(){[[T],[H],[ee],[De],[Ae],[Te],[X],[Ee],[je]].forEach(e=>this._injector.add(e))}onReady(){this._injector.get(o.IRenderManagerService).registerRenderModule(t.UniverInstanceType.UNIVER_SHEET,[Oe]),this._injector.get(Te),this._injector.get(X),this._injector.get(Ae)}onRendered(){this._injector.get(Ee),this._injector.get(je),this._injector.get(De)}};k($,`pluginName`,Y),k($,`packageName`,Ce),k($,`version`,we),k($,`type`,t.UniverInstanceType.UNIVER_SHEET),$=C([(0,t.DependentOn)(f.UniverSheetsHyperLinkPlugin,a.UniverDocsUIPlugin),S(1,(0,t.Inject)(t.Injector)),S(2,t.IConfigService)],$),e.CloseHyperLinkPopupOperation=K,e.InsertHyperLinkOperation=q,e.InsertLinkShortcut=Se,e.OpenHyperLinkEditPanelOperation=G,Object.defineProperty(e,"SheetsHyperLinkCopyPasteController",{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,"SheetsHyperLinkPopupService",{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,"SheetsHyperLinkResolverService",{enumerable:!0,get:function(){return T}}),e.SheetsHyperLinkSidePanelService=ee,Object.defineProperty(e,"UniverSheetsHyperLinkUIPlugin",{enumerable:!0,get:function(){return $}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiArSA=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`تحرير الارتباط`,addTitle:`إدراج ارتباط تشعبي`,label:`التسمية`,type:`النوع`,link:`الرابط`,linkPlaceholder:`أدخل الرابط`,range:`النطاق`,worksheet:`ورقة العمل`,definedName:`الاسم المعرف`,ok:`تأكيد`,cancel:`إلغاء`,labelPlaceholder:`أدخل التسمية`,inputError:`الرجاء الإدخال`,selectError:`الرجاء التحديد`,linkError:`الرجاء إدخال رابط صالح`},menu:{add:`إدراج ارتباط تشعبي`},message:{noSheet:`تم حذف الورقة المستهدفة`,refError:`نطاق غير صالح`,hiddenSheet:`تعذر فتح الرابط لأن الورقة المرتبطة مخفية`,coped:`تم نسخ الرابط إلى الحافظة`},popup:{copy:`نسخ الرابط`,edit:`تحرير الرابط`,cancel:`إلغاء الارتباط`}}}});
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiCaES=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiCaES=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Edita l'enllaç`,addTitle:`Insereix enllaç`,label:`Etiqueta`,type:`Tipus`,link:`Enllaç`,linkPlaceholder:`Introdueix l'enllaç`,range:`Interval`,worksheet:`Full de càlcul`,definedName:`Nom definit`,ok:`Confirmar`,cancel:`Cancel·lar`,labelPlaceholder:`Introdueix l'etiqueta`,inputError:`Si us plau, introdueix`,selectError:`Si us plau, selecciona`,linkError:`Si us plau, introdueix un enllaç vàlid`},menu:{add:`Insereix enllaç`},message:{noSheet:`El full de destinació ha estat eliminat`,refError:`Interval no vàlid`,hiddenSheet:`No es pot obrir l'enllaç perquè el full enllaçat està amagat`,coped:`Enllaç copiat al porta-retalls`},popup:{copy:`Copia l'enllaç`,edit:`Edita l'enllaç`,cancel:`Cancel·la l'enllaç`}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiDeDE=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Link bearbeiten`,addTitle:`Link einfügen`,label:`Beschriftung`,type:`Typ`,link:`Link`,linkPlaceholder:`Link eingeben`,range:`Bereich`,worksheet:`Arbeitsblatt`,definedName:`Definierter Name`,ok:`Bestätigen`,cancel:`Abbrechen`,labelPlaceholder:`Beschriftung eingeben`,inputError:`Bitte eingeben`,selectError:`Bitte auswählen`,linkError:`Bitte einen gültigen Link eingeben`},menu:{add:`Link einfügen`},message:{noSheet:`Zielblatt wurde gelöscht`,refError:`Ungültiger Bereich`,hiddenSheet:`Der Link kann nicht geöffnet werden, da das verknüpfte Blatt ausgeblendet ist`,coped:`Link in Zwischenablage kopiert`},popup:{copy:`Link kopieren`,edit:`Link bearbeiten`,cancel:`Link aufheben`}}}});
|
package/lib/umd/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiEnUS=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiEnUS=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Edit Link`,addTitle:`Insert Link`,label:`Label`,type:`Type`,link:`Link`,linkPlaceholder:`Enter link`,range:`Range`,worksheet:`Worksheet`,definedName:`Defined Name`,ok:`Confirm`,cancel:`Cancel`,labelPlaceholder:`Enter label`,inputError:`Please enter`,selectError:`Please select`,linkError:`Please enter a legal link`},menu:{add:`Insert Link`},message:{noSheet:`Target sheet has been delete`,refError:`Invalid Range`,hiddenSheet:`Cannot open the link because the linked sheet is hidden`,coped:`Link copied to clipboard`},popup:{copy:`Copy Link`,edit:`Edit Link`,cancel:`Cancel Link`}}}});
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiEsES=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiEsES=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Editar enlace`,addTitle:`Insertar enlace`,label:`Etiqueta`,type:`Tipo`,link:`Enlace`,linkPlaceholder:`Introduce el enlace`,range:`Rango`,worksheet:`Hoja de cálculo`,definedName:`Nombre definido`,ok:`Confirmar`,cancel:`Cancelar`,labelPlaceholder:`Introduce la etiqueta`,inputError:`Por favor, introduce`,selectError:`Por favor, selecciona`,linkError:`Por favor, introduce un enlace válido`},menu:{add:`Insertar enlace`},message:{noSheet:`La hoja de destino ha sido eliminada`,refError:`Rango no válido`,hiddenSheet:`No se puede abrir el enlace porque la hoja enlazada está oculta`,coped:`Enlace copiado al portapapeles`},popup:{copy:`Copiar enlace`,edit:`Editar enlace`,cancel:`Cancelar enlace`}}}});
|
package/lib/umd/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiFaIR=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiFaIR=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`ویرایش لینک`,addTitle:`درج لینک`,label:`برچسب`,type:`نوع`,link:`لینک`,linkPlaceholder:`لینک را وارد کنید`,range:`محدوده`,worksheet:`برگ کار`,definedName:`نام تعریف شده`,ok:`تایید`,cancel:`انصراف`,labelPlaceholder:`برچسب را وارد کنید`,inputError:`لطفا وارد کنید`,selectError:`لطفا انتخاب کنید`,linkError:`لطفا یک لینک معتبر وارد کنید`},menu:{add:`درج لینک`},message:{noSheet:`برگ هدف حذف شده است`,refError:`محدوده نامعتبر`,hiddenSheet:`نمیتوان لینک را باز کرد زیرا برگ مرتبط پنهان است`,coped:`لینک به کلیپ بورد کپی شد`},popup:{copy:`کپی لینک`,edit:`ویرایش لینک`,cancel:`لینک را لغو کنید`}}}});
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiFrFR=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiFrFR=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Modifier le lien`,addTitle:`Insérer un lien`,label:`Titre`,type:`Type`,link:`Lien`,linkPlaceholder:`Entrez le lien`,range:`Plage`,worksheet:`Feuille de calcul`,definedName:`Nom défini`,ok:`Confirmer`,cancel:`Annuler`,labelPlaceholder:`Entrez le titre`,inputError:`Veuillez entrer`,selectError:`Veuillez sélectionner`,linkError:`Veuillez entrer un lien valide`},menu:{add:`Insérer un lien`},message:{noSheet:`La feuille cible a été supprimée`,refError:`Plage invalide`,hiddenSheet:`Impossible d'ouvrir le lien car la feuille liée est masquée`,coped:`Lien copié dans le presse-papiers`},popup:{copy:`Copier le lien`,edit:`Modifier le lien`,cancel:`Annuler le lien`}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiIdID=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Edit Tautan`,addTitle:`Sisipkan Tautan`,label:`Label`,type:`Tipe`,link:`Tautan`,linkPlaceholder:`Masukkan tautan`,range:`Rentang`,worksheet:`Lembar Kerja`,definedName:`Nama yang Ditentukan`,ok:`Konfirmasi`,cancel:`Batal`,labelPlaceholder:`Masukkan label`,inputError:`Silakan masukkan`,selectError:`Silakan pilih`,linkError:`Silakan masukkan tautan yang valid`},menu:{add:`Sisipkan Tautan`},message:{noSheet:`Lembar target telah dihapus`,refError:`Rentang Tidak Valid`,hiddenSheet:`Tidak dapat membuka tautan karena lembar yang ditautkan tersembunyi`,coped:`Tautan disalin ke clipboard`},popup:{copy:`Salin Tautan`,edit:`Edit Tautan`,cancel:`Batalkan Tautan`}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiItIT=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Modifica collegamento`,addTitle:`Inserisci collegamento`,label:`Etichetta`,type:`Tipo`,link:`Collegamento`,linkPlaceholder:`Inserisci collegamento`,range:`Intervallo`,worksheet:`Foglio di lavoro`,definedName:`Nome definito`,ok:`Conferma`,cancel:`Annulla`,labelPlaceholder:`Inserisci etichetta`,inputError:`Inserisci`,selectError:`Seleziona`,linkError:`Inserisci un collegamento valido`},menu:{add:`Inserisci collegamento`},message:{noSheet:`Il foglio di destinazione è stato eliminato`,refError:`Intervallo non valido`,hiddenSheet:`Impossibile aprire il collegamento perché il foglio collegato è nascosto`,coped:`Collegamento copiato negli appunti`},popup:{copy:`Copia collegamento`,edit:`Modifica collegamento`,cancel:`Annulla collegamento`}}}});
|
package/lib/umd/locale/ja-JP.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiJaJP=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiJaJP=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`リンクの編集`,addTitle:`リンクの挿入`,label:`表示文字列`,type:`種類`,link:`リンク`,linkPlaceholder:`リンクを入力`,range:`範囲`,worksheet:`ワークシート`,definedName:`定義済みの名前`,ok:`OK`,cancel:`キャンセル`,labelPlaceholder:`表示する文字列を入力`,inputError:`値を入力してください`,selectError:`選択してください`,linkError:`有効なリンクを入力してください`},menu:{add:`リンクの挿入`},message:{noSheet:`対象のワークシートが削除されました`,refError:`無効な範囲です`,hiddenSheet:`リンクを開けません。参照先のワークシートが非表示です`,coped:`リンクがクリップボードにコピーされました`},popup:{copy:`リンクをコピー`,edit:`リンクの編集`,cancel:`リンク解除`}}}});
|
package/lib/umd/locale/ko-KR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiKoKR=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiKoKR=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`링크 편집`,addTitle:`링크 삽입`,label:`표시 텍스트`,type:`유형`,link:`링크`,linkPlaceholder:`링크 입력`,range:`범위`,worksheet:`워크시트`,definedName:`정의된 이름`,ok:`확인`,cancel:`취소`,labelPlaceholder:`표시할 텍스트 입력`,inputError:`값을 입력하세요`,selectError:`선택하세요`,linkError:`유효한 링크를 입력하세요`},menu:{add:`링크 삽입`},message:{noSheet:`대상 워크시트가 삭제되었습니다`,refError:`잘못된 범위입니다`,hiddenSheet:`링크를 열 수 없습니다. 연결된 워크시트가 숨겨져 있습니다`,coped:`링크가 클립보드에 복사되었습니다`},popup:{copy:`링크 복사`,edit:`링크 편집`,cancel:`링크 취소`}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiPlPL=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Edytuj łącze`,addTitle:`Wstaw łącze`,label:`Etykieta`,type:`Typ`,link:`Łącze`,linkPlaceholder:`Wprowadź łącze`,range:`Zakres`,worksheet:`Arkusz`,definedName:`Nazwa zdefiniowana`,ok:`Potwierdź`,cancel:`Anuluj`,labelPlaceholder:`Wprowadź etykietę`,inputError:`Wprowadź wartość`,selectError:`Wybierz wartość`,linkError:`Wprowadź prawidłowe łącze`},menu:{add:`Wstaw łącze`},message:{noSheet:`Arkusz docelowy został usunięty`,refError:`Nieprawidłowy zakres`,hiddenSheet:`Nie można otworzyć łącza, ponieważ połączony arkusz jest ukryty`,coped:`Łącze skopiowane do schowka`},popup:{copy:`Kopiuj łącze`,edit:`Edytuj łącze`,cancel:`Anuluj łącze`}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiPtBR=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Editar Link`,addTitle:`Inserir Link`,label:`Rótulo`,type:`Tipo`,link:`Link`,linkPlaceholder:`Digite o link`,range:`Intervalo`,worksheet:`Planilha`,definedName:`Nome Definido`,ok:`Confirmar`,cancel:`Cancelar`,labelPlaceholder:`Digite o rótulo`,inputError:`Por favor, digite`,selectError:`Por favor, selecione`,linkError:`Por favor, digite um link válido`},menu:{add:`Inserir Link`},message:{noSheet:`A planilha de destino foi excluída`,refError:`Intervalo Inválido`,hiddenSheet:`Não é possível abrir o link porque a planilha vinculada está oculta`,coped:`Link copiado para a área de transferência`},popup:{copy:`Copiar Link`,edit:`Editar Link`,cancel:`Cancelar Link`}}}});
|
package/lib/umd/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiRuRU=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiRuRU=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Редактировать ссылку`,addTitle:`Вставить ссылку`,label:`Метка`,type:`Тип`,link:`Ссылка`,linkPlaceholder:`Введите ссылку`,range:`Диапазон`,worksheet:`Лист`,definedName:`Определенное имя`,ok:`ОК`,cancel:`Отмена`,labelPlaceholder:`Введите метку`,inputError:`Пожалуйста, введите`,selectError:`Пожалуйста, выберите`,linkError:`Пожалуйста, введите корректную ссылку`},menu:{add:`Вставить ссылку`},message:{noSheet:`Целевой лист был удален`,refError:`Недопустимый диапазон`,hiddenSheet:`Невозможно открыть ссылку, так как связанный лист скрыт`,coped:`Ссылка скопирована в буфер обмена`},popup:{copy:`Копировать ссылку`,edit:`Редактировать ссылку`,cancel:`Отменить ссылку`}}}});
|
package/lib/umd/locale/sk-SK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiSkSK=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiSkSK=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Upraviť odkaz`,addTitle:`Vložiť odkaz`,label:`Popisok`,type:`Typ`,link:`Odkaz`,linkPlaceholder:`Zadajte odkaz`,range:`Rozsah`,worksheet:`Hárok`,definedName:`Definovaný názov`,ok:`Potvrdiť`,cancel:`Zrušiť`,labelPlaceholder:`Zadajte popisok`,inputError:`Zadajte hodnotu`,selectError:`Vyberte`,linkError:`Zadajte platný odkaz`},menu:{add:`Vložiť odkaz`},message:{noSheet:`Cieľový hárok bol odstránený`,refError:`Neplatný rozsah`,hiddenSheet:`Odkaz nie je možné otvoriť, pretože prepojený hárok je skrytý`,coped:`Odkaz skopírovaný do schránky`},popup:{copy:`Kopírovať odkaz`,edit:`Upraviť odkaz`,cancel:`Zrušiť odkaz`}}}});
|
package/lib/umd/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiViVN=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiViVN=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`Chỉnh sửa liên kết`,addTitle:`Chèn liên kết`,label:`Văn bản`,labelPlaceholder:`Nhập văn bản`,type:`Loại`,link:`Liên kết`,linkPlaceholder:`Nhập địa chỉ liên kết`,range:`Ô`,worksheet:`Bảng tính`,definedName:`Tên đã xác định`,ok:`Xác nhận`,cancel:`Hủy`,inputError:`Vui lòng nhập`,selectError:`Vui lòng chọn`,linkError:`Vui lòng nhập liên kết hợp lệ`},menu:{add:`Thêm liên kết`},message:{noSheet:`Bảng con này đã bị xóa`,refError:`Tham chiếu lỗi`,hiddenSheet:`Không thể mở bảng con bị ẩn`,coped:`Liên kết đã được sao chép vào clipboard`},popup:{copy:`Sao chép`,edit:`Chỉnh sửa`,cancel:`Hủy liên kết`}}}});
|
package/lib/umd/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhCN=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhCN=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`编辑链接`,addTitle:`插入链接`,label:`文本`,labelPlaceholder:`输入文本`,type:`类型`,link:`链接`,linkPlaceholder:`输入链接地址`,range:`单元格`,worksheet:`工作表`,definedName:`定义的名称`,ok:`确认`,cancel:`取消`,inputError:`请输入`,selectError:`请选择`,linkError:`请输入合法的链接`},menu:{add:`添加链接`},message:{noSheet:`该子表已被删除`,refError:`错误的引用`,hiddenSheet:`无法打开被隐藏的子表`,coped:`链接已被复制到剪贴板`},popup:{copy:`复制`,edit:`编辑`,cancel:`取消链接`}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhHK=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`編輯連結`,addTitle:`插入連結`,label:`文本`,labelPlaceholder:`輸入文字`,type:`類型`,link:`連結`,linkPlaceholder:`輸入連結位址`,range:`儲存格`,worksheet:`工作表`,definedName:`定義的名稱`,ok:`確認`,cancel:`取消`,inputError:`請輸入`,selectError:`請選擇`,linkError:`請輸入合法的連結`},menu:{add:`新增連結`},message:{noSheet:`該子表已被刪除`,refError:`錯誤的引用`,hiddenSheet:`無法開啟被隱藏的子表`,coped:`連結已複製到剪貼簿`},popup:{copy:`複製`,edit:`編輯`,cancel:`取消連結`}}}});
|
package/lib/umd/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhTW=t())})(this,function(){return{
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhTW=t())})(this,function(){return{"sheets-hyper-link-ui":{form:{editTitle:`編輯連結`,addTitle:`插入連結`,label:`文本`,labelPlaceholder:`輸入文字`,type:`類型`,link:`連結`,linkPlaceholder:`輸入連結位址`,range:`儲存格`,worksheet:`工作表`,definedName:`定義的名稱`,ok:`確認`,cancel:`取消`,inputError:`請輸入`,selectError:`請選擇`,linkError:`請輸入合法的連結`},menu:{add:`新增連結`},message:{noSheet:`該子表已被刪除`,refError:`錯誤的引用`,hiddenSheet:`無法開啟被隱藏的子表`,coped:`連結已複製到剪貼簿`},popup:{copy:`複製`,edit:`編輯`,cancel:`取消連結`}}}});
|