asma-ui-richeditor 0.1.2-beta → 0.1.2-beta2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(".toolbar{width:100%;padding-block:4px;background-color:var(--colors-gray-100);display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;border-inline:1px solid var(--colors-gray-500);border-bottom:1px solid var(--colors-gray-500);border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding-inline:1rem;border-top:1px solid var(--colors-gray-200);box-sizing:border-box}.core-ui-rte:not(:focus-within):hover+.toolbar{border-inline:1px solid var(--colors-gama-300);border-bottom:1px solid var(--colors-gama-300)}.toolbar-error{border-inline:1px solid var(--colors-red-500);border-bottom:1px solid var(--colors-red-500)}.toolbar-focused{border-inline:1px solid var(--colors-gama-500);border-bottom:1px solid var(--colors-gama-500)}.font-size-select{appearance:none;-webkit-appearance:none;-moz-appearance:none;background-color:transparent;padding-right:25px;cursor:pointer;border-radius:4px;color:var(--colors-delta-700);font-size:14px;padding-left:4px}.font-size-select option{cursor:pointer}.font-size-select:focus{outline:none}.select-wrapper{position:relative;display:flex;align-items:center;justify-content:center}.chevron-icon{position:absolute;right:6px;top:8px;pointer-events:none;color:var(--colors-delta-700)}:root{--max-scrollable-height: 100px}*{box-sizing:border-box;padding:0;margin:0}.core-ui-rte{box-sizing:border-box;border-radius:4px;border:1px solid var(--colors-gray-500);overflow:hidden}.core-ui-rte:not(:focus-within):hover{border-color:var(--colors-gama-300)}.core-ui-rte:focus-within{border-color:var(--colors-gama-500)}.core-ui-rte.error-state:hover{border-color:var(--colors-red-500)}.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:8px 14px;overflow-y:auto;max-height:var(--max-scrollable-height);scrollbar-width:thin;scrollbar-color:var(--colors-gray-500) #fff}.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.core-ui-rte-error{border-radius:4px;border:1px solid var(--colors-red-500)}.core-ui-rte.core-ui-rte-tools-error{border-radius:4px 4px 0 0;border:1px solid var(--colors-red-500);border-bottom:none}.core-ui-rte-edit-mode{border-radius:4px 4px 0 0;border-bottom:none;min-height:40px}.core-ui-rte-hide-toolbar{border:1px solid var(--colors-gray-500);border-radius:4px}.core-ui-rte.core-ui-rte-readonly-mode .tiptap{min-height:100px;max-height:none;overflow:hidden}.core-ui-rte.core-ui-rte-readonly-mode{background-color:var(--colors-gray-10);border-color:var(--colors-gray-200)}.core-ui-rte.core-ui-rte-readonly-mode:hover{border-color:var(--colors-gray-200)}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
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,useImperativeHandle as d}from"react";import h from"react-dom";import{
|
|
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,useImperativeHandle as d}from"react";import h from"react-dom";import{StyledButton as u,LinkOutlineIcon as p,DotsVerticalIcon as f,StyledMenuItem as m,StyledDialog as g,StyledInputField as y,StyledFormControl as b,StyledFormHelperText as v}from"asma-core-ui";import{Popover as w}from"@mui/material";var k,x={exports:{}},S={};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -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?ga.exports=function(){if(ma)return ya;ma=1;var e=t,n=ca,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 ya.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},ya}():ga.exports=(ba||(ba=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=ca,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;va.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)}()),va);var wa=ga.exports;class ka{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 xa="production"!==process.env.NODE_ENV,Sa=typeof window>"u",Oa=Sa||!!(typeof window<"u"&&window.next);class Ca{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 Sa||Oa?(xa&&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&&Sa&&xa)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 Zs(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 Ma(t={},e=[]){const s=n(t);s.current=t;const[a]=r((()=>new Ca(s))),l=ca.useSyncExternalStore(a.subscribe,a.getEditor,a.getServerSnapshot);return o(l),i(a.onRender(e)),function(t){const[e]=r((()=>new ka(t.editor))),n=wa.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 Ta=s({onDragStart:void 0});t.forwardRef(((e,n)=>{const{onDragStart:r}=a(Ta),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));const Ea=Object.freeze({left:0,top:0,width:16,height:16}),Na=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Aa=Object.freeze({...Ea,...Na}),Da=Object.freeze({...Aa,body:"",hidden:!1});function Ra(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 Da)r in Na?r in t&&!(r in n)&&(n[r]=Na[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function Ia(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let i={};function s(t){i=Ra(r[t]||o[t],i)}return s(e),n.forEach(s),Ra(t,i)}function La(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,Ia(t,o,i)),n.push(o))}return n}const Pa=/^[a-z0-9]+(-[a-z0-9]+)*$/,ja=(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&&!za(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&&!za(t)?null:t}if(n&&""===r){const t={provider:r,prefix:"",name:i};return e&&!za(t,n)?null:t}return null},za=(t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(Pa)||!(e&&""===t.prefix||t.prefix.match(Pa))||!t.name.match(Pa)),$a={provider:"",aliases:{},not_found:{},...Ea};function Ba(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Fa(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons||!Ba(t,$a))return null;const n=e.icons;for(const t in n){const e=n[t];if(!t.match(Pa)||"string"!=typeof e.body||!Ba(e,Da))return null}const r=e.aliases||Object.create(null);for(const t in r){const e=r[t],o=e.parent;if(!t.match(Pa)||"string"!=typeof o||!n[o]&&!r[o]||!Ba(e,Da))return null}return e}const _a=Object.create(null);function Va(t,e){const n=_a[t]||(_a[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 Ha(t,e){return Fa(e)?La(e,((e,n)=>{n?t.icons[e]=n:t.missing.add(e)})):[]}let Wa=!1;function Ka(t){return"boolean"==typeof t&&(Wa=t),Wa}function qa(t){const e="string"==typeof t?ja(t,!0,Wa):t;if(e){const t=Va(e.provider,e.prefix),n=e.name;return t.icons[n]||(t.missing.has(n)?null:void 0)}}function Ja(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),Wa&&!e&&!t.prefix){let e=!1;return Fa(t)&&(t.prefix="",La(t,((t,n)=>{n&&function(t,e){const n=ja(t,!0,Wa);return!!n&&function(t,e,n){try{if("string"==typeof n.body)return t.icons[e]={...n},!0}catch{}return!1}(Va(n.provider,n.prefix),n.name,e)}(t,n)&&(e=!0)}))),e}const n=t.prefix;if(!za({provider:e,prefix:n,name:"a"}))return!1;return!!Ha(Va(e,n),t)}const Ua=Object.freeze({width:null,height:null}),Ga=Object.freeze({...Ua,...Na}),Ya=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Qa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Xa(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(Ya);if(null===r||!r.length)return t;const o=[];let i=r.shift(),s=Qa.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 Za=/\sid="(\S+)"/g,tl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let el=0;function nl(t,e=tl){const n=[];let r;for(;r=Za.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+(el++).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 rl=Object.create(null);function ol(t){return rl[t]||rl[""]}function il(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 sl=Object.create(null),al=["https://api.simplesvg.com","https://api.unisvg.com"],ll=[];for(;al.length>0;)1===al.length||Math.random()>.5?ll.push(al.shift()):ll.push(al.pop());function cl(t,e){const n=il(e);return null!==n&&(sl[t]=n,!0)}function dl(t){return sl[t]}sl[""]=il({resources:["https://api.iconify.design"].concat(ll)});let hl=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch{}})();const ul={prepare:(t,e,n)=>{const r=[],o=function(t,e){const n=dl(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(!hl)return void n("abort",424);let r=function(t){if("string"==typeof t){const e=dl(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;hl(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 pl(t,e){t.forEach((t=>{const n=t.loaderCallbacks;n&&(t.loaderCallbacks=n.filter((t=>t.id!==e)))}))}let fl=0;var ml={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function gl(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 yl(t){const e={...ml,...t};let n=[];function r(){n=n.filter((t=>"pending"===t().status))}return{query:function(t,o,i){const s=gl(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 bl(){}const vl=Object.create(null);function wl(t,e,n){let r,o;if("string"==typeof t){const e=ol(t);if(!e)return n(void 0,424),bl;o=e.send;const i=function(t){if(!vl[t]){const e=dl(t);if(!e)return;const n={config:e,redundancy:yl(e)};vl[t]=n}return vl[t]}(t);i&&(r=i.redundancy)}else{const e=il(t);if(e){r=yl(e);const n=ol(t.resources?t.resources[0]:"");n&&(o=n.send)}}return r&&o?r.query(e,o,n)().abort:(n(void 0,424),bl)}const kl="iconify2",xl="iconify",Sl=xl+"-count",Ol=xl+"-version",Cl=36e5,Ml=168,Tl=50;function El(t,e){try{return t.getItem(e)}catch{}}function Nl(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Al(t,e){try{t.removeItem(e)}catch{}}function Dl(t,e){return Nl(t,Sl,e.toString())}function Rl(t){return parseInt(El(t,Sl))||0}const Il={local:!0,session:!0},Ll={local:new Set,session:new Set};let Pl=!1;let jl=typeof window>"u"?{}:window;function zl(t){const e=t+"Storage";try{if(jl&&jl[e]&&"number"==typeof jl[e].length)return jl[e]}catch{}Il[t]=!1}function $l(t,e){const n=zl(t);if(!n)return;const r=El(n,Ol);if(r!==kl){if(r){const t=Rl(n);for(let e=0;e<t;e++)Al(n,xl+e.toString())}return Nl(n,Ol,kl),void Dl(n,0)}const o=Math.floor(Date.now()/Cl)-Ml,i=t=>{const r=xl+t.toString(),i=El(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{}Al(n,r)}};let s=Rl(n);for(let e=s-1;e>=0;e--)i(e)||(e===s-1?(s--,Dl(n,s)):Ll[t].add(e))}function Bl(){if(!Pl){Pl=!0;for(const t in Il)$l(t,(t=>{const e=t.data,n=Va(t.provider,e.prefix);if(!Ha(n,e).length)return!1;const r=e.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,r):r,!0}))}}function Fl(t,e){function n(n){let r;if(!Il[n]||!(r=zl(n)))return;const o=Ll[n];let i;if(o.size)o.delete(i=Array.from(o).shift());else if(i=Rl(r),i>=Tl||!Dl(r,i+1))return;const s={cached:Math.floor(Date.now()/Cl),provider:t.provider,data:e};return Nl(r,xl+i.toString(),JSON.stringify(s))}Pl||Bl(),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 Il)$l(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 _l(){}function Vl(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||pl([t],e.id),e.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),e.abort))}))})))}(t)})))}const Hl=(t,e)=>{const n=function(t,e=!0,n=!1){const r=[];return t.forEach((t=>{const o="string"==typeof t?ja(t,e,n):t;o&&r.push(o)})),r}(t,!0,Ka()),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]=Va(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,_l)})),()=>{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(Va(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=Va(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=ol(e))&&o.prepare(e,n,r).forEach((n=>{wl(e,n,(e=>{if("object"!=typeof e)n.icons.forEach((e=>{t.missing.add(e)}));else try{const n=Ha(t,e);if(!n.length)return;const r=t.pendingIcons;r&&n.forEach((t=>{r.delete(t)})),Fl(t,e)}catch(t){console.error(t)}Vl(t)}))}))})))}(t,o[e][n])})),e?function(t,e,n){const r=fl++,o=pl.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):_l};const Wl=/[\s,]+/;function Kl(t,e){e.split(Wl).forEach((e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}}))}function ql(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 Jl(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 Ul;function Gl(t){return void 0===Ul&&function(){try{Ul=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{Ul=null}}(),Ul?Ul.createHTML(t):t}const Yl={...Ga,inline:!1},Ql={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Xl={display:"inline-block"},Zl={backgroundColor:"currentColor"},tc={backgroundColor:"transparent"},ec={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},nc={WebkitMask:Zl,mask:Zl,background:tc};for(const t in nc){const e=nc[t];for(const n in ec)e[t+n]=ec[n]}const rc={...Yl,inline:!0};function oc(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const ic=(t,e,n)=>{const r=e.inline?rc:Yl,o=function(t,e){const n={...t};for(const t in e){const r=e[t],o=typeof r;t in Ua?(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?Ql:{}};if(n){const t=ja(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&&Kl(o,n);break;case"color":s.color=n;break;case"rotate":"string"==typeof n?o[t]=ql(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={...Aa,...t},r={...Ga,...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=Xa(h,l/c)):(d="auto"===s?l:s,h=null===a?Xa(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:Gl(nl(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":Jl(g),width:oc(h.width),height:oc(h.height),...Xl,...m?Zl:tc,...a},l("span",c)};var sc;if(Ka(!0),sc=ul,rl[""]=sc,typeof document<"u"&&typeof window<"u"){Bl();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||!Ja(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;cl(t,r)||console.error(n)}catch{console.error(n)}}}}function ac(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=qa(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=qa(n);if(h({name:n,data:r}))if(void 0===r){const t=Hl([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?ic({...Aa,...f},t,p):t.children?t.children:l("span",{})}const lc=e(((t,e)=>ac({...t,_ref:e})));e(((t,e)=>ac({inline:!0,...t,_ref:e})));const cc=({open:t,setOpen:e,editor:n})=>{const[o,s]=r("");i((()=>{if(t){const t=n.getAttributes("link").href;t&&s(t)}}),[t,n]);const a=new URLSearchParams(window.location.search).get("lang"),l="no"===a?"Legg til lenke":"Add link",c="no"===a?"Gå tilbake":"Go back";return M.jsx(u,{open:t,dataTest:"link-modal-rte",onClose:()=>e(!1),className:"z-[99] relative",children:M.jsxs("main",{className:"flex flex-col items-start p-0 gap-6 m-4",children:[M.jsx("div",{className:"text-xl font-bold absolute top-4 left-4",children:l}),M.jsx("div",{children:M.jsx(p,{dataTest:"link-input-field",size:"small",value:o,onChange:t=>s(t.target.value)})}),M.jsxs("div",{className:"flex gap-2 p-0 w-full justify-end",children:[M.jsx(f,{dataTest:"delete-customer-confirm-button",size:"medium",variant:"contained",onClick:()=>{n.chain().focus().setLink({href:o}).run(),e(!1),s("")},children:l}),M.jsx(f,{dataTest:"delete-customer-reject-button",size:"medium",variant:"outlined",onClick:()=>{e(!1),s("")},children:c})]})]})})},dc=({editor:t,onClose:e,error:o,focused:s})=>{const[a,l]=r(!1),[d,h]=r(0),u=n(null),p="no"===new URLSearchParams(window.location.search).get("lang")?"Lukk":"Close",[b,v]=r(!1),[k,x]=r([]);i((()=>{const e=new ResizeObserver((()=>{var e;if(u.current){const n=u.current.clientWidth;v(n<432);const r=null==(e=[{width:156,buttons:0},{width:192,buttons:1},{width:270,buttons:2},{width:316,buttons:3},{width:352,buttons:4},{width:388,buttons:5},{width:428,buttons:6},{width:432,buttons:7},{width:1/0,buttons:8}].find((t=>n<t.width)))?void 0:e.buttons;if(h(void 0!==r?r:8),r){const e=[];r<8&&e.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>l(!0),children:M.jsx(g,{})},"link")),r<7&&e.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleItalic().run(),children:M.jsx(lc,{icon:"material-symbols:format-italic",height:20})},"italic")),r<6&&e.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBold().run(),children:M.jsx(lc,{icon:"ooui:bold-b"})},"bold")),r<5&&e.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleOrderedList().run(),children:M.jsx(lc,{icon:"cil:list-numbered"})},"ordered")),r<4&&e.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBulletList().run(),children:M.jsx(lc,{icon:"material-symbols:list",fontSize:24})},"bullet")),x(e)}}}));return u.current&&e.observe(u.current),()=>e.disconnect()}),[t]);const{anchorEl:S,open:O,handleClose:C,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 M.jsxs("div",{className:E("toolbar",{"toolbar-error":o,"toolbar-focused":s}),ref:u,children:[M.jsxs("div",{className:"flex flex-row gap-1",children:[d>=1&&M.jsx(f,{dataTest:"richeditor-h1-button",size:"small",variant:t.isActive("heading",{level:1})?"outlined":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().setNode("heading",{level:1}).run()},children:M.jsx(lc,{icon:"bi:type-h1"})}),d>=2&&M.jsx(f,{dataTest:"richeditor-h2-button",size:"small",variant:t.isActive("heading",{level:2})?"outlined":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().setNode("heading",{level:2}).run()},children:M.jsx(lc,{icon:"bi:type-h2"})}),d>=3&&M.jsxs("div",{className:"select-wrapper",children:[M.jsxs("select",{className:"font-size-select",onChange:e=>{const n=e.target.value;t.chain().focus().setMark("textStyle",{fontSize:{small:"10px",normal:"16px",large:"24px",huge:"32px"}[n]}).run()},defaultValue:"normal",children:[M.jsx("option",{value:"small",children:"Small"}),M.jsx("option",{value:"normal",children:"Normal"}),M.jsx("option",{value:"large",children:"Large"}),M.jsx("option",{value:"huge",children:"Huge"})]}),M.jsx(lc,{icon:"tabler:caret-up-down-filled",className:"chevron-icon"})]}),d>=4&&M.jsx(f,{dataTest:"richeditor-bullet-list-button",size:"small",variant:t.isActive("bulletList")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleBulletList().run(),children:M.jsx(lc,{icon:"material-symbols:list",fontSize:24})}),d>=5&&M.jsx(f,{dataTest:"richeditor-ordered-list-button",size:"small",variant:t.isActive("orderedList")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleOrderedList().run(),children:M.jsx(lc,{icon:"cil:list-numbered"})}),d>=6&&M.jsx(f,{dataTest:"richeditor-bold-button",size:"small",variant:t.isActive("bold")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleBold().run(),children:M.jsx(lc,{icon:"ooui:bold-b"})}),d>=7&&M.jsx(f,{dataTest:"richeditor-italic-button",size:"small",variant:t.isActive("italic")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleItalic().run(),children:M.jsx(lc,{icon:"material-symbols:format-italic",height:20})}),d>=8&&M.jsx(f,{dataTest:"richeditor-link-button",size:"small",variant:t.isActive("link")?"outlined":"textGray",onClick:()=>l(!0),children:M.jsx(g,{})})]}),M.jsxs("div",{className:"flex flex-row",children:[b&&M.jsxs(M.Fragment,{children:[M.jsx(f,{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:M.jsx(y,{className:"text-delta-800",width:20,height:20})}),M.jsx(w,{open:O,anchorEl:S,onClose:C,onClick:C,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:k})]}),M.jsx(f,{dataTest:"richeditor-close-toolbar-button",size:"small",variant:"text",onClick:e,children:p})]}),M.jsx(cc,{open:a,setOpen:l,editor:t})]})},hc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,mc=ss.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",Hi(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[ta({find:hc,type:this.type}),ta({find:pc,type:this.type})]},addPasteRules(){return[ra({find:uc,type:this.type}),ra({find:fc,type:this.type})]}}),gc=na.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Hi(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)}}}),yc=ss.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Rs(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),bc=/^\s*([-+*])\s$/,vc=na.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",Hi(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(gc.name,this.editor.getAttributes(yc.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ea({find:bc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ea({find:bc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yc.name),editor:this.editor})),[t]}}),wc=na.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]}`,Hi(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 Zi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=qi(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}})))}}),kc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,xc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Sc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Oc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Cc=ss.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",Hi(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[ta({find:kc,type:this.type}),ta({find:Sc,type:this.type})]},addPasteRules(){return[ra({find:xc,type:this.type}),ra({find:Oc,type:this.type})]}}),Mc="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Tc="ελ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",Ec=(t,e)=>{for(const n in e)t[n]=e[n];return t},Nc="numeric",Ac="ascii",Dc="alpha",Rc="asciinumeric",Ic="alphanumeric",Lc="domain",Pc="emoji",jc="scheme",zc="slashscheme",$c="whitespace";function Bc(t,e){return t in e||(e[t]=[]),e[t]}function Fc(t,e,n){e[Nc]&&(e[Rc]=!0,e[Ic]=!0),e[Ac]&&(e[Rc]=!0,e[Dc]=!0),e[Rc]&&(e[Ic]=!0),e[Dc]&&(e[Ic]=!0),e[Ic]&&(e[Lc]=!0),e[Pc]&&(e[Lc]=!0);for(const r in e){const e=Bc(r,n);e.indexOf(t)<0&&e.push(t)}}function _c(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}_c.groups={},_c.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||_c.groups,e&&e.j?o=e:(o=new _c(e),n&&r&&Fc(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||_c.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 _c,Ec(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new _c,i){if(r)if(s.t&&"string"==typeof s.t){const t=Ec(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);Fc(i,t,r)}else n&&Fc(i,n,r);s.t=i}return o.j[t]=s,s}};const Vc=(t,e,n,r,o)=>t.ta(e,n,r,o),Hc=(t,e,n,r,o)=>t.tr(e,n,r,o),Wc=(t,e,n,r,o)=>t.ts(e,n,r,o),Kc=(t,e,n,r,o)=>t.tt(e,n,r,o),qc="WORD",Jc="UWORD",Uc="LOCALHOST",Gc="TLD",Yc="UTLD",Qc="SCHEME",Xc="SLASH_SCHEME",Zc="NUM",td="WS",ed="NL",nd="OPENBRACE",rd="CLOSEBRACE",od="OPENBRACKET",id="CLOSEBRACKET",sd="OPENPAREN",ad="CLOSEPAREN",ld="OPENANGLEBRACKET",cd="CLOSEANGLEBRACKET",dd="FULLWIDTHLEFTPAREN",hd="FULLWIDTHRIGHTPAREN",ud="LEFTCORNERBRACKET",pd="RIGHTCORNERBRACKET",fd="LEFTWHITECORNERBRACKET",md="RIGHTWHITECORNERBRACKET",gd="FULLWIDTHLESSTHAN",yd="FULLWIDTHGREATERTHAN",bd="AMPERSAND",vd="APOSTROPHE",wd="ASTERISK",kd="AT",xd="BACKSLASH",Sd="BACKTICK",Od="CARET",Cd="COLON",Md="COMMA",Td="DOLLAR",Ed="DOT",Nd="EQUALS",Ad="EXCLAMATION",Dd="HYPHEN",Rd="PERCENT",Id="PIPE",Ld="PLUS",Pd="POUND",jd="QUERY",zd="QUOTE",$d="SEMI",Bd="SLASH",Fd="TILDE",_d="UNDERSCORE",Vd="EMOJI",Hd="SYM";var Wd=Object.freeze({__proto__:null,WORD:qc,UWORD:Jc,LOCALHOST:Uc,TLD:Gc,UTLD:Yc,SCHEME:Qc,SLASH_SCHEME:Xc,NUM:Zc,WS:td,NL:ed,OPENBRACE:nd,CLOSEBRACE:rd,OPENBRACKET:od,CLOSEBRACKET:id,OPENPAREN:sd,CLOSEPAREN:ad,OPENANGLEBRACKET:ld,CLOSEANGLEBRACKET:cd,FULLWIDTHLEFTPAREN:dd,FULLWIDTHRIGHTPAREN:hd,LEFTCORNERBRACKET:ud,RIGHTCORNERBRACKET:pd,LEFTWHITECORNERBRACKET:fd,RIGHTWHITECORNERBRACKET:md,FULLWIDTHLESSTHAN:gd,FULLWIDTHGREATERTHAN:yd,AMPERSAND:bd,APOSTROPHE:vd,ASTERISK:wd,AT:kd,BACKSLASH:xd,BACKTICK:Sd,CARET:Od,COLON:Cd,COMMA:Md,DOLLAR:Td,DOT:Ed,EQUALS:Nd,EXCLAMATION:Ad,HYPHEN:Dd,PERCENT:Rd,PIPE:Id,PLUS:Ld,POUND:Pd,QUERY:jd,QUOTE:zd,SEMI:$d,SLASH:Bd,TILDE:Fd,UNDERSCORE:_d,EMOJI:Vd,SYM:Hd});const Kd=/[a-z]/,qd=/\p{L}/u,Jd=/\p{Emoji}/u,Ud=/\d/,Gd=/\s/,Yd="\n",Qd="️",Xd="";let Zd=null,th=null;function eh(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 _c(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new _c(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function nh(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 rh={defaultProtocol:"http",events:null,format:ih,formatHref:ih,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oh(t,e){void 0===e&&(e=null);let n=Ec({},rh);t&&(n=Ec(n,t instanceof oh?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 ih(t){return t}function sh(t,e){this.t="token",this.v=t,this.tk=e}function ah(t,e){class n extends sh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}oh.prototype={o:rh,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]:rh[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)}},sh.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=rh.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&&Ec(s,d),{tagName:o,attributes:s,content:i,eventListeners:h}}};const lh=ah("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ch=ah("text"),dh=ah("nl"),hh=ah("url",{isLink:!0,toHref(t){return void 0===t&&(t=rh.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Uc&&t[1].t===Cd}}),uh=t=>new _c(t);function ph(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const fh=typeof console<"u"&&console&&console.warn||(()=>{}),mh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gh(t,e){if(void 0===e&&(e=!1),mh.initialized&&fh(`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');mh.customSchemes.push([t,e])}function yh(){mh.scanner=function(t){void 0===t&&(t=[]);const e={};_c.groups=e;const n=new _c;null==Zd&&(Zd=nh(Mc)),null==th&&(th=nh(Tc)),Kc(n,"'",vd),Kc(n,"{",nd),Kc(n,"}",rd),Kc(n,"[",od),Kc(n,"]",id),Kc(n,"(",sd),Kc(n,")",ad),Kc(n,"<",ld),Kc(n,">",cd),Kc(n,"(",dd),Kc(n,")",hd),Kc(n,"「",ud),Kc(n,"」",pd),Kc(n,"『",fd),Kc(n,"』",md),Kc(n,"<",gd),Kc(n,">",yd),Kc(n,"&",bd),Kc(n,"*",wd),Kc(n,"@",kd),Kc(n,"`",Sd),Kc(n,"^",Od),Kc(n,":",Cd),Kc(n,",",Md),Kc(n,"$",Td),Kc(n,".",Ed),Kc(n,"=",Nd),Kc(n,"!",Ad),Kc(n,"-",Dd),Kc(n,"%",Rd),Kc(n,"|",Id),Kc(n,"+",Ld),Kc(n,"#",Pd),Kc(n,"?",jd),Kc(n,'"',zd),Kc(n,"/",Bd),Kc(n,";",$d),Kc(n,"~",Fd),Kc(n,"_",_d),Kc(n,"\\",xd);const r=Hc(n,Ud,Zc,{[Nc]:!0});Hc(r,Ud,r);const o=Hc(n,Kd,qc,{[Ac]:!0});Hc(o,Kd,o);const i=Hc(n,qd,Jc,{[Dc]:!0});Hc(i,Kd),Hc(i,qd,i);const s=Hc(n,Gd,td,{[$c]:!0});Kc(n,Yd,ed,{[$c]:!0}),Kc(s,Yd),Hc(s,Gd,s);const a=Hc(n,Jd,Vd,{[Pc]:!0});Hc(a,Jd,a),Kc(a,Qd,a);const l=Kc(a,Xd);Hc(l,Jd,a);const c=[[Kd,o]],d=[[Kd,null],[qd,i]];for(let t=0;t<Zd.length;t++)eh(n,Zd[t],Gc,qc,c);for(let t=0;t<th.length;t++)eh(n,th[t],Yc,Jc,d);Fc(Gc,{tld:!0,ascii:!0},e),Fc(Yc,{utld:!0,alpha:!0},e),eh(n,"file",Qc,qc,c),eh(n,"mailto",Qc,qc,c),eh(n,"http",Xc,qc,c),eh(n,"https",Xc,qc,c),eh(n,"ftp",Xc,qc,c),eh(n,"ftps",Xc,qc,c),Fc(Qc,{scheme:!0,ascii:!0},e),Fc(Xc,{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]?{[jc]:!0}:{[zc]:!0};r.indexOf("-")>=0?o[Lc]=!0:Kd.test(r)?Ud.test(r)?o[Rc]=!0:o[Ac]=!0:o[Nc]=!0,Wc(n,r,r,o)}return Wc(n,"localhost",Uc,{ascii:!0}),n.jd=new _c(Hd),{start:n,tokens:Ec({groups:e},Wd)}}(mh.customSchemes);for(let t=0;t<mh.tokenQueue.length;t++)mh.tokenQueue[t][1]({scanner:mh.scanner});mh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([bd,wd,kd,xd,Sd,Od,Td,Nd,Dd,Zc,Rd,Id,Ld,Pd,Bd,Hd,Fd,_d]),r=[vd,Cd,Md,Ed,Ad,jd,zd,$d,ld,cd,nd,rd,id,od,sd,ad,dd,hd,ud,pd,fd,md,gd,yd],o=[bd,vd,wd,xd,Sd,Od,Td,Nd,Dd,nd,rd,Rd,Id,Ld,Pd,jd,Bd,Hd,Fd,_d],i=uh(),s=Kc(i,Fd);Vc(s,o,s),Vc(s,e.domain,s);const a=uh(),l=uh(),c=uh();Vc(i,e.domain,a),Vc(i,e.scheme,l),Vc(i,e.slashscheme,c),Vc(a,o,s),Vc(a,e.domain,a);const d=Kc(a,kd);Kc(s,kd,d),Kc(l,kd,d),Kc(c,kd,d);const h=Kc(s,Ed);Vc(h,o,s),Vc(h,e.domain,s);const u=uh();Vc(d,e.domain,u),Vc(u,e.domain,u);const p=Kc(u,Ed);Vc(p,e.domain,u);const f=uh(lh);Vc(p,e.tld,f),Vc(p,e.utld,f),Kc(d,Uc,f);const m=Kc(u,Dd);Vc(m,e.domain,u),Vc(f,e.domain,u),Kc(f,Ed,p),Kc(f,Dd,m);const g=Kc(f,Cd);Vc(g,e.numeric,lh);const y=Kc(a,Dd),b=Kc(a,Ed);Vc(y,e.domain,a),Vc(b,o,s),Vc(b,e.domain,a);const v=uh(hh);Vc(b,e.tld,v),Vc(b,e.utld,v),Vc(v,e.domain,a),Vc(v,o,s),Kc(v,Ed,b),Kc(v,Dd,y),Kc(v,kd,d);const w=Kc(v,Cd),k=uh(hh);Vc(w,e.numeric,k);const x=uh(hh),S=uh();Vc(x,n,x),Vc(x,r,S),Vc(S,n,x),Vc(S,r,S),Kc(v,Bd,x),Kc(k,Bd,x);const O=Kc(l,Cd),C=Kc(c,Cd),M=Kc(C,Bd),T=Kc(M,Bd);Vc(l,e.domain,a),Kc(l,Ed,b),Kc(l,Dd,y),Vc(c,e.domain,a),Kc(c,Ed,b),Kc(c,Dd,y),Vc(O,e.domain,x),Kc(O,Bd,x),Vc(T,e.domain,x),Vc(T,n,x),Kc(T,Bd,x);const E=[[nd,rd],[od,id],[sd,ad],[ld,cd],[dd,hd],[ud,pd],[fd,md],[gd,yd]];for(let t=0;t<E.length;t++){const[e,o]=E[t],i=Kc(x,e);Kc(S,e,i),Kc(i,o,x);const s=uh(hh);Vc(i,n,s);const a=uh();Vc(i,r),Vc(s,n,s),Vc(s,r,a),Vc(a,n,s),Vc(a,r,a),Kc(s,o,x),Kc(a,o,x)}return Kc(i,Uc,v),Kc(i,ed,dh),{start:i,tokens:Wd}}(mh.scanner.tokens);for(let t=0;t<mh.pluginQueue.length;t++)mh.pluginQueue[t][1]({scanner:mh.scanner,parser:mh.parser});mh.initialized=!0}function bh(t){return mh.initialized||yh(),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(ph(ch,e,s)),s=[]),o-=u,d-=u;const t=h.t,r=n.slice(o-d,o);i.push(ph(t,e,r))}}return s.length>0&&i.push(ph(ch,e,s)),i}(mh.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}(mh.scanner.start,t))}function vh(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 oh(n),o=bh(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 wh(t){return new qe({key:new Ge("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 Ce(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}})}))})),Ps(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=bh(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=>{js(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 kh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function xh(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(kh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Sh=ss.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?gh(t.scheme,t.optionalSlashes):gh(t)}))},onDestroy(){_c.groups={},mh.scanner=null,mh.parser=null,mh.tokenQueue=[],mh.pluginQueue=[],mh.customSchemes=[],mh.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||!xh(e,this.options.protocols))&&null}}]},renderHTML({HTMLAttributes:t}){return xh(t.href,this.options.protocols)?["a",Hi(this.options.HTMLAttributes,t),0]:["a",Hi(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[ra({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=vh(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(wh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),!0===this.options.openOnClick&&t.push(function(t){return new qe({key:new Ge("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=Ls(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 qe({key:new Ge("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=vh(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}}),Oh=na.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Hi(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)}}}),Ch=na.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Hi(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)}}}),Mh=ss.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Rs(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),Th=/^(\d+)\.\s$/,Eh=na.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",Hi(this.options.HTMLAttributes,n),0]:["ol",Hi(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(Ch.name,this.editor.getAttributes(Mh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ea({find:Th,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=ea({find:Th,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Mh.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),Nh=na.create({name:"doc",topNode:!0,content:"block+"}),Ah=na.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Dh=na.create({name:"text",group:"inline"}),Rh=ss.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Rs(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}});var Ih=hs.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 Lh=[Nh,Ah,Dh,Rh],Ph=[wc.configure({levels:[1,2]}),Oh,vc,Eh,Sh,mc,Cc,Ih],jh=({dataTest:t,id:e,inputRef:n,className:o,disabled:s,readOnly:a,error:l,placeholder:c,helperText:h,required:u,hideToolbar:p,noDefaultStyles:m,...g})=>{const y=Ma({...g,extensions:[...Lh,...Ph,...g.extensions||[]],shouldRerenderOnTransaction:g.shouldRerenderOnTransaction||!1,immediatelyRender:g.immediatelyRender||!0,editable:g.editable||!s&&!a}),[w,k]=r(g.toolbarDefaultVisible);d(n,(()=>y));const[x,S]=r(!1);return i((()=>{const t=()=>S(!0),e=()=>S(!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?M.jsxs(b,{className:o,children:[g.title&&M.jsx("p",{className:"font-semibold mb-1 text-delta-800",children:g.title}),M.jsxs("div",{className:E("flex flex-col h-full"),children:[M.jsxs(fa,{id:e,className:E("relative",!m&&"core-ui-rte",!m&&!s&&!a&&"core-ui-rte-edit-mode",a&&"core-ui-rte-readonly-mode",l&&(w?"core-ui-rte-tools-error":"core-ui-rte-error"),(p||!w)&&"core-ui-rte-hide-toolbar",l&&"error-state"),editor:y,onClick:()=>y.chain().focus().run(),style:{"--max-scrollable-height":g.maxScrollableHeight?`${g.maxScrollableHeight}px`:"none"},children:[c&&!g.content&&!a&&M.jsx("p",{className:"absolute top-2 left-[14px] text-gray-500 text-base",children:c}),!p&&!s&&!a&&!w&&M.jsx(f,{className:"absolute top-1 right-4",dataTest:"richeditor-show-toolbar-button",size:"small",variant:"textGray",onClick:()=>k(!0),children:M.jsx(lc,{icon:"material-symbols:format-color-text"})})]}),!p&&!s&&!a&&w&&M.jsx(dc,{editor:y,onClose:()=>k(!1),error:l,focused:x})]}),(l||u)&&!a&&M.jsx(v,{error:l,"data-test":`error-${t}`,children:h})]}):null};export{jh as RichInput};
|
|
56
|
+
*/"production"===process.env.NODE_ENV?ga.exports=function(){if(ma)return ya;ma=1;var e=t,n=ca,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 ya.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},ya}():ga.exports=(ba||(ba=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=ca,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;va.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)}()),va);var wa=ga.exports;class ka{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 xa="production"!==process.env.NODE_ENV,Sa=typeof window>"u",Oa=Sa||!!(typeof window<"u"&&window.next);class Ca{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 Sa||Oa?(xa&&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&&Sa&&xa)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 Zs(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 Ma(t={},e=[]){const s=n(t);s.current=t;const[a]=r((()=>new Ca(s))),l=ca.useSyncExternalStore(a.subscribe,a.getEditor,a.getServerSnapshot);return o(l),i(a.onRender(e)),function(t){const[e]=r((()=>new ka(t.editor))),n=wa.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 Ta=s({onDragStart:void 0});t.forwardRef(((e,n)=>{const{onDragStart:r}=a(Ta),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));const Ea=Object.freeze({left:0,top:0,width:16,height:16}),Na=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Aa=Object.freeze({...Ea,...Na}),Da=Object.freeze({...Aa,body:"",hidden:!1});function Ra(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 Da)r in Na?r in t&&!(r in n)&&(n[r]=Na[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function Ia(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let i={};function s(t){i=Ra(r[t]||o[t],i)}return s(e),n.forEach(s),Ra(t,i)}function La(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,Ia(t,o,i)),n.push(o))}return n}const Pa=/^[a-z0-9]+(-[a-z0-9]+)*$/,ja=(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&&!za(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&&!za(t)?null:t}if(n&&""===r){const t={provider:r,prefix:"",name:i};return e&&!za(t,n)?null:t}return null},za=(t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(Pa)||!(e&&""===t.prefix||t.prefix.match(Pa))||!t.name.match(Pa)),$a={provider:"",aliases:{},not_found:{},...Ea};function Ba(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Fa(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons||!Ba(t,$a))return null;const n=e.icons;for(const t in n){const e=n[t];if(!t.match(Pa)||"string"!=typeof e.body||!Ba(e,Da))return null}const r=e.aliases||Object.create(null);for(const t in r){const e=r[t],o=e.parent;if(!t.match(Pa)||"string"!=typeof o||!n[o]&&!r[o]||!Ba(e,Da))return null}return e}const _a=Object.create(null);function Va(t,e){const n=_a[t]||(_a[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 Ha(t,e){return Fa(e)?La(e,((e,n)=>{n?t.icons[e]=n:t.missing.add(e)})):[]}let Wa=!1;function Ka(t){return"boolean"==typeof t&&(Wa=t),Wa}function qa(t){const e="string"==typeof t?ja(t,!0,Wa):t;if(e){const t=Va(e.provider,e.prefix),n=e.name;return t.icons[n]||(t.missing.has(n)?null:void 0)}}function Ja(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),Wa&&!e&&!t.prefix){let e=!1;return Fa(t)&&(t.prefix="",La(t,((t,n)=>{n&&function(t,e){const n=ja(t,!0,Wa);return!!n&&function(t,e,n){try{if("string"==typeof n.body)return t.icons[e]={...n},!0}catch{}return!1}(Va(n.provider,n.prefix),n.name,e)}(t,n)&&(e=!0)}))),e}const n=t.prefix;if(!za({provider:e,prefix:n,name:"a"}))return!1;return!!Ha(Va(e,n),t)}const Ua=Object.freeze({width:null,height:null}),Ga=Object.freeze({...Ua,...Na}),Ya=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Qa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Xa(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(Ya);if(null===r||!r.length)return t;const o=[];let i=r.shift(),s=Qa.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 Za=/\sid="(\S+)"/g,tl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let el=0;function nl(t,e=tl){const n=[];let r;for(;r=Za.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+(el++).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 rl=Object.create(null);function ol(t){return rl[t]||rl[""]}function il(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 sl=Object.create(null),al=["https://api.simplesvg.com","https://api.unisvg.com"],ll=[];for(;al.length>0;)1===al.length||Math.random()>.5?ll.push(al.shift()):ll.push(al.pop());function cl(t,e){const n=il(e);return null!==n&&(sl[t]=n,!0)}function dl(t){return sl[t]}sl[""]=il({resources:["https://api.iconify.design"].concat(ll)});let hl=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch{}})();const ul={prepare:(t,e,n)=>{const r=[],o=function(t,e){const n=dl(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(!hl)return void n("abort",424);let r=function(t){if("string"==typeof t){const e=dl(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;hl(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 pl(t,e){t.forEach((t=>{const n=t.loaderCallbacks;n&&(t.loaderCallbacks=n.filter((t=>t.id!==e)))}))}let fl=0;var ml={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function gl(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 yl(t){const e={...ml,...t};let n=[];function r(){n=n.filter((t=>"pending"===t().status))}return{query:function(t,o,i){const s=gl(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 bl(){}const vl=Object.create(null);function wl(t,e,n){let r,o;if("string"==typeof t){const e=ol(t);if(!e)return n(void 0,424),bl;o=e.send;const i=function(t){if(!vl[t]){const e=dl(t);if(!e)return;const n={config:e,redundancy:yl(e)};vl[t]=n}return vl[t]}(t);i&&(r=i.redundancy)}else{const e=il(t);if(e){r=yl(e);const n=ol(t.resources?t.resources[0]:"");n&&(o=n.send)}}return r&&o?r.query(e,o,n)().abort:(n(void 0,424),bl)}const kl="iconify2",xl="iconify",Sl=xl+"-count",Ol=xl+"-version",Cl=36e5,Ml=168,Tl=50;function El(t,e){try{return t.getItem(e)}catch{}}function Nl(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Al(t,e){try{t.removeItem(e)}catch{}}function Dl(t,e){return Nl(t,Sl,e.toString())}function Rl(t){return parseInt(El(t,Sl))||0}const Il={local:!0,session:!0},Ll={local:new Set,session:new Set};let Pl=!1;let jl=typeof window>"u"?{}:window;function zl(t){const e=t+"Storage";try{if(jl&&jl[e]&&"number"==typeof jl[e].length)return jl[e]}catch{}Il[t]=!1}function $l(t,e){const n=zl(t);if(!n)return;const r=El(n,Ol);if(r!==kl){if(r){const t=Rl(n);for(let e=0;e<t;e++)Al(n,xl+e.toString())}return Nl(n,Ol,kl),void Dl(n,0)}const o=Math.floor(Date.now()/Cl)-Ml,i=t=>{const r=xl+t.toString(),i=El(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{}Al(n,r)}};let s=Rl(n);for(let e=s-1;e>=0;e--)i(e)||(e===s-1?(s--,Dl(n,s)):Ll[t].add(e))}function Bl(){if(!Pl){Pl=!0;for(const t in Il)$l(t,(t=>{const e=t.data,n=Va(t.provider,e.prefix);if(!Ha(n,e).length)return!1;const r=e.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,r):r,!0}))}}function Fl(t,e){function n(n){let r;if(!Il[n]||!(r=zl(n)))return;const o=Ll[n];let i;if(o.size)o.delete(i=Array.from(o).shift());else if(i=Rl(r),i>=Tl||!Dl(r,i+1))return;const s={cached:Math.floor(Date.now()/Cl),provider:t.provider,data:e};return Nl(r,xl+i.toString(),JSON.stringify(s))}Pl||Bl(),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 Il)$l(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 _l(){}function Vl(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||pl([t],e.id),e.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),e.abort))}))})))}(t)})))}const Hl=(t,e)=>{const n=function(t,e=!0,n=!1){const r=[];return t.forEach((t=>{const o="string"==typeof t?ja(t,e,n):t;o&&r.push(o)})),r}(t,!0,Ka()),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]=Va(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,_l)})),()=>{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(Va(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=Va(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=ol(e))&&o.prepare(e,n,r).forEach((n=>{wl(e,n,(e=>{if("object"!=typeof e)n.icons.forEach((e=>{t.missing.add(e)}));else try{const n=Ha(t,e);if(!n.length)return;const r=t.pendingIcons;r&&n.forEach((t=>{r.delete(t)})),Fl(t,e)}catch(t){console.error(t)}Vl(t)}))}))})))}(t,o[e][n])})),e?function(t,e,n){const r=fl++,o=pl.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):_l};const Wl=/[\s,]+/;function Kl(t,e){e.split(Wl).forEach((e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}}))}function ql(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 Jl(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 Ul;function Gl(t){return void 0===Ul&&function(){try{Ul=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{Ul=null}}(),Ul?Ul.createHTML(t):t}const Yl={...Ga,inline:!1},Ql={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Xl={display:"inline-block"},Zl={backgroundColor:"currentColor"},tc={backgroundColor:"transparent"},ec={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},nc={WebkitMask:Zl,mask:Zl,background:tc};for(const t in nc){const e=nc[t];for(const n in ec)e[t+n]=ec[n]}const rc={...Yl,inline:!0};function oc(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const ic=(t,e,n)=>{const r=e.inline?rc:Yl,o=function(t,e){const n={...t};for(const t in e){const r=e[t],o=typeof r;t in Ua?(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?Ql:{}};if(n){const t=ja(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&&Kl(o,n);break;case"color":s.color=n;break;case"rotate":"string"==typeof n?o[t]=ql(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={...Aa,...t},r={...Ga,...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=Xa(h,l/c)):(d="auto"===s?l:s,h=null===a?Xa(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:Gl(nl(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":Jl(g),width:oc(h.width),height:oc(h.height),...Xl,...m?Zl:tc,...a},l("span",c)};var sc;if(Ka(!0),sc=ul,rl[""]=sc,typeof document<"u"&&typeof window<"u"){Bl();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||!Ja(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;cl(t,r)||console.error(n)}catch{console.error(n)}}}}function ac(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=qa(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=qa(n);if(h({name:n,data:r}))if(void 0===r){const t=Hl([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?ic({...Aa,...f},t,p):t.children?t.children:l("span",{})}const lc=e(((t,e)=>ac({...t,_ref:e})));e(((t,e)=>ac({inline:!0,...t,_ref:e})));const cc=()=>{const t=new URLSearchParams(window.location.search).get("lang")||localStorage.getItem("lang")||"en";return{Norsk:"no"===t,English:"en"===t}},dc=({editor:t,onClose:e,error:o,focused:s,openLinkDialog:a})=>{const[l,d]=r(0),h=n(null),{Norsk:g}=cc(),y=g?"Lukk":"Close",[b,v]=r(!1),[k,x]=r([]);i((()=>{const e=new ResizeObserver((()=>{var e;if(h.current){const n=h.current.clientWidth;v(n<432);const r=null==(e=[{width:156,buttons:0},{width:192,buttons:1},{width:270,buttons:2},{width:316,buttons:3},{width:352,buttons:4},{width:388,buttons:5},{width:428,buttons:6},{width:432,buttons:7},{width:1/0,buttons:8}].find((t=>n<t.width)))?void 0:e.buttons;d(void 0!==r?r:8);const o=[];Number(r)<8&&o.push(M.jsx(m,{className:"flex items-center justify-center",onClick:a,children:M.jsx(p,{})},"link")),Number(r)<7&&o.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleItalic().run(),children:M.jsx(lc,{icon:"material-symbols:format-italic",height:20})},"italic")),Number(r)<6&&o.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBold().run(),children:M.jsx(lc,{icon:"ooui:bold-b"})},"bold")),Number(r)<5&&o.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleOrderedList().run(),children:M.jsx(lc,{icon:"cil:list-numbered"})},"ordered")),Number(r)<4&&o.push(M.jsx(m,{className:"flex items-center justify-center",onClick:()=>t.chain().focus().toggleBulletList().run(),children:M.jsx(lc,{icon:"material-symbols:list",fontSize:24})},"bullet")),x(o)}}));return h.current&&e.observe(h.current),()=>e.disconnect()}),[t,a]);const{anchorEl:S,open:O,handleClose:C,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 M.jsxs("div",{className:E("toolbar",{"toolbar-error":o,"toolbar-focused":s}),ref:h,children:[M.jsxs("div",{className:"flex flex-row gap-1",children:[l>=1&&M.jsx(u,{dataTest:"richeditor-h1-button",size:"small",variant:t.isActive("heading",{level:1})?"outlined":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().setNode("heading",{level:1}).run()},children:M.jsx(lc,{icon:"bi:type-h1"})}),l>=2&&M.jsx(u,{dataTest:"richeditor-h2-button",size:"small",variant:t.isActive("heading",{level:2})?"outlined":"textGray",onClick:()=>{t.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),t.chain().focus().setNode("heading",{level:2}).run()},children:M.jsx(lc,{icon:"bi:type-h2"})}),l>=3&&M.jsxs("div",{className:"select-wrapper",children:[M.jsxs("select",{className:"font-size-select",onChange:e=>{const n=e.target.value;t.chain().focus().setMark("textStyle",{fontSize:{small:"10px",normal:"16px",large:"24px",huge:"32px"}[n]}).run()},defaultValue:"normal",children:[M.jsx("option",{value:"small",children:"Small"}),M.jsx("option",{value:"normal",children:"Normal"}),M.jsx("option",{value:"large",children:"Large"}),M.jsx("option",{value:"huge",children:"Huge"})]}),M.jsx(lc,{icon:"tabler:caret-up-down-filled",className:"chevron-icon"})]}),l>=4&&M.jsx(u,{dataTest:"richeditor-bullet-list-button",size:"small",variant:t.isActive("bulletList")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleBulletList().run(),children:M.jsx(lc,{icon:"material-symbols:list",fontSize:24})}),l>=5&&M.jsx(u,{dataTest:"richeditor-ordered-list-button",size:"small",variant:t.isActive("orderedList")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleOrderedList().run(),children:M.jsx(lc,{icon:"cil:list-numbered"})}),l>=6&&M.jsx(u,{dataTest:"richeditor-bold-button",size:"small",variant:t.isActive("bold")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleBold().run(),children:M.jsx(lc,{icon:"ooui:bold-b"})}),l>=7&&M.jsx(u,{dataTest:"richeditor-italic-button",size:"small",variant:t.isActive("italic")?"outlined":"textGray",onClick:()=>t.chain().focus().toggleItalic().run(),children:M.jsx(lc,{icon:"material-symbols:format-italic",height:20})}),l>=8&&M.jsx(u,{dataTest:"richeditor-link-button",size:"small",variant:t.isActive("link")?"outlined":"textGray",onClick:a,children:M.jsx(p,{})})]}),M.jsxs("div",{className:"flex flex-row",children:[b&&M.jsxs(M.Fragment,{children:[M.jsx(u,{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:M.jsx(f,{className:"text-delta-800",width:20,height:20})}),M.jsx(w,{open:O,anchorEl:S,onClose:C,onClick:C,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:k})]}),M.jsx(u,{dataTest:"richeditor-close-toolbar-button",size:"small",variant:"text",onClick:e,children:y})]})]})},hc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,mc=ss.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",Hi(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[ta({find:hc,type:this.type}),ta({find:pc,type:this.type})]},addPasteRules(){return[ra({find:uc,type:this.type}),ra({find:fc,type:this.type})]}}),gc=na.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Hi(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)}}}),yc=ss.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Rs(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),bc=/^\s*([-+*])\s$/,vc=na.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",Hi(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(gc.name,this.editor.getAttributes(yc.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ea({find:bc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ea({find:bc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yc.name),editor:this.editor})),[t]}}),wc=na.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]}`,Hi(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 Zi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=qi(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}})))}}),kc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,xc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Sc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Oc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Cc=ss.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",Hi(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[ta({find:kc,type:this.type}),ta({find:Sc,type:this.type})]},addPasteRules(){return[ra({find:xc,type:this.type}),ra({find:Oc,type:this.type})]}}),Mc="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Tc="ελ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",Ec=(t,e)=>{for(const n in e)t[n]=e[n];return t},Nc="numeric",Ac="ascii",Dc="alpha",Rc="asciinumeric",Ic="alphanumeric",Lc="domain",Pc="emoji",jc="scheme",zc="slashscheme",$c="whitespace";function Bc(t,e){return t in e||(e[t]=[]),e[t]}function Fc(t,e,n){e[Nc]&&(e[Rc]=!0,e[Ic]=!0),e[Ac]&&(e[Rc]=!0,e[Dc]=!0),e[Rc]&&(e[Ic]=!0),e[Dc]&&(e[Ic]=!0),e[Ic]&&(e[Lc]=!0),e[Pc]&&(e[Lc]=!0);for(const r in e){const e=Bc(r,n);e.indexOf(t)<0&&e.push(t)}}function _c(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}_c.groups={},_c.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||_c.groups,e&&e.j?o=e:(o=new _c(e),n&&r&&Fc(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||_c.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 _c,Ec(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new _c,i){if(r)if(s.t&&"string"==typeof s.t){const t=Ec(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);Fc(i,t,r)}else n&&Fc(i,n,r);s.t=i}return o.j[t]=s,s}};const Vc=(t,e,n,r,o)=>t.ta(e,n,r,o),Hc=(t,e,n,r,o)=>t.tr(e,n,r,o),Wc=(t,e,n,r,o)=>t.ts(e,n,r,o),Kc=(t,e,n,r,o)=>t.tt(e,n,r,o),qc="WORD",Jc="UWORD",Uc="LOCALHOST",Gc="TLD",Yc="UTLD",Qc="SCHEME",Xc="SLASH_SCHEME",Zc="NUM",td="WS",ed="NL",nd="OPENBRACE",rd="CLOSEBRACE",od="OPENBRACKET",id="CLOSEBRACKET",sd="OPENPAREN",ad="CLOSEPAREN",ld="OPENANGLEBRACKET",cd="CLOSEANGLEBRACKET",dd="FULLWIDTHLEFTPAREN",hd="FULLWIDTHRIGHTPAREN",ud="LEFTCORNERBRACKET",pd="RIGHTCORNERBRACKET",fd="LEFTWHITECORNERBRACKET",md="RIGHTWHITECORNERBRACKET",gd="FULLWIDTHLESSTHAN",yd="FULLWIDTHGREATERTHAN",bd="AMPERSAND",vd="APOSTROPHE",wd="ASTERISK",kd="AT",xd="BACKSLASH",Sd="BACKTICK",Od="CARET",Cd="COLON",Md="COMMA",Td="DOLLAR",Ed="DOT",Nd="EQUALS",Ad="EXCLAMATION",Dd="HYPHEN",Rd="PERCENT",Id="PIPE",Ld="PLUS",Pd="POUND",jd="QUERY",zd="QUOTE",$d="SEMI",Bd="SLASH",Fd="TILDE",_d="UNDERSCORE",Vd="EMOJI",Hd="SYM";var Wd=Object.freeze({__proto__:null,WORD:qc,UWORD:Jc,LOCALHOST:Uc,TLD:Gc,UTLD:Yc,SCHEME:Qc,SLASH_SCHEME:Xc,NUM:Zc,WS:td,NL:ed,OPENBRACE:nd,CLOSEBRACE:rd,OPENBRACKET:od,CLOSEBRACKET:id,OPENPAREN:sd,CLOSEPAREN:ad,OPENANGLEBRACKET:ld,CLOSEANGLEBRACKET:cd,FULLWIDTHLEFTPAREN:dd,FULLWIDTHRIGHTPAREN:hd,LEFTCORNERBRACKET:ud,RIGHTCORNERBRACKET:pd,LEFTWHITECORNERBRACKET:fd,RIGHTWHITECORNERBRACKET:md,FULLWIDTHLESSTHAN:gd,FULLWIDTHGREATERTHAN:yd,AMPERSAND:bd,APOSTROPHE:vd,ASTERISK:wd,AT:kd,BACKSLASH:xd,BACKTICK:Sd,CARET:Od,COLON:Cd,COMMA:Md,DOLLAR:Td,DOT:Ed,EQUALS:Nd,EXCLAMATION:Ad,HYPHEN:Dd,PERCENT:Rd,PIPE:Id,PLUS:Ld,POUND:Pd,QUERY:jd,QUOTE:zd,SEMI:$d,SLASH:Bd,TILDE:Fd,UNDERSCORE:_d,EMOJI:Vd,SYM:Hd});const Kd=/[a-z]/,qd=/\p{L}/u,Jd=/\p{Emoji}/u,Ud=/\d/,Gd=/\s/,Yd="\n",Qd="️",Xd="";let Zd=null,th=null;function eh(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 _c(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new _c(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function nh(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 rh={defaultProtocol:"http",events:null,format:ih,formatHref:ih,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oh(t,e){void 0===e&&(e=null);let n=Ec({},rh);t&&(n=Ec(n,t instanceof oh?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 ih(t){return t}function sh(t,e){this.t="token",this.v=t,this.tk=e}function ah(t,e){class n extends sh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}oh.prototype={o:rh,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]:rh[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)}},sh.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=rh.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&&Ec(s,d),{tagName:o,attributes:s,content:i,eventListeners:h}}};const lh=ah("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ch=ah("text"),dh=ah("nl"),hh=ah("url",{isLink:!0,toHref(t){return void 0===t&&(t=rh.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Uc&&t[1].t===Cd}}),uh=t=>new _c(t);function ph(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const fh=typeof console<"u"&&console&&console.warn||(()=>{}),mh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gh(t,e){if(void 0===e&&(e=!1),mh.initialized&&fh(`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');mh.customSchemes.push([t,e])}function yh(){mh.scanner=function(t){void 0===t&&(t=[]);const e={};_c.groups=e;const n=new _c;null==Zd&&(Zd=nh(Mc)),null==th&&(th=nh(Tc)),Kc(n,"'",vd),Kc(n,"{",nd),Kc(n,"}",rd),Kc(n,"[",od),Kc(n,"]",id),Kc(n,"(",sd),Kc(n,")",ad),Kc(n,"<",ld),Kc(n,">",cd),Kc(n,"(",dd),Kc(n,")",hd),Kc(n,"「",ud),Kc(n,"」",pd),Kc(n,"『",fd),Kc(n,"』",md),Kc(n,"<",gd),Kc(n,">",yd),Kc(n,"&",bd),Kc(n,"*",wd),Kc(n,"@",kd),Kc(n,"`",Sd),Kc(n,"^",Od),Kc(n,":",Cd),Kc(n,",",Md),Kc(n,"$",Td),Kc(n,".",Ed),Kc(n,"=",Nd),Kc(n,"!",Ad),Kc(n,"-",Dd),Kc(n,"%",Rd),Kc(n,"|",Id),Kc(n,"+",Ld),Kc(n,"#",Pd),Kc(n,"?",jd),Kc(n,'"',zd),Kc(n,"/",Bd),Kc(n,";",$d),Kc(n,"~",Fd),Kc(n,"_",_d),Kc(n,"\\",xd);const r=Hc(n,Ud,Zc,{[Nc]:!0});Hc(r,Ud,r);const o=Hc(n,Kd,qc,{[Ac]:!0});Hc(o,Kd,o);const i=Hc(n,qd,Jc,{[Dc]:!0});Hc(i,Kd),Hc(i,qd,i);const s=Hc(n,Gd,td,{[$c]:!0});Kc(n,Yd,ed,{[$c]:!0}),Kc(s,Yd),Hc(s,Gd,s);const a=Hc(n,Jd,Vd,{[Pc]:!0});Hc(a,Jd,a),Kc(a,Qd,a);const l=Kc(a,Xd);Hc(l,Jd,a);const c=[[Kd,o]],d=[[Kd,null],[qd,i]];for(let t=0;t<Zd.length;t++)eh(n,Zd[t],Gc,qc,c);for(let t=0;t<th.length;t++)eh(n,th[t],Yc,Jc,d);Fc(Gc,{tld:!0,ascii:!0},e),Fc(Yc,{utld:!0,alpha:!0},e),eh(n,"file",Qc,qc,c),eh(n,"mailto",Qc,qc,c),eh(n,"http",Xc,qc,c),eh(n,"https",Xc,qc,c),eh(n,"ftp",Xc,qc,c),eh(n,"ftps",Xc,qc,c),Fc(Qc,{scheme:!0,ascii:!0},e),Fc(Xc,{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]?{[jc]:!0}:{[zc]:!0};r.indexOf("-")>=0?o[Lc]=!0:Kd.test(r)?Ud.test(r)?o[Rc]=!0:o[Ac]=!0:o[Nc]=!0,Wc(n,r,r,o)}return Wc(n,"localhost",Uc,{ascii:!0}),n.jd=new _c(Hd),{start:n,tokens:Ec({groups:e},Wd)}}(mh.customSchemes);for(let t=0;t<mh.tokenQueue.length;t++)mh.tokenQueue[t][1]({scanner:mh.scanner});mh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([bd,wd,kd,xd,Sd,Od,Td,Nd,Dd,Zc,Rd,Id,Ld,Pd,Bd,Hd,Fd,_d]),r=[vd,Cd,Md,Ed,Ad,jd,zd,$d,ld,cd,nd,rd,id,od,sd,ad,dd,hd,ud,pd,fd,md,gd,yd],o=[bd,vd,wd,xd,Sd,Od,Td,Nd,Dd,nd,rd,Rd,Id,Ld,Pd,jd,Bd,Hd,Fd,_d],i=uh(),s=Kc(i,Fd);Vc(s,o,s),Vc(s,e.domain,s);const a=uh(),l=uh(),c=uh();Vc(i,e.domain,a),Vc(i,e.scheme,l),Vc(i,e.slashscheme,c),Vc(a,o,s),Vc(a,e.domain,a);const d=Kc(a,kd);Kc(s,kd,d),Kc(l,kd,d),Kc(c,kd,d);const h=Kc(s,Ed);Vc(h,o,s),Vc(h,e.domain,s);const u=uh();Vc(d,e.domain,u),Vc(u,e.domain,u);const p=Kc(u,Ed);Vc(p,e.domain,u);const f=uh(lh);Vc(p,e.tld,f),Vc(p,e.utld,f),Kc(d,Uc,f);const m=Kc(u,Dd);Vc(m,e.domain,u),Vc(f,e.domain,u),Kc(f,Ed,p),Kc(f,Dd,m);const g=Kc(f,Cd);Vc(g,e.numeric,lh);const y=Kc(a,Dd),b=Kc(a,Ed);Vc(y,e.domain,a),Vc(b,o,s),Vc(b,e.domain,a);const v=uh(hh);Vc(b,e.tld,v),Vc(b,e.utld,v),Vc(v,e.domain,a),Vc(v,o,s),Kc(v,Ed,b),Kc(v,Dd,y),Kc(v,kd,d);const w=Kc(v,Cd),k=uh(hh);Vc(w,e.numeric,k);const x=uh(hh),S=uh();Vc(x,n,x),Vc(x,r,S),Vc(S,n,x),Vc(S,r,S),Kc(v,Bd,x),Kc(k,Bd,x);const O=Kc(l,Cd),C=Kc(c,Cd),M=Kc(C,Bd),T=Kc(M,Bd);Vc(l,e.domain,a),Kc(l,Ed,b),Kc(l,Dd,y),Vc(c,e.domain,a),Kc(c,Ed,b),Kc(c,Dd,y),Vc(O,e.domain,x),Kc(O,Bd,x),Vc(T,e.domain,x),Vc(T,n,x),Kc(T,Bd,x);const E=[[nd,rd],[od,id],[sd,ad],[ld,cd],[dd,hd],[ud,pd],[fd,md],[gd,yd]];for(let t=0;t<E.length;t++){const[e,o]=E[t],i=Kc(x,e);Kc(S,e,i),Kc(i,o,x);const s=uh(hh);Vc(i,n,s);const a=uh();Vc(i,r),Vc(s,n,s),Vc(s,r,a),Vc(a,n,s),Vc(a,r,a),Kc(s,o,x),Kc(a,o,x)}return Kc(i,Uc,v),Kc(i,ed,dh),{start:i,tokens:Wd}}(mh.scanner.tokens);for(let t=0;t<mh.pluginQueue.length;t++)mh.pluginQueue[t][1]({scanner:mh.scanner,parser:mh.parser});mh.initialized=!0}function bh(t){return mh.initialized||yh(),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(ph(ch,e,s)),s=[]),o-=u,d-=u;const t=h.t,r=n.slice(o-d,o);i.push(ph(t,e,r))}}return s.length>0&&i.push(ph(ch,e,s)),i}(mh.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}(mh.scanner.start,t))}function vh(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 oh(n),o=bh(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 wh(t){return new qe({key:new Ge("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 Ce(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}})}))})),Ps(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=bh(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=>{js(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 kh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function xh(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(kh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Sh=ss.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?gh(t.scheme,t.optionalSlashes):gh(t)}))},onDestroy(){_c.groups={},mh.scanner=null,mh.parser=null,mh.tokenQueue=[],mh.pluginQueue=[],mh.customSchemes=[],mh.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||!xh(e,this.options.protocols))&&null}}]},renderHTML({HTMLAttributes:t}){return xh(t.href,this.options.protocols)?["a",Hi(this.options.HTMLAttributes,t),0]:["a",Hi(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[ra({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=vh(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(wh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),!0===this.options.openOnClick&&t.push(function(t){return new qe({key:new Ge("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=Ls(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 qe({key:new Ge("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=vh(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}}),Oh=na.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Hi(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)}}}),Ch=na.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Hi(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)}}}),Mh=ss.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Rs(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),Th=/^(\d+)\.\s$/,Eh=na.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",Hi(this.options.HTMLAttributes,n),0]:["ol",Hi(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(Ch.name,this.editor.getAttributes(Mh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ea({find:Th,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=ea({find:Th,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Mh.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),Nh=na.create({name:"doc",topNode:!0,content:"block+"}),Ah=na.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Dh=na.create({name:"text",group:"inline"}),Rh=ss.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",Hi(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Rs(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}});var Ih=hs.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 Lh=[Nh,Ah,Dh,Rh],Ph=[wc.configure({levels:[1,2]}),Oh,vc,Eh,Sh,mc,Cc,Ih],jh=({open:t,setOpen:e,editor:n})=>{const[o,s]=r("");i((()=>{if(t){const t=n.getAttributes("link").href;t&&s(t)}}),[t,n]);const{Norsk:a}=cc(),l=a?"Legg til lenke":"Add link",c=a?"Gå tilbake":"Go back";return M.jsx(g,{open:t,dataTest:"link-modal-rte",onClose:()=>e(!1),className:"z-[99]",dialogTitle:M.jsx("div",{className:"text-gray-700",children:l}),children:M.jsxs("main",{className:"flex flex-col items-start p-0 gap-6 m-4",children:[M.jsx("div",{children:M.jsx(y,{dataTest:"link-input-field",size:"small",value:o,onChange:t=>s(t.target.value)})}),M.jsxs("div",{className:"flex gap-2 p-0 w-full justify-end",children:[M.jsx(u,{dataTest:"delete-customer-confirm-button",size:"medium",variant:"contained",onClick:()=>{n.chain().focus().setLink({href:o}).run(),e(!1),s("")},children:l}),M.jsx(u,{dataTest:"delete-customer-reject-button",size:"medium",variant:"outlined",onClick:()=>{e(!1),s("")},children:c})]})]})})},zh=({dataTest:t,id:e,inputRef:n,className:o,disabled:s,readOnly:a,error:l,placeholder:c,helperText:h,required:p,hideToolbar:f,noDefaultStyles:m,...g})=>{const y=Ma({...g,extensions:[...Lh,...Ph,...g.extensions||[]],shouldRerenderOnTransaction:g.shouldRerenderOnTransaction||!1,immediatelyRender:g.immediatelyRender||!0,editable:g.editable||!s&&!a}),[w,k]=r(g.toolbarDefaultVisible),[x,S]=r(!1);d(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?M.jsxs(M.Fragment,{children:[M.jsxs(b,{className:o,children:[g.title&&M.jsx("p",{className:"font-semibold text-base text-gray-700 mb-2",children:g.title}),M.jsxs("div",{className:E("flex flex-col h-full"),children:[M.jsxs(fa,{id:e,className:E("relative",!m&&"core-ui-rte",!m&&!s&&!a&&"core-ui-rte-edit-mode",a&&"core-ui-rte-readonly-mode",l&&(w?"core-ui-rte-tools-error":"core-ui-rte-error"),(f||!w)&&"core-ui-rte-hide-toolbar",l&&"error-state"),editor:y,onClick:()=>y.chain().focus().run(),style:{"--max-scrollable-height":g.maxScrollableHeight?g.maxScrollableHeight:"none"},children:[c&&!g.content&&!a&&M.jsx("p",{className:"absolute top-2 left-[14px] text-gray-500 text-base",children:c}),!f&&!s&&!a&&!w&&M.jsx(u,{className:"absolute top-1 right-4",dataTest:"richeditor-show-toolbar-button",size:"small",variant:"textGray",onClick:()=>k(!0),children:M.jsx(lc,{icon:"material-symbols:format-color-text"})})]}),!f&&!s&&!a&&w&&M.jsx(dc,{editor:y,onClose:()=>k(!1),error:l,focused:O,openLinkDialog:()=>S(!0)})]}),(l||p)&&!a&&M.jsx(v,{error:l,"data-test":`error-${t}`,children:h})]}),M.jsx(jh,{open:x,setOpen:S,editor:y})]}):null};export{zh as RichInput};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Editor } from '@tiptap/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
export declare const LinkDialog: React.FC<{
|
|
4
4
|
open: boolean;
|
|
5
5
|
setOpen: (value: boolean) => void;
|
|
6
6
|
editor: Editor;
|
|
7
|
-
}
|
|
8
|
-
export declare const LinkDialog: React.FC<Props>;
|
|
9
|
-
export {};
|
|
7
|
+
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
|
2
|
-
export declare const Toolbar: ({ editor, onClose, error, focused, }: {
|
|
2
|
+
export declare const Toolbar: ({ editor, onClose, error, focused, openLinkDialog, }: {
|
|
3
3
|
editor: Editor;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
error?: boolean | undefined;
|
|
6
6
|
focused: boolean;
|
|
7
|
+
openLinkDialog: () => void;
|
|
7
8
|
}) => JSX.Element;
|
|
@@ -15,7 +15,7 @@ export interface IRichInput extends UseEditorOptions {
|
|
|
15
15
|
required?: boolean;
|
|
16
16
|
hideToolbar?: boolean;
|
|
17
17
|
noDefaultStyles?: boolean;
|
|
18
|
-
maxScrollableHeight?: number;
|
|
18
|
+
maxScrollableHeight?: number | string;
|
|
19
19
|
toolbarDefaultVisible?: boolean;
|
|
20
20
|
}
|
|
21
21
|
export interface CustomCSSProperties extends React.CSSProperties {
|