@yoopta/editor 4.9.8 → 4.9.9

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 +1 @@
1
- {"version":3,"file":"FloatingBlockActions.d.ts","sourceRoot":"","sources":["../../../src/components/Block/FloatingBlockActions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAmB,MAAM,oBAAoB,CAAC;AAehE,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,mBAAmB,EAAE,GAAG,CAAC;CAC1B,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC,CAAC;AAoBF,eAAO,MAAM,oBAAoB,oEAAsC,yBAAyB,6CAsL9F,CAAC"}
1
+ {"version":3,"file":"FloatingBlockActions.d.ts","sourceRoot":"","sources":["../../../src/components/Block/FloatingBlockActions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAmB,MAAM,oBAAoB,CAAC;AAehE,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,mBAAmB,EAAE,GAAG,CAAC;CAC1B,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC,CAAC;AAoBF,eAAO,MAAM,oBAAoB,oEAAsC,yBAAyB,6CAwL9F,CAAC"}
@@ -866,15 +866,11 @@ export declare const useActionMenuToolRefs: ({ editor }: {
866
866
  ActionMenu: import("react").ComponentType<any>;
867
867
  };
868
868
  export declare const useBlockStyles: (block: YooptaBlockData, transform: Transform | null, transition: string | undefined, isDragging: boolean, isOver: boolean) => {
869
- container: {
870
- marginLeft: string;
871
- transform: string;
872
- transition: string | undefined;
873
- opacity: number;
874
- };
875
- content: {
876
- borderBottom: string;
877
- } | undefined;
869
+ marginLeft: string;
870
+ transform: string;
871
+ transition: string | undefined;
872
+ opacity: number;
873
+ borderBottom: string | undefined;
878
874
  };
879
875
  export declare const useBlockOptionsRefs: () => {
880
876
  blockOptionsRefs: {
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/Block/hooks.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CjC,CAAC;AAEF,eAAO,MAAM,cAAc,UAClB,eAAe,aACX,SAAS,GAAG,IAAI,cACf,MAAM,GAAG,SAAS,cAClB,OAAO,UACX,OAAO;;;;;;;;;;CAchB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B/B,CAAC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/Block/hooks.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CjC,CAAC;AAEF,eAAO,MAAM,cAAc,UAClB,eAAe,aACX,SAAS,GAAG,IAAI,cACf,MAAM,GAAG,SAAS,cAClB,OAAO,UACX,OAAO;;;;;;CAYhB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=insertBlock.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertBlock.test.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/insertBlock.test.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -3,4 +3,4 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var Li=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Ii="undefined"==typeof Element,Fi=Ii?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,zi=!Ii&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},$i=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Hi=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!$i(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),s=e(a.length?a:l.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:l,candidates:s})}else{Fi.call(l,Li)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var c=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),u=!$i(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(c&&u){var d=e(!0===c?l.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:l,candidates:d})}else i.unshift.apply(i,l.children)}}return o},Vi=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ui=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Vi(e)?0:e.tabIndex},Ki=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Wi=function(e){return"INPUT"===e.tagName},qi=function(e){return function(e){return Wi(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||zi(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Yi=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Xi=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Fi.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Fi.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Yi(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,a=zi(e);if(l&&!l.shadowRoot&&!0===r(l))return Yi(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=i}if(function(e){var t,n,r,o,i=e&&zi(e),l=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&l;){var s,c,u;a=!(null===(c=l=null===(s=i=zi(l))||void 0===s?void 0:s.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Zi=function(e,t){return!(t.disabled||$i(t)||function(e){return Wi(e)&&"hidden"===e.type}(t)||Xi(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Fi.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ji=function(e,t){return!(qi(t)||Ui(t)<0||!Zi(e,t))},Gi=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Qi=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,a=function(e,t){var n=Ui(e);return n<0&&t&&!Vi(e)?0:n}(l,i),s=i?e(t.candidates):l;0===a?i?n.push.apply(n,s):n.push(l):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:s})})),r.sort(Ki).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},el=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Hi([e],t.includeContainer,{filter:Ji.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Gi}):function(e,t,n){if($i(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Li));return t&&Fi.call(e,Li)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ji.bind(null,t)),Qi(n)};const tl=r["useInsertionEffect".toString()]||(e=>e());var nl="undefined"!=typeof document?c:u;function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rl.apply(this,arguments)}let ol=!1,il=0;const ll=()=>"floating-ui-"+il++;const al=r["useId".toString()]||function(){const[e,t]=r.useState((()=>ol?ll():void 0));return nl((()=>{null==e&&t(ll())}),[]),r.useEffect((()=>{ol||(ol=!0)}),[]),e};const sl=r.createContext(null),cl=r.createContext(null);function ul(e){return"data-floating-ui-"+e}function dl(e){const t=a(e);return nl((()=>{t.current=e})),t}const fl=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pl(e,t){const n=el(e,fl());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(o=e)?void 0:o.ownerDocument)||document));var o;return n.slice(r+1)[0]}function hl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ro(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function gl(e){el(e,fl()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function vl(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const yl={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ml(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const bl=r.forwardRef((function(e,t){const[n,o]=r.useState();nl((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",ml),()=>{document.removeEventListener("keydown",ml)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ul("focus-guard")]:"",style:yl};return r.createElement("span",rl({},e,i))})),wl=r.createContext(null),kl=ul("portal");function xl(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),l=al(),a=Ol(),s=r.useRef(null);return nl((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{s.current=null}))}),[o]),nl((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(kl,""),e.appendChild(n),s.current=n,i(n)}),[t,l]),nl((()=>{if(s.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!Ao(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=l,o.setAttribute(kl,""),e=r||e,e.appendChild(o),s.current=o,i(o)}),[t,n,l,a]),o}({id:n,root:o}),[a,s]=r.useState(null),c=r.useRef(null),u=r.useRef(null),d=r.useRef(null),f=r.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!(!o&&!l);return r.useEffect((()=>{if(l&&i&&(null==a||!a.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&hl(e)){("focusin"===e.type?vl:gl)(l)}}}),[l,i,null==a?void 0:a.modal]),r.createElement(wl.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:l,setFocusManagerState:s})),[i,l])},p&&l&&r.createElement(bl,{"data-type":"outside",ref:c,onFocus:e=>{if(hl(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=pl(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),p&&l&&r.createElement("span",{"aria-owns":l.id,style:yl}),l&&M(t,l),p&&l&&r.createElement(bl,{"data-type":"outside",ref:u,onFocus:e=>{if(hl(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=pl(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const Ol=()=>r.useContext(wl),El=new Set,Sl=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=al();return nl((()=>{if(!n)return;El.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,c;const e=(null==(s=window.visualViewport)?void 0:s.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{El.delete(i),0===El.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,n]),r.createElement("div",rl({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function _l(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[l,a]=r.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||l,c=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Bi(p,o)||h(o);const[g,v]=r.useState(null),[y,m]=r.useState(null),b=r.useCallback((e=>{e!==O.current&&(O.current=e,v(e))}),[]),w=r.useCallback((e=>{e!==E.current&&(E.current=e,m(e))}),[]),k=l||g,x=a||y,O=r.useRef(null),E=r.useRef(null),S=r.useRef(d),_=null!=c,C=Ni(c),j=Ni(i),D=r.useCallback((()=>{if(!O.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};j.current&&(e.platform=j.current),Pi(O.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};A.current&&!Bi(S.current,t)&&(S.current=t,B.flushSync((()=>{f(t)})))}))}),[p,t,n,j]);Ri((()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const A=r.useRef(!1);Ri((()=>(A.current=!0,()=>{A.current=!1})),[]),Ri((()=>{if(k&&(O.current=k),x&&(E.current=x),k&&x){if(C.current)return C.current(k,x,D);D()}}),[k,x,D,C,_]);const P=r.useMemo((()=>({reference:O,floating:E,setReference:b,setFloating:w})),[b,w]),R=r.useMemo((()=>({reference:k,floating:x})),[k,x]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Mi(R.floating,d.x),r=Mi(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Ti(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:D,refs:P,elements:R,floatingStyles:T})),[d,D,P,R,T])}(e),u=r.useContext(cl),d=null!=((null==(f=r.useContext(sl))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return tl((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:d}),null==o||o(e,t,n)})),h=r.useRef(null),g=r.useRef({}),v=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],y=al(),m=r.useCallback((e=>{const t=Ao(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c.refs.setReference(t)}),[c.refs]),b=r.useCallback((e=>{(Ao(e)||null===e)&&(h.current=e,a(e)),(Ao(c.refs.reference.current)||null===c.refs.reference.current||null!==e&&!Ao(e))&&c.refs.setReference(e)}),[c.refs]),w=r.useMemo((()=>({...c.refs,setReference:b,setPositionReference:m,domReference:h})),[c.refs,b,m]),k=r.useMemo((()=>({...c.elements,domReference:s})),[c.elements,s]),x=r.useMemo((()=>({...c,refs:w,elements:k,dataRef:g,nodeId:i,floatingId:y,events:v,open:n,onOpenChange:p})),[c,i,y,v,n,p,w,k]);return nl((()=>{const e=null==u?void 0:u.nodesRef.current.find((e=>e.id===i));e&&(e.context=x)})),r.useMemo((()=>({...c,context:x,refs:w,elements:k})),[c,w,k,x])}const Cl=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function jl(e,t){return"function"==typeof e?e(t):e}function Dl(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[a,s]=r.useState(!1),[c,u]=r.useState("unmounted"),d=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return nl((()=>{a&&!d&&u("unmounted")}),[a,d]),nl((()=>{if(o){if(n){u("initial");const e=requestAnimationFrame((()=>{u("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),u("close")}}),[n,o]),{isMounted:d,status:c}}function Al(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:l,duration:a=250}=t,s=e.placement,c=s.split("-")[0],u=r.useMemo((()=>({side:c,placement:s})),[c,s]),d="number"==typeof a,f=(d?a:a.open)||0,p=(d?a:a.close)||0,[h,g]=r.useState((()=>({...jl(l,u),...jl(n,u)}))),{isMounted:v,status:y}=Dl(e,{duration:a}),m=dl(n),b=dl(o),w=dl(i),k=dl(l);return nl((()=>{const e=jl(m.current,u),t=jl(w.current,u),n=jl(k.current,u),r=jl(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(Cl).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Cl).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,m,b,k,f,y,u]),{isMounted:v,styles:h}}function Pl({editor:e,view:t,onClose:n,mode:r="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===r&&(t=t.filter((t=>function(e,t){var n;const r=e.blocks[t];if(!r)return!1;const o=H(r.elements);return"void"!==(null===(n=null==o?void 0:o.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,r,o,i,l,a;return{type:t,title:(null===(r=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===r?void 0:r.title)||t,description:null===(i=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===i?void 0:i.description,icon:null===(a=null===(l=e.blocks[t].options)||void 0===l?void 0:l.display)||void 0===a?void 0:a.icon}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{e.toggleBlock(t,{deleteText:"create"===r,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const Rl=p((({children:n,block:r,blockId:o,onActiveDragHandleChange:i})=>{const l=zt(),{attributes:a,listeners:c,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:p,isOver:h,isDragging:g}=mo({id:o,disabled:l.readOnly}),v=((e,t,n,r,o)=>s((()=>({container:{marginLeft:20*e.meta.depth+"px",transform:t?`translate3d(${t.x}px, ${t.y}px, 0)`:"none",transition:n,opacity:r?.7:1},content:o&&!r?{borderBottom:"2px solid #007aff"}:void 0})),[e.meta.depth,t,n,r,o]))(r,f,p,g,h),y=`yoopta-block yoopta-align-${r.meta.align||"left"}`,m=Z.isBlockSelected(l,r);return t("div",Object.assign({ref:u,className:y,style:v.container,"data-yoopta-block":!0,"data-yoopta-block-id":o,onMouseEnter:()=>{!l.readOnly&&i&&i({attributes:a,listeners:c,setActivatorNodeRef:d})}},{children:[e("div",Object.assign({style:v.content},{children:n})),!l.readOnly&&e("div",{"data-block-selected":m,className:"yoopta-selection-block"})]}))}));function Bl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}Rl.displayName="Block","function"==typeof SuppressedError&&SuppressedError;var Tl={};Object.defineProperty(Tl,"__esModule",{value:!0});for(var Ml="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Nl={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ll={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Ml?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Il={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Fl=1;Fl<20;Fl++)Il["f"+Fl]=111+Fl;function zl(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return $l(e,t)})),o=function(e){return r.some((function(t){return Hl(t,e)}))};return null==n?o:o(n)}function $l(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var l in Nl)r[Nl[l]]=!1;var a=!0,s=!1,c=void 0;try{for(var u,d=o[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var f=u.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Ul(f),g=Nl[h];if(f.length>1&&!g&&!Ll[f]&&!Il[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=Vl(f)),g&&(r[g]=!p||null)}}catch(e){s=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(s)throw c}}return r}function Hl(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function Vl(e){return e=Ul(e),Il[e]||e.toUpperCase().charCodeAt(0)}function Ul(e){return e=e.toLowerCase(),e=Ll[e]||e}Tl.default=zl,Tl.isHotkey=zl,Tl.isCodeHotkey=function(e,t){return zl(e,t)};var Kl=Tl.isKeyHotkey=function(e,t){return zl(e,{byKey:!0},t)};Tl.parseHotkey=$l,Tl.compareHotkey=Hl,Tl.toKeyCode=Vl,Tl.toKeyName=Ul;const Wl={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",shiftDelete:"shift+delete",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",cmdShiftEnter:"mod+shift+enter",slashCommand:"/",copy:"mod+c",cut:"mod+x",cmdShiftRight:"mod+shift+right",cmdShiftLeft:"mod+shift+left",cmdShiftDelete:"mod+shift+backspace",cmdShiftD:"mod+shift+d",cmdAltDelete:"mod+alt+backspace"},ql={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Yl={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Xl=e=>{const t=Wl[e],n=ql[e],r=Yl[e],o=t&&Kl(t),i=n&&Kl(n),l=r&&Kl(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!l||!l(e)))},Zl={isBold:Xl("bold"),isCompose:Xl("compose"),isArrowLeft:Xl("arrowLeft"),isArrowRight:Xl("arrowRight"),isArrowUp:Xl("arrowUp"),isArrowDown:Xl("arrowDown"),isDeleteBackward:Xl("deleteBackward"),isDeleteForward:Xl("deleteForward"),isDeleteLineBackward:Xl("deleteLineBackward"),isDeleteLineForward:Xl("deleteLineForward"),isDeleteWordBackward:Xl("deleteWordBackward"),isDeleteWordForward:Xl("deleteWordForward"),isExtendBackward:Xl("extendBackward"),isExtendForward:Xl("extendForward"),isExtendLineBackward:Xl("extendLineBackward"),isExtendLineForward:Xl("extendLineForward"),isItalic:Xl("italic"),isMoveLineBackward:Xl("moveLineBackward"),isMoveLineForward:Xl("moveLineForward"),isCtrlLeft:Xl("ctrlLeft"),isCtrlRight:Xl("ctrlRight"),isRedo:Xl("redo"),isShiftEnter:Xl("shiftEnter"),isEnter:Xl("enter"),isTransposeCharacter:Xl("transposeCharacter"),isUndo:Xl("undo"),isSpace:Xl("space"),isSelect:Xl("select"),isTab:Xl("tab"),isShiftTab:Xl("shiftTab"),isBackspace:Xl("backspace"),isCmdEnter:Xl("cmdEnter"),isCmd:Xl("cmd"),isEscape:Xl("escape"),isSlashCommand:Xl("slashCommand"),isShiftArrowUp:Xl("shiftArrowUp"),isShiftArrowDown:Xl("shiftArrowDown"),isCopy:Xl("copy"),isCut:Xl("cut"),isShiftDelete:Xl("shiftDelete"),isCmdShiftEnter:Xl("cmdShiftEnter"),isCmdShiftRight:Xl("cmdShiftRight"),isCmdShiftLeft:Xl("cmdShiftLeft"),isCmdShiftDelete:Xl("cmdShiftDelete"),isCmdAltDelete:Xl("cmdAltDelete"),isCmdShiftD:Xl("cmdShiftD")};const Jl={onKeyDown:function(e){return t=>{const n=re(e,{at:e.path.current});if(Zl.isShiftEnter(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;return t.preventDefault(),void n.insertText("\n")}if(Zl.isUndo(t))t.preventDefault();else if(Zl.isRedo(t))t.preventDefault();else if(Zl.isEnter(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;t.preventDefault();const r=y.first(n,[]),o=y.last(n,[]),i=y.isStart(n,n.selection.anchor,r[1]),l=y.isEnd(n,n.selection.anchor,o[1]);if(E.isExpanded(n.selection)&&w.delete(n,{at:n.selection}),!i&&!l)return void e.splitBlock({slate:n,focus:!0});const a=Ee.getBlock(e,{at:e.path.current}),s=Ee.buildBlockData({id:I()}),c=y.string(n,[]),u=i&&c.length>0,d=Z.getNextPath(e);e.batchOperations((()=>{e.insertBlock(s.type,{at:u?e.path.current:d,focus:!u}),u&&a&&e.focusBlock(a.id)}))}else if(Zl.isBackspace(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;const r=x.parent(n.selection.anchor.path);if(y.isStart(n,n.selection.anchor,r)){t.preventDefault();if(0===y.string(n,r).trim().length)return void e.deleteBlock({at:e.path.current,focus:!0});{if(E.isExpanded(n.selection))return w.delete(n,{at:n.selection});const t=Ee.getBlock(e,{at:Z.getPreviousPath(e)}),r=Ee.getBlockSlate(e,{id:null==t?void 0:t.id});if(t&&r){const{node:n}=function(e){const t=y.last(e,[]);return{node:t[0],path:t[1]}}(r);if(0===O.string(n).trim().length)return e.deleteBlock({blockId:t.id,focus:!1}),void e.setPath({current:t.meta.order})}e.mergeBlock()}}}else{if(Zl.isSelect(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;const[,r]=y.first(n,[0]),[,o]=y.last(n,[n.children.length-1]),i=y.range(n,r,o),l=E.equals(n.selection,i),a=0===y.string(n,i).trim().length;if(E.isExpanded(n.selection)&&l||a){t.preventDefault(),C.blur(n),C.deselect(n),w.deselect(n);const r=Array.from({length:Object.keys(e.children).length},((e,t)=>t));return void e.setPath({current:null,selected:r,source:"keyboard"})}}if(Zl.isShiftTab(t)){if(t.isDefaultPrevented())return;t.preventDefault();const n=e.path.selected;return Array.isArray(n)&&n.length>0?void e.batchOperations((()=>{n.forEach((t=>{const n=Ee.getBlock(e,{at:t});n&&n.meta.depth>0&&e.decreaseBlockDepth({at:t})}))})):void e.decreaseBlockDepth()}if(Zl.isTab(t)){if(t.isDefaultPrevented())return;t.preventDefault();const n=e.path.selected;return Array.isArray(n)&&n.length>0?void e.batchOperations((()=>{n.forEach((t=>{e.increaseBlockDepth({at:t})}))})):void e.increaseBlockDepth()}if(Zl.isArrowUp(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;if(1===new Set(n.selection.anchor.path).size){const n=Z.getPreviousPath(e),r=re(e,{at:n}),o=ne(e,{at:n}),i=e.blocks[(null==o?void 0:o.type)||""];if(r&&o&&!(null==i?void 0:i.hasCustomEditor)){const[,n]=y.last(r,[0]),i={path:n,offset:y.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockPath:!0})}}}if(Zl.isArrowDown(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;const r=x.parent(n.selection.anchor.path);if(y.isEnd(n,n.selection.anchor,r)){const n=Z.getNextPath(e),o=re(e,{at:n}),i=ne(e,{at:n}),l=e.blocks[(null==i?void 0:i.type)||""];if(o&&i&&!(null==l?void 0:l.hasCustomEditor)){const n=function(e,t){try{const[,n]=y.first(e,t);return{path:n,offset:0}}catch(e){return{path:[0,0],offset:0}}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(n&&n.selection&&E.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Kl(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Gl=({children:t,attributes:n,placeholder:r})=>{const o=D(),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Ql(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const ea={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"italic"},MARK:{type:"highlight",parse:e=>({color:e.style.color})}},ta=["left","center","right",void 0];function na(e,t,n,r){var o,i;let l;if(t.parse){l=t.parse(n,e);if(m.isElement(l)&&"inline"===(null===(o=l.props)||void 0===o?void 0:o.nodeType))return l}const a=e.blocks[t.type],s=$(a.elements)||"",c=a.elements[s],u="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:I(),type:s,children:u&&!a.hasCustomEditor?[{text:""}]:r.map(oa).flat(),props:Object.assign({nodeType:"block"},c.props)};if(l)if(m.isElement(l))d=l;else if(Array.isArray(l)){return l}if(0===d.children.length&&(d.children=[{text:""}]),!l&&t.parse)return;const f=n.getAttribute("data-meta-align"),p=parseInt(n.getAttribute("data-meta-depth")||"0",10);return Ee.buildBlockData({id:I(),type:t.type,value:[d],meta:{order:0,depth:p,align:ta.includes(f)?f:void 0}})}function ra(e,t,n){var r;if(3===n.nodeType){return{text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return{text:"\n"};const o=n;let i=Array.from(o.childNodes).map((n=>ra(e,t,n))).flat().filter(Boolean);if(ea[o.nodeName]){const e=ea[o.nodeName],t=e.type;return i.map((n=>"string"==typeof n?{[t]:!e.parse||e.parse(o),text:n}:n.text?Object.assign(Object.assign({},n),{[t]:!e.parse||e.parse(o)}):n))}const l=t[o.nodeName];if(l){if(Array.isArray(l)){return l.map((t=>na(e,t,o,i))).filter(Boolean)}return na(e,l,o,i)}return i}function oa(e){if("string"==typeof e)return{text:e};if(m.isElement(e))return e;if(Array.isArray(e))return e.map(oa).flat();if(null==e?void 0:e.text)return e;if(Ql(e)){return e.value[0].children.map(oa).flat()}return{text:""}}function ia(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const r=e.plugins[n],{parsers:o}=r;if(o){const{html:e}=o;if(e){const{deserialize:r}=e;if(r){const{nodeNames:e}=r;e&&e.forEach((e=>{const o=t[e];if(o){const i=Array.isArray(o)?o:[o];t[e]=[...i,{type:n,parse:r.parse}]}else t[e]={type:n,parse:r.parse}}))}}}})),t}(e);return ra(e,n,t).flat().filter(Ql)}var la={},aa={get exports(){return la},set exports(e){la=e}},sa={};!function(e,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t=n(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),new TypeError("Expected a string but received a ".concat(t))}},e.exports=t.default,e.exports.default=t.default}({get exports(){return sa},set exports(e){sa=e}},sa);var ca,ua,da={},fa={get exports(){return da},set exports(e){da=e}},pa={};ca={get exports(){return pa},set exports(e){pa=e}},ua=pa,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},ca.exports=ua.default,ca.exports.default=ua.default,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),(t=(0,r.default)(t,i)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var o=e.split("."),l=o[o.length-1];if(t.require_tld){if(o.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(l))return!1;if(/\s/.test(l))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(l))return!1;return o.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var n=o(sa),r=o(pa);function o(e){return e&&e.__esModule?e:{default:e}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(fa,da);var ha={};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,r.default)(t),!(n=String(n)))return e(t,4)||e(t,6);if("4"===n)return l.test(t);if("6"===n)return s.test(t);return!1};var n,r=(n=sa)&&n.__esModule?n:{default:n};var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(o,"[.]){3}").concat(o),l=new RegExp("^".concat(i,"$")),a="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(a,":){7}(?:").concat(a,"|:)|")+"(?:".concat(a,":){6}(?:").concat(i,"|:").concat(a,"|:)|")+"(?:".concat(a,":){5}(?::").concat(i,"|(:").concat(a,"){1,2}|:)|")+"(?:".concat(a,":){4}(?:(:").concat(a,"){0,1}:").concat(i,"|(:").concat(a,"){1,3}|:)|")+"(?:".concat(a,":){3}(?:(:").concat(a,"){0,2}:").concat(i,"|(:").concat(a,"){1,4}|:)|")+"(?:".concat(a,":){2}(?:(:").concat(a,"){0,3}:").concat(i,"|(:").concat(a,"){1,5}|:)|")+"(?:".concat(a,":){1}(?:(:").concat(a,"){0,4}:").concat(i,"|(:").concat(a,"){1,6}|:)|")+"(?::((?::".concat(a,"){0,5}:").concat(i,"|(?::").concat(a,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}({get exports(){return ha},set exports(e){ha=e}},ha),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,i.default)(t,s)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var l,d,f,p,h,g,v,y;if(v=e.split("#"),e=v.shift(),v=e.split("?"),e=v.shift(),(v=e.split("://")).length>1){if(l=v.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(l))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;v[0]=e.slice(2)}}if(""===(e=v.join("://")))return!1;if(v=e.split("/"),""===(e=v.shift())&&!t.require_host)return!0;if((v=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===v[0])return!1;if((d=v.shift()).indexOf(":")>=0&&d.split(":").length>2)return!1;var m=d.split(":"),b=(O=2,function(e){if(Array.isArray(e))return e}(x=m)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(x,O)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(x,O)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=b[0],k=b[1];if(""===w&&""===k)return!1}var x,O;p=v.join("@"),g=null,y=null;var E=p.match(c);E?(f="",y=E[1],g=E[2]||null):(f=(v=p.split(":")).shift(),v.length&&(g=v.join(":")));if(null!==g&&g.length>0){if(h=parseInt(g,10),!/^[0-9]+$/.test(g)||h<=0||h>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return u(f,t.host_whitelist);if(""===f&&!t.require_host)return!0;if(!((0,o.default)(f)||(0,r.default)(f,t)||y&&(0,o.default)(y,6)))return!1;if(f=f||y,t.host_blacklist&&u(f,t.host_blacklist))return!1;return!0};var n=l(sa),r=l(da),o=l(ha),i=l(pa);function l(e){return e&&e.__esModule?e:{default:e}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},c=/^\[([^\]]+)\](?::([0-9]+))?$/;function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(e===r||(o=r,"[object RegExp]"===Object.prototype.toString.call(o)&&r.test(e)))return!0}var o;return!1}e.exports=t.default,e.exports.default=t.default}(aa,la);var ga=ie(la);function va(e){return!(!e||e.length>2048)&&ga(e,{protocols:["http","https"],require_protocol:!0,require_valid_protocol:!0,require_host:!0,require_port:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,allow_underscores:!0,disallow_auth:!1})}const ya=(e,t,n)=>{var r,o,i,l;(e=>{const[t]=y.nodes(e,{match:e=>!y.isEditor(e)&&m.isElement(e)&&"link"===e.type});return!!t})(t)&&(e=>{w.unwrapNodes(e,{match:e=>!y.isEditor(e)&&m.isElement(e)&&"link"===e.type})})(t);const{selection:a}=t,s=a&&E.isCollapsed(a),c=null===(l=null===(i=null===(o=null===(r=e.plugins)||void 0===r?void 0:r.LinkPlugin)||void 0===o?void 0:o.elements)||void 0===i?void 0:i.link)||void 0===l?void 0:l.props,u={type:"link",children:s?[{text:n}]:[],props:{url:n,target:(null==c?void 0:c.target)||"_self",rel:(null==c?void 0:c.rel)||"noopener noreferrer"}};s?w.insertNodes(t,u):(w.wrapNodes(t,u,{split:!0}),w.collapse(t,{edge:"end"}))},ma=(e,t,n,r,o)=>s((()=>{let i=t.blockEditorsMap[e];const{normalizeNode:l,insertText:a,apply:s}=i,c=Object.keys(r);return c.forEach((e=>{var n;const o=null===(n=r[e].props)||void 0===n?void 0:n.nodeType,l="inline"===o,a="void"===o,s="inlineVoid"===o,{markableVoid:c,isVoid:u,isInline:d}=i;s&&(i.markableVoid=t=>c(t)||t.type===e),(a||s)&&(i.isVoid=t=>u(t)||t.type===e),(l||s)&&(i.isInline=t=>d(t)||t.type===e,i=((e,t)=>{const{insertData:n,insertText:r}=t;return t.insertText=n=>{n&&va(n)?ya(e,t,n):r(n)},t.insertData=r=>{const o=r.getData("text/plain");o&&va(o)?ya(e,t,o):n(r)},t})(t,i))})),i.insertText=e=>{const n=Z.getSelectedPaths(t),r=Z.getPath(t);Array.isArray(n)&&n.length>0&&t.setPath({current:r}),a(e)},i.normalizeNode=e=>{const[r,o]=e,a=t.blocks[n.type].elements;if(Object.keys(a).length>1)return l(e);if(m.isElement(r)){const{type:e}=r,t=$(a);if(!c.includes(e))return void w.setNodes(i,{type:t,props:Object.assign({},r.props)},{at:o});if(r.type===t)for(const[e,t]of O.children(i,o))if(m.isElement(e)&&!i.isInline(e))return void w.unwrapNodes(i,{at:t})}l(e)},i.apply=n=>{var r,o,l;if(_.isSelectionOperation(n)){const e=Z.getSelectedPaths(t),n=Z.getPath(t);Array.isArray(e)&&i.selection&&E.isExpanded(i.selection)&&t.setPath({current:n})}let a=t.isSavingHistory();if(void 0===a&&(a=ba(n)),a){const a=t.historyStack.undos[t.historyStack.undos.length-1];if(!a||"set_slate"!==(null===(r=null==a?void 0:a.operations[0])||void 0===r?void 0:r.type)){const r={type:"set_slate",properties:{slateOps:[n],selectionBefore:i.selection},blockId:e,slate:i};return t.applyTransforms([r],{source:"api",validatePaths:!1}),void s(n)}const c=null===(l=null===(o=null==a?void 0:a.operations[0])||void 0===o?void 0:o.properties)||void 0===l?void 0:l.slateOps,u=c&&c[c.length-1];let d=wa(n,u);if(0!==i.operations.length&&(d=!0),d)u!==n&&c.push(n);else{const r={operations:[n],selectionBefore:i.selection},o={type:"set_slate",properties:{slateOps:r.operations,selectionBefore:r.selectionBefore},blockId:e,slate:i};t.applyTransforms([o],{source:"api",validatePaths:!1})}}s(n)},o&&(i=o(i,t,e)),i}),[]),ba=e=>"set_selection"!==e.type,wa=(e,t)=>t===e||(!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!x.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!x.equals(e.path,t.path))),ka=({id:t,customEditor:n,elements:r,marks:o,events:i,options:l,extensions:c,placeholder:u="Type '/' for commands"})=>{const f=zt(),p=$t(t);let h=a(p.value).current;const g=s((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(r)),[r]),v=s((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(o)),[o]),m=ma(t,f,p,r,c),b=((e,t,n,r)=>s((()=>{if(!e||t.readOnly)return{};const o=Bl(e||{},["onBeforeCreate","onDestroy","onCreate"]),i={hotkeys:Zl,currentBlock:n,defaultBlock:Ee.buildBlockData({id:I()})},l={};return Object.keys(o).forEach((e=>{l[e]=function(n){o[e]&&o[e](t,r,i)(n)}})),l}),[e,t,n]))(i,f,p,m),w=d((e=>{f.readOnly||(window.scheduler?window.scheduler.postTask((()=>f.updateBlock(t,{value:e})),{priority:"background"}):f.updateBlock(t,{value:e}))}),[t]),k=d((e=>{f.readOnly||"mousemove"!==f.path.source&&"keyboard"!==f.path.source&&f.setPath({current:f.path.current,selected:f.path.selected,selection:e,source:"native-selection"})}),[f.readOnly]),O=d((n=>{const r=g[n.element.type],{attributes:o}=n,i=Bl(n,["attributes"]);return o["data-element-type"]=i.element.type,r?e(r,Object.assign({},i,{attributes:o,blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(R,Object.assign({},i,{attributes:o}))}),[r]),S=d((t=>{var n,r,o,i;let{children:l,leaf:a,attributes:s}=t;const c=Bl(a,["text"]),d=f.path.current===p.meta.order;c&&Object.keys(c).forEach((e=>{const t=v[e];t&&(l=t.render({children:l,leaf:a}))}));const h=!("void"===(null===(i=null===(o=null===(r=null===(n=t.children)||void 0===n?void 0:n.props)||void 0===r?void 0:r.parent)||void 0===o?void 0:o.props)||void 0===i?void 0:i.nodeType))&&d&&a.withPlaceholder;return e(Gl,Object.assign({attributes:s,placeholder:h?u:void 0},{children:l}))}),[o]),_=d((e=>{var t;f.readOnly||(null===(t=b.onKeyDown)||void 0===t||t.call(b,e),Jl.onKeyDown(f)(e))}),[b.onKeyDown,f.readOnly,f.path.current,p.meta.order]),j=d((e=>{var t;f.readOnly||null===(t=null==b?void 0:b.onKeyUp)||void 0===t||t.call(b,e)}),[b.onKeyUp,f.readOnly]),D=d((e=>{var t;f.readOnly||(e.preventDefault(),null===(t=null==b?void 0:b.onBlur)||void 0===t||t.call(b,e))}),[b.onBlur,f.readOnly]),A=d((e=>{var t;f.readOnly||(f.isFocused()||(ee.set(f,!0),f.emit("focus",!0)),null===(t=null==b?void 0:b.onFocus)||void 0===t||t.call(b,e))}),[b.onFocus,f.readOnly]),P=d((e=>{var t;if(f.readOnly)return;null===(t=null==b?void 0:b.onPaste)||void 0===t||t.call(b,e);const n=e.clipboardData.getData("text/html"),r=(new DOMParser).parseFromString(n,"text/html");if(r.body.childNodes.length>0){const t=ia(f,r.body);if(t.length>0&&null!==f.path.current){e.preventDefault();let n=!1,r=!1;if(m&&m.selection){const e=x.parent(m.selection.anchor.path),t=y.string(m,e).trim(),o=y.isStart(m,m.selection.anchor,e);r=""===t&&o,n=!o||t.length>0,C.blur(m)}const o=f.path.current;if(null===o)return;return void f.batchOperations((()=>{const e=[];r&&f.deleteBlock({at:o}),t.forEach(((t,r)=>{let i=n?o+r+1:o+r;e.push(i);const l=Bl(t,["type"]);f.insertBlock(t.type,{at:i,focus:!1,blockData:l})})),f.setPath({current:null,selected:e,source:"copy-paste"})}))}}}),[b.onPaste,f.readOnly]),B=d((e=>{const t=[];if(f.readOnly)return t;const[n,r]=e,o=f.path.current===p.meta.order;return m.selection&&o&&!y.isEditor(n)&&""===y.string(m,[r[0]])&&E.includes(m.selection,r)&&E.isCollapsed(m.selection)&&t.push(Object.assign(Object.assign({},m.selection),{withPlaceholder:!0})),t}),[f.readOnly,f.path.current,p.meta.order]);return e(xa,{id:t,slate:m,initialValue:h,onChange:w,onSelectionChange:k,decorate:B,renderLeaf:S,renderElement:O,eventHandlers:b,onKeyDown:_,onKeyUp:j,onFocus:A,onBlur:D,customEditor:n,readOnly:f.readOnly,onPaste:P})},xa=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:l,eventHandlers:a,onKeyDown:s,onKeyUp:c,onFocus:u,onSelectionChange:d,onPaste:f,customEditor:p,decorate:h,readOnly:g})=>"function"==typeof p?p({blockId:t}):e(A,Object.assign({editor:n,initialValue:r,onValueChange:o,onSelectionChange:d},{children:e(P,Object.assign({renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},a,{onKeyDown:s,onKeyUp:c,onFocus:u,decorate:h,readOnly:g,onPaste:f}),`editable-${t}`)}),`slate-${t}`)));xa.displayName="SlateEditorInstance";const Oa=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s((()=>[...t].filter((e=>null!=e))),[...t])}(_n(yr,{activationConstraint:{distance:20}}),_n(fr,{coordinateGetter:ko})),handleDragEnd:d((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,t)}}),[]),handleDragStart:d((t=>{e.setPath({current:null})}),[])});var Ea;function Sa(){return Sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sa.apply(this,arguments)}var _a,Ca=function(e){return r.createElement("svg",Sa({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Ea||(Ea=r.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function ja(){return ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ja.apply(this,arguments)}var Da,Aa=function(e){return r.createElement("svg",ja({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),_a||(_a=r.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Pa(){return Pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pa.apply(this,arguments)}var Ra=function(e){return r.createElement("svg",Pa({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Da||(Da=r.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Ba(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var Ta=["color"],Ma=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,Ta);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Na=["color"],La=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,Na);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Ia=["color"],Fa=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,Ia);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),za=["color"],$a=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,za);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Ha=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},Va={"text/plain":"Text","text/html":"Url",default:"Text"};var Ua=function(e,t){var n,r,o,i,l,a,s=!1;t||(t={}),n=t.debug||!1;try{if(o=Ha(),i=document.createRange(),l=document.getSelection(),(a=document.createElement("span")).textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=Va[t.format]||Va.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(a),i.selectNodeContents(a),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),a&&document.body.removeChild(a),o()}return s};const Ka=t=>{var{className:n,children:r,lockScroll:o=!0}=t,i=Bl(t,["className","children","lockScroll"]);return e(Sl,Object.assign({lockScroll:o,className:n},i,{onClick:e=>{var t;e.stopPropagation(),null===(t=i.onClick)||void 0===t||t.call(i,e)},onMouseDown:e=>{var t;e.stopPropagation(),null===(t=i.onMouseDown)||void 0===t||t.call(i,e)}},{children:r}))},Wa=t=>{const[n,r]=f(!1),o=a(null),i=zt();return u((()=>{r(!0);const e=i.refElement;if(!e)return;return e.querySelector(".yoopta-overlays")||(o.current=document.createElement("div"),o.current.className="yoopta-overlays",e.appendChild(o.current)),()=>{o.current&&o.current.remove()}}),[]),n?e(xl,Object.assign({id:`${t.id}-${i.id}`,root:o.current||i.refElement},{children:t.children})):null},qa=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),Ya=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoopta-block-options-menu-content data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),Xa=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),Za=["delete","duplicate","turnInto","copy"],Ja=({isOpen:n,onClose:r,refs:o,style:i,actions:l=Za,children:a})=>{var s,c,u;const d=zt(),p=So(),[h,g]=f(!1),{refs:v,floatingStyles:y,context:m}=_l({placement:"right",open:h,onOpenChange:g,middleware:[Ai(),Di(),ji(),di(10)],whileElementsMounted:Ci}),{isMounted:b,styles:w}=Al(m,{duration:100});if(!n)return null;const k=ne(d,{at:d.path.current}),x=H(null===(s=d.blocks[(null==k?void 0:k.type)||""])||void 0===s?void 0:s.elements),O="void"===(null===(c=null==x?void 0:x.props)||void 0===c?void 0:c.nodeType),E=p.ActionMenu,S=Object.assign(Object.assign({},y),w),_=Pl({editor:d,view:"small",onClose:()=>{g(!1),r()}});return e(Wa,Object.assign({id:"yoo-block-options-portal"},{children:e(Ka,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating,contentEditable:!1},{children:t(Ya,{children:[null!==l&&t(qa,{children:[e(Xa,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{d.deleteBlock({at:d.path.current}),d.setPath({current:null}),r()}},{children:[e($a,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(Xa,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{"number"==typeof d.path.current&&(d.duplicateBlock({original:{path:d.path.current},focus:!0}),r())}},{children:[e(Ma,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!E&&!O&&!(null===(u=d.blocks[(null==k?void 0:k.type)||""])||void 0===u?void 0:u.hasCustomEditor)&&t(Xa,{children:[b&&e(Wa,Object.assign({id:"yoo-block-options-portal"},{children:e(Ka,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>g(!1)},{children:e("div",Object.assign({style:S,ref:v.setFloating},{children:e(E,Object.assign({},_))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:v.setReference,onClick:()=>g((e=>!e))},{children:[e(Ra,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(Xa,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=ne(d);e&&(Ua(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),r()}},{children:[e(Fa,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Ga=Object.freeze({__proto__:null,BlockOptions:Ja,BlockOptionsMenuContent:Ya,BlockOptionsMenuGroup:qa,BlockOptionsMenuItem:Xa,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const Qa={position:"fixed",top:0,left:0,opacity:0,transform:"scale(0.95) translateX(-46px)",transition:"opacity 150ms ease-out"},es=p((({editor:n,dragHandleProps:r})=>{const[o,i]=f(null),l=a(null),[s,c]=f(Qa),{attributes:d,listeners:p,setActivatorNodeRef:h}=r||{},{isBlockOptionsMounted:g,setIsBlockOptionsOpen:v,blockOptionsFloatingStyle:m,blockOptionsRefs:b}=(()=>{const[e,t]=f(!1),{refs:n,floatingStyles:r,context:o}=_l({placement:"right-start",open:e,onOpenChange:t,middleware:[Ai(),Di(),ji(),di()]}),{isMounted:i,styles:l}=Al(o,{duration:100});return{blockOptionsRefs:n,blockOptionsFloatingStyle:Object.assign(Object.assign({},r),l),isBlockOptionsOpen:e,setIsBlockOptionsOpen:t,isBlockOptionsMounted:i}})(),{isActionMenuOpen:k,actionMenuRefs:x,hasActionMenu:O,actionMenuStyles:E,onChangeActionMenuOpen:S,onCloseActionMenu:_,actionMenuRenderProps:j,ActionMenu:D}=(({editor:e})=>{const t=So().ActionMenu,[n,r]=f(!1),{refs:o,floatingStyles:i,context:l}=_l({placement:"bottom-start",open:n,onOpenChange:r,middleware:[Ai(),Di(),ji(),di(10)],whileElementsMounted:Ci}),{isMounted:a,styles:s}=Al(l,{duration:100}),c=Object.assign(Object.assign({},i),s),u=e=>r(e),d=()=>u(!1),p=Pl({editor:e,view:"default",mode:"create",onClose:d});return{isActionMenuOpen:a,actionMenuStyles:c,actionMenuRefs:o,hasActionMenu:!!t,onChangeActionMenuOpen:u,actionMenuRenderProps:p,onCloseActionMenu:d,ActionMenu:t}})({editor:n}),A=()=>{c((e=>Object.assign(Object.assign({},e),{opacity:0,transform:Qa.transform}))),setTimeout((()=>{i(null)}),150)},P=function(e,t,{leading:n=!0,trailing:r=!0}={}){let o=0,i=null,l=null;const a=t=>{e(...l),o=t,l=null},s=(...e)=>{const s=Date.now();o||n||(o=s);const c=t-(s-o);l=e,c<=0||c>t?(i&&(clearTimeout(i),i=null),a(s)):!i&&r&&(i=setTimeout((()=>{i=null,r&&l&&a(Date.now())}),c))};return s.cancel=()=>{i&&(clearTimeout(i),i=null),l=null,o=0},s}((e=>{var t;if(!(null===(t=n.refElement)||void 0===t?void 0:t.contains(e.target)))return A();if(n.readOnly)return;const r=e.target.closest("[data-yoopta-block]");if(r){const e=r.getAttribute("data-yoopta-block-id");if(e===(null==o?void 0:o.id))return;const t=n.children[e||""];t&&((e,t)=>{var n;i(t);const r=e.getBoundingClientRect(),o=(null===(n=l.current)||void 0===n?void 0:n.offsetWidth)||46;c((e=>Object.assign(Object.assign({},e),{top:r.top+2,left:r.left,opacity:1,transform:`scale(1) translateX(-${o}px)`})))})(r,t)}}),100,{leading:!0,trailing:!0});u((()=>(document.addEventListener("scroll",A),document.addEventListener("mousemove",P),()=>{document.removeEventListener("scroll",A),document.removeEventListener("mousemove",P),P.cancel()})),[]);return e(Wa,Object.assign({id:"block-actions"},{children:e("div",Object.assign({contentEditable:!1,style:s,className:"yoopta-block-actions",ref:l},{children:t("div",Object.assign({className:"yoopta-block-action-buttons"},{children:[k&&O&&e(Wa,Object.assign({id:"yoo-block-options-portal"},{children:e(Ka,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:_},{children:e("div",Object.assign({style:E,ref:x.setFloating},{children:e(D,Object.assign({},j))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=o;if(!t)return;const r=Ee.getBlockSlate(n,{id:t.id}),i=n.blocks[t.type];if(!r)return;const l=document.querySelector(`[data-yoopta-block-id="${t.id}"]`),a=H(i.elements);let s;i.hasCustomEditor||(s=y.string(r,[0]));const c="string"==typeof s&&0===s.trim().length;if(O&&c&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType))n.setPath({current:t.meta.order}),n.focusBlock(t.id),x.setReference(l),S(!0);else{const e=Ee.buildBlockData({id:I()}),r=t.meta.order+1;n.setPath({current:t.meta.order}),n.insertBlock(e.type,{at:r,focus:!0}),O&&setTimeout((()=>{l&&x.setReference(l.nextSibling),S(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Aa,{})})),e("button",Object.assign({ref:e=>{null==h||h(e),b.setReference(e)},type:"button",className:"yoopta-block-actions-drag",onClick:e=>{e.stopPropagation();const t=o;if(!t)return;const r=re(n,{at:t.meta.order});n.focusBlock(t.id),r&&setTimeout((()=>{n.blocks[t.type].hasCustomEditor||(C.blur(r),C.deselect(r),w.deselect(r)),n.setPath({current:t.meta.order,selected:[t.meta.order]}),v(!0)}),10)}},d,p,{children:e(Ca,{})})),e(Ja,{isOpen:g,refs:b,style:m,onClose:()=>v(!1)})]}))}))}))}));es.displayName="FloatingBlockActions";const ts=[],ns=({editor:r,marks:o,placeholder:i})=>{const l=Vt(),{sensors:a,handleDragEnd:c,handleDragStart:u}=Oa({editor:r}),[d,p]=f(null),h=Object.keys(r.children),g=s((()=>0===h.length?ts:h.sort(((e,t)=>r.children[e].meta.order-r.children[t].meta.order))),[h]),v=[];for(let t=0;t<g.length;t++){const n=g[t],l=r.children[n],a=r.plugins[l.type];l&&a?v.push(e(Rl,Object.assign({block:l,blockId:n,onActiveDragHandleChange:p},{children:e(ka,{type:l.type,id:n,marks:o,customEditor:a.customEditor,events:a.events,elements:a.elements,options:a.options,extensions:a.extensions,placeholder:i},n)}),n)):console.error(`Plugin ${l.type} not found`)}return l?e(n,{children:v}):e(Xr,Object.assign({id:"yoopta-dnd-context",sensors:a,collisionDetection:Tn,onDragStart:u,onDragEnd:c},{children:t(uo,Object.assign({disabled:l,items:g,strategy:ao},{children:[v,e(es,{editor:r,dragHandleProps:d})]}))}))},rs=({editor:e,root:t})=>{const[n,r]=f({origin:[0,0],coords:[0,0],selection:!1}),o=o=>{var i;if(e.readOnly||!1===t)return;const l=null===(i=e.refElement)||void 0===i?void 0:i.contains(o.target),s=Z.getSelectedPaths(e);if(!l&&!n.selection&&Array.isArray(s)&&s.length>0)return e.setPath({current:null}),a();l||r({origin:[o.pageX,o.pageY-window.pageYOffset],coords:[o.pageX,o.pageY-window.pageYOffset],selection:!0})},i=o=>{if(!n.selection||e.readOnly||!1===t)return;r((e=>Object.assign(Object.assign({},e),{coords:[o.pageX,o.pageY-window.pageYOffset]})));const i=((e,t,n)=>{var r;const o=[],i=null===(r=e.refElement)||void 0===r?void 0:r.querySelectorAll("[data-yoopta-block]");return i?(i.forEach(((e,r)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),a=Math.min(t[0],n[0]),s=Math.max(t[1],n[1]),c=Math.max(t[0],n[0]);l<i.bottom&&s>i.top&&a<i.right&&c>i.left&&o.push(r)})),o):o})(e,n.origin,[o.pageX,o.pageY-window.pageYOffset]);e.setPath({current:null,selected:i,source:"selection-box"})},l=()=>{e.readOnly||a()};u((()=>{var n;if(e.readOnly||!1===t)return;const r=t&&"current"in t?t.current:t||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=e.refElement)||void 0===n?void 0:n.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",o),r.addEventListener("mousemove",i),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",o),r.removeEventListener("mousemove",i),r.removeEventListener("mouseup",l)}}),[e.path,n,t,e.readOnly]);const a=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:a})},os=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:o})},is={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null};function ls({editor:e}){const t=a(!1),n=a(!1),r=a(null),o=a(null);let i=a(is).current;const l=()=>{const t=e.path.current;if("number"==typeof t){const n=Ee.getBlockSlate(e,{at:t}),r=Ee.getBlock(e,{at:t}),o=e.blocks[(null==r?void 0:r.type)||""];if(!n||(null==o?void 0:o.hasCustomEditor))return;try{y.withoutNormalizing(n,(()=>{w.select(n,[0]),n.selection&&E.isExpanded(n.selection)&&(C.blur(n),C.deselect(n))}))}catch(e){}}},s=i=>{if(!t.current||e.readOnly)return;const a=document.elementFromPoint(i.clientX,i.clientY),s=null==a?void 0:a.closest("[data-yoopta-block]");s&&e.batchOperations((()=>{var t;const i=s.getAttribute("data-yoopta-block-id")||"",a=null===(t=e.children[i])||void 0===t?void 0:t.meta.order;if(n.current&&"number"==typeof a&&a===r.current)return o.current=a,void e.setPath({current:a,selected:[a],source:"mousemove"});if("number"==typeof a&&a!==o.current){o.current=a,n.current=!0;const t=Math.min(r.current,a),i=Math.max(r.current,a);l();const s=Array.from({length:i-t+1},((e,n)=>t+n));e.setPath({current:a,selected:s,source:"mousemove"})}}))},c=()=>{var i,l;t.current=!1,n.current=!1,r.current=null,o.current=null,null===(i=e.refElement)||void 0===i||i.removeEventListener("mousemove",s),null===(l=e.refElement)||void 0===l||l.removeEventListener("mouseup",c),null===document||void 0===document||document.removeEventListener("mouseup",c)};return{onMouseDown:n=>{e.readOnly||(e.isFocused()||e.focus(),e.batchOperations((()=>{var i,a,u;const d=Z.getSelectedPaths(e);Array.isArray(d)&&d.length>0&&!n.shiftKey&&!n.altKey&&e.setPath({current:null});const f=n.target.closest("[data-yoopta-block]");if(f&&0===n.button){const d=f.getAttribute("data-yoopta-block-id")||"",p=null===(i=e.children[d])||void 0===i?void 0:i.meta.order;if("number"==typeof p){if(t.current=!0,r.current=p,o.current=p,n.shiftKey&&!Z.isPathEmpty(e)&&p!==e.path.current)return void(t=>{l();const n=Z.getPath(e);if("number"!=typeof n)return;const r=Array.from({length:Math.abs(t-n)}).map(((e,r)=>t>n?n+r+1:n-r-1));e.setPath({current:t,selected:[...r,n],source:"keyboard"})})(p);p!==e.path.current&&e.setPath({current:p}),null===(a=e.refElement)||void 0===a||a.addEventListener("mousemove",s),null===(u=e.refElement)||void 0===u||u.addEventListener("mouseup",c),null===document||void 0===document||document.addEventListener("mouseup",c)}}})))},onShiftArrowUp:t=>{if("function"==typeof t.isDefaultPrevented&&t.isDefaultPrevented())return;if(i.selectionStarted&&null!==i.startedIndexToSelect&&null!==i.indexToSelect){const t=i.indexToSelect,n=t-1;if(0===t)return;if(t===i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}if(n<i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}const r=Z.getSelectedPaths(e);if((null==r?void 0:r.includes(t))&&t!==i.startedIndexToSelect){const o=r.filter((e=>e!==t));return e.setPath({current:n,selected:o,source:"keyboard"}),void(i.indexToSelect=n)}return}const n=ne(e),r=re(e);if(!r||!r.selection||!n)return;const o=x.parent(r.selection.anchor.path),l=y.isStart(r,r.selection.focus,o);if(E.isExpanded(r.selection)&&l){const o=q(e);if("number"!=typeof o)return;const l=ne(e,{at:o});if(n&&l){t.preventDefault(),C.blur(r),C.deselect(r),w.deselect(r);const o=e.path.selected?[...e.path.selected,null==n?void 0:n.meta.order,n.meta.order-1]:[null==n?void 0:n.meta.order,n.meta.order-1];e.setPath({current:null,selected:o,source:"keyboard"}),i.startedIndexToSelect=n.meta.order,i.indexToSelect=n.meta.order-1,i.selectionStarted=!0}}},onShiftArrowDown:t=>{if(i.selectionStarted&&null!==i.indexToSelect&&null!==i.startedIndexToSelect){const t=i.indexToSelect,n=t+1;if(n===Object.keys(e.children).length)return;if(t===i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}if(n>i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}const r=Z.getSelectedPaths(e);if((null==r?void 0:r.includes(t))&&t!==i.startedIndexToSelect){const o=r.filter((e=>e!==t));return e.setPath({current:n,selected:o,source:"keyboard"}),void(i.indexToSelect=n)}return}const n=ne(e),r=re(e);if(!r||!r.selection||!n)return;const o=x.parent(r.selection.anchor.path),l=y.isEnd(r,r.selection.focus,o);if(E.isExpanded(r.selection)&&l){const o=Z.getNextPath(e),l=ne(e,{at:o});if(n&&l){t.preventDefault(),C.blur(r),C.deselect(r),w.deselect(r);const o=e.path.selected?[...e.path.selected,null==n?void 0:n.meta.order,(null==n?void 0:n.meta.order)+1]:[null==n?void 0:n.meta.order,n.meta.order+1];e.setPath({current:null,selected:o,source:"keyboard"}),i.startedIndexToSelect=n.meta.order,i.indexToSelect=n.meta.order+1,i.selectionStarted=!0}}},selectionState:i}}const as=({placeholder:n,marks:r,className:o,selectionBoxRoot:i,width:l,style:a,children:s,autoFocus:c=!0})=>{const d=zt(),f=Vt(),p=rs({editor:d,root:i}),h=ls({editor:d});u((()=>{c&&!f&&d.focus()}),[c,f]),u((()=>{if(!f)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.path,f]);const g=()=>{h.selectionState.indexToSelect=null,h.selectionState.startedIndexToSelect=null,h.selectionState.selectionStarted=!1},v=e=>{if(!f){if(Zl.isRedo(e))return e.preventDefault(),void d.redo();if(Zl.isUndo(e))return e.preventDefault(),void d.undo();if(Zl.isSelect(e)){const t=Z.getSelectedPaths(d);if((null==t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(Array.isArray(t)&&t.length>0){e.preventDefault();const t=Object.keys(d.children).map(((e,t)=>t));return void d.setPath({current:null,selected:t,source:"keyboard"})}}if(Zl.isCopy(e)||Zl.isCut(e)){const t=Z.getSelectedPaths(d);if(Array.isArray(t)&&t.length>0){e.preventDefault();const t=d.getHTML(d.getEditorValue()),n=d.getPlainText(d.getEditorValue()),r=new Blob([t],{type:"text/html"}),o=new Blob([n],{type:"text/plain"}),i=new ClipboardItem({"text/html":r,"text/plain":o});return navigator.clipboard.write([i]).then((()=>{const e=(new DOMParser).parseFromString(t,"text/html");console.log("HTML copied\n",e.body)})),void(Zl.isCut(e)&&(d.batchOperations((()=>{const e=Z.getSelectedPaths(d);if(Array.isArray(e)&&e.length>0){const t=e.length===Object.keys(d.children).length;if(e.forEach((e=>{var t;const n=null===(t=Ee.getBlock(d,{at:e}))||void 0===t?void 0:t.id;n&&d.deleteBlock({blockId:n})})),t){const e=z({id:I()});d.insertBlock(e.type,{at:0,focus:!0})}}})),d.setPath({current:null,selected:null,source:"copy-paste"}),g()))}}if(Zl.isBackspace(e)){e.stopPropagation();const t=Z.getSelectedPaths(d);return(null==t?void 0:t.length)===Object.keys(d.children).length?(e.preventDefault(),void d.batchOperations((()=>{Object.keys(d.children).forEach((e=>d.deleteBlock({blockId:e}))),d.setPath({current:null,selected:null}),g()}))):void d.batchOperations((()=>{const t=Z.getSelectedPaths(d);Array.isArray(t)&&(null==t?void 0:t.length)>0&&(e.preventDefault(),t.forEach((e=>d.deleteBlock({at:e}))),d.setPath({current:null,selected:null}),g())}))}if(Zl.isShiftArrowUp(e)&&h.onShiftArrowUp(e),Zl.isShiftArrowDown(e)&&h.onShiftArrowDown(e),Zl.isTab(e)){const t=Z.getSelectedPaths(d);Array.isArray(t)&&t.length>0&&(e.preventDefault(),d.batchOperations((()=>{t.forEach((e=>{const t=Ee.getBlock(d,{at:e});d.increaseBlockDepth({blockId:null==t?void 0:t.id})}))})))}else if(Zl.isShiftTab(e)){const t=Z.getSelectedPaths(d);Array.isArray(t)&&t.length>0&&(e.preventDefault(),d.batchOperations((()=>{t.forEach((e=>{const t=Ee.getBlock(d,{at:e});d.decreaseBlockDepth({blockId:null==t?void 0:t.id})}))})))}else;}},b=e=>{if(!f)return;const t=e.clipboardData,n=window.getSelection();if(n&&n.rangeCount>0){const e=n.getRangeAt(0);if(e.collapsed)return;const r=e.cloneContents().querySelectorAll("[data-yoopta-block-id]");if(!r.length)return;const o=Array.from(r).reduce(((e,t)=>{const n=t.getAttribute("data-yoopta-block-id")||"",r=d.children[n];return r&&(e[n]=r),e}),{}),i=d.getHTML(o),l=d.getPlainText(o);return t.setData("text/html",i),void t.setData("text/plain",l)}},w=(k=Object.assign(Object.assign({},a),{userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:l||(null==a?void 0:a.width),paddingBottom:null==a?void 0:a.paddingBottom}),Object.assign(Object.assign({},k),{width:k.width||400,paddingBottom:"number"==typeof k.paddingBottom?k.paddingBottom:100}));var k;return t("div",Object.assign({ref:e=>d.refElement=e,className:o?`yoopta-editor ${o}`:"yoopta-editor",style:w,onMouseDown:e=>{f||(h.onMouseDown(e),g(),(e=>{var t;const n=d.refElement;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10),i=z({id:I()});if(e.clientY>=o){const e=Object.keys(d.children).length-1,n=ne(d,{at:e}),r=re(d,{at:e});if(n&&r&&r.selection){const e=y.string(r,r.selection.anchor.path),o=x.parent(r.selection.anchor.path),[l]=y.node(r,o);if(n.type===i.type&&m.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:r})}const o=e+1;d.insertBlock(i.type,{at:o,focus:!0})}})(e))},onBlur:e=>{var t,n;if((null===(t=d.refElement)||void 0===t?void 0:t.contains(e.relatedTarget))||(null===(n=d.refElement)||void 0===n?void 0:n.contains(e.target))||f)return;g();const r=Z.getSelectedPaths(d);Array.isArray(r)&&r.length>0&&d.setPath({current:null,selected:null})},onCopy:b,onCut:b},{children:[e(ns,{editor:d,marks:r,placeholder:n}),!1!==i&&e(os,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!f}),s]}))};function ss(e,t){const n=re(e);if(!n)return!1;const r=y.marks(n);return!!(null==r?void 0:r[t])}function cs(e,t){const n={};return t.forEach((t=>{const r=t.type;n[r]={hotkey:t.hotkey,type:r,getValue:()=>function(e,t){const n=re(e);if(!n)return null;const r=y.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ss(e,r),toggle:()=>function(e,t){if(Array.isArray(e.path.selected)&&e.path.selected.length>0){const n=e.path.selected.map((n=>{const r=Ee.getBlockSlate(e,{at:n});if(!r)return{isActiveMark:!1,slate:r};const[o]=y.node(r,[]);if(!o)return{isActiveMark:!1,slate:r};const i=y.end(r,[]),l=y.start(r,[]);w.select(r,{anchor:l,focus:i});const a=y.marks(r);return{slate:r,isActiveMark:!!(null==a?void 0:a[t])}})),r=n.every((e=>e.isActiveMark));for(const e of n)e.isActiveMark?r&&y.removeMark(e.slate,t):y.addMark(e.slate,t,!0);return}const n=re(e),r=ss(e,t);n&&n.selection&&(r?y.removeMark(n,t):y.addMark(n,t,!0))}(e,r),update:t=>function(e,t,n){if(Array.isArray(e.path.selected)&&e.path.selected.length>0){for(const r of e.path.selected){const o=Ee.getBlockSlate(e,{at:r});if(!o)continue;const[i]=y.node(o,[]);if(!i)continue;const l=y.end(o,[]),a=y.start(o,[]);w.select(o,{anchor:a,focus:l});const s=y.marks(o);(null==s?void 0:s[t])?y.removeMark(o,t):y.addMark(o,t,n)}return}const r=re(e);r&&r.selection&&E.isExpanded(r.selection)&&y.addMark(r,t,n)}(e,r,t)}})),n}function us({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const ds=us({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),fs=({id:t,editor:n,value:r,marks:o,plugins:i,autoFocus:l,className:a,tools:c,selectionBoxRoot:p,children:h,placeholder:g,readOnly:v,width:y,style:m,onChange:b,onPathChange:w})=>{const k=s((()=>o?[ds,...o]:[ds]),[o]),x=s((()=>i.map((e=>e.getPlugin))),[i]),[O,E]=f((()=>{n.id||(n.id=t||I()),n.readOnly=v||!1,k&&(n.formats=cs(n,k)),n.blocks=function(e,t){const n={};return t.forEach((t=>{var r;const o=H(t.elements),i=null===(r=null==o?void 0:o.props)||void 0===r?void 0:r.nodeType;if("inline"!==i&&"inlineVoid"!==i){const r={};Object.keys(t.elements).forEach((e=>{const n=Bl(t.elements[e],["render"]);r[e]=n}));const{display:o,placeholder:i,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:r,hasCustomEditor:!!t.customEditor,options:{display:o,placeholder:i,shortcuts:l},isActive:()=>{const n=ne(e,{at:e.path.current});return(null==n?void 0:n.type)===t.type}}}})),n}(n,x);const e=fe(r);return e||void 0===r||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(r)}`),n.children=e?r:{},n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=kt(e);if(0===r.children.length){const t=e.children[n];if(t){const n=K(e,t.type);r.children=[n]}}t[n]=r})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,r,o,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(r=e.options)||void 0===r?void 0:r.shortcuts.length)>0&&(null===(i=null===(o=e.options)||void 0===o?void 0:o.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var r;const o=e.elements[t],i=null===(r=o.props)||void 0===r?void 0:r.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=Object.assign(Object.assign({},o),{rootPlugin:e.type}))})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const r=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:r})}})),t}(x),n.commands=function(e,t){const n={};return t.forEach((t=>{t.commands&&Object.keys(t.commands).forEach((r=>{var o;(null===(o=t.commands)||void 0===o?void 0:o[r])&&(n[r]=(...n)=>{var o;return null===(o=t.commands)||void 0===o?void 0:o[r](e,...n)})}))})),n}(n,x),{editor:n,version:0}})),[S,_]=f(null),C=d((e=>{_(e),null==w||w(e)}),[]),j=d(((e,t)=>{if(E((e=>({editor:e.editor,version:e.version+1}))),"function"==typeof b&&Array.isArray(t.operations)){const n=t.operations.filter((e=>"validate_block_paths"!==e.type&&"set_block_path"!==e.type&&"set_slate"!==e.type));n.length>0&&b(e,{operations:n})}}),[]);return u((()=>{const e=e=>{j(e.value,{operations:e.operations})};return n.on("change",e),n.on("path-change",C),()=>{n.off("change",e),n.off("path-change",C)}}),[n,j]),e(Ft,Object.assign({editorState:O},{children:e(Eo,Object.assign({tools:c},{children:e(as,Object.assign({placeholder:g,marks:k,autoFocus:l,className:a,selectionBoxRoot:p,width:y,style:m},{children:h}))}))}))},ps=Object.assign(Object.assign({},Ga),{ExtendedBlockActions:({id:r,className:o,style:i,onClick:l,children:a})=>{const s=Vt(),[c,u]=f(!1),{refs:d,floatingStyles:p,context:h}=_l({placement:"bottom-start",open:c,onOpenChange:u,middleware:[Ai(),Di(),ji(),di(10)],whileElementsMounted:Ci}),{isMounted:g,styles:v}=Al(h,{duration:100}),y=Object.assign(Object.assign({},v),p);return s?null:t(n,{children:[g&&e(Ja,Object.assign({isOpen:!0,onClose:()=>u(!1),refs:d,style:y},{children:a})),e("button",Object.assign({type:"button",contentEditable:!1,ref:d.setReference,id:r,className:`yoopta-button yoopta-extended-block-actions ${o||""}`,onClick:()=>{null==l||l(),u(!0)},style:c?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(La,{})}))]})},Portal:Wa,Overlay:Ka});function hs(e,t){var n;const r=[];return t.forEach((t=>{if(t.nodeType===Node.TEXT_NODE&&r.push({text:t.textContent||""}),t.nodeType===Node.ELEMENT_NODE){const n=t;if("P"!==n.nodeName&&"SPAN"!==n.nodeName&&"DIV"!==n.nodeName||r.push(Object.assign({},hs(e,n.childNodes)[0])),"B"!==n.nodeName&&"STRONG"!==n.nodeName||r.push(Object.assign({bold:!0},hs(e,n.childNodes)[0])),"I"!==n.nodeName&&"EM"!==n.nodeName||r.push(Object.assign({italic:!0},hs(e,n.childNodes)[0])),"S"!==n.nodeName&&"STRIKE"!==n.nodeName||r.push(Object.assign({strike:!0},hs(e,n.childNodes)[0])),"U"!==n.nodeName&&"INS"!==n.nodeName||r.push(Object.assign({underline:!0},hs(e,n.childNodes)[0])),"CODE"===n.nodeName&&r.push(Object.assign({code:!0},hs(e,n.childNodes)[0])),"MARK"===n.nodeName){const t=n.style.color,o=n.style.backgroundColor||"transparent";r.push(Object.assign({highlight:{color:t,backgroundColor:o}},hs(e,n.childNodes)[0]))}"A"===n.nodeName&&r.push({id:I(),type:"link",props:{url:n.getAttribute("href")||"",target:n.getAttribute("target")||"",rel:n.getAttribute("rel")||""},children:hs(e,n.childNodes)})}})),0!==r.length||(null===(n=r[0])||void 0===n?void 0:n.text)||r.push({text:""}),r}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-h-4{height:1rem}.yoo-editor-w-4{width:1rem}.yoopta-editor *{border:0 solid #e5e7eb;box-sizing:border-box;scrollbar-color:#d3d1cb transparent}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-placeholder{display:contents;position:relative}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);cursor:text;font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;pointer-events:none;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-button{background-color:transparent;border-style:none;cursor:pointer}.yoopta-block{border-radius:.25rem;margin-bottom:1px;margin-top:2px;padding:0 2px;position:relative}.yoopta-selection-block:before{background-color:#2383e224;border-radius:4px;content:"";content:var(--tw-content);height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transition-duration:.2s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;z-index:0}.yoopta-selection-block[data-block-selected=true]:before{background-color:#2383e224;opacity:1}.yoopta-block-actions{pointer-events:none}.yoopta-block-action-buttons{display:flex;pointer-events:auto}.yoopta-block-actions-plus{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:24px}.yoopta-block-actions-plus:active,.yoopta-block-actions-plus:focus,.yoopta-block-actions-plus:hover{background-color:#37362f14}.yoopta-block-actions-drag{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:18px}.yoopta-block-actions-drag:active,.yoopta-block-actions-drag:focus,.yoopta-block-actions-drag:hover{background-color:#37362f14}.yoopta-slate:focus{outline:2px solid transparent;outline-offset:2px}.yoopta-slate:focus-visible{outline:2px solid transparent;outline-offset:2px}.yoopta-block-options-button{background-color:transparent;border-radius:.125rem;border-style:none;cursor:pointer;display:flex;justify-content:flex-start;line-height:120%;margin-left:4px;margin-right:4px;padding:.375rem .5rem;width:100%}.yoopta-block-options-button:hover{background-color:#37352f14}.yoopta-block-options-item{align-items:center;cursor:default;display:flex;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;position:relative;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-block-options-item[data-disabled]{opacity:.5;pointer-events:none}.yoopta-extended-block-actions{--tw-bg-opacity:1;align-items:center;background-color:rgb(238 238 238/var(--tw-bg-opacity));border-radius:2px;border-style:none;cursor:pointer;display:flex;height:22px;justify-content:space-between;opacity:1;padding:0 4px;position:absolute;right:8px;top:8px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,1,1);width:22px;z-index:10}.yoopta-block-options-separator{background-color:#37352f14;height:1px;margin-bottom:4px;margin-top:4px;width:100%}.yoopta-block-options-menu-content{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);min-width:200px;overflow:hidden;padding:6px 0;position:relative;width:auto}.yoopta-block-options-group{display:flex;flex-direction:column}.yoopta-align-left{justify-content:flex-start;text-align:left}.yoopta-align-center{justify-content:center;text-align:center}.yoopta-align-right{justify-content:flex-end;text-align:right}');export{Ee as Blocks,xe as Elements,Zl as HOTKEYS,Z as Paths,ps as UI,N as YooptaPlugin,z as buildBlockData,F as buildBlockElement,K as buildBlockElementsStructure,kt as buildSlateEditor,Nt as createYooptaEditor,us as createYooptaMark,fs as default,ia as deserializeHTML,hs as deserializeTextNodes,ne as findPluginBlockByPath,re as findSlateBySelectionPath,I as generateId,H as getRootBlockElement,$ as getRootBlockElementType,At as serializeTextNodes,Pt as serializeTextNodesIntoMarkdown,$t as useBlockData,Kt as useBlockSelected,zt as useYooptaEditor,Ht as useYooptaFocused,Ut as useYooptaPluginOptions,Vt as useYooptaReadOnly,So as useYooptaTools};
6
+ var Li=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Ii="undefined"==typeof Element,Fi=Ii?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,zi=!Ii&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},$i=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Hi=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!$i(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),s=e(a.length?a:l.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:l,candidates:s})}else{Fi.call(l,Li)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var c=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),u=!$i(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(c&&u){var d=e(!0===c?l.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:l,candidates:d})}else i.unshift.apply(i,l.children)}}return o},Vi=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ui=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Vi(e)?0:e.tabIndex},Ki=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Wi=function(e){return"INPUT"===e.tagName},qi=function(e){return function(e){return Wi(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||zi(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Yi=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Xi=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Fi.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Fi.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Yi(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,a=zi(e);if(l&&!l.shadowRoot&&!0===r(l))return Yi(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=i}if(function(e){var t,n,r,o,i=e&&zi(e),l=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&l;){var s,c,u;a=!(null===(c=l=null===(s=i=zi(l))||void 0===s?void 0:s.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Zi=function(e,t){return!(t.disabled||$i(t)||function(e){return Wi(e)&&"hidden"===e.type}(t)||Xi(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Fi.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ji=function(e,t){return!(qi(t)||Ui(t)<0||!Zi(e,t))},Gi=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Qi=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,a=function(e,t){var n=Ui(e);return n<0&&t&&!Vi(e)?0:n}(l,i),s=i?e(t.candidates):l;0===a?i?n.push.apply(n,s):n.push(l):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:s})})),r.sort(Ki).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},el=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Hi([e],t.includeContainer,{filter:Ji.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Gi}):function(e,t,n){if($i(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Li));return t&&Fi.call(e,Li)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ji.bind(null,t)),Qi(n)};const tl=r["useInsertionEffect".toString()]||(e=>e());var nl="undefined"!=typeof document?c:u;function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rl.apply(this,arguments)}let ol=!1,il=0;const ll=()=>"floating-ui-"+il++;const al=r["useId".toString()]||function(){const[e,t]=r.useState((()=>ol?ll():void 0));return nl((()=>{null==e&&t(ll())}),[]),r.useEffect((()=>{ol||(ol=!0)}),[]),e};const sl=r.createContext(null),cl=r.createContext(null);function ul(e){return"data-floating-ui-"+e}function dl(e){const t=a(e);return nl((()=>{t.current=e})),t}const fl=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pl(e,t){const n=el(e,fl());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(o=e)?void 0:o.ownerDocument)||document));var o;return n.slice(r+1)[0]}function hl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ro(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function gl(e){el(e,fl()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function vl(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const yl={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ml(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const bl=r.forwardRef((function(e,t){const[n,o]=r.useState();nl((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",ml),()=>{document.removeEventListener("keydown",ml)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ul("focus-guard")]:"",style:yl};return r.createElement("span",rl({},e,i))})),wl=r.createContext(null),kl=ul("portal");function xl(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),l=al(),a=Ol(),s=r.useRef(null);return nl((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{s.current=null}))}),[o]),nl((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(kl,""),e.appendChild(n),s.current=n,i(n)}),[t,l]),nl((()=>{if(s.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!Ao(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=l,o.setAttribute(kl,""),e=r||e,e.appendChild(o),s.current=o,i(o)}),[t,n,l,a]),o}({id:n,root:o}),[a,s]=r.useState(null),c=r.useRef(null),u=r.useRef(null),d=r.useRef(null),f=r.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!(!o&&!l);return r.useEffect((()=>{if(l&&i&&(null==a||!a.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&hl(e)){("focusin"===e.type?vl:gl)(l)}}}),[l,i,null==a?void 0:a.modal]),r.createElement(wl.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:l,setFocusManagerState:s})),[i,l])},p&&l&&r.createElement(bl,{"data-type":"outside",ref:c,onFocus:e=>{if(hl(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=pl(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),p&&l&&r.createElement("span",{"aria-owns":l.id,style:yl}),l&&M(t,l),p&&l&&r.createElement(bl,{"data-type":"outside",ref:u,onFocus:e=>{if(hl(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=pl(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const Ol=()=>r.useContext(wl),El=new Set,Sl=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=al();return nl((()=>{if(!n)return;El.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,c;const e=(null==(s=window.visualViewport)?void 0:s.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{El.delete(i),0===El.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,n]),r.createElement("div",rl({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function _l(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[l,a]=r.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||l,c=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Bi(p,o)||h(o);const[g,v]=r.useState(null),[y,m]=r.useState(null),b=r.useCallback((e=>{e!==O.current&&(O.current=e,v(e))}),[]),w=r.useCallback((e=>{e!==E.current&&(E.current=e,m(e))}),[]),k=l||g,x=a||y,O=r.useRef(null),E=r.useRef(null),S=r.useRef(d),_=null!=c,C=Ni(c),j=Ni(i),D=r.useCallback((()=>{if(!O.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};j.current&&(e.platform=j.current),Pi(O.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};A.current&&!Bi(S.current,t)&&(S.current=t,B.flushSync((()=>{f(t)})))}))}),[p,t,n,j]);Ri((()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const A=r.useRef(!1);Ri((()=>(A.current=!0,()=>{A.current=!1})),[]),Ri((()=>{if(k&&(O.current=k),x&&(E.current=x),k&&x){if(C.current)return C.current(k,x,D);D()}}),[k,x,D,C,_]);const P=r.useMemo((()=>({reference:O,floating:E,setReference:b,setFloating:w})),[b,w]),R=r.useMemo((()=>({reference:k,floating:x})),[k,x]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Mi(R.floating,d.x),r=Mi(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Ti(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:D,refs:P,elements:R,floatingStyles:T})),[d,D,P,R,T])}(e),u=r.useContext(cl),d=null!=((null==(f=r.useContext(sl))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return tl((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:d}),null==o||o(e,t,n)})),h=r.useRef(null),g=r.useRef({}),v=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],y=al(),m=r.useCallback((e=>{const t=Ao(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c.refs.setReference(t)}),[c.refs]),b=r.useCallback((e=>{(Ao(e)||null===e)&&(h.current=e,a(e)),(Ao(c.refs.reference.current)||null===c.refs.reference.current||null!==e&&!Ao(e))&&c.refs.setReference(e)}),[c.refs]),w=r.useMemo((()=>({...c.refs,setReference:b,setPositionReference:m,domReference:h})),[c.refs,b,m]),k=r.useMemo((()=>({...c.elements,domReference:s})),[c.elements,s]),x=r.useMemo((()=>({...c,refs:w,elements:k,dataRef:g,nodeId:i,floatingId:y,events:v,open:n,onOpenChange:p})),[c,i,y,v,n,p,w,k]);return nl((()=>{const e=null==u?void 0:u.nodesRef.current.find((e=>e.id===i));e&&(e.context=x)})),r.useMemo((()=>({...c,context:x,refs:w,elements:k})),[c,w,k,x])}const Cl=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function jl(e,t){return"function"==typeof e?e(t):e}function Dl(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[a,s]=r.useState(!1),[c,u]=r.useState("unmounted"),d=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return nl((()=>{a&&!d&&u("unmounted")}),[a,d]),nl((()=>{if(o){if(n){u("initial");const e=requestAnimationFrame((()=>{u("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),u("close")}}),[n,o]),{isMounted:d,status:c}}function Al(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:l,duration:a=250}=t,s=e.placement,c=s.split("-")[0],u=r.useMemo((()=>({side:c,placement:s})),[c,s]),d="number"==typeof a,f=(d?a:a.open)||0,p=(d?a:a.close)||0,[h,g]=r.useState((()=>({...jl(l,u),...jl(n,u)}))),{isMounted:v,status:y}=Dl(e,{duration:a}),m=dl(n),b=dl(o),w=dl(i),k=dl(l);return nl((()=>{const e=jl(m.current,u),t=jl(w.current,u),n=jl(k.current,u),r=jl(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(Cl).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Cl).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,m,b,k,f,y,u]),{isMounted:v,styles:h}}function Pl({editor:e,view:t,onClose:n,mode:r="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===r&&(t=t.filter((t=>function(e,t){var n;const r=e.blocks[t];if(!r)return!1;const o=H(r.elements);return"void"!==(null===(n=null==o?void 0:o.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,r,o,i,l,a;return{type:t,title:(null===(r=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===r?void 0:r.title)||t,description:null===(i=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===i?void 0:i.description,icon:null===(a=null===(l=e.blocks[t].options)||void 0===l?void 0:l.display)||void 0===a?void 0:a.icon}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{e.toggleBlock(t,{deleteText:"create"===r,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const Rl=p((({children:n,block:r,blockId:o,onActiveDragHandleChange:i})=>{const l=zt(),{attributes:a,listeners:c,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:p,isOver:h,isDragging:g}=mo({id:o,disabled:l.readOnly}),v=((e,t,n,r,o)=>s((()=>({marginLeft:20*e.meta.depth+"px",transform:t?`translate3d(${t.x}px, ${t.y}px, 0)`:"none",transition:n,opacity:r?.7:1,borderBottom:o&&!r?"2px solid #007aff":void 0})),[e.meta.depth,t,n,r,o]))(r,f,p,g,h),y=`yoopta-block yoopta-align-${r.meta.align||"left"}`,m=Z.isBlockSelected(l,r);return t("div",Object.assign({ref:u,className:y,style:v,"data-yoopta-block":!0,"data-yoopta-block-id":o,onMouseEnter:()=>{!l.readOnly&&i&&i({attributes:a,listeners:c,setActivatorNodeRef:d})}},{children:[n,!l.readOnly&&e("div",{"data-block-selected":m,className:"yoopta-selection-block"})]}))}));function Bl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}Rl.displayName="Block","function"==typeof SuppressedError&&SuppressedError;var Tl={};Object.defineProperty(Tl,"__esModule",{value:!0});for(var Ml="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Nl={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ll={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Ml?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Il={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Fl=1;Fl<20;Fl++)Il["f"+Fl]=111+Fl;function zl(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return $l(e,t)})),o=function(e){return r.some((function(t){return Hl(t,e)}))};return null==n?o:o(n)}function $l(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var l in Nl)r[Nl[l]]=!1;var a=!0,s=!1,c=void 0;try{for(var u,d=o[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var f=u.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Ul(f),g=Nl[h];if(f.length>1&&!g&&!Ll[f]&&!Il[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=Vl(f)),g&&(r[g]=!p||null)}}catch(e){s=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(s)throw c}}return r}function Hl(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function Vl(e){return e=Ul(e),Il[e]||e.toUpperCase().charCodeAt(0)}function Ul(e){return e=e.toLowerCase(),e=Ll[e]||e}Tl.default=zl,Tl.isHotkey=zl,Tl.isCodeHotkey=function(e,t){return zl(e,t)};var Kl=Tl.isKeyHotkey=function(e,t){return zl(e,{byKey:!0},t)};Tl.parseHotkey=$l,Tl.compareHotkey=Hl,Tl.toKeyCode=Vl,Tl.toKeyName=Ul;const Wl={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",shiftDelete:"shift+delete",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",cmdShiftEnter:"mod+shift+enter",slashCommand:"/",copy:"mod+c",cut:"mod+x",cmdShiftRight:"mod+shift+right",cmdShiftLeft:"mod+shift+left",cmdShiftDelete:"mod+shift+backspace",cmdShiftD:"mod+shift+d",cmdAltDelete:"mod+alt+backspace"},ql={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Yl={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Xl=e=>{const t=Wl[e],n=ql[e],r=Yl[e],o=t&&Kl(t),i=n&&Kl(n),l=r&&Kl(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!l||!l(e)))},Zl={isBold:Xl("bold"),isCompose:Xl("compose"),isArrowLeft:Xl("arrowLeft"),isArrowRight:Xl("arrowRight"),isArrowUp:Xl("arrowUp"),isArrowDown:Xl("arrowDown"),isDeleteBackward:Xl("deleteBackward"),isDeleteForward:Xl("deleteForward"),isDeleteLineBackward:Xl("deleteLineBackward"),isDeleteLineForward:Xl("deleteLineForward"),isDeleteWordBackward:Xl("deleteWordBackward"),isDeleteWordForward:Xl("deleteWordForward"),isExtendBackward:Xl("extendBackward"),isExtendForward:Xl("extendForward"),isExtendLineBackward:Xl("extendLineBackward"),isExtendLineForward:Xl("extendLineForward"),isItalic:Xl("italic"),isMoveLineBackward:Xl("moveLineBackward"),isMoveLineForward:Xl("moveLineForward"),isCtrlLeft:Xl("ctrlLeft"),isCtrlRight:Xl("ctrlRight"),isRedo:Xl("redo"),isShiftEnter:Xl("shiftEnter"),isEnter:Xl("enter"),isTransposeCharacter:Xl("transposeCharacter"),isUndo:Xl("undo"),isSpace:Xl("space"),isSelect:Xl("select"),isTab:Xl("tab"),isShiftTab:Xl("shiftTab"),isBackspace:Xl("backspace"),isCmdEnter:Xl("cmdEnter"),isCmd:Xl("cmd"),isEscape:Xl("escape"),isSlashCommand:Xl("slashCommand"),isShiftArrowUp:Xl("shiftArrowUp"),isShiftArrowDown:Xl("shiftArrowDown"),isCopy:Xl("copy"),isCut:Xl("cut"),isShiftDelete:Xl("shiftDelete"),isCmdShiftEnter:Xl("cmdShiftEnter"),isCmdShiftRight:Xl("cmdShiftRight"),isCmdShiftLeft:Xl("cmdShiftLeft"),isCmdShiftDelete:Xl("cmdShiftDelete"),isCmdAltDelete:Xl("cmdAltDelete"),isCmdShiftD:Xl("cmdShiftD")};const Jl={onKeyDown:function(e){return t=>{const n=re(e,{at:e.path.current});if(Zl.isShiftEnter(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;return t.preventDefault(),void n.insertText("\n")}if(Zl.isUndo(t))t.preventDefault();else if(Zl.isRedo(t))t.preventDefault();else if(Zl.isEnter(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;t.preventDefault();const r=y.first(n,[]),o=y.last(n,[]),i=y.isStart(n,n.selection.anchor,r[1]),l=y.isEnd(n,n.selection.anchor,o[1]);if(E.isExpanded(n.selection)&&w.delete(n,{at:n.selection}),!i&&!l)return void e.splitBlock({slate:n,focus:!0});const a=Ee.getBlock(e,{at:e.path.current}),s=Ee.buildBlockData({id:I()}),c=y.string(n,[]),u=i&&c.length>0,d=Z.getNextPath(e);e.batchOperations((()=>{e.insertBlock(s.type,{at:u?e.path.current:d,focus:!u}),u&&a&&e.focusBlock(a.id)}))}else if(Zl.isBackspace(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;const r=x.parent(n.selection.anchor.path);if(y.isStart(n,n.selection.anchor,r)){t.preventDefault();if(0===y.string(n,r).trim().length)return void e.deleteBlock({at:e.path.current,focus:!0});{if(E.isExpanded(n.selection))return w.delete(n,{at:n.selection});const t=Ee.getBlock(e,{at:Z.getPreviousPath(e)}),r=Ee.getBlockSlate(e,{id:null==t?void 0:t.id});if(t&&r){const{node:n}=function(e){const t=y.last(e,[]);return{node:t[0],path:t[1]}}(r);if(0===O.string(n).trim().length)return e.deleteBlock({blockId:t.id,focus:!1}),void e.setPath({current:t.meta.order})}e.mergeBlock()}}}else{if(Zl.isSelect(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;const[,r]=y.first(n,[0]),[,o]=y.last(n,[n.children.length-1]),i=y.range(n,r,o),l=E.equals(n.selection,i),a=0===y.string(n,i).trim().length;if(E.isExpanded(n.selection)&&l||a){t.preventDefault(),C.blur(n),C.deselect(n),w.deselect(n);const r=Array.from({length:Object.keys(e.children).length},((e,t)=>t));return void e.setPath({current:null,selected:r,source:"keyboard"})}}if(Zl.isShiftTab(t)){if(t.isDefaultPrevented())return;t.preventDefault();const n=e.path.selected;return Array.isArray(n)&&n.length>0?void e.batchOperations((()=>{n.forEach((t=>{const n=Ee.getBlock(e,{at:t});n&&n.meta.depth>0&&e.decreaseBlockDepth({at:t})}))})):void e.decreaseBlockDepth()}if(Zl.isTab(t)){if(t.isDefaultPrevented())return;t.preventDefault();const n=e.path.selected;return Array.isArray(n)&&n.length>0?void e.batchOperations((()=>{n.forEach((t=>{e.increaseBlockDepth({at:t})}))})):void e.increaseBlockDepth()}if(Zl.isArrowUp(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;if(1===new Set(n.selection.anchor.path).size){const n=Z.getPreviousPath(e),r=re(e,{at:n}),o=ne(e,{at:n}),i=e.blocks[(null==o?void 0:o.type)||""];if(r&&o&&!(null==i?void 0:i.hasCustomEditor)){const[,n]=y.last(r,[0]),i={path:n,offset:y.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockPath:!0})}}}if(Zl.isArrowDown(t)){if(t.isDefaultPrevented())return;if(!n||!n.selection)return;const r=x.parent(n.selection.anchor.path);if(y.isEnd(n,n.selection.anchor,r)){const n=Z.getNextPath(e),o=re(e,{at:n}),i=ne(e,{at:n}),l=e.blocks[(null==i?void 0:i.type)||""];if(o&&i&&!(null==l?void 0:l.hasCustomEditor)){const n=function(e,t){try{const[,n]=y.first(e,t);return{path:n,offset:0}}catch(e){return{path:[0,0],offset:0}}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(n&&n.selection&&E.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Kl(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Gl=({children:t,attributes:n,placeholder:r})=>{const o=D(),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Ql(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const ea={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"italic"},MARK:{type:"highlight",parse:e=>({color:e.style.color})}},ta=["left","center","right",void 0];function na(e,t,n,r){var o,i;let l;if(t.parse){l=t.parse(n,e);if(m.isElement(l)&&"inline"===(null===(o=l.props)||void 0===o?void 0:o.nodeType))return l}const a=e.blocks[t.type],s=$(a.elements)||"",c=a.elements[s],u="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:I(),type:s,children:u&&!a.hasCustomEditor?[{text:""}]:r.map(oa).flat(),props:Object.assign({nodeType:"block"},c.props)};if(l)if(m.isElement(l))d=l;else if(Array.isArray(l)){return l}if(0===d.children.length&&(d.children=[{text:""}]),!l&&t.parse)return;const f=n.getAttribute("data-meta-align"),p=parseInt(n.getAttribute("data-meta-depth")||"0",10);return Ee.buildBlockData({id:I(),type:t.type,value:[d],meta:{order:0,depth:p,align:ta.includes(f)?f:void 0}})}function ra(e,t,n){var r;if(3===n.nodeType){return{text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return{text:"\n"};const o=n;let i=Array.from(o.childNodes).map((n=>ra(e,t,n))).flat().filter(Boolean);if(ea[o.nodeName]){const e=ea[o.nodeName],t=e.type;return i.map((n=>"string"==typeof n?{[t]:!e.parse||e.parse(o),text:n}:n.text?Object.assign(Object.assign({},n),{[t]:!e.parse||e.parse(o)}):n))}const l=t[o.nodeName];if(l){if(Array.isArray(l)){return l.map((t=>na(e,t,o,i))).filter(Boolean)}return na(e,l,o,i)}return i}function oa(e){if("string"==typeof e)return{text:e};if(m.isElement(e))return e;if(Array.isArray(e))return e.map(oa).flat();if(null==e?void 0:e.text)return e;if(Ql(e)){return e.value[0].children.map(oa).flat()}return{text:""}}function ia(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const r=e.plugins[n],{parsers:o}=r;if(o){const{html:e}=o;if(e){const{deserialize:r}=e;if(r){const{nodeNames:e}=r;e&&e.forEach((e=>{const o=t[e];if(o){const i=Array.isArray(o)?o:[o];t[e]=[...i,{type:n,parse:r.parse}]}else t[e]={type:n,parse:r.parse}}))}}}})),t}(e);return ra(e,n,t).flat().filter(Ql)}var la={},aa={get exports(){return la},set exports(e){la=e}},sa={};!function(e,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t=n(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),new TypeError("Expected a string but received a ".concat(t))}},e.exports=t.default,e.exports.default=t.default}({get exports(){return sa},set exports(e){sa=e}},sa);var ca,ua,da={},fa={get exports(){return da},set exports(e){da=e}},pa={};ca={get exports(){return pa},set exports(e){pa=e}},ua=pa,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},ca.exports=ua.default,ca.exports.default=ua.default,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),(t=(0,r.default)(t,i)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var o=e.split("."),l=o[o.length-1];if(t.require_tld){if(o.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(l))return!1;if(/\s/.test(l))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(l))return!1;return o.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var n=o(sa),r=o(pa);function o(e){return e&&e.__esModule?e:{default:e}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(fa,da);var ha={};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,r.default)(t),!(n=String(n)))return e(t,4)||e(t,6);if("4"===n)return l.test(t);if("6"===n)return s.test(t);return!1};var n,r=(n=sa)&&n.__esModule?n:{default:n};var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(o,"[.]){3}").concat(o),l=new RegExp("^".concat(i,"$")),a="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(a,":){7}(?:").concat(a,"|:)|")+"(?:".concat(a,":){6}(?:").concat(i,"|:").concat(a,"|:)|")+"(?:".concat(a,":){5}(?::").concat(i,"|(:").concat(a,"){1,2}|:)|")+"(?:".concat(a,":){4}(?:(:").concat(a,"){0,1}:").concat(i,"|(:").concat(a,"){1,3}|:)|")+"(?:".concat(a,":){3}(?:(:").concat(a,"){0,2}:").concat(i,"|(:").concat(a,"){1,4}|:)|")+"(?:".concat(a,":){2}(?:(:").concat(a,"){0,3}:").concat(i,"|(:").concat(a,"){1,5}|:)|")+"(?:".concat(a,":){1}(?:(:").concat(a,"){0,4}:").concat(i,"|(:").concat(a,"){1,6}|:)|")+"(?::((?::".concat(a,"){0,5}:").concat(i,"|(?::").concat(a,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}({get exports(){return ha},set exports(e){ha=e}},ha),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,i.default)(t,s)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var l,d,f,p,h,g,v,y;if(v=e.split("#"),e=v.shift(),v=e.split("?"),e=v.shift(),(v=e.split("://")).length>1){if(l=v.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(l))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;v[0]=e.slice(2)}}if(""===(e=v.join("://")))return!1;if(v=e.split("/"),""===(e=v.shift())&&!t.require_host)return!0;if((v=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===v[0])return!1;if((d=v.shift()).indexOf(":")>=0&&d.split(":").length>2)return!1;var m=d.split(":"),b=(O=2,function(e){if(Array.isArray(e))return e}(x=m)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(x,O)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(x,O)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=b[0],k=b[1];if(""===w&&""===k)return!1}var x,O;p=v.join("@"),g=null,y=null;var E=p.match(c);E?(f="",y=E[1],g=E[2]||null):(f=(v=p.split(":")).shift(),v.length&&(g=v.join(":")));if(null!==g&&g.length>0){if(h=parseInt(g,10),!/^[0-9]+$/.test(g)||h<=0||h>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return u(f,t.host_whitelist);if(""===f&&!t.require_host)return!0;if(!((0,o.default)(f)||(0,r.default)(f,t)||y&&(0,o.default)(y,6)))return!1;if(f=f||y,t.host_blacklist&&u(f,t.host_blacklist))return!1;return!0};var n=l(sa),r=l(da),o=l(ha),i=l(pa);function l(e){return e&&e.__esModule?e:{default:e}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},c=/^\[([^\]]+)\](?::([0-9]+))?$/;function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(e===r||(o=r,"[object RegExp]"===Object.prototype.toString.call(o)&&r.test(e)))return!0}var o;return!1}e.exports=t.default,e.exports.default=t.default}(aa,la);var ga=ie(la);function va(e){return!(!e||e.length>2048)&&ga(e,{protocols:["http","https"],require_protocol:!0,require_valid_protocol:!0,require_host:!0,require_port:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,allow_underscores:!0,disallow_auth:!1})}const ya=(e,t,n)=>{var r,o,i,l;(e=>{const[t]=y.nodes(e,{match:e=>!y.isEditor(e)&&m.isElement(e)&&"link"===e.type});return!!t})(t)&&(e=>{w.unwrapNodes(e,{match:e=>!y.isEditor(e)&&m.isElement(e)&&"link"===e.type})})(t);const{selection:a}=t,s=a&&E.isCollapsed(a),c=null===(l=null===(i=null===(o=null===(r=e.plugins)||void 0===r?void 0:r.LinkPlugin)||void 0===o?void 0:o.elements)||void 0===i?void 0:i.link)||void 0===l?void 0:l.props,u={type:"link",children:s?[{text:n}]:[],props:{url:n,target:(null==c?void 0:c.target)||"_self",rel:(null==c?void 0:c.rel)||"noopener noreferrer"}};s?w.insertNodes(t,u):(w.wrapNodes(t,u,{split:!0}),w.collapse(t,{edge:"end"}))},ma=(e,t,n,r,o)=>s((()=>{let i=t.blockEditorsMap[e];const{normalizeNode:l,insertText:a,apply:s}=i,c=Object.keys(r);return c.forEach((e=>{var n;const o=null===(n=r[e].props)||void 0===n?void 0:n.nodeType,l="inline"===o,a="void"===o,s="inlineVoid"===o,{markableVoid:c,isVoid:u,isInline:d}=i;s&&(i.markableVoid=t=>c(t)||t.type===e),(a||s)&&(i.isVoid=t=>u(t)||t.type===e),(l||s)&&(i.isInline=t=>d(t)||t.type===e,i=((e,t)=>{const{insertData:n,insertText:r}=t;return t.insertText=n=>{n&&va(n)?ya(e,t,n):r(n)},t.insertData=r=>{const o=r.getData("text/plain");o&&va(o)?ya(e,t,o):n(r)},t})(t,i))})),i.insertText=e=>{const n=Z.getSelectedPaths(t),r=Z.getPath(t);Array.isArray(n)&&n.length>0&&t.setPath({current:r}),a(e)},i.normalizeNode=e=>{const[r,o]=e,a=t.blocks[n.type].elements;if(Object.keys(a).length>1)return l(e);if(m.isElement(r)){const{type:e}=r,t=$(a);if(!c.includes(e))return void w.setNodes(i,{id:I(),type:t,props:Object.assign({},r.props)},{at:o});if(r.type===t)for(const[e,t]of O.children(i,o))if(m.isElement(e)&&!i.isInline(e))return void w.unwrapNodes(i,{at:t})}l(e)},i.apply=n=>{var r,o,l;if(_.isSelectionOperation(n)){const e=Z.getSelectedPaths(t),n=Z.getPath(t);Array.isArray(e)&&i.selection&&E.isExpanded(i.selection)&&t.setPath({current:n})}let a=t.isSavingHistory();if(void 0===a&&(a=ba(n)),a){const a=t.historyStack.undos[t.historyStack.undos.length-1];if(!a||"set_slate"!==(null===(r=null==a?void 0:a.operations[0])||void 0===r?void 0:r.type)){const r={type:"set_slate",properties:{slateOps:[n],selectionBefore:i.selection},blockId:e,slate:i};return t.applyTransforms([r],{source:"api",validatePaths:!1}),void s(n)}const c=null===(l=null===(o=null==a?void 0:a.operations[0])||void 0===o?void 0:o.properties)||void 0===l?void 0:l.slateOps,u=c&&c[c.length-1];let d=wa(n,u);if(0!==i.operations.length&&(d=!0),d)u!==n&&c.push(n);else{const r={operations:[n],selectionBefore:i.selection},o={type:"set_slate",properties:{slateOps:r.operations,selectionBefore:r.selectionBefore},blockId:e,slate:i};t.applyTransforms([o],{source:"api",validatePaths:!1})}}s(n)},o&&(i=o(i,t,e)),i}),[]),ba=e=>"set_selection"!==e.type,wa=(e,t)=>t===e||(!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!x.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!x.equals(e.path,t.path))),ka=({id:t,customEditor:n,elements:r,marks:o,events:i,options:l,extensions:c,placeholder:u="Type '/' for commands"})=>{const f=zt(),p=$t(t);let h=a(p.value).current;const g=s((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(r)),[r]),v=s((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(o)),[o]),m=ma(t,f,p,r,c),b=((e,t,n,r)=>s((()=>{if(!e||t.readOnly)return{};const o=Bl(e||{},["onBeforeCreate","onDestroy","onCreate"]),i={hotkeys:Zl,currentBlock:n,defaultBlock:Ee.buildBlockData({id:I()})},l={};return Object.keys(o).forEach((e=>{l[e]=function(n){o[e]&&o[e](t,r,i)(n)}})),l}),[e,t,n]))(i,f,p,m),w=d((e=>{f.readOnly||(window.scheduler?window.scheduler.postTask((()=>f.updateBlock(t,{value:e})),{priority:"background"}):f.updateBlock(t,{value:e}))}),[t]),k=d((e=>{f.readOnly||"mousemove"!==f.path.source&&"keyboard"!==f.path.source&&f.setPath({current:f.path.current,selected:f.path.selected,selection:e,source:"native-selection"})}),[f.readOnly]),O=d((n=>{const r=g[n.element.type],{attributes:o}=n,i=Bl(n,["attributes"]);return o["data-element-type"]=i.element.type,r?e(r,Object.assign({},i,{attributes:o,blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(R,Object.assign({},i,{attributes:o}))}),[r]),S=d((t=>{var n,r,o,i;let{children:l,leaf:a,attributes:s}=t;const c=Bl(a,["text"]),d=f.path.current===p.meta.order;c&&Object.keys(c).forEach((e=>{const t=v[e];t&&(l=t.render({children:l,leaf:a}))}));const h=!("void"===(null===(i=null===(o=null===(r=null===(n=t.children)||void 0===n?void 0:n.props)||void 0===r?void 0:r.parent)||void 0===o?void 0:o.props)||void 0===i?void 0:i.nodeType))&&d&&a.withPlaceholder;return e(Gl,Object.assign({attributes:s,placeholder:h?u:void 0},{children:l}))}),[o]),_=d((e=>{var t;f.readOnly||(null===(t=b.onKeyDown)||void 0===t||t.call(b,e),Jl.onKeyDown(f)(e))}),[b.onKeyDown,f.readOnly,f.path.current,p.meta.order]),j=d((e=>{var t;f.readOnly||null===(t=null==b?void 0:b.onKeyUp)||void 0===t||t.call(b,e)}),[b.onKeyUp,f.readOnly]),D=d((e=>{var t;f.readOnly||(e.preventDefault(),null===(t=null==b?void 0:b.onBlur)||void 0===t||t.call(b,e))}),[b.onBlur,f.readOnly]),A=d((e=>{var t;f.readOnly||(f.isFocused()||(ee.set(f,!0),f.emit("focus",!0)),null===(t=null==b?void 0:b.onFocus)||void 0===t||t.call(b,e))}),[b.onFocus,f.readOnly]),P=d((e=>{var t;if(f.readOnly)return;null===(t=null==b?void 0:b.onPaste)||void 0===t||t.call(b,e);const n=e.clipboardData.getData("text/html"),r=(new DOMParser).parseFromString(n,"text/html");if(r.body.childNodes.length>0){const t=ia(f,r.body);if(t.length>0&&null!==f.path.current){e.preventDefault();let n=!1,r=!1;if(m&&m.selection){const e=x.parent(m.selection.anchor.path),t=y.string(m,e).trim(),o=y.isStart(m,m.selection.anchor,e);r=""===t&&o,n=!o||t.length>0,C.blur(m)}const o=f.path.current;if(null===o)return;return void f.batchOperations((()=>{const e=[];r&&f.deleteBlock({at:o}),t.forEach(((t,r)=>{let i=n?o+r+1:o+r;e.push(i);const l=Bl(t,["type"]);f.insertBlock(t.type,{at:i,focus:!1,blockData:l})})),f.setPath({current:null,selected:e,source:"copy-paste"})}))}}}),[b.onPaste,f.readOnly]),B=d((e=>{const t=[];if(f.readOnly)return t;const[n,r]=e,o=f.path.current===p.meta.order;return m.selection&&o&&!y.isEditor(n)&&""===y.string(m,[r[0]])&&E.includes(m.selection,r)&&E.isCollapsed(m.selection)&&t.push(Object.assign(Object.assign({},m.selection),{withPlaceholder:!0})),t}),[f.readOnly,f.path.current,p.meta.order]);return e(xa,{id:t,slate:m,initialValue:h,onChange:w,onSelectionChange:k,decorate:B,renderLeaf:S,renderElement:O,eventHandlers:b,onKeyDown:_,onKeyUp:j,onFocus:A,onBlur:D,customEditor:n,readOnly:f.readOnly,onPaste:P})},xa=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:l,eventHandlers:a,onKeyDown:s,onKeyUp:c,onFocus:u,onSelectionChange:d,onPaste:f,customEditor:p,decorate:h,readOnly:g})=>"function"==typeof p?p({blockId:t}):e(A,Object.assign({editor:n,initialValue:r,onValueChange:o,onSelectionChange:d},{children:e(P,Object.assign({renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},a,{onKeyDown:s,onKeyUp:c,onFocus:u,decorate:h,readOnly:g,onPaste:f}),`editable-${t}`)}),`slate-${t}`)));xa.displayName="SlateEditorInstance";const Oa=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s((()=>[...t].filter((e=>null!=e))),[...t])}(_n(yr,{activationConstraint:{distance:20}}),_n(fr,{coordinateGetter:ko})),handleDragEnd:d((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,t)}}),[]),handleDragStart:d((t=>{e.setPath({current:null})}),[])});var Ea;function Sa(){return Sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sa.apply(this,arguments)}var _a,Ca=function(e){return r.createElement("svg",Sa({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Ea||(Ea=r.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function ja(){return ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ja.apply(this,arguments)}var Da,Aa=function(e){return r.createElement("svg",ja({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),_a||(_a=r.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Pa(){return Pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pa.apply(this,arguments)}var Ra=function(e){return r.createElement("svg",Pa({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Da||(Da=r.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Ba(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var Ta=["color"],Ma=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,Ta);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Na=["color"],La=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,Na);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Ia=["color"],Fa=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,Ia);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),za=["color"],$a=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Ba(e,za);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Ha=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},Va={"text/plain":"Text","text/html":"Url",default:"Text"};var Ua=function(e,t){var n,r,o,i,l,a,s=!1;t||(t={}),n=t.debug||!1;try{if(o=Ha(),i=document.createRange(),l=document.getSelection(),(a=document.createElement("span")).textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=Va[t.format]||Va.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(a),i.selectNodeContents(a),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),a&&document.body.removeChild(a),o()}return s};const Ka=t=>{var{className:n,children:r,lockScroll:o=!0}=t,i=Bl(t,["className","children","lockScroll"]);return e(Sl,Object.assign({lockScroll:o,className:n},i,{onClick:e=>{var t;e.stopPropagation(),null===(t=i.onClick)||void 0===t||t.call(i,e)},onMouseDown:e=>{var t;e.stopPropagation(),null===(t=i.onMouseDown)||void 0===t||t.call(i,e)}},{children:r}))},Wa=t=>{const[n,r]=f(!1),o=a(null),i=zt();return u((()=>{r(!0);const e=i.refElement;if(!e)return;return e.querySelector(".yoopta-overlays")||(o.current=document.createElement("div"),o.current.className="yoopta-overlays",e.appendChild(o.current)),()=>{o.current&&o.current.remove()}}),[]),n?e(xl,Object.assign({id:`${t.id}-${i.id}`,root:o.current||i.refElement},{children:t.children})):null},qa=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),Ya=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoopta-block-options-menu-content data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),Xa=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),Za=["delete","duplicate","turnInto","copy"],Ja=({isOpen:n,onClose:r,refs:o,style:i,actions:l=Za,children:a})=>{var s,c,u;const d=zt(),p=So(),[h,g]=f(!1),{refs:v,floatingStyles:y,context:m}=_l({placement:"right",open:h,onOpenChange:g,middleware:[Ai(),Di(),ji(),di(10)],whileElementsMounted:Ci}),{isMounted:b,styles:w}=Al(m,{duration:100});if(!n)return null;const k=ne(d,{at:d.path.current}),x=H(null===(s=d.blocks[(null==k?void 0:k.type)||""])||void 0===s?void 0:s.elements),O="void"===(null===(c=null==x?void 0:x.props)||void 0===c?void 0:c.nodeType),E=p.ActionMenu,S=Object.assign(Object.assign({},y),w),_=Pl({editor:d,view:"small",onClose:()=>{g(!1),r()}});return e(Wa,Object.assign({id:"yoo-block-options-portal"},{children:e(Ka,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating,contentEditable:!1},{children:t(Ya,{children:[null!==l&&t(qa,{children:[e(Xa,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{d.deleteBlock({at:d.path.current}),d.setPath({current:null}),r()}},{children:[e($a,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(Xa,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{"number"==typeof d.path.current&&(d.duplicateBlock({original:{path:d.path.current},focus:!0}),r())}},{children:[e(Ma,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!E&&!O&&!(null===(u=d.blocks[(null==k?void 0:k.type)||""])||void 0===u?void 0:u.hasCustomEditor)&&t(Xa,{children:[b&&e(Wa,Object.assign({id:"yoo-block-options-portal"},{children:e(Ka,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>g(!1)},{children:e("div",Object.assign({style:S,ref:v.setFloating},{children:e(E,Object.assign({},_))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:v.setReference,onClick:()=>g((e=>!e))},{children:[e(Ra,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(Xa,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=ne(d);e&&(Ua(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),r()}},{children:[e(Fa,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Ga=Object.freeze({__proto__:null,BlockOptions:Ja,BlockOptionsMenuContent:Ya,BlockOptionsMenuGroup:qa,BlockOptionsMenuItem:Xa,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const Qa={position:"fixed",top:0,left:0,opacity:0,transform:"scale(0.95) translateX(-46px)",transition:"opacity 150ms ease-out"},es=p((({editor:n,dragHandleProps:r})=>{const[o,i]=f(null),l=a(null),[s,c]=f(Qa),{attributes:d,listeners:p,setActivatorNodeRef:h}=r||{},{isBlockOptionsMounted:g,setIsBlockOptionsOpen:v,blockOptionsFloatingStyle:m,blockOptionsRefs:b}=(()=>{const[e,t]=f(!1),{refs:n,floatingStyles:r,context:o}=_l({placement:"right-start",open:e,onOpenChange:t,middleware:[Ai(),Di(),ji(),di()]}),{isMounted:i,styles:l}=Al(o,{duration:100});return{blockOptionsRefs:n,blockOptionsFloatingStyle:Object.assign(Object.assign({},r),l),isBlockOptionsOpen:e,setIsBlockOptionsOpen:t,isBlockOptionsMounted:i}})(),{isActionMenuOpen:k,actionMenuRefs:x,hasActionMenu:O,actionMenuStyles:E,onChangeActionMenuOpen:S,onCloseActionMenu:_,actionMenuRenderProps:j,ActionMenu:D}=(({editor:e})=>{const t=So().ActionMenu,[n,r]=f(!1),{refs:o,floatingStyles:i,context:l}=_l({placement:"bottom-start",open:n,onOpenChange:r,middleware:[Ai(),Di(),ji(),di(10)],whileElementsMounted:Ci}),{isMounted:a,styles:s}=Al(l,{duration:100}),c=Object.assign(Object.assign({},i),s),u=e=>r(e),d=()=>u(!1),p=Pl({editor:e,view:"default",mode:"create",onClose:d});return{isActionMenuOpen:a,actionMenuStyles:c,actionMenuRefs:o,hasActionMenu:!!t,onChangeActionMenuOpen:u,actionMenuRenderProps:p,onCloseActionMenu:d,ActionMenu:t}})({editor:n}),A=()=>{c((e=>Object.assign(Object.assign({},e),{opacity:0,transform:Qa.transform}))),setTimeout((()=>{i(null)}),150)},P=function(e,t,{leading:n=!0,trailing:r=!0}={}){let o=0,i=null,l=null;const a=t=>{e(...l),o=t,l=null},s=(...e)=>{const s=Date.now();o||n||(o=s);const c=t-(s-o);l=e,c<=0||c>t?(i&&(clearTimeout(i),i=null),a(s)):!i&&r&&(i=setTimeout((()=>{i=null,r&&l&&a(Date.now())}),c))};return s.cancel=()=>{i&&(clearTimeout(i),i=null),l=null,o=0},s}((e=>{var t,r;const a=null===(t=n.refElement)||void 0===t?void 0:t.contains(e.target),s=null===(r=l.current)||void 0===r?void 0:r.contains(e.target);if(!a)return A();if(n.readOnly)return;if(s)return;const u=e.target.closest("[data-yoopta-block]");if(u){const e=u.getAttribute("data-yoopta-block-id");if(e===(null==o?void 0:o.id))return;const t=n.children[e||""];t&&((e,t)=>{var n;i(t);const r=e.getBoundingClientRect(),o=(null===(n=l.current)||void 0===n?void 0:n.offsetWidth)||46;c((e=>Object.assign(Object.assign({},e),{top:r.top+2,left:r.left,opacity:1,transform:`scale(1) translateX(-${o}px)`})))})(u,t)}}),100,{leading:!0,trailing:!0});u((()=>(document.addEventListener("scroll",A),document.addEventListener("mousemove",P),()=>{document.removeEventListener("scroll",A),document.removeEventListener("mousemove",P),P.cancel()})),[]);return e(Wa,Object.assign({id:"block-actions"},{children:e("div",Object.assign({contentEditable:!1,style:s,className:"yoopta-block-actions",ref:l},{children:t("div",Object.assign({className:"yoopta-block-action-buttons"},{children:[k&&O&&e(Wa,Object.assign({id:"yoo-block-options-portal"},{children:e(Ka,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:_},{children:e("div",Object.assign({style:E,ref:x.setFloating},{children:e(D,Object.assign({},j))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=o;if(!t)return;const r=Ee.getBlockSlate(n,{id:t.id}),i=n.blocks[t.type];if(!r)return;const l=document.querySelector(`[data-yoopta-block-id="${t.id}"]`),a=H(i.elements);let s;i.hasCustomEditor||(s=y.string(r,[0]));const c="string"==typeof s&&0===s.trim().length;if(O&&c&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType))n.setPath({current:t.meta.order}),n.focusBlock(t.id),x.setReference(l),S(!0);else{const e=Ee.buildBlockData({id:I()}),r=t.meta.order+1;n.setPath({current:t.meta.order}),n.insertBlock(e.type,{at:r,focus:!0}),O&&setTimeout((()=>{l&&x.setReference(l.nextSibling),S(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Aa,{})})),e("button",Object.assign({ref:e=>{null==h||h(e),b.setReference(e)},type:"button",className:"yoopta-block-actions-drag",onClick:e=>{e.stopPropagation();const t=o;if(!t)return;const r=re(n,{at:t.meta.order});n.focusBlock(t.id),r&&setTimeout((()=>{n.blocks[t.type].hasCustomEditor||(C.blur(r),C.deselect(r),w.deselect(r)),n.setPath({current:t.meta.order,selected:[t.meta.order]}),v(!0)}),10)}},d,p,{children:e(Ca,{})})),e(Ja,{isOpen:g,refs:b,style:m,onClose:()=>v(!1)})]}))}))}))}));es.displayName="FloatingBlockActions";const ts=[],ns=({editor:r,marks:o,placeholder:i})=>{const l=Vt(),{sensors:a,handleDragEnd:c,handleDragStart:u}=Oa({editor:r}),[d,p]=f(null),h=Object.keys(r.children),g=s((()=>0===h.length?ts:h.sort(((e,t)=>r.children[e].meta.order-r.children[t].meta.order))),[h]),v=[];for(let t=0;t<g.length;t++){const n=g[t],l=r.children[n],a=r.plugins[l.type];l&&a?v.push(e(Rl,Object.assign({block:l,blockId:n,onActiveDragHandleChange:p},{children:e(ka,{type:l.type,id:n,marks:o,customEditor:a.customEditor,events:a.events,elements:a.elements,options:a.options,extensions:a.extensions,placeholder:i},n)}),n)):console.error(`Plugin ${l.type} not found`)}return l?e(n,{children:v}):e(Xr,Object.assign({id:"yoopta-dnd-context",sensors:a,collisionDetection:Tn,onDragStart:u,onDragEnd:c},{children:t(uo,Object.assign({disabled:l,items:g,strategy:ao},{children:[v,e(es,{editor:r,dragHandleProps:d})]}))}))},rs=({editor:e,root:t})=>{const[n,r]=f({origin:[0,0],coords:[0,0],selection:!1}),o=o=>{var i;if(e.readOnly||!1===t)return;const l=null===(i=e.refElement)||void 0===i?void 0:i.contains(o.target),s=Z.getSelectedPaths(e);if(!l&&!n.selection&&Array.isArray(s)&&s.length>0)return e.setPath({current:null}),a();l||r({origin:[o.pageX,o.pageY-window.pageYOffset],coords:[o.pageX,o.pageY-window.pageYOffset],selection:!0})},i=o=>{if(!n.selection||e.readOnly||!1===t)return;r((e=>Object.assign(Object.assign({},e),{coords:[o.pageX,o.pageY-window.pageYOffset]})));const i=((e,t,n)=>{var r;const o=[],i=null===(r=e.refElement)||void 0===r?void 0:r.querySelectorAll("[data-yoopta-block]");return i?(i.forEach(((e,r)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),a=Math.min(t[0],n[0]),s=Math.max(t[1],n[1]),c=Math.max(t[0],n[0]);l<i.bottom&&s>i.top&&a<i.right&&c>i.left&&o.push(r)})),o):o})(e,n.origin,[o.pageX,o.pageY-window.pageYOffset]);e.setPath({current:null,selected:i,source:"selection-box"})},l=()=>{e.readOnly||a()};u((()=>{var n;if(e.readOnly||!1===t)return;const r=t&&"current"in t?t.current:t||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=e.refElement)||void 0===n?void 0:n.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",o),r.addEventListener("mousemove",i),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",o),r.removeEventListener("mousemove",i),r.removeEventListener("mouseup",l)}}),[e.path,n,t,e.readOnly]);const a=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:a})},os=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:o})},is={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null};function ls({editor:e}){const t=a(!1),n=a(!1),r=a(null),o=a(null);let i=a(is).current;const l=()=>{const t=e.path.current;if("number"==typeof t){const n=Ee.getBlockSlate(e,{at:t}),r=Ee.getBlock(e,{at:t}),o=e.blocks[(null==r?void 0:r.type)||""];if(!n||(null==o?void 0:o.hasCustomEditor))return;try{y.withoutNormalizing(n,(()=>{w.select(n,[0]),n.selection&&E.isExpanded(n.selection)&&(C.blur(n),C.deselect(n))}))}catch(e){}}},s=i=>{if(!t.current||e.readOnly)return;const a=document.elementFromPoint(i.clientX,i.clientY),s=null==a?void 0:a.closest("[data-yoopta-block]");s&&e.batchOperations((()=>{var t;const i=s.getAttribute("data-yoopta-block-id")||"",a=null===(t=e.children[i])||void 0===t?void 0:t.meta.order;if(n.current&&"number"==typeof a&&a===r.current)return o.current=a,void e.setPath({current:a,selected:[a],source:"mousemove"});if("number"==typeof a&&a!==o.current){o.current=a,n.current=!0;const t=Math.min(r.current,a),i=Math.max(r.current,a);l();const s=Array.from({length:i-t+1},((e,n)=>t+n));e.setPath({current:a,selected:s,source:"mousemove"})}}))},c=()=>{var i,l;t.current=!1,n.current=!1,r.current=null,o.current=null,null===(i=e.refElement)||void 0===i||i.removeEventListener("mousemove",s),null===(l=e.refElement)||void 0===l||l.removeEventListener("mouseup",c),null===document||void 0===document||document.removeEventListener("mouseup",c)};return{onMouseDown:n=>{e.readOnly||(e.isFocused()||e.focus(),e.batchOperations((()=>{var i,a,u;const d=Z.getSelectedPaths(e);Array.isArray(d)&&d.length>0&&!n.shiftKey&&!n.altKey&&e.setPath({current:null});const f=n.target.closest("[data-yoopta-block]");if(f&&0===n.button){const d=f.getAttribute("data-yoopta-block-id")||"",p=null===(i=e.children[d])||void 0===i?void 0:i.meta.order;if("number"==typeof p){if(t.current=!0,r.current=p,o.current=p,n.shiftKey&&!Z.isPathEmpty(e)&&p!==e.path.current)return void(t=>{l();const n=Z.getPath(e);if("number"!=typeof n)return;const r=Array.from({length:Math.abs(t-n)}).map(((e,r)=>t>n?n+r+1:n-r-1));e.setPath({current:t,selected:[...r,n],source:"keyboard"})})(p);p!==e.path.current&&e.setPath({current:p}),null===(a=e.refElement)||void 0===a||a.addEventListener("mousemove",s),null===(u=e.refElement)||void 0===u||u.addEventListener("mouseup",c),null===document||void 0===document||document.addEventListener("mouseup",c)}}})))},onShiftArrowUp:t=>{if("function"==typeof t.isDefaultPrevented&&t.isDefaultPrevented())return;if(i.selectionStarted&&null!==i.startedIndexToSelect&&null!==i.indexToSelect){const t=i.indexToSelect,n=t-1;if(0===t)return;if(t===i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}if(n<i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}const r=Z.getSelectedPaths(e);if((null==r?void 0:r.includes(t))&&t!==i.startedIndexToSelect){const o=r.filter((e=>e!==t));return e.setPath({current:n,selected:o,source:"keyboard"}),void(i.indexToSelect=n)}return}const n=ne(e),r=re(e);if(!r||!r.selection||!n)return;const o=x.parent(r.selection.anchor.path),l=y.isStart(r,r.selection.focus,o);if(E.isExpanded(r.selection)&&l){const o=q(e);if("number"!=typeof o)return;const l=ne(e,{at:o});if(n&&l){t.preventDefault(),C.blur(r),C.deselect(r),w.deselect(r);const o=e.path.selected?[...e.path.selected,null==n?void 0:n.meta.order,n.meta.order-1]:[null==n?void 0:n.meta.order,n.meta.order-1];e.setPath({current:null,selected:o,source:"keyboard"}),i.startedIndexToSelect=n.meta.order,i.indexToSelect=n.meta.order-1,i.selectionStarted=!0}}},onShiftArrowDown:t=>{if(i.selectionStarted&&null!==i.indexToSelect&&null!==i.startedIndexToSelect){const t=i.indexToSelect,n=t+1;if(n===Object.keys(e.children).length)return;if(t===i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}if(n>i.startedIndexToSelect){const t=e.path.selected?[...e.path.selected,n]:[n];return e.setPath({current:n,selected:t,source:"keyboard"}),void(i.indexToSelect=n)}const r=Z.getSelectedPaths(e);if((null==r?void 0:r.includes(t))&&t!==i.startedIndexToSelect){const o=r.filter((e=>e!==t));return e.setPath({current:n,selected:o,source:"keyboard"}),void(i.indexToSelect=n)}return}const n=ne(e),r=re(e);if(!r||!r.selection||!n)return;const o=x.parent(r.selection.anchor.path),l=y.isEnd(r,r.selection.focus,o);if(E.isExpanded(r.selection)&&l){const o=Z.getNextPath(e),l=ne(e,{at:o});if(n&&l){t.preventDefault(),C.blur(r),C.deselect(r),w.deselect(r);const o=e.path.selected?[...e.path.selected,null==n?void 0:n.meta.order,(null==n?void 0:n.meta.order)+1]:[null==n?void 0:n.meta.order,n.meta.order+1];e.setPath({current:null,selected:o,source:"keyboard"}),i.startedIndexToSelect=n.meta.order,i.indexToSelect=n.meta.order+1,i.selectionStarted=!0}}},selectionState:i}}const as=({placeholder:n,marks:r,className:o,selectionBoxRoot:i,width:l,style:a,children:s,autoFocus:c=!0})=>{const d=zt(),f=Vt(),p=rs({editor:d,root:i}),h=ls({editor:d});u((()=>{c&&!f&&d.focus()}),[c,f]),u((()=>{if(!f)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.path,f]);const g=()=>{h.selectionState.indexToSelect=null,h.selectionState.startedIndexToSelect=null,h.selectionState.selectionStarted=!1},v=e=>{if(!f){if(Zl.isRedo(e))return e.preventDefault(),void d.redo();if(Zl.isUndo(e))return e.preventDefault(),void d.undo();if(Zl.isSelect(e)){const t=Z.getSelectedPaths(d);if((null==t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(Array.isArray(t)&&t.length>0){e.preventDefault();const t=Object.keys(d.children).map(((e,t)=>t));return void d.setPath({current:null,selected:t,source:"keyboard"})}}if(Zl.isCopy(e)||Zl.isCut(e)){const t=Z.getSelectedPaths(d);if(Array.isArray(t)&&t.length>0){e.preventDefault();const t=d.getHTML(d.getEditorValue()),n=d.getPlainText(d.getEditorValue()),r=new Blob([t],{type:"text/html"}),o=new Blob([n],{type:"text/plain"}),i=new ClipboardItem({"text/html":r,"text/plain":o});return navigator.clipboard.write([i]).then((()=>{const e=(new DOMParser).parseFromString(t,"text/html");console.log("HTML copied\n",e.body)})),void(Zl.isCut(e)&&(d.batchOperations((()=>{const e=Z.getSelectedPaths(d);if(Array.isArray(e)&&e.length>0){const t=e.length===Object.keys(d.children).length;if(e.forEach((e=>{var t;const n=null===(t=Ee.getBlock(d,{at:e}))||void 0===t?void 0:t.id;n&&d.deleteBlock({blockId:n})})),t){const e=z({id:I()});d.insertBlock(e.type,{at:0,focus:!0})}}})),d.setPath({current:null,selected:null,source:"copy-paste"}),g()))}}if(Zl.isBackspace(e)){e.stopPropagation();const t=Z.getSelectedPaths(d);return(null==t?void 0:t.length)===Object.keys(d.children).length?(e.preventDefault(),void d.batchOperations((()=>{Object.keys(d.children).forEach((e=>d.deleteBlock({blockId:e}))),d.setPath({current:null,selected:null}),g()}))):void d.batchOperations((()=>{const t=Z.getSelectedPaths(d);Array.isArray(t)&&(null==t?void 0:t.length)>0&&(e.preventDefault(),t.forEach((e=>d.deleteBlock({at:e}))),d.setPath({current:null,selected:null}),g())}))}if(Zl.isShiftArrowUp(e)&&h.onShiftArrowUp(e),Zl.isShiftArrowDown(e)&&h.onShiftArrowDown(e),Zl.isTab(e)){const t=Z.getSelectedPaths(d);Array.isArray(t)&&t.length>0&&(e.preventDefault(),d.batchOperations((()=>{t.forEach((e=>{const t=Ee.getBlock(d,{at:e});d.increaseBlockDepth({blockId:null==t?void 0:t.id})}))})))}else if(Zl.isShiftTab(e)){const t=Z.getSelectedPaths(d);Array.isArray(t)&&t.length>0&&(e.preventDefault(),d.batchOperations((()=>{t.forEach((e=>{const t=Ee.getBlock(d,{at:e});d.decreaseBlockDepth({blockId:null==t?void 0:t.id})}))})))}else;}},b=e=>{if(!f)return;const t=e.clipboardData,n=window.getSelection();if(n&&n.rangeCount>0){const e=n.getRangeAt(0);if(e.collapsed)return;const r=e.cloneContents().querySelectorAll("[data-yoopta-block-id]");if(!r.length)return;const o=Array.from(r).reduce(((e,t)=>{const n=t.getAttribute("data-yoopta-block-id")||"",r=d.children[n];return r&&(e[n]=r),e}),{}),i=d.getHTML(o),l=d.getPlainText(o);return t.setData("text/html",i),void t.setData("text/plain",l)}},w=(k=Object.assign(Object.assign({},a),{userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:l||(null==a?void 0:a.width),paddingBottom:null==a?void 0:a.paddingBottom}),Object.assign(Object.assign({},k),{width:k.width||400,paddingBottom:"number"==typeof k.paddingBottom?k.paddingBottom:100}));var k;return t("div",Object.assign({ref:e=>d.refElement=e,className:o?`yoopta-editor ${o}`:"yoopta-editor",style:w,onMouseDown:e=>{f||(h.onMouseDown(e),g(),(e=>{var t;const n=d.refElement;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10),i=z({id:I()});if(e.clientY>=o){const e=Object.keys(d.children).length-1,n=ne(d,{at:e}),r=re(d,{at:e});if(n&&r&&r.selection){const e=y.string(r,r.selection.anchor.path),o=x.parent(r.selection.anchor.path),[l]=y.node(r,o);if(n.type===i.type&&m.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:r})}const o=e+1;d.insertBlock(i.type,{at:o,focus:!0})}})(e))},onBlur:e=>{var t,n;if((null===(t=d.refElement)||void 0===t?void 0:t.contains(e.relatedTarget))||(null===(n=d.refElement)||void 0===n?void 0:n.contains(e.target))||f)return;g();const r=Z.getSelectedPaths(d);Array.isArray(r)&&r.length>0&&d.setPath({current:null,selected:null})},onCopy:b,onCut:b},{children:[e(ns,{editor:d,marks:r,placeholder:n}),!1!==i&&e(os,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!f}),s]}))};function ss(e,t){const n=re(e);if(!n)return!1;const r=y.marks(n);return!!(null==r?void 0:r[t])}function cs(e,t){const n={};return t.forEach((t=>{const r=t.type;n[r]={hotkey:t.hotkey,type:r,getValue:()=>function(e,t){const n=re(e);if(!n)return null;const r=y.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ss(e,r),toggle:()=>function(e,t){if(Array.isArray(e.path.selected)&&e.path.selected.length>0){const n=e.path.selected.map((n=>{const r=Ee.getBlockSlate(e,{at:n});if(!r)return{isActiveMark:!1,slate:r};const[o]=y.node(r,[]);if(!o)return{isActiveMark:!1,slate:r};const i=y.end(r,[]),l=y.start(r,[]);w.select(r,{anchor:l,focus:i});const a=y.marks(r);return{slate:r,isActiveMark:!!(null==a?void 0:a[t])}})),r=n.every((e=>e.isActiveMark));for(const e of n)e.isActiveMark?r&&y.removeMark(e.slate,t):y.addMark(e.slate,t,!0);return}const n=re(e),r=ss(e,t);n&&n.selection&&(r?y.removeMark(n,t):y.addMark(n,t,!0))}(e,r),update:t=>function(e,t,n){if(Array.isArray(e.path.selected)&&e.path.selected.length>0){for(const r of e.path.selected){const o=Ee.getBlockSlate(e,{at:r});if(!o)continue;const[i]=y.node(o,[]);if(!i)continue;const l=y.end(o,[]),a=y.start(o,[]);w.select(o,{anchor:a,focus:l});const s=y.marks(o);(null==s?void 0:s[t])?y.removeMark(o,t):y.addMark(o,t,n)}return}const r=re(e);r&&r.selection&&E.isExpanded(r.selection)&&y.addMark(r,t,n)}(e,r,t)}})),n}function us({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const ds=us({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),fs=({id:t,editor:n,value:r,marks:o,plugins:i,autoFocus:l,className:a,tools:c,selectionBoxRoot:p,children:h,placeholder:g,readOnly:v,width:y,style:m,onChange:b,onPathChange:w})=>{const k=s((()=>o?[ds,...o]:[ds]),[o]),x=s((()=>i.map((e=>e.getPlugin))),[i]),[O,E]=f((()=>{n.id||(n.id=t||I()),n.readOnly=v||!1,k&&(n.formats=cs(n,k)),n.blocks=function(e,t){const n={};return t.forEach((t=>{var r;const o=H(t.elements),i=null===(r=null==o?void 0:o.props)||void 0===r?void 0:r.nodeType;if("inline"!==i&&"inlineVoid"!==i){const r={};Object.keys(t.elements).forEach((e=>{const n=Bl(t.elements[e],["render"]);r[e]=n}));const{display:o,placeholder:i,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:r,hasCustomEditor:!!t.customEditor,options:{display:o,placeholder:i,shortcuts:l},isActive:()=>{const n=ne(e,{at:e.path.current});return(null==n?void 0:n.type)===t.type}}}})),n}(n,x);const e=fe(r);return e||void 0===r||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(r)}`),n.children=e?r:{},n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=kt(e);if(0===r.children.length){const t=e.children[n];if(t){const n=K(e,t.type);r.children=[n]}}t[n]=r})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,r,o,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(r=e.options)||void 0===r?void 0:r.shortcuts.length)>0&&(null===(i=null===(o=e.options)||void 0===o?void 0:o.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var r;const o=e.elements[t],i=null===(r=o.props)||void 0===r?void 0:r.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=Object.assign(Object.assign({},o),{rootPlugin:e.type}))})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const r=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:r})}})),t}(x),n.commands=function(e,t){const n={};return t.forEach((t=>{t.commands&&Object.keys(t.commands).forEach((r=>{var o;(null===(o=t.commands)||void 0===o?void 0:o[r])&&(n[r]=(...n)=>{var o;return null===(o=t.commands)||void 0===o?void 0:o[r](e,...n)})}))})),n}(n,x),{editor:n,version:0}})),[S,_]=f(null),C=d((e=>{_(e),null==w||w(e)}),[]),j=d(((e,t)=>{if(E((e=>({editor:e.editor,version:e.version+1}))),"function"==typeof b&&Array.isArray(t.operations)){const n=t.operations.filter((e=>"validate_block_paths"!==e.type&&"set_block_path"!==e.type&&"set_slate"!==e.type));n.length>0&&b(e,{operations:n})}}),[]);return u((()=>{const e=e=>{j(e.value,{operations:e.operations})};return n.on("change",e),n.on("path-change",C),()=>{n.off("change",e),n.off("path-change",C)}}),[n,j]),e(Ft,Object.assign({editorState:O},{children:e(Eo,Object.assign({tools:c},{children:e(as,Object.assign({placeholder:g,marks:k,autoFocus:l,className:a,selectionBoxRoot:p,width:y,style:m},{children:h}))}))}))},ps=Object.assign(Object.assign({},Ga),{ExtendedBlockActions:({id:r,className:o,style:i,onClick:l,children:a})=>{const s=Vt(),[c,u]=f(!1),{refs:d,floatingStyles:p,context:h}=_l({placement:"bottom-start",open:c,onOpenChange:u,middleware:[Ai(),Di(),ji(),di(10)],whileElementsMounted:Ci}),{isMounted:g,styles:v}=Al(h,{duration:100}),y=Object.assign(Object.assign({},v),p);return s?null:t(n,{children:[g&&e(Ja,Object.assign({isOpen:!0,onClose:()=>u(!1),refs:d,style:y},{children:a})),e("button",Object.assign({type:"button",contentEditable:!1,ref:d.setReference,id:r,className:`yoopta-button yoopta-extended-block-actions ${o||""}`,onClick:()=>{null==l||l(),u(!0)},style:c?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(La,{})}))]})},Portal:Wa,Overlay:Ka});function hs(e,t){var n;const r=[];return t.forEach((t=>{if(t.nodeType===Node.TEXT_NODE&&r.push({text:t.textContent||""}),t.nodeType===Node.ELEMENT_NODE){const n=t;if("P"!==n.nodeName&&"SPAN"!==n.nodeName&&"DIV"!==n.nodeName||r.push(Object.assign({},hs(e,n.childNodes)[0])),"B"!==n.nodeName&&"STRONG"!==n.nodeName||r.push(Object.assign({bold:!0},hs(e,n.childNodes)[0])),"I"!==n.nodeName&&"EM"!==n.nodeName||r.push(Object.assign({italic:!0},hs(e,n.childNodes)[0])),"S"!==n.nodeName&&"STRIKE"!==n.nodeName||r.push(Object.assign({strike:!0},hs(e,n.childNodes)[0])),"U"!==n.nodeName&&"INS"!==n.nodeName||r.push(Object.assign({underline:!0},hs(e,n.childNodes)[0])),"CODE"===n.nodeName&&r.push(Object.assign({code:!0},hs(e,n.childNodes)[0])),"MARK"===n.nodeName){const t=n.style.color,o=n.style.backgroundColor||"transparent";r.push(Object.assign({highlight:{color:t,backgroundColor:o}},hs(e,n.childNodes)[0]))}"A"===n.nodeName&&r.push({id:I(),type:"link",props:{url:n.getAttribute("href")||"",target:n.getAttribute("target")||"",rel:n.getAttribute("rel")||""},children:hs(e,n.childNodes)})}})),0!==r.length||(null===(n=r[0])||void 0===n?void 0:n.text)||r.push({text:""}),r}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-h-4{height:1rem}.yoo-editor-w-4{width:1rem}.yoopta-editor *{border:0 solid #e5e7eb;box-sizing:border-box;scrollbar-color:#d3d1cb transparent}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-placeholder{display:contents;position:relative}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);cursor:text;font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;pointer-events:none;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-button{background-color:transparent;border-style:none;cursor:pointer}.yoopta-block{border-radius:.25rem;margin-bottom:1px;margin-top:2px;padding:0 2px;position:relative}.yoopta-selection-block:before{background-color:#2383e224;border-radius:4px;content:"";content:var(--tw-content);height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transition-duration:.2s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;z-index:0}.yoopta-selection-block[data-block-selected=true]:before{background-color:#2383e224;opacity:1}.yoopta-block-actions{pointer-events:none}.yoopta-block-action-buttons{display:flex;pointer-events:auto}.yoopta-block-actions-plus{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:24px}.yoopta-block-actions-plus:active,.yoopta-block-actions-plus:focus,.yoopta-block-actions-plus:hover{background-color:#37362f14}.yoopta-block-actions-drag{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:18px}.yoopta-block-actions-drag:active,.yoopta-block-actions-drag:focus,.yoopta-block-actions-drag:hover{background-color:#37362f14}.yoopta-slate:focus{outline:2px solid transparent;outline-offset:2px}.yoopta-slate:focus-visible{outline:2px solid transparent;outline-offset:2px}.yoopta-block-options-button{background-color:transparent;border-radius:.125rem;border-style:none;cursor:pointer;display:flex;justify-content:flex-start;line-height:120%;margin-left:4px;margin-right:4px;padding:.375rem .5rem;width:100%}.yoopta-block-options-button:hover{background-color:#37352f14}.yoopta-block-options-item{align-items:center;cursor:default;display:flex;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;position:relative;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-block-options-item[data-disabled]{opacity:.5;pointer-events:none}.yoopta-extended-block-actions{--tw-bg-opacity:1;align-items:center;background-color:rgb(238 238 238/var(--tw-bg-opacity));border-radius:2px;border-style:none;cursor:pointer;display:flex;height:22px;justify-content:space-between;opacity:1;padding:0 4px;position:absolute;right:8px;top:8px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,1,1);width:22px;z-index:10}.yoopta-block-options-separator{background-color:#37352f14;height:1px;margin-bottom:4px;margin-top:4px;width:100%}.yoopta-block-options-menu-content{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);min-width:200px;overflow:hidden;padding:6px 0;position:relative;width:auto}.yoopta-block-options-group{display:flex;flex-direction:column}.yoopta-align-left{justify-content:flex-start;text-align:left}.yoopta-align-center{justify-content:center;text-align:center}.yoopta-align-right{justify-content:flex-end;text-align:right}');export{Ee as Blocks,xe as Elements,Zl as HOTKEYS,Z as Paths,ps as UI,N as YooptaPlugin,z as buildBlockData,F as buildBlockElement,K as buildBlockElementsStructure,kt as buildSlateEditor,Nt as createYooptaEditor,us as createYooptaMark,fs as default,ia as deserializeHTML,hs as deserializeTextNodes,ne as findPluginBlockByPath,re as findSlateBySelectionPath,I as generateId,H as getRootBlockElement,$ as getRootBlockElementType,At as serializeTextNodes,Pt as serializeTextNodesIntoMarkdown,$t as useBlockData,Kt as useBlockSelected,zt as useYooptaEditor,Ht as useYooptaFocused,Ut as useYooptaPluginOptions,Vt as useYooptaReadOnly,So as useYooptaTools};
@@ -1 +1 @@
1
- {"version":3,"file":"deserializeHTML.d.ts","sourceRoot":"","sources":["../../src/parsers/deserializeHTML.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,SAAS,EAAuB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA+LhG,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,iDAUnE"}
1
+ {"version":3,"file":"deserializeHTML.d.ts","sourceRoot":"","sources":["../../src/parsers/deserializeHTML.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,SAAS,EAAuB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA+LhG,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,iDAUnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/plugins/hooks.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAK7D,OAAO,EAA6B,YAAY,EAAE,MAAM,SAAS,CAAC;AAIlE,eAAO,MAAM,cAAc,OACrB,MAAM,UACF,SAAS,SACV,eAAe,YACZ,GAAG,kBACG,GAAG,sCAsJpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,WACnB,YAAY,GAAG,SAAS,UACxB,SAAS,SACV,eAAe,SACf,WAAW,wBAwBnB,CAAC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/plugins/hooks.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAK7D,OAAO,EAA6B,YAAY,EAAE,MAAM,SAAS,CAAC;AAIlE,eAAO,MAAM,cAAc,OACrB,MAAM,UACF,SAAS,SACV,eAAe,YACZ,GAAG,kBACG,GAAG,sCA0JpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,WACnB,YAAY,GAAG,SAAS,UACxB,SAAS,SACV,eAAe,SACf,WAAW,wBAwBnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.9.8",
3
+ "version": "4.9.9",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -68,5 +68,5 @@
68
68
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
69
69
  },
70
70
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
71
- "gitHead": "1f76dd78df66443a2f176994faab20db5a5be576"
71
+ "gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
72
72
  }