@yoopta/editor 4.3.1 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dnd.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/dnd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAInH,eAAO,MAAM,iBAAiB;YAA0B,SAAS;;;
|
|
1
|
+
{"version":3,"file":"dnd.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/dnd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAInH,eAAO,MAAM,iBAAiB;YAA0B,SAAS;;;2BAYrB,YAAY;6BASV,cAAc;CAK3D,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from
|
|
|
3
3
|
* tabbable 6.2.0
|
|
4
4
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
5
|
*/
|
|
6
|
-
var Xr=["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(","),Zr="undefined"==typeof Element,qr=Zr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gr=!Zr&&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},Jr=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Qr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Jr(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),c=e(a.length?a:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{qr.call(l,Xr)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),d=!Jr(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return o},eo=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},to=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))&&!eo(e)?0:e.tabIndex},no=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ro=function(e){return"INPUT"===e.tagName},oo=function(e){return function(e){return ro(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Gr(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},io=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},lo=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=qr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return io(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,a=Gr(e);if(l&&!l.shadowRoot&&!0===r(l))return io(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Gr(e),l=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&l;){var c,s,d;a=!(null===(s=l=null===(c=i=Gr(l))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ao=function(e,t){return!(t.disabled||Jr(t)||function(e){return ro(e)&&"hidden"===e.type}(t)||lo(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!qr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},co=function(e,t){return!(oo(t)||to(t)<0||!ao(e,t))},so=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},uo=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,a=function(e,t){var n=to(e);return n<0&&t&&!eo(e)?0:n}(l,i),c=i?e(t.candidates):l;0===a?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:c})})),r.sort(no).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},fo=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qr([e],t.includeContainer,{filter:co.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:so}):function(e,t,n){if(Jr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Xr));return t&&qr.call(e,Xr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,co.bind(null,t)),uo(n)};const po=r["useInsertionEffect".toString()]||(e=>e());var ho="undefined"!=typeof document?c:s;function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}let vo=!1,yo=0;const mo=()=>"floating-ui-"+yo++;const bo=r["useId".toString()]||function(){const[e,t]=r.useState((()=>vo?mo():void 0));return ho((()=>{null==e&&t(mo())}),[]),r.useEffect((()=>{vo||(vo=!0)}),[]),e};const wo=r.createContext(null),xo=r.createContext(null);function ko(e){return"data-floating-ui-"+e}function Oo(e){const t=a(e);return ho((()=>{t.current=e})),t}const Co=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Eo(e,t){const n=fo(e,Co());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(o=e)?void 0:o.ownerDocument)||document));var o;return n.slice(r+1)[0]}function So(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Vn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Do(e){fo(e,Co()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ro(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 _o={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 jo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Bo=r.forwardRef((function(e,t){const[n,o]=r.useState();ho((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",jo),()=>{document.removeEventListener("keydown",jo)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ko("focus-guard")]:"",style:_o};return r.createElement("span",go({},e,i))})),Ao=r.createContext(null),To=ko("portal");function Mo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),l=bo(),a=No(),c=r.useRef(null);return ho((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{c.current=null}))}),[o]),ho((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(To,""),e.appendChild(n),c.current=n,i(n)}),[t,l]),ho((()=>{if(c.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!Hn(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=l,o.setAttribute(To,""),e=r||e,e.appendChild(o),c.current=o,i(o)}),[t,n,l,a]),o}({id:n,root:o}),[a,c]=r.useState(null),s=r.useRef(null),d=r.useRef(null),u=r.useRef(null),f=r.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!(!o&&!l);return r.useEffect((()=>{if(l&&i&&(null==a||!a.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&So(e)){("focusin"===e.type?Ro:Do)(l)}}}),[l,i,null==a?void 0:a.modal]),r.createElement(Ao.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:c})),[i,l])},p&&l&&r.createElement(Bo,{"data-type":"outside",ref:s,onFocus:e=>{if(So(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Eo(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),p&&l&&r.createElement("span",{"aria-owns":l.id,style:_o}),l&&b(t,l),p&&l&&r.createElement(Bo,{"data-type":"outside",ref:d,onFocus:e=>{if(So(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Eo(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const No=()=>r.useContext(Ao),Lo=new Set,Po=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=bo();return ho((()=>{if(!n)return;Lo.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Lo.delete(i),0===Lo.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,n]),r.createElement("div",go({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Io(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[l,a]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Kr(p,o)||h(o);const[g,v]=r.useState(null),[m,b]=r.useState(null),w=r.useCallback((e=>{e!==C.current&&(C.current=e,v(e))}),[]),x=r.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),k=l||g,O=a||m,C=r.useRef(null),E=r.useRef(null),S=r.useRef(u),D=null!=s,R=$r(s),_=$r(i),j=r.useCallback((()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),Ur(C.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Kr(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,_]);Vr((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=r.useRef(!1);Vr((()=>(B.current=!0,()=>{B.current=!1})),[]),Vr((()=>{if(k&&(C.current=k),O&&(E.current=O),k&&O){if(R.current)return R.current(k,O,j);j()}}),[k,O,j,R,D]);const A=r.useMemo((()=>({reference:C,floating:E,setReference:w,setFloating:x})),[w,x]),T=r.useMemo((()=>({reference:k,floating:O})),[k,O]),M=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Yr(T.floating,u.x),r=Yr(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Wr(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,T.floating,u.x,u.y]);return r.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=r.useContext(xo),u=null!=((null==(f=r.useContext(wo))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return po((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==o||o(e,t,n)})),h=r.useRef(null),g=r.useRef({}),v=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],m=bo(),b=r.useCallback((e=>{const t=Hn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=r.useCallback((e=>{(Hn(e)||null===e)&&(h.current=e,a(e)),(Hn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Hn(e))&&s.refs.setReference(e)}),[s.refs]),x=r.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=r.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),O=r.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 ho((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),r.useMemo((()=>({...s,context:O,refs:x,elements:k})),[s,x,k,O])}const Fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zo(e,t){return"function"==typeof e?e(t):e}function Ho(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[a,c]=r.useState(!1),[s,d]=r.useState("unmounted"),u=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return ho((()=>{a&&!u&&d("unmounted")}),[a,u]),ho((()=>{if(o){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[n,o]),{isMounted:u,status:s}}function Uo(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:l,duration:a=250}=t,c=e.placement,s=c.split("-")[0],d=r.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof a,f=(u?a:a.open)||0,p=(u?a:a.close)||0,[h,g]=r.useState((()=>({...zo(l,d),...zo(n,d)}))),{isMounted:v,status:y}=Ho(e,{duration:a}),m=Oo(n),b=Oo(o),w=Oo(i),x=Oo(l);return ho((()=>{const e=zo(m.current,d),t=zo(w.current,d),n=zo(x.current,d),r=zo(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(r).map(Fo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Fo).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Vo;function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ko.apply(this,arguments)}var Wo=function(e){return r.createElement("svg",Ko({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vo||(Vo=r.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Yo(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var $o=["color"],Xo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,$o);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Zo=["color"],qo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Zo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Go=["color"],Jo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Go);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Qo=["color"],ei=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Qo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ni={"text/plain":"Text","text/html":"Url",default:"Text"};var ri=function(e,t){var n,r,o,i,l,a,c=!1;t||(t={}),n=t.debug||!1;try{if(o=ti(),i=document.createRange(),l=document.getSelection(),(a=document.createElement("span")).textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=ni[t.format]||ni.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(a),i.selectNodeContents(a),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),a&&document.body.removeChild(a),o()}return c};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}const li=i(void 0),ai=({children:r,tools:o})=>{const i=K(),l=d((()=>o?Object.keys(o).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=o[t])||void 0===n?void 0:n.render})}),{}):{}),[o]),a=d((()=>!o||i?null:Object.keys(o).map((t=>{var n,r,i;const l=null===(n=null==o?void 0:o[t])||void 0===n?void 0:n.tool,a=null===(r=null==o?void 0:o[t])||void 0===r?void 0:r.render,c=null===(i=null==o?void 0:o[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:a},c),t):null}))),[o]);return e(li.Provider,Object.assign({value:l},{children:t(n,{children:[a,r]})}))},ci=()=>{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:r="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===r&&(t=t.filter((t=>function(e,t){var n;const r=e.blocks[t];if(!r)return!1;const o=ii(r.elements);return"void"!==(null===(n=null==o?void 0:o.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,r,o,i;return{type:t,title:(null===(r=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===r?void 0:r.title)||t,description:null===(i=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===i?void 0:i.description}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===r&&e.blocks[t].toggle({focus:!0}),"create"===r&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=t=>e(Po,Object.assign({lockScroll:!0,className:t.className,onClick:t.onClick},{children:t.children})),ui=t=>{const[n,r]=f(!1),o=z();return s((()=>{r(!0)}),[]),n?e(Mo,Object.assign({id:`${t.id}-${o.id}`,root:document.querySelector(`[data-yoopta-editor-id="${o.id}"]`)},{children:t.children})):null},fi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),pi=({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})),hi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),gi=({isOpen:n,onClose:r,refs:o,style:i,children:l})=>{var a,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:g,context:v}=Io({placement:"right",open:u,onOpenChange:p,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:y,styles:m}=Uo(v,{duration:100});if(!n)return null;const b=L(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(a=null==w?void 0:w.props)||void 0===a?void 0:a.nodeType),k=d.ActionMenu,O=Object.assign(Object.assign({},g),m),C=si({editor:s,view:"small",onClose:()=>{p(!1),r()}});return e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(pi,{children:[t(fi,{children:[e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(Xo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!k&&!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(hi,{children:[y&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:O,ref:h.setFloating},{children:e(k,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=L(s);e&&(ri(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),r()}},{children:[e(Jo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var vi=Object.freeze({__proto__:null,BlockOptions:gi,BlockOptionsMenuContent:pi,BlockOptionsMenuGroup:fi,BlockOptionsMenuItem:hi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const yi=({block:n,editor:r,dragHandleProps:o,onChangeActiveBlock:i,showActions:l})=>{const[a,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=ci().ActionMenu,[n,r]=f(!1),{refs:o,floatingStyles:i,context:l}=Io({placement:"bottom-start",open:n,onOpenChange:r,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:a,styles:c}=Uo(l,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>r(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:a,actionMenuStyles:s,actionMenuRefs:o,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:r}),{refs:m,floatingStyles:b,context:x}=Io({placement:"right-start",open:a,onOpenChange:c,middleware:[Hr(),zr(),Fr(),kr()]}),{isMounted:k,styles:O}=Uo(x,{duration:100}),{setActivatorNodeRef:C,attributes:E,listeners:R}=o,_=Object.assign(Object.assign({},b),O);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,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=Ln(r,{at:[n.meta.order]}),o=r.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ii(o.elements);let a;o.hasCustomEditor||(a=S.string(t,[0]));const c="string"==typeof a&&0===a.trim().length;if(u&&c&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))r.setSelection([n.meta.order]),r.focusBlock(n.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Nn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{C(e),m.setReference(e)}},E,R,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Ln(r,{at:[n.meta.order]});r.focusBlock(n.id),t&&setTimeout((()=>{r.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),c(!0)}),10)}},{children:e(Tn,{})})),e(gi,{isOpen:k,refs:m,style:_,onClose:()=>c(!1)})]}))},mi=({children:n,block:r,blockId:o})=>{var i;const l=z(),[a,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=En({id:o,disabled:l.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1,marginLeft:20*r.meta.depth+"px"},b=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=a===o,x={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoopta-block",onMouseEnter:()=>{l.readOnly||c(o)},onMouseLeave:()=>{l.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":o,"data-yoopta-block-type":r.type},{children:[!l.readOnly&&e(yi,{block:r,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:n})),b&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};function bi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;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"},Oi={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"},Ci={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},Ei=1;Ei<20;Ei++)Ci["f"+Ei]=111+Ei;function Si(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Di(e,t)})),o=function(e){return r.some((function(t){return Ri(t,e)}))};return null==n?o:o(n)}function Di(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var l in ki)r[ki[l]]=!1;var a=!0,c=!1,s=void 0;try{for(var d,u=o[Symbol.iterator]();!(a=(d=u.next()).done);a=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=ji(f),g=ki[h];if(f.length>1&&!g&&!Oi[f]&&!Ci[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=_i(f)),g&&(r[g]=!p||null)}}catch(e){c=!0,s=e}finally{try{!a&&u.return&&u.return()}finally{if(c)throw s}}return r}function Ri(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function _i(e){return e=ji(e),Ci[e]||e.toUpperCase().charCodeAt(0)}function ji(e){return e=e.toLowerCase(),e=Oi[e]||e}wi.default=Si,wi.isHotkey=Si,wi.isCodeHotkey=function(e,t){return Si(e,t)};var Bi=wi.isKeyHotkey=function(e,t){return Si(e,{byKey:!0},t)};wi.parseHotkey=Di,wi.compareHotkey=Ri,wi.toKeyCode=_i,wi.toKeyName=ji;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:"/",kekCeburek:"mod+enter"},Ti={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"},Mi={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ni=e=>{const t=Ai[e],n=Ti[e],r=Mi[e],o=t&&Bi(t),i=n&&Bi(n),l=r&&Bi(r);return e=>!(!o||!o(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"),isKekceburek:Ni("kekCeburek")};const Pi={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const r=R.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 o=S.isStart(n,n.selection.anchor,r),i=S.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const l=Q({id:G()}),a=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:a,slate:n,focus:!0})}else if(Li.isBackspace(t)){if(t.isDefaultPrevented())return;const r=L(e,{at:e.selection});e.blocks[(null==r?void 0:r.type)||""];const o=R.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=Ln(e,{at:[i]}),a=L(e,{at:[i]}),c=e.blocks[(null==a?void 0:a.type)||""];let s;if(l&&!c.hasCustomEditor&&(s=function(e,t){const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(_.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,r=L(e,{at:[t]});if(e.blocks[(null==r?void 0:r.type)||""].hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const o=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,o,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Li.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=S.first(n,[0]),[,o]=S.last(n,[n.children.length-1]),i=S.range(n,r,o),l=_.equals(n.selection,i);if(_.isExpanded(n.selection)&&l)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;const r=R.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=Ln(e,{at:n}),o=L(e,{at:n});if(r&&o){const[,n]=S.last(r,[0]),i={path:n,offset:S.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Li.isArrowDown(t)){if(t.isDefaultPrevented())return;const r=R.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=Ln(e,{at:n}),i=L(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=S.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(_.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Bi(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Ii=({children:t,attributes:n,placeholder:r})=>{const o=x(),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Fi(e){try{return new URL(e),!0}catch(e){return!1}}const zi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&_.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noopener noreferrer"}};r?D.insertNodes(e,o):(D.wrapNodes(e,o,{split:!0}),D.collapse(e,{edge:"end"}))};function Hi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Ui={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Vi(e,t,n){var r,o,i;if(3===n.nodeType){return null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const l=n;let a=Array.from(l.childNodes).map((n=>Vi(e,t,n))).flat();if(Ui[n.nodeName]){return{[Ui[n.nodeName].type]:!0,text:null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const r=t[n.nodeName],o=e.blocks[r.type],l=oi(o.elements)||"",c=o.elements[l],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:l,children:s&&!o.hasCustomEditor?[{text:""}]:a.map(Ki),props:Object.assign({nodeType:"block"},c.props)};if(r.parse){const e=r.parse(n);if(e)if(B.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return Q({id:G(),type:r.type,value:[d],meta:{order:0,depth:0}})}return a}function Ki(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Hi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Wi={html:{deserialize:function(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const r=e.plugins[n],{parsers:o}=r;if(o){const{html:e}=o;if(e){const{deserialize:r}=e;if(r){const{nodeNames:e}=r;e&&e.forEach((e=>{t[e]={type:n,parse:r.parse}}))}}}})),t}(e);return Vi(e,n,t).filter(Hi)},serialize:function(){}},markdown:{}},Yi=({id:t,customEditor:n,elements:r,marks:o,events:i,options:l,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),g=H(t),v=a(g.value).current;g.type;const y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(r)),[r]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(o)),[o]),b=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(r).forEach((t=>{var n;const o=null===(n=r[t].props)||void 0===n?void 0:n.nodeType,i="inline"===o,l="void"===o,a="inlineVoid"===o;a&&(e.markableVoid=e=>e.type===t),(l||a)&&(e.isVoid=e=>e.type===t),(i||a)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Fi(t)?zi(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Fi(r)?zi(e,r):t(n)},e})(e))})),e}),[]),w=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Li,currentBlock:g,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),x=u((e=>h.updateBlock(t,{value:e})),[t]),k=u((n=>{const r=y[n.element.type];return r?e(r,Object.assign({},n,{blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(C,Object.assign({},n))}),[r]),O=u((t=>{var n,r,o,i,l;let{children:a,leaf:s,attributes:d}=t;const u=bi(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&&(a=t.render({children:a,leaf:s}))}));const p=!("void"===(null===(l=null===(i=null===(o=null===(r=t.children)||void 0===r?void 0:r.props)||void 0===o?void 0:o.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?c:void 0},{children:a}))}),[o]),E=u((e=>{var t;h.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Pi.onKeyDown(h)(e))}),[w.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.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==w?void 0:w.onClick)||void 0===n||n.call(w,e))}),[w.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),j=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,h.readOnly]),B=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,h.readOnly]),A=u((e=>{var t;if(h.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const n=e.clipboardData.getData("text/html"),r=(new DOMParser).parseFromString(n,"text/html");if(r.body.childNodes.length>0){const e=Wi.html.deserialize(h,r.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[w.onPaste,h.readOnly]),T=u((e=>{var t;const n=[];if(h.readOnly)return n;const[r,o]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(r)&&""===S.string(b,[o[0]])&&_.includes(b.selection,o)&&_.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($i,{id:t,slate:b,initialValue:v,onChange:x,decorate:T,renderLeaf:O,renderElement:k,eventHandlers:w,onKeyDown:E,onKeyUp:D,onFocus:B,onClick:R,onBlur:j,customEditor:n,readOnly:h.readOnly,onPaste:A})},$i=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:l,eventHandlers:a,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(O,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},a,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));$i.displayName="SlateEditorInstance";const Xi=({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])}(Te(Ct,{activationConstraint:{delay:100,tolerance:0}}),Te(bt,{coordinateGetter:Rn})),handleDragEnd:u((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Zi=[],qi=({editor:t,marks:r,placeholder:o})=>{const i=K(),{sensors:l,handleDragEnd:a,handleDragStart:c}=Xi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Zi: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],a=t.plugins[l.type];l&&a?f.push(e(mi,Object.assign({block:l,blockId:i},{children:e(Yi,{type:l.type,id:i,marks:r,customEditor:a.customEditor,events:a.events,elements:a.elements,options:a.options,placeholder:o},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(nn,Object.assign({sensors:l,collisionDetection:He,onDragStart:c,onDragEnd:a},{children:e(mn,Object.assign({disabled:i,items:u,strategy:gn},{children:f}))}))},Gi=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var l;if(e.readOnly||!1===n)return;const a=null===(l=t.current)||void 0===l?void 0:l.contains(i.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();a||o({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},l=t=>{if(!r.selection||e.readOnly||!1===n)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t,n)=>{const r=[];return document.querySelectorAll(`[data-yoopta-editor-id="${e}"] [data-yoopta-block]`).forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),a=Math.min(t[0],n[0]),c=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&c>i.top&&a<i.right&&s>i.left&&r.push(o)})),r})(e.id,r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},a=()=>{e.readOnly||c()};s((()=>{var r;if(e.readOnly||!1===n)return;const o=n&&"current"in n?n.current:n||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===(r=t.current)||void 0===r?void 0:r.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",i),o.addEventListener("mousemove",l),o.addEventListener("mouseup",a),()=>{o.removeEventListener("mousedown",i),o.removeEventListener("mousemove",l),o.removeEventListener("mouseup",a)}}),[e.selectedBlocks,r,n,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:c})},Ji=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:o})},Qi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},el=({placeholder:n,marks:r,className:o,selectionBoxRoot:i,width:l,autoFocus:c=!0})=>{const d=z(),u=K(),f=a(null),p=Gi({editor:d,yooptaEditorRef:f,root:i});let h=a(Qi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)}),[d.selectedBlocks,u]);const g=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},v=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},y=e=>{var t,n,r,o,i;if(!u){if(Li.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Li.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void v();if(Array.isArray(d.selectedBlocks)&&(null===(r=d.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void v()}if(Li.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(o=d.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),i=S.isStart(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&i){const r=d.selection?[d.selection[0]-1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Li.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),o=S.isEnd(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&o){const r=d.selection?[d.selection[0]+1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:l},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({"data-yoopta-editor-id":d.id,className:o?`yoopta-editor ${o}`:"yoopta-editor",style:m,ref:f,onClick:e=>{u||(v(),(e=>{var t;const n=f.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10),i=Q({id:G()});if(e.clientY>=o){const e=Object.keys(d.children).length-1,n=L(d,{at:[e]}),r=Ln(d,{at:[e]});if(n&&r&&r.selection){const e=S.string(r,r.selection.anchor.path),o=R.parent(r.selection.anchor.path),[l]=S.node(r,o);if(n.type===i.type&&B.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:r})}const o=e+1;d.insertBlock(i,{at:[o],focus:!0})}})(e),g())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(v(),g())}},{children:[e(qi,{editor:d,marks:r,placeholder:n}),!1!==i&&e(Ji,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},tl=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return s((()=>r(!0)),[]),n?e:t};
|
|
6
|
+
var Xr=["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(","),Zr="undefined"==typeof Element,qr=Zr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gr=!Zr&&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},Jr=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Qr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Jr(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),c=e(a.length?a:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{qr.call(l,Xr)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),d=!Jr(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return o},eo=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},to=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))&&!eo(e)?0:e.tabIndex},no=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ro=function(e){return"INPUT"===e.tagName},oo=function(e){return function(e){return ro(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Gr(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},io=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},lo=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=qr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return io(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,a=Gr(e);if(l&&!l.shadowRoot&&!0===r(l))return io(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Gr(e),l=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&l;){var c,s,d;a=!(null===(s=l=null===(c=i=Gr(l))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ao=function(e,t){return!(t.disabled||Jr(t)||function(e){return ro(e)&&"hidden"===e.type}(t)||lo(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!qr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},co=function(e,t){return!(oo(t)||to(t)<0||!ao(e,t))},so=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},uo=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,a=function(e,t){var n=to(e);return n<0&&t&&!eo(e)?0:n}(l,i),c=i?e(t.candidates):l;0===a?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:c})})),r.sort(no).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},fo=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qr([e],t.includeContainer,{filter:co.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:so}):function(e,t,n){if(Jr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Xr));return t&&qr.call(e,Xr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,co.bind(null,t)),uo(n)};const po=r["useInsertionEffect".toString()]||(e=>e());var ho="undefined"!=typeof document?c:s;function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}let vo=!1,yo=0;const mo=()=>"floating-ui-"+yo++;const bo=r["useId".toString()]||function(){const[e,t]=r.useState((()=>vo?mo():void 0));return ho((()=>{null==e&&t(mo())}),[]),r.useEffect((()=>{vo||(vo=!0)}),[]),e};const wo=r.createContext(null),xo=r.createContext(null);function ko(e){return"data-floating-ui-"+e}function Oo(e){const t=a(e);return ho((()=>{t.current=e})),t}const Co=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Eo(e,t){const n=fo(e,Co());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(o=e)?void 0:o.ownerDocument)||document));var o;return n.slice(r+1)[0]}function So(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Vn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Do(e){fo(e,Co()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ro(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 _o={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 jo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Bo=r.forwardRef((function(e,t){const[n,o]=r.useState();ho((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",jo),()=>{document.removeEventListener("keydown",jo)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ko("focus-guard")]:"",style:_o};return r.createElement("span",go({},e,i))})),Ao=r.createContext(null),To=ko("portal");function Mo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),l=bo(),a=No(),c=r.useRef(null);return ho((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{c.current=null}))}),[o]),ho((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(To,""),e.appendChild(n),c.current=n,i(n)}),[t,l]),ho((()=>{if(c.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!Hn(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=l,o.setAttribute(To,""),e=r||e,e.appendChild(o),c.current=o,i(o)}),[t,n,l,a]),o}({id:n,root:o}),[a,c]=r.useState(null),s=r.useRef(null),d=r.useRef(null),u=r.useRef(null),f=r.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!(!o&&!l);return r.useEffect((()=>{if(l&&i&&(null==a||!a.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&So(e)){("focusin"===e.type?Ro:Do)(l)}}}),[l,i,null==a?void 0:a.modal]),r.createElement(Ao.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:c})),[i,l])},p&&l&&r.createElement(Bo,{"data-type":"outside",ref:s,onFocus:e=>{if(So(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Eo(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),p&&l&&r.createElement("span",{"aria-owns":l.id,style:_o}),l&&b(t,l),p&&l&&r.createElement(Bo,{"data-type":"outside",ref:d,onFocus:e=>{if(So(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Eo(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const No=()=>r.useContext(Ao),Lo=new Set,Po=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=bo();return ho((()=>{if(!n)return;Lo.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Lo.delete(i),0===Lo.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,n]),r.createElement("div",go({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Io(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[l,a]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Kr(p,o)||h(o);const[g,v]=r.useState(null),[m,b]=r.useState(null),w=r.useCallback((e=>{e!==C.current&&(C.current=e,v(e))}),[]),x=r.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),k=l||g,O=a||m,C=r.useRef(null),E=r.useRef(null),S=r.useRef(u),D=null!=s,R=$r(s),_=$r(i),j=r.useCallback((()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),Ur(C.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Kr(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,_]);Vr((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=r.useRef(!1);Vr((()=>(B.current=!0,()=>{B.current=!1})),[]),Vr((()=>{if(k&&(C.current=k),O&&(E.current=O),k&&O){if(R.current)return R.current(k,O,j);j()}}),[k,O,j,R,D]);const A=r.useMemo((()=>({reference:C,floating:E,setReference:w,setFloating:x})),[w,x]),T=r.useMemo((()=>({reference:k,floating:O})),[k,O]),M=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Yr(T.floating,u.x),r=Yr(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Wr(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,T.floating,u.x,u.y]);return r.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=r.useContext(xo),u=null!=((null==(f=r.useContext(wo))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return po((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==o||o(e,t,n)})),h=r.useRef(null),g=r.useRef({}),v=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],m=bo(),b=r.useCallback((e=>{const t=Hn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=r.useCallback((e=>{(Hn(e)||null===e)&&(h.current=e,a(e)),(Hn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Hn(e))&&s.refs.setReference(e)}),[s.refs]),x=r.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=r.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),O=r.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 ho((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),r.useMemo((()=>({...s,context:O,refs:x,elements:k})),[s,x,k,O])}const Fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zo(e,t){return"function"==typeof e?e(t):e}function Ho(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[a,c]=r.useState(!1),[s,d]=r.useState("unmounted"),u=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return ho((()=>{a&&!u&&d("unmounted")}),[a,u]),ho((()=>{if(o){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[n,o]),{isMounted:u,status:s}}function Uo(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:l,duration:a=250}=t,c=e.placement,s=c.split("-")[0],d=r.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof a,f=(u?a:a.open)||0,p=(u?a:a.close)||0,[h,g]=r.useState((()=>({...zo(l,d),...zo(n,d)}))),{isMounted:v,status:y}=Ho(e,{duration:a}),m=Oo(n),b=Oo(o),w=Oo(i),x=Oo(l);return ho((()=>{const e=zo(m.current,d),t=zo(w.current,d),n=zo(x.current,d),r=zo(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(r).map(Fo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Fo).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Vo;function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ko.apply(this,arguments)}var Wo=function(e){return r.createElement("svg",Ko({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vo||(Vo=r.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Yo(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var $o=["color"],Xo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,$o);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Zo=["color"],qo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Zo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Go=["color"],Jo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Go);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Qo=["color"],ei=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Qo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ni={"text/plain":"Text","text/html":"Url",default:"Text"};var ri=function(e,t){var n,r,o,i,l,a,c=!1;t||(t={}),n=t.debug||!1;try{if(o=ti(),i=document.createRange(),l=document.getSelection(),(a=document.createElement("span")).textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=ni[t.format]||ni.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(a),i.selectNodeContents(a),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),a&&document.body.removeChild(a),o()}return c};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}const li=i(void 0),ai=({children:r,tools:o})=>{const i=K(),l=d((()=>o?Object.keys(o).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=o[t])||void 0===n?void 0:n.render})}),{}):{}),[o]),a=d((()=>!o||i?null:Object.keys(o).map((t=>{var n,r,i;const l=null===(n=null==o?void 0:o[t])||void 0===n?void 0:n.tool,a=null===(r=null==o?void 0:o[t])||void 0===r?void 0:r.render,c=null===(i=null==o?void 0:o[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:a},c),t):null}))),[o]);return e(li.Provider,Object.assign({value:l},{children:t(n,{children:[a,r]})}))},ci=()=>{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:r="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===r&&(t=t.filter((t=>function(e,t){var n;const r=e.blocks[t];if(!r)return!1;const o=ii(r.elements);return"void"!==(null===(n=null==o?void 0:o.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,r,o,i;return{type:t,title:(null===(r=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===r?void 0:r.title)||t,description:null===(i=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===i?void 0:i.description}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===r&&e.blocks[t].toggle({focus:!0}),"create"===r&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=t=>e(Po,Object.assign({lockScroll:!0,className:t.className,onClick:t.onClick},{children:t.children})),ui=t=>{const[n,r]=f(!1),o=z();return s((()=>{r(!0)}),[]),n?e(Mo,Object.assign({id:`${t.id}-${o.id}`,root:document.querySelector(`[data-yoopta-editor-id="${o.id}"]`)},{children:t.children})):null},fi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),pi=({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})),hi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),gi=({isOpen:n,onClose:r,refs:o,style:i,children:l})=>{var a,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:g,context:v}=Io({placement:"right",open:u,onOpenChange:p,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:y,styles:m}=Uo(v,{duration:100});if(!n)return null;const b=L(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(a=null==w?void 0:w.props)||void 0===a?void 0:a.nodeType),k=d.ActionMenu,O=Object.assign(Object.assign({},g),m),C=si({editor:s,view:"small",onClose:()=>{p(!1),r()}});return e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(pi,{children:[t(fi,{children:[e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(Xo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!k&&!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(hi,{children:[y&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:O,ref:h.setFloating},{children:e(k,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=L(s);e&&(ri(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),r()}},{children:[e(Jo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var vi=Object.freeze({__proto__:null,BlockOptions:gi,BlockOptionsMenuContent:pi,BlockOptionsMenuGroup:fi,BlockOptionsMenuItem:hi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const yi=({block:n,editor:r,dragHandleProps:o,onChangeActiveBlock:i,showActions:l})=>{const[a,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=ci().ActionMenu,[n,r]=f(!1),{refs:o,floatingStyles:i,context:l}=Io({placement:"bottom-start",open:n,onOpenChange:r,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:a,styles:c}=Uo(l,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>r(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:a,actionMenuStyles:s,actionMenuRefs:o,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:r}),{refs:m,floatingStyles:b,context:x}=Io({placement:"right-start",open:a,onOpenChange:c,middleware:[Hr(),zr(),Fr(),kr()]}),{isMounted:k,styles:O}=Uo(x,{duration:100}),{setActivatorNodeRef:C,attributes:E,listeners:R}=o,_=Object.assign(Object.assign({},b),O);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,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=Ln(r,{at:[n.meta.order]}),o=r.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ii(o.elements);let a;o.hasCustomEditor||(a=S.string(t,[0]));const c="string"==typeof a&&0===a.trim().length;if(u&&c&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))r.setSelection([n.meta.order]),r.focusBlock(n.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Nn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{C(e),m.setReference(e)}},E,R,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Ln(r,{at:[n.meta.order]});r.focusBlock(n.id),t&&setTimeout((()=>{r.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),c(!0)}),10)}},{children:e(Tn,{})})),e(gi,{isOpen:k,refs:m,style:_,onClose:()=>c(!1)})]}))},mi=({children:n,block:r,blockId:o})=>{var i;const l=z(),[a,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=En({id:o,disabled:l.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1,marginLeft:20*r.meta.depth+"px"},b=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=a===o,x={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoopta-block",onMouseEnter:()=>{l.readOnly||c(o)},onMouseLeave:()=>{l.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":o,"data-yoopta-block-type":r.type},{children:[!l.readOnly&&e(yi,{block:r,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:n})),b&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};function bi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;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"},Oi={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"},Ci={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},Ei=1;Ei<20;Ei++)Ci["f"+Ei]=111+Ei;function Si(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Di(e,t)})),o=function(e){return r.some((function(t){return Ri(t,e)}))};return null==n?o:o(n)}function Di(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var l in ki)r[ki[l]]=!1;var a=!0,c=!1,s=void 0;try{for(var d,u=o[Symbol.iterator]();!(a=(d=u.next()).done);a=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=ji(f),g=ki[h];if(f.length>1&&!g&&!Oi[f]&&!Ci[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=_i(f)),g&&(r[g]=!p||null)}}catch(e){c=!0,s=e}finally{try{!a&&u.return&&u.return()}finally{if(c)throw s}}return r}function Ri(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function _i(e){return e=ji(e),Ci[e]||e.toUpperCase().charCodeAt(0)}function ji(e){return e=e.toLowerCase(),e=Oi[e]||e}wi.default=Si,wi.isHotkey=Si,wi.isCodeHotkey=function(e,t){return Si(e,t)};var Bi=wi.isKeyHotkey=function(e,t){return Si(e,{byKey:!0},t)};wi.parseHotkey=Di,wi.compareHotkey=Ri,wi.toKeyCode=_i,wi.toKeyName=ji;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:"/",kekCeburek:"mod+enter"},Ti={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"},Mi={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ni=e=>{const t=Ai[e],n=Ti[e],r=Mi[e],o=t&&Bi(t),i=n&&Bi(n),l=r&&Bi(r);return e=>!(!o||!o(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"),isKekceburek:Ni("kekCeburek")};const Pi={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const r=R.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 o=S.isStart(n,n.selection.anchor,r),i=S.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const l=Q({id:G()}),a=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:a,slate:n,focus:!0})}else if(Li.isBackspace(t)){if(t.isDefaultPrevented())return;const r=L(e,{at:e.selection});e.blocks[(null==r?void 0:r.type)||""];const o=R.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=Ln(e,{at:[i]}),a=L(e,{at:[i]}),c=e.blocks[(null==a?void 0:a.type)||""];let s;if(l&&!c.hasCustomEditor&&(s=function(e,t){const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(_.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,r=L(e,{at:[t]});if(e.blocks[(null==r?void 0:r.type)||""].hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const o=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,o,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Li.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=S.first(n,[0]),[,o]=S.last(n,[n.children.length-1]),i=S.range(n,r,o),l=_.equals(n.selection,i);if(_.isExpanded(n.selection)&&l)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;const r=R.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=Ln(e,{at:n}),o=L(e,{at:n});if(r&&o){const[,n]=S.last(r,[0]),i={path:n,offset:S.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Li.isArrowDown(t)){if(t.isDefaultPrevented())return;const r=R.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=Ln(e,{at:n}),i=L(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=S.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(_.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Bi(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Ii=({children:t,attributes:n,placeholder:r})=>{const o=x(),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Fi(e){try{return new URL(e),!0}catch(e){return!1}}const zi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&_.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noopener noreferrer"}};r?D.insertNodes(e,o):(D.wrapNodes(e,o,{split:!0}),D.collapse(e,{edge:"end"}))};function Hi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Ui={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Vi(e,t,n){var r,o,i;if(3===n.nodeType){return null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const l=n;let a=Array.from(l.childNodes).map((n=>Vi(e,t,n))).flat();if(Ui[n.nodeName]){return{[Ui[n.nodeName].type]:!0,text:null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const r=t[n.nodeName],o=e.blocks[r.type],l=oi(o.elements)||"",c=o.elements[l],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:l,children:s&&!o.hasCustomEditor?[{text:""}]:a.map(Ki),props:Object.assign({nodeType:"block"},c.props)};if(r.parse){const e=r.parse(n);if(e)if(B.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return Q({id:G(),type:r.type,value:[d],meta:{order:0,depth:0}})}return a}function Ki(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Hi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Wi={html:{deserialize:function(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const r=e.plugins[n],{parsers:o}=r;if(o){const{html:e}=o;if(e){const{deserialize:r}=e;if(r){const{nodeNames:e}=r;e&&e.forEach((e=>{t[e]={type:n,parse:r.parse}}))}}}})),t}(e);return Vi(e,n,t).filter(Hi)},serialize:function(){}},markdown:{}},Yi=({id:t,customEditor:n,elements:r,marks:o,events:i,options:l,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),g=H(t),v=a(g.value).current;g.type;const y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(r)),[r]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(o)),[o]),b=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(r).forEach((t=>{var n;const o=null===(n=r[t].props)||void 0===n?void 0:n.nodeType,i="inline"===o,l="void"===o,a="inlineVoid"===o;a&&(e.markableVoid=e=>e.type===t),(l||a)&&(e.isVoid=e=>e.type===t),(i||a)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Fi(t)?zi(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Fi(r)?zi(e,r):t(n)},e})(e))})),e}),[]),w=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Li,currentBlock:g,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),x=u((e=>h.updateBlock(t,{value:e})),[t]),k=u((n=>{const r=y[n.element.type];return r?e(r,Object.assign({},n,{blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(C,Object.assign({},n))}),[r]),O=u((t=>{var n,r,o,i,l;let{children:a,leaf:s,attributes:d}=t;const u=bi(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&&(a=t.render({children:a,leaf:s}))}));const p=!("void"===(null===(l=null===(i=null===(o=null===(r=t.children)||void 0===r?void 0:r.props)||void 0===o?void 0:o.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?c:void 0},{children:a}))}),[o]),E=u((e=>{var t;h.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Pi.onKeyDown(h)(e))}),[w.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.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==w?void 0:w.onClick)||void 0===n||n.call(w,e))}),[w.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),j=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,h.readOnly]),B=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,h.readOnly]),A=u((e=>{var t;if(h.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const n=e.clipboardData.getData("text/html"),r=(new DOMParser).parseFromString(n,"text/html");if(r.body.childNodes.length>0){const e=Wi.html.deserialize(h,r.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[w.onPaste,h.readOnly]),T=u((e=>{var t;const n=[];if(h.readOnly)return n;const[r,o]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(r)&&""===S.string(b,[o[0]])&&_.includes(b.selection,o)&&_.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($i,{id:t,slate:b,initialValue:v,onChange:x,decorate:T,renderLeaf:O,renderElement:k,eventHandlers:w,onKeyDown:E,onKeyUp:D,onFocus:B,onClick:R,onBlur:j,customEditor:n,readOnly:h.readOnly,onPaste:A})},$i=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:l,eventHandlers:a,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(O,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},a,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));$i.displayName="SlateEditorInstance";const Xi=({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])}(Te(Ct,{activationConstraint:{distance:20}}),Te(bt,{coordinateGetter:Rn})),handleDragEnd:u((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Zi=[],qi=({editor:t,marks:r,placeholder:o})=>{const i=K(),{sensors:l,handleDragEnd:a,handleDragStart:c}=Xi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Zi: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],a=t.plugins[l.type];l&&a?f.push(e(mi,Object.assign({block:l,blockId:i},{children:e(Yi,{type:l.type,id:i,marks:r,customEditor:a.customEditor,events:a.events,elements:a.elements,options:a.options,placeholder:o},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(nn,Object.assign({sensors:l,collisionDetection:He,onDragStart:c,onDragEnd:a},{children:e(mn,Object.assign({disabled:i,items:u,strategy:gn},{children:f}))}))},Gi=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var l;if(e.readOnly||!1===n)return;const a=null===(l=t.current)||void 0===l?void 0:l.contains(i.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();a||o({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},l=t=>{if(!r.selection||e.readOnly||!1===n)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t,n)=>{const r=[];return document.querySelectorAll(`[data-yoopta-editor-id="${e}"] [data-yoopta-block]`).forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),a=Math.min(t[0],n[0]),c=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&c>i.top&&a<i.right&&s>i.left&&r.push(o)})),r})(e.id,r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},a=()=>{e.readOnly||c()};s((()=>{var r;if(e.readOnly||!1===n)return;const o=n&&"current"in n?n.current:n||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===(r=t.current)||void 0===r?void 0:r.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",i),o.addEventListener("mousemove",l),o.addEventListener("mouseup",a),()=>{o.removeEventListener("mousedown",i),o.removeEventListener("mousemove",l),o.removeEventListener("mouseup",a)}}),[e.selectedBlocks,r,n,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:c})},Ji=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:o})},Qi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},el=({placeholder:n,marks:r,className:o,selectionBoxRoot:i,width:l,autoFocus:c=!0})=>{const d=z(),u=K(),f=a(null),p=Gi({editor:d,yooptaEditorRef:f,root:i});let h=a(Qi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)}),[d.selectedBlocks,u]);const g=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},v=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},y=e=>{var t,n,r,o,i;if(!u){if(Li.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Li.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void v();if(Array.isArray(d.selectedBlocks)&&(null===(r=d.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void v()}if(Li.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(o=d.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),i=S.isStart(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&i){const r=d.selection?[d.selection[0]-1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Li.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),o=S.isEnd(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&o){const r=d.selection?[d.selection[0]+1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:l},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({"data-yoopta-editor-id":d.id,className:o?`yoopta-editor ${o}`:"yoopta-editor",style:m,ref:f,onClick:e=>{u||(v(),(e=>{var t;const n=f.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10),i=Q({id:G()});if(e.clientY>=o){const e=Object.keys(d.children).length-1,n=L(d,{at:[e]}),r=Ln(d,{at:[e]});if(n&&r&&r.selection){const e=S.string(r,r.selection.anchor.path),o=R.parent(r.selection.anchor.path),[l]=S.node(r,o);if(n.type===i.type&&B.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:r})}const o=e+1;d.insertBlock(i,{at:[o],focus:!0})}})(e),g())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(v(),g())}},{children:[e(qi,{editor:d,marks:r,placeholder:n}),!1!==i&&e(Ji,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},tl=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return s((()=>r(!0)),[]),n?e:t};
|
|
7
7
|
/*!
|
|
8
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
9
9
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/editor",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
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": "
|
|
70
|
+
"gitHead": "228dd8503a28b29beac2f40786e148d710a3fc74"
|
|
71
71
|
}
|