asma-ui-richeditor 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -1,76 +1,76 @@
1
- # How to create and use the Design System
2
-
3
- ## Component composition.
4
-
5
- - When creating components that consists of several components, each component should be styled.
6
- - Each components that is used to create a "composed" component should be styled, and remember to check if the component alread is styled.
7
- - When creating a "composed component" evalute if it's really needed to create a composed component, or just document how to use the styled components.
8
- - MUI often has documentation on how to create composed components.
9
-
10
- ## Documentation and testing
11
-
12
- - All components shall be documented and tested in Storybook before PR is created.
13
-
14
- ## Changelog
15
-
16
- The project uses "changesets" to automatically bump version and create a changelog.
17
-
18
- For each new feature or change run "npx changeset". Choose patch for a change or bug fix, minor for a new feature or major version for a breaking change. This creates a markdown file in .changeset folder. Commit to brach/PR as normal.
19
-
20
- A PR can have several changesets.
21
-
22
- The pipeline will automatically bump version and create changelog after merge to master.
23
-
24
- ## Index file
25
-
26
- - Index files shall not be edited manually.
27
- - ctix is used for automatically create index files for exporting componens. Run "npm run create-index"
28
- - 'src/styles/index.ccss' is imported to 'src/theme/customMuiColors.ts' so exporting works with ctix.
29
-
30
- ## Using MUI theme in App
31
-
32
- ```tsx
33
- import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
34
- import { defaultTheme, customPalettes } from 'asma-ui-richeditor';
35
-
36
- const dataTheme = window.document.body.attributes.getNamedItem('data-theme');
37
-
38
- const getTheme = () => {
39
- switch (dataTheme?.value) {
40
- case 'fretex':
41
- return customPalettes.fretex.primary;
42
- default:
43
- return null;
44
- }
45
- };
46
-
47
- const theme = createTheme(defaultTheme, {
48
- palette: {
49
- ...defaultTheme.palette,
50
- primary: {
51
- ...getTheme(),
52
- },
53
- role: customPalettes.role,
54
- },
55
- });
56
-
57
- <React.Fragment>
58
- <ThemeProvider theme={createMuiTheme(theme)}>
59
- <... />
60
- </ThemeProvider>
61
- </React.Fragment>
62
- ```
63
-
64
- ## Using Components in App
65
-
66
- ```tsx
67
- import { StyledButton } from 'asma-ui-richeditor';
68
-
69
- ...
70
-
71
- <>
72
- <StyledButton>
73
- Text
74
- </StyledButton>
75
- </>
76
- ```
1
+ # How to create and use the Design System
2
+
3
+ ## Component composition.
4
+
5
+ - When creating components that consists of several components, each component should be styled.
6
+ - Each components that is used to create a "composed" component should be styled, and remember to check if the component alread is styled.
7
+ - When creating a "composed component" evalute if it's really needed to create a composed component, or just document how to use the styled components.
8
+ - MUI often has documentation on how to create composed components.
9
+
10
+ ## Documentation and testing
11
+
12
+ - All components shall be documented and tested in Storybook before PR is created.
13
+
14
+ ## Changelog
15
+
16
+ The project uses "changesets" to automatically bump version and create a changelog.
17
+
18
+ For each new feature or change run "npx changeset". Choose patch for a change or bug fix, minor for a new feature or major version for a breaking change. This creates a markdown file in .changeset folder. Commit to brach/PR as normal.
19
+
20
+ A PR can have several changesets.
21
+
22
+ The pipeline will automatically bump version and create changelog after merge to master.
23
+
24
+ ## Index file
25
+
26
+ - Index files shall not be edited manually.
27
+ - ctix is used for automatically create index files for exporting componens. Run "npm run create-index"
28
+ - 'src/styles/index.ccss' is imported to 'src/theme/customMuiColors.ts' so exporting works with ctix.
29
+
30
+ ## Using MUI theme in App
31
+
32
+ ```tsx
33
+ import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
34
+ import { defaultTheme, customPalettes } from 'asma-ui-richeditor';
35
+
36
+ const dataTheme = window.document.body.attributes.getNamedItem('data-theme');
37
+
38
+ const getTheme = () => {
39
+ switch (dataTheme?.value) {
40
+ case 'fretex':
41
+ return customPalettes.fretex.primary;
42
+ default:
43
+ return null;
44
+ }
45
+ };
46
+
47
+ const theme = createTheme(defaultTheme, {
48
+ palette: {
49
+ ...defaultTheme.palette,
50
+ primary: {
51
+ ...getTheme(),
52
+ },
53
+ role: customPalettes.role,
54
+ },
55
+ });
56
+
57
+ <React.Fragment>
58
+ <ThemeProvider theme={createMuiTheme(theme)}>
59
+ <... />
60
+ </ThemeProvider>
61
+ </React.Fragment>
62
+ ```
63
+
64
+ ## Using Components in App
65
+
66
+ ```tsx
67
+ import { StyledButton } from 'asma-ui-richeditor';
68
+
69
+ ...
70
+
71
+ <>
72
+ <StyledButton>
73
+ Text
74
+ </StyledButton>
75
+ </>
76
+ ```
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".toolbar{width:100%;padding-block:4px;background-color:var(--colors-delta-10);display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;padding-inline:8px;border-top:1px solid var(--colors-delta-200)}.chevron-icon{position:absolute;right:6px;top:8px;pointer-events:none;color:var(--colors-delta-700)}.link-input-field{width:568px}@media (width <= 768px){.link-input-field{width:100%}}:root{--max-scrollable-height: 100px}*{box-sizing:border-box;padding:0;margin:0}.core-ui-rte{overflow:hidden}.core-ui-rte a{text-decoration:underline;cursor:pointer;color:var(--colors-gama-400);transition:color .3s ease-in}.core-ui-rte a:hover{color:var(--colors-gama-600)}.core-ui-rte ol{list-style-type:decimal}.core-ui-rte ul{list-style-type:disc}.core-ui-rte .tiptap :first-child{margin-top:0}.core-ui-rte .tiptap{outline:none;padding-block:8px;padding-left:14px;padding-right:14px;overflow-y:auto;max-height:var(--max-scrollable-height);scrollbar-width:thin;scrollbar-color:var(--colors-gray-500) transparent}.core-ui-rte .tiptap ul,.core-ui-rte .tiptap ol{padding:0 1rem;margin:1.25rem 1rem 1.25rem .4rem}.core-ui-rte .tiptap ul li,.core-ui-rte .tiptap ol li{margin-top:.25em;margin-bottom:.25em}.core-ui-rte .tiptap .core-ui-rte ol{list-style-type:decimal}.core-ui-rte .tiptap .core-ui-rte ul{list-style-type:disc}.core-ui-rte .tiptap h1{font-size:2em;padding:0;margin:0}.core-ui-rte .tiptap h2{font-size:1.5em;padding:0;margin:0}.core-ui-rte.displace-text .tiptap{padding-right:40px}.core-ui-rte.edit-mode .tiptap{min-height:40px;max-height:var(--max-scrollable-height)}.rte-wrapper{position:relative;display:flex;flex-direction:column;height:100%;border-radius:4px;overflow:hidden;outline:1px solid var(--colors-delta-500);outline-offset:-1px}.rte-wrapper:hover{outline:2px solid var(--colors-gama-300);outline-offset:-2px}.rte-wrapper.error-state{outline:1px solid var(--colors-red-500)}.rte-wrapper.error-state:hover{outline:2px solid var(--colors-red-500)}.rte-wrapper.error-focused-state{outline:2px solid var(--colors-red-500);outline-offset:-2px}.rte-wrapper.readonly-outlined .tiptap{min-height:100px;max-height:none;overflow:hidden}.rte-wrapper.readonly-outlined{background-color:var(--colors-gray-10);outline:1px solid var(--colors-gray-200);outline-offset:-1px}.rte-wrapper.readonly-outlined:hover{outline:1px solid var(--colors-gray-200);outline-offset:-1px}.rte-wrapper.readonly-plain .tiptap{max-height:none;overflow:hidden;padding:0;margin:0}.rte-wrapper.readonly-plain{background-color:#fff;border-radius:unset;outline:none}.rte-wrapper.readonly-plain:hover{outline:none}.rte-wrapper.focused-state{outline:2px solid var(--colors-gama-400);outline-offset:-2px}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".toolbar{width:100%;padding-block:4px;background-color:var(--colors-delta-10);display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;padding-inline:8px;border-top:1px solid var(--colors-delta-200)}.chevron-icon{position:absolute;right:6px;top:8px;pointer-events:none;color:var(--colors-delta-700)}.link-input-field{width:568px}@media (width <= 768px){.link-input-field{width:100%}}:root{--max-scrollable-height: 100px}*{box-sizing:border-box;padding:0;margin:0}.core-ui-rte{overflow:hidden}.core-ui-rte a{text-decoration:underline;cursor:pointer;color:var(--colors-gama-400);transition:color .3s ease-in}.core-ui-rte a:hover{color:var(--colors-gama-600)}.core-ui-rte ol{list-style-type:decimal}.core-ui-rte ul{list-style-type:disc}.core-ui-rte .tiptap :first-child{margin-top:0}.core-ui-rte .tiptap{outline:none;padding-block:8px;padding-left:14px;padding-right:14px;overflow-y:auto;max-height:var(--max-scrollable-height);scrollbar-width:thin;scrollbar-color:var(--colors-gray-500) transparent}.core-ui-rte .tiptap ul,.core-ui-rte .tiptap ol{padding:0 1rem;margin:1.25rem 1rem 1.25rem .4rem}.core-ui-rte .tiptap ul li,.core-ui-rte .tiptap ol li{margin-top:.25em;margin-bottom:.25em}.core-ui-rte .tiptap .core-ui-rte ol{list-style-type:decimal}.core-ui-rte .tiptap .core-ui-rte ul{list-style-type:disc}.core-ui-rte .tiptap h1{font-size:2em;padding:0;margin:0}.core-ui-rte .tiptap h2{font-size:1.5em;padding:0;margin:0}.core-ui-rte.displace-text .tiptap{padding-right:40px}.core-ui-rte.edit-mode .tiptap{min-height:40px;max-height:var(--max-scrollable-height)}.rte-wrapper{position:relative;display:flex;flex-direction:column;height:100%;border-radius:4px;overflow:hidden;outline:1px solid var(--colors-delta-500);outline-offset:-1px}.rte-wrapper:hover{outline:2px solid var(--colors-gama-300);outline-offset:-2px}.rte-wrapper.error-state{outline:1px solid var(--colors-red-500)}.rte-wrapper.error-state:hover{outline:2px solid var(--colors-red-500)}.rte-wrapper.error-focused-state{outline:2px solid var(--colors-red-500);outline-offset:-2px}.rte-wrapper.readonly-outlined .tiptap{min-height:100px;max-height:none;overflow:hidden}.rte-wrapper.readonly-outlined{background-color:var(--colors-gray-10);outline:1px solid var(--colors-gray-200);outline-offset:-1px}.rte-wrapper.readonly-outlined:hover{outline:1px solid var(--colors-gray-200);outline-offset:-1px}.rte-wrapper.readonly-plain .tiptap{max-height:none;overflow:hidden;padding:0;margin:0}.rte-wrapper.readonly-plain{background-color:#fff;border-radius:unset;outline:none}.rte-wrapper.readonly-plain:hover{outline:none}.rte-wrapper.focused-state{outline:2px solid var(--colors-gama-400);outline-offset:-2px}.ProseMirror:focus{outline:none}._link-dialog-container_jjs9w_1{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:0;gap:24px;height:100%;margin:16px}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
2
  import t,{forwardRef as e,useRef as n,useState as r,useDebugValue as o,useEffect as i,createContext as s,useContext as a,createElement as l,useCallback as c,useLayoutEffect as d,useMemo as h,useImperativeHandle as u}from"react";import p from"react-dom";import{StyledMenuItem as f,StyledInputField as m,LinkOutlineIcon as g,StyledButton as y,DotsVerticalIcon as b,StyledDialog as v,StyledFormControl as w,StyledFormHelperText as k}from"asma-core-ui";import{Popover as x}from"@mui/material";var S,O={exports:{}},C={};
3
3
  /**
4
4
  * @license React
@@ -53,4 +53,4 @@ import t,{forwardRef as e,useRef as n,useState as r,useDebugValue as o,useEffect
53
53
  *
54
54
  * This source code is licensed under the MIT license found in the
55
55
  * LICENSE file in the root directory of this source tree.
56
- */"production"===process.env.NODE_ENV?ba.exports=function(){if(ya)return va;ya=1;var e=t,n=ha,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return va.useSyncExternalStoreWithSelector=function(t,e,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function t(t){if(!s){if(s=!0,o=t,t=c(t),void 0!==d&&u.hasValue){var e=u.value;if(d(e,t))return i=e}return i=t}if(e=i,r(o,t))return e;var n=c(t);return void 0!==d&&d(e,n)?e:(o=t,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return t(e())},null===a?void 0:function(){return t(a())}]}),[e,n,c,d]);var p=o(t,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},va}():ba.exports=(wa||(wa=1,"production"!==process.env.NODE_ENV&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=t,n=ha,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;ka.useSyncExternalStoreWithSelector=function(t,e,n,c,d){var h,u=i(null);null===u.current?(h={hasValue:!1,value:null},u.current=h):h=u.current;var p=a((function(){var t,o,i=!1,s=function(e){if(!i){i=!0,t=e;var n=c(e);if(void 0!==d&&h.hasValue){var s=h.value;if(d(s,n))return o=s,s}return o=n,n}var a=o;if(r(t,e))return a;var l=c(e);return void 0!==d&&d(a,l)?a:(t=e,o=l,l)},a=void 0===n?null:n;return[function(){return s(e())},null===a?void 0:function(){return s(a())}]}),[e,n,c,d]),f=p[0],m=p[1],g=o(t,f,m);return s((function(){h.hasValue=!0,h.value=g}),[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ka);var xa=ba.exports;class Sa{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach((t=>t()))},e=this.editor;return e.on("transaction",t),()=>{e.off("transaction",t)}}}}const Oa="production"!==process.env.NODE_ENV,Ca=typeof window>"u",Ma=Ca||!!(typeof window<"u"&&window.next);class Ta{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((t=>t()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return Ca||Ma?(Oa&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Ca&&Oa)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(e,...t)},onBlur:(...t)=>{var e,n;return null===(n=(e=this.options.current).onBlur)||void 0===n?void 0:n.call(e,...t)},onCreate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onCreate)||void 0===n?void 0:n.call(e,...t)},onDestroy:(...t)=>{var e,n;return null===(n=(e=this.options.current).onDestroy)||void 0===n?void 0:n.call(e,...t)},onFocus:(...t)=>{var e,n;return null===(n=(e=this.options.current).onFocus)||void 0===n?void 0:n.call(e,...t)},onSelectionUpdate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(e,...t)},onTransaction:(...t)=>{var e,n;return null===(n=(e=this.options.current).onTransaction)||void 0===n?void 0:n.call(e,...t)},onUpdate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onUpdate)||void 0===n?void 0:n.call(e,...t)},onContentError:(...t)=>{var e,n;return null===(n=(e=this.options.current).onContentError)||void 0===n?void 0:n.call(e,...t)}};return new ea(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?this.editor.setOptions(this.options.current):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=t);if(this.previousDeps.length===t.length&&this.previousDeps.every(((e,n)=>e===t[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===t?e&&e.setOptions(this.options.current):e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))}),1)}}function Ea(t={},e=[]){const s=n(t);s.current=t;const[a]=r((()=>new Ta(s))),l=ha.useSyncExternalStore(a.subscribe,a.getEditor,a.getServerSnapshot);return o(l),i(a.onRender(e)),function(t){const[e]=r((()=>new Sa(t.editor))),n=xa.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);i((()=>e.watch(t.editor)),[t.editor,e]),o(n)}({editor:l,selector:({transactionNumber:e})=>!1===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===e?0:e+1}),l}s({editor:null}).Consumer;const Na=s({onDragStart:void 0});t.forwardRef(((e,n)=>{const{onDragStart:r}=a(Na),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));const Aa=Object.freeze({left:0,top:0,width:16,height:16}),Da=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ra=Object.freeze({...Aa,...Da}),Ia=Object.freeze({...Ra,body:"",hidden:!1});function La(t,e){const n=function(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}(t,e);for(const r in Ia)r in Da?r in t&&!(r in n)&&(n[r]=Da[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function Pa(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let i={};function s(t){i=La(r[t]||o[t],i)}return s(e),n.forEach(s),La(t,i)}function ja(t,e){const n=[];if("object"!=typeof t||"object"!=typeof t.icons)return n;t.not_found instanceof Array&&t.not_found.forEach((t=>{e(t,null),n.push(t)}));const r=function(t,e){const n=t.icons,r=t.aliases||Object.create(null),o=Object.create(null);return(e||Object.keys(n).concat(Object.keys(r))).forEach((function t(e){if(n[e])return o[e]=[];if(!(e in o)){o[e]=null;const n=r[e]&&r[e].parent,i=n&&t(n);i&&(o[e]=[n].concat(i))}return o[e]})),o}(t);for(const o in r){const i=r[o];i&&(e(o,Pa(t,o,i)),n.push(o))}return n}const za=/^[a-z0-9]+(-[a-z0-9]+)*$/,$a=(t,e,n,r="")=>{const o=t.split(":");if("@"===t.slice(0,1)){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const t=o.pop(),n=o.pop(),i={provider:o.length>0?o[0]:r,prefix:n,name:t};return e&&!Ba(i)?null:i}const i=o[0],s=i.split("-");if(s.length>1){const t={provider:r,prefix:s.shift(),name:s.join("-")};return e&&!Ba(t)?null:t}if(n&&""===r){const t={provider:r,prefix:"",name:i};return e&&!Ba(t,n)?null:t}return null},Ba=(t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(za)||!(e&&""===t.prefix||t.prefix.match(za))||!t.name.match(za)),Fa={provider:"",aliases:{},not_found:{},...Aa};function _a(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Va(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons||!_a(t,Fa))return null;const n=e.icons;for(const t in n){const e=n[t];if(!t.match(za)||"string"!=typeof e.body||!_a(e,Ia))return null}const r=e.aliases||Object.create(null);for(const t in r){const e=r[t],o=e.parent;if(!t.match(za)||"string"!=typeof o||!n[o]&&!r[o]||!_a(e,Ia))return null}return e}const Ha=Object.create(null);function Wa(t,e){const n=Ha[t]||(Ha[t]=Object.create(null));return n[e]||(n[e]=function(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}(t,e))}function Ka(t,e){return Va(e)?ja(e,((e,n)=>{n?t.icons[e]=n:t.missing.add(e)})):[]}let qa=!1;function Ja(t){return"boolean"==typeof t&&(qa=t),qa}function Ua(t){const e="string"==typeof t?$a(t,!0,qa):t;if(e){const t=Wa(e.provider,e.prefix),n=e.name;return t.icons[n]||(t.missing.has(n)?null:void 0)}}function Ga(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),qa&&!e&&!t.prefix){let e=!1;return Va(t)&&(t.prefix="",ja(t,((t,n)=>{n&&function(t,e){const n=$a(t,!0,qa);return!!n&&function(t,e,n){try{if("string"==typeof n.body)return t.icons[e]={...n},!0}catch{}return!1}(Wa(n.provider,n.prefix),n.name,e)}(t,n)&&(e=!0)}))),e}const n=t.prefix;if(!Ba({provider:e,prefix:n,name:"a"}))return!1;return!!Ka(Wa(e,n),t)}const Ya=Object.freeze({width:null,height:null}),Qa=Object.freeze({...Ya,...Da}),Xa=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Za=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function tl(t,e,n){if(1===e)return t;if(n=n||100,"number"==typeof t)return Math.ceil(t*e*n)/n;if("string"!=typeof t)return t;const r=t.split(Xa);if(null===r||!r.length)return t;const o=[];let i=r.shift(),s=Za.test(i);for(;;){if(s){const t=parseFloat(i);isNaN(t)?o.push(i):o.push(Math.ceil(t*e*n)/n)}else o.push(i);if(i=r.shift(),void 0===i)return o.join("");s=!s}}const el=/\sid="(\S+)"/g,nl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let rl=0;function ol(t,e=nl){const n=[];let r;for(;r=el.exec(t);)n.push(r[1]);if(!n.length)return t;const o="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach((n=>{const r="function"==typeof e?e(n):e+(rl++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+r+o+"$3")})),t=t.replace(new RegExp(o,"g"),"")}const il=Object.create(null);function sl(t){return il[t]||il[""]}function al(t){let e;if("string"==typeof t.resources)e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:!0===t.random,index:t.index||0,dataAfterTimeout:!1!==t.dataAfterTimeout}}const ll=Object.create(null),cl=["https://api.simplesvg.com","https://api.unisvg.com"],dl=[];for(;cl.length>0;)1===cl.length||Math.random()>.5?dl.push(cl.shift()):dl.push(cl.pop());function hl(t,e){const n=al(e);return null!==n&&(ll[t]=n,!0)}function ul(t){return ll[t]}ll[""]=al({resources:["https://api.iconify.design"].concat(dl)});let pl=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch{}})();const fl={prepare:(t,e,n)=>{const r=[],o=function(t,e){const n=ul(t);if(!n)return 0;let r;if(n.maxURL){let t=0;n.resources.forEach((e=>{t=Math.max(t,e.length)}));const o=e+".json?icons=";r=n.maxURL-t-n.path.length-o.length}else r=0;return r}(t,e),i="icons";let s={type:i,provider:t,prefix:e,icons:[]},a=0;return n.forEach(((n,l)=>{a+=n.length+1,a>=o&&l>0&&(r.push(s),s={type:i,provider:t,prefix:e,icons:[]},a=n.length),s.icons.push(n)})),r.push(s),r},send:(t,e,n)=>{if(!pl)return void n("abort",424);let r=function(t){if("string"==typeof t){const e=ul(t);if(e)return e.path}return"/"}(e.provider);switch(e.type){case"icons":{const t=e.prefix,n=e.icons.join(",");r+=t+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const t=e.uri;r+="/"===t.slice(0,1)?t.slice(1):t;break}default:return void n("abort",400)}let o=503;pl(t+r).then((t=>{const e=t.status;if(200===e)return o=501,t.json();setTimeout((()=>{n(function(t){return 404===t}(e)?"abort":"next",e)}))})).then((t=>{"object"==typeof t&&null!==t?setTimeout((()=>{n("success",t)})):setTimeout((()=>{404===t?n("abort",t):n("next",o)}))})).catch((()=>{n("next",o)}))}};function ml(t,e){t.forEach((t=>{const n=t.loaderCallbacks;n&&(t.loaderCallbacks=n.filter((t=>t.id!==e)))}))}let gl=0;var yl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function bl(t,e,n,r){const o=t.resources.length,i=t.random?Math.floor(Math.random()*o):t.index;let s;if(t.random){let e=t.resources.slice(0);for(s=[];e.length>1;){const t=Math.floor(Math.random()*e.length);s.push(e[t]),e=e.slice(0,t).concat(e.slice(t+1))}s=s.concat(e)}else s=t.resources.slice(i).concat(t.resources.slice(0,i));const a=Date.now();let l,c="pending",d=0,h=null,u=[],p=[];function f(){h&&(clearTimeout(h),h=null)}function m(){"pending"===c&&(c="aborted"),f(),u.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),u=[]}function g(t,e){e&&(p=[]),"function"==typeof t&&p.push(t)}function y(){c="failed",p.forEach((t=>{t(void 0,l)}))}function b(){u.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),u=[]}function v(){if("pending"!==c)return;f();const r=s.shift();if(void 0===r)return u.length?void(h=setTimeout((()=>{f(),"pending"===c&&(b(),y())}),t.timeout)):void y();const o={status:"pending",resource:r,callback:(e,n)=>{!function(e,n,r){const o="success"!==n;switch(u=u.filter((t=>t!==e)),c){case"pending":break;case"failed":if(o||!t.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=r,void y();if(o)return l=r,void(u.length||(s.length?v():y()));if(f(),b(),!t.random){const n=t.resources.indexOf(e.resource);-1!==n&&n!==t.index&&(t.index=n)}c="completed",p.forEach((t=>{t(r)}))}(o,e,n)}};u.push(o),d++,h=setTimeout(v,t.rotate),n(r,e,o.callback)}return"function"==typeof r&&p.push(r),setTimeout(v),function(){return{startTime:a,payload:e,status:c,queriesSent:d,queriesPending:u.length,subscribe:g,abort:m}}}function vl(t){const e={...yl,...t};let n=[];function r(){n=n.filter((t=>"pending"===t().status))}return{query:function(t,o,i){const s=bl(e,t,o,((t,e)=>{r(),i&&i(t,e)}));return n.push(s),s},find:function(t){return n.find((e=>t(e)))||null},setIndex:t=>{e.index=t},getIndex:()=>e.index,cleanup:r}}function wl(){}const kl=Object.create(null);function xl(t,e,n){let r,o;if("string"==typeof t){const e=sl(t);if(!e)return n(void 0,424),wl;o=e.send;const i=function(t){if(!kl[t]){const e=ul(t);if(!e)return;const n={config:e,redundancy:vl(e)};kl[t]=n}return kl[t]}(t);i&&(r=i.redundancy)}else{const e=al(t);if(e){r=vl(e);const n=sl(t.resources?t.resources[0]:"");n&&(o=n.send)}}return r&&o?r.query(e,o,n)().abort:(n(void 0,424),wl)}const Sl="iconify2",Ol="iconify",Cl=Ol+"-count",Ml=Ol+"-version",Tl=36e5,El=168,Nl=50;function Al(t,e){try{return t.getItem(e)}catch{}}function Dl(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Rl(t,e){try{t.removeItem(e)}catch{}}function Il(t,e){return Dl(t,Cl,e.toString())}function Ll(t){return parseInt(Al(t,Cl))||0}const Pl={local:!0,session:!0},jl={local:new Set,session:new Set};let zl=!1;let $l=typeof window>"u"?{}:window;function Bl(t){const e=t+"Storage";try{if($l&&$l[e]&&"number"==typeof $l[e].length)return $l[e]}catch{}Pl[t]=!1}function Fl(t,e){const n=Bl(t);if(!n)return;const r=Al(n,Ml);if(r!==Sl){if(r){const t=Ll(n);for(let e=0;e<t;e++)Rl(n,Ol+e.toString())}return Dl(n,Ml,Sl),void Il(n,0)}const o=Math.floor(Date.now()/Tl)-El,i=t=>{const r=Ol+t.toString(),i=Al(n,r);if("string"==typeof i){try{const n=JSON.parse(i);if("object"==typeof n&&"number"==typeof n.cached&&n.cached>o&&"string"==typeof n.provider&&"object"==typeof n.data&&"string"==typeof n.data.prefix&&e(n,t))return!0}catch{}Rl(n,r)}};let s=Ll(n);for(let e=s-1;e>=0;e--)i(e)||(e===s-1?(s--,Il(n,s)):jl[t].add(e))}function _l(){if(!zl){zl=!0;for(const t in Pl)Fl(t,(t=>{const e=t.data,n=Wa(t.provider,e.prefix);if(!Ka(n,e).length)return!1;const r=e.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,r):r,!0}))}}function Vl(t,e){function n(n){let r;if(!Pl[n]||!(r=Bl(n)))return;const o=jl[n];let i;if(o.size)o.delete(i=Array.from(o).shift());else if(i=Ll(r),i>=Nl||!Il(r,i+1))return;const s={cached:Math.floor(Date.now()/Tl),provider:t.provider,data:e};return Dl(r,Ol+i.toString(),JSON.stringify(s))}zl||_l(),e.lastModified&&!function(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const n in Pl)Fl(n,(n=>{const r=n.data;return n.provider!==t.provider||r.prefix!==t.prefix||r.lastModified===e}));return!0}(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&delete(e=Object.assign({},e)).not_found,n("local")||n("session"))}function Hl(){}function Wl(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout((()=>{t.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout((()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const r=t.provider,o=t.prefix;e.forEach((e=>{const i=e.icons,s=i.pending.length;i.pending=i.pending.filter((e=>{if(e.prefix!==o)return!0;const s=e.name;if(t.icons[s])i.loaded.push({provider:r,prefix:o,name:s});else{if(!t.missing.has(s))return n=!0,!0;i.missing.push({provider:r,prefix:o,name:s})}return!1})),i.pending.length!==s&&(n||ml([t],e.id),e.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),e.abort))}))})))}(t)})))}const Kl=(t,e)=>{const n=function(t,e=!0,n=!1){const r=[];return t.forEach((t=>{const o="string"==typeof t?$a(t,e,n):t;o&&r.push(o)})),r}(t,!0,Ja()),r=function(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort(((t,e)=>t.provider!==e.provider?t.provider.localeCompare(e.provider):t.prefix!==e.prefix?t.prefix.localeCompare(e.prefix):t.name.localeCompare(e.name)));let r={provider:"",prefix:"",name:""};return t.forEach((t=>{if(r.name===t.name&&r.prefix===t.prefix&&r.provider===t.provider)return;r=t;const o=t.provider,i=t.prefix,s=t.name,a=n[o]||(n[o]=Object.create(null)),l=a[i]||(a[i]=Wa(o,i));let c;c=s in l.icons?e.loaded:""===i||l.missing.has(s)?e.missing:e.pending;const d={provider:o,prefix:i,name:s};c.push(d)})),e}(n);if(!r.pending.length){let t=!0;return e&&setTimeout((()=>{t&&e(r.loaded,r.missing,r.pending,Hl)})),()=>{t=!1}}const o=Object.create(null),i=[];let s,a;return r.pending.forEach((t=>{const{provider:e,prefix:n}=t;if(n===a&&e===s)return;s=e,a=n,i.push(Wa(e,n));const r=o[e]||(o[e]=Object.create(null));r[n]||(r[n]=[])})),r.pending.forEach((t=>{const{provider:e,prefix:n,name:r}=t,i=Wa(e,n),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),o[e][n].push(r))})),i.forEach((t=>{const{provider:e,prefix:n}=t;o[e][n].length&&function(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout((()=>{t.iconsQueueFlag=!1;const{provider:e,prefix:n}=t,r=t.iconsToLoad;let o;delete t.iconsToLoad,r&&(o=sl(e))&&o.prepare(e,n,r).forEach((n=>{xl(e,n,(e=>{if("object"!=typeof e)n.icons.forEach((e=>{t.missing.add(e)}));else try{const n=Ka(t,e);if(!n.length)return;const r=t.pendingIcons;r&&n.forEach((t=>{r.delete(t)})),Vl(t,e)}catch(t){console.error(t)}Wl(t)}))}))})))}(t,o[e][n])})),e?function(t,e,n){const r=gl++,o=ml.bind(null,n,r);if(!e.pending.length)return o;const i={id:r,icons:e,callback:t,abort:o};return n.forEach((t=>{(t.loaderCallbacks||(t.loaderCallbacks=[])).push(i)})),o}(e,r,i):Hl};const ql=/[\s,]+/;function Jl(t,e){e.split(ql).forEach((e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}}))}function Ul(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function r(t){for(;t<0;)t+=4;return t%4}if(""===n){const e=parseInt(t);return isNaN(e)?0:r(e)}if(n!==t){let e=0;switch(n){case"%":e=25;break;case"deg":e=90}if(e){let o=parseFloat(t.slice(0,t.length-n.length));return isNaN(o)?0:(o/=e,o%1==0?r(o):0)}}return e}function Gl(t){return'url("'+function(t){return"data:image/svg+xml,"+function(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(t)}(t)+'")'}let Yl;function Ql(t){return void 0===Yl&&function(){try{Yl=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{Yl=null}}(),Yl?Yl.createHTML(t):t}const Xl={...Qa,inline:!1},Zl={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},tc={display:"inline-block"},ec={backgroundColor:"currentColor"},nc={backgroundColor:"transparent"},rc={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},oc={WebkitMask:ec,mask:ec,background:nc};for(const t in oc){const e=oc[t];for(const n in rc)e[t+n]=rc[n]}const ic={...Xl,inline:!0};function sc(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const ac=(t,e,n)=>{const r=e.inline?ic:Xl,o=function(t,e){const n={...t};for(const t in e){const r=e[t],o=typeof r;t in Ya?(null===r||r&&("string"===o||"number"===o))&&(n[t]=r):o===typeof n[t]&&(n[t]="rotate"===t?r%4:r)}return n}(r,e),i=e.mode||"svg",s={},a=e.style||{},c={..."svg"===i?Zl:{}};if(n){const t=$a(n,!1,!0);if(t){const e=["iconify"],n=["provider","prefix"];for(const r of n)t[r]&&e.push("iconify--"+t[r]);c.className=e.join(" ")}}for(let t in e){const n=e[t];if(void 0!==n)switch(t){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":c.ref=n;break;case"className":c[t]=(c[t]?c[t]+" ":"")+n;break;case"inline":case"hFlip":case"vFlip":o[t]=!0===n||"true"===n||1===n;break;case"flip":"string"==typeof n&&Jl(o,n);break;case"color":s.color=n;break;case"rotate":"string"==typeof n?o[t]=Ul(n):"number"==typeof n&&(o[t]=n);break;case"ariaHidden":case"aria-hidden":!0!==n&&"true"!==n&&delete c["aria-hidden"];break;default:void 0===r[t]&&(c[t]=n)}}const d=function(t,e){const n={...Ra,...t},r={...Qa,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach((t=>{const e=[],n=t.hFlip,r=t.vFlip;let s,a=t.rotate;switch(n?r?a+=2:(e.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),e.push("scale(-1 1)"),o.top=o.left=0):r&&(e.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),e.push("scale(1 -1)"),o.top=o.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:s=o.height/2+o.top,e.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:e.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:s=o.width/2+o.left,e.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}a%2==1&&(o.left!==o.top&&(s=o.left,o.left=o.top,o.top=s),o.width!==o.height&&(s=o.width,o.width=o.height,o.height=s)),e.length&&(i=function(t,e,n){const r=function(t,e="defs"){let n="";const r=t.indexOf("<"+e);for(;r>=0;){const o=t.indexOf(">",r),i=t.indexOf("</"+e);if(-1===o||-1===i)break;const s=t.indexOf(">",i);if(-1===s)break;n+=t.slice(o+1,i).trim(),t=t.slice(0,r).trim()+t.slice(s+1)}return{defs:n,content:t}}(t);return function(t,e){return t?"<defs>"+t+"</defs>"+e:e}(r.defs,e+r.content+n)}(i,'<g transform="'+e.join(" ")+'">',"</g>"))}));const s=r.width,a=r.height,l=o.width,c=o.height;let d,h;null===s?(h=null===a?"1em":"auto"===a?c:a,d=tl(h,l/c)):(d="auto"===s?l:s,h=null===a?tl(d,c/l):"auto"===a?c:a);const u={},p=(t,e)=>{(t=>"unset"===t||"undefined"===t||"none"===t)(e)||(u[t]=e.toString())};p("width",d),p("height",h);const f=[o.left,o.top,l,c];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:i}}(t,o),h=d.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===i){c.style={...s,...a},Object.assign(c,h);let t=0,n=e.id;return"string"==typeof n&&(n=n.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:Ql(ol(d.body,n?()=>n+"ID"+t++:"iconifyReact"))},l("svg",c)}const{body:u,width:p,height:f}=t,m="mask"===i||"bg"!==i&&-1!==u.indexOf("currentColor"),g=function(t,e){let n=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)n+=" "+t+'="'+e[t]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}(u,{...h,width:p+"",height:f+""});return c.style={...s,"--svg":Gl(g),width:sc(h.width),height:sc(h.height),...tc,...m?ec:nc,...a},l("span",c)};var lc;if(Ja(!0),lc=fl,il[""]=lc,typeof document<"u"&&typeof window<"u"){_l();const t=window;if(void 0!==t.IconifyPreload){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof e&&null!==e&&(e instanceof Array?e:[e]).forEach((t=>{try{("object"!=typeof t||null===t||t instanceof Array||"object"!=typeof t.icons||"string"!=typeof t.prefix||!Ga(t))&&console.error(n)}catch{console.error(n)}}))}if(void 0!==t.IconifyProviders){const e=t.IconifyProviders;if("object"==typeof e&&null!==e)for(let t in e){const n="IconifyProviders["+t+"] is invalid.";try{const r=e[t];if("object"!=typeof r||!r||void 0===r.resources)continue;hl(t,r)||console.error(n)}catch{console.error(n)}}}}function cc(t){const[e,n]=r(!!t.ssr),[o,s]=r({});const[a,c]=r(function(e){if(e){const e=t.icon;if("object"==typeof e)return{name:"",data:e};const n=Ua(e);if(n)return{name:e,data:n}}return{name:""}}(!!t.ssr));function d(){const t=o.callback;t&&(t(),s({}))}function h(t){if(JSON.stringify(a)!==JSON.stringify(t))return d(),c(t),!0}function u(){var e;const n=t.icon;if("object"==typeof n)return void h({name:"",data:n});const r=Ua(n);if(h({name:n,data:r}))if(void 0===r){const t=Kl([n],u);s({callback:t})}else r&&(null===(e=t.onLoad)||void 0===e||e.call(t,n))}i((()=>(n(!0),d)),[]),i((()=>{e&&u()}),[t.icon,e]);const{name:p,data:f}=a;return f?ac({...Ra,...f},t,p):t.children?t.children:l("span",{})}const dc=e(((t,e)=>cc({...t,_ref:e})));e(((t,e)=>cc({inline:!0,...t,_ref:e})));const hc=t=>E.jsx(f,{...t,sx:{"&.MuiMenuItem-root":{color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"}},children:t.children}),uc={small:"10px",normal:"16px",large:"24px",huge:"32px"},pc=t=>{const{editor:e}=t,[n,o]=r("normal");return d((()=>{const{from:t,to:n}=e.state.selection;e.state.doc.nodesBetween(t-1,n,(t=>{if(t.marks){const e=t.marks.find((t=>"textStyle"===t.type.name)),n=null==e?void 0:e.attrs.fontSize,r=Object.keys(uc).find((t=>uc[t]===n))||"normal";o(r)}}))}),[e.state.selection,e.state.doc]),E.jsx(m,{...t,select:!0,size:"small",dataTest:"font-size-select",onChange:t=>{const n=t.target.value;e.chain().focus().setMark("textStyle",{fontSize:uc[n]}).run(),o(n)},value:n,SelectProps:{IconComponent:()=>null},InputProps:{endAdornment:E.jsx(dc,{icon:"tabler:caret-up-down-filled",className:"chevron-icon"})},sx:{".MuiSelect-select":{border:"none",padding:0,overflow:"hidden",display:"flex",alignItems:"center",color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"},".MuiOutlinedInput-root":{height:"32px",width:"75px","& .MuiOutlinedInput-notchedOutline":{border:"none"}}},children:t.children})},fc=({editor:t,onClose:e,error:o,focused:i,openLinkDialog:s,locale:a})=>{const[l,u]=r(0),p=n(null),m=h((()=>"no"===a),[a]),[v,w]=r(!1),[k,S]=r([]);d((()=>{const e=new ResizeObserver((()=>{var e;if(p.current){const n=p.current.clientWidth;w(n<(m?416:420));const r=null==(e=[{width:m?296:300,buttons:3},{width:m?340:342,buttons:4},{width:m?374:378,buttons:5},{width:m?416:420,buttons:6},{width:m?416:420,buttons:7},{width:1/0,buttons:8}].find((t=>n<t.width)))?void 0:e.buttons;u(void 0!==r?r:8);const o=[];Number(r)<8&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:s,selected:t.isActive("link"),children:E.jsx(g,{})},"link")),Number(r)<7&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleItalic().run(),selected:t.isActive("italic"),children:E.jsx(dc,{icon:"material-symbols:format-italic",height:20})},"italic")),Number(r)<6&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBold().run(),selected:t.isActive("bold"),children:E.jsx(dc,{icon:"ooui:bold-b"})},"bold")),Number(r)<5&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleOrderedList().run(),selected:t.isActive("orderedList"),children:E.jsx(dc,{icon:"mdi:format-list-numbered",fontSize:20})},"ordered")),Number(r)<4&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBulletList().run(),selected:t.isActive("bulletList"),children:E.jsx(dc,{icon:"mdi:format-list-bulleted",fontSize:20})},"bullet")),S(o)}}));return p.current&&e.observe(p.current),()=>e.disconnect()}),[t,s,m]);const{anchorEl:O,open:C,handleClose:M,handleOpen:T}=(()=>{const[t,e]=r(null),n=!!t,o=c((t=>{e(t.currentTarget)}),[]);return{open:n,handleClose:c((()=>{e(null)}),[]),handleOpen:o,anchorEl:t}})();return E.jsx(E.Fragment,{children:E.jsxs("div",{className:A("toolbar",{"toolbar-error":o,"toolbar-focused":i}),ref:p,children:[E.jsxs("div",{className:"flex flex-row items-center gap-1",children:[l>=1&&E.jsx(y,{dataTest:"richeditor-h1-button",size:"small",variant:t.isActive("heading",{level:1})?"text":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().toggleHeading({level:1}).run()},children:E.jsx(dc,{icon:"bi:type-h1"})}),l>=2&&E.jsx(y,{dataTest:"richeditor-h2-button",size:"small",variant:t.isActive("heading",{level:2})?"text":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().toggleHeading({level:2}).run()},children:E.jsx(dc,{icon:"bi:type-h2"})}),l>=3&&E.jsxs(pc,{editor:t,children:[E.jsx(hc,{value:"small",children:m?"Liten":"Small"}),E.jsx(hc,{value:"normal",children:"Normal"}),E.jsx(hc,{value:"large",children:m?"Stor":"Large"}),E.jsx(hc,{value:"huge",children:m?"Enorm":"Huge"})]}),l>=4&&E.jsx(y,{dataTest:"richeditor-bullet-list-button",size:"small",variant:t.isActive("bulletList")?"text":"textGray",onClick:()=>t.chain().focus().toggleBulletList().run(),children:E.jsx(dc,{icon:"mdi:format-list-bulleted",fontSize:20})}),l>=5&&E.jsx(y,{dataTest:"richeditor-ordered-list-button",size:"small",variant:t.isActive("orderedList")?"text":"textGray",onClick:()=>t.chain().focus().toggleOrderedList().run(),children:E.jsx(dc,{icon:"mdi:format-list-numbered",fontSize:20})}),l>=6&&E.jsx(y,{dataTest:"richeditor-bold-button",size:"small",variant:t.isActive("bold")?"text":"textGray",onClick:()=>t.chain().focus().toggleBold().run(),children:E.jsx(dc,{icon:"ooui:bold-b"})}),l>=7&&E.jsx(y,{dataTest:"richeditor-italic-button",size:"small",variant:t.isActive("italic")?"text":"textGray",onClick:()=>t.chain().focus().toggleItalic().run(),children:E.jsx(dc,{icon:"material-symbols:format-italic",height:20})}),l>=8&&E.jsx(y,{dataTest:"richeditor-link-button",size:"small",variant:t.isActive("link")?"text":"textGray",onClick:s,children:E.jsx(g,{})}),v&&E.jsxs(E.Fragment,{children:[E.jsx(y,{size:"small",dataTest:"richeditor-more-menu-button",variant:"text",onClick:t=>{t.stopPropagation(),t.preventDefault(),T(t)},onMouseDown:t=>{t.stopPropagation(),t.preventDefault()},onMouseUp:t=>{t.stopPropagation(),t.preventDefault()},children:E.jsx(b,{className:"text-delta-800",width:20,height:20})}),E.jsx(x,{open:C,anchorEl:O,onClose:M,onClick:M,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:k})]})]}),E.jsx(y,{dataTest:"richeditor-close-toolbar-button",size:"small",variant:"text",onClick:e,children:m?"Lukk":"Close"})]})})},mc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vc=ls.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[na({find:mc,type:this.type}),na({find:yc,type:this.type})]},addPasteRules(){return[ia({find:gc,type:this.type}),ia({find:bc,type:this.type})]}}),wc=oa.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Ki(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),kc=ls.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ls(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),xc=/^\s*([-+*])\s$/,Sc=oa.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wc.name,this.editor.getAttributes(kc.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ra({find:xc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ra({find:xc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(kc.name),editor:this.editor})),[t]}}),Oc=oa.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ki(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>function(t){return new es({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Ui(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}}),Cc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Mc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Tc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Ec=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Nc=ls.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[na({find:Cc,type:this.type}),na({find:Tc,type:this.type})]},addPasteRules(){return[ia({find:Mc,type:this.type}),ia({find:Ec,type:this.type})]}}),Ac="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Dc="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Rc=(t,e)=>{for(const n in e)t[n]=e[n];return t},Ic="numeric",Lc="ascii",Pc="alpha",jc="asciinumeric",zc="alphanumeric",$c="domain",Bc="emoji",Fc="scheme",_c="slashscheme",Vc="whitespace";function Hc(t,e){return t in e||(e[t]=[]),e[t]}function Wc(t,e,n){e[Ic]&&(e[jc]=!0,e[zc]=!0),e[Lc]&&(e[jc]=!0,e[Pc]=!0),e[jc]&&(e[zc]=!0),e[Pc]&&(e[zc]=!0),e[zc]&&(e[$c]=!0),e[Bc]&&(e[$c]=!0);for(const r in e){const e=Hc(r,n);e.indexOf(t)<0&&e.push(t)}}function Kc(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Kc.groups={},Kc.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e){return void 0===e&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||Kc.groups,e&&e.j?o=e:(o=new Kc(e),n&&r&&Wc(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let e=0;e<i-1;e++)o=o.tt(t[e]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||Kc.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new Kc,Rc(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Kc,i){if(r)if(s.t&&"string"==typeof s.t){const t=Rc(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);Wc(i,t,r)}else n&&Wc(i,n,r);s.t=i}return o.j[t]=s,s}};const qc=(t,e,n,r,o)=>t.ta(e,n,r,o),Jc=(t,e,n,r,o)=>t.tr(e,n,r,o),Uc=(t,e,n,r,o)=>t.ts(e,n,r,o),Gc=(t,e,n,r,o)=>t.tt(e,n,r,o),Yc="WORD",Qc="UWORD",Xc="LOCALHOST",Zc="TLD",td="UTLD",ed="SCHEME",nd="SLASH_SCHEME",rd="NUM",od="WS",id="NL",sd="OPENBRACE",ad="CLOSEBRACE",ld="OPENBRACKET",cd="CLOSEBRACKET",dd="OPENPAREN",hd="CLOSEPAREN",ud="OPENANGLEBRACKET",pd="CLOSEANGLEBRACKET",fd="FULLWIDTHLEFTPAREN",md="FULLWIDTHRIGHTPAREN",gd="LEFTCORNERBRACKET",yd="RIGHTCORNERBRACKET",bd="LEFTWHITECORNERBRACKET",vd="RIGHTWHITECORNERBRACKET",wd="FULLWIDTHLESSTHAN",kd="FULLWIDTHGREATERTHAN",xd="AMPERSAND",Sd="APOSTROPHE",Od="ASTERISK",Cd="AT",Md="BACKSLASH",Td="BACKTICK",Ed="CARET",Nd="COLON",Ad="COMMA",Dd="DOLLAR",Rd="DOT",Id="EQUALS",Ld="EXCLAMATION",Pd="HYPHEN",jd="PERCENT",zd="PIPE",$d="PLUS",Bd="POUND",Fd="QUERY",_d="QUOTE",Vd="SEMI",Hd="SLASH",Wd="TILDE",Kd="UNDERSCORE",qd="EMOJI",Jd="SYM";var Ud=Object.freeze({__proto__:null,WORD:Yc,UWORD:Qc,LOCALHOST:Xc,TLD:Zc,UTLD:td,SCHEME:ed,SLASH_SCHEME:nd,NUM:rd,WS:od,NL:id,OPENBRACE:sd,CLOSEBRACE:ad,OPENBRACKET:ld,CLOSEBRACKET:cd,OPENPAREN:dd,CLOSEPAREN:hd,OPENANGLEBRACKET:ud,CLOSEANGLEBRACKET:pd,FULLWIDTHLEFTPAREN:fd,FULLWIDTHRIGHTPAREN:md,LEFTCORNERBRACKET:gd,RIGHTCORNERBRACKET:yd,LEFTWHITECORNERBRACKET:bd,RIGHTWHITECORNERBRACKET:vd,FULLWIDTHLESSTHAN:wd,FULLWIDTHGREATERTHAN:kd,AMPERSAND:xd,APOSTROPHE:Sd,ASTERISK:Od,AT:Cd,BACKSLASH:Md,BACKTICK:Td,CARET:Ed,COLON:Nd,COMMA:Ad,DOLLAR:Dd,DOT:Rd,EQUALS:Id,EXCLAMATION:Ld,HYPHEN:Pd,PERCENT:jd,PIPE:zd,PLUS:$d,POUND:Bd,QUERY:Fd,QUOTE:_d,SEMI:Vd,SLASH:Hd,TILDE:Wd,UNDERSCORE:Kd,EMOJI:qd,SYM:Jd});const Gd=/[a-z]/,Yd=/\p{L}/u,Qd=/\p{Emoji}/u,Xd=/\d/,Zd=/\s/,th="\n",eh="️",nh="‍";let rh=null,oh=null;function ih(t,e,n,r,o){let i;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?i=t.j[s]:(i=new Kc(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new Kc(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function sh(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const ah={defaultProtocol:"http",events:null,format:ch,formatHref:ch,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lh(t,e){void 0===e&&(e=null);let n=Rc({},ah);t&&(n=Rc(n,t instanceof lh?t.o:t));const r=n.ignoreTags,o=[];for(let t=0;t<r.length;t++)o.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function ch(t){return t}function dh(t,e){this.t="token",this.v=t,this.tk=e}function hh(t,e){class n extends dh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}lh.prototype={o:ah,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o&&("object"==typeof o?(o=n.t in o?o[n.t]:ah[t],"function"==typeof o&&r&&(o=o(e,n))):"function"==typeof o&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},dh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=ah.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Rc(s,d),{tagName:o,attributes:s,content:i,eventListeners:h}}};const uh=hh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ph=hh("text"),fh=hh("nl"),mh=hh("url",{isLink:!0,toHref(t){return void 0===t&&(t=ah.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Xc&&t[1].t===Nd}}),gh=t=>new Kc(t);function yh(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const bh=typeof console<"u"&&console&&console.warn||(()=>{}),vh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function wh(t,e){if(void 0===e&&(e=!1),vh.initialized&&bh(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');vh.customSchemes.push([t,e])}function kh(){vh.scanner=function(t){void 0===t&&(t=[]);const e={};Kc.groups=e;const n=new Kc;null==rh&&(rh=sh(Ac)),null==oh&&(oh=sh(Dc)),Gc(n,"'",Sd),Gc(n,"{",sd),Gc(n,"}",ad),Gc(n,"[",ld),Gc(n,"]",cd),Gc(n,"(",dd),Gc(n,")",hd),Gc(n,"<",ud),Gc(n,">",pd),Gc(n,"(",fd),Gc(n,")",md),Gc(n,"「",gd),Gc(n,"」",yd),Gc(n,"『",bd),Gc(n,"』",vd),Gc(n,"<",wd),Gc(n,">",kd),Gc(n,"&",xd),Gc(n,"*",Od),Gc(n,"@",Cd),Gc(n,"`",Td),Gc(n,"^",Ed),Gc(n,":",Nd),Gc(n,",",Ad),Gc(n,"$",Dd),Gc(n,".",Rd),Gc(n,"=",Id),Gc(n,"!",Ld),Gc(n,"-",Pd),Gc(n,"%",jd),Gc(n,"|",zd),Gc(n,"+",$d),Gc(n,"#",Bd),Gc(n,"?",Fd),Gc(n,'"',_d),Gc(n,"/",Hd),Gc(n,";",Vd),Gc(n,"~",Wd),Gc(n,"_",Kd),Gc(n,"\\",Md);const r=Jc(n,Xd,rd,{[Ic]:!0});Jc(r,Xd,r);const o=Jc(n,Gd,Yc,{[Lc]:!0});Jc(o,Gd,o);const i=Jc(n,Yd,Qc,{[Pc]:!0});Jc(i,Gd),Jc(i,Yd,i);const s=Jc(n,Zd,od,{[Vc]:!0});Gc(n,th,id,{[Vc]:!0}),Gc(s,th),Jc(s,Zd,s);const a=Jc(n,Qd,qd,{[Bc]:!0});Jc(a,Qd,a),Gc(a,eh,a);const l=Gc(a,nh);Jc(l,Qd,a);const c=[[Gd,o]],d=[[Gd,null],[Yd,i]];for(let t=0;t<rh.length;t++)ih(n,rh[t],Zc,Yc,c);for(let t=0;t<oh.length;t++)ih(n,oh[t],td,Qc,d);Wc(Zc,{tld:!0,ascii:!0},e),Wc(td,{utld:!0,alpha:!0},e),ih(n,"file",ed,Yc,c),ih(n,"mailto",ed,Yc,c),ih(n,"http",nd,Yc,c),ih(n,"https",nd,Yc,c),ih(n,"ftp",nd,Yc,c),ih(n,"ftps",nd,Yc,c),Wc(ed,{scheme:!0,ascii:!0},e),Wc(nd,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],o=t[e][1]?{[Fc]:!0}:{[_c]:!0};r.indexOf("-")>=0?o[$c]=!0:Gd.test(r)?Xd.test(r)?o[jc]=!0:o[Lc]=!0:o[Ic]=!0,Uc(n,r,r,o)}return Uc(n,"localhost",Xc,{ascii:!0}),n.jd=new Kc(Jd),{start:n,tokens:Rc({groups:e},Ud)}}(vh.customSchemes);for(let t=0;t<vh.tokenQueue.length;t++)vh.tokenQueue[t][1]({scanner:vh.scanner});vh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([xd,Od,Cd,Md,Td,Ed,Dd,Id,Pd,rd,jd,zd,$d,Bd,Hd,Jd,Wd,Kd]),r=[Sd,Nd,Ad,Rd,Ld,Fd,_d,Vd,ud,pd,sd,ad,cd,ld,dd,hd,fd,md,gd,yd,bd,vd,wd,kd],o=[xd,Sd,Od,Md,Td,Ed,Dd,Id,Pd,sd,ad,jd,zd,$d,Bd,Fd,Hd,Jd,Wd,Kd],i=gh(),s=Gc(i,Wd);qc(s,o,s),qc(s,e.domain,s);const a=gh(),l=gh(),c=gh();qc(i,e.domain,a),qc(i,e.scheme,l),qc(i,e.slashscheme,c),qc(a,o,s),qc(a,e.domain,a);const d=Gc(a,Cd);Gc(s,Cd,d),Gc(l,Cd,d),Gc(c,Cd,d);const h=Gc(s,Rd);qc(h,o,s),qc(h,e.domain,s);const u=gh();qc(d,e.domain,u),qc(u,e.domain,u);const p=Gc(u,Rd);qc(p,e.domain,u);const f=gh(uh);qc(p,e.tld,f),qc(p,e.utld,f),Gc(d,Xc,f);const m=Gc(u,Pd);qc(m,e.domain,u),qc(f,e.domain,u),Gc(f,Rd,p),Gc(f,Pd,m);const g=Gc(f,Nd);qc(g,e.numeric,uh);const y=Gc(a,Pd),b=Gc(a,Rd);qc(y,e.domain,a),qc(b,o,s),qc(b,e.domain,a);const v=gh(mh);qc(b,e.tld,v),qc(b,e.utld,v),qc(v,e.domain,a),qc(v,o,s),Gc(v,Rd,b),Gc(v,Pd,y),Gc(v,Cd,d);const w=Gc(v,Nd),k=gh(mh);qc(w,e.numeric,k);const x=gh(mh),S=gh();qc(x,n,x),qc(x,r,S),qc(S,n,x),qc(S,r,S),Gc(v,Hd,x),Gc(k,Hd,x);const O=Gc(l,Nd),C=Gc(c,Nd),M=Gc(C,Hd),T=Gc(M,Hd);qc(l,e.domain,a),Gc(l,Rd,b),Gc(l,Pd,y),qc(c,e.domain,a),Gc(c,Rd,b),Gc(c,Pd,y),qc(O,e.domain,x),Gc(O,Hd,x),qc(T,e.domain,x),qc(T,n,x),Gc(T,Hd,x);const E=[[sd,ad],[ld,cd],[dd,hd],[ud,pd],[fd,md],[gd,yd],[bd,vd],[wd,kd]];for(let t=0;t<E.length;t++){const[e,o]=E[t],i=Gc(x,e);Gc(S,e,i),Gc(i,o,x);const s=gh(mh);qc(i,n,s);const a=gh();qc(i,r),qc(s,n,s),qc(s,r,a),qc(a,n,s),qc(a,r,a),Gc(s,o,x),Gc(a,o,x)}return Gc(i,Xc,v),Gc(i,id,fh),{start:i,tokens:Ud}}(vh.scanner.tokens);for(let t=0;t<vh.pluginQueue.length;t++)vh.pluginQueue[t][1]({scanner:vh.scanner,parser:vh.parser});vh.initialized=!0}function xh(t){return vh.initialized||kh(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,d=0,h=null,u=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(yh(ph,e,s)),s=[]),o-=u,d-=u;const t=h.t,r=n.slice(o-d,o);i.push(yh(t,e,r))}}return s.length>0&&i.push(yh(ph,e,s)),i}(vh.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,d=null,h=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=n[s].length,u++),c+=n[s].length,i+=n[s].length,s++;i-=h,s-=u,c-=h,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}(vh.scanner.start,t))}function Sh(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new lh(n),o=xh(t),i=[];for(let t=0;t<o.length;t++){const n=o[t];n.isLink&&(!e||n.t===e)&&r.check(n)&&i.push(n.toFormattedObject(r))}return i}function Oh(t){return new Ue({key:new Qe("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new Te(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]);return function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),l=e.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),zs(r)}(a).forEach((({newRange:e})=>{const n=function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,e,(t=>t.isTextblock));let o,i;if(n.length>1?(o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(e.from,e.to," "," ").endsWith(" ")&&(o=n[0],i=r.doc.textBetween(o.pos,e.to,void 0," ")),o&&i){const e=i.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],a=o.pos+i.lastIndexOf(n);if(!n)return!1;const l=xh(n).map((e=>e.toObject(t.defaultProtocol)));if(!function(t){return 1===t.length?t[0].isLink:!(3!==t.length||!t[1].isLink)&&["()","[]"].includes(t[0].value+t[2].value)}(l))return!1;l.filter((t=>t.isLink)).map((t=>({...t,from:a+t.start+1,to:a+t.end+1}))).filter((t=>!r.schema.marks.code||!r.doc.rangeHasMark(t.from,t.to,r.schema.marks.code))).filter((e=>t.validate(e.value))).forEach((e=>{$s(e.from,e.to,r.doc).some((e=>e.mark.type===t.type))||s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Ch=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Mh(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme;e&&n.push(e)})),!t||t.replace(Ch,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Th=ls.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?wh(t.scheme,t.optionalSlashes):wh(t)}))},onDestroy(){Kc.groups={},vh.scanner=null,vh.parser=null,vh.tokenQueue=[],vh.pluginQueue=[],vh.customSchemes=[],vh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!Mh(e,this.options.protocols))&&null}}]},renderHTML({HTMLAttributes:t}){return Mh(t.href,this.options.protocols)?["a",Ki(this.options.HTMLAttributes,t),0]:["a",Ki(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ia({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=Sh(t).filter((t=>t.isLink&&n(t.value)));r.length&&r.forEach((t=>e.push({text:t.value,data:{href:t.href},index:t.start})))}return e},type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(Oh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),!0===this.options.openOnClick&&t.push(function(t){return new Ue({key:new Qe("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(0!==r.button||!e.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find((t=>"A"===t.nodeName)))return!1;const l=js(e.state,t.type.name),c=r.target,d=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:l.href,h=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:l.target;return!(!c||!d||(window.open(d,h),0))}}})}({type:this.type})),this.options.linkOnPaste&&t.push(function(t){return new Ue({key:new Qe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const l=Sh(a,{defaultProtocol:t.defaultProtocol}).find((t=>t.isLink&&t.value===a));return!(!a||!l||(t.editor.commands.setMark(t.type,{href:l.href}),0))}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Eh=oa.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Ki(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Nh=oa.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Ki(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ah=ls.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ls(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),Dh=/^(\d+)\.\s$/,Rh=oa.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return 1===e?["ol",Ki(this.options.HTMLAttributes,n),0]:["ol",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Nh.name,this.editor.getAttributes(Ah.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ra({find:Dh,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ra({find:Dh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Ah.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),Ih=oa.create({name:"doc",topNode:!0,content:"block+"}),Lh=oa.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ph=oa.create({name:"text",group:"inline"}),jh=ls.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ls(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}});var zh=ps.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(t){return t.style.fontSize.replace(/['"]+/g,"")},renderHTML:function(t){return t.fontSize?{style:"font-size: "+t.fontSize}:{}}}}}]},addCommands:function(){return{setFontSize:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:t}).run()}},unsetFontSize:function(){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}});const $h=[Ih,Lh,Ph,jh],Bh=[Oc.configure({levels:[1,2]}),Eh,Sc,Rh,Th,vc,Nc,zh],Fh=({open:t,setOpen:e,editor:n,locale:o})=>{const[i,s]=r(""),a=h((()=>"no"===o),[o]);d((()=>{if(t){const{from:t,to:e}=n.state.selection;let r=null;n.state.doc.nodesBetween(t-1,e,(t=>{if(t.marks){const e=t.marks.find((t=>"link"===t.type.name));e&&(r=e.attrs.href)}})),s(r||"");const o=document.querySelector('[data-test="link-input-field"]');null==o||o.focus()}}),[t,n]);return E.jsx(v,{open:t,dataTest:"link-modal-rte",onClose:()=>e(!1),className:"z-[99]",dialogTitle:E.jsx("div",{className:"text-gray-700",children:a?"Legg til lenke":"Add link"}),children:E.jsxs("main",{className:"flex flex-col items-start justify-center p-0 gap-6 m-4 h-full",children:[E.jsx("div",{className:"link-input-field",children:E.jsx(m,{autoFocus:!0,multiline:!0,className:"w-full",dataTest:"link-input-field",size:"small",sx:{"& .MuiInputBase-root":{minHeight:64,alignItems:"start"}},value:i,onChange:t=>s(t.target.value)})}),E.jsxs("div",{className:"flex gap-2 p-0 w-full justify-end",children:[E.jsx(y,{dataTest:"delete-customer-reject-button",size:"medium",variant:"outlined",onClick:()=>{e(!1),s("")},children:a?"Avbryt":"Cancel"}),E.jsx(y,{dataTest:"delete-customer-confirm-button",size:"medium",variant:"contained",onClick:()=>{n.chain().focus().setLink({href:i}).run(),e(!1),s("")},children:a?"Legg til lenke":"Add link"})]})]})})},_h=ps.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Ue({key:new Qe("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants(((t,e)=>{const n=r>=e&&r<=e+t.nodeSize,s=!t.isLeaf&&Vs(t);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=Lo.node(e,e+t.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:e,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren})),zo.create(t,o)}}})]}}),Vh=({dataTest:t,id:e,inputRef:n,className:o,editorClassName:s,disabled:a,readOnly:l,error:c,placeholder:d,helperText:h,required:p,hideToolbar:f,noDefaultStyles:m,...g})=>{const y=Ea({...g,extensions:[_h.configure({placeholder:d}),...$h,...Bh,...g.extensions||[]],shouldRerenderOnTransaction:g.shouldRerenderOnTransaction||!1,immediatelyRender:g.immediatelyRender||!0,editable:g.editable||!a&&!l}),[b,v]=r(g.toolbarDefaultVisible),[x,S]=r(!1);u(n,(()=>y));const[O,C]=r(!1);return i((()=>{const t=()=>C(!0),e=()=>C(!1);return null==y||y.on("focus",t),null==y||y.on("blur",e),()=>{null==y||y.off("focus",t),null==y||y.off("blur",e)}}),[y]),y?E.jsxs(E.Fragment,{children:[E.jsxs(w,{className:o,children:[g.title&&E.jsx("p",{className:"font-semibold text-base text-gray-700 mb-2",children:g.title}),E.jsxs("div",{className:A("rte-wrapper","outlined"===l&&"readonly-outlined","plain"===l&&"readonly-plain",c&&!O&&"error-state",O&&!l&&(c?"error-focused-state":"focused-state")),children:[E.jsx(ga,{"data-test":t,id:e,className:A("border-none rounded-none",!m&&"core-ui-rte",!f&&!a&&!l&&!b&&"displace-text",!m&&!a&&!l&&"edit-mode",s),editor:y,onClick:()=>null==y?void 0:y.chain().focus().run(),style:{"--max-scrollable-height":g.maxScrollableHeight?`${g.maxScrollableHeight}${"number"==typeof g.maxScrollableHeight?"px":""}`:"none"}}),!f&&!a&&!l&&!b&&E.jsx(dc,{onClick:()=>v(!0),className:"cursor-pointer absolute bottom-2.5 right-4",icon:"material-symbols:format-color-text",color:"var(--colors-gray-700)",height:24,width:24}),!f&&!a&&!l&&b&&E.jsx(fc,{editor:y,onClose:()=>v(!1),error:c,focused:O,openLinkDialog:()=>S(!0),locale:g.locale})]}),(c||p)&&!l&&E.jsx(k,{error:c,"data-test":`error-${t}`,children:h})]}),E.jsx(Fh,{open:x,setOpen:S,editor:y,locale:g.locale})]}):null};export{Vh as RichInput};
56
+ */"production"===process.env.NODE_ENV?ba.exports=function(){if(ya)return va;ya=1;var e=t,n=ha,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return va.useSyncExternalStoreWithSelector=function(t,e,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function t(t){if(!s){if(s=!0,o=t,t=c(t),void 0!==d&&u.hasValue){var e=u.value;if(d(e,t))return i=e}return i=t}if(e=i,r(o,t))return e;var n=c(t);return void 0!==d&&d(e,n)?e:(o=t,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return t(e())},null===a?void 0:function(){return t(a())}]}),[e,n,c,d]);var p=o(t,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},va}():ba.exports=(wa||(wa=1,"production"!==process.env.NODE_ENV&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=t,n=ha,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;ka.useSyncExternalStoreWithSelector=function(t,e,n,c,d){var h,u=i(null);null===u.current?(h={hasValue:!1,value:null},u.current=h):h=u.current;var p=a((function(){var t,o,i=!1,s=function(e){if(!i){i=!0,t=e;var n=c(e);if(void 0!==d&&h.hasValue){var s=h.value;if(d(s,n))return o=s,s}return o=n,n}var a=o;if(r(t,e))return a;var l=c(e);return void 0!==d&&d(a,l)?a:(t=e,o=l,l)},a=void 0===n?null:n;return[function(){return s(e())},null===a?void 0:function(){return s(a())}]}),[e,n,c,d]),f=p[0],m=p[1],g=o(t,f,m);return s((function(){h.hasValue=!0,h.value=g}),[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ka);var xa=ba.exports;class Sa{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach((t=>t()))},e=this.editor;return e.on("transaction",t),()=>{e.off("transaction",t)}}}}const Oa="production"!==process.env.NODE_ENV,Ca=typeof window>"u",Ma=Ca||!!(typeof window<"u"&&window.next);class Ta{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((t=>t()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return Ca||Ma?(Oa&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Ca&&Oa)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(e,...t)},onBlur:(...t)=>{var e,n;return null===(n=(e=this.options.current).onBlur)||void 0===n?void 0:n.call(e,...t)},onCreate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onCreate)||void 0===n?void 0:n.call(e,...t)},onDestroy:(...t)=>{var e,n;return null===(n=(e=this.options.current).onDestroy)||void 0===n?void 0:n.call(e,...t)},onFocus:(...t)=>{var e,n;return null===(n=(e=this.options.current).onFocus)||void 0===n?void 0:n.call(e,...t)},onSelectionUpdate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(e,...t)},onTransaction:(...t)=>{var e,n;return null===(n=(e=this.options.current).onTransaction)||void 0===n?void 0:n.call(e,...t)},onUpdate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onUpdate)||void 0===n?void 0:n.call(e,...t)},onContentError:(...t)=>{var e,n;return null===(n=(e=this.options.current).onContentError)||void 0===n?void 0:n.call(e,...t)}};return new ea(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?this.editor.setOptions(this.options.current):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=t);if(this.previousDeps.length===t.length&&this.previousDeps.every(((e,n)=>e===t[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===t?e&&e.setOptions(this.options.current):e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))}),1)}}function Ea(t={},e=[]){const s=n(t);s.current=t;const[a]=r((()=>new Ta(s))),l=ha.useSyncExternalStore(a.subscribe,a.getEditor,a.getServerSnapshot);return o(l),i(a.onRender(e)),function(t){const[e]=r((()=>new Sa(t.editor))),n=xa.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);i((()=>e.watch(t.editor)),[t.editor,e]),o(n)}({editor:l,selector:({transactionNumber:e})=>!1===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===e?0:e+1}),l}s({editor:null}).Consumer;const Na=s({onDragStart:void 0});t.forwardRef(((e,n)=>{const{onDragStart:r}=a(Na),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));const Aa=Object.freeze({left:0,top:0,width:16,height:16}),Da=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ra=Object.freeze({...Aa,...Da}),Ia=Object.freeze({...Ra,body:"",hidden:!1});function La(t,e){const n=function(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}(t,e);for(const r in Ia)r in Da?r in t&&!(r in n)&&(n[r]=Da[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function Pa(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let i={};function s(t){i=La(r[t]||o[t],i)}return s(e),n.forEach(s),La(t,i)}function ja(t,e){const n=[];if("object"!=typeof t||"object"!=typeof t.icons)return n;t.not_found instanceof Array&&t.not_found.forEach((t=>{e(t,null),n.push(t)}));const r=function(t,e){const n=t.icons,r=t.aliases||Object.create(null),o=Object.create(null);return(e||Object.keys(n).concat(Object.keys(r))).forEach((function t(e){if(n[e])return o[e]=[];if(!(e in o)){o[e]=null;const n=r[e]&&r[e].parent,i=n&&t(n);i&&(o[e]=[n].concat(i))}return o[e]})),o}(t);for(const o in r){const i=r[o];i&&(e(o,Pa(t,o,i)),n.push(o))}return n}const za=/^[a-z0-9]+(-[a-z0-9]+)*$/,$a=(t,e,n,r="")=>{const o=t.split(":");if("@"===t.slice(0,1)){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const t=o.pop(),n=o.pop(),i={provider:o.length>0?o[0]:r,prefix:n,name:t};return e&&!Ba(i)?null:i}const i=o[0],s=i.split("-");if(s.length>1){const t={provider:r,prefix:s.shift(),name:s.join("-")};return e&&!Ba(t)?null:t}if(n&&""===r){const t={provider:r,prefix:"",name:i};return e&&!Ba(t,n)?null:t}return null},Ba=(t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(za)||!(e&&""===t.prefix||t.prefix.match(za))||!t.name.match(za)),Fa={provider:"",aliases:{},not_found:{},...Aa};function _a(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Va(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons||!_a(t,Fa))return null;const n=e.icons;for(const t in n){const e=n[t];if(!t.match(za)||"string"!=typeof e.body||!_a(e,Ia))return null}const r=e.aliases||Object.create(null);for(const t in r){const e=r[t],o=e.parent;if(!t.match(za)||"string"!=typeof o||!n[o]&&!r[o]||!_a(e,Ia))return null}return e}const Ha=Object.create(null);function Wa(t,e){const n=Ha[t]||(Ha[t]=Object.create(null));return n[e]||(n[e]=function(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}(t,e))}function Ka(t,e){return Va(e)?ja(e,((e,n)=>{n?t.icons[e]=n:t.missing.add(e)})):[]}let qa=!1;function Ja(t){return"boolean"==typeof t&&(qa=t),qa}function Ua(t){const e="string"==typeof t?$a(t,!0,qa):t;if(e){const t=Wa(e.provider,e.prefix),n=e.name;return t.icons[n]||(t.missing.has(n)?null:void 0)}}function Ga(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),qa&&!e&&!t.prefix){let e=!1;return Va(t)&&(t.prefix="",ja(t,((t,n)=>{n&&function(t,e){const n=$a(t,!0,qa);return!!n&&function(t,e,n){try{if("string"==typeof n.body)return t.icons[e]={...n},!0}catch{}return!1}(Wa(n.provider,n.prefix),n.name,e)}(t,n)&&(e=!0)}))),e}const n=t.prefix;if(!Ba({provider:e,prefix:n,name:"a"}))return!1;return!!Ka(Wa(e,n),t)}const Ya=Object.freeze({width:null,height:null}),Qa=Object.freeze({...Ya,...Da}),Xa=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Za=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function tl(t,e,n){if(1===e)return t;if(n=n||100,"number"==typeof t)return Math.ceil(t*e*n)/n;if("string"!=typeof t)return t;const r=t.split(Xa);if(null===r||!r.length)return t;const o=[];let i=r.shift(),s=Za.test(i);for(;;){if(s){const t=parseFloat(i);isNaN(t)?o.push(i):o.push(Math.ceil(t*e*n)/n)}else o.push(i);if(i=r.shift(),void 0===i)return o.join("");s=!s}}const el=/\sid="(\S+)"/g,nl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let rl=0;function ol(t,e=nl){const n=[];let r;for(;r=el.exec(t);)n.push(r[1]);if(!n.length)return t;const o="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach((n=>{const r="function"==typeof e?e(n):e+(rl++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+r+o+"$3")})),t=t.replace(new RegExp(o,"g"),"")}const il=Object.create(null);function sl(t){return il[t]||il[""]}function al(t){let e;if("string"==typeof t.resources)e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:!0===t.random,index:t.index||0,dataAfterTimeout:!1!==t.dataAfterTimeout}}const ll=Object.create(null),cl=["https://api.simplesvg.com","https://api.unisvg.com"],dl=[];for(;cl.length>0;)1===cl.length||Math.random()>.5?dl.push(cl.shift()):dl.push(cl.pop());function hl(t,e){const n=al(e);return null!==n&&(ll[t]=n,!0)}function ul(t){return ll[t]}ll[""]=al({resources:["https://api.iconify.design"].concat(dl)});let pl=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch{}})();const fl={prepare:(t,e,n)=>{const r=[],o=function(t,e){const n=ul(t);if(!n)return 0;let r;if(n.maxURL){let t=0;n.resources.forEach((e=>{t=Math.max(t,e.length)}));const o=e+".json?icons=";r=n.maxURL-t-n.path.length-o.length}else r=0;return r}(t,e),i="icons";let s={type:i,provider:t,prefix:e,icons:[]},a=0;return n.forEach(((n,l)=>{a+=n.length+1,a>=o&&l>0&&(r.push(s),s={type:i,provider:t,prefix:e,icons:[]},a=n.length),s.icons.push(n)})),r.push(s),r},send:(t,e,n)=>{if(!pl)return void n("abort",424);let r=function(t){if("string"==typeof t){const e=ul(t);if(e)return e.path}return"/"}(e.provider);switch(e.type){case"icons":{const t=e.prefix,n=e.icons.join(",");r+=t+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const t=e.uri;r+="/"===t.slice(0,1)?t.slice(1):t;break}default:return void n("abort",400)}let o=503;pl(t+r).then((t=>{const e=t.status;if(200===e)return o=501,t.json();setTimeout((()=>{n(function(t){return 404===t}(e)?"abort":"next",e)}))})).then((t=>{"object"==typeof t&&null!==t?setTimeout((()=>{n("success",t)})):setTimeout((()=>{404===t?n("abort",t):n("next",o)}))})).catch((()=>{n("next",o)}))}};function ml(t,e){t.forEach((t=>{const n=t.loaderCallbacks;n&&(t.loaderCallbacks=n.filter((t=>t.id!==e)))}))}let gl=0;var yl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function bl(t,e,n,r){const o=t.resources.length,i=t.random?Math.floor(Math.random()*o):t.index;let s;if(t.random){let e=t.resources.slice(0);for(s=[];e.length>1;){const t=Math.floor(Math.random()*e.length);s.push(e[t]),e=e.slice(0,t).concat(e.slice(t+1))}s=s.concat(e)}else s=t.resources.slice(i).concat(t.resources.slice(0,i));const a=Date.now();let l,c="pending",d=0,h=null,u=[],p=[];function f(){h&&(clearTimeout(h),h=null)}function m(){"pending"===c&&(c="aborted"),f(),u.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),u=[]}function g(t,e){e&&(p=[]),"function"==typeof t&&p.push(t)}function y(){c="failed",p.forEach((t=>{t(void 0,l)}))}function b(){u.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),u=[]}function v(){if("pending"!==c)return;f();const r=s.shift();if(void 0===r)return u.length?void(h=setTimeout((()=>{f(),"pending"===c&&(b(),y())}),t.timeout)):void y();const o={status:"pending",resource:r,callback:(e,n)=>{!function(e,n,r){const o="success"!==n;switch(u=u.filter((t=>t!==e)),c){case"pending":break;case"failed":if(o||!t.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=r,void y();if(o)return l=r,void(u.length||(s.length?v():y()));if(f(),b(),!t.random){const n=t.resources.indexOf(e.resource);-1!==n&&n!==t.index&&(t.index=n)}c="completed",p.forEach((t=>{t(r)}))}(o,e,n)}};u.push(o),d++,h=setTimeout(v,t.rotate),n(r,e,o.callback)}return"function"==typeof r&&p.push(r),setTimeout(v),function(){return{startTime:a,payload:e,status:c,queriesSent:d,queriesPending:u.length,subscribe:g,abort:m}}}function vl(t){const e={...yl,...t};let n=[];function r(){n=n.filter((t=>"pending"===t().status))}return{query:function(t,o,i){const s=bl(e,t,o,((t,e)=>{r(),i&&i(t,e)}));return n.push(s),s},find:function(t){return n.find((e=>t(e)))||null},setIndex:t=>{e.index=t},getIndex:()=>e.index,cleanup:r}}function wl(){}const kl=Object.create(null);function xl(t,e,n){let r,o;if("string"==typeof t){const e=sl(t);if(!e)return n(void 0,424),wl;o=e.send;const i=function(t){if(!kl[t]){const e=ul(t);if(!e)return;const n={config:e,redundancy:vl(e)};kl[t]=n}return kl[t]}(t);i&&(r=i.redundancy)}else{const e=al(t);if(e){r=vl(e);const n=sl(t.resources?t.resources[0]:"");n&&(o=n.send)}}return r&&o?r.query(e,o,n)().abort:(n(void 0,424),wl)}const Sl="iconify2",Ol="iconify",Cl=Ol+"-count",Ml=Ol+"-version",Tl=36e5,El=168,Nl=50;function Al(t,e){try{return t.getItem(e)}catch{}}function Dl(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Rl(t,e){try{t.removeItem(e)}catch{}}function Il(t,e){return Dl(t,Cl,e.toString())}function Ll(t){return parseInt(Al(t,Cl))||0}const Pl={local:!0,session:!0},jl={local:new Set,session:new Set};let zl=!1;let $l=typeof window>"u"?{}:window;function Bl(t){const e=t+"Storage";try{if($l&&$l[e]&&"number"==typeof $l[e].length)return $l[e]}catch{}Pl[t]=!1}function Fl(t,e){const n=Bl(t);if(!n)return;const r=Al(n,Ml);if(r!==Sl){if(r){const t=Ll(n);for(let e=0;e<t;e++)Rl(n,Ol+e.toString())}return Dl(n,Ml,Sl),void Il(n,0)}const o=Math.floor(Date.now()/Tl)-El,i=t=>{const r=Ol+t.toString(),i=Al(n,r);if("string"==typeof i){try{const n=JSON.parse(i);if("object"==typeof n&&"number"==typeof n.cached&&n.cached>o&&"string"==typeof n.provider&&"object"==typeof n.data&&"string"==typeof n.data.prefix&&e(n,t))return!0}catch{}Rl(n,r)}};let s=Ll(n);for(let e=s-1;e>=0;e--)i(e)||(e===s-1?(s--,Il(n,s)):jl[t].add(e))}function _l(){if(!zl){zl=!0;for(const t in Pl)Fl(t,(t=>{const e=t.data,n=Wa(t.provider,e.prefix);if(!Ka(n,e).length)return!1;const r=e.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,r):r,!0}))}}function Vl(t,e){function n(n){let r;if(!Pl[n]||!(r=Bl(n)))return;const o=jl[n];let i;if(o.size)o.delete(i=Array.from(o).shift());else if(i=Ll(r),i>=Nl||!Il(r,i+1))return;const s={cached:Math.floor(Date.now()/Tl),provider:t.provider,data:e};return Dl(r,Ol+i.toString(),JSON.stringify(s))}zl||_l(),e.lastModified&&!function(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const n in Pl)Fl(n,(n=>{const r=n.data;return n.provider!==t.provider||r.prefix!==t.prefix||r.lastModified===e}));return!0}(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&delete(e=Object.assign({},e)).not_found,n("local")||n("session"))}function Hl(){}function Wl(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout((()=>{t.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout((()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const r=t.provider,o=t.prefix;e.forEach((e=>{const i=e.icons,s=i.pending.length;i.pending=i.pending.filter((e=>{if(e.prefix!==o)return!0;const s=e.name;if(t.icons[s])i.loaded.push({provider:r,prefix:o,name:s});else{if(!t.missing.has(s))return n=!0,!0;i.missing.push({provider:r,prefix:o,name:s})}return!1})),i.pending.length!==s&&(n||ml([t],e.id),e.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),e.abort))}))})))}(t)})))}const Kl=(t,e)=>{const n=function(t,e=!0,n=!1){const r=[];return t.forEach((t=>{const o="string"==typeof t?$a(t,e,n):t;o&&r.push(o)})),r}(t,!0,Ja()),r=function(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort(((t,e)=>t.provider!==e.provider?t.provider.localeCompare(e.provider):t.prefix!==e.prefix?t.prefix.localeCompare(e.prefix):t.name.localeCompare(e.name)));let r={provider:"",prefix:"",name:""};return t.forEach((t=>{if(r.name===t.name&&r.prefix===t.prefix&&r.provider===t.provider)return;r=t;const o=t.provider,i=t.prefix,s=t.name,a=n[o]||(n[o]=Object.create(null)),l=a[i]||(a[i]=Wa(o,i));let c;c=s in l.icons?e.loaded:""===i||l.missing.has(s)?e.missing:e.pending;const d={provider:o,prefix:i,name:s};c.push(d)})),e}(n);if(!r.pending.length){let t=!0;return e&&setTimeout((()=>{t&&e(r.loaded,r.missing,r.pending,Hl)})),()=>{t=!1}}const o=Object.create(null),i=[];let s,a;return r.pending.forEach((t=>{const{provider:e,prefix:n}=t;if(n===a&&e===s)return;s=e,a=n,i.push(Wa(e,n));const r=o[e]||(o[e]=Object.create(null));r[n]||(r[n]=[])})),r.pending.forEach((t=>{const{provider:e,prefix:n,name:r}=t,i=Wa(e,n),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),o[e][n].push(r))})),i.forEach((t=>{const{provider:e,prefix:n}=t;o[e][n].length&&function(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout((()=>{t.iconsQueueFlag=!1;const{provider:e,prefix:n}=t,r=t.iconsToLoad;let o;delete t.iconsToLoad,r&&(o=sl(e))&&o.prepare(e,n,r).forEach((n=>{xl(e,n,(e=>{if("object"!=typeof e)n.icons.forEach((e=>{t.missing.add(e)}));else try{const n=Ka(t,e);if(!n.length)return;const r=t.pendingIcons;r&&n.forEach((t=>{r.delete(t)})),Vl(t,e)}catch(t){console.error(t)}Wl(t)}))}))})))}(t,o[e][n])})),e?function(t,e,n){const r=gl++,o=ml.bind(null,n,r);if(!e.pending.length)return o;const i={id:r,icons:e,callback:t,abort:o};return n.forEach((t=>{(t.loaderCallbacks||(t.loaderCallbacks=[])).push(i)})),o}(e,r,i):Hl};const ql=/[\s,]+/;function Jl(t,e){e.split(ql).forEach((e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}}))}function Ul(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function r(t){for(;t<0;)t+=4;return t%4}if(""===n){const e=parseInt(t);return isNaN(e)?0:r(e)}if(n!==t){let e=0;switch(n){case"%":e=25;break;case"deg":e=90}if(e){let o=parseFloat(t.slice(0,t.length-n.length));return isNaN(o)?0:(o/=e,o%1==0?r(o):0)}}return e}function Gl(t){return'url("'+function(t){return"data:image/svg+xml,"+function(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(t)}(t)+'")'}let Yl;function Ql(t){return void 0===Yl&&function(){try{Yl=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{Yl=null}}(),Yl?Yl.createHTML(t):t}const Xl={...Qa,inline:!1},Zl={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},tc={display:"inline-block"},ec={backgroundColor:"currentColor"},nc={backgroundColor:"transparent"},rc={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},oc={WebkitMask:ec,mask:ec,background:nc};for(const t in oc){const e=oc[t];for(const n in rc)e[t+n]=rc[n]}const ic={...Xl,inline:!0};function sc(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const ac=(t,e,n)=>{const r=e.inline?ic:Xl,o=function(t,e){const n={...t};for(const t in e){const r=e[t],o=typeof r;t in Ya?(null===r||r&&("string"===o||"number"===o))&&(n[t]=r):o===typeof n[t]&&(n[t]="rotate"===t?r%4:r)}return n}(r,e),i=e.mode||"svg",s={},a=e.style||{},c={..."svg"===i?Zl:{}};if(n){const t=$a(n,!1,!0);if(t){const e=["iconify"],n=["provider","prefix"];for(const r of n)t[r]&&e.push("iconify--"+t[r]);c.className=e.join(" ")}}for(let t in e){const n=e[t];if(void 0!==n)switch(t){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":c.ref=n;break;case"className":c[t]=(c[t]?c[t]+" ":"")+n;break;case"inline":case"hFlip":case"vFlip":o[t]=!0===n||"true"===n||1===n;break;case"flip":"string"==typeof n&&Jl(o,n);break;case"color":s.color=n;break;case"rotate":"string"==typeof n?o[t]=Ul(n):"number"==typeof n&&(o[t]=n);break;case"ariaHidden":case"aria-hidden":!0!==n&&"true"!==n&&delete c["aria-hidden"];break;default:void 0===r[t]&&(c[t]=n)}}const d=function(t,e){const n={...Ra,...t},r={...Qa,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach((t=>{const e=[],n=t.hFlip,r=t.vFlip;let s,a=t.rotate;switch(n?r?a+=2:(e.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),e.push("scale(-1 1)"),o.top=o.left=0):r&&(e.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),e.push("scale(1 -1)"),o.top=o.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:s=o.height/2+o.top,e.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:e.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:s=o.width/2+o.left,e.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}a%2==1&&(o.left!==o.top&&(s=o.left,o.left=o.top,o.top=s),o.width!==o.height&&(s=o.width,o.width=o.height,o.height=s)),e.length&&(i=function(t,e,n){const r=function(t,e="defs"){let n="";const r=t.indexOf("<"+e);for(;r>=0;){const o=t.indexOf(">",r),i=t.indexOf("</"+e);if(-1===o||-1===i)break;const s=t.indexOf(">",i);if(-1===s)break;n+=t.slice(o+1,i).trim(),t=t.slice(0,r).trim()+t.slice(s+1)}return{defs:n,content:t}}(t);return function(t,e){return t?"<defs>"+t+"</defs>"+e:e}(r.defs,e+r.content+n)}(i,'<g transform="'+e.join(" ")+'">',"</g>"))}));const s=r.width,a=r.height,l=o.width,c=o.height;let d,h;null===s?(h=null===a?"1em":"auto"===a?c:a,d=tl(h,l/c)):(d="auto"===s?l:s,h=null===a?tl(d,c/l):"auto"===a?c:a);const u={},p=(t,e)=>{(t=>"unset"===t||"undefined"===t||"none"===t)(e)||(u[t]=e.toString())};p("width",d),p("height",h);const f=[o.left,o.top,l,c];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:i}}(t,o),h=d.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===i){c.style={...s,...a},Object.assign(c,h);let t=0,n=e.id;return"string"==typeof n&&(n=n.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:Ql(ol(d.body,n?()=>n+"ID"+t++:"iconifyReact"))},l("svg",c)}const{body:u,width:p,height:f}=t,m="mask"===i||"bg"!==i&&-1!==u.indexOf("currentColor"),g=function(t,e){let n=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)n+=" "+t+'="'+e[t]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}(u,{...h,width:p+"",height:f+""});return c.style={...s,"--svg":Gl(g),width:sc(h.width),height:sc(h.height),...tc,...m?ec:nc,...a},l("span",c)};var lc;if(Ja(!0),lc=fl,il[""]=lc,typeof document<"u"&&typeof window<"u"){_l();const t=window;if(void 0!==t.IconifyPreload){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof e&&null!==e&&(e instanceof Array?e:[e]).forEach((t=>{try{("object"!=typeof t||null===t||t instanceof Array||"object"!=typeof t.icons||"string"!=typeof t.prefix||!Ga(t))&&console.error(n)}catch{console.error(n)}}))}if(void 0!==t.IconifyProviders){const e=t.IconifyProviders;if("object"==typeof e&&null!==e)for(let t in e){const n="IconifyProviders["+t+"] is invalid.";try{const r=e[t];if("object"!=typeof r||!r||void 0===r.resources)continue;hl(t,r)||console.error(n)}catch{console.error(n)}}}}function cc(t){const[e,n]=r(!!t.ssr),[o,s]=r({});const[a,c]=r(function(e){if(e){const e=t.icon;if("object"==typeof e)return{name:"",data:e};const n=Ua(e);if(n)return{name:e,data:n}}return{name:""}}(!!t.ssr));function d(){const t=o.callback;t&&(t(),s({}))}function h(t){if(JSON.stringify(a)!==JSON.stringify(t))return d(),c(t),!0}function u(){var e;const n=t.icon;if("object"==typeof n)return void h({name:"",data:n});const r=Ua(n);if(h({name:n,data:r}))if(void 0===r){const t=Kl([n],u);s({callback:t})}else r&&(null===(e=t.onLoad)||void 0===e||e.call(t,n))}i((()=>(n(!0),d)),[]),i((()=>{e&&u()}),[t.icon,e]);const{name:p,data:f}=a;return f?ac({...Ra,...f},t,p):t.children?t.children:l("span",{})}const dc=e(((t,e)=>cc({...t,_ref:e})));e(((t,e)=>cc({inline:!0,...t,_ref:e})));const hc=t=>E.jsx(f,{...t,sx:{"&.MuiMenuItem-root":{color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"}},children:t.children}),uc={small:"10px",normal:"16px",large:"24px",huge:"32px"},pc=t=>{const{editor:e}=t,[n,o]=r("normal");return d((()=>{const{from:t,to:n}=e.state.selection;e.state.doc.nodesBetween(t-1,n,(t=>{if(t.marks){const e=t.marks.find((t=>"textStyle"===t.type.name)),n=null==e?void 0:e.attrs.fontSize,r=Object.keys(uc).find((t=>uc[t]===n))||"normal";o(r)}}))}),[e.state.selection,e.state.doc]),E.jsx(m,{...t,select:!0,size:"small",dataTest:"font-size-select",onChange:t=>{const n=t.target.value;e.chain().focus().setMark("textStyle",{fontSize:uc[n]}).run(),o(n)},value:n,SelectProps:{IconComponent:()=>null},InputProps:{endAdornment:E.jsx(dc,{icon:"tabler:caret-up-down-filled",className:"chevron-icon"})},sx:{".MuiSelect-select":{border:"none",padding:0,overflow:"hidden",display:"flex",alignItems:"center",color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"},".MuiOutlinedInput-root":{height:"32px",width:"75px","& .MuiOutlinedInput-notchedOutline":{border:"none"}}},children:t.children})},fc=({editor:t,onClose:e,error:o,focused:i,openLinkDialog:s,locale:a})=>{const[l,u]=r(0),p=n(null),m=h((()=>"no"===a),[a]),[v,w]=r(!1),[k,S]=r([]);d((()=>{const e=new ResizeObserver((()=>{var e;if(p.current){const n=p.current.clientWidth;w(n<(m?416:420));const r=null==(e=[{width:m?296:300,buttons:3},{width:m?340:342,buttons:4},{width:m?374:378,buttons:5},{width:m?416:420,buttons:6},{width:m?416:420,buttons:7},{width:1/0,buttons:8}].find((t=>n<t.width)))?void 0:e.buttons;u(void 0!==r?r:8);const o=[];Number(r)<8&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:s,selected:t.isActive("link"),children:E.jsx(g,{})},"link")),Number(r)<7&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleItalic().run(),selected:t.isActive("italic"),children:E.jsx(dc,{icon:"material-symbols:format-italic",height:20})},"italic")),Number(r)<6&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBold().run(),selected:t.isActive("bold"),children:E.jsx(dc,{icon:"ooui:bold-b"})},"bold")),Number(r)<5&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleOrderedList().run(),selected:t.isActive("orderedList"),children:E.jsx(dc,{icon:"mdi:format-list-numbered",fontSize:20})},"ordered")),Number(r)<4&&o.push(E.jsx(f,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBulletList().run(),selected:t.isActive("bulletList"),children:E.jsx(dc,{icon:"mdi:format-list-bulleted",fontSize:20})},"bullet")),S(o)}}));return p.current&&e.observe(p.current),()=>e.disconnect()}),[t,s,m]);const{anchorEl:O,open:C,handleClose:M,handleOpen:T}=(()=>{const[t,e]=r(null),n=!!t,o=c((t=>{e(t.currentTarget)}),[]);return{open:n,handleClose:c((()=>{e(null)}),[]),handleOpen:o,anchorEl:t}})();return E.jsx(E.Fragment,{children:E.jsxs("div",{className:A("toolbar",{"toolbar-error":o,"toolbar-focused":i}),ref:p,children:[E.jsxs("div",{className:"flex flex-row items-center gap-1",children:[l>=1&&E.jsx(y,{dataTest:"richeditor-h1-button",size:"small",variant:t.isActive("heading",{level:1})?"text":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().toggleHeading({level:1}).run()},children:E.jsx(dc,{icon:"bi:type-h1"})}),l>=2&&E.jsx(y,{dataTest:"richeditor-h2-button",size:"small",variant:t.isActive("heading",{level:2})?"text":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().toggleHeading({level:2}).run()},children:E.jsx(dc,{icon:"bi:type-h2"})}),l>=3&&E.jsxs(pc,{editor:t,children:[E.jsx(hc,{value:"small",children:m?"Liten":"Small"}),E.jsx(hc,{value:"normal",children:"Normal"}),E.jsx(hc,{value:"large",children:m?"Stor":"Large"}),E.jsx(hc,{value:"huge",children:m?"Enorm":"Huge"})]}),l>=4&&E.jsx(y,{dataTest:"richeditor-bullet-list-button",size:"small",variant:t.isActive("bulletList")?"text":"textGray",onClick:()=>t.chain().focus().toggleBulletList().run(),children:E.jsx(dc,{icon:"mdi:format-list-bulleted",fontSize:20})}),l>=5&&E.jsx(y,{dataTest:"richeditor-ordered-list-button",size:"small",variant:t.isActive("orderedList")?"text":"textGray",onClick:()=>t.chain().focus().toggleOrderedList().run(),children:E.jsx(dc,{icon:"mdi:format-list-numbered",fontSize:20})}),l>=6&&E.jsx(y,{dataTest:"richeditor-bold-button",size:"small",variant:t.isActive("bold")?"text":"textGray",onClick:()=>t.chain().focus().toggleBold().run(),children:E.jsx(dc,{icon:"ooui:bold-b"})}),l>=7&&E.jsx(y,{dataTest:"richeditor-italic-button",size:"small",variant:t.isActive("italic")?"text":"textGray",onClick:()=>t.chain().focus().toggleItalic().run(),children:E.jsx(dc,{icon:"material-symbols:format-italic",height:20})}),l>=8&&E.jsx(y,{dataTest:"richeditor-link-button",size:"small",variant:t.isActive("link")?"text":"textGray",onClick:s,children:E.jsx(g,{})}),v&&E.jsxs(E.Fragment,{children:[E.jsx(y,{size:"small",dataTest:"richeditor-more-menu-button",variant:"text",onClick:t=>{t.stopPropagation(),t.preventDefault(),T(t)},onMouseDown:t=>{t.stopPropagation(),t.preventDefault()},onMouseUp:t=>{t.stopPropagation(),t.preventDefault()},children:E.jsx(b,{className:"text-delta-800",width:20,height:20})}),E.jsx(x,{open:C,anchorEl:O,onClose:M,onClick:M,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:k})]})]}),E.jsx(y,{dataTest:"richeditor-close-toolbar-button",size:"small",variant:"text",onClick:e,children:m?"Lukk":"Close"})]})})},mc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vc=ls.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[na({find:mc,type:this.type}),na({find:yc,type:this.type})]},addPasteRules(){return[ia({find:gc,type:this.type}),ia({find:bc,type:this.type})]}}),wc=oa.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Ki(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),kc=ls.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ls(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),xc=/^\s*([-+*])\s$/,Sc=oa.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wc.name,this.editor.getAttributes(kc.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ra({find:xc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ra({find:xc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(kc.name),editor:this.editor})),[t]}}),Oc=oa.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ki(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>function(t){return new es({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Ui(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}}),Cc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Mc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Tc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Ec=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Nc=ls.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[na({find:Cc,type:this.type}),na({find:Tc,type:this.type})]},addPasteRules(){return[ia({find:Mc,type:this.type}),ia({find:Ec,type:this.type})]}}),Ac="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Dc="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Rc=(t,e)=>{for(const n in e)t[n]=e[n];return t},Ic="numeric",Lc="ascii",Pc="alpha",jc="asciinumeric",zc="alphanumeric",$c="domain",Bc="emoji",Fc="scheme",_c="slashscheme",Vc="whitespace";function Hc(t,e){return t in e||(e[t]=[]),e[t]}function Wc(t,e,n){e[Ic]&&(e[jc]=!0,e[zc]=!0),e[Lc]&&(e[jc]=!0,e[Pc]=!0),e[jc]&&(e[zc]=!0),e[Pc]&&(e[zc]=!0),e[zc]&&(e[$c]=!0),e[Bc]&&(e[$c]=!0);for(const r in e){const e=Hc(r,n);e.indexOf(t)<0&&e.push(t)}}function Kc(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Kc.groups={},Kc.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e){return void 0===e&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||Kc.groups,e&&e.j?o=e:(o=new Kc(e),n&&r&&Wc(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let e=0;e<i-1;e++)o=o.tt(t[e]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||Kc.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new Kc,Rc(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Kc,i){if(r)if(s.t&&"string"==typeof s.t){const t=Rc(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);Wc(i,t,r)}else n&&Wc(i,n,r);s.t=i}return o.j[t]=s,s}};const qc=(t,e,n,r,o)=>t.ta(e,n,r,o),Jc=(t,e,n,r,o)=>t.tr(e,n,r,o),Uc=(t,e,n,r,o)=>t.ts(e,n,r,o),Gc=(t,e,n,r,o)=>t.tt(e,n,r,o),Yc="WORD",Qc="UWORD",Xc="LOCALHOST",Zc="TLD",td="UTLD",ed="SCHEME",nd="SLASH_SCHEME",rd="NUM",od="WS",id="NL",sd="OPENBRACE",ad="CLOSEBRACE",ld="OPENBRACKET",cd="CLOSEBRACKET",dd="OPENPAREN",hd="CLOSEPAREN",ud="OPENANGLEBRACKET",pd="CLOSEANGLEBRACKET",fd="FULLWIDTHLEFTPAREN",md="FULLWIDTHRIGHTPAREN",gd="LEFTCORNERBRACKET",yd="RIGHTCORNERBRACKET",bd="LEFTWHITECORNERBRACKET",vd="RIGHTWHITECORNERBRACKET",wd="FULLWIDTHLESSTHAN",kd="FULLWIDTHGREATERTHAN",xd="AMPERSAND",Sd="APOSTROPHE",Od="ASTERISK",Cd="AT",Md="BACKSLASH",Td="BACKTICK",Ed="CARET",Nd="COLON",Ad="COMMA",Dd="DOLLAR",Rd="DOT",Id="EQUALS",Ld="EXCLAMATION",Pd="HYPHEN",jd="PERCENT",zd="PIPE",$d="PLUS",Bd="POUND",Fd="QUERY",_d="QUOTE",Vd="SEMI",Hd="SLASH",Wd="TILDE",Kd="UNDERSCORE",qd="EMOJI",Jd="SYM";var Ud=Object.freeze({__proto__:null,WORD:Yc,UWORD:Qc,LOCALHOST:Xc,TLD:Zc,UTLD:td,SCHEME:ed,SLASH_SCHEME:nd,NUM:rd,WS:od,NL:id,OPENBRACE:sd,CLOSEBRACE:ad,OPENBRACKET:ld,CLOSEBRACKET:cd,OPENPAREN:dd,CLOSEPAREN:hd,OPENANGLEBRACKET:ud,CLOSEANGLEBRACKET:pd,FULLWIDTHLEFTPAREN:fd,FULLWIDTHRIGHTPAREN:md,LEFTCORNERBRACKET:gd,RIGHTCORNERBRACKET:yd,LEFTWHITECORNERBRACKET:bd,RIGHTWHITECORNERBRACKET:vd,FULLWIDTHLESSTHAN:wd,FULLWIDTHGREATERTHAN:kd,AMPERSAND:xd,APOSTROPHE:Sd,ASTERISK:Od,AT:Cd,BACKSLASH:Md,BACKTICK:Td,CARET:Ed,COLON:Nd,COMMA:Ad,DOLLAR:Dd,DOT:Rd,EQUALS:Id,EXCLAMATION:Ld,HYPHEN:Pd,PERCENT:jd,PIPE:zd,PLUS:$d,POUND:Bd,QUERY:Fd,QUOTE:_d,SEMI:Vd,SLASH:Hd,TILDE:Wd,UNDERSCORE:Kd,EMOJI:qd,SYM:Jd});const Gd=/[a-z]/,Yd=/\p{L}/u,Qd=/\p{Emoji}/u,Xd=/\d/,Zd=/\s/,th="\n",eh="️",nh="‍";let rh=null,oh=null;function ih(t,e,n,r,o){let i;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?i=t.j[s]:(i=new Kc(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new Kc(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function sh(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const ah={defaultProtocol:"http",events:null,format:ch,formatHref:ch,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lh(t,e){void 0===e&&(e=null);let n=Rc({},ah);t&&(n=Rc(n,t instanceof lh?t.o:t));const r=n.ignoreTags,o=[];for(let t=0;t<r.length;t++)o.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function ch(t){return t}function dh(t,e){this.t="token",this.v=t,this.tk=e}function hh(t,e){class n extends dh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}lh.prototype={o:ah,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o&&("object"==typeof o?(o=n.t in o?o[n.t]:ah[t],"function"==typeof o&&r&&(o=o(e,n))):"function"==typeof o&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},dh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=ah.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Rc(s,d),{tagName:o,attributes:s,content:i,eventListeners:h}}};const uh=hh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ph=hh("text"),fh=hh("nl"),mh=hh("url",{isLink:!0,toHref(t){return void 0===t&&(t=ah.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Xc&&t[1].t===Nd}}),gh=t=>new Kc(t);function yh(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const bh=typeof console<"u"&&console&&console.warn||(()=>{}),vh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function wh(t,e){if(void 0===e&&(e=!1),vh.initialized&&bh(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');vh.customSchemes.push([t,e])}function kh(){vh.scanner=function(t){void 0===t&&(t=[]);const e={};Kc.groups=e;const n=new Kc;null==rh&&(rh=sh(Ac)),null==oh&&(oh=sh(Dc)),Gc(n,"'",Sd),Gc(n,"{",sd),Gc(n,"}",ad),Gc(n,"[",ld),Gc(n,"]",cd),Gc(n,"(",dd),Gc(n,")",hd),Gc(n,"<",ud),Gc(n,">",pd),Gc(n,"(",fd),Gc(n,")",md),Gc(n,"「",gd),Gc(n,"」",yd),Gc(n,"『",bd),Gc(n,"』",vd),Gc(n,"<",wd),Gc(n,">",kd),Gc(n,"&",xd),Gc(n,"*",Od),Gc(n,"@",Cd),Gc(n,"`",Td),Gc(n,"^",Ed),Gc(n,":",Nd),Gc(n,",",Ad),Gc(n,"$",Dd),Gc(n,".",Rd),Gc(n,"=",Id),Gc(n,"!",Ld),Gc(n,"-",Pd),Gc(n,"%",jd),Gc(n,"|",zd),Gc(n,"+",$d),Gc(n,"#",Bd),Gc(n,"?",Fd),Gc(n,'"',_d),Gc(n,"/",Hd),Gc(n,";",Vd),Gc(n,"~",Wd),Gc(n,"_",Kd),Gc(n,"\\",Md);const r=Jc(n,Xd,rd,{[Ic]:!0});Jc(r,Xd,r);const o=Jc(n,Gd,Yc,{[Lc]:!0});Jc(o,Gd,o);const i=Jc(n,Yd,Qc,{[Pc]:!0});Jc(i,Gd),Jc(i,Yd,i);const s=Jc(n,Zd,od,{[Vc]:!0});Gc(n,th,id,{[Vc]:!0}),Gc(s,th),Jc(s,Zd,s);const a=Jc(n,Qd,qd,{[Bc]:!0});Jc(a,Qd,a),Gc(a,eh,a);const l=Gc(a,nh);Jc(l,Qd,a);const c=[[Gd,o]],d=[[Gd,null],[Yd,i]];for(let t=0;t<rh.length;t++)ih(n,rh[t],Zc,Yc,c);for(let t=0;t<oh.length;t++)ih(n,oh[t],td,Qc,d);Wc(Zc,{tld:!0,ascii:!0},e),Wc(td,{utld:!0,alpha:!0},e),ih(n,"file",ed,Yc,c),ih(n,"mailto",ed,Yc,c),ih(n,"http",nd,Yc,c),ih(n,"https",nd,Yc,c),ih(n,"ftp",nd,Yc,c),ih(n,"ftps",nd,Yc,c),Wc(ed,{scheme:!0,ascii:!0},e),Wc(nd,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],o=t[e][1]?{[Fc]:!0}:{[_c]:!0};r.indexOf("-")>=0?o[$c]=!0:Gd.test(r)?Xd.test(r)?o[jc]=!0:o[Lc]=!0:o[Ic]=!0,Uc(n,r,r,o)}return Uc(n,"localhost",Xc,{ascii:!0}),n.jd=new Kc(Jd),{start:n,tokens:Rc({groups:e},Ud)}}(vh.customSchemes);for(let t=0;t<vh.tokenQueue.length;t++)vh.tokenQueue[t][1]({scanner:vh.scanner});vh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([xd,Od,Cd,Md,Td,Ed,Dd,Id,Pd,rd,jd,zd,$d,Bd,Hd,Jd,Wd,Kd]),r=[Sd,Nd,Ad,Rd,Ld,Fd,_d,Vd,ud,pd,sd,ad,cd,ld,dd,hd,fd,md,gd,yd,bd,vd,wd,kd],o=[xd,Sd,Od,Md,Td,Ed,Dd,Id,Pd,sd,ad,jd,zd,$d,Bd,Fd,Hd,Jd,Wd,Kd],i=gh(),s=Gc(i,Wd);qc(s,o,s),qc(s,e.domain,s);const a=gh(),l=gh(),c=gh();qc(i,e.domain,a),qc(i,e.scheme,l),qc(i,e.slashscheme,c),qc(a,o,s),qc(a,e.domain,a);const d=Gc(a,Cd);Gc(s,Cd,d),Gc(l,Cd,d),Gc(c,Cd,d);const h=Gc(s,Rd);qc(h,o,s),qc(h,e.domain,s);const u=gh();qc(d,e.domain,u),qc(u,e.domain,u);const p=Gc(u,Rd);qc(p,e.domain,u);const f=gh(uh);qc(p,e.tld,f),qc(p,e.utld,f),Gc(d,Xc,f);const m=Gc(u,Pd);qc(m,e.domain,u),qc(f,e.domain,u),Gc(f,Rd,p),Gc(f,Pd,m);const g=Gc(f,Nd);qc(g,e.numeric,uh);const y=Gc(a,Pd),b=Gc(a,Rd);qc(y,e.domain,a),qc(b,o,s),qc(b,e.domain,a);const v=gh(mh);qc(b,e.tld,v),qc(b,e.utld,v),qc(v,e.domain,a),qc(v,o,s),Gc(v,Rd,b),Gc(v,Pd,y),Gc(v,Cd,d);const w=Gc(v,Nd),k=gh(mh);qc(w,e.numeric,k);const x=gh(mh),S=gh();qc(x,n,x),qc(x,r,S),qc(S,n,x),qc(S,r,S),Gc(v,Hd,x),Gc(k,Hd,x);const O=Gc(l,Nd),C=Gc(c,Nd),M=Gc(C,Hd),T=Gc(M,Hd);qc(l,e.domain,a),Gc(l,Rd,b),Gc(l,Pd,y),qc(c,e.domain,a),Gc(c,Rd,b),Gc(c,Pd,y),qc(O,e.domain,x),Gc(O,Hd,x),qc(T,e.domain,x),qc(T,n,x),Gc(T,Hd,x);const E=[[sd,ad],[ld,cd],[dd,hd],[ud,pd],[fd,md],[gd,yd],[bd,vd],[wd,kd]];for(let t=0;t<E.length;t++){const[e,o]=E[t],i=Gc(x,e);Gc(S,e,i),Gc(i,o,x);const s=gh(mh);qc(i,n,s);const a=gh();qc(i,r),qc(s,n,s),qc(s,r,a),qc(a,n,s),qc(a,r,a),Gc(s,o,x),Gc(a,o,x)}return Gc(i,Xc,v),Gc(i,id,fh),{start:i,tokens:Ud}}(vh.scanner.tokens);for(let t=0;t<vh.pluginQueue.length;t++)vh.pluginQueue[t][1]({scanner:vh.scanner,parser:vh.parser});vh.initialized=!0}function xh(t){return vh.initialized||kh(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,d=0,h=null,u=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(yh(ph,e,s)),s=[]),o-=u,d-=u;const t=h.t,r=n.slice(o-d,o);i.push(yh(t,e,r))}}return s.length>0&&i.push(yh(ph,e,s)),i}(vh.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,d=null,h=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=n[s].length,u++),c+=n[s].length,i+=n[s].length,s++;i-=h,s-=u,c-=h,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}(vh.scanner.start,t))}function Sh(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new lh(n),o=xh(t),i=[];for(let t=0;t<o.length;t++){const n=o[t];n.isLink&&(!e||n.t===e)&&r.check(n)&&i.push(n.toFormattedObject(r))}return i}function Oh(t){return new Ue({key:new Qe("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new Te(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]);return function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),l=e.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),zs(r)}(a).forEach((({newRange:e})=>{const n=function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,e,(t=>t.isTextblock));let o,i;if(n.length>1?(o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(e.from,e.to," "," ").endsWith(" ")&&(o=n[0],i=r.doc.textBetween(o.pos,e.to,void 0," ")),o&&i){const e=i.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],a=o.pos+i.lastIndexOf(n);if(!n)return!1;const l=xh(n).map((e=>e.toObject(t.defaultProtocol)));if(!function(t){return 1===t.length?t[0].isLink:!(3!==t.length||!t[1].isLink)&&["()","[]"].includes(t[0].value+t[2].value)}(l))return!1;l.filter((t=>t.isLink)).map((t=>({...t,from:a+t.start+1,to:a+t.end+1}))).filter((t=>!r.schema.marks.code||!r.doc.rangeHasMark(t.from,t.to,r.schema.marks.code))).filter((e=>t.validate(e.value))).forEach((e=>{$s(e.from,e.to,r.doc).some((e=>e.mark.type===t.type))||s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Ch=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Mh(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme;e&&n.push(e)})),!t||t.replace(Ch,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Th=ls.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?wh(t.scheme,t.optionalSlashes):wh(t)}))},onDestroy(){Kc.groups={},vh.scanner=null,vh.parser=null,vh.tokenQueue=[],vh.pluginQueue=[],vh.customSchemes=[],vh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!Mh(e,this.options.protocols))&&null}}]},renderHTML({HTMLAttributes:t}){return Mh(t.href,this.options.protocols)?["a",Ki(this.options.HTMLAttributes,t),0]:["a",Ki(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ia({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=Sh(t).filter((t=>t.isLink&&n(t.value)));r.length&&r.forEach((t=>e.push({text:t.value,data:{href:t.href},index:t.start})))}return e},type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(Oh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),!0===this.options.openOnClick&&t.push(function(t){return new Ue({key:new Qe("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(0!==r.button||!e.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find((t=>"A"===t.nodeName)))return!1;const l=js(e.state,t.type.name),c=r.target,d=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:l.href,h=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:l.target;return!(!c||!d||(window.open(d,h),0))}}})}({type:this.type})),this.options.linkOnPaste&&t.push(function(t){return new Ue({key:new Qe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const l=Sh(a,{defaultProtocol:t.defaultProtocol}).find((t=>t.isLink&&t.value===a));return!(!a||!l||(t.editor.commands.setMark(t.type,{href:l.href}),0))}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Eh=oa.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Ki(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Nh=oa.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Ki(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ah=ls.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ls(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),Dh=/^(\d+)\.\s$/,Rh=oa.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return 1===e?["ol",Ki(this.options.HTMLAttributes,n),0]:["ol",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Nh.name,this.editor.getAttributes(Ah.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ra({find:Dh,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ra({find:Dh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Ah.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),Ih=oa.create({name:"doc",topNode:!0,content:"block+"}),Lh=oa.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ph=oa.create({name:"text",group:"inline"}),jh=ls.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Ki(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ls(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}});var zh=ps.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(t){return t.style.fontSize.replace(/['"]+/g,"")},renderHTML:function(t){return t.fontSize?{style:"font-size: "+t.fontSize}:{}}}}}]},addCommands:function(){return{setFontSize:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:t}).run()}},unsetFontSize:function(){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}});const $h=[Ih,Lh,Ph,jh],Bh=[Oc.configure({levels:[1,2]}),Eh,Sc,Rh,Th,vc,Nc,zh],Fh="_link-dialog-container_jjs9w_1",_h=({open:t,setOpen:e,editor:n,locale:o})=>{const[i,s]=r(""),a=h((()=>"no"===o),[o]);d((()=>{if(t){const{from:t,to:e}=n.state.selection;let r=null;n.state.doc.nodesBetween(t-1,e,(t=>{if(t.marks){const e=t.marks.find((t=>"link"===t.type.name));e&&(r=e.attrs.href)}})),s(r||"");const o=document.querySelector('[data-test="link-input-field"]');null==o||o.focus()}}),[t,n]);return E.jsx(v,{open:t,dataTest:"link-modal-rte",onClose:()=>e(!1),className:"z-[99]",dialogTitle:E.jsx("div",{className:"text-gray-700",children:a?"Legg til lenke":"Add link"}),children:E.jsxs("div",{className:Fh,children:[E.jsx("div",{className:"link-input-field",children:E.jsx(m,{autoFocus:!0,multiline:!0,className:"w-full",dataTest:"link-input-field",size:"small",sx:{"& .MuiInputBase-root":{minHeight:64,alignItems:"start"}},value:i,onChange:t=>s(t.target.value)})}),E.jsxs("div",{className:"flex gap-2 p-0 w-full justify-end",children:[E.jsx(y,{dataTest:"delete-customer-reject-button",size:"medium",variant:"outlined",onClick:()=>{e(!1),s("")},children:a?"Avbryt":"Cancel"}),E.jsx(y,{dataTest:"delete-customer-confirm-button",size:"medium",variant:"contained",onClick:()=>{n.chain().focus().setLink({href:i}).run(),e(!1),s("")},children:a?"Legg til lenke":"Add link"})]})]})})},Vh=ps.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Ue({key:new Qe("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants(((t,e)=>{const n=r>=e&&r<=e+t.nodeSize,s=!t.isLeaf&&Vs(t);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=Lo.node(e,e+t.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:e,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren})),zo.create(t,o)}}})]}}),Hh=({dataTest:t,id:e,inputRef:n,className:o,editorClassName:s,disabled:a,readOnly:l,error:c,placeholder:d,helperText:h,required:p,hideToolbar:f,noDefaultStyles:m,...g})=>{const y=Ea({...g,extensions:[Vh.configure({placeholder:d}),...$h,...Bh,...g.extensions||[]],shouldRerenderOnTransaction:g.shouldRerenderOnTransaction||!1,immediatelyRender:g.immediatelyRender||!0,editable:g.editable||!a&&!l}),[b,v]=r(g.toolbarDefaultVisible),[x,S]=r(!1);u(n,(()=>y));const[O,C]=r(!1);return i((()=>{const t=()=>C(!0),e=()=>C(!1);return null==y||y.on("focus",t),null==y||y.on("blur",e),()=>{null==y||y.off("focus",t),null==y||y.off("blur",e)}}),[y]),y?E.jsxs(E.Fragment,{children:[E.jsxs(w,{className:o,children:[g.title&&E.jsx("p",{className:"font-semibold text-base text-gray-700 mb-2",children:g.title}),E.jsxs("div",{className:A(!m&&"rte-wrapper","outlined"===l&&"readonly-outlined","plain"===l&&"readonly-plain",c&&!O&&"error-state",O&&!l&&(c?"error-focused-state":"focused-state")),children:[E.jsx(ga,{"data-test":t,id:e,className:A("border-none rounded-none",!m&&"core-ui-rte",!f&&!a&&!l&&!b&&"displace-text",!m&&!a&&!l&&"edit-mode",s),editor:y,onClick:()=>null==y?void 0:y.chain().focus().run(),style:{"--max-scrollable-height":g.maxScrollableHeight?`${g.maxScrollableHeight}${"number"==typeof g.maxScrollableHeight?"px":""}`:"none"}}),!f&&!a&&!l&&!b&&E.jsx(dc,{onClick:()=>v(!0),className:"cursor-pointer absolute bottom-2.5 right-4",icon:"material-symbols:format-color-text",color:"var(--colors-gray-700)",height:24,width:24}),!f&&!a&&!l&&b&&E.jsx(fc,{editor:y,onClose:()=>v(!1),error:c,focused:O,openLinkDialog:()=>S(!0),locale:g.locale})]}),(c||p)&&!l&&E.jsx(k,{error:c,"data-test":`error-${t}`,children:h})]}),E.jsx(_h,{open:x,setOpen:S,editor:y,locale:g.locale})]}):null};export{Hh as RichInput};