@yoopta/editor 4.6.6 → 4.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var Xo=["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(","),qo="undefined"==typeof Element,Zo=qo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Go=!qo&&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},Jo=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},Qo=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var l=i.shift();if(!Jo(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),a=e(c.length?c:l.children,!0,o);o.flatten?r.push.apply(r,a):r.push({scopeParent:l,candidates:a})}else{Zo.call(l,Xo)&&o.filter(l)&&(n||!t.includes(l))&&r.push(l);var s=l.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(l),d=!Jo(s,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return r},er=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tr=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))&&!er(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},or=function(e){return"INPUT"===e.tagName},rr=function(e){return function(e){return or(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Go(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(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 r=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!r||r===e}(e)},ir=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},lr=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Zo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Zo.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ir(e)}else{if("function"==typeof o){for(var i=e;e;){var l=e.parentElement,c=Go(e);if(l&&!l.shadowRoot&&!0===o(l))return ir(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,o,r,i=e&&Go(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!c&&l;){var a,s,d;c=!(null===(s=l=null===(a=i=Go(l))||void 0===a?void 0:a.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},cr=function(e,t){return!(t.disabled||Jo(t)||function(e){return or(e)&&"hidden"===e.type}(t)||lr(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 o=t.children.item(n);if("LEGEND"===o.tagName)return!!Zo.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},ar=function(e,t){return!(rr(t)||tr(t)<0||!cr(e,t))},sr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},dr=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=tr(e);return n<0&&t&&!er(e)?0:n}(l,i),a=i?e(t.candidates):l;0===c?i?n.push.apply(n,a):n.push(l):o.push({documentOrder:r,tabIndex:c,item:t,isScope:i,content:a})})),o.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ur=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qo([e],t.includeContainer,{filter:ar.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:sr}):function(e,t,n){if(Jo(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Xo));return t&&Zo.call(e,Xo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,ar.bind(null,t)),dr(n)};const fr=o["useInsertionEffect".toString()]||(e=>e());var pr="undefined"!=typeof document?a:s;function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},hr.apply(this,arguments)}let gr=!1,vr=0;const yr=()=>"floating-ui-"+vr++;const mr=o["useId".toString()]||function(){const[e,t]=o.useState((()=>gr?yr():void 0));return pr((()=>{null==e&&t(yr())}),[]),o.useEffect((()=>{gr||(gr=!0)}),[]),e};const br=o.createContext(null),wr=o.createContext(null);function xr(e){return"data-floating-ui-"+e}function kr(e){const t=c(e);return pr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Or(e,t){const n=ur(e,Er());"prev"===t&&n.reverse();const o=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==(r=e)?void 0:r.ownerDocument)||document));var r;return n.slice(o+1)[0]}function Cr(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!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&&Un(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Sr(e){ur(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(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 jr={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 Br(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Rr=o.forwardRef((function(e,t){const[n,r]=o.useState();pr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Br),()=>{document.removeEventListener("keydown",Br)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xr("focus-guard")]:"",style:jr};return o.createElement("span",hr({},e,i))})),_r=o.createContext(null),Ar=xr("portal");function Mr(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,i]=o.useState(null),l=mr(),c=Tr(),a=o.useRef(null);return pr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{a.current=null}))}),[r]),pr((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(Ar,""),e.appendChild(n),a.current=n,i(n)}),[t,l]),pr((()=>{if(a.current)return;let e=n||(null==c?void 0:c.portalNode);e&&!Fn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const r=document.createElement("div");r.id=l,r.setAttribute(Ar,""),e=o||e,e.appendChild(r),a.current=r,i(r)}),[t,n,l,c]),r}({id:n,root:r}),[c,a]=o.useState(null),s=o.useRef(null),d=o.useRef(null),u=o.useRef(null),f=o.useRef(null),p=!!c&&!c.modal&&c.open&&i&&!(!r&&!l);return o.useEffect((()=>{if(l&&i&&(null==c||!c.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&&Cr(e)){("focusin"===e.type?Dr:Sr)(l)}}}),[l,i,null==c?void 0:c.modal]),o.createElement(_r.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:a})),[i,l])},p&&l&&o.createElement(Rr,{"data-type":"outside",ref:s,onFocus:e=>{if(Cr(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Or(document.body,"prev")||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),p&&l&&o.createElement("span",{"aria-owns":l.id,style:jr}),l&&b(t,l),p&&l&&o.createElement(Rr,{"data-type":"outside",ref:d,onFocus:e=>{if(Cr(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Or(document.body,"next")||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const Tr=()=>o.useContext(_r),Nr=new Set,Lr=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const i=mr();return pr((()=>{if(!n)return;Nr.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,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[o]=r+"px"),e){var a,s;const e=(null==(a=window.visualViewport)?void 0:a.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Nr.delete(i),0===Nr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}}),[i,n]),o.createElement("div",hr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Pr(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e,[l,c]=o.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:s,open:d}=e,[u,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);$o(p,r)||h(r);const[g,v]=o.useState(null),[m,b]=o.useState(null),w=o.useCallback((e=>{e!==O.current&&(O.current=e,v(e))}),[]),x=o.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=l||g,E=c||m,O=o.useRef(null),C=o.useRef(null),S=o.useRef(u),D=null!=s,j=Yo(s),B=Yo(i),R=o.useCallback((()=>{if(!O.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};B.current&&(e.platform=B.current),Uo(O.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};_.current&&!$o(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,B]);Vo((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const _=o.useRef(!1);Vo((()=>(_.current=!0,()=>{_.current=!1})),[]),Vo((()=>{if(k&&(O.current=k),E&&(C.current=E),k&&E){if(j.current)return j.current(k,E,R);R()}}),[k,E,R,j,D]);const A=o.useMemo((()=>({reference:O,floating:C,setReference:w,setFloating:x})),[w,x]),M=o.useMemo((()=>({reference:k,floating:E})),[k,E]),T=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=Ko(M.floating,u.x),o=Ko(M.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+o+"px)",...Wo(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,a,M.floating,u.x,u.y]);return o.useMemo((()=>({...u,update:R,refs:A,elements:M,floatingStyles:T})),[u,R,A,M,T])}(e),d=o.useContext(wr),u=null!=((null==(f=o.useContext(br))?void 0:f.id)||null);var f;const p=function(e){const t=o.useRef((()=>{}));return fr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];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:u}),null==r||r(e,t,n)})),h=o.useRef(null),g=o.useRef({}),v=o.useState((()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter((e=>e!==n)))||[])}}}()))[0],m=mr(),b=o.useCallback((e=>{const t=Fn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=o.useCallback((e=>{(Fn(e)||null===e)&&(h.current=e,c(e)),(Fn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Fn(e))&&s.refs.setReference(e)}),[s.refs]),x=o.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=o.useMemo((()=>({...s.elements,domReference:a})),[s.elements,a]),E=o.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:v,open:n,onOpenChange:p})),[s,i,m,v,n,p,x,k]);return pr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const Ir=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Fr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[c,a]=o.useState(!1),[s,d]=o.useState("unmounted"),u=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return pr((()=>{c&&!u&&d("unmounted")}),[c,u]),pr((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}a(!0),d("close")}}),[n,r]),{isMounted:u,status:s}}function Hr(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:l,duration:c=250}=t,a=e.placement,s=a.split("-")[0],d=o.useMemo((()=>({side:s,placement:a})),[s,a]),u="number"==typeof c,f=(u?c:c.open)||0,p=(u?c:c.close)||0,[h,g]=o.useState((()=>({...zr(l,d),...zr(n,d)}))),{isMounted:v,status:y}=Fr(e,{duration:c}),m=kr(n),b=kr(r),w=kr(i),x=kr(l);return pr((()=>{const e=zr(m.current,d),t=zr(w.current,d),n=zr(x.current,d),o=zr(b.current,d)||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(o).map(Ir).join(","),transitionDuration:f+"ms",...n,...o}),"close"===y){const o=t||e;g({transitionProperty:Object.keys(o).map(Ir).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Ur;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vr.apply(this,arguments)}var $r=function(e){return o.createElement("svg",Vr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Ur||(Ur=o.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 Wr(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}var Kr=["color"],Yr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Kr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Xr=["color"],qr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Xr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Zr=["color"],Gr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Zr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Jr=["color"],Qr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Jr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),ei=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));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()}},ti={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var n,o,r,i,l,c,a=!1;t||(t={}),n=t.debug||!1;try{if(r=ei(),i=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ti[t.format]||ti.default;window.clipboardData.setData(r,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(c),i.selectNodeContents(c),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");a=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=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(o,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),c&&document.body.removeChild(c),r()}return a};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ri(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}function ii(e,t){var n;return(null===(n=e.children)||void 0===n?void 0:n.map((e=>{const n=t[e];if(!n)throw new Error(`Element definition for ${e} not found`);return G({id:Z(),type:e,props:n.props,children:n.children&&n.children.length>0?ii(n,t):[{text:""}]})})))||[]}const li=i(void 0),ci=({children:o,tools:r})=>{const i=V(),l=d((()=>r?Object.keys(r).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=r[t])||void 0===n?void 0:n.render})}),{}):{}),[r]),c=d((()=>!r||i?null:Object.keys(r).map((t=>{var n,o,i;const l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,c=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,a=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:c},a),t):null}))),[r]);return e(li.Provider,Object.assign({value:l},{children:t(n,{children:[c,o]})}))},ai=()=>{const e=l(li);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:n,mode:o="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===o&&(t=t.filter((t=>function(e,t){var n;const o=e.blocks[t];if(!o)return!1;const r=ri(o.elements);return"void"!==(null===(n=null==r?void 0:r.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,o,r,i,l,c;return{type:t,title:(null===(o=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===o?void 0:o.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description,icon:null===(c=null===(l=e.blocks[t].options)||void 0===l?void 0:l.display)||void 0===c?void 0:c.icon}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===o&&e.blocks[t].toggle({focus:!0}),"create"===o&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}function di(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const ui=t=>{var{className:n,children:o,lockScroll:r=!0}=t,i=di(t,["className","children","lockScroll"]);return e(Lr,Object.assign({lockScroll:r,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:o}))},fi=t=>{const[n,o]=f(!1),r=c(null),i=F();return s((()=>{o(!0);const e=i.refElement;if(!e)return;return e.querySelector(".yoopta-overlays")||(r.current=document.createElement("div"),r.current.className="yoopta-overlays",e.appendChild(r.current)),()=>{r.current&&r.current.remove()}}),[]),n?e(Mr,Object.assign({id:`${t.id}-${i.id}`,root:r.current||i.refElement},{children:t.children})):null},pi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),hi=({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})),gi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),vi=({isOpen:n,onClose:o,refs:r,style:i,children:l})=>{var c,a,s;const d=F(),u=ai(),[p,h]=f(!1),{refs:g,floatingStyles:v,context:y}=Pr({placement:"right",open:p,onOpenChange:h,middleware:[Ho(),Fo(),zo(),ko(10)],whileElementsMounted:Io}),{isMounted:m,styles:b}=Hr(y,{duration:100});if(!n)return null;const w=L(d,{at:d.selection}),x=ri(null===(c=d.blocks[(null==w?void 0:w.type)||""])||void 0===c?void 0:c.elements),k="void"===(null===(a=null==x?void 0:x.props)||void 0===a?void 0:a.nodeType),E=u.ActionMenu,O=Object.assign(Object.assign({},v),b),C=si({editor:d,view:"small",onClose:()=>{h(!1),o()}});return e(fi,Object.assign({id:"yoo-block-options-portal"},{children:e(ui,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(hi,{children:[t(pi,{children:[e(gi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=d.selection;d.deleteBlock({at:e}),d.setBlockSelected(null),d.setSelection(null),o()}},{children:[e(Qr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(gi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{d.duplicateBlock({at:d.selection,focus:!0}),d.setBlockSelected(null),o()}},{children:[e(Yr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!E&&!k&&!(null===(s=d.blocks[(null==w?void 0:w.type)||""])||void 0===s?void 0:s.hasCustomEditor)&&t(gi,{children:[m&&e(fi,Object.assign({id:"yoo-block-options-portal"},{children:e(ui,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>h(!1)},{children:e("div",Object.assign({style:O,ref:g.setFloating},{children:e(E,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:g.setReference,onClick:()=>h((e=>!e))},{children:[e($r,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(gi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=L(d);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),o()}},{children:[e(Gr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var yi=Object.freeze({__proto__:null,BlockOptions:vi,BlockOptionsMenuContent:hi,BlockOptionsMenuGroup:pi,BlockOptionsMenuItem:gi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const mi=({block:n,editor:o,dragHandleProps:r,onChangeActiveBlock:i,showActions:l})=>{const[c,a]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=ai().ActionMenu,[n,o]=f(!1),{refs:r,floatingStyles:i,context:l}=Pr({placement:"bottom-start",open:n,onOpenChange:o,middleware:[Ho(),Fo(),zo(),ko(10)],whileElementsMounted:Io}),{isMounted:c,styles:a}=Hr(l,{duration:100}),s=Object.assign(Object.assign({},i),a),d=e=>o(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:c,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:o}),{refs:m,floatingStyles:b,context:x}=Pr({placement:"right-start",open:c,onOpenChange:a,middleware:[Ho(),Fo(),zo(),ko()]}),{isMounted:k,styles:E}=Hr(x,{duration:100}),{setActivatorNodeRef:O,attributes:C,listeners:j}=r,B=Object.assign(Object.assign({},b),E);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(fi,Object.assign({id:"yoo-block-options-portal"},{children:e(ui,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:g},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(y,Object.assign({},v))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=Nn(o,{at:[n.meta.order]}),r=o.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ri(r.elements);let c;r.hasCustomEditor||(c=S.string(t,[0]));const a="string"==typeof c&&0===c.trim().length;if(u&&a&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))o.setSelection([n.meta.order]),o.focusBlock(n.id),d.setReference(i),h(!0);else{const e=J({id:Z()}),t=[n.meta.order+1];o.setSelection([n.meta.order]),o.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Tn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{O(e),m.setReference(e)}},C,j,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Nn(o,{at:[n.meta.order]});o.focusBlock(n.id),t&&setTimeout((()=>{o.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),o.setBlockSelected([n.meta.order],{only:!0}),o.setSelection([n.meta.order]),a(!0)}),10)}},{children:e(An,{})})),e(vi,{isOpen:k,refs:m,style:B,onClose:()=>a(!1)})]}))},bi=({children:n,block:o,blockId:r})=>{var i;const l=F(),[c,a]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=On({id:r,disabled:l.readOnly}),m=`yoopta-block yoopta-align-${o.meta.align||"left"}`,b={marginLeft:20*o.meta.depth+"px",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1},w=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),x=c===r,k={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:m,onMouseEnter:()=>{l.readOnly||a(r)},onMouseLeave:()=>{l.readOnly||a(null)},style:b,"data-hovered-block":x,"data-yoopta-block":!0,"data-yoopta-block-id":r,"data-yoopta-block-type":o.type},{children:[!l.readOnly&&e(mi,{block:o,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:x,onChangeActiveBlock:e=>a(e)}),e("div",Object.assign({style:k},{children:n})),w&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};var wi={};Object.defineProperty(wi,"__esModule",{value:!0});for(var xi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ki={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ei={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:xi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Oi={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},Ci=1;Ci<20;Ci++)Oi["f"+Ci]=111+Ci;function Si(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Di(e,t)})),r=function(e){return o.some((function(t){return ji(t,e)}))};return null==n?r:r(n)}function Di(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var l in ki)o[ki[l]]=!1;var c=!0,a=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(c=(d=u.next()).done);c=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Ri(f),g=ki[h];if(f.length>1&&!g&&!Ei[f]&&!Oi[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=Bi(f)),g&&(o[g]=!p||null)}}catch(e){a=!0,s=e}finally{try{!c&&u.return&&u.return()}finally{if(a)throw s}}return o}function ji(e,t){for(var n in e){var o=e[n],r=void 0;if(null!=o&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===o&&93===t.which?91:t.which:t[n])||!1!==o)&&r!==o))return!1}return!0}function Bi(e){return e=Ri(e),Oi[e]||e.toUpperCase().charCodeAt(0)}function Ri(e){return e=e.toLowerCase(),e=Ei[e]||e}wi.default=Si,wi.isHotkey=Si,wi.isCodeHotkey=function(e,t){return Si(e,t)};var _i=wi.isKeyHotkey=function(e,t){return Si(e,{byKey:!0},t)};wi.parseHotkey=Di,wi.compareHotkey=ji,wi.toKeyCode=Bi,wi.toKeyName=Ri;const Ai={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",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",slashCommand:"/",copy:"mod+c",cut:"mod+x"},Mi={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"},Ti={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ni=e=>{const t=Ai[e],n=Mi[e],o=Ti[e],r=t&&_i(t),i=n&&_i(n),l=o&&_i(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!l||!l(e)))},Li={isBold:Ni("bold"),isCompose:Ni("compose"),isArrowLeft:Ni("arrowLeft"),isArrowRight:Ni("arrowRight"),isArrowUp:Ni("arrowUp"),isArrowDown:Ni("arrowDown"),isDeleteBackward:Ni("deleteBackward"),isDeleteForward:Ni("deleteForward"),isDeleteLineBackward:Ni("deleteLineBackward"),isDeleteLineForward:Ni("deleteLineForward"),isDeleteWordBackward:Ni("deleteWordBackward"),isDeleteWordForward:Ni("deleteWordForward"),isExtendBackward:Ni("extendBackward"),isExtendForward:Ni("extendForward"),isExtendLineBackward:Ni("extendLineBackward"),isExtendLineForward:Ni("extendLineForward"),isItalic:Ni("italic"),isMoveLineBackward:Ni("moveLineBackward"),isMoveLineForward:Ni("moveLineForward"),isCtrlLeft:Ni("ctrlLeft"),isCtrlRight:Ni("ctrlRight"),isRedo:Ni("redo"),isShiftEnter:Ni("shiftEnter"),isEnter:Ni("enter"),isTransposeCharacter:Ni("transposeCharacter"),isUndo:Ni("undo"),isSpace:Ni("space"),isSelect:Ni("select"),isTab:Ni("tab"),isShiftTab:Ni("shiftTab"),isBackspace:Ni("backspace"),isCmdEnter:Ni("cmdEnter"),isCmd:Ni("cmd"),isEscape:Ni("escape"),isSlashCommand:Ni("slashCommand"),isShiftArrowUp:Ni("shiftArrowUp"),isShiftArrowDown:Ni("shiftArrowDown"),isCopy:Ni("copy"),isCut:Ni("cut")};const Pi={onKeyDown:function(e){return t=>{const n=Nn(e,{at:e.selection});if(!n||!n.selection)return;const o=j.parent(n.selection.anchor.path);if(Li.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Li.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(n,n.selection.anchor,o),i=S.isEnd(n,n.selection.anchor,o);if(!r&&!i)return void e.splitBlock({slate:n,focus:!0});const l=J({id:Z()}),c=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:c,slate:n,focus:!0})}else if(Li.isBackspace(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,o)){t.preventDefault();const r=S.string(n,o),i=e.selection?e.selection[0]-1:0,l=Nn(e,{at:[i]}),c=L(e,{at:[i]}),a=e.blocks[(null==c?void 0:c.type)||""];let s;if(l&&!a.hasCustomEditor&&(s=function(e,t){try{const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}catch(e){return{path:[0,0],offset:0}}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(B.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,o=L(e,{at:[t]}),r=e.blocks[(null==o?void 0:o.type)||""];if(r&&r.hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const i=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(R.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,i,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Li.isSelect(t)){if(t.isDefaultPrevented())return;const[,o]=S.first(n,[0]),[,r]=S.last(n,[n.children.length-1]),i=S.range(n,o,r),l=B.equals(n.selection,i),c=0===S.string(n,i).trim().length;if(B.isExpanded(n.selection)&&l||c)return t.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Li.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Li.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Li.isArrowUp(t)){if(t.isDefaultPrevented())return;if(1===new Set(n.selection.anchor.path).size){const n=e.selection?[e.selection[0]-1]:null,o=Nn(e,{at:n}),r=L(e,{at:n});if(o&&r){const[,n]=S.last(o,[0]),i={path:n,offset:S.string(o,n).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Li.isArrowDown(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,r=Nn(e,{at:n}),i=L(e,{at:n});if(r&&i){const n=function(e,t){try{const[,n]=S.first(e,t);return{path:n,offset:0}}catch(e){return{path:[0,0],offset:0}}}(r,o);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(B.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&_i(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Ii=({children:t,attributes:n,placeholder:o})=>{const r=x(),i=Object.assign({},n);return r&&o&&(i["data-placeholder"]=o,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function zi(e){try{return new URL(e),!0}catch(e){return!1}}const Fi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&_.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&_.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,o=n&&B.isCollapsed(n),r={type:"link",children:o?[{text:t}]:[],props:{url:t,target:"_self",rel:"noopener noreferrer"}};o?D.insertNodes(e,r):(D.wrapNodes(e,r,{split:!0}),D.collapse(e,{edge:"end"}))},Hi=new WeakMap;function Ui(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Vi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"italic"}};function $i(e,t,n,o){var r,i;let l;if(t.parse){l=t.parse(n);if(_.isElement(l)&&"inline"===(null===(r=l.props)||void 0===r?void 0:r.nodeType))return l}const c=e.blocks[t.type],a=oi(c.elements)||"",s=c.elements[a],d="void"===(null===(i=s.props)||void 0===i?void 0:i.nodeType);let u={id:Z(),type:a,children:d&&!c.hasCustomEditor?[{text:""}]:o.map(Ki),props:Object.assign({nodeType:"block"},s.props)};if(l)if(_.isElement(l))u=l;else if(Array.isArray(l)){return l}0===u.children.length&&(u.children=[{text:""}]);return J({id:Z(),type:t.type,value:[u],meta:{order:0,depth:0}})}function Wi(e,t,n){var o,r;if(3===n.nodeType){return null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const i=n;let l=Array.from(i.childNodes).map((n=>Wi(e,t,n))).flat();if(Vi[n.nodeName]){return{[Vi[n.nodeName].type]:!0,text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}const c=t[n.nodeName];return c?Array.isArray(c)?c.map((t=>$i(e,t,n,l))):$i(e,c,n,l):l}function Ki(e){if("string"==typeof e)return{text:e};if(_.isElement(e))return e;if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Ui(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}function Yi(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const o=e.plugins[n],{parsers:r}=o;if(r){const{html:e}=r;if(e){const{deserialize:o}=e;if(o){const{nodeNames:e}=o;e&&e.forEach((e=>{const r=t[e];if(r){const i=Array.isArray(r)?r:[r];t[e]=[...i,{type:n,parse:o.parse}]}else t[e]={type:n,parse:o.parse}}))}}}})),t}(e);return Wi(e,n,t).filter(Ui)}const Xi=({id:t,customEditor:n,elements:o,marks:r,events:i,options:l,placeholder:a="Type '/' for commands"})=>{var s,f,p;const h=F(),g=H(t),v=c(g.value).current,y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(o).forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,l="void"===r,c="inlineVoid"===r;c&&(e.markableVoid=e=>e.type===t),(l||c)&&(e.isVoid=e=>e.type===t),(i||c)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&zi(t)?Fi(e,t):n(t)},e.insertData=n=>{const o=n.getData("text/plain");o&&zi(o)?Fi(e,o):t(n)},e})(e))})),e}),[o]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Li,currentBlock:g,defaultBlock:J({id:Z()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),k=u((e=>h.updateBlock(t,{value:e})),[t]),E=u((n=>{const o=y[n.element.type],{attributes:r}=n,i=di(n,["attributes"]);let c;r["data-element-type"]=i.element.type;try{c=w.findPath(b,n.element)}catch(e){c=[]}return o?e(o,Object.assign({},i,{path:c,attributes:r,blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(O,Object.assign({},i,{attributes:r}))}),[o,b.children]),C=u((t=>{var n,o,r,i,l;let{children:c,leaf:s,attributes:d}=t;const u=di(s,["text"]),f=(null===(n=h.selection)||void 0===n?void 0:n[0])===g.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(c=t.render({children:c,leaf:s}))}));const p=!("void"===(null===(l=null===(i=null===(r=null===(o=t.children)||void 0===o?void 0:o.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===l?void 0:l.nodeType))&&f&&s.withPlaceholder;return e(Ii,Object.assign({attributes:d,placeholder:p?a:void 0},{children:c}))}),[r]),D=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),Pi.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),j=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),R=u((e=>{var t,n;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==g.meta.order&&h.setSelection([g.meta.order]),null===(n=null==x?void 0:x.onMouseDown)||void 0===n||n.call(x,e))}),[x.onMouseDown,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),_=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),A=u((e=>{var t;h.readOnly||(h.isFocused()||(Hi.set(h,!0),h.emit("focus",!0)),null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e))}),[x.onFocus,h.readOnly]),M=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const e=Yi(h,o.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),T=u((e=>{var t;const n=[];if(h.readOnly)return n;const[o,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(o)&&""===S.string(b,[r[0]])&&B.includes(b.selection,r)&&B.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],g.meta.order]);return e(qi,{id:t,slate:b,initialValue:v,onChange:k,decorate:T,renderLeaf:C,renderElement:E,eventHandlers:x,onKeyDown:D,onKeyUp:j,onFocus:A,onMouseDown:R,onBlur:_,customEditor:n,readOnly:h.readOnly,onPaste:M})},qi=p((({id:t,slate:n,initialValue:o,onChange:r,renderLeaf:i,renderElement:l,eventHandlers:c,onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:o,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},c,{onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));qi.displayName="SlateEditorInstance";const Zi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(Et,{activationConstraint:{distance:20}}),Ae(mt,{coordinateGetter:Dn})),handleDragEnd:u((t=>{const{active:n,over:o}=t;if(n&&o&&n.id!==o.id){const t=e.children[o.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Gi=[],Ji=({editor:t,marks:o,placeholder:r})=>{const i=V(),{sensors:l,handleDragEnd:c,handleDragStart:a}=Zi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Gi:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],l=t.children[i],c=t.plugins[l.type];l&&c?f.push(e(bi,Object.assign({block:l,blockId:i},{children:e(Xi,{type:l.type,id:i,marks:o,customEditor:c.customEditor,events:c.events,elements:c.elements,options:c.options,placeholder:r},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(tn,Object.assign({sensors:l,collisionDetection:Fe,onDragStart:a,onDragEnd:c},{children:e(yn,Object.assign({disabled:i,items:u,strategy:hn},{children:f}))}))},Qi=({editor:e,root:t})=>{const[n,o]=f({origin:[0,0],coords:[0,0],selection:!1}),r=r=>{var i;if(e.readOnly||!1===t)return;const l=null===(i=e.refElement)||void 0===i?void 0:i.contains(r.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||o({origin:[r.pageX,r.pageY-window.pageYOffset],coords:[r.pageX,r.pageY-window.pageYOffset],selection:!0})},i=r=>{if(!n.selection||e.readOnly||!1===t)return;o((e=>Object.assign(Object.assign({},e),{coords:[r.pageX,r.pageY-window.pageYOffset]})));const i=((e,t,n)=>{var o;const r=[],i=null===(o=e.refElement)||void 0===o?void 0:o.querySelectorAll("[data-yoopta-block]");return i?(i.forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),c=Math.min(t[0],n[0]),a=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&a>i.top&&c<i.right&&s>i.left&&r.push(o)})),r):r})(e,n.origin,[r.pageX,r.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===t)return;const o=t&&"current"in t?t.current:t||document;if(!o)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in o))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(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",r),o.addEventListener("mousemove",i),o.addEventListener("mouseup",l),()=>{o.removeEventListener("mousedown",r),o.removeEventListener("mousemove",i),o.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,t,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},el=({origin:t,coords:n,isOpen:o})=>{if(!o)return null;const r={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:r})};var tl=Symbol.for("immer-nothing"),nl=Symbol.for("immer-draftable"),ol=Symbol.for("immer-state");function rl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var il=Object.getPrototypeOf;function ll(e){return!!e&&!!e[ol]}function cl(e){return!!e&&(sl(e)||Array.isArray(e)||!!e[nl]||!!e.constructor?.[nl]||hl(e)||gl(e))}var al=Object.prototype.constructor.toString();function sl(e){if(!e||"object"!=typeof e)return!1;const t=il(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===al}function dl(e,t){0===ul(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function ul(e){const t=e[ol];return t?t.type_:Array.isArray(e)?1:hl(e)?2:gl(e)?3:0}function fl(e,t){return 2===ul(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pl(e,t,n){const o=ul(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function hl(e){return e instanceof Map}function gl(e){return e instanceof Set}function vl(e){return e.copy_||e.base_}function yl(e,t){if(hl(e))return new Map(e);if(gl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&sl(e)){if(!il(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[ol];let o=Reflect.ownKeys(n);for(let t=0;t<o.length;t++){const r=o[t],i=n[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(il(e),n)}function ml(e,t=!1){return wl(e)||ll(e)||!cl(e)||(ul(e)>1&&(e.set=e.add=e.clear=e.delete=bl),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>ml(t,!0)))),e}function bl(){rl(2)}function wl(e){return Object.isFrozen(e)}var xl,kl={};function El(e){const t=kl[e];return t||rl(0),t}function Ol(){return xl}function Cl(e,t){t&&(El("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sl(e){Dl(e),e.drafts_.forEach(Bl),e.drafts_=null}function Dl(e){e===xl&&(xl=e.parent_)}function jl(e){return xl={drafts_:[],parent_:xl,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Bl(e){const t=e[ol];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Rl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ol].modified_&&(Sl(t),rl(4)),cl(e)&&(e=_l(t,e),t.parent_||Ml(t,e)),t.patches_&&El("Patches").generateReplacementPatches_(n[ol].base_,e,t.patches_,t.inversePatches_)):e=_l(t,n,[]),Sl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tl?e:void 0}function _l(e,t,n){if(wl(t))return t;const o=t[ol];if(!o)return dl(t,((r,i)=>Al(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return Ml(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,i=!1;3===o.type_&&(r=new Set(t),t.clear(),i=!0),dl(r,((r,l)=>Al(e,o,t,r,l,n,i))),Ml(e,t,!1),n&&e.patches_&&El("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Al(e,t,n,o,r,i,l){if(ll(r)){const l=_l(e,r,i&&t&&3!==t.type_&&!fl(t.assigned_,o)?i.concat(o):void 0);if(pl(n,o,l),!ll(l))return;e.canAutoFreeze_=!1}else l&&n.add(r);if(cl(r)&&!wl(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;_l(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||Ml(e,r)}}function Ml(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ml(t,n)}var Tl={get(e,t){if(t===ol)return e;const n=vl(e);if(!fl(n,t))return function(e,t,n){const o=Pl(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!cl(o)?o:o===Ll(e.base_,t)?(zl(e),e.copy_[t]=Fl(o,e)):o},has:(e,t)=>t in vl(e),ownKeys:e=>Reflect.ownKeys(vl(e)),set(e,t,n){const o=Pl(vl(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ll(vl(e),t),l=o?.[ol];if(l&&l.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(i=o)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||fl(e.base_,t)))return!0;zl(e),Il(e)}var r,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ll(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,zl(e),Il(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=vl(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){rl(11)},getPrototypeOf:e=>il(e.base_),setPrototypeOf(){rl(12)}},Nl={};function Ll(e,t){const n=e[ol];return(n?vl(n):e)[t]}function Pl(e,t){if(!(t in e))return;let n=il(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=il(n)}}function Il(e){e.modified_||(e.modified_=!0,e.parent_&&Il(e.parent_))}function zl(e){e.copy_||(e.copy_=yl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}dl(Tl,((e,t)=>{Nl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Nl.deleteProperty=function(e,t){return Nl.set.call(this,e,t,void 0)},Nl.set=function(e,t,n){return Tl.set.call(this,e[0],t,n,e[0])};function Fl(e,t){const n=hl(e)?El("MapSet").proxyMap_(e,t):gl(e)?El("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:Ol(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=Tl;n&&(r=[o],i=Nl);const{revoke:l,proxy:c}=Proxy.revocable(r,i);return o.draft_=c,o.revoke_=l,c}(e,t);return(t?t.scope_:Ol()).drafts_.push(n),n}function Hl(e){if(!cl(e)||wl(e))return e;const t=e[ol];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=yl(e,t.scope_.immer_.useStrictShallowCopy_)}else n=yl(e,!0);return dl(n,((e,t)=>{pl(n,e,Hl(t))})),t&&(t.finalized_=!1),n}var Ul=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&rl(6),void 0!==n&&"function"!=typeof n&&rl(7),cl(e)){const r=jl(this),i=Fl(e,void 0);let l=!0;try{o=t(i),l=!1}finally{l?Sl(r):Dl(r)}return Cl(r,n),Rl(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===tl&&(o=void 0),this.autoFreeze_&&ml(o,!0),n){const t=[],r=[];El("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}rl(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){cl(e)||rl(8),ll(e)&&(e=function(e){ll(e)||rl(10);return Hl(e)}(e));const t=jl(this),n=Fl(e,void 0);return n[ol].isManual_=!0,Dl(t),n}finishDraft(e,t){const n=e&&e[ol];n&&n.isManual_||rl(9);const{scope_:o}=n;return Cl(o,t),Rl(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=El("Patches").applyPatches_;return ll(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};Ul.produce,Ul.produceWithPatches.bind(Ul),Ul.setAutoFreeze.bind(Ul),Ul.setUseStrictShallowCopy.bind(Ul),Ul.applyPatches.bind(Ul);var Vl=Ul.createDraft.bind(Ul),$l=Ul.finishDraft.bind(Ul);
6
+ var Xo=["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(","),qo="undefined"==typeof Element,Zo=qo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Go=!qo&&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},Jo=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},Qo=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var l=i.shift();if(!Jo(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),a=e(c.length?c:l.children,!0,o);o.flatten?r.push.apply(r,a):r.push({scopeParent:l,candidates:a})}else{Zo.call(l,Xo)&&o.filter(l)&&(n||!t.includes(l))&&r.push(l);var s=l.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(l),d=!Jo(s,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return r},er=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tr=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))&&!er(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},or=function(e){return"INPUT"===e.tagName},rr=function(e){return function(e){return or(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Go(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(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 r=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!r||r===e}(e)},ir=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},lr=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Zo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Zo.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ir(e)}else{if("function"==typeof o){for(var i=e;e;){var l=e.parentElement,c=Go(e);if(l&&!l.shadowRoot&&!0===o(l))return ir(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,o,r,i=e&&Go(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!c&&l;){var a,s,d;c=!(null===(s=l=null===(a=i=Go(l))||void 0===a?void 0:a.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},cr=function(e,t){return!(t.disabled||Jo(t)||function(e){return or(e)&&"hidden"===e.type}(t)||lr(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 o=t.children.item(n);if("LEGEND"===o.tagName)return!!Zo.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},ar=function(e,t){return!(rr(t)||tr(t)<0||!cr(e,t))},sr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},dr=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=tr(e);return n<0&&t&&!er(e)?0:n}(l,i),a=i?e(t.candidates):l;0===c?i?n.push.apply(n,a):n.push(l):o.push({documentOrder:r,tabIndex:c,item:t,isScope:i,content:a})})),o.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ur=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qo([e],t.includeContainer,{filter:ar.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:sr}):function(e,t,n){if(Jo(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Xo));return t&&Zo.call(e,Xo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,ar.bind(null,t)),dr(n)};const fr=o["useInsertionEffect".toString()]||(e=>e());var pr="undefined"!=typeof document?a:s;function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},hr.apply(this,arguments)}let gr=!1,vr=0;const yr=()=>"floating-ui-"+vr++;const mr=o["useId".toString()]||function(){const[e,t]=o.useState((()=>gr?yr():void 0));return pr((()=>{null==e&&t(yr())}),[]),o.useEffect((()=>{gr||(gr=!0)}),[]),e};const br=o.createContext(null),wr=o.createContext(null);function xr(e){return"data-floating-ui-"+e}function kr(e){const t=c(e);return pr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Or(e,t){const n=ur(e,Er());"prev"===t&&n.reverse();const o=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==(r=e)?void 0:r.ownerDocument)||document));var r;return n.slice(o+1)[0]}function Cr(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!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&&Un(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Sr(e){ur(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(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 jr={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 Br(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Rr=o.forwardRef((function(e,t){const[n,r]=o.useState();pr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Br),()=>{document.removeEventListener("keydown",Br)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xr("focus-guard")]:"",style:jr};return o.createElement("span",hr({},e,i))})),_r=o.createContext(null),Ar=xr("portal");function Mr(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,i]=o.useState(null),l=mr(),c=Tr(),a=o.useRef(null);return pr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{a.current=null}))}),[r]),pr((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(Ar,""),e.appendChild(n),a.current=n,i(n)}),[t,l]),pr((()=>{if(a.current)return;let e=n||(null==c?void 0:c.portalNode);e&&!Fn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const r=document.createElement("div");r.id=l,r.setAttribute(Ar,""),e=o||e,e.appendChild(r),a.current=r,i(r)}),[t,n,l,c]),r}({id:n,root:r}),[c,a]=o.useState(null),s=o.useRef(null),d=o.useRef(null),u=o.useRef(null),f=o.useRef(null),p=!!c&&!c.modal&&c.open&&i&&!(!r&&!l);return o.useEffect((()=>{if(l&&i&&(null==c||!c.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&&Cr(e)){("focusin"===e.type?Dr:Sr)(l)}}}),[l,i,null==c?void 0:c.modal]),o.createElement(_r.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:a})),[i,l])},p&&l&&o.createElement(Rr,{"data-type":"outside",ref:s,onFocus:e=>{if(Cr(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Or(document.body,"prev")||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),p&&l&&o.createElement("span",{"aria-owns":l.id,style:jr}),l&&b(t,l),p&&l&&o.createElement(Rr,{"data-type":"outside",ref:d,onFocus:e=>{if(Cr(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Or(document.body,"next")||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const Tr=()=>o.useContext(_r),Nr=new Set,Lr=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const i=mr();return pr((()=>{if(!n)return;Nr.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,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[o]=r+"px"),e){var a,s;const e=(null==(a=window.visualViewport)?void 0:a.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Nr.delete(i),0===Nr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}}),[i,n]),o.createElement("div",hr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Pr(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e,[l,c]=o.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:s,open:d}=e,[u,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);$o(p,r)||h(r);const[g,v]=o.useState(null),[m,b]=o.useState(null),w=o.useCallback((e=>{e!==O.current&&(O.current=e,v(e))}),[]),x=o.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=l||g,E=c||m,O=o.useRef(null),C=o.useRef(null),S=o.useRef(u),D=null!=s,j=Yo(s),B=Yo(i),R=o.useCallback((()=>{if(!O.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};B.current&&(e.platform=B.current),Uo(O.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};_.current&&!$o(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,B]);Vo((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const _=o.useRef(!1);Vo((()=>(_.current=!0,()=>{_.current=!1})),[]),Vo((()=>{if(k&&(O.current=k),E&&(C.current=E),k&&E){if(j.current)return j.current(k,E,R);R()}}),[k,E,R,j,D]);const A=o.useMemo((()=>({reference:O,floating:C,setReference:w,setFloating:x})),[w,x]),M=o.useMemo((()=>({reference:k,floating:E})),[k,E]),T=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=Ko(M.floating,u.x),o=Ko(M.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+o+"px)",...Wo(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,a,M.floating,u.x,u.y]);return o.useMemo((()=>({...u,update:R,refs:A,elements:M,floatingStyles:T})),[u,R,A,M,T])}(e),d=o.useContext(wr),u=null!=((null==(f=o.useContext(br))?void 0:f.id)||null);var f;const p=function(e){const t=o.useRef((()=>{}));return fr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];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:u}),null==r||r(e,t,n)})),h=o.useRef(null),g=o.useRef({}),v=o.useState((()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter((e=>e!==n)))||[])}}}()))[0],m=mr(),b=o.useCallback((e=>{const t=Fn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=o.useCallback((e=>{(Fn(e)||null===e)&&(h.current=e,c(e)),(Fn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Fn(e))&&s.refs.setReference(e)}),[s.refs]),x=o.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=o.useMemo((()=>({...s.elements,domReference:a})),[s.elements,a]),E=o.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:v,open:n,onOpenChange:p})),[s,i,m,v,n,p,x,k]);return pr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const Ir=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Fr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[c,a]=o.useState(!1),[s,d]=o.useState("unmounted"),u=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return pr((()=>{c&&!u&&d("unmounted")}),[c,u]),pr((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}a(!0),d("close")}}),[n,r]),{isMounted:u,status:s}}function Hr(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:l,duration:c=250}=t,a=e.placement,s=a.split("-")[0],d=o.useMemo((()=>({side:s,placement:a})),[s,a]),u="number"==typeof c,f=(u?c:c.open)||0,p=(u?c:c.close)||0,[h,g]=o.useState((()=>({...zr(l,d),...zr(n,d)}))),{isMounted:v,status:y}=Fr(e,{duration:c}),m=kr(n),b=kr(r),w=kr(i),x=kr(l);return pr((()=>{const e=zr(m.current,d),t=zr(w.current,d),n=zr(x.current,d),o=zr(b.current,d)||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(o).map(Ir).join(","),transitionDuration:f+"ms",...n,...o}),"close"===y){const o=t||e;g({transitionProperty:Object.keys(o).map(Ir).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Ur;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vr.apply(this,arguments)}var $r=function(e){return o.createElement("svg",Vr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Ur||(Ur=o.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 Wr(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}var Kr=["color"],Yr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Kr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Xr=["color"],qr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Xr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Zr=["color"],Gr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Zr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Jr=["color"],Qr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Jr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{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:o,fillRule:"evenodd",clipRule:"evenodd"}))})),ei=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));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()}},ti={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var n,o,r,i,l,c,a=!1;t||(t={}),n=t.debug||!1;try{if(r=ei(),i=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ti[t.format]||ti.default;window.clipboardData.setData(r,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(c),i.selectNodeContents(c),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");a=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=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(o,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),c&&document.body.removeChild(c),r()}return a};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ri(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}function ii(e,t){var n;return(null===(n=e.children)||void 0===n?void 0:n.map((e=>{const n=t[e];if(!n)throw new Error(`Element definition for ${e} not found`);return G({id:Z(),type:e,props:n.props,children:n.children&&n.children.length>0?ii(n,t):[{text:""}]})})))||[]}const li=i(void 0),ci=({children:o,tools:r})=>{const i=V(),l=d((()=>r?Object.keys(r).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=r[t])||void 0===n?void 0:n.render})}),{}):{}),[r]),c=d((()=>!r||i?null:Object.keys(r).map((t=>{var n,o,i;const l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,c=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,a=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:c},a),t):null}))),[r]);return e(li.Provider,Object.assign({value:l},{children:t(n,{children:[c,o]})}))},ai=()=>{const e=l(li);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:n,mode:o="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===o&&(t=t.filter((t=>function(e,t){var n;const o=e.blocks[t];if(!o)return!1;const r=ri(o.elements);return"void"!==(null===(n=null==r?void 0:r.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,o,r,i,l,c;return{type:t,title:(null===(o=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===o?void 0:o.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description,icon:null===(c=null===(l=e.blocks[t].options)||void 0===l?void 0:l.display)||void 0===c?void 0:c.icon}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===o&&e.blocks[t].toggle({focus:!0}),"create"===o&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}function di(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const ui=t=>{var{className:n,children:o,lockScroll:r=!0}=t,i=di(t,["className","children","lockScroll"]);return e(Lr,Object.assign({lockScroll:r,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:o}))},fi=t=>{const[n,o]=f(!1),r=c(null),i=F();return s((()=>{o(!0);const e=i.refElement;if(!e)return;return e.querySelector(".yoopta-overlays")||(r.current=document.createElement("div"),r.current.className="yoopta-overlays",e.appendChild(r.current)),()=>{r.current&&r.current.remove()}}),[]),n?e(Mr,Object.assign({id:`${t.id}-${i.id}`,root:r.current||i.refElement},{children:t.children})):null},pi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),hi=({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})),gi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),vi=({isOpen:n,onClose:o,refs:r,style:i,children:l})=>{var c,a,s;const d=F(),u=ai(),[p,h]=f(!1),{refs:g,floatingStyles:v,context:y}=Pr({placement:"right",open:p,onOpenChange:h,middleware:[Ho(),Fo(),zo(),ko(10)],whileElementsMounted:Io}),{isMounted:m,styles:b}=Hr(y,{duration:100});if(!n)return null;const w=L(d,{at:d.selection}),x=ri(null===(c=d.blocks[(null==w?void 0:w.type)||""])||void 0===c?void 0:c.elements),k="void"===(null===(a=null==x?void 0:x.props)||void 0===a?void 0:a.nodeType),E=u.ActionMenu,O=Object.assign(Object.assign({},v),b),C=si({editor:d,view:"small",onClose:()=>{h(!1),o()}});return e(fi,Object.assign({id:"yoo-block-options-portal"},{children:e(ui,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(hi,{children:[t(pi,{children:[e(gi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=d.selection;d.deleteBlock({at:e}),d.setBlockSelected(null),d.setSelection(null),o()}},{children:[e(Qr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(gi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{d.duplicateBlock({at:d.selection,focus:!0}),d.setBlockSelected(null),o()}},{children:[e(Yr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!E&&!k&&!(null===(s=d.blocks[(null==w?void 0:w.type)||""])||void 0===s?void 0:s.hasCustomEditor)&&t(gi,{children:[m&&e(fi,Object.assign({id:"yoo-block-options-portal"},{children:e(ui,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>h(!1)},{children:e("div",Object.assign({style:O,ref:g.setFloating},{children:e(E,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:g.setReference,onClick:()=>h((e=>!e))},{children:[e($r,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(gi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=L(d);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),o()}},{children:[e(Gr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var yi=Object.freeze({__proto__:null,BlockOptions:vi,BlockOptionsMenuContent:hi,BlockOptionsMenuGroup:pi,BlockOptionsMenuItem:gi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const mi=({block:n,editor:o,dragHandleProps:r,onChangeActiveBlock:i,showActions:l})=>{const[c,a]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=ai().ActionMenu,[n,o]=f(!1),{refs:r,floatingStyles:i,context:l}=Pr({placement:"bottom-start",open:n,onOpenChange:o,middleware:[Ho(),Fo(),zo(),ko(10)],whileElementsMounted:Io}),{isMounted:c,styles:a}=Hr(l,{duration:100}),s=Object.assign(Object.assign({},i),a),d=e=>o(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:c,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:o}),{refs:m,floatingStyles:b,context:x}=Pr({placement:"right-start",open:c,onOpenChange:a,middleware:[Ho(),Fo(),zo(),ko()]}),{isMounted:k,styles:E}=Hr(x,{duration:100}),{setActivatorNodeRef:O,attributes:C,listeners:j}=r,B=Object.assign(Object.assign({},b),E);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(fi,Object.assign({id:"yoo-block-options-portal"},{children:e(ui,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:g},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(y,Object.assign({},v))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=Nn(o,{at:[n.meta.order]}),r=o.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ri(r.elements);let c;r.hasCustomEditor||(c=S.string(t,[0]));const a="string"==typeof c&&0===c.trim().length;if(u&&a&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))o.setSelection([n.meta.order]),o.focusBlock(n.id),d.setReference(i),h(!0);else{const e=J({id:Z()}),t=[n.meta.order+1];o.setSelection([n.meta.order]),o.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Tn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{O(e),m.setReference(e)}},C,j,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Nn(o,{at:[n.meta.order]});o.focusBlock(n.id),t&&setTimeout((()=>{o.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),o.setBlockSelected([n.meta.order],{only:!0}),o.setSelection([n.meta.order]),a(!0)}),10)}},{children:e(An,{})})),e(vi,{isOpen:k,refs:m,style:B,onClose:()=>a(!1)})]}))},bi=({children:n,block:o,blockId:r})=>{var i;const l=F(),[c,a]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=On({id:r,disabled:l.readOnly}),m=`yoopta-block yoopta-align-${o.meta.align||"left"}`,b={marginLeft:20*o.meta.depth+"px",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1},w=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),x=c===r,k={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:m,onMouseEnter:()=>{l.readOnly||a(r)},onMouseLeave:()=>{l.readOnly||a(null)},style:b,"data-hovered-block":x,"data-yoopta-block":!0,"data-yoopta-block-id":r,"data-yoopta-block-type":o.type},{children:[!l.readOnly&&e(mi,{block:o,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:x,onChangeActiveBlock:e=>a(e)}),e("div",Object.assign({style:k},{children:n})),w&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};var wi={};Object.defineProperty(wi,"__esModule",{value:!0});for(var xi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ki={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ei={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:xi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Oi={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},Ci=1;Ci<20;Ci++)Oi["f"+Ci]=111+Ci;function Si(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Di(e,t)})),r=function(e){return o.some((function(t){return ji(t,e)}))};return null==n?r:r(n)}function Di(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var l in ki)o[ki[l]]=!1;var c=!0,a=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(c=(d=u.next()).done);c=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Ri(f),g=ki[h];if(f.length>1&&!g&&!Ei[f]&&!Oi[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=Bi(f)),g&&(o[g]=!p||null)}}catch(e){a=!0,s=e}finally{try{!c&&u.return&&u.return()}finally{if(a)throw s}}return o}function ji(e,t){for(var n in e){var o=e[n],r=void 0;if(null!=o&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===o&&93===t.which?91:t.which:t[n])||!1!==o)&&r!==o))return!1}return!0}function Bi(e){return e=Ri(e),Oi[e]||e.toUpperCase().charCodeAt(0)}function Ri(e){return e=e.toLowerCase(),e=Ei[e]||e}wi.default=Si,wi.isHotkey=Si,wi.isCodeHotkey=function(e,t){return Si(e,t)};var _i=wi.isKeyHotkey=function(e,t){return Si(e,{byKey:!0},t)};wi.parseHotkey=Di,wi.compareHotkey=ji,wi.toKeyCode=Bi,wi.toKeyName=Ri;const Ai={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",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",slashCommand:"/",copy:"mod+c",cut:"mod+x"},Mi={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"},Ti={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ni=e=>{const t=Ai[e],n=Mi[e],o=Ti[e],r=t&&_i(t),i=n&&_i(n),l=o&&_i(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!l||!l(e)))},Li={isBold:Ni("bold"),isCompose:Ni("compose"),isArrowLeft:Ni("arrowLeft"),isArrowRight:Ni("arrowRight"),isArrowUp:Ni("arrowUp"),isArrowDown:Ni("arrowDown"),isDeleteBackward:Ni("deleteBackward"),isDeleteForward:Ni("deleteForward"),isDeleteLineBackward:Ni("deleteLineBackward"),isDeleteLineForward:Ni("deleteLineForward"),isDeleteWordBackward:Ni("deleteWordBackward"),isDeleteWordForward:Ni("deleteWordForward"),isExtendBackward:Ni("extendBackward"),isExtendForward:Ni("extendForward"),isExtendLineBackward:Ni("extendLineBackward"),isExtendLineForward:Ni("extendLineForward"),isItalic:Ni("italic"),isMoveLineBackward:Ni("moveLineBackward"),isMoveLineForward:Ni("moveLineForward"),isCtrlLeft:Ni("ctrlLeft"),isCtrlRight:Ni("ctrlRight"),isRedo:Ni("redo"),isShiftEnter:Ni("shiftEnter"),isEnter:Ni("enter"),isTransposeCharacter:Ni("transposeCharacter"),isUndo:Ni("undo"),isSpace:Ni("space"),isSelect:Ni("select"),isTab:Ni("tab"),isShiftTab:Ni("shiftTab"),isBackspace:Ni("backspace"),isCmdEnter:Ni("cmdEnter"),isCmd:Ni("cmd"),isEscape:Ni("escape"),isSlashCommand:Ni("slashCommand"),isShiftArrowUp:Ni("shiftArrowUp"),isShiftArrowDown:Ni("shiftArrowDown"),isCopy:Ni("copy"),isCut:Ni("cut")};const Pi={onKeyDown:function(e){return t=>{const n=Nn(e,{at:e.selection});if(!n||!n.selection)return;const o=j.parent(n.selection.anchor.path);if(Li.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Li.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(n,n.selection.anchor,o),i=S.isEnd(n,n.selection.anchor,o);if(!r&&!i)return void e.splitBlock({slate:n,focus:!0});const l=J({id:Z()}),c=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:c,slate:n,focus:!0})}else if(Li.isBackspace(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,o)){t.preventDefault();const r=S.string(n,o),i=e.selection?e.selection[0]-1:0,l=Nn(e,{at:[i]}),c=L(e,{at:[i]}),a=e.blocks[(null==c?void 0:c.type)||""];let s;if(l&&!a.hasCustomEditor&&(s=function(e,t){try{const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}catch(e){return{path:[0,0],offset:0}}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(B.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,o=L(e,{at:[t]}),r=e.blocks[(null==o?void 0:o.type)||""];if(r&&r.hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const i=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(R.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,i,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Li.isSelect(t)){if(t.isDefaultPrevented())return;const[,o]=S.first(n,[0]),[,r]=S.last(n,[n.children.length-1]),i=S.range(n,o,r),l=B.equals(n.selection,i),c=0===S.string(n,i).trim().length;if(B.isExpanded(n.selection)&&l||c)return t.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Li.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Li.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Li.isArrowUp(t)){if(t.isDefaultPrevented())return;if(1===new Set(n.selection.anchor.path).size){const n=e.selection?[e.selection[0]-1]:null,o=Nn(e,{at:n}),r=L(e,{at:n});if(o&&r){const[,n]=S.last(o,[0]),i={path:n,offset:S.string(o,n).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Li.isArrowDown(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,r=Nn(e,{at:n}),i=L(e,{at:n});if(r&&i){const n=function(e,t){try{const[,n]=S.first(e,t);return{path:n,offset:0}}catch(e){return{path:[0,0],offset:0}}}(r,o);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(B.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&_i(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Ii=({children:t,attributes:n,placeholder:o})=>{const r=x(),i=Object.assign({},n);return r&&o&&(i["data-placeholder"]=o,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function zi(e){try{return new URL(e),!0}catch(e){return!1}}const Fi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&_.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&_.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,o=n&&B.isCollapsed(n),r={type:"link",children:o?[{text:t}]:[],props:{url:t,target:"_self",rel:"noopener noreferrer"}};o?D.insertNodes(e,r):(D.wrapNodes(e,r,{split:!0}),D.collapse(e,{edge:"end"}))},Hi=new WeakMap;function Ui(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Vi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"italic"}};function $i(e,t,n,o){var r,i;let l;if(t.parse){l=t.parse(n);if(_.isElement(l)&&"inline"===(null===(r=l.props)||void 0===r?void 0:r.nodeType))return l}const c=e.blocks[t.type],a=oi(c.elements)||"",s=c.elements[a],d="void"===(null===(i=s.props)||void 0===i?void 0:i.nodeType);let u={id:Z(),type:a,children:d&&!c.hasCustomEditor?[{text:""}]:o.map(Ki),props:Object.assign({nodeType:"block"},s.props)};if(l)if(_.isElement(l))u=l;else if(Array.isArray(l)){return l}0===u.children.length&&(u.children=[{text:""}]);const f=n.getAttribute("data-meta-align")||"left",p=parseInt(n.getAttribute("data-meta-depth")||"0",10);return J({id:Z(),type:t.type,value:[u],meta:{order:0,depth:p,align:f}})}function Wi(e,t,n){var o,r;if(3===n.nodeType){return null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const i=n;let l=Array.from(i.childNodes).map((n=>Wi(e,t,n))).flat();if(Vi[n.nodeName]){return{[Vi[n.nodeName].type]:!0,text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}const c=t[n.nodeName];return c?Array.isArray(c)?c.map((t=>$i(e,t,n,l))):$i(e,c,n,l):l}function Ki(e){if("string"==typeof e)return{text:e};if(_.isElement(e))return e;if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Ui(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}function Yi(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const o=e.plugins[n],{parsers:r}=o;if(r){const{html:e}=r;if(e){const{deserialize:o}=e;if(o){const{nodeNames:e}=o;e&&e.forEach((e=>{const r=t[e];if(r){const i=Array.isArray(r)?r:[r];t[e]=[...i,{type:n,parse:o.parse}]}else t[e]={type:n,parse:o.parse}}))}}}})),t}(e);return Wi(e,n,t).filter(Ui)}const Xi=({id:t,customEditor:n,elements:o,marks:r,events:i,options:l,placeholder:a="Type '/' for commands"})=>{var s,f,p;const h=F(),g=H(t),v=c(g.value).current,y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(o).forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,l="void"===r,c="inlineVoid"===r;c&&(e.markableVoid=e=>e.type===t),(l||c)&&(e.isVoid=e=>e.type===t),(i||c)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&zi(t)?Fi(e,t):n(t)},e.insertData=n=>{const o=n.getData("text/plain");o&&zi(o)?Fi(e,o):t(n)},e})(e))})),e}),[o]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Li,currentBlock:g,defaultBlock:J({id:Z()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),k=u((e=>h.updateBlock(t,{value:e})),[t]),E=u((n=>{const o=y[n.element.type],{attributes:r}=n,i=di(n,["attributes"]);let c;r["data-element-type"]=i.element.type;try{c=w.findPath(b,n.element)}catch(e){c=[]}return o?e(o,Object.assign({},i,{path:c,attributes:r,blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(O,Object.assign({},i,{attributes:r}))}),[o,b.children]),C=u((t=>{var n,o,r,i,l;let{children:c,leaf:s,attributes:d}=t;const u=di(s,["text"]),f=(null===(n=h.selection)||void 0===n?void 0:n[0])===g.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(c=t.render({children:c,leaf:s}))}));const p=!("void"===(null===(l=null===(i=null===(r=null===(o=t.children)||void 0===o?void 0:o.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===l?void 0:l.nodeType))&&f&&s.withPlaceholder;return e(Ii,Object.assign({attributes:d,placeholder:p?a:void 0},{children:c}))}),[r]),D=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),Pi.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),j=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),R=u((e=>{var t,n;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==g.meta.order&&h.setSelection([g.meta.order]),null===(n=null==x?void 0:x.onMouseDown)||void 0===n||n.call(x,e))}),[x.onMouseDown,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),_=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),A=u((e=>{var t;h.readOnly||(h.isFocused()||(Hi.set(h,!0),h.emit("focus",!0)),null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e))}),[x.onFocus,h.readOnly]),M=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const e=Yi(h,o.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),T=u((e=>{var t;const n=[];if(h.readOnly)return n;const[o,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(o)&&""===S.string(b,[r[0]])&&B.includes(b.selection,r)&&B.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],g.meta.order]);return e(qi,{id:t,slate:b,initialValue:v,onChange:k,decorate:T,renderLeaf:C,renderElement:E,eventHandlers:x,onKeyDown:D,onKeyUp:j,onFocus:A,onMouseDown:R,onBlur:_,customEditor:n,readOnly:h.readOnly,onPaste:M})},qi=p((({id:t,slate:n,initialValue:o,onChange:r,renderLeaf:i,renderElement:l,eventHandlers:c,onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:o,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},c,{onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));qi.displayName="SlateEditorInstance";const Zi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(Et,{activationConstraint:{distance:20}}),Ae(mt,{coordinateGetter:Dn})),handleDragEnd:u((t=>{const{active:n,over:o}=t;if(n&&o&&n.id!==o.id){const t=e.children[o.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Gi=[],Ji=({editor:t,marks:o,placeholder:r})=>{const i=V(),{sensors:l,handleDragEnd:c,handleDragStart:a}=Zi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Gi:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],l=t.children[i],c=t.plugins[l.type];l&&c?f.push(e(bi,Object.assign({block:l,blockId:i},{children:e(Xi,{type:l.type,id:i,marks:o,customEditor:c.customEditor,events:c.events,elements:c.elements,options:c.options,placeholder:r},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(tn,Object.assign({sensors:l,collisionDetection:Fe,onDragStart:a,onDragEnd:c},{children:e(yn,Object.assign({disabled:i,items:u,strategy:hn},{children:f}))}))},Qi=({editor:e,root:t})=>{const[n,o]=f({origin:[0,0],coords:[0,0],selection:!1}),r=r=>{var i;if(e.readOnly||!1===t)return;const l=null===(i=e.refElement)||void 0===i?void 0:i.contains(r.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||o({origin:[r.pageX,r.pageY-window.pageYOffset],coords:[r.pageX,r.pageY-window.pageYOffset],selection:!0})},i=r=>{if(!n.selection||e.readOnly||!1===t)return;o((e=>Object.assign(Object.assign({},e),{coords:[r.pageX,r.pageY-window.pageYOffset]})));const i=((e,t,n)=>{var o;const r=[],i=null===(o=e.refElement)||void 0===o?void 0:o.querySelectorAll("[data-yoopta-block]");return i?(i.forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),c=Math.min(t[0],n[0]),a=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&a>i.top&&c<i.right&&s>i.left&&r.push(o)})),r):r})(e,n.origin,[r.pageX,r.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===t)return;const o=t&&"current"in t?t.current:t||document;if(!o)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in o))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(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",r),o.addEventListener("mousemove",i),o.addEventListener("mouseup",l),()=>{o.removeEventListener("mousedown",r),o.removeEventListener("mousemove",i),o.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,t,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},el=({origin:t,coords:n,isOpen:o})=>{if(!o)return null;const r={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:r})};var tl=Symbol.for("immer-nothing"),nl=Symbol.for("immer-draftable"),ol=Symbol.for("immer-state");function rl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var il=Object.getPrototypeOf;function ll(e){return!!e&&!!e[ol]}function cl(e){return!!e&&(sl(e)||Array.isArray(e)||!!e[nl]||!!e.constructor?.[nl]||hl(e)||gl(e))}var al=Object.prototype.constructor.toString();function sl(e){if(!e||"object"!=typeof e)return!1;const t=il(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===al}function dl(e,t){0===ul(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function ul(e){const t=e[ol];return t?t.type_:Array.isArray(e)?1:hl(e)?2:gl(e)?3:0}function fl(e,t){return 2===ul(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pl(e,t,n){const o=ul(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function hl(e){return e instanceof Map}function gl(e){return e instanceof Set}function vl(e){return e.copy_||e.base_}function yl(e,t){if(hl(e))return new Map(e);if(gl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&sl(e)){if(!il(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[ol];let o=Reflect.ownKeys(n);for(let t=0;t<o.length;t++){const r=o[t],i=n[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(il(e),n)}function ml(e,t=!1){return wl(e)||ll(e)||!cl(e)||(ul(e)>1&&(e.set=e.add=e.clear=e.delete=bl),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>ml(t,!0)))),e}function bl(){rl(2)}function wl(e){return Object.isFrozen(e)}var xl,kl={};function El(e){const t=kl[e];return t||rl(0),t}function Ol(){return xl}function Cl(e,t){t&&(El("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sl(e){Dl(e),e.drafts_.forEach(Bl),e.drafts_=null}function Dl(e){e===xl&&(xl=e.parent_)}function jl(e){return xl={drafts_:[],parent_:xl,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Bl(e){const t=e[ol];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Rl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ol].modified_&&(Sl(t),rl(4)),cl(e)&&(e=_l(t,e),t.parent_||Ml(t,e)),t.patches_&&El("Patches").generateReplacementPatches_(n[ol].base_,e,t.patches_,t.inversePatches_)):e=_l(t,n,[]),Sl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tl?e:void 0}function _l(e,t,n){if(wl(t))return t;const o=t[ol];if(!o)return dl(t,((r,i)=>Al(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return Ml(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,i=!1;3===o.type_&&(r=new Set(t),t.clear(),i=!0),dl(r,((r,l)=>Al(e,o,t,r,l,n,i))),Ml(e,t,!1),n&&e.patches_&&El("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Al(e,t,n,o,r,i,l){if(ll(r)){const l=_l(e,r,i&&t&&3!==t.type_&&!fl(t.assigned_,o)?i.concat(o):void 0);if(pl(n,o,l),!ll(l))return;e.canAutoFreeze_=!1}else l&&n.add(r);if(cl(r)&&!wl(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;_l(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||Ml(e,r)}}function Ml(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ml(t,n)}var Tl={get(e,t){if(t===ol)return e;const n=vl(e);if(!fl(n,t))return function(e,t,n){const o=Pl(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!cl(o)?o:o===Ll(e.base_,t)?(zl(e),e.copy_[t]=Fl(o,e)):o},has:(e,t)=>t in vl(e),ownKeys:e=>Reflect.ownKeys(vl(e)),set(e,t,n){const o=Pl(vl(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ll(vl(e),t),l=o?.[ol];if(l&&l.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(i=o)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||fl(e.base_,t)))return!0;zl(e),Il(e)}var r,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ll(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,zl(e),Il(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=vl(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){rl(11)},getPrototypeOf:e=>il(e.base_),setPrototypeOf(){rl(12)}},Nl={};function Ll(e,t){const n=e[ol];return(n?vl(n):e)[t]}function Pl(e,t){if(!(t in e))return;let n=il(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=il(n)}}function Il(e){e.modified_||(e.modified_=!0,e.parent_&&Il(e.parent_))}function zl(e){e.copy_||(e.copy_=yl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}dl(Tl,((e,t)=>{Nl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Nl.deleteProperty=function(e,t){return Nl.set.call(this,e,t,void 0)},Nl.set=function(e,t,n){return Tl.set.call(this,e[0],t,n,e[0])};function Fl(e,t){const n=hl(e)?El("MapSet").proxyMap_(e,t):gl(e)?El("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:Ol(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=Tl;n&&(r=[o],i=Nl);const{revoke:l,proxy:c}=Proxy.revocable(r,i);return o.draft_=c,o.revoke_=l,c}(e,t);return(t?t.scope_:Ol()).drafts_.push(n),n}function Hl(e){if(!cl(e)||wl(e))return e;const t=e[ol];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=yl(e,t.scope_.immer_.useStrictShallowCopy_)}else n=yl(e,!0);return dl(n,((e,t)=>{pl(n,e,Hl(t))})),t&&(t.finalized_=!1),n}var Ul=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&rl(6),void 0!==n&&"function"!=typeof n&&rl(7),cl(e)){const r=jl(this),i=Fl(e,void 0);let l=!0;try{o=t(i),l=!1}finally{l?Sl(r):Dl(r)}return Cl(r,n),Rl(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===tl&&(o=void 0),this.autoFreeze_&&ml(o,!0),n){const t=[],r=[];El("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}rl(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){cl(e)||rl(8),ll(e)&&(e=function(e){ll(e)||rl(10);return Hl(e)}(e));const t=jl(this),n=Fl(e,void 0);return n[ol].isManual_=!0,Dl(t),n}finishDraft(e,t){const n=e&&e[ol];n&&n.isManual_||rl(9);const{scope_:o}=n;return Cl(o,t),Rl(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=El("Patches").applyPatches_;return ll(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};Ul.produce,Ul.produceWithPatches.bind(Ul),Ul.setAutoFreeze.bind(Ul),Ul.setUseStrictShallowCopy.bind(Ul),Ul.applyPatches.bind(Ul);var Vl=Ul.createDraft.bind(Ul),$l=Ul.finishDraft.bind(Ul);
7
7
  /*!
8
8
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
9
9
  *
10
10
  * Copyright (c) 2014-2017, Jon Schlinkert.
11
11
  * Released under the MIT License.
12
12
  */
13
- function Wl(e){return"[object Object]"===Object.prototype.toString.call(e)}var Kl={isHistory(e){return!1!==Wl(t=e)&&(void 0===(n=t.constructor)||!1!==Wl(o=n.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,n,o}},Yl=new WeakMap,Xl=new WeakMap,ql={isHistoryEditor:e=>Kl.isHistory(e.history)&&S.isEditor(e),isMerging:e=>Xl.get(e),isSaving:e=>Yl.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=ql.isMerging(e);Xl.set(e,!1),t(),Xl.set(e,n)},withoutSaving(e,t){var n=ql.isSaving(e);Yl.set(e,!1),t(),Yl.set(e,n)}},Zl=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var o=n[n.length-1];o.selectionBefore&&D.setSelection(t,o.selectionBefore),ql.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of o.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",o)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var o=n[n.length-1];ql.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=o.operations.map(A.inverse).reverse();for(var n of e)t.apply(n);o.selectionBefore&&D.setSelection(t,o.selectionBefore)}))})),t.writeHistory("redos",o),e.undos.pop()}},t.apply=e=>{var{operations:o,history:r}=t,{undos:i}=r,l=i[i.length-1],c=l&&l.operations[l.operations.length-1],a=ql.isSaving(t),s=ql.isMerging(t);if(null==a&&(a=Jl(e)),a){if(null==s&&(s=null!=l&&(0!==o.length||Gl(e,c))),l&&s)l.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();r.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},Gl=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!j.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!j.equals(e.path,t.path)),Jl=(e,t)=>"set_selection"!==e.type;function Ql(e,t,n){e.children=Vl(e.children);const o=L(e);if(!o)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const r=(null==n?void 0:n.slate)||Nn(e,{at:[null==o?void 0:o.meta.order]});if(!r||!r.selection)return;const i=e.blocks[t],l=function(e,t){const n=e.blocks[t].elements,o=oi(n);if(!o)throw new Error(`Root element type not found for block type ${t}`);const r=n[o];return{id:Z(),type:o,props:r.props,children:r.children&&r.children.length>0?ii(r,n):[{text:""}]}}(e,t);(null==n?void 0:n.deleteText)&&D.delete(r,{at:[0,0]});const c=J({id:o.id,type:i.type,meta:{order:o.meta.order,depth:o.meta.depth,align:o.meta.align},value:[l]});r.children=c.value;const a=c.id;e.children[a]=c,e.blockEditorsMap[a]=r,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(a,{slate:r,waitExecution:!0})}function ec(e,t){const n=Nn(e);if(!n)return!1;const o=S.marks(n);return!!(null==o?void 0:o[t])}const tc=(e,t)=>{const{insertText:n}=t;return t.insertText=o=>{var r;const{selection:i}=t;if(" "===o&&i&&B.isCollapsed(i)){const{anchor:l}=i,c=S.above(t,{match:e=>_.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!c)return;const[,a]=c,s=S.parent(t,a),[d]=s;if(_.isElement(d)&&!R.isText(d.children[0]))return n(o);const u=c?a:[],f={anchor:l,focus:S.start(t,u)},p=S.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return D.select(t,f),D.delete(t),void h.create({deleteText:!1})}n(o)},t};function nc(e,t,n){e.children=Vl(e.children);let o=!1;const r=e.children[t];r&&(n.id&&(r.id=n.id,o=!0),n.type&&(r.type=n.type,o=!0),n.meta&&(r.meta=n.meta,o=!0),n.value&&(r.value=n.value),e.children=$l(e.children),o&&e.applyChanges(),e.emit("change",e.children))}const oc="Paragraph";function rc(e,t,n){e.children=Vl(e.children);const o=L(e,{at:(null==n?void 0:n.at)||e.selection});if(!o)throw new Error("Block from not found at current selection");let r=t;o.type===r&&(r=oc);const i=Nn(e,{at:[o.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${o.meta.order}`);const l=oi(e.blocks[r].elements);S.withoutNormalizing(i,(()=>{D.setNodes(i,{type:l},{at:[0],mode:"lowest",match:e=>_.isElement(e)&&!S.isInline(i,e)}),(null==n?void 0:n.deleteText)&&D.delete(i,{at:[0,0]});const t={id:o.id,type:r,meta:Object.assign(Object.assign({},o.meta),{order:o.meta.order}),value:i.children};e.blockEditorsMap[o.id]=i,e.children[o.id]=t,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(t.id,{slate:i})}))}function ic(e,t={}){const{at:n=e.selection,deleteAll:o=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=Vl(e.children),r.forEach((t=>{const n=L(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=$l(e.children),e.applyChanges(),void e.emit("change",e.children)}if(o||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:Z()}),n=function(e){return tc(e,Zl(C(M())))}(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!n)return;e.children=Vl(e.children);const[l]=n,c=Object.keys(e.children),a=c.find((t=>e.children[t].meta.order===l));if(c.forEach((t=>{const n=e.children[t];n.meta.order>l&&(n.meta.order-=1)})),a&&(delete e.children[a],delete e.blockEditorsMap[a]),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,o=L(e,{at:[n]});o&&e.focusBlock(o.id,{focusAt:t.focusAt})}}function lc(e,t){const n={};return t.forEach((t=>{const o=t.type;n[o]={hotkey:t.hotkey,type:o,getValue:()=>function(e,t){const n=Nn(e);if(!n)return null;const o=S.marks(n);return null==o?void 0:o[t]}(e,o),isActive:()=>ec(e,o),toggle:()=>function(e,t){const n=Nn(e),o=ec(e,t);n&&(o?S.removeMark(n,t):S.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,o),update:t=>function(e,t,n){const o=Nn(e);o&&o.selection&&B.isExpanded(o.selection)&&(S.addMark(o,t,n),e.applyChanges(),e.emit("change",e.children))}(e,o,t)}})),n}function cc(e){const t={};return Object.keys(e.children).forEach((n=>{const o=ac(e);t[n]=o})),t}function ac(e){return tc(e,Zl(C(M())))}function sc(e,t,n={}){e.children=Vl(e.children);const{at:o=null,focus:r=!1,slate:i=null}=n,l=L(e),c=o,a={id:Z(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(c){const[t]=c;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),a.meta.order=t}else{const t=Object.keys(e.children).length;a.meta.order=t}const d=ac(e);e.blockEditorsMap[a.id]=d,s&&l&&(a.meta.order=l.meta.order,l.meta.order+=1),e.children[a.id]=a;const u=null==l?void 0:l.id;e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:a.id)}function dc(e,t={}){const{deleteAll:n=!1,paths:o,blockIds:r,focus:i=!0}=t;if(n||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:Z()}),n=function(e){return tc(e,Zl(C(M())))}(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.applyChanges(),e.emit("change",e.children),void(i&&e.focusBlock(t.id,{waitExecution:!0}))}if(Array.isArray(r)&&r.length>0){e.children=Vl(e.children),r.forEach((t=>{delete e.children[t],delete e.blockEditorsMap[t]}));const t=Object.keys(e.children).sort(((t,n)=>e.children[t].meta.order>e.children[n].meta.order?1:-1));return t.forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),void(i&&e.focusBlock(t[0],{waitExecution:!0}))}if(Array.isArray(o)&&o.length>0){e.children=Vl(e.children),o.forEach((t=>{const n=L(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));const t=Object.keys(e.children).sort(((t,n)=>e.children[t].meta.order>e.children[n].meta.order?1:-1));return t.forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),void(i&&e.focusBlock(t[0],{waitExecution:!0}))}}function uc(e,t,n){e.children=Vl(e.children);const[o]=n,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===o)),l=r.meta.order<i.meta.order,c=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{l?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:c&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=o,r.meta.depth=i.meta.depth,e.setSelection([o]),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children)}function fc(e,t,n={}){try{const{focusAt:o,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:l=!0}=n,c=()=>{const r=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(T.isPoint(t))return t;if(j.isPath(t))return{path:t,offset:0};const[,n]=S.first(e,[0]);return{path:n||[0,0],offset:0}}(r,o);D.select(r,e),w.focus(r)}l&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>c()),i):c(),Hi.set(e,!0)}catch(e){}}function pc(e,t={}){const{slate:n,focus:o=!0}=t,r=L(e);n&&n.selection&&r&&S.withoutNormalizing(n,(()=>{e.children=Vl(e.children);const t=j.parent(n.selection.anchor.path);D.splitNodes(n,{at:n.selection,match:e=>_.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,l=n.children.slice()[i];D.removeNodes(n,{at:[i],match:e=>_.isElement(e),mode:"highest"});const c={id:Z(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth,align:r.meta.align},value:[l]};Object.values(e.children).forEach((e=>{e.meta.order>=c.meta.order&&(e.meta.order+=1)}));const a=ac(e);e.blockEditorsMap[c.id]=a,e.children[c.id]=c,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(c.id,{slate:a})}))}function hc(e,t={}){const{at:n=e.selection,blockId:o=""}=t;if(!o&&!n)return;e.children=Vl(e.children);const r=e.children[o]||L(e);r&&(r.meta.depth=r.meta.depth+1,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children))}function gc(e,t={}){const{at:n=e.selection,blockId:o=""}=t;if(!o&&!n)return;e.children=Vl(e.children);const r=e.children[o]||L(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children))}var vc={};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,r="[object Arguments]",i="[object Boolean]",l="[object Date]",c="[object Function]",a="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",C="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",j="[object Uint32Array]",B=/\w*$/,R=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[l]=A[w]=A[x]=A[k]=A[E]=A[O]=A[s]=A[d]=A[u]=A[p]=A[h]=A[g]=A[v]=A[C]=A[S]=A[D]=A[j]=!0,A["[object Error]"]=A[c]=A[y]=!1;var M="object"==typeof K&&K&&K.Object===Object&&K,T="object"==typeof self&&self&&self.Object===Object&&self,N=M||T||Function("return this")(),L=t&&!t.nodeType&&t,P=L&&e&&!e.nodeType&&e,I=P&&P.exports===L;function z(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function H(e,t,n,o){var r=-1,i=e?e.length:0;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function $(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Y,X=Array.prototype,q=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=q.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=I?N.Buffer:void 0,re=N.Symbol,ie=N.Uint8Array,le=$(Object.getPrototypeOf,Object),ce=Object.create,ae=Z.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=oe?oe.isBuffer:void 0,fe=$(Object.keys,Object),pe=Ie(N,"DataView"),he=Ie(N,"Map"),ge=Ie(N,"Promise"),ve=Ie(N,"Set"),ye=Ie(N,"WeakMap"),me=Ie(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ge),ke=Ve(ve),Ee=Ve(ye),Oe=re?re.prototype:void 0,Ce=Oe?Oe.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function De(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function je(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Be(e){this.__data__=new De(e)}function Re(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!ae.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],o=n.length,i=!!o;for(var l in e)!t&&!ee.call(e,l)||i&&("length"==l||He(l,o))||n.push(l);return n}function _e(e,t,n){var o=e[t];ee.call(e,t)&&$e(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if($e(e[n][0],t))return n;return-1}function Me(e,t,n,o,f,y,R){var _;if(o&&(_=y?o(e,f,y,R):o(e)),void 0!==_)return _;if(!qe(e))return e;var M=We(e);if(M){if(_=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n<o;)t[n]=e[n];return t}(e,_)}else{var T=Fe(e),N=T==c||T==a;if(Ye(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(T==u||T==r||N&&!y){if(U(e))return y?e:{};if(_=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=le(e),qe(t)?ce(t):{});var t}(N?{}:e),!t)return function(e,t){return Le(e,ze(e),t)}(e,function(e,t){return e&&Le(t,Ze(t),e)}(_,e))}else{if(!A[T])return y?e:{};_=function(e,t,n,o){var r=e.constructor;switch(t){case m:return Ne(e);case i:case l:return new r(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,o);case w:case x:case k:case E:case O:case C:case S:case D:case j:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,o);case s:return function(e,t,n){var o=t?n(V(e),!0):V(e);return H(o,z,new e.constructor)}(e,o,n);case d:case g:return new r(e);case p:return function(e){var t=new e.constructor(e.source,B.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var o=t?n(W(e),!0):W(e);return H(o,F,new e.constructor)}(e,o,n);case v:return c=e,Ce?Object(Ce.call(c)):{}}var c}(e,T,Me,t)}}R||(R=new Be);var L=R.get(e);if(L)return L;if(R.set(e,_),!M)var P=n?function(e){return function(e,t,n){var o=t(e);return We(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,Ze,ze)}(e):Ze(e);return function(e,t){for(var n=-1,o=e?e.length:0;++n<o&&!1!==t(e[n],n,e););}(P||e,(function(r,i){P&&(r=e[i=r]),_e(_,i,Me(r,t,n,o,i,e,R))})),_}function Te(e){return!(!qe(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?ne:R).test(Ve(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Le(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var l=t[r],c=o?o(n[l],e[l],l,n,e):void 0;_e(n,l,void 0===c?e[l]:c)}return n}function Pe(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Te(n)?n:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var o=t[e];return o===n?void 0:o}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},De.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,o=Ae(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},je.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||De),string:new Se}},je.prototype.delete=function(e){return Pe(this,e).delete(e)},je.prototype.get=function(e){return Pe(this,e).get(e)},je.prototype.has=function(e){return Pe(this,e).has(e)},je.prototype.set=function(e,t){return Pe(this,e).set(e,t),this},Be.prototype.clear=function(){this.__data__=new De},Be.prototype.delete=function(e){return this.__data__.delete(e)},Be.prototype.get=function(e){return this.__data__.get(e)},Be.prototype.has=function(e){return this.__data__.has(e)},Be.prototype.set=function(e,t){var n=this.__data__;if(n instanceof De){var o=n.__data__;if(!he||o.length<199)return o.push([e,t]),this;n=this.__data__=new je(o)}return n.set(e,t),this};var ze=de?$(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||_.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function $e(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=b||he&&Fe(new he)!=s||ge&&Fe(ge.resolve())!=f||ve&&Fe(new ve)!=h||ye&&Fe(new ye)!=y)&&(Fe=function(e){var t=te.call(e),n=t==u?e.constructor:void 0,o=n?Ve(n):void 0;if(o)switch(o){case be:return b;case we:return s;case xe:return f;case ke:return h;case Ee:return y}return t});var We=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Xe(e)}var Ye=ue||function(){return!1};function Xe(e){var t=qe(e)?te.call(e):"";return t==c||t==a}function qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?Re(e):function(e){if(!Ue(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Me(e,!0,!0)}}({get exports(){return vc},set exports(e){vc=e}},vc);var yc=vc;function mc(e,t={}){const{blockId:n,focus:o}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(n&&(r=e.children[n],!r))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(r=L(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=Vl(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(l=r,"function"==typeof window.structuredClone?window.structuredClone(l):yc(l));var l;const c=ac(e);i.id=Z(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=c;const a=i.id;e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(a,{waitExecution:!0})}function bc(e,t,n={}){e.children=Vl(e.children);const{at:o,focus:r}=n;let i=o||[0];const l=L(e),c=Nn(e);let a=!1,s=!1;if(c&&c.selection){const t=j.parent(c.selection.anchor.path),n=S.string(c,t).trim(),o=S.isStart(c,c.selection.anchor,t);a=""===n&&o,s=!o||n.length>0,w.blur(c),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,n)=>{const o={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+n})};d.push(o.meta.order),e.children[o.id]=o;const r=ac(e);e.blockEditorsMap[o.id]=r})),l&&a){const t=l.meta.order;delete e.children[l.id],delete e.blockEditorsMap[l.id],Object.keys(e.children).forEach((n=>{const o=e.children[n];o.meta.order>t&&(o.meta.order-=1)}))}e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}function wc(e,t){if(!(null==t?void 0:t.id)&&!(null==t?void 0:t.at))throw new Error("getBlock requires either an id or at");if(null==t?void 0:t.id)return e.children[null==t?void 0:t.id];const n=Object.keys(e.children).find((n=>{var o;return e.children[n].meta.order===(null===(o=null==t?void 0:t.at)||void 0===o?void 0:o[0])}));return n?e.children[n]:null}const xc={insertBlock:sc,deleteBlock:ic,moveBlock:uc,focusBlock:fc,splitBlock:pc,increaseBlockDepth:hc,decreaseBlockDepth:gc,duplicateBlock:mc,updateBlock:nc,toggleBlock:rc,insertBlocks:bc,deleteBlocks:dc,getBlock:wc},kc={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Ec=({placeholder:n,marks:o,className:r,selectionBoxRoot:i,width:l,style:a,children:d,autoFocus:u=!0})=>{const f=F(),p=V(),h=Qi({editor:f,root:i});let g=c(kc).current;s((()=>{u&&!p&&f.focus()}),[u,p]),s((()=>{if(!p)return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)}),[f.selectedBlocks,p]);const v=()=>{p||Array.isArray(f.selectedBlocks)&&f.selectedBlocks.length>0&&f.setBlockSelected(null)},y=()=>{g.indexToSelect=null,g.startedIndexToSelect=null,g.selectionStarted=!1},m=e=>{var t,n,o,r,i;if(!p){if(Li.isSelect(e)){if((null===(t=f.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(f.children).length)return void e.preventDefault();if(g.selectionStarted)return e.preventDefault(),void f.setBlockSelected([],{allSelected:!0})}if((Li.isCopy(e)||Li.isCut(e))&&Array.isArray(f.selectedBlocks)&&f.selectedBlocks.length>0){e.preventDefault();const t=f.getHTML(f.getEditorValue()),n=f.getPlainText(f.getEditorValue()),o=new Blob([t],{type:"text/html"}),r=new Blob([n],{type:"text/plain"}),i=new ClipboardItem({"text/html":o,"text/plain":r});if(navigator.clipboard.write([i]).then((()=>{const e=(new DOMParser).parseFromString(t,"text/html");console.log("HTML copied\n",e.body)})),Li.isCut(e)){const e=f.selectedBlocks.length===Object.keys(f.children).length;f.deleteBlocks({paths:f.selectedBlocks,focus:!1}),f.setBlockSelected(null),y(),e&&f.insertBlock(J({id:Z()}),{at:[0],focus:!0})}}else{if(Li.isBackspace(e)){e.stopPropagation();if(Array.isArray(f.selectedBlocks)&&(null===(n=f.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(f.children).length)return e.preventDefault(),f.deleteBlocks({deleteAll:!0}),f.setBlockSelected(null),void y();if(Array.isArray(f.selectedBlocks)&&(null===(o=f.selectedBlocks)||void 0===o?void 0:o.length)>0)return e.preventDefault(),f.deleteBlocks({paths:f.selectedBlocks,focus:!1}),f.setBlockSelected(null),void y()}if(Li.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(g.selectionStarted&&null!==g.startedIndexToSelect&&null!==g.indexToSelect){const e=g.indexToSelect,t=e-1;if(0===e)return;if(e===g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if(t<g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if((null===(r=f.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==g.startedIndexToSelect){const n=f.selectedBlocks.filter((t=>t!==e));return f.setBlockSelected(n,{only:!0}),void(g.indexToSelect=t)}return}const t=L(f),n=Nn(f);if(!n||!n.selection||!t)return;const o=j.parent(n.selection.anchor.path),i=S.isStart(n,n.selection.focus,o);if(B.isExpanded(n.selection)&&i){const o=f.selection?[f.selection[0]-1]:[0],r=L(f,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),f.setSelection(null),f.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),g.startedIndexToSelect=t.meta.order,g.indexToSelect=t.meta.order-1,g.selectionStarted=!0)}}if(Li.isShiftArrowDown(e)){if(g.selectionStarted&&null!==g.indexToSelect&&null!==g.startedIndexToSelect){const e=g.indexToSelect,t=e+1;if(t===Object.keys(f.children).length)return;if(e===g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if(t>g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if((null===(i=f.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==g.startedIndexToSelect){const n=f.selectedBlocks.filter((t=>t!==e));return f.setBlockSelected(n,{only:!0}),void(g.indexToSelect=t)}return}const t=L(f),n=Nn(f);if(!n||!n.selection||!t)return;const o=j.parent(n.selection.anchor.path),r=S.isEnd(n,n.selection.focus,o);if(B.isExpanded(n.selection)&&r){const o=f.selection?[f.selection[0]+1]:[0],r=L(f,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),f.setSelection(null),f.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),g.startedIndexToSelect=t.meta.order,g.indexToSelect=t.meta.order+1,g.selectionStarted=!0)}}if(Li.isTab(e)){const t=f.selectedBlocks;Array.isArray(t)&&t.length>0&&(e.preventDefault(),t.forEach((e=>{const t=xc.getBlock(f,{at:[e]});f.increaseBlockDepth({blockId:null==t?void 0:t.id})})))}else if(Li.isShiftTab(e)){const t=f.selectedBlocks;Array.isArray(t)&&t.length>0&&(e.preventDefault(),t.forEach((e=>{const t=xc.getBlock(f,{at:[e]});f.decreaseBlockDepth({blockId:null==t?void 0:t.id})})))}else;}}},b=(x={userSelect:h.selection?"none":"auto",pointerEvents:h.selection?"none":"auto",width:l||(null==a?void 0:a.width),paddingBottom:null==a?void 0:a.paddingBottom},Object.assign(Object.assign({},x),{width:x.width||400,paddingBottom:"number"==typeof x.paddingBottom?x.paddingBottom:100}));var x;return t("div",Object.assign({ref:e=>f.refElement=e,className:r?`yoopta-editor ${r}`:"yoopta-editor",style:b,onMouseDown:e=>{p||(y(),(e=>{var t;const n=f.refElement;if(!n)return;const{bottom:o}=n.getBoundingClientRect(),r=o-parseInt(getComputedStyle(n).paddingBottom,10),i=J({id:Z()});if(e.clientY>=r){const e=Object.keys(f.children).length-1,n=L(f,{at:[e]}),o=Nn(f,{at:[e]});if(n&&o&&o.selection){const e=S.string(o,o.selection.anchor.path),r=j.parent(o.selection.anchor.path),[l]=S.node(o,r);if(n.type===i.type&&_.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void f.focusBlock(n.id,{slate:o})}const r=e+1;f.insertBlock(i,{at:[r],focus:!0})}})(e),v())},onBlur:e=>{var t;(null===(t=f.refElement)||void 0===t?void 0:t.contains(e.relatedTarget))||p||(y(),v())}},{children:[e(Ji,{editor:f,marks:o,placeholder:n}),!1!==i&&e(el,{origin:h.origin,coords:h.coords,isOpen:h.selection&&!p}),d]}))},Oc=({children:e,fallback:t=null})=>{const[n,o]=f(!1);return s((()=>o(!0)),[]),n?e:t};function Cc({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const Sc=Cc({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),Dc=(()=>{const e=Z();return{[e]:J({id:e})}})(),jc=new X,Bc=(e,t)=>jc.on(e,t),Rc=(e,t)=>jc.once(e,t),_c=(e,t)=>jc.off(e,t),Ac=(e,t)=>jc.emit(e,t);const Mc=({id:n,editor:o,value:r,marks:i,plugins:l,autoFocus:c,className:a,tools:s,selectionBoxRoot:u,children:p,placeholder:h,readOnly:g,width:v,style:y})=>{const m=()=>{k((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},b=d((()=>i?[Sc,...i]:[Sc]),[i]),w=d((()=>l.map((e=>e.getPlugin))),[l]),[x,k]=f((()=>{o.id||(o.id=n||Z()),o.applyChanges=m,o.readOnly=g||!1,b&&(o.formats=lc(o,b)),o.blocks=function(e,t){const n={};return t.forEach((t=>{var o;const r=ri(t.elements),i=null===(o=null==r?void 0:r.props)||void 0===o?void 0:o.nodeType;if("inline"!==i&&"inlineVoid"!==i){const o={};Object.keys(t.elements).forEach((e=>{const n=di(t.elements[e],["render"]);o[e]=n}));const{display:r,placeholder:i,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:o,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,shortcuts:l},isActive:()=>{const n=L(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:n=>rc(e,t.type,n),create:n=>Ql(e,t.type,n),update:(t,n)=>{nc(e,t,n)},delete:t=>{ic(e,t)}}}})),n}(o,w);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r);return e||void 0===r||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(r)}`),o.children=e?r:Dc,o.blockEditorsMap=cc(o),o.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,o,r,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(o=e.options)||void 0===o?void 0:o.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(o),o.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var o;const r=e.elements[t],i=null===(o=r.props)||void 0===o?void 0:o.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=Object.assign(Object.assign({},r),{rootPlugin:e.type}))})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const o=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:o})}})),t}(w),o.on=Bc,o.once=Rc,o.off=_c,o.emit=Ac,{editor:o,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(r)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(Oc,{children:e(z,Object.assign({editorState:x},{children:e(ci,Object.assign({tools:s},{children:e(Ec,Object.assign({placeholder:h,marks:b,autoFocus:c,className:a,selectionBoxRoot:u,width:v,style:y},{children:p}))}))}))})},Tc=Object.assign(Object.assign({},yi),{ExtendedBlockActions:({id:o,className:r,style:i,onClick:l,children:c})=>{const a=V(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Pr({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Ho(),Fo(),zo(),ko(10)],whileElementsMounted:Io}),{isMounted:g,styles:v}=Hr(h,{duration:100}),y=Object.assign(Object.assign({},v),p);return a?null:t(n,{children:[g&&e(vi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:y},{children:c})),e("button",Object.assign({type:"button",ref:u.setReference,id:o,className:`yoopta-button yoopta-extended-block-actions ${r||""}`,onClick:()=>{null==l||l(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qr,{})}))]})},Portal:fi,Overlay:ui});function Nc(e,t){const n=Object.keys(e.children),{type:o}=t||{},r=n.find((t=>e.children[t].type===o));return r?e.children[r]:null}function Lc(e){return Array.from(new Set(e))}function Pc(e,t){try{w.blur(t),w.deselect(t),D.deselect(t)}catch(e){}e.setBlockSelected(null),e.setSelection(null)}const Ic={underline:{type:"underline",tag:"U"},strike:{type:"strike",tag:"S"},code:{type:"code",tag:"CODE"},italic:{type:"italic",tag:"I"},bold:{type:"bold",tag:"B"}};function zc(e,t){return e.map((e=>{var n,o;let r="";if(e.text)return r=Object.keys(Ic).reduce(((t,n)=>e[n]?`<${Ic[n].tag}>${t}</${Ic[n].tag}>`:t),e.text),r;if(e.type){const i=function(e,t){return Object.values(e).find((e=>{var n,o;return e.type===(null===(o=null===(n=e.elements)||void 0===n?void 0:n[t])||void 0===o?void 0:o.rootPlugin)}))}(t,e.type);if(i&&(null===(o=null===(n=i.parsers)||void 0===n?void 0:n.html)||void 0===o?void 0:o.serialize))return r=i.parsers.html.serialize(e,zc(e.children,t)),r}return r})).join("")}function Fc(e,t){const n=Object.values(t).filter((t=>{var n;return null===(n=e.selectedBlocks)||void 0===n?void 0:n.includes(t.meta.order)})).sort(((e,t)=>e.meta.order-t.meta.order)).map((t=>{var n,o;const r=e.plugins[t.type];if(r&&(null===(o=null===(n=r.parsers)||void 0===n?void 0:n.html)||void 0===o?void 0:o.serialize)){const n=zc(t.value[0].children,e.plugins);return r.parsers.html.serialize(t.value[0],n)}return""}));return`<body id="yoopta-clipboard" data-editor-id="${e.id}">${n.join("")}</body>`}const Hc=()=>{const e={id:"",children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),setEditorValue:(...t)=>function(e,t){e.children=t,e.blockEditorsMap=cc(e),e.applyChanges(),e.emit("change",e.children)}(e,...t),applyChanges:()=>{},insertBlock:(...t)=>sc(e,...t),insertBlocks:(...t)=>bc(e,...t),deleteBlocks:(...t)=>dc(e,...t),deleteBlock:(...t)=>ic(e,...t),duplicateBlock:(...t)=>mc(e,...t),toggleBlock:(...t)=>rc(e,...t),increaseBlockDepth:(...t)=>hc(e,...t),decreaseBlockDepth:(...t)=>gc(e,...t),moveBlock:(...t)=>uc(e,...t),focusBlock:(...t)=>fc(e,...t),getBlock:(...t)=>wc(e,...t),updateBlock:(...t)=>nc(e,...t),splitBlock:(...t)=>pc(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:o=!0}=n;e.selection=t,o&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:o=!1,allSelected:r=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(o)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=Lc(t)}else e.selectedBlocks=Lc(i.concat(t));e.applyChanges()}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{},isFocused:()=>function(e){return!!Hi.get(e)}(e),focus:()=>function(e){if(e.readOnly)return;const t=L(e,{at:[0]});t&&(Hi.set(e,!0),e.focusBlock(t.id,{waitExecution:!0}),e.emit("focus",!0))}(e),blur:(...t)=>function(e,t={}){var n;const o=null!==(n=t.slate)&&void 0!==n?n:Nn(e);if(!o)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>Pc(e,o)),i):(Hi.set(e,!1),Pc(e,o),e.emit("blur",!1),e.applyChanges())}(e,...t),getHTML:t=>Fc(e,t),getMarkdown:t=>function(e,t){return function(e,t){return t.sort(((e,t)=>e.meta.order>t.meta.order?1:-1)).map((t=>{var n,o;const r=e.plugins[t.type];if(r){const e=t.value[0];if(null===(o=null===(n=r.parsers)||void 0===n?void 0:n.markdown)||void 0===o?void 0:o.serialize){const t=r.parsers.markdown.serialize(e,e.children.map((e=>e.text)).join(""));if(t)return t}}return""})).join("\n")}(e,Object.values(t))}(e,t),getPlainText:t=>function(e,t){const n=Fc(e,t),o=document.createElement("div");return o.innerHTML=n,o.innerText}(e,t),refElement:null};return e};function Uc(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(!r)return void console.warn("No slate found");let i=e=>_.isElement(e);(null==n?void 0:n.type)&&(i=e=>_.isElement(e)&&e.type===(null==n?void 0:n.type));try{const[e]=S.nodes(r,{at:(null==n?void 0:n.path)||r.selection||[0],match:i,mode:"lowest"});return e}catch(e){}}function Vc(e,t,n){const o=Uc(e,t,n);if(o)return o[0]}const $c={createElement:function(e,t,n,o){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Nn(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const l=e.blocks[r.type],c=l.elements[n.type],a=G({type:n.type,props:Object.assign(Object.assign({},c.props),n.props)}),s=Object.keys(l.elements);let d=[];s.forEach((e=>{const t=l.elements[e];e===n.type&&Array.isArray(t.children)&&t.children.length>0&&t.children.forEach((e=>{const t=l.elements[e];d.push(G({type:e,props:t.props}))}))})),d.length>0&&(a.children=d);const{path:u,focus:f=!0}=o||{};let p;const h=Uc(e,t,{type:n.type});if(h){const[,e]=h;j.isPath(u)?p=u:"prev"===u?p=j.previous(e):"next"===u&&(p=j.next(e))}if(D.insertNodes(i,a,{at:p,select:f}),f&&d.length>0){const n=d[0],o=Uc(e,t,{path:p,type:n.type});if(o){const[,e]=o;D.select(i,e)}}e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")},deleteElement:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});r?S.withoutNormalizing(r,(()=>{D.removeNodes(r,{at:n.path,match:e=>_.isElement(e)&&e.type===n.type}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")},updateElement:function(e,t,n,o){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Nn(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:(null==o?void 0:o.path)||[0],match:e=>_.isElement(e)&&e.type===n.type}),r=null==t?void 0:t[0],l=null==t?void 0:t[1],c=(null==r?void 0:r.props)||{},a={props:Object.assign(Object.assign({},c),n.props)};D.setNodes(i,a,{at:(null==o?void 0:o.path)||l||[0],match:e=>_.isElement(e)&&e.type===n.type,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")},insertElementText:function(e,t,n){const{blockId:o,focus:r}=n||{},i=o?e.children[o]:L(e);if(!i)return void console.warn(`To set text programmatically, you must provide a valid blockId. Got: ${o}`);const l=Nn(e,{at:[i.meta.order]});if(!l)return void console.warn("No slate found");const c=e.blocks[i.type],a=Array.from({length:Object.keys(c.elements).length},(e=>0));let s=l.selection||a;s?S.withoutNormalizing(l,(()=>{B.isRange(s)&&!B.isCollapsed(s)&&D.collapse(l,{edge:"end"}),D.insertText(l,t,{at:s}),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(i.id,{waitExecution:!0,shouldUpdateBlockSelection:!0})})):console.warn("No valid path or selection found for text insertion")},getElement:Vc,getElementChildren:function(e,t,n){const o=Vc(e,t,n);if(o)return o.children},getElementEntry:Uc,isElementEmpty:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(!r)return void console.warn("No slate found");const[i]=S.nodes(r,{at:n.path||r.selection,match:e=>_.isElement(e)&&e.type===n.type});if(i){const[e,t]=i;return 0===S.string(r,t).trim().length}return!1},getElementPath:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(r)try{return w.findPath(r,n)}catch(e){}else console.warn("No slate found")},getParentElementPath:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(!r)return console.warn("No slate found"),[];try{const e=w.findPath(r,n);return j.parent(e)}catch(e){}}};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.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}*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}button{background-color:transparent;border:none;cursor:pointer}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-editor{height:auto}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;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{background-color:#2383e224;border-radius:.25rem;height:100%;left:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:90}.yoopta-block-actions{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoopta-block-actions[data-hovered-state-open=true]{opacity:1}.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{xc as Blocks,$c as Elements,Li as HOTKEYS,Tc as UI,N as YooptaPlugin,J as buildBlockData,G as buildBlockElement,Hc as createYooptaEditor,Cc as createYooptaMark,Mc as default,L as findPluginBlockBySelectionPath,Nc as findPluginBlockByType,Nn as findSlateBySelectionPath,Z as generateId,ri as getRootBlockElement,oi as getRootBlockElementType,H as useBlockData,W as useBlockSelected,F as useYooptaEditor,U as useYooptaFocused,$ as useYooptaPluginOptions,V as useYooptaReadOnly,ai as useYooptaTools};
13
+ function Wl(e){return"[object Object]"===Object.prototype.toString.call(e)}var Kl={isHistory(e){return!1!==Wl(t=e)&&(void 0===(n=t.constructor)||!1!==Wl(o=n.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,n,o}},Yl=new WeakMap,Xl=new WeakMap,ql={isHistoryEditor:e=>Kl.isHistory(e.history)&&S.isEditor(e),isMerging:e=>Xl.get(e),isSaving:e=>Yl.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=ql.isMerging(e);Xl.set(e,!1),t(),Xl.set(e,n)},withoutSaving(e,t){var n=ql.isSaving(e);Yl.set(e,!1),t(),Yl.set(e,n)}},Zl=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var o=n[n.length-1];o.selectionBefore&&D.setSelection(t,o.selectionBefore),ql.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of o.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",o)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var o=n[n.length-1];ql.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=o.operations.map(A.inverse).reverse();for(var n of e)t.apply(n);o.selectionBefore&&D.setSelection(t,o.selectionBefore)}))})),t.writeHistory("redos",o),e.undos.pop()}},t.apply=e=>{var{operations:o,history:r}=t,{undos:i}=r,l=i[i.length-1],c=l&&l.operations[l.operations.length-1],a=ql.isSaving(t),s=ql.isMerging(t);if(null==a&&(a=Jl(e)),a){if(null==s&&(s=null!=l&&(0!==o.length||Gl(e,c))),l&&s)l.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();r.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},Gl=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!j.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!j.equals(e.path,t.path)),Jl=(e,t)=>"set_selection"!==e.type;function Ql(e,t,n){e.children=Vl(e.children);const o=L(e);if(!o)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const r=(null==n?void 0:n.slate)||Nn(e,{at:[null==o?void 0:o.meta.order]});if(!r||!r.selection)return;const i=e.blocks[t],l=function(e,t){const n=e.blocks[t].elements,o=oi(n);if(!o)throw new Error(`Root element type not found for block type ${t}`);const r=n[o];return{id:Z(),type:o,props:r.props,children:r.children&&r.children.length>0?ii(r,n):[{text:""}]}}(e,t);(null==n?void 0:n.deleteText)&&D.delete(r,{at:[0,0]});const c=J({id:o.id,type:i.type,meta:{order:o.meta.order,depth:o.meta.depth,align:o.meta.align},value:[l]});r.children=c.value;const a=c.id;e.children[a]=c,e.blockEditorsMap[a]=r,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(a,{slate:r,waitExecution:!0})}function ec(e,t){const n=Nn(e);if(!n)return!1;const o=S.marks(n);return!!(null==o?void 0:o[t])}const tc=(e,t)=>{const{insertText:n}=t;return t.insertText=o=>{var r;const{selection:i}=t;if(" "===o&&i&&B.isCollapsed(i)){const{anchor:l}=i,c=S.above(t,{match:e=>_.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!c)return;const[,a]=c,s=S.parent(t,a),[d]=s;if(_.isElement(d)&&!R.isText(d.children[0]))return n(o);const u=c?a:[],f={anchor:l,focus:S.start(t,u)},p=S.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return D.select(t,f),D.delete(t),void h.create({deleteText:!1})}n(o)},t};function nc(e,t,n){e.children=Vl(e.children);let o=!1;const r=e.children[t];r&&(n.id&&(r.id=n.id,o=!0),n.type&&(r.type=n.type,o=!0),n.meta&&(r.meta=n.meta,o=!0),n.value&&(r.value=n.value),e.children=$l(e.children),o&&e.applyChanges(),e.emit("change",e.children))}const oc="Paragraph";function rc(e,t,n){e.children=Vl(e.children);const o=L(e,{at:(null==n?void 0:n.at)||e.selection});if(!o)throw new Error("Block from not found at current selection");let r=t;o.type===r&&(r=oc);const i=Nn(e,{at:[o.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${o.meta.order}`);const l=oi(e.blocks[r].elements);S.withoutNormalizing(i,(()=>{D.setNodes(i,{type:l},{at:[0],mode:"lowest",match:e=>_.isElement(e)&&!S.isInline(i,e)}),(null==n?void 0:n.deleteText)&&D.delete(i,{at:[0,0]});const t={id:o.id,type:r,meta:Object.assign(Object.assign({},o.meta),{order:o.meta.order}),value:i.children};e.blockEditorsMap[o.id]=i,e.children[o.id]=t,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(t.id,{slate:i})}))}function ic(e,t={}){const{at:n=e.selection,deleteAll:o=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=Vl(e.children),r.forEach((t=>{const n=L(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=$l(e.children),e.applyChanges(),void e.emit("change",e.children)}if(o||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:Z()}),n=function(e){return tc(e,Zl(C(M())))}(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!n)return;e.children=Vl(e.children);const[l]=n,c=Object.keys(e.children),a=c.find((t=>e.children[t].meta.order===l));if(c.forEach((t=>{const n=e.children[t];n.meta.order>l&&(n.meta.order-=1)})),a&&(delete e.children[a],delete e.blockEditorsMap[a]),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,o=L(e,{at:[n]});o&&e.focusBlock(o.id,{focusAt:t.focusAt})}}function lc(e,t){const n={};return t.forEach((t=>{const o=t.type;n[o]={hotkey:t.hotkey,type:o,getValue:()=>function(e,t){const n=Nn(e);if(!n)return null;const o=S.marks(n);return null==o?void 0:o[t]}(e,o),isActive:()=>ec(e,o),toggle:()=>function(e,t){const n=Nn(e),o=ec(e,t);n&&(o?S.removeMark(n,t):S.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,o),update:t=>function(e,t,n){const o=Nn(e);o&&o.selection&&B.isExpanded(o.selection)&&(S.addMark(o,t,n),e.applyChanges(),e.emit("change",e.children))}(e,o,t)}})),n}function cc(e){const t={};return Object.keys(e.children).forEach((n=>{const o=ac(e);t[n]=o})),t}function ac(e){return tc(e,Zl(C(M())))}function sc(e,t,n={}){e.children=Vl(e.children);const{at:o=null,focus:r=!1,slate:i=null}=n,l=L(e),c=o,a={id:Z(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(c){const[t]=c;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),a.meta.order=t}else{const t=Object.keys(e.children).length;a.meta.order=t}const d=ac(e);e.blockEditorsMap[a.id]=d,s&&l&&(a.meta.order=l.meta.order,l.meta.order+=1),e.children[a.id]=a;const u=null==l?void 0:l.id;e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:a.id)}function dc(e,t={}){const{deleteAll:n=!1,paths:o,blockIds:r,focus:i=!0}=t;if(n||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:Z()}),n=function(e){return tc(e,Zl(C(M())))}(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.applyChanges(),e.emit("change",e.children),void(i&&e.focusBlock(t.id,{waitExecution:!0}))}if(Array.isArray(r)&&r.length>0){e.children=Vl(e.children),r.forEach((t=>{delete e.children[t],delete e.blockEditorsMap[t]}));const t=Object.keys(e.children).sort(((t,n)=>e.children[t].meta.order>e.children[n].meta.order?1:-1));return t.forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),void(i&&e.focusBlock(t[0],{waitExecution:!0}))}if(Array.isArray(o)&&o.length>0){e.children=Vl(e.children),o.forEach((t=>{const n=L(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));const t=Object.keys(e.children).sort(((t,n)=>e.children[t].meta.order>e.children[n].meta.order?1:-1));return t.forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),void(i&&e.focusBlock(t[0],{waitExecution:!0}))}}function uc(e,t,n){e.children=Vl(e.children);const[o]=n,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===o)),l=r.meta.order<i.meta.order,c=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{l?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:c&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=o,r.meta.depth=i.meta.depth,e.setSelection([o]),e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children)}function fc(e,t,n={}){try{const{focusAt:o,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:l=!0}=n,c=()=>{const r=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(T.isPoint(t))return t;if(j.isPath(t))return{path:t,offset:0};const[,n]=S.first(e,[0]);return{path:n||[0,0],offset:0}}(r,o);D.select(r,e),w.focus(r)}l&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>c()),i):c(),Hi.set(e,!0)}catch(e){}}function pc(e,t={}){const{slate:n,focus:o=!0}=t,r=L(e);n&&n.selection&&r&&S.withoutNormalizing(n,(()=>{e.children=Vl(e.children);const t=j.parent(n.selection.anchor.path);D.splitNodes(n,{at:n.selection,match:e=>_.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,l=n.children.slice()[i];D.removeNodes(n,{at:[i],match:e=>_.isElement(e),mode:"highest"});const c={id:Z(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth,align:r.meta.align},value:[l]};Object.values(e.children).forEach((e=>{e.meta.order>=c.meta.order&&(e.meta.order+=1)}));const a=ac(e);e.blockEditorsMap[c.id]=a,e.children[c.id]=c,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(c.id,{slate:a})}))}function hc(e,t={}){const{at:n=e.selection,blockId:o=""}=t;if(!o&&!n)return;e.children=Vl(e.children);const r=e.children[o]||L(e);r&&(r.meta.depth=r.meta.depth+1,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children))}function gc(e,t={}){const{at:n=e.selection,blockId:o=""}=t;if(!o&&!n)return;e.children=Vl(e.children);const r=e.children[o]||L(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children))}var vc={};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,r="[object Arguments]",i="[object Boolean]",l="[object Date]",c="[object Function]",a="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",C="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",j="[object Uint32Array]",B=/\w*$/,R=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[l]=A[w]=A[x]=A[k]=A[E]=A[O]=A[s]=A[d]=A[u]=A[p]=A[h]=A[g]=A[v]=A[C]=A[S]=A[D]=A[j]=!0,A["[object Error]"]=A[c]=A[y]=!1;var M="object"==typeof K&&K&&K.Object===Object&&K,T="object"==typeof self&&self&&self.Object===Object&&self,N=M||T||Function("return this")(),L=t&&!t.nodeType&&t,P=L&&e&&!e.nodeType&&e,I=P&&P.exports===L;function z(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function H(e,t,n,o){var r=-1,i=e?e.length:0;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function $(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Y,X=Array.prototype,q=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=q.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=I?N.Buffer:void 0,re=N.Symbol,ie=N.Uint8Array,le=$(Object.getPrototypeOf,Object),ce=Object.create,ae=Z.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=oe?oe.isBuffer:void 0,fe=$(Object.keys,Object),pe=Ie(N,"DataView"),he=Ie(N,"Map"),ge=Ie(N,"Promise"),ve=Ie(N,"Set"),ye=Ie(N,"WeakMap"),me=Ie(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ge),ke=Ve(ve),Ee=Ve(ye),Oe=re?re.prototype:void 0,Ce=Oe?Oe.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function De(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function je(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Be(e){this.__data__=new De(e)}function Re(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!ae.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],o=n.length,i=!!o;for(var l in e)!t&&!ee.call(e,l)||i&&("length"==l||He(l,o))||n.push(l);return n}function _e(e,t,n){var o=e[t];ee.call(e,t)&&$e(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if($e(e[n][0],t))return n;return-1}function Me(e,t,n,o,f,y,R){var _;if(o&&(_=y?o(e,f,y,R):o(e)),void 0!==_)return _;if(!qe(e))return e;var M=We(e);if(M){if(_=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n<o;)t[n]=e[n];return t}(e,_)}else{var T=Fe(e),N=T==c||T==a;if(Ye(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(T==u||T==r||N&&!y){if(U(e))return y?e:{};if(_=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=le(e),qe(t)?ce(t):{});var t}(N?{}:e),!t)return function(e,t){return Le(e,ze(e),t)}(e,function(e,t){return e&&Le(t,Ze(t),e)}(_,e))}else{if(!A[T])return y?e:{};_=function(e,t,n,o){var r=e.constructor;switch(t){case m:return Ne(e);case i:case l:return new r(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,o);case w:case x:case k:case E:case O:case C:case S:case D:case j:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,o);case s:return function(e,t,n){var o=t?n(V(e),!0):V(e);return H(o,z,new e.constructor)}(e,o,n);case d:case g:return new r(e);case p:return function(e){var t=new e.constructor(e.source,B.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var o=t?n(W(e),!0):W(e);return H(o,F,new e.constructor)}(e,o,n);case v:return c=e,Ce?Object(Ce.call(c)):{}}var c}(e,T,Me,t)}}R||(R=new Be);var L=R.get(e);if(L)return L;if(R.set(e,_),!M)var P=n?function(e){return function(e,t,n){var o=t(e);return We(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,Ze,ze)}(e):Ze(e);return function(e,t){for(var n=-1,o=e?e.length:0;++n<o&&!1!==t(e[n],n,e););}(P||e,(function(r,i){P&&(r=e[i=r]),_e(_,i,Me(r,t,n,o,i,e,R))})),_}function Te(e){return!(!qe(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?ne:R).test(Ve(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Le(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var l=t[r],c=o?o(n[l],e[l],l,n,e):void 0;_e(n,l,void 0===c?e[l]:c)}return n}function Pe(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Te(n)?n:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var o=t[e];return o===n?void 0:o}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},De.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,o=Ae(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},je.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||De),string:new Se}},je.prototype.delete=function(e){return Pe(this,e).delete(e)},je.prototype.get=function(e){return Pe(this,e).get(e)},je.prototype.has=function(e){return Pe(this,e).has(e)},je.prototype.set=function(e,t){return Pe(this,e).set(e,t),this},Be.prototype.clear=function(){this.__data__=new De},Be.prototype.delete=function(e){return this.__data__.delete(e)},Be.prototype.get=function(e){return this.__data__.get(e)},Be.prototype.has=function(e){return this.__data__.has(e)},Be.prototype.set=function(e,t){var n=this.__data__;if(n instanceof De){var o=n.__data__;if(!he||o.length<199)return o.push([e,t]),this;n=this.__data__=new je(o)}return n.set(e,t),this};var ze=de?$(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||_.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function $e(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=b||he&&Fe(new he)!=s||ge&&Fe(ge.resolve())!=f||ve&&Fe(new ve)!=h||ye&&Fe(new ye)!=y)&&(Fe=function(e){var t=te.call(e),n=t==u?e.constructor:void 0,o=n?Ve(n):void 0;if(o)switch(o){case be:return b;case we:return s;case xe:return f;case ke:return h;case Ee:return y}return t});var We=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Xe(e)}var Ye=ue||function(){return!1};function Xe(e){var t=qe(e)?te.call(e):"";return t==c||t==a}function qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?Re(e):function(e){if(!Ue(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Me(e,!0,!0)}}({get exports(){return vc},set exports(e){vc=e}},vc);var yc=vc;function mc(e,t={}){const{blockId:n,focus:o}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(n&&(r=e.children[n],!r))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(r=L(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=Vl(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(l=r,"function"==typeof window.structuredClone?window.structuredClone(l):yc(l));var l;const c=ac(e);i.id=Z(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=c;const a=i.id;e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(a,{waitExecution:!0})}function bc(e,t,n={}){e.children=Vl(e.children);const{at:o,focus:r}=n;let i=o||[0];const l=L(e),c=Nn(e);let a=!1,s=!1;if(c&&c.selection){const t=j.parent(c.selection.anchor.path),n=S.string(c,t).trim(),o=S.isStart(c,c.selection.anchor,t);a=""===n&&o,s=!o||n.length>0,w.blur(c),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,n)=>{const o={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+n})};d.push(o.meta.order),e.children[o.id]=o;const r=ac(e);e.blockEditorsMap[o.id]=r})),l&&a){const t=l.meta.order;delete e.children[l.id],delete e.blockEditorsMap[l.id],Object.keys(e.children).forEach((n=>{const o=e.children[n];o.meta.order>t&&(o.meta.order-=1)}))}e.children=$l(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}function wc(e,t){if(!(null==t?void 0:t.id)&&!(null==t?void 0:t.at))throw new Error("getBlock requires either an id or at");if(null==t?void 0:t.id)return e.children[null==t?void 0:t.id];const n=Object.keys(e.children).find((n=>{var o;return e.children[n].meta.order===(null===(o=null==t?void 0:t.at)||void 0===o?void 0:o[0])}));return n?e.children[n]:null}const xc={insertBlock:sc,deleteBlock:ic,moveBlock:uc,focusBlock:fc,splitBlock:pc,increaseBlockDepth:hc,decreaseBlockDepth:gc,duplicateBlock:mc,updateBlock:nc,toggleBlock:rc,insertBlocks:bc,deleteBlocks:dc,getBlock:wc},kc={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Ec=({placeholder:n,marks:o,className:r,selectionBoxRoot:i,width:l,style:a,children:d,autoFocus:u=!0})=>{const f=F(),p=V(),h=Qi({editor:f,root:i});let g=c(kc).current;s((()=>{u&&!p&&f.focus()}),[u,p]),s((()=>{if(!p)return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)}),[f.selectedBlocks,p]);const v=()=>{p||Array.isArray(f.selectedBlocks)&&f.selectedBlocks.length>0&&f.setBlockSelected(null)},y=()=>{g.indexToSelect=null,g.startedIndexToSelect=null,g.selectionStarted=!1},m=e=>{var t,n,o,r,i;if(!p){if(Li.isSelect(e)){if((null===(t=f.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(f.children).length)return void e.preventDefault();if(g.selectionStarted)return e.preventDefault(),void f.setBlockSelected([],{allSelected:!0})}if((Li.isCopy(e)||Li.isCut(e))&&Array.isArray(f.selectedBlocks)&&f.selectedBlocks.length>0){e.preventDefault();const t=f.getHTML(f.getEditorValue()),n=f.getPlainText(f.getEditorValue()),o=new Blob([t],{type:"text/html"}),r=new Blob([n],{type:"text/plain"}),i=new ClipboardItem({"text/html":o,"text/plain":r});if(navigator.clipboard.write([i]).then((()=>{const e=(new DOMParser).parseFromString(t,"text/html");console.log("HTML copied\n",e.body)})),Li.isCut(e)){const e=f.selectedBlocks.length===Object.keys(f.children).length;f.deleteBlocks({paths:f.selectedBlocks,focus:!1}),f.setBlockSelected(null),y(),e&&f.insertBlock(J({id:Z()}),{at:[0],focus:!0})}}else{if(Li.isBackspace(e)){e.stopPropagation();if(Array.isArray(f.selectedBlocks)&&(null===(n=f.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(f.children).length)return e.preventDefault(),f.deleteBlocks({deleteAll:!0}),f.setBlockSelected(null),void y();if(Array.isArray(f.selectedBlocks)&&(null===(o=f.selectedBlocks)||void 0===o?void 0:o.length)>0)return e.preventDefault(),f.deleteBlocks({paths:f.selectedBlocks,focus:!1}),f.setBlockSelected(null),void y()}if(Li.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(g.selectionStarted&&null!==g.startedIndexToSelect&&null!==g.indexToSelect){const e=g.indexToSelect,t=e-1;if(0===e)return;if(e===g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if(t<g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if((null===(r=f.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==g.startedIndexToSelect){const n=f.selectedBlocks.filter((t=>t!==e));return f.setBlockSelected(n,{only:!0}),void(g.indexToSelect=t)}return}const t=L(f),n=Nn(f);if(!n||!n.selection||!t)return;const o=j.parent(n.selection.anchor.path),i=S.isStart(n,n.selection.focus,o);if(B.isExpanded(n.selection)&&i){const o=f.selection?[f.selection[0]-1]:[0],r=L(f,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),f.setSelection(null),f.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),g.startedIndexToSelect=t.meta.order,g.indexToSelect=t.meta.order-1,g.selectionStarted=!0)}}if(Li.isShiftArrowDown(e)){if(g.selectionStarted&&null!==g.indexToSelect&&null!==g.startedIndexToSelect){const e=g.indexToSelect,t=e+1;if(t===Object.keys(f.children).length)return;if(e===g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if(t>g.startedIndexToSelect)return f.setBlockSelected([t]),void(g.indexToSelect=t);if((null===(i=f.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==g.startedIndexToSelect){const n=f.selectedBlocks.filter((t=>t!==e));return f.setBlockSelected(n,{only:!0}),void(g.indexToSelect=t)}return}const t=L(f),n=Nn(f);if(!n||!n.selection||!t)return;const o=j.parent(n.selection.anchor.path),r=S.isEnd(n,n.selection.focus,o);if(B.isExpanded(n.selection)&&r){const o=f.selection?[f.selection[0]+1]:[0],r=L(f,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),f.setSelection(null),f.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),g.startedIndexToSelect=t.meta.order,g.indexToSelect=t.meta.order+1,g.selectionStarted=!0)}}if(Li.isTab(e)){const t=f.selectedBlocks;Array.isArray(t)&&t.length>0&&(e.preventDefault(),t.forEach((e=>{const t=xc.getBlock(f,{at:[e]});f.increaseBlockDepth({blockId:null==t?void 0:t.id})})))}else if(Li.isShiftTab(e)){const t=f.selectedBlocks;Array.isArray(t)&&t.length>0&&(e.preventDefault(),t.forEach((e=>{const t=xc.getBlock(f,{at:[e]});f.decreaseBlockDepth({blockId:null==t?void 0:t.id})})))}else;}}},b=(x={userSelect:h.selection?"none":"auto",pointerEvents:h.selection?"none":"auto",width:l||(null==a?void 0:a.width),paddingBottom:null==a?void 0:a.paddingBottom},Object.assign(Object.assign({},x),{width:x.width||400,paddingBottom:"number"==typeof x.paddingBottom?x.paddingBottom:100}));var x;return t("div",Object.assign({ref:e=>f.refElement=e,className:r?`yoopta-editor ${r}`:"yoopta-editor",style:b,onMouseDown:e=>{p||(y(),(e=>{var t;const n=f.refElement;if(!n)return;const{bottom:o}=n.getBoundingClientRect(),r=o-parseInt(getComputedStyle(n).paddingBottom,10),i=J({id:Z()});if(e.clientY>=r){const e=Object.keys(f.children).length-1,n=L(f,{at:[e]}),o=Nn(f,{at:[e]});if(n&&o&&o.selection){const e=S.string(o,o.selection.anchor.path),r=j.parent(o.selection.anchor.path),[l]=S.node(o,r);if(n.type===i.type&&_.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void f.focusBlock(n.id,{slate:o})}const r=e+1;f.insertBlock(i,{at:[r],focus:!0})}})(e),v())},onBlur:e=>{var t;(null===(t=f.refElement)||void 0===t?void 0:t.contains(e.relatedTarget))||p||(y(),v())}},{children:[e(Ji,{editor:f,marks:o,placeholder:n}),!1!==i&&e(el,{origin:h.origin,coords:h.coords,isOpen:h.selection&&!p}),d]}))},Oc=({children:e,fallback:t=null})=>{const[n,o]=f(!1);return s((()=>o(!0)),[]),n?e:t};function Cc({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const Sc=Cc({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),Dc=(()=>{const e=Z();return{[e]:J({id:e})}})(),jc=new X,Bc=(e,t)=>jc.on(e,t),Rc=(e,t)=>jc.once(e,t),_c=(e,t)=>jc.off(e,t),Ac=(e,t)=>jc.emit(e,t);const Mc=({id:n,editor:o,value:r,marks:i,plugins:l,autoFocus:c,className:a,tools:s,selectionBoxRoot:u,children:p,placeholder:h,readOnly:g,width:v,style:y})=>{const m=()=>{k((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},b=d((()=>i?[Sc,...i]:[Sc]),[i]),w=d((()=>l.map((e=>e.getPlugin))),[l]),[x,k]=f((()=>{o.id||(o.id=n||Z()),o.applyChanges=m,o.readOnly=g||!1,b&&(o.formats=lc(o,b)),o.blocks=function(e,t){const n={};return t.forEach((t=>{var o;const r=ri(t.elements),i=null===(o=null==r?void 0:r.props)||void 0===o?void 0:o.nodeType;if("inline"!==i&&"inlineVoid"!==i){const o={};Object.keys(t.elements).forEach((e=>{const n=di(t.elements[e],["render"]);o[e]=n}));const{display:r,placeholder:i,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:o,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,shortcuts:l},isActive:()=>{const n=L(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:n=>rc(e,t.type,n),create:n=>Ql(e,t.type,n),update:(t,n)=>{nc(e,t,n)},delete:t=>{ic(e,t)}}}})),n}(o,w);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r);return e||void 0===r||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(r)}`),o.children=e?r:Dc,o.blockEditorsMap=cc(o),o.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,o,r,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(o=e.options)||void 0===o?void 0:o.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(o),o.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var o;const r=e.elements[t],i=null===(o=r.props)||void 0===o?void 0:o.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=Object.assign(Object.assign({},r),{rootPlugin:e.type}))})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const o=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:o})}})),t}(w),o.on=Bc,o.once=Rc,o.off=_c,o.emit=Ac,{editor:o,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(r)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(Oc,{children:e(z,Object.assign({editorState:x},{children:e(ci,Object.assign({tools:s},{children:e(Ec,Object.assign({placeholder:h,marks:b,autoFocus:c,className:a,selectionBoxRoot:u,width:v,style:y},{children:p}))}))}))})},Tc=Object.assign(Object.assign({},yi),{ExtendedBlockActions:({id:o,className:r,style:i,onClick:l,children:c})=>{const a=V(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Pr({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Ho(),Fo(),zo(),ko(10)],whileElementsMounted:Io}),{isMounted:g,styles:v}=Hr(h,{duration:100}),y=Object.assign(Object.assign({},v),p);return a?null:t(n,{children:[g&&e(vi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:y},{children:c})),e("button",Object.assign({type:"button",ref:u.setReference,id:o,className:`yoopta-button yoopta-extended-block-actions ${r||""}`,onClick:()=>{null==l||l(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qr,{})}))]})},Portal:fi,Overlay:ui});function Nc(e,t){const n=Object.keys(e.children),{type:o}=t||{},r=n.find((t=>e.children[t].type===o));return r?e.children[r]:null}function Lc(e){return Array.from(new Set(e))}function Pc(e,t){try{w.blur(t),w.deselect(t),D.deselect(t)}catch(e){}e.setBlockSelected(null),e.setSelection(null)}const Ic={underline:{type:"underline",tag:"U"},strike:{type:"strike",tag:"S"},code:{type:"code",tag:"CODE"},italic:{type:"italic",tag:"I"},bold:{type:"bold",tag:"B"}};function zc(e,t){return e.map((e=>{var n,o;let r="";if(e.text)return r=Object.keys(Ic).reduce(((t,n)=>e[n]?`<${Ic[n].tag}>${t}</${Ic[n].tag}>`:t),e.text),r;if(e.type){const i=function(e,t){return Object.values(e).find((e=>{var n,o;return e.type===(null===(o=null===(n=e.elements)||void 0===n?void 0:n[t])||void 0===o?void 0:o.rootPlugin)}))}(t,e.type);if(i&&(null===(o=null===(n=i.parsers)||void 0===n?void 0:n.html)||void 0===o?void 0:o.serialize))return r=i.parsers.html.serialize(e,zc(e.children,t)),r}return r})).join("")}function Fc(e,t){const n=Object.values(t).filter((t=>{var n;return null===(n=e.selectedBlocks)||void 0===n?void 0:n.includes(t.meta.order)})).sort(((e,t)=>e.meta.order-t.meta.order)).map((t=>{var n,o;const r=e.plugins[t.type];if(r&&(null===(o=null===(n=r.parsers)||void 0===n?void 0:n.html)||void 0===o?void 0:o.serialize)){const n=zc(t.value[0].children,e.plugins);return r.parsers.html.serialize(t.value[0],n,t.meta)}return""}));return`<body id="yoopta-clipboard" data-editor-id="${e.id}">${n.join("")}</body>`}const Hc=()=>{const e={id:"",children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),setEditorValue:(...t)=>function(e,t){e.children=t,e.blockEditorsMap=cc(e),e.applyChanges(),e.emit("change",e.children)}(e,...t),applyChanges:()=>{},insertBlock:(...t)=>sc(e,...t),insertBlocks:(...t)=>bc(e,...t),deleteBlocks:(...t)=>dc(e,...t),deleteBlock:(...t)=>ic(e,...t),duplicateBlock:(...t)=>mc(e,...t),toggleBlock:(...t)=>rc(e,...t),increaseBlockDepth:(...t)=>hc(e,...t),decreaseBlockDepth:(...t)=>gc(e,...t),moveBlock:(...t)=>uc(e,...t),focusBlock:(...t)=>fc(e,...t),getBlock:(...t)=>wc(e,...t),updateBlock:(...t)=>nc(e,...t),splitBlock:(...t)=>pc(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:o=!0}=n;e.selection=t,o&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:o=!1,allSelected:r=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(o)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=Lc(t)}else e.selectedBlocks=Lc(i.concat(t));e.applyChanges()}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{},isFocused:()=>function(e){return!!Hi.get(e)}(e),focus:()=>function(e){if(e.readOnly)return;const t=L(e,{at:[0]});t&&(Hi.set(e,!0),e.focusBlock(t.id,{waitExecution:!0}),e.emit("focus",!0))}(e),blur:(...t)=>function(e,t={}){var n;const o=null!==(n=t.slate)&&void 0!==n?n:Nn(e);if(!o)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>Pc(e,o)),i):(Hi.set(e,!1),Pc(e,o),e.emit("blur",!1),e.applyChanges())}(e,...t),getHTML:t=>Fc(e,t),getMarkdown:t=>function(e,t){return function(e,t){return t.sort(((e,t)=>e.meta.order>t.meta.order?1:-1)).map((t=>{var n,o;const r=e.plugins[t.type];if(r){const e=t.value[0];if(null===(o=null===(n=r.parsers)||void 0===n?void 0:n.markdown)||void 0===o?void 0:o.serialize){const t=r.parsers.markdown.serialize(e,e.children.map((e=>e.text)).join(""));if(t)return t}}return""})).join("\n")}(e,Object.values(t))}(e,t),getPlainText:t=>function(e,t){const n=Fc(e,t),o=document.createElement("div");return o.innerHTML=n,o.innerText}(e,t),refElement:null};return e};function Uc(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(!r)return void console.warn("No slate found");let i=e=>_.isElement(e);(null==n?void 0:n.type)&&(i=e=>_.isElement(e)&&e.type===(null==n?void 0:n.type));try{const[e]=S.nodes(r,{at:(null==n?void 0:n.path)||r.selection||[0],match:i,mode:"lowest"});return e}catch(e){}}function Vc(e,t,n){const o=Uc(e,t,n);if(o)return o[0]}const $c={createElement:function(e,t,n,o){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Nn(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const l=e.blocks[r.type],c=l.elements[n.type],a=G({type:n.type,props:Object.assign(Object.assign({},c.props),n.props)}),s=Object.keys(l.elements);let d=[];s.forEach((e=>{const t=l.elements[e];e===n.type&&Array.isArray(t.children)&&t.children.length>0&&t.children.forEach((e=>{const t=l.elements[e];d.push(G({type:e,props:t.props}))}))})),d.length>0&&(a.children=d);const{path:u,focus:f=!0}=o||{};let p;const h=Uc(e,t,{type:n.type});if(h){const[,e]=h;j.isPath(u)?p=u:"prev"===u?p=j.previous(e):"next"===u&&(p=j.next(e))}if(D.insertNodes(i,a,{at:p,select:f}),f&&d.length>0){const n=d[0],o=Uc(e,t,{path:p,type:n.type});if(o){const[,e]=o;D.select(i,e)}}e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")},deleteElement:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});r?S.withoutNormalizing(r,(()=>{D.removeNodes(r,{at:n.path,match:e=>_.isElement(e)&&e.type===n.type}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")},updateElement:function(e,t,n,o){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Nn(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:(null==o?void 0:o.path)||[0],match:e=>_.isElement(e)&&e.type===n.type}),r=null==t?void 0:t[0],l=null==t?void 0:t[1],c=(null==r?void 0:r.props)||{},a={props:Object.assign(Object.assign({},c),n.props)};D.setNodes(i,a,{at:(null==o?void 0:o.path)||l||[0],match:e=>_.isElement(e)&&e.type===n.type,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")},insertElementText:function(e,t,n){const{blockId:o,focus:r}=n||{},i=o?e.children[o]:L(e);if(!i)return void console.warn(`To set text programmatically, you must provide a valid blockId. Got: ${o}`);const l=Nn(e,{at:[i.meta.order]});if(!l)return void console.warn("No slate found");const c=e.blocks[i.type],a=Array.from({length:Object.keys(c.elements).length},(e=>0));let s=l.selection||a;s?S.withoutNormalizing(l,(()=>{B.isRange(s)&&!B.isCollapsed(s)&&D.collapse(l,{edge:"end"}),D.insertText(l,t,{at:s}),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(i.id,{waitExecution:!0,shouldUpdateBlockSelection:!0})})):console.warn("No valid path or selection found for text insertion")},getElement:Vc,getElementChildren:function(e,t,n){const o=Vc(e,t,n);if(o)return o.children},getElementEntry:Uc,isElementEmpty:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(!r)return void console.warn("No slate found");const[i]=S.nodes(r,{at:n.path||r.selection,match:e=>_.isElement(e)&&e.type===n.type});if(i){const[e,t]=i;return 0===S.string(r,t).trim().length}return!1},getElementPath:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(r)try{return w.findPath(r,n)}catch(e){}else console.warn("No slate found")},getParentElementPath:function(e,t,n){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const r=Nn(e,{at:[o.meta.order]});if(!r)return console.warn("No slate found"),[];try{const e=w.findPath(r,n);return j.parent(e)}catch(e){}}};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.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}*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}button{background-color:transparent;border:none;cursor:pointer}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-editor{height:auto}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;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{background-color:#2383e224;border-radius:.25rem;height:100%;left:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:90}.yoopta-block-actions{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoopta-block-actions[data-hovered-state-open=true]{opacity:1}.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{xc as Blocks,$c as Elements,Li as HOTKEYS,Tc as UI,N as YooptaPlugin,J as buildBlockData,G as buildBlockElement,Hc as createYooptaEditor,Cc as createYooptaMark,Mc as default,L as findPluginBlockBySelectionPath,Nc as findPluginBlockByType,Nn as findSlateBySelectionPath,Z as generateId,ri as getRootBlockElement,oi as getRootBlockElementType,H as useBlockData,W as useBlockSelected,F as useYooptaEditor,U as useYooptaFocused,$ as useYooptaPluginOptions,V as useYooptaReadOnly,ai as useYooptaTools};
@@ -1 +1 @@
1
- {"version":3,"file":"deserializeHTML.d.ts","sourceRoot":"","sources":["../../src/parsers/deserializeHTML.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAe3D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC;AAEF,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAC,CAAC;AA4FnF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,EAAE,WAAW,GAAG,SAAS,OAkC5G;AAiCD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,iDAQnE"}
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;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAe3D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC;AAEF,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAgGnF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,EAAE,WAAW,GAAG,SAAS,OAkC5G;AAiCD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,iDAQnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"getHTML.d.ts","sourceRoot":"","sources":["../../src/parsers/getHTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAuC9E,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAiB9E"}
1
+ {"version":3,"file":"getHTML.d.ts","sourceRoot":"","sources":["../../src/parsers/getHTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAwC9E,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAiB9E"}
@@ -1,7 +1,7 @@
1
1
  import { HTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  import { Descendant, Editor } from 'slate';
3
3
  import { RenderElementProps as RenderSlateElementProps, RenderLeafProps } from 'slate-react';
4
- import { SlateElement, YooEditor, YooptaBlockData } from '../editor/types';
4
+ import { SlateElement, YooEditor, YooptaBlockBaseMeta, YooptaBlockData } from '../editor/types';
5
5
  import { YooptaMark } from '../marks';
6
6
  import { EditorEventHandlers } from '../types/eventHandlers';
7
7
  import { HOTKEYS_TYPE } from '../utils/hotkeys';
@@ -69,7 +69,7 @@ export type PluginParsers = {
69
69
  };
70
70
  export type PluginParserTypes = 'html' | 'markdown';
71
71
  export type PluginParserValues = 'deserialize' | 'serialize';
72
- export type PluginserializeParser = (element: SlateElement, text: string) => string;
72
+ export type PluginserializeParser = (element: SlateElement, text: string, blockMetaData?: YooptaBlockBaseMeta) => string;
73
73
  export type PluginDeserializeParser = {
74
74
  nodeNames: string[];
75
75
  parse?: (el: HTMLElement) => SlateElement<string, any> | YooptaBlockData[] | void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,IAAI;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC;KAC1C,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CAC9C,GAAG,CAAC,CAAC;AAEN,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,uBAAuB,GAAG;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,GAAG;IACtE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,GAAG,CAAC,OAAO,CAAC;CACvE,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAA;CAAE,CAAC;AAC3F,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAE3D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,MAAM,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAC,OAAO,CAAC;IACzD,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,kBAAkB,IAAI;KACzF,GAAG,IAAI,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,mBAAmB,GAAG,CAClC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,KAC/B,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI;CACrC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC3G,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,GAAG,CAAC,OAAO,CAAC;IACrE,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEpF,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,EAAE,GAAG,IAAI,CAAC;CACnF,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI;KAC5C,GAAG,IAAI,CAAC,GAAG,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI;IAAE,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAAE,CAAC;AAEvH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,eAAe,GAAG;IACrE,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC1B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,IAAI;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC;KAC1C,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CAC9C,GAAG,CAAC,CAAC;AAEN,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,uBAAuB,GAAG;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,GAAG;IACtE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,GAAG,CAAC,OAAO,CAAC;CACvE,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAA;CAAE,CAAC;AAC3F,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAE3D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,MAAM,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAC,OAAO,CAAC;IACzD,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,kBAAkB,IAAI;KACzF,GAAG,IAAI,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,mBAAmB,GAAG,CAClC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,KAC/B,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI;CACrC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC3G,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,GAAG,CAAC,OAAO,CAAC;IACrE,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,mBAAmB,KAChC,MAAM,CAAC;AAEZ,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,EAAE,GAAG,IAAI,CAAC;CACnF,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI;KAC5C,GAAG,IAAI,CAAC,GAAG,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI;IAAE,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAAE,CAAC;AAEvH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,eAAe,GAAG;IACrE,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.6.6",
3
+ "version": "4.6.7",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -67,5 +67,5 @@
67
67
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
68
68
  },
69
69
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
70
- "gitHead": "345ab55b85215e7094f5ef578bb2af0e898fa79c"
70
+ "gitHead": "fa7494d86e7aa6854f96f9089372c90ce3052003"
71
71
  }