@yoopta/editor 4.0.0-rc.9 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/UI/BlockOptions/BlockOptions.d.ts.map +1 -1
- package/dist/UI/BlockOptions/utils.d.ts +32 -0
- package/dist/UI/BlockOptions/utils.d.ts.map +1 -0
- package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts +2 -1
- package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts.map +1 -1
- package/dist/UI/index.d.ts +3 -2
- package/dist/UI/index.d.ts.map +1 -1
- package/dist/YooptaEditor.d.ts +8 -5
- package/dist/YooptaEditor.d.ts.map +1 -1
- package/dist/components/Block/Block.d.ts.map +1 -1
- package/dist/components/Block/BlockActions.d.ts +1 -1
- package/dist/components/Block/BlockActions.d.ts.map +1 -1
- package/dist/components/Block/hooks.d.ts +865 -0
- package/dist/components/Block/hooks.d.ts.map +1 -0
- package/dist/components/Editor/Editor.d.ts +4 -2
- package/dist/components/Editor/Editor.d.ts.map +1 -1
- package/dist/components/Editor/RenderBlocks.d.ts +2 -1
- package/dist/components/Editor/RenderBlocks.d.ts.map +1 -1
- package/dist/components/Editor/utils.d.ts.map +1 -1
- package/dist/components/SelectionBox/SelectionBox.d.ts +1 -1
- package/dist/components/SelectionBox/SelectionBox.d.ts.map +1 -1
- package/dist/components/SelectionBox/hooks.d.ts.map +1 -1
- package/dist/contexts/YooptaContext/ToolsContext.d.ts.map +1 -0
- package/dist/contexts/{UltraYooptaContext/UltraYooptaContext.d.ts → YooptaContext/YooptaContext.d.ts} +7 -8
- package/dist/contexts/YooptaContext/YooptaContext.d.ts.map +1 -0
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/selection/setBlockSelected.d.ts +1 -1
- package/dist/editor/selection/setBlockSelected.d.ts.map +1 -1
- package/dist/editor/textFormats/toggle.d.ts.map +1 -1
- package/dist/editor/textFormats/update.d.ts.map +1 -1
- package/dist/editor/transforms/createBlock.d.ts.map +1 -1
- package/dist/editor/transforms/decreaseBlockDepth.d.ts.map +1 -1
- package/dist/editor/transforms/deleteBlock.d.ts.map +1 -1
- package/dist/editor/transforms/duplicateBlock.d.ts.map +1 -1
- package/dist/editor/transforms/focusBlock.d.ts.map +1 -1
- package/dist/editor/transforms/getBlock.d.ts +2 -0
- package/dist/editor/transforms/getBlock.d.ts.map +1 -0
- package/dist/editor/transforms/increaseBlockDepth.d.ts.map +1 -1
- package/dist/editor/transforms/insertBlock.d.ts +1 -1
- package/dist/editor/transforms/insertBlock.d.ts.map +1 -1
- package/dist/editor/transforms/insertBlocks.d.ts +3 -0
- package/dist/editor/transforms/insertBlocks.d.ts.map +1 -0
- package/dist/editor/transforms/splitBlock.d.ts.map +1 -1
- package/dist/editor/transforms/toggleBlock.d.ts +4 -2
- package/dist/editor/transforms/toggleBlock.d.ts.map +1 -1
- package/dist/editor/transforms/updateBlock.d.ts.map +1 -1
- package/dist/editor/transforms/updateBlockElement.d.ts.map +1 -1
- package/dist/editor/types.d.ts +15 -13
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/handlers/onKeyDown.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/marks/FakeSelectionMark.d.ts +5 -0
- package/dist/marks/FakeSelectionMark.d.ts.map +1 -0
- package/dist/parsers/deserializeHTML.d.ts +10 -0
- package/dist/parsers/deserializeHTML.d.ts.map +1 -0
- package/dist/parsers/deserializeMarkdown.d.ts +2 -0
- package/dist/parsers/deserializeMarkdown.d.ts.map +1 -0
- package/dist/parsers/index.d.ts +10 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/serializeHTML.d.ts +2 -0
- package/dist/parsers/serializeHTML.d.ts.map +1 -0
- package/dist/parsers/serializeMarkdown.d.ts +2 -0
- package/dist/parsers/serializeMarkdown.d.ts.map +1 -0
- package/dist/plugins/SlateEditorComponent.d.ts +3 -3
- package/dist/plugins/SlateEditorComponent.d.ts.map +1 -1
- package/dist/plugins/createYooptaPlugin.d.ts +12 -4
- package/dist/plugins/createYooptaPlugin.d.ts.map +1 -1
- package/dist/plugins/extenstions/withInlines.d.ts.map +1 -1
- package/dist/plugins/types.d.ts +24 -14
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/utils/editorBuilders.d.ts +3 -3
- package/dist/utils/editorBuilders.d.ts.map +1 -1
- package/dist/utils/generateId.d.ts.map +1 -1
- package/dist/utils/getMaxOffsetInElement.d.ts.map +1 -1
- package/dist/utils/validators.d.ts +2 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/package.json +8 -10
- package/dist/contexts/UltraYooptaContext/ToolsContext.d.ts.map +0 -1
- package/dist/contexts/UltraYooptaContext/UltraYooptaContext.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- /package/dist/contexts/{UltraYooptaContext → YooptaContext}/ToolsContext.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import o,{createContext as i,useContext as a,useRef as u,useLayoutEffect as s,useEffect as l,useMemo as c,useCallback as d,useState as f,memo as h,useReducer as p,Component as v,forwardRef as g,createElement as m,isValidElement as D}from"react";import{randomFillSync as b}from"crypto";import*as y from"react-dom";import C,{unstable_batchedUpdates as w,createPortal as B}from"react-dom";class E{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const t=Object.assign(Object.assign({},this.plugin.options),e);return new E({type:this.plugin.type,elements:this.plugin.elements,events:this.plugin.events,options:t})}}function A(e,t={}){const n=Object.keys(e.children),{at:r=e.selection}=t,o=n.find((t=>e.children[t].meta.order===(null==r?void 0:r[0])));return o?e.children[o]:null}const x={editor:{getBlock:()=>{},insertBlock:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,blockEditorsMap:{},children:{}}},F=i(x),O=({children:t,editorState:n})=>{const r=u(x);return r.current={editor:n.editor},e(F.Provider,Object.assign({value:r.current},{children:t}))},k=()=>{const e=a(F);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},S=e=>k().children[e],j=e=>k().blocks[e],P=e=>k().plugins[e],R=e=>{var t;return null===(t=P(e))||void 0===t?void 0:t.options},T=({blockId:e,path:t})=>{var n;const r=k();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let o;return e&&(o=r.children[e]),t&&(o=A(r,{at:t})),(null===(n=r.selection)||void 0===n?void 0:n[0])===(null==o?void 0:o.meta.order)};var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var u=new o(r,i||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],u]:e._events[s].push(u):(e._events[s]=u,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function u(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),u.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},u.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},u.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,o,i,a){var u=n?n+e:e;if(!this._events[u])return!1;var s,l,c=this._events[u],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,o),!0;case 5:return c.fn.call(c.context,t,r,o,i),!0;case 6:return c.fn.call(c.context,t,r,o,i,a),!0}for(l=1,s=new Array(d-1);l<d;l++)s[l-1]=arguments[l];c.fn.apply(c.context,s)}else{var f,h=c.length;for(l=0;l<h;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,r);break;case 4:c[l].fn.call(c[l].context,t,r,o);break;default:if(!s)for(f=1,s=new Array(d-1);f<d;f++)s[f-1]=arguments[f];c[l].fn.apply(c[l].context,s)}}return!0},u.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},u.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},u.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var u=this._events[i];if(u.fn)u.fn!==t||o&&!u.once||r&&u.context!==r||a(this,i);else{for(var s=0,l=[],c=u.length;s<c;s++)(u[s].fn!==t||o&&!u[s].once||r&&u[s].context!==r)&&l.push(u[s]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u}({get exports(){return _},set exports(e){_=e}});var M=_;let L,I,z=(e=21)=>{var t;t=e-=0,!L||L.length<t?(L=Buffer.allocUnsafe(128*t),b(L),I=0):I+t>L.length&&(b(L),I=0),I+=t;let n="";for(let t=I-e;t<I;t++)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&L[t]];return n};const W=()=>{var e;return"undefined"==typeof window?z():"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?function(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}():z()},V=e=>({id:W(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),q=e=>({id:(null==e?void 0:e.id)||W(),value:(null==e?void 0:e.value)||[V()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const U="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function H(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function K(e){return"nodeType"in e}function $(e){var t,n;return e?H(e)?e:K(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function X(e){const{Document:t}=$(e);return e instanceof t}function Y(e){return!H(e)&&e instanceof $(e).HTMLElement}function Z(e){return e instanceof $(e).SVGElement}function J(e){return e?H(e)?e.document:K(e)?X(e)?e:Y(e)||Z(e)?e.ownerDocument:document:document:document}const G=U?s:l;function Q(e){const t=u(e);return G((()=>{t.current=e})),d((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)}),[])}function ee(e,t){void 0===t&&(t=[e]);const n=u(e);return G((()=>{n.current!==e&&(n.current=e)}),t),n}function te(e,t){const n=u();return c((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function ne(e){const t=Q(e),n=u(null),r=d((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function re(e){const t=u();return l((()=>{t.current=e}),[e]),t.current}let oe={};function ie(e,t){return c((()=>{if(t)return t;const n=null==oe[e]?0:oe[e]+1;return oe[e]=n,e+"-"+n}),[e,t])}function ae(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const ue=ae(1),se=ae(-1);function le(e){if(!e)return!1;const{KeyboardEvent:t}=$(e.target);return t&&e instanceof t}function ce(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=$(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const de=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[de.Translate.toString(e),de.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),fe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function he(e){return e.matches(fe)?e:e.querySelector(fe)}const pe={display:"none"};function ve(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:pe},n)}function ge(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const me=i(null);const De={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},be={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ye(e){let{announcements:t=be,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=De}=e;const{announce:u,announcement:s}=function(){const[e,t]=f("");return{announce:d((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=ie("DndLiveRegion"),[p,v]=f(!1);if(l((()=>{v(!0)}),[]),function(e){const t=a(me);l((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(c((()=>({onDragStart(e){let{active:n}=e;u(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&u(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;u(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;u(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;u(t.onDragCancel({active:n,over:r}))}})),[u,t])),!p)return null;const g=o.createElement(o.Fragment,null,o.createElement(ve,{id:r,value:i.draggable}),o.createElement(ge,{id:h,announcement:s}));return n?B(g,n):g}var Ce;function we(){}function Be(e,t){return c((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Ce||(Ce={}));const Ee=Object.freeze({x:0,y:0});function Ae(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Fe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Oe(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function ke(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Se(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const je=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Se(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ae(Se(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(xe)};function Pe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,u=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*u;return Number((o/(n+r-o)).toFixed(4))}return 0}const Re=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Pe(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Fe)};function Te(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ee}function Ne(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const _e=Ne(1);const Me={ignoreTransform:!1};function Le(e,t){void 0===t&&(t=Me);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=$(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:u}=r,s=e.left-a-(1-o)*parseFloat(n),l=e.top-u-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:l,right:s+c,bottom:l+d,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:u,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:u,right:s}}function Ie(e){return Le(e,{ignoreTransform:!0})}function ze(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(X(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Y(o)||Z(o))return n;if(n.includes(o))return n;const i=$(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=$(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=$(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function We(e){const[t]=ze(e,1);return null!=t?t:null}function Ve(e){return U&&e?H(e)?e:K(e)?X(e)||e===J(e).scrollingElement?window:Y(e)?e:null:null:null}function qe(e){return H(e)?e.scrollX:e.scrollLeft}function Ue(e){return H(e)?e.scrollY:e.scrollTop}function He(e){return{x:qe(e),y:Ue(e)}}var Ke;function $e(e){return!(!U||!e)&&e===document.scrollingElement}function Xe(e){const t={x:0,y:0},n=$e(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Ke||(Ke={}));const Ye={x:.2,y:.2};function Ze(e,t,n,r,o){let{top:i,left:a,right:u,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Ye);const{isTop:l,isBottom:c,isLeft:d,isRight:f}=Xe(e),h={x:0,y:0},p={x:0,y:0},v=t.height*o.y,g=t.width*o.x;return!l&&i<=t.top+v?(h.y=Ke.Backward,p.y=r*Math.abs((t.top+v-i)/v)):!c&&s>=t.bottom-v&&(h.y=Ke.Forward,p.y=r*Math.abs((t.bottom-v-s)/v)),!f&&u>=t.right-g?(h.x=Ke.Forward,p.x=r*Math.abs((t.right-g-u)/g)):!d&&a<=t.left+g&&(h.x=Ke.Backward,p.x=r*Math.abs((t.left+g-a)/g)),{direction:h,speed:p}}function Je(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ge(e){return e.reduce(((e,t)=>ue(e,He(t))),Ee)}const Qe=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Ue(t)),0)}]];class et{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ze(t),r=Ge(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Qe)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class tt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function nt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var rt,ot;function it(e){e.preventDefault()}function at(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(rt||(rt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ot||(ot={}));const ut={start:[ot.Space,ot.Enter],cancel:[ot.Esc],end:[ot.Space,ot.Enter]},st=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ot.Right:return{...n,x:n.x+25};case ot.Left:return{...n,x:n.x-25};case ot.Down:return{...n,y:n.y+25};case ot.Up:return{...n,y:n.y-25}}};class lt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new tt(J(t)),this.windowListeners=new tt($(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(rt.Resize,this.handleCancel),this.windowListeners.add(rt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(rt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);We(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Ee)}handleKeyDown(e){if(le(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ut,coordinateGetter:i=st,scrollBehavior:a="smooth"}=r,{code:u}=e;if(o.end.includes(u))return void this.handleEnd(e);if(o.cancel.includes(u))return void this.handleCancel(e);const{collisionRect:s}=n.current,l=s?{x:s.left,y:s.top}:Ee;this.referenceCoordinates||(this.referenceCoordinates=l);const c=i(e,{active:t,context:n.current,currentCoordinates:l});if(c){const t=se(c,l),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:u,isLeft:s,isBottom:l,maxScroll:d,minScroll:f}=Xe(n),h=Je(n),p={x:Math.min(o===ot.Right?h.right-h.width/2:h.right,Math.max(o===ot.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(o===ot.Down?h.bottom-h.height/2:h.bottom,Math.max(o===ot.Down?h.top:h.top+h.height/2,c.y))},v=o===ot.Right&&!u||o===ot.Left&&!s,g=o===ot.Down&&!l||o===ot.Up&&!i;if(v&&p.x!==c.x){const e=n.scrollLeft+t.x,i=o===ot.Right&&e<=d.x||o===ot.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===ot.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&p.y!==c.y){const e=n.scrollTop+t.y,i=o===ot.Down&&e<=d.y||o===ot.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===ot.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,ue(se(c,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ct(e){return Boolean(e&&"distance"in e)}function dt(e){return Boolean(e&&"delay"in e)}lt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ut,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ft{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=$(e);return e instanceof t?e:J(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=J(i),this.documentListeners=new tt(this.document),this.listeners=new tt(n),this.windowListeners=new tt($(i)),this.initialCoordinates=null!=(r=ce(o))?r:Ee,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(rt.Resize,this.handleCancel),this.windowListeners.add(rt.DragStart,it),this.windowListeners.add(rt.VisibilityChange,this.handleCancel),this.windowListeners.add(rt.ContextMenu,it),this.documentListeners.add(rt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(ct(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(rt.Click,at,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(rt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const u=null!=(t=ce(e))?t:Ee,s=se(r,u);if(!n&&a){if(ct(a)){if(null!=a.tolerance&&nt(s,a.tolerance))return this.handleCancel();if(nt(s,a.distance))return this.handleStart()}return dt(a)&&nt(s,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(u)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ot.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ht={move:{name:"pointermove"},end:{name:"pointerup"}};class pt extends ft{constructor(e){const{event:t}=e,n=J(t.target);super(e,ht,n)}}pt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const vt={move:{name:"mousemove"},end:{name:"mouseup"}};var gt;!function(e){e[e.RightClick=2]="RightClick"}(gt||(gt={}));(class extends ft{constructor(e){super(e,vt,J(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==gt.RightClick&&(null==r||r({event:n}),!0)}}];const mt={move:{name:"touchmove"},end:{name:"touchend"}};var Dt,bt;function yt(e){let{acceleration:t,activator:n=Dt.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=bt.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:p,delta:v,threshold:g}=e;const m=function(e){let{delta:t,disabled:n}=e;const r=re(t);return te((e=>{if(n||!r||!e)return Ct;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ke.Backward]:e.x[Ke.Backward]||-1===o.x,[Ke.Forward]:e.x[Ke.Forward]||1===o.x},y:{[Ke.Backward]:e.y[Ke.Backward]||-1===o.y,[Ke.Forward]:e.y[Ke.Forward]||1===o.y}}}),[n,t,r])}({delta:v,disabled:!i}),[D,b]=function(){const e=u(null);return[d(((t,n)=>{e.current=setInterval(t,n)}),[]),d((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=u({x:0,y:0}),C=u({x:0,y:0}),w=c((()=>{switch(n){case Dt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Dt.DraggableRect:return o}}),[n,o,f]),B=u(null),E=d((()=>{const e=B.current;if(!e)return;const t=y.current.x*C.current.x,n=y.current.y*C.current.y;e.scrollBy(t,n)}),[]),A=c((()=>s===bt.TreeOrder?[...h].reverse():h),[s,h]);l((()=>{if(i&&h.length&&w){for(const e of A){if(!1===(null==r?void 0:r(e)))continue;const n=h.indexOf(e),o=p[n];if(!o)continue;const{direction:i,speed:u}=Ze(e,o,w,t,g);for(const e of["x","y"])m[e][i[e]]||(u[e]=0,i[e]=0);if(u.x>0||u.y>0)return b(),B.current=e,D(E,a),y.current=u,void(C.current=i)}y.current={x:0,y:0},C.current={x:0,y:0},b()}else b()}),[t,E,r,b,i,a,JSON.stringify(w),JSON.stringify(m),D,h,A,p,JSON.stringify(g)])}(class extends ft{constructor(e){super(e,mt)}static setup(){return window.addEventListener(mt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(mt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Dt||(Dt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(bt||(bt={}));const Ct={x:{[Ke.Backward]:!1,[Ke.Forward]:!1},y:{[Ke.Backward]:!1,[Ke.Forward]:!1}};var wt,Bt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(wt||(wt={})),function(e){e.Optimized="optimized"}(Bt||(Bt={}));const Et=new Map;function At(e,t){return te((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function xt(e){let{callback:t,disabled:n}=e;const r=Q(t),o=c((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return l((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function Ft(e){return new et(Le(e),e)}function Ot(e,t,n){void 0===t&&(t=Ft);const[r,o]=p((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);if(JSON.stringify(r)===JSON.stringify(i))return r;return i}),null),i=function(e){let{callback:t,disabled:n}=e;const r=Q(t),o=c((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return l((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),a=xt({callback:o});return G((()=>{o(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),r}const kt=[];function St(e,t){void 0===t&&(t=[]);const n=u(null);return l((()=>{n.current=null}),t),l((()=>{const t=e!==Ee;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?se(e,n.current):Ee}function jt(e){return c((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Pt=[];function Rt(e){let{measure:t}=e;const[n,r]=f(null),o=d((e=>{for(const{target:n}of e)if(Y(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),i=xt({callback:o}),a=d((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Y(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[u,s]=ne(a);return c((()=>({nodeRef:u,rect:n,setRef:s})),[n,u,s])}const Tt=[{sensor:pt,options:{}},{sensor:lt,options:{}}],Nt={current:{}},_t={draggable:{measure:Ie},droppable:{measure:Ie,strategy:wt.WhileDragging,frequency:Bt.Optimized},dragOverlay:{measure:Le}};class Mt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Lt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:we},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_t,measureDroppableContainers:we,windowRect:null,measuringScheduled:!1},It=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:we,draggableNodes:new Map,over:null,measureDroppableContainers:we}),zt=i(Lt);function Wt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mt}}}function Vt(e,t){switch(t.type){case Ce.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ce.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Ce.DragEnd:case Ce.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ce.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Mt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Ce.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Mt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Ce.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Mt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function qt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=a(It),i=re(r),u=re(null==n?void 0:n.id);return l((()=>{if(!t&&!r&&i&&null!=u){if(!le(i))return;if(document.activeElement===i.target)return;const e=o.get(u);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=he(e);if(t){t.focus();break}}}))}}),[r,t,o,u,i]),null}const Ut=i({...Ee,scaleX:1,scaleY:1});var Ht;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ht||(Ht={}));const Kt=h((function(e){var t,n,r,i;let{id:a,accessibility:s,autoScroll:h=!0,children:v,sensors:g=Tt,collisionDetection:m=Re,measuring:D,modifiers:b,...y}=e;const C=p(Vt,void 0,Wt),[B,E]=C,[A,x]=function(){const[e]=f((()=>new Set)),t=d((t=>(e.add(t),()=>e.delete(t))),[e]);return[d((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[F,O]=f(Ht.Uninitialized),k=F===Ht.Initialized,{draggable:{active:S,nodes:j,translate:P},droppable:{containers:R}}=B,T=S?j.get(S):null,N=u({initial:null,translated:null}),_=c((()=>{var e;return null!=S?{id:S,data:null!=(e=null==T?void 0:T.data)?e:Nt,rect:N}:null}),[S,T]),M=u(null),[L,I]=f(null),[z,W]=f(null),V=ee(y,Object.values(y)),q=ie("DndDescribedBy",a),H=c((()=>R.getEnabled()),[R]),K=c((()=>({draggable:{..._t.draggable,...null==X?void 0:X.draggable},droppable:{..._t.droppable,...null==X?void 0:X.droppable},dragOverlay:{..._t.dragOverlay,...null==X?void 0:X.dragOverlay}})),[null==(X=D)?void 0:X.draggable,null==X?void 0:X.droppable,null==X?void 0:X.dragOverlay]);var X;const{droppableRects:Y,measureDroppableContainers:Z,measuringScheduled:J}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=f(null),{frequency:s,measure:c,strategy:h}=o,p=u(e),v=function(){switch(h){case wt.Always:return!1;case wt.BeforeDragging:return n;default:return!n}}(),g=ee(v),m=d((function(e){void 0===e&&(e=[]),g.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),D=u(null),b=te((t=>{if(v&&!n)return Et;if(!t||t===Et||p.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new et(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,v,c]);return l((()=>{p.current=e}),[e]),l((()=>{v||m()}),[n,v]),l((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),l((()=>{v||"number"!=typeof s||null!==D.current||(D.current=setTimeout((()=>{m(),D.current=null}),s))}),[s,v,m,...r]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:null!=i}}(H,{dragging:k,dependencies:[P.x,P.y],config:K.droppable}),Q=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return te((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(j,S),ne=c((()=>z?ce(z):null),[z]),re=function(){const e=!1===(null==L?void 0:L.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=k&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),oe=function(e,t){return At(e,t)}(Q,K.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=u(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;G((()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Te(n(e),r);if(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=We(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,a,s,r,n])}({activeNode:S?j.get(S):null,config:re.layoutShiftCompensation,initialRect:oe,measure:K.draggable.measure});const ae=Ot(Q,K.draggable.measure,oe),se=Ot(Q?Q.parentElement:null),le=u({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=R.getNodeFor(null==(t=le.current.over)?void 0:t.id),fe=Rt({measure:K.dragOverlay.measure}),he=null!=(n=fe.nodeRef.current)?n:Q,pe=k?null!=(r=fe.rect)?r:ae:null,ve=Boolean(fe.nodeRef.current&&fe.rect),ge=Te(De=ve?null:ae,At(De));var De;const be=jt(he?$(he):null),we=function(e){const t=u(e),n=te((n=>e?n&&n!==kt&&e&&t.current&&e.parentNode===t.current.parentNode?n:ze(e):kt),[e]);return l((()=>{t.current=e}),[e]),n}(k?null!=de?de:Q:null),Be=function(e,t){void 0===t&&(t=Le);const[n]=e,r=jt(n?$(n):null),[o,i]=p((function(){return e.length?e.map((e=>$e(e)?r:new et(t(e),e))):Pt}),Pt),a=xt({callback:i});return e.length>0&&o===Pt&&i(),G((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),o}(we),Ae=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(b,{transform:{x:P.x-ge.x,y:P.y-ge.y,scaleX:1,scaleY:1},activatorEvent:z,active:_,activeNodeRect:ae,containerNodeRect:se,draggingNodeRect:pe,over:le.current.over,overlayNodeRect:fe.rect,scrollableAncestors:we,scrollableAncestorRects:Be,windowRect:be}),xe=ne?ue(ne,P):null,Fe=function(e){const[t,n]=f(null),r=u(e),o=d((e=>{const t=Ve(e.target);t&&n((e=>e?(e.set(t,He(t)),new Map(e)):null))}),[]);return l((()=>{const t=r.current;if(e!==t){i(t);const a=e.map((e=>{const t=Ve(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,He(t)]):null})).filter((e=>null!=e));n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Ve(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),c((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ue(e,t)),Ee):Ge(e):Ee),[e,t])}(we),Oe=St(Fe),Se=St(Fe,[ae]),je=ue(Ae,Oe),Pe=pe?_e(pe,Ae):null,Ne=_&&Pe?m({active:_,collisionRect:Pe,droppableRects:Y,droppableContainers:H,pointerCoordinates:xe}):null,Me=ke(Ne,"id"),[Ie,qe]=f(null),Ue=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ve?Ae:ue(Ae,Se),null!=(i=null==Ie?void 0:Ie.rect)?i:null,ae),Ke=d(((e,t)=>{let{sensor:n,options:r}=t;if(null==M.current)return;const o=j.get(M.current);if(!o)return;const i=e.nativeEvent,a=new n({active:M.current,activeNode:o,event:i,options:r,context:le,onStart(e){const t=M.current;if(null==t)return;const n=j.get(t);if(!n)return;const{onDragStart:r}=V.current,o={active:{id:t,data:n.data,rect:N}};w((()=>{null==r||r(o),O(Ht.Initializing),E({type:Ce.DragStart,initialCoordinates:e,active:t}),A({type:"onDragStart",event:o})}))},onMove(e){E({type:Ce.DragMove,coordinates:e})},onEnd:u(Ce.DragEnd),onCancel:u(Ce.DragCancel)});function u(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=le.current;let a=null;if(t&&o){const{cancelDrop:u}=V.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Ce.DragEnd&&"function"==typeof u){await Promise.resolve(u(a))&&(e=Ce.DragCancel)}}M.current=null,w((()=>{E({type:e}),O(Ht.Uninitialized),qe(null),I(null),W(null);const t=e===Ce.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[t];null==e||e(a),A({type:t,event:a})}}))}}w((()=>{I(a),W(e.nativeEvent)}))}),[j]),Xe=d(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=j.get(r);if(null!==M.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},M.current=r,Ke(n,t))}),[j,Ke]),Ye=function(e,t){return c((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(g,Xe);!function(e){l((()=>{if(!U)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(g),G((()=>{ae&&F===Ht.Initializing&&O(Ht.Initialized)}),[ae,F]),l((()=>{const{onDragMove:e}=V.current,{active:t,activatorEvent:n,collisions:r,over:o}=le.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:je.x,y:je.y},over:o};w((()=>{null==e||e(i),A({type:"onDragMove",event:i})}))}),[je.x,je.y]),l((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=le.current;if(!e||null==M.current||!t||!o)return;const{onDragOver:i}=V.current,a=r.get(Me),u=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:u};w((()=>{qe(u),null==i||i(s),A({type:"onDragOver",event:s})}))}),[Me]),G((()=>{le.current={activatorEvent:z,active:_,activeNode:Q,collisionRect:Pe,collisions:Ne,droppableRects:Y,draggableNodes:j,draggingNode:he,draggingNodeRect:pe,droppableContainers:R,over:Ie,scrollableAncestors:we,scrollAdjustedTranslate:je},N.current={initial:pe,translated:Pe}}),[_,Q,Ne,Pe,j,he,pe,Y,R,Ie,we,je]),yt({...re,delta:P,draggingRect:Pe,pointerCoordinates:xe,scrollableAncestors:we,scrollableAncestorRects:Be});const Ze=c((()=>({active:_,activeNode:Q,activeNodeRect:ae,activatorEvent:z,collisions:Ne,containerNodeRect:se,dragOverlay:fe,draggableNodes:j,droppableContainers:R,droppableRects:Y,over:Ie,measureDroppableContainers:Z,scrollableAncestors:we,scrollableAncestorRects:Be,measuringConfiguration:K,measuringScheduled:J,windowRect:be})),[_,Q,ae,z,Ne,se,fe,j,R,Y,Ie,Z,we,Be,K,J,be]),Je=c((()=>({activatorEvent:z,activators:Ye,active:_,activeNodeRect:ae,ariaDescribedById:{draggable:q},dispatch:E,draggableNodes:j,over:Ie,measureDroppableContainers:Z})),[z,Ye,_,ae,E,q,j,Ie,Z]);return o.createElement(me.Provider,{value:x},o.createElement(It.Provider,{value:Je},o.createElement(zt.Provider,{value:Ze},o.createElement(Ut.Provider,{value:Ue},v)),o.createElement(qt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),o.createElement(ye,{...s,hiddenTextDescribedById:q}))})),$t=i(null),Xt="button",Yt="Droppable";function Zt(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=ie(Yt),{activators:u,activatorEvent:s,active:l,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:p}=a(It),{role:v=Xt,roleDescription:g="draggable",tabIndex:m=0}=null!=o?o:{},D=(null==l?void 0:l.id)===t,b=a(D?Ut:$t),[y,C]=ne(),[w,B]=ne(),E=function(e,t){return c((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(u,t),A=ee(n);G((()=>(h.set(t,{id:t,key:i,node:y,activatorNode:w,data:A}),()=>{const e=h.get(t);e&&e.key===i&&h.delete(t)})),[h,t]);return{active:l,activatorEvent:s,activeNodeRect:d,attributes:c((()=>({role:v,tabIndex:m,"aria-disabled":r,"aria-pressed":!(!D||v!==Xt)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[r,v,m,D,g,f.draggable]),isDragging:D,listeners:r?void 0:E,node:y,over:p,setNodeRef:C,setActivatorNodeRef:B,transform:b}}const Jt="Droppable",Gt={timeout:25};function Qt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function en(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function tn(e){return null!==e&&e>=0}const nn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Qt(t,r,n),a=t[o],u=i[o];return u&&a?{x:u.left-a.left,y:u.top-a.top,scaleX:u.width/a.width,scaleY:u.height/a.height}:null},rn={scaleX:1,scaleY:1},on=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const u=null!=(t=i[n])?t:r;if(!u)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(u.top+u.height):e.top-u.top,...rn}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-u.height-s,...rn}:o<n&&o>=a?{x:0,y:u.height+s,...rn}:{x:0,y:0,...rn}};const an="Sortable",un=o.createContext({activeIndex:-1,containerId:an,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:nn,disabled:{draggable:!1,droppable:!1}});function sn(e){let{children:t,id:n,items:r,strategy:i=nn,disabled:s=!1}=e;const{active:d,dragOverlay:f,droppableRects:h,over:p,measureDroppableContainers:v}=a(zt),g=ie(an,n),m=Boolean(null!==f.rect),D=c((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),b=null!=d,y=d?D.indexOf(d.id):-1,C=p?D.indexOf(p.id):-1,w=u(D),B=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(D,w.current),E=-1!==C&&-1===y||B,A=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(s);G((()=>{B&&b&&v(D)}),[B,D,b,v]),l((()=>{w.current=D}),[D]);const x=c((()=>({activeIndex:y,containerId:g,disabled:A,disableTransforms:E,items:D,overIndex:C,useDragOverlay:m,sortedRects:en(D,h),strategy:i})),[y,g,A.draggable,A.droppable,E,D,C,h,m,i]);return o.createElement(un.Provider,{value:x},t)}const ln=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Qt(n,r,o).indexOf(t)},cn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:u,previousContainerId:s,transition:l}=e;return!(!l||!r)&&((u===i||o!==a)&&(!!n||a!==o&&t===s))},dn={duration:200,easing:"ease"},fn="transform",hn=de.Transition.toString({property:fn,duration:0,easing:"linear"}),pn={roleDescription:"sortable"};function vn(e){let{animateLayoutChanges:t=cn,attributes:n,disabled:r,data:o,getNewIndex:i=ln,id:s,strategy:h,resizeObserverConfig:p,transition:v=dn}=e;const{items:g,containerId:m,activeIndex:D,disabled:b,disableTransforms:y,sortedRects:C,overIndex:w,useDragOverlay:B,strategy:E}=a(un),A=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,b),x=g.indexOf(s),F=c((()=>({sortable:{containerId:m,index:x,items:g},...o})),[m,o,x,g]),O=c((()=>g.slice(g.indexOf(s))),[g,s]),{rect:k,node:S,isOver:j,setNodeRef:P}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=ie(Jt),{active:s,dispatch:c,over:f,measureDroppableContainers:h}=a(It),p=u({disabled:n}),v=u(!1),g=u(null),m=u(null),{disabled:D,updateMeasurementsFor:b,timeout:y}={...Gt,...o},C=ee(null!=b?b:r),w=xt({callback:d((()=>{v.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{h(Array.isArray(C.current)?C.current:[C.current]),m.current=null}),y)):v.current=!0}),[y]),disabled:D||!s}),B=d(((e,t)=>{w&&(t&&(w.unobserve(t),v.current=!1),e&&w.observe(e))}),[w]),[E,A]=ne(B),x=ee(t);return l((()=>{w&&E.current&&(w.disconnect(),v.current=!1,w.observe(E.current))}),[E,w]),G((()=>(c({type:Ce.RegisterDroppable,element:{id:r,key:i,disabled:n,node:E,rect:g,data:x}}),()=>c({type:Ce.UnregisterDroppable,key:i,id:r}))),[r]),l((()=>{n!==p.current.disabled&&(c({type:Ce.SetDroppableDisabled,id:r,key:i,disabled:n}),p.current.disabled=n)}),[r,i,n,c]),{active:s,rect:g,isOver:(null==f?void 0:f.id)===r,node:E,over:f,setNodeRef:A}}({id:s,data:F,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...p}}),{active:R,activatorEvent:T,activeNodeRect:N,attributes:_,setNodeRef:M,listeners:L,isDragging:I,over:z,setActivatorNodeRef:W,transform:V}=Zt({id:s,data:F,attributes:{...pn,...n},disabled:A.draggable}),q=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c((()=>e=>{t.forEach((t=>t(e)))}),t)}(P,M),U=Boolean(R),H=U&&!y&&tn(D)&&tn(w),K=!B&&I,$=K&&H?V:null,X=H?null!=$?$:(null!=h?h:E)({rects:C,activeNodeRect:N,activeIndex:D,overIndex:w,index:x}):null,Y=tn(D)&&tn(w)?i({id:s,items:g,activeIndex:D,overIndex:w}):x,Z=null==R?void 0:R.id,J=u({activeId:Z,items:g,newIndex:Y,containerId:m}),Q=g!==J.current.items,te=t({active:R,containerId:m,isDragging:I,isSorting:U,id:s,index:x,items:g,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:v,wasDragging:null!=J.current.activeId}),re=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=f(null),s=u(n);return G((()=>{if(!t&&n!==s.current&&r.current){const e=o.current;if(e){const t=Le(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==s.current&&(s.current=n)}),[t,n,r,o]),l((()=>{i&&a(null)}),[i]),i}({disabled:!te,index:x,node:S,rect:k});return l((()=>{U&&J.current.newIndex!==Y&&(J.current.newIndex=Y),m!==J.current.containerId&&(J.current.containerId=m),g!==J.current.items&&(J.current.items=g)}),[U,Y,m,g]),l((()=>{if(Z===J.current.activeId)return;if(Z&&!J.current.activeId)return void(J.current.activeId=Z);const e=setTimeout((()=>{J.current.activeId=Z}),50);return()=>clearTimeout(e)}),[Z]),{active:R,activeIndex:D,attributes:_,data:F,rect:k,index:x,newIndex:Y,items:g,isOver:j,isSorting:U,isDragging:I,listeners:L,node:S,overIndex:w,over:z,setNodeRef:q,setActivatorNodeRef:W,setDroppableNodeRef:P,setDraggableNodeRef:M,transform:null!=re?re:X,transition:function(){if(re||Q&&J.current.newIndex===x)return hn;if(K&&!le(T)||!v)return;if(U||te)return de.Transition.toString({...v,property:fn});return}()}}function gn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const mn=[ot.Down,ot.Right,ot.Up,ot.Left],Dn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:u}}=t;if(mn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case ot.Down:r.top<i.top&&t.push(n);break;case ot.Up:r.top>i.top&&t.push(n);break;case ot.Left:r.left>i.left&&t.push(n);break;case ot.Right:r.left<i.left&&t.push(n)}}));const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Oe(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Oe(r),a=o.reduce(((e,t,r)=>e+Ae(n[r],t)),0),u=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:u}})}}return i.sort(xe)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let l=ke(s,"id");if(l===(null==a?void 0:a.id)&&s.length>1&&(l=s[1].id),null!=l){const e=i.get(n.id),t=i.get(l),a=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&a&&e&&t){const n=ze(s).some(((e,t)=>u[t]!==e)),o=bn(e,t),i=function(e,t){if(!gn(e)||!gn(t))return!1;if(!bn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),l=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},c={x:a.left,y:a.top};return l.x&&l.y?c:se(c,l)}}}};function bn(e,t){return!(!gn(e)||!gn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var yn;function Cn(){return Cn=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},Cn.apply(this,arguments)}var wn,Bn=function(e){return r.createElement("svg",Cn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),yn||(yn=r.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function En(){return En=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},En.apply(this,arguments)}var An=function(e){return r.createElement("svg",En({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),wn||(wn=r.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function xn(e,t={}){const n=Object.keys(e.children),{at:r=e.selection}=t,o=n.find((t=>e.children[t].meta.order===(null==r?void 0:r[0])));if(o)return e.blockEditorsMap[o]}var Fn=function(e){if(e=String(e||""),Sn.test(e))return"rtl";if(jn.test(e))return"ltr";return"neutral"},On="֑-߿יִ-﷽ﹰ-ﻼ",kn="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Sn=new RegExp("^[^"+kn+"]*["+On+"]"),jn=new RegExp("^[^"+On+"]*["+kn+"]");var Pn=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Rn="object"==typeof N&&N&&N.Object===Object&&N,Tn="object"==typeof self&&self&&self.Object===Object&&self,Nn=Rn||Tn||Function("return this")(),_n=Nn,Mn=function(){return _n.Date.now()},Ln=/\s/;var In=function(e){for(var t=e.length;t--&&Ln.test(e.charAt(t)););return t},zn=In,Wn=/^\s+/;var Vn=function(e){return e?e.slice(0,zn(e)+1).replace(Wn,""):e},qn=Nn.Symbol,Un=qn,Hn=Object.prototype,Kn=Hn.hasOwnProperty,$n=Hn.toString,Xn=Un?Un.toStringTag:void 0;var Yn=function(e){var t=Kn.call(e,Xn),n=e[Xn];try{e[Xn]=void 0;var r=!0}catch(e){}var o=$n.call(e);return r&&(t?e[Xn]=n:delete e[Xn]),o},Zn=Object.prototype.toString;var Jn=Yn,Gn=function(e){return Zn.call(e)},Qn=qn?qn.toStringTag:void 0;var er=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Qn&&Qn in Object(e)?Jn(e):Gn(e)},tr=function(e){return null!=e&&"object"==typeof e};var nr=Vn,rr=Pn,or=function(e){return"symbol"==typeof e||tr(e)&&"[object Symbol]"==er(e)},ir=/^[-+]0x[0-9a-f]+$/i,ar=/^0b[01]+$/i,ur=/^0o[0-7]+$/i,sr=parseInt;var lr=Pn,cr=Mn,dr=function(e){if("number"==typeof e)return e;if(or(e))return NaN;if(rr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=nr(e);var n=ar.test(e);return n||ur.test(e)?sr(e.slice(2),n?2:8):ir.test(e)?NaN:+e},fr=Math.max,hr=Math.min;var pr=function(e,t,n){var r,o,i,a,u,s,l=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,l=t,a=e.apply(i,n)}function p(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-l>=i}function v(){var e=cr();if(p(e))return g(e);u=setTimeout(v,function(e){var n=t-(e-s);return d?hr(n,i-(e-l)):n}(e))}function g(e){return u=void 0,f&&r?h(e):(r=o=void 0,a)}function m(){var e=cr(),n=p(e);if(r=arguments,o=this,s=e,n){if(void 0===u)return function(e){return l=e,u=setTimeout(v,t),c?h(e):a}(s);if(d)return clearTimeout(u),u=setTimeout(v,t),h(s)}return void 0===u&&(u=setTimeout(v,t)),a}return t=dr(t)||0,lr(n)&&(c=!!n.leading,i=(d="maxWait"in n)?fr(dr(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),m.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=s=o=u=void 0},m.flush=function(){return void 0===u?a:g(cr())},m},vr=pr,gr=Pn;var mr=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return gr(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),vr(e,t,{leading:r,maxWait:t,trailing:o})};const Dr=e=>"object"==typeof e&&null!=e&&1===e.nodeType,br=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,yr=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return br(n.overflowY,t)||br(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Cr=(e,t,n,r,o,i,a,u)=>i<e&&a>t||i>e&&a<t?0:i<=e&&u<=n||a>=t&&u>=n?i-e-r:a>t&&u<n||i<e&&u>n?a-t+o:0,wr=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},Br=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:u,inline:s,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!Dr(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,h=[];let p=e;for(;Dr(p)&&d(p);){if(p=wr(p),p===f){h.push(p);break}null!=p&&p===document.body&&yr(p)&&!yr(document.documentElement)||null!=p&&yr(p,c)&&h.push(p)}const v=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,g=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:D}=window,{height:b,width:y,top:C,right:w,bottom:B,left:E}=e.getBoundingClientRect(),{top:A,right:x,bottom:F,left:O}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let k="start"===u||"nearest"===u?C-A:"end"===u?B+F:C+b/2-A+F,S="center"===s?E+y/2-O+x:"end"===s?w+x:E-O;const j=[];for(let e=0;e<h.length;e++){const t=h[e],{height:n,width:r,top:o,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===a&&C>=0&&E>=0&&B<=g&&w<=v&&C>=o&&B<=l&&E>=c&&w<=i)return j;const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),A=parseInt(d.borderTopWidth,10),x=parseInt(d.borderRightWidth,10),F=parseInt(d.borderBottomWidth,10);let O=0,P=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-x:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-A-F:0,N="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,_="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)O="start"===u?k:"end"===u?k-g:"nearest"===u?Cr(D,D+g,g,A,F,D+k,D+k+b,b):k-g/2,P="start"===s?S:"center"===s?S-v/2:"end"===s?S-v:Cr(m,m+v,v,p,x,m+S,m+S+y,y),O=Math.max(0,O+D),P=Math.max(0,P+m);else{O="start"===u?k-o-A:"end"===u?k-l+F+T:"nearest"===u?Cr(o,l,n,A,F+T,k,k+b,b):k-(o+n/2)+T/2,P="start"===s?S-c-p:"center"===s?S-(c+r/2)+R/2:"end"===s?S-i+x+R:Cr(c,i,r,p,x+R,S,S+y,y);const{scrollLeft:e,scrollTop:a}=t;O=0===_?0:Math.max(0,Math.min(a+O/_,t.scrollHeight-n/_+T)),P=0===N?0:Math.max(0,Math.min(e+P/N,t.scrollWidth-r/N+R)),k+=a-O,S+=e-P}j.push({el:t,top:O,left:P})}return j};function Er(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(Br(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:a}of Br(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=a-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import*as n from"react";import r,{createContext as i,useContext as a,useRef as l,useLayoutEffect as c,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as y,createElement as g}from"react";import*as v from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as O,DefaultElement as E,withReact as C}from"slate-react";import{Editor as S,Transforms as _,Path as D,Range as R,Text as j,Element as B,Operation as A,createEditor as T,Point as M}from"slate";class L{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:o}=e,n=Object.assign(Object.assign({},this.plugin.options),o),r=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const o=r[e];o&&o.render&&(r[e].render=o=>t[e](o))})),new L(Object.assign(Object.assign({},this.plugin),{elements:r,options:n}))}}function N(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));return r?e.children[r]:null}const I={editor:{getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},P=i(I),F=({children:t,editorState:o})=>{const n=l(I);return n.current={editor:o.editor},e(P.Provider,Object.assign({value:n.current},{children:t}))},z=()=>{const e=a(P);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},H=e=>z().children[e],U=e=>z().blocks[e],V=e=>z().plugins[e],K=()=>z().readOnly,W=e=>{var t;return null===(t=V(e))||void 0===t?void 0:t.options},Y=({blockId:e,path:t})=>{var o;const n=z();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=n.children[e]),t&&(r=N(n,{at:t})),(null===(o=n.selection)||void 0===o?void 0:o[0])===(null==r?void 0:r.meta.order)};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}function r(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var l=new r(n,i||e,a),c=o?o+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],l]:e._events[c].push(l):(e._events[c]=l,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(o=!1)),l.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(o?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);r<i;r++)a[r]=n[r].fn;return a},l.prototype.listenerCount=function(e){var t=o?o+e:e,n=this._events[t];return n?n.fn?1:n.length:0},l.prototype.emit=function(e,t,n,r,i,a){var l=o?o+e:e;if(!this._events[l])return!1;var c,s,d=this._events[l],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,r),!0;case 5:return d.fn.call(d.context,t,n,r,i),!0;case 6:return d.fn.call(d.context,t,n,r,i,a),!0}for(s=1,c=new Array(u-1);s<u;s++)c[s-1]=arguments[s];d.fn.apply(d.context,c)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,n);break;case 4:d[s].fn.call(d[s].context,t,n,r);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];d[s].fn.apply(d[s].context,c)}}return!0},l.prototype.on=function(e,t,o){return i(this,e,t,o,!1)},l.prototype.once=function(e,t,o){return i(this,e,t,o,!0)},l.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var l=this._events[i];if(l.fn)l.fn!==t||r&&!l.once||n&&l.context!==n||a(this,i);else{for(var c=0,s=[],d=l.length;c<d;c++)(l[c].fn!==t||r&&!l[c].once||n&&l[c].context!==n)&&s.push(l[c]);s.length?this._events[i]=1===s.length?s[0]:s:a(this,i)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=o,l.EventEmitter=l,e.exports=l}({get exports(){return X},set exports(e){X=e}});var Z=X;function q(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?q():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function oe(e){return"nodeType"in e}function ne(e){var t,o;return e?te(e)?e:oe(e)&&null!=(t=null==(o=e.ownerDocument)?void 0:o.defaultView)?t:window:window}function re(e){const{Document:t}=ne(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof ne(e).HTMLElement}function ae(e){return e instanceof ne(e).SVGElement}function le(e){return e?te(e)?e.document:oe(e)?re(e)?e:ie(e)||ae(e)?e.ownerDocument:document:document:document}const ce=ee?c:s;function se(e){const t=l(e);return ce((()=>{t.current=e})),u((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}function de(e,t){void 0===t&&(t=[e]);const o=l(e);return ce((()=>{o.current!==e&&(o.current=e)}),t),o}function ue(e,t){const o=l();return d((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function fe(e){const t=se(e),o=l(null),n=u((e=>{e!==o.current&&(null==t||t(e,o.current)),o.current=e}),[]);return[o,n]}function pe(e){const t=l();return s((()=>{t.current=e}),[e]),t.current}let he={};function ye(e,t){return d((()=>{if(t)return t;const o=null==he[e]?0:he[e]+1;return he[e]=o,e+"-"+o}),[e,t])}function ge(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>{const n=Object.entries(o);for(const[o,r]of n){const n=t[o];null!=n&&(t[o]=n+e*r)}return t}),{...t})}}const ve=ge(1),me=ge(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=ne(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ne(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:o}=e.touches[0];return{x:t,y:o}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:o}=e.changedTouches[0];return{x:t,y:o}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const xe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:o}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:o}=e;return"scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:n}=e;return t+" "+o+"ms "+n}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oe(e){return e.matches(ke)?e:e.querySelector(ke)}const Ee={display:"none"};function Ce(e){let{id:t,value:o}=e;return r.createElement("div",{id:t,style:Ee},o)}function Se(e){let{id:t,announcement:o,ariaLiveType:n="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":n,"aria-atomic":!0},o)}const _e=i(null);const De={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Re={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was moved over droppable area "+o.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was dropped over droppable area "+o.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function je(e){let{announcements:t=Re,container:o,hiddenTextDescribedById:n,screenReaderInstructions:i=De}=e;const{announce:l,announcement:c}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ye("DndLiveRegion"),[h,y]=f(!1);if(s((()=>{y(!0)}),[]),function(e){const t=a(_e);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:o}=e;l(t.onDragStart({active:o}))},onDragMove(e){let{active:o,over:n}=e;t.onDragMove&&l(t.onDragMove({active:o,over:n}))},onDragOver(e){let{active:o,over:n}=e;l(t.onDragOver({active:o,over:n}))},onDragEnd(e){let{active:o,over:n}=e;l(t.onDragEnd({active:o,over:n}))},onDragCancel(e){let{active:o,over:n}=e;l(t.onDragCancel({active:o,over:n}))}})),[l,t])),!h)return null;const g=r.createElement(r.Fragment,null,r.createElement(Ce,{id:n,value:i.draggable}),r.createElement(Se,{id:p,announcement:c}));return o?b(g,o):g}var Be;function Ae(){}function Te(e,t){return d((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Be||(Be={}));const Me=Object.freeze({x:0,y:0});function Le(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ne(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return o-n}function Ie(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return n-o}function Pe(e){let{left:t,top:o,height:n,width:r}=e;return[{x:t,y:o},{x:t+r,y:o},{x:t,y:o+n},{x:t+r,y:o+n}]}function Fe(e,t){if(!e||0===e.length)return null;const[o]=e;return t?o[t]:o}function ze(e,t,o){return void 0===t&&(t=e.left),void 0===o&&(o=e.top),{x:t+.5*e.width,y:o+.5*e.height}}const He=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=ze(t,t.left,t.top),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Le(ze(n),r);i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(Ne)};function Ue(e,t){const o=Math.max(t.top,e.top),n=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-n,l=i-o;if(n<r&&o<i){const o=t.width*t.height,n=e.width*e.height,r=a*l;return Number((r/(o+n-r)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=[];for(const e of n){const{id:n}=e,i=o.get(n);if(i){const o=Ue(i,t);o>0&&r.push({id:n,data:{droppableContainer:e,value:o}})}}return r.sort(Ie)};function Ke(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Me}function We(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>({...t,top:t.top+e*o.y,bottom:t.bottom+e*o.y,left:t.left+e*o.x,right:t.right+e*o.x})),{...t})}}const Ye=We(1);const $e={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=$e);let o=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=ne(e).getComputedStyle(e);t&&(o=function(e,t,o){const n=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!n)return e;const{scaleX:r,scaleY:i,x:a,y:l}=n,c=e.left-a-(1-r)*parseFloat(o),s=e.top-l-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(o,t,n))}const{top:n,left:r,width:i,height:a,bottom:l,right:c}=o;return{top:n,left:r,width:i,height:a,bottom:l,right:c}}function Ze(e){return Xe(e,{ignoreTransform:!0})}function qe(e,t){const o=[];return e?function n(r){if(null!=t&&o.length>=t)return o;if(!r)return o;if(re(r)&&null!=r.scrollingElement&&!o.includes(r.scrollingElement))return o.push(r.scrollingElement),o;if(!ie(r)||ae(r))return o;if(o.includes(r))return o;const i=ne(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=ne(e).getComputedStyle(e));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const n=t[e];return"string"==typeof n&&o.test(n)}))}(r,i)&&o.push(r),function(e,t){return void 0===t&&(t=ne(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?o:n(r.parentNode)}(e):o}function Ge(e){const[t]=qe(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:oe(e)?re(e)||e===le(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var ot;function nt(e){return!(!ee||!e)&&e===document.scrollingElement}function rt(e){const t={x:0,y:0},o=nt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-o.width,y:e.scrollHeight-o.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ot||(ot={}));const it={x:.2,y:.2};function at(e,t,o,n,r){let{top:i,left:a,right:l,bottom:c}=o;void 0===n&&(n=10),void 0===r&&(r=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=rt(e),p={x:0,y:0},h={x:0,y:0},y=t.height*r.y,g=t.width*r.x;return!s&&i<=t.top+y?(p.y=ot.Backward,h.y=n*Math.abs((t.top+y-i)/y)):!d&&c>=t.bottom-y&&(p.y=ot.Forward,h.y=n*Math.abs((t.bottom-y-c)/y)),!f&&l>=t.right-g?(p.x=ot.Forward,h.x=n*Math.abs((t.right-g-l)/g)):!u&&a<=t.left+g&&(p.x=ot.Backward,h.x=n*Math.abs((t.left+g-a)/g)),{direction:p,speed:h}}function lt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:o,right:n,bottom:r}=e.getBoundingClientRect();return{top:t,left:o,right:n,bottom:r,width:e.clientWidth,height:e.clientHeight}}function ct(e){return e.reduce(((e,t)=>ve(e,tt(t))),Me)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=qe(t),n=ct(o);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(o),a=n[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,o){var n;null==(n=this.target)||n.addEventListener(e,t,o),this.listeners.push([e,t,o])}}function ft(e,t){const o=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(o**2+n**2)>t:"x"in t&&"y"in t?o>t.x&&n>t.y:"x"in t?o>t.x:"y"in t&&n>t.y}var pt,ht;function yt(e){e.preventDefault()}function gt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const vt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:o}=t;switch(e.code){case ht.Right:return{...o,x:o.x+25};case ht.Left:return{...o,x:o.x-25};case ht.Down:return{...o,y:o.y+25};case ht.Up:return{...o,y:o.y-25}}};class bt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ut(le(t)),this.windowListeners=new ut(ne(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,o=e.node.current;o&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:o,left:n,bottom:r,right:i}=t(e);Ge(e)&&(r<=0||i<=0||o>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(o),t(Me)}handleKeyDown(e){if(be(e)){const{active:t,context:o,options:n}=this.props,{keyboardCodes:r=vt,coordinateGetter:i=mt,scrollBehavior:a="smooth"}=n,{code:l}=e;if(r.end.includes(l))return void this.handleEnd(e);if(r.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=o.current,s=c?{x:c.left,y:c.top}:Me;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:o.current,currentCoordinates:s});if(d){const t=me(d,s),n={x:0,y:0},{scrollableAncestors:r}=o.current;for(const o of r){const r=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:f}=rt(o),p=lt(o),h={x:Math.min(r===ht.Right?p.right-p.width/2:p.right,Math.max(r===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(r===ht.Down?p.top:p.top+p.height/2,d.y))},y=r===ht.Right&&!l||r===ht.Left&&!c,g=r===ht.Down&&!s||r===ht.Up&&!i;if(y&&h.x!==d.x){const e=o.scrollLeft+t.x,i=r===ht.Right&&e<=u.x||r===ht.Left&&e>=f.x;if(i&&!t.y)return void o.scrollTo({left:e,behavior:a});n.x=i?o.scrollLeft-e:r===ht.Right?o.scrollLeft-u.x:o.scrollLeft-f.x,n.x&&o.scrollBy({left:-n.x,behavior:a});break}if(g&&h.y!==d.y){const e=o.scrollTop+t.y,i=r===ht.Down&&e<=u.y||r===ht.Up&&e>=f.y;if(i&&!t.x)return void o.scrollTo({top:e,behavior:a});n.y=i?o.scrollTop-e:r===ht.Down?o.scrollTop-u.y:o.scrollTop-f.y,n.y&&o.scrollBy({top:-n.y,behavior:a});break}}this.handleMove(e,ve(me(d,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:o}=this.props;e.preventDefault(),o(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,o)=>{let{keyboardCodes:n=vt,onActivation:r}=t,{active:i}=o;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,o){var n;void 0===o&&(o=function(e){const{EventTarget:t}=ne(e);return e instanceof t?e:le(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=le(i),this.documentListeners=new ut(this.document),this.listeners=new ut(o),this.windowListeners=new ut(ne(i)),this.initialCoordinates=null!=(n=we(r))?n:Me,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,yt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,yt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=o&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,gt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:o,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;const l=null!=(t=we(e))?t:Me,c=me(n,l);if(!o&&a){if(wt(a)){if(null!=a.tolerance&&ft(c,a.tolerance))return this.handleCancel();if(ft(c,a.distance))return this.handleStart()}return xt(a)&&ft(c,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ot={move:{name:"pointermove"},end:{name:"pointerup"}};class Et extends kt{constructor(e){const{event:t}=e,o=le(t.target);super(e,Ot,o)}}Et.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return!(!o.isPrimary||0!==o.button)&&(null==n||n({event:o}),!0)}}];const Ct={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Ct,le(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return o.button!==St.RightClick&&(null==n||n({event:o}),!0)}}];const _t={move:{name:"touchmove"},end:{name:"touchend"}};var Dt,Rt;function jt(e){let{acceleration:t,activator:o=Dt.Pointer,canScroll:n,draggingRect:r,enabled:i,interval:a=5,order:c=Rt.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:y,threshold:g}=e;const v=function(e){let{delta:t,disabled:o}=e;const n=pe(t);return ue((e=>{if(o||!n||!e)return Bt;const r={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:e.x[ot.Backward]||-1===r.x,[ot.Forward]:e.x[ot.Forward]||1===r.x},y:{[ot.Backward]:e.y[ot.Backward]||-1===r.y,[ot.Forward]:e.y[ot.Forward]||1===r.y}}}),[o,t,n])}({delta:y,disabled:!i}),[m,b]=function(){const e=l(null);return[u(((t,o)=>{e.current=setInterval(t,o)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=l({x:0,y:0}),x=l({x:0,y:0}),k=d((()=>{switch(o){case Dt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Dt.DraggableRect:return r}}),[o,r,f]),O=l(null),E=u((()=>{const e=O.current;if(!e)return;const t=w.current.x*x.current.x,o=w.current.y*x.current.y;e.scrollBy(t,o)}),[]),C=d((()=>c===Rt.TreeOrder?[...p].reverse():p),[c,p]);s((()=>{if(i&&p.length&&k){for(const e of C){if(!1===(null==n?void 0:n(e)))continue;const o=p.indexOf(e),r=h[o];if(!r)continue;const{direction:i,speed:l}=at(e,r,k,t,g);for(const e of["x","y"])v[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return b(),O.current=e,m(E,a),w.current=l,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,E,n,b,i,a,JSON.stringify(k),JSON.stringify(v),m,p,C,h,JSON.stringify(g)])}(class extends kt{constructor(e){super(e,_t)}static setup(){return window.addEventListener(_t.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(_t.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;const{touches:r}=o;return!(r.length>1)&&(null==n||n({event:o}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Dt||(Dt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Rt||(Rt={}));const Bt={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};var At,Tt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Tt||(Tt={}));const Mt=new Map;function Lt(e,t){return ue((o=>e?o||("function"==typeof t?t(e):e):null),[t,e])}function Nt(e){let{callback:t,disabled:o}=e;const n=se(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(n)}),[o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function It(e){return new dt(Xe(e),e)}function Pt(e,t,o){void 0===t&&(t=It);const[n,r]=h((function(n){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=n?n:o)?r:null;const i=t(e);if(JSON.stringify(n)===JSON.stringify(i))return n;return i}),null),i=function(e){let{callback:t,disabled:o}=e;const n=se(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(n)}),[n,o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const o of t){const{type:t,target:n}=o;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){r();break}}}}),a=Nt({callback:r});return ce((()=>{r(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),n}const Ft=[];function zt(e,t){void 0===t&&(t=[]);const o=l(null);return s((()=>{o.current=null}),t),s((()=>{const t=e!==Me;t&&!o.current&&(o.current=e),!t&&o.current&&(o.current=null)}),[e]),o.current?me(e,o.current):Me}function Ht(e){return d((()=>e?function(e){const t=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:t,bottom:o,width:t,height:o}}(e):null),[e])}const Ut=[];function Vt(e){let{measure:t}=e;const[o,n]=f(null),r=u((e=>{for(const{target:o}of e)if(ie(o)){n((e=>{const n=t(o);return e?{...e,width:n.width,height:n.height}:n}));break}}),[t]),i=Nt({callback:r}),a=u((e=>{const o=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),o&&(null==i||i.observe(o)),n(o?t(o):null)}),[t,i]),[l,c]=fe(a);return d((()=>({nodeRef:l,rect:o,setRef:c})),[o,l,c])}const Kt=[{sensor:Et,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Yt={draggable:{measure:Ze},droppable:{measure:Ze,strategy:At.WhileDragging,frequency:Tt.Optimized},dragOverlay:{measure:Xe}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,o;return null!=(t=null==(o=this.get(e))?void 0:o.node.current)?t:void 0}}const Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},Zt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),qt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Jt(e,t){switch(t.type){case Be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Be.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Be.DragEnd:case Be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Be.RegisterDroppable:{const{element:o}=t,{id:n}=o,r=new $t(e.droppable.containers);return r.set(n,o),{...e,droppable:{...e.droppable,containers:r}}}case Be.SetDroppableDisabled:{const{id:o,key:n,disabled:r}=t,i=e.droppable.containers.get(o);if(!i||n!==i.key)return e;const a=new $t(e.droppable.containers);return a.set(o,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case Be.UnregisterDroppable:{const{id:o,key:n}=t,r=e.droppable.containers.get(o);if(!r||n!==r.key)return e;const i=new $t(e.droppable.containers);return i.delete(o),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:o,activatorEvent:n,draggableNodes:r}=a(Zt),i=pe(n),l=pe(null==o?void 0:o.id);return s((()=>{if(!t&&!n&&i&&null!=l){if(!be(i))return;if(document.activeElement===i.target)return;const e=r.get(l);if(!e)return;const{activatorNode:t,node:o}=e;if(!t.current&&!o.current)return;requestAnimationFrame((()=>{for(const e of[t.current,o.current]){if(!e)continue;const t=Oe(e);if(t){t.focus();break}}}))}}),[n,t,r,l,i]),null}const eo=i({...Me,scaleX:1,scaleY:1});var to;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(to||(to={}));const oo=p((function(e){var t,o,n,i;let{id:a,accessibility:c,autoScroll:p=!0,children:y,sensors:g=Kt,collisionDetection:v=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[O,E]=k,[C,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:o,event:n}=t;e.forEach((e=>{var t;return null==(t=e[o])?void 0:t.call(e,n)}))}),[e]),t]}(),[_,D]=f(to.Uninitialized),R=_===to.Initialized,{draggable:{active:j,nodes:B,translate:A},droppable:{containers:T}}=O,M=j?B.get(j):null,L=l({initial:null,translated:null}),N=d((()=>{var e;return null!=j?{id:j,data:null!=(e=null==M?void 0:M.data)?e:Wt,rect:L}:null}),[j,M]),I=l(null),[P,F]=f(null),[z,H]=f(null),U=de(x,Object.values(x)),V=ye("DndDescribedBy",a),K=d((()=>T.getEnabled()),[T]),W=d((()=>({draggable:{...Yt.draggable,...null==Y?void 0:Y.draggable},droppable:{...Yt.droppable,...null==Y?void 0:Y.droppable},dragOverlay:{...Yt.dragOverlay,...null==Y?void 0:Y.dragOverlay}})),[null==(Y=b)?void 0:Y.draggable,null==Y?void 0:Y.droppable,null==Y?void 0:Y.dragOverlay]);var Y;const{droppableRects:$,measureDroppableContainers:X,measuringScheduled:Z}=function(e,t){let{dragging:o,dependencies:n,config:r}=t;const[i,a]=f(null),{frequency:c,measure:d,strategy:p}=r,h=l(e),y=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return o;default:return!o}}(),g=de(y),v=u((function(e){void 0===e&&(e=[]),g.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),m=l(null),b=ue((t=>{if(y&&!o)return Mt;if(!t||t===Mt||h.current!==e||null!=i){const t=new Map;for(let o of e){if(!o)continue;if(i&&i.length>0&&!i.includes(o.id)&&o.rect.current){t.set(o.id,o.rect.current);continue}const e=o.node.current,n=e?new dt(d(e),e):null;o.rect.current=n,n&&t.set(o.id,n)}return t}return t}),[e,i,o,y,d]);return s((()=>{h.current=e}),[e]),s((()=>{y||v()}),[o,y]),s((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),s((()=>{y||"number"!=typeof c||null!==m.current||(m.current=setTimeout((()=>{v(),m.current=null}),c))}),[c,y,v,...n]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:null!=i}}(K,{dragging:R,dependencies:[A.x,A.y],config:W.droppable}),q=function(e,t){const o=null!==t?e.get(t):void 0,n=o?o.node.current:null;return ue((e=>{var o;return null===t?null:null!=(o=null!=n?n:e)?o:null}),[n,t])}(B,j),G=d((()=>z?we(z):null),[z]),J=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,o=R&&!e&&!t;if("object"==typeof p)return{...p,enabled:o};return{enabled:o}}(),Q=function(e,t){return Lt(e,t)}(q,W.draggable.measure);!function(e){let{activeNode:t,measure:o,initialRect:n,config:r=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof r?{x:r,y:r}:r;ce((()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!n)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Ke(o(e),n);if(a||(r.x=0),c||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ge(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,a,c,n,o])}({activeNode:j?B.get(j):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=Pt(q,W.draggable.measure,Q),oe=Pt(q?q.parentElement:null),re=l({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=T.getNodeFor(null==(t=re.current.over)?void 0:t.id),ae=Vt({measure:W.dragOverlay.measure}),le=null!=(o=ae.nodeRef.current)?o:q,se=R?null!=(n=ae.rect)?n:te:null,fe=Boolean(ae.nodeRef.current&&ae.rect),pe=Ke(he=fe?null:te,Lt(he));var he;const ge=Ht(le?ne(le):null),me=function(e){const t=l(e),o=ue((o=>e?o&&o!==Ft&&e&&t.current&&e.parentNode===t.current.parentNode?o:qe(e):Ft),[e]);return s((()=>{t.current=e}),[e]),o}(R?null!=ie?ie:q:null),be=function(e,t){void 0===t&&(t=Xe);const[o]=e,n=Ht(o?ne(o):null),[r,i]=h((function(){return e.length?e.map((e=>nt(e)?n:new dt(t(e),e))):Ut}),Ut),a=Nt({callback:i});return e.length>0&&r===Ut&&i(),ce((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),r}(me),xe=function(e,t){let{transform:o,...n}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...n})),o):o}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:z,active:N,activeNodeRect:te,containerNodeRect:oe,draggingNodeRect:se,over:re.current.over,overlayNodeRect:ae.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ge}),ke=G?ve(G,A):null,Oe=function(e){const[t,o]=f(null),n=l(e),r=u((e=>{const t=Je(e.target);t&&o((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=n.current;if(e!==t){i(t);const a=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));o(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ve(e,t)),Me):ct(e):Me),[e,t])}(me),Ee=zt(Oe),Ce=zt(Oe,[te]),Se=ve(xe,Ee),De=se?Ye(se,xe):null,Re=N&&De?v({active:N,collisionRect:De,droppableRects:$,droppableContainers:K,pointerCoordinates:ke}):null,Ae=Fe(Re,"id"),[Te,Le]=f(null),Ne=function(e,t,o){return{...e,scaleX:t&&o?t.width/o.width:1,scaleY:t&&o?t.height/o.height:1}}(fe?xe:ve(xe,Ce),null!=(i=null==Te?void 0:Te.rect)?i:null,te),Ie=u(((e,t)=>{let{sensor:o,options:n}=t;if(null==I.current)return;const r=B.get(I.current);if(!r)return;const i=e.nativeEvent,a=new o({active:I.current,activeNode:r,event:i,options:n,context:re,onStart(e){const t=I.current;if(null==t)return;const o=B.get(t);if(!o)return;const{onDragStart:n}=U.current,r={active:{id:t,data:o.data,rect:L}};m((()=>{null==n||n(r),D(to.Initializing),E({type:Be.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:r})}))},onMove(e){E({type:Be.DragMove,coordinates:e})},onEnd:l(Be.DragEnd),onCancel:l(Be.DragCancel)});function l(e){return async function(){const{active:t,collisions:o,over:n,scrollAdjustedTranslate:r}=re.current;let a=null;if(t&&r){const{cancelDrop:l}=U.current;if(a={activatorEvent:i,active:t,collisions:o,delta:r,over:n},e===Be.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=Be.DragCancel)}}I.current=null,m((()=>{E({type:e}),D(to.Uninitialized),Le(null),F(null),H(null);const t=e===Be.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=U.current[t];null==e||e(a),C({type:t,event:a})}}))}}m((()=>{F(a),H(e.nativeEvent)}))}),[B]),Pe=u(((e,t)=>(o,n)=>{const r=o.nativeEvent,i=B.get(n);if(null!==I.current||!i||r.dndKit||r.defaultPrevented)return;const a={active:i};!0===e(o,t.options,a)&&(r.dndKit={capturedBy:t.sensor},I.current=n,Ie(o,t))}),[B,Ie]),ze=function(e,t){return d((()=>e.reduce(((e,o)=>{const{sensor:n}=o;return[...e,...n.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,o)})))]}),[])),[e,t])}(g,Pe);!function(e){s((()=>{if(!ee)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(g),ce((()=>{te&&_===to.Initializing&&D(to.Initialized)}),[te,_]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:o,collisions:n,over:r}=re.current;if(!t||!o)return;const i={active:t,activatorEvent:o,collisions:n,delta:{x:Se.x,y:Se.y},over:r};m((()=>{null==e||e(i),C({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:o,droppableContainers:n,scrollAdjustedTranslate:r}=re.current;if(!e||null==I.current||!t||!r)return;const{onDragOver:i}=U.current,a=n.get(Ae),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:o,delta:{x:r.x,y:r.y},over:l};m((()=>{Le(l),null==i||i(c),C({type:"onDragOver",event:c})}))}),[Ae]),ce((()=>{re.current={activatorEvent:z,active:N,activeNode:q,collisionRect:De,collisions:Re,droppableRects:$,draggableNodes:B,draggingNode:le,draggingNodeRect:se,droppableContainers:T,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:Se},L.current={initial:se,translated:De}}),[N,q,Re,De,B,le,se,$,T,Te,me,Se]),jt({...J,delta:A,draggingRect:De,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:N,activeNode:q,activeNodeRect:te,activatorEvent:z,collisions:Re,containerNodeRect:oe,dragOverlay:ae,draggableNodes:B,droppableContainers:T,droppableRects:$,over:Te,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:Z,windowRect:ge})),[N,q,te,z,Re,oe,ae,B,T,$,Te,X,me,be,W,Z,ge]),Ue=d((()=>({activatorEvent:z,activators:ze,active:N,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:E,draggableNodes:B,over:Te,measureDroppableContainers:X})),[z,ze,N,te,E,V,B,Te,X]);return r.createElement(_e.Provider,{value:S},r.createElement(Zt.Provider,{value:Ue},r.createElement(qt.Provider,{value:He},r.createElement(eo.Provider,{value:Ne},y)),r.createElement(Qt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),r.createElement(je,{...c,hiddenTextDescribedById:V}))})),no=i(null),ro="button",io="Droppable";function ao(e){let{id:t,data:o,disabled:n=!1,attributes:r}=e;const i=ye(io),{activators:l,activatorEvent:c,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=a(Zt),{role:y=ro,roleDescription:g="draggable",tabIndex:v=0}=null!=r?r:{},m=(null==s?void 0:s.id)===t,b=a(m?eo:no),[w,x]=fe(),[k,O]=fe(),E=function(e,t){return d((()=>e.reduce(((e,o)=>{let{eventName:n,handler:r}=o;return e[n]=e=>{r(e,t)},e}),{})),[e,t])}(l,t),C=de(o);ce((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:C}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:c,activeNodeRect:u,attributes:d((()=>({role:y,tabIndex:v,"aria-disabled":n,"aria-pressed":!(!m||y!==ro)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[n,y,v,m,g,f.draggable]),isDragging:m,listeners:n?void 0:E,node:w,over:h,setNodeRef:x,setActivatorNodeRef:O,transform:b}}const lo="Droppable",co={timeout:25};function so(e,t,o){const n=e.slice();return n.splice(o<0?n.length+o:o,0,n.splice(t,1)[0]),n}function uo(e,t){return e.reduce(((e,o,n)=>{const r=t.get(o);return r&&(e[n]=r),e}),Array(e.length))}function fo(e){return null!==e&&e>=0}const po=e=>{let{rects:t,activeIndex:o,overIndex:n,index:r}=e;const i=so(t,n,o),a=t[r],l=i[r];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},ho={scaleX:1,scaleY:1},yo=e=>{var t;let{activeIndex:o,activeNodeRect:n,index:r,rects:i,overIndex:a}=e;const l=null!=(t=i[o])?t:n;if(!l)return null;if(r===o){const e=i[a];return e?{x:0,y:o<a?e.top+e.height-(l.top+l.height):e.top-l.top,...ho}:null}const c=function(e,t,o){const n=e[t],r=e[t-1],i=e[t+1];if(!n)return 0;if(o<t)return r?n.top-(r.top+r.height):i?i.top-(n.top+n.height):0;return i?i.top-(n.top+n.height):r?n.top-(r.top+r.height):0}(i,r,o);return r>o&&r<=a?{x:0,y:-l.height-c,...ho}:r<o&&r>=a?{x:0,y:l.height+c,...ho}:{x:0,y:0,...ho}};const go="Sortable",vo=r.createContext({activeIndex:-1,containerId:go,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:po,disabled:{draggable:!1,droppable:!1}});function mo(e){let{children:t,id:o,items:n,strategy:i=po,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:y}=a(qt),g=ye(go,o),v=Boolean(null!==f.rect),m=d((()=>n.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[n]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=l(m),O=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}(m,k.current),E=-1!==x&&-1===w||O,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);ce((()=>{O&&b&&y(m)}),[O,m,b,y]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:g,disabled:C,disableTransforms:E,items:m,overIndex:x,useDragOverlay:v,sortedRects:uo(m,p),strategy:i})),[w,g,C.draggable,C.droppable,E,m,x,p,v,i]);return r.createElement(vo.Provider,{value:S},t)}const bo=e=>{let{id:t,items:o,activeIndex:n,overIndex:r}=e;return so(o,n,r).indexOf(t)},wo=e=>{let{containerId:t,isSorting:o,wasDragging:n,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!n)&&((l===i||r!==a)&&(!!o||a!==r&&t===c))},xo={duration:200,easing:"ease"},ko="transform",Oo=xe.Transition.toString({property:ko,duration:0,easing:"linear"}),Eo={roleDescription:"sortable"};function Co(e){let{animateLayoutChanges:t=wo,attributes:o,disabled:n,data:r,getNewIndex:i=bo,id:c,strategy:p,resizeObserverConfig:h,transition:y=xo}=e;const{items:g,containerId:v,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:O,strategy:E}=a(vo),C=function(e,t){var o,n;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(o=null==e?void 0:e.draggable)?o:t.draggable,droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(n,b),S=g.indexOf(c),_=d((()=>({sortable:{containerId:v,index:S,items:g},...r})),[v,r,S,g]),D=d((()=>g.slice(g.indexOf(c))),[g,c]),{rect:R,node:j,isOver:B,setNodeRef:A}=function(e){let{data:t,disabled:o=!1,id:n,resizeObserverConfig:r}=e;const i=ye(lo),{active:c,dispatch:d,over:f,measureDroppableContainers:p}=a(Zt),h=l({disabled:o}),y=l(!1),g=l(null),v=l(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...co,...r},x=de(null!=b?b:n),k=Nt({callback:u((()=>{y.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),w)):y.current=!0}),[w]),disabled:m||!c}),O=u(((e,t)=>{k&&(t&&(k.unobserve(t),y.current=!1),e&&k.observe(e))}),[k]),[E,C]=fe(O),S=de(t);return s((()=>{k&&E.current&&(k.disconnect(),y.current=!1,k.observe(E.current))}),[E,k]),ce((()=>(d({type:Be.RegisterDroppable,element:{id:n,key:i,disabled:o,node:E,rect:g,data:S}}),()=>d({type:Be.UnregisterDroppable,key:i,id:n}))),[n]),s((()=>{o!==h.current.disabled&&(d({type:Be.SetDroppableDisabled,id:n,key:i,disabled:o}),h.current.disabled=o)}),[n,i,o,d]),{active:c,rect:g,isOver:(null==f?void 0:f.id)===n,node:E,over:f,setNodeRef:C}}({id:c,data:_,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...h}}),{active:T,activatorEvent:M,activeNodeRect:L,attributes:N,setNodeRef:I,listeners:P,isDragging:F,over:z,setActivatorNodeRef:H,transform:U}=ao({id:c,data:_,attributes:{...Eo,...o},disabled:C.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,I),K=Boolean(T),W=K&&!w&&fo(m)&&fo(k),Y=!O&&F,$=Y&&W?U:null,X=W?null!=$?$:(null!=p?p:E)({rects:x,activeNodeRect:L,activeIndex:m,overIndex:k,index:S}):null,Z=fo(m)&&fo(k)?i({id:c,items:g,activeIndex:m,overIndex:k}):S,q=null==T?void 0:T.id,G=l({activeId:q,items:g,newIndex:Z,containerId:v}),J=g!==G.current.items,Q=t({active:T,containerId:v,isDragging:F,isSorting:K,id:c,index:S,items:g,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:y,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:o,node:n,rect:r}=e;const[i,a]=f(null),c=l(o);return ce((()=>{if(!t&&o!==c.current&&n.current){const e=r.current;if(e){const t=Xe(n.current,{ignoreTransform:!0}),o={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(o.x||o.y)&&a(o)}}o!==c.current&&(c.current=o)}),[t,o,n,r]),s((()=>{i&&a(null)}),[i]),i}({disabled:!Q,index:S,node:j,rect:R});return s((()=>{K&&G.current.newIndex!==Z&&(G.current.newIndex=Z),v!==G.current.containerId&&(G.current.containerId=v),g!==G.current.items&&(G.current.items=g)}),[K,Z,v,g]),s((()=>{if(q===G.current.activeId)return;if(q&&!G.current.activeId)return void(G.current.activeId=q);const e=setTimeout((()=>{G.current.activeId=q}),50);return()=>clearTimeout(e)}),[q]),{active:T,activeIndex:m,attributes:N,data:_,rect:R,index:S,newIndex:Z,items:g,isOver:B,isSorting:K,isDragging:F,listeners:P,node:j,overIndex:k,over:z,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:I,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return Oo;if(Y&&!be(M)||!y)return;if(K||Q)return xe.Transition.toString({...y,property:ko});return}()}}function So(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _o=[ht.Down,ht.Right,ht.Up,ht.Left],Do=(e,t)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(_o.includes(e.code)){if(e.preventDefault(),!o||!n)return;const t=[];i.getEnabled().forEach((o=>{if(!o||null!=o&&o.disabled)return;const i=r.get(o.id);if(i)switch(e.code){case ht.Down:n.top<i.top&&t.push(o);break;case ht.Up:n.top>i.top&&t.push(o);break;case ht.Left:n.left>i.left&&t.push(o);break;case ht.Right:n.left<i.left&&t.push(o)}}));const c=(e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=Pe(t),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Pe(n),a=r.reduce(((e,t,n)=>e+Le(o[n],t)),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(Ne)})({active:o,collisionRect:n,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let s=Fe(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(o.id),t=i.get(s),a=t?r.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const o=qe(c).some(((e,t)=>l[t]!==e)),r=Ro(e,t),i=function(e,t){if(!So(e)||!So(t))return!1;if(!Ro(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=o||!r?{x:0,y:0}:{x:i?n.width-a.width:0,y:i?n.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:me(d,s)}}}};function Ro(e,t){return!(!So(e)||!So(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var jo;function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Bo.apply(this,arguments)}var Ao,To=function(e){return n.createElement("svg",Bo({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),jo||(jo=n.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Mo.apply(this,arguments)}var Lo=function(e){return n.createElement("svg",Mo({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Ao||(Ao=n.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function No(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));if(r)return e.blockEditorsMap[r]}function Io(e){return zo(e)?(e.nodeName||"").toLowerCase():"#document"}function Po(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fo(e){var t;return null==(t=(zo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function zo(e){return e instanceof Node||e instanceof Po(e).Node}function Ho(e){return e instanceof Element||e instanceof Po(e).Element}function Uo(e){return e instanceof HTMLElement||e instanceof Po(e).HTMLElement}function Vo(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Po(e).ShadowRoot)}function Ko(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function Wo(e){return["table","td","th"].includes(Io(e))}function Yo(e){const t=$o(),o=Zo(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function $o(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xo(e){return["html","body","#document"].includes(Io(e))}function Zo(e){return Po(e).getComputedStyle(e)}function qo(e){return Ho(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Go(e){if("html"===Io(e))return e;const t=e.assignedSlot||e.parentNode||Vo(e)&&e.host||Fo(e);return Vo(t)?t.host:t}function Jo(e){const t=Go(e);return Xo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&Ko(t)?t:Jo(t)}function Qo(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const r=Jo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Po(r);return i?t.concat(a,a.visualViewport||[],Ko(r)?r:[],a.frameElement&&o?Qo(a.frameElement):[]):t.concat(r,Qo(r,[],o))}const en=Math.min,tn=Math.max,on=Math.round,nn=Math.floor,rn=e=>({x:e,y:e}),an={left:"right",right:"left",bottom:"top",top:"bottom"},ln={start:"end",end:"start"};function cn(e,t,o){return tn(e,en(t,o))}function sn(e,t){return"function"==typeof e?e(t):e}function dn(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function fn(e){return"x"===e?"y":"x"}function pn(e){return"y"===e?"height":"width"}function hn(e){return["top","bottom"].includes(dn(e))?"y":"x"}function yn(e){return fn(hn(e))}function gn(e){return e.replace(/start|end/g,(e=>ln[e]))}function vn(e){return e.replace(/left|right|bottom|top/g,(e=>an[e]))}function mn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function wn(e,t,o){let{reference:n,floating:r}=e;const i=hn(t),a=yn(t),l=pn(a),c=dn(t),s="y"===i,d=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2,f=n[l]/2-r[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-r.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-r.width,y:u};break;default:p={x:n.x,y:n.y}}switch(un(t)){case"start":p[a]-=f*(o&&s?-1:1);break;case"end":p[a]+=f*(o&&s?-1:1)}return p}async function xn(e,t){var o;void 0===t&&(t={});const{x:n,y:r,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=sn(t,e),h=mn(p),y=l[f?"floating"===u?"reference":"floating":u],g=bn(await i.getClippingRect({element:null==(o=await(null==i.isElement?void 0:i.isElement(y)))||o?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:c})),v="floating"===u?{...a.floating,x:n,y:r}:a.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(m))&&await(null==i.getScale?void 0:i.getScale(m))||{x:1,y:1},w=bn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:m,strategy:c}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function kn(e){const t=en(...e.map((e=>e.left))),o=en(...e.map((e=>e.top)));return{x:t,y:o,width:tn(...e.map((e=>e.right)))-t,height:tn(...e.map((e=>e.bottom)))-o}}const On=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:r,y:i,placement:a,middlewareData:l}=t,c=await async function(e,t){const{placement:o,platform:n,elements:r}=e,i=await(null==n.isRTL?void 0:n.isRTL(r.floating)),a=dn(o),l=un(o),c="y"===hn(o),s=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,u=sn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),c?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return a===(null==(o=l.offset)?void 0:o.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}};function En(e){const t=Zo(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=Uo(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,l=on(o)!==i||on(n)!==a;return l&&(o=i,n=a),{width:o,height:n,$:l}}function Cn(e){return Ho(e)?e:e.contextElement}function Sn(e){const t=Cn(e);if(!Uo(t))return rn(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:i}=En(t);let a=(i?on(o.width):o.width)/n,l=(i?on(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const _n=rn(0);function Dn(e){const t=Po(e);return $o()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_n}function Rn(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),i=Cn(e);let a=rn(1);t&&(n?Ho(n)&&(a=Sn(n)):a=Sn(e));const l=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==Po(e))&&t}(i,o,n)?Dn(i):rn(0);let c=(r.left+l.x)/a.x,s=(r.top+l.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(i){const e=Po(i),t=n&&Ho(n)?Po(n):n;let o=e,r=o.frameElement;for(;r&&n&&t!==o;){const e=Sn(r),t=r.getBoundingClientRect(),n=Zo(r),i=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,u*=e.y,c+=i,s+=a,o=Po(r),r=o.frameElement}}return bn({width:d,height:u,x:c,y:s})}const jn=[":popover-open",":modal"];function Bn(e){return jn.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function An(e){return Rn(Fo(e)).left+qo(e).scrollLeft}function Tn(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=Po(e),n=Fo(e),r=o.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(r){i=r.width,a=r.height;const e=$o();(!e||e&&"fixed"===t)&&(l=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:l,y:c}}(e,o);else if("document"===t)n=function(e){const t=Fo(e),o=qo(e),n=e.ownerDocument.body,r=tn(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=tn(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+An(e);const l=-o.scrollTop;return"rtl"===Zo(n).direction&&(a+=tn(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:l}}(Fo(e));else if(Ho(t))n=function(e,t){const o=Rn(e,!0,"fixed"===t),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=Uo(e)?Sn(e):rn(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:n*i.y}}(t,o);else{const o=Dn(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return bn(n)}function Mn(e,t){const o=Go(e);return!(o===t||!Ho(o)||Xo(o))&&("fixed"===Zo(o).position||Mn(o,t))}function Ln(e,t,o){const n=Uo(t),r=Fo(t),i="fixed"===o,a=Rn(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=rn(0);if(n||!n&&!i)if(("body"!==Io(t)||Ko(r))&&(l=qo(t)),n){const e=Rn(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&(c.x=An(r));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Nn(e,t){return Uo(e)&&"fixed"!==Zo(e).position?t?t(e):e.offsetParent:null}function In(e,t){const o=Po(e);if(!Uo(e)||Bn(e))return o;let n=Nn(e,t);for(;n&&Wo(n)&&"static"===Zo(n).position;)n=Nn(n,t);return n&&("html"===Io(n)||"body"===Io(n)&&"static"===Zo(n).position&&!Yo(n))?o:n||function(e){let t=Go(e);for(;Uo(t)&&!Xo(t);){if(Yo(t))return t;t=Go(t)}return null}(e)||o}const Pn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const i="fixed"===r,a=Fo(n),l=!!t&&Bn(t.floating);if(n===a||l&&i)return o;let c={scrollLeft:0,scrollTop:0},s=rn(1);const d=rn(0),u=Uo(n);if((u||!u&&!i)&&(("body"!==Io(n)||Ko(a))&&(c=qo(n)),Uo(n))){const e=Rn(n);s=Sn(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-c.scrollLeft*s.x+d.x,y:o.y*s.y-c.scrollTop*s.y+d.y}},getDocumentElement:Fo,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const i=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=Qo(e,[],!1).filter((e=>Ho(e)&&"body"!==Io(e))),r=null;const i="fixed"===Zo(e).position;let a=i?Go(e):e;for(;Ho(a)&&!Xo(a);){const t=Zo(a),o=Yo(a);o||"fixed"!==t.position||(r=null),(i?!o&&!r:!o&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Ko(a)&&!o&&Mn(e,a))?n=n.filter((e=>e!==a)):r=t,a=Go(a)}return t.set(e,n),n}(t,this._c):[].concat(o),n],a=i[0],l=i.reduce(((e,o)=>{const n=Tn(t,o,r);return e.top=tn(n.top,e.top),e.right=en(n.right,e.right),e.bottom=en(n.bottom,e.bottom),e.left=tn(n.left,e.left),e}),Tn(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:In,getElementRects:async function(e){const t=this.getOffsetParent||In,o=this.getDimensions;return{reference:Ln(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=En(e);return{width:t,height:o}},getScale:Sn,isElement:Ho,isRTL:function(e){return"rtl"===Zo(e).direction}};function Fn(e,t,o,n){void 0===n&&(n={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,s=Cn(e),d=r||i?[...s?Qo(s):[],...Qo(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",o,{passive:!0}),i&&e.addEventListener("resize",o)}));const u=s&&l?function(e,t){let o,n=null;const r=Fo(e);function i(){var e;clearTimeout(o),null==(e=n)||e.disconnect(),n=null}return function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(l||t(),!u||!f)return;const p={rootMargin:-nn(d)+"px "+-nn(r.clientWidth-(s+u))+"px "+-nn(r.clientHeight-(d+f))+"px "+-nn(s)+"px",threshold:tn(0,en(1,c))||1};let h=!0;function y(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return a();t?a(!1,t):o=setTimeout((()=>{a(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(y,{...p,root:r.ownerDocument})}catch(e){n=new IntersectionObserver(y,p)}n.observe(e)}(!0),i}(s,o):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),o()})),s&&!c&&h.observe(s),h.observe(t));let y=c?Rn(e):null;return c&&function t(){const n=Rn(e);!y||n.x===y.x&&n.y===y.y&&n.width===y.width&&n.height===y.height||o();y=n,f=requestAnimationFrame(t)}(),o(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",o),i&&e.removeEventListener("resize",o)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(f)}}const zn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...c}=sn(e,t),s={x:o,y:n},d=await xn(t,c),u=hn(dn(r)),f=fn(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=cn(p+d["y"===f?"top":"left"],p,p-d[e])}if(a){const e="y"===u?"bottom":"right";h=cn(h+d["y"===u?"top":"left"],h,h-d[e])}const y=l.fn({...t,[f]:p,[u]:h});return{...y,data:{x:y.x-o,y:y.y-n}}}}},Hn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=sn(e,t);if(null!=(o=i.arrow)&&o.alignmentOffset)return{};const v=dn(r),m=dn(l)===l,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),w=f||(m||!y?[vn(l)]:function(e){const t=vn(e);return[gn(e),t,gn(t)]}(l));f||"none"===h||w.push(...function(e,t,o,n){const r=un(e);let i=function(e,t,o){const n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}(dn(e),"start"===o,n);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(gn)))),i}(l,y,h,b));const x=[l,...w],k=await xn(t,g),O=[];let E=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&O.push(k[v]),u){const e=function(e,t,o){void 0===o&&(o=!1);const n=un(e),r=yn(e),i=pn(r);let a="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=vn(a)),[a,vn(a)]}(r,a,b);O.push(k[e[0]],k[e[1]])}if(E=[...E,{placement:r,overflows:O}],!O.every((e=>e<=0))){var C,S;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let o=null==(S=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!o)switch(p){case"bestFit":{var _;const e=null==(_=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(o=e);break}case"initialPlacement":o=l}if(r!==o)return{reset:{placement:o}}}return{}}}},Un=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:r,platform:i,strategy:a}=t,{padding:l=2,x:c,y:s}=sn(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(n.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let n=null;for(let e=0;e<t.length;e++){const r=t[e];!n||r.y-n.y>n.height/2?o.push([r]):o[o.length-1].push(r),n=r}return o.map((e=>bn(kn(e))))}(d),f=bn(kn(d)),p=mn(l);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=s)return u.find((e=>c>e.left-p.left&&c<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===hn(o)){const e=u[0],t=u[u.length-1],n="top"===dn(o),r=e.top,i=t.bottom,a=n?e.left:t.left,l=n?e.right:t.right;return{top:r,bottom:i,left:a,right:l,width:l-a,height:i-r,x:a,y:r}}const e="left"===dn(o),t=tn(...u.map((e=>e.right))),n=en(...u.map((e=>e.left))),r=u.filter((o=>e?o.left===n:o.right===t)),i=r[0].top,a=r[r.length-1].bottom;return{top:i,bottom:a,left:n,right:t,width:t-n,height:a-i,x:n,y:i}}return f}},floating:n.floating,strategy:a});return r.reference.x!==h.reference.x||r.reference.y!==h.reference.y||r.reference.width!==h.reference.width||r.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Vn=(e,t,o)=>{const n=new Map,r={platform:Pn,...o},i={...r.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,l=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let s=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=wn(s,n,c),f=n,p={},h=0;for(let o=0;o<l.length;o++){const{name:i,fn:y}=l[o],{x:g,y:v,data:m,reset:b}=await y({x:d,y:u,initialPlacement:n,placement:f,strategy:r,middlewareData:p,rects:s,platform:a,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=wn(s,f,c))),o=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var Kn="undefined"!=typeof document?c:s;function Wn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,n,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;0!=n--;)if(!Wn(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),o=r.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=o;0!=n--;){const o=r[n];if(("_owner"!==o||!e.$$typeof)&&!Wn(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Yn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $n(e,t){const o=Yn(e);return Math.round(t*o)/o}function Xn(e){const t=n.useRef(e);return Kn((()=>{t.current=e})),t}
|
|
2
|
+
/*!
|
|
3
|
+
* tabbable 6.2.0
|
|
4
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
+
*/
|
|
6
|
+
var Zn=["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(","),qn="undefined"==typeof Element,Gn=qn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Jn=!qn&&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},Qn=function e(t,o){var n;void 0===o&&(o=!0);var r=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===r||"true"===r||o&&t&&e(t.parentNode)},er=function e(t,o,n){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Qn(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{Gn.call(a,Zn)&&n.filter(a)&&(o||!t.includes(a))&&r.push(a);var s=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),d=!Qn(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(s&&d){var u=e(!0===s?a.children:s.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},tr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},or=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!tr(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},rr=function(e){return"INPUT"===e.tagName},ir=function(e){return function(e){return rr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||Jn(e),n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!r||r===e}(e)},ar=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},lr=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Gn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Gn.call(r,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return ar(e)}else{if("function"==typeof n){for(var i=e;e;){var a=e.parentElement,l=Jn(e);if(a&&!a.shadowRoot&&!0===n(a))return ar(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,o,n,r,i=e&&Jn(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(o=a)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&a;){var c,s,d;l=!(null===(s=a=null===(c=i=Jn(a))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},cr=function(e,t){return!(t.disabled||Qn(t)||function(e){return rr(e)&&"hidden"===e.type}(t)||lr(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!!Gn.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},sr=function(e,t){return!(ir(t)||or(t)<0||!cr(e,t))},dr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ur=function e(t){var o=[],n=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var o=or(e);return o<0&&t&&!tr(e)?0:o}(a,i),c=i?e(t.candidates):a;0===l?i?o.push.apply(o,c):o.push(a):n.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:c})})),n.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},fr=function(e,t){var o;return o=(t=t||{}).getShadowRoot?er([e],t.includeContainer,{filter:sr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dr}):function(e,t,o){if(Qn(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Zn));return t&&Gn.call(e,Zn)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,sr.bind(null,t)),ur(o)};const pr=n["useInsertionEffect".toString()]||(e=>e());var hr="undefined"!=typeof document?c:s;function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},yr.apply(this,arguments)}let gr=!1,vr=0;const mr=()=>"floating-ui-"+vr++;const br=n["useId".toString()]||function(){const[e,t]=n.useState((()=>gr?mr():void 0));return hr((()=>{null==e&&t(mr())}),[]),n.useEffect((()=>{gr||(gr=!0)}),[]),e};const wr=n.createContext(null),xr=n.createContext(null);function kr(e){return"data-floating-ui-"+e}function Or(e){const t=l(e);return hr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const o=fr(e,Er());"prev"===t&&o.reverse();const n=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return o.slice(n+1)[0]}function Sr(e,t){const o=t||e.currentTarget,n=e.relatedTarget;return!n||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&Vo(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function _r(e){fr(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Rr={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 jr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Br=n.forwardRef((function(e,t){const[o,r]=n.useState();hr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",jr),()=>{document.removeEventListener("keydown",jr)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[kr("focus-guard")]:"",style:Rr};return n.createElement("span",yr({},e,i))})),Ar=n.createContext(null),Tr=kr("portal");function Mr(e){let{children:t,id:o,root:r=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:o}=void 0===e?{}:e;const[r,i]=n.useState(null),a=br(),l=Lr(),c=n.useRef(null);return hr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{c.current=null}))}),[r]),hr((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=a,o.setAttribute(Tr,""),e.appendChild(o),c.current=o,i(o)}),[t,a]),hr((()=>{if(c.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!Ho(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const r=document.createElement("div");r.id=a,r.setAttribute(Tr,""),e=n||e,e.appendChild(r),c.current=r,i(r)}),[t,o,a,l]),r}({id:o,root:r}),[l,c]=n.useState(null),s=n.useRef(null),d=n.useRef(null),u=n.useRef(null),f=n.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!r&&!a);return n.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Sr(e)){("focusin"===e.type?Dr:_r)(a)}}}),[a,i,null==l?void 0:l.modal]),n.createElement(Ar.Provider,{value:n.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:c})),[i,a])},p&&a&&n.createElement(Br,{"data-type":"outside",ref:s,onFocus:e=>{if(Sr(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&n.createElement("span",{"aria-owns":a.id,style:Rr}),a&&b(t,a),p&&a&&n.createElement(Br,{"data-type":"outside",ref:d,onFocus:e=>{if(Sr(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Lr=()=>n.useContext(Ar),Nr=new Set,Ir=n.forwardRef((function(e,t){let{lockScroll:o=!1,...r}=e;const i=br();return hr((()=>{if(!o)return;Nr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(o))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Nr.delete(i),0===Nr.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,o]),n.createElement("div",yr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Pr(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:r,nodeId:i}=e,[a,l]=n.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||a,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=n.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=n.useState(r);Wn(p,r)||h(r);const[y,g]=n.useState(null),[m,b]=n.useState(null),w=n.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),x=n.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=a||y,O=l||m,E=n.useRef(null),C=n.useRef(null),S=n.useRef(u),_=null!=s,D=Xn(s),R=Xn(i),j=n.useCallback((()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:o,middleware:p};R.current&&(e.platform=R.current),Vn(E.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Wn(S.current,t)&&(S.current=t,v.flushSync((()=>{f(t)})))}))}),[p,t,o,R]);Kn((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=n.useRef(!1);Kn((()=>(B.current=!0,()=>{B.current=!1})),[]),Kn((()=>{if(k&&(E.current=k),O&&(C.current=O),k&&O){if(D.current)return D.current(k,O,j);j()}}),[k,O,j,D,_]);const A=n.useMemo((()=>({reference:E,floating:C,setReference:w,setFloating:x})),[w,x]),T=n.useMemo((()=>({reference:k,floating:O})),[k,O]),M=n.useMemo((()=>{const e={position:o,left:0,top:0};if(!T.floating)return e;const t=$n(T.floating,u.x),n=$n(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Yn(T.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,c,T.floating,u.x,u.y]);return n.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=n.useContext(xr),u=null!=((null==(f=n.useContext(wr))?void 0:f.id)||null);var f;const p=function(e){const t=n.useRef((()=>{}));return pr((()=>{t.current=e})),n.useCallback((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(y.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:o,nested:u}),null==r||r(e,t,o)})),h=n.useRef(null),y=n.useRef({}),g=n.useState((()=>function(){const e=new Map;return{emit(t,o){var n;null==(n=e.get(t))||n.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var n;e.set(t,(null==(n=e.get(t))?void 0:n.filter((e=>e!==o)))||[])}}}()))[0],m=br(),b=n.useCallback((e=>{const t=Ho(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=n.useCallback((e=>{(Ho(e)||null===e)&&(h.current=e,l(e)),(Ho(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Ho(e))&&s.refs.setReference(e)}),[s.refs]),x=n.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=n.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),O=n.useMemo((()=>({...s,refs:x,elements:k,dataRef:y,nodeId:i,floatingId:m,events:g,open:o,onOpenChange:p})),[s,i,m,g,o,p,x,k]);return hr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),n.useMemo((()=>({...s,context:O,refs:x,elements:k})),[s,x,k,O])}const Fr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Hr(e,t){void 0===t&&(t={});const{open:o,elements:{floating:r}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,c]=n.useState(!1),[s,d]=n.useState("unmounted"),u=function(e,t){const[o,r]=n.useState(e);return e&&!o&&r(!0),n.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),o}(o,a);return hr((()=>{l&&!u&&d("unmounted")}),[l,u]),hr((()=>{if(r){if(o){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[o,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:o={opacity:0},open:r,close:i,common:a,duration:l=250}=t,c=e.placement,s=c.split("-")[0],d=n.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof l,f=(u?l:l.open)||0,p=(u?l:l.close)||0,[h,y]=n.useState((()=>({...zr(a,d),...zr(o,d)}))),{isMounted:g,status:v}=Hr(e,{duration:l}),m=Or(o),b=Or(r),w=Or(i),x=Or(a);return hr((()=>{const e=zr(m.current,d),t=zr(w.current,d),o=zr(x.current,d),n=zr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&y((t=>({transitionProperty:t.transitionProperty,...o,...e}))),"open"===v&&y({transitionProperty:Object.keys(n).map(Fr).join(","),transitionDuration:f+"ms",...o,...n}),"close"===v){const n=t||e;y({transitionProperty:Object.keys(n).map(Fr).join(","),transitionDuration:p+"ms",...o,...n})}}),[p,w,m,b,x,f,v,d]),{isMounted:g,styles:h}}var Vr;function Kr(){return Kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Kr.apply(this,arguments)}var Wr=function(e){return n.createElement("svg",Kr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vr||(Vr=n.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 Yr(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}var $r=["color"],Xr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,$r);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Zr=["color"],qr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Zr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Gr=["color"],Jr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Gr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Qr=["color"],ei=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Qr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));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||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}},oi={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var o,n,r,i,a,l,c=!1;t||(t={}),o=t.debug||!1;try{if(r=ti(),i=document.createRange(),a=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=oi[t.format]||oi.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){o&&console.error("unable to copy using execCommand: ",r),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){o&&console.error("unable to copy using clipboardData: ",r),o&&console.error("falling back to prompt"),n=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(n,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return c};function ri(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=ri(e);return t?e[t]:void 0}const ai=i(void 0),li=({children:n,tools:r})=>{const i=K(),a=d((()=>r?Object.keys(r).reduce(((e,t)=>{var o;return Object.assign(Object.assign({},e),{[t]:null===(o=r[t])||void 0===o?void 0:o.render})}),{}):{}),[r]),l=d((()=>!r||i?null:Object.keys(r).map((t=>{var o,n,i;const a=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.tool,l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.render,c=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:l},c),t):null}))),[r]);return e(ai.Provider,Object.assign({value:a},{children:t(o,{children:[l,n]})}))},ci=()=>{const e=a(ai);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:o,mode:n="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===n&&(t=t.filter((t=>function(e,t){var o;const n=e.blocks[t];if(!n)return!1;const r=ii(n.elements);return"void"!==(null===(o=null==r?void 0:r.props)||void 0===o?void 0:o.nodeType)}(e,t)))),t.map((t=>{var o,n,r,i;return{type:t,title:(null===(n=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===n?void 0:n.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description}}))})(),onClose:o,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===n&&e.blocks[t].toggle({focus:!0}),"create"===n&&e.blocks[t].create({deleteText:!0,focus:!0}),o()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=({children:t})=>e("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),ui=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-border-solid yoo-editor-border-[#e5e7eb] yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md 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})),fi=({children:t})=>e("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),pi=({isOpen:o,onClose:n,refs:r,style:i,children:a})=>{var l,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:y,context:g}=Pr({placement:"right",open:u,onOpenChange:p,middleware:[Un(),Hn(),zn(),On(10)],whileElementsMounted:Fn}),{isMounted:v,styles:m}=Ur(g,{duration:100});if(!o)return null;const b=N(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(l=null==w?void 0:w.props)||void 0===l?void 0:l.nodeType),k=d.ActionMenu,O=Object.assign(Object.assign({},y),m),E=si({editor:s,view:"small",onClose:()=>{p(!1),n()}});return e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:n},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(ui,{children:[t(di,{children:[e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),n()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),n()}},{children:[e(Xr,{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(fi,{children:[v&&e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,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({},E))}))}))})),t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=N(s);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),n()}},{children:[e(Jr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var hi=Object.freeze({__proto__:null,BlockOptions:pi,BlockOptionsMenuContent:ui,BlockOptionsMenuGroup:di,BlockOptionsMenuItem:fi,BlockOptionsSeparator:({className:t})=>e("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});const yi=({block:o,editor:n,dragHandleProps:r,onChangeActiveBlock:i,showActions:a})=>{const[l,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:y,actionMenuRenderProps:g,ActionMenu:v}=(({editor:e})=>{const t=ci().ActionMenu,[o,n]=f(!1),{refs:r,floatingStyles:i,context:a}=Pr({placement:"bottom-start",open:o,onOpenChange:n,middleware:[Un(),Hn(),zn(),On(10)],whileElementsMounted:Fn}),{isMounted:l,styles:c}=Ur(a,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>n(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:l,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:n}),{refs:m,floatingStyles:b,context:x}=Pr({placement:"right-start",open:l,onOpenChange:c,middleware:[Un(),Hn(),zn(),On()]}),{isMounted:k,styles:O}=Ur(x,{duration:100}),{setActivatorNodeRef:E,attributes:C,listeners:D}=r,R=Object.assign(Object.assign({},b),O);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":a,className:'yoo-editor-flex yoo-editor-absolute -yoo-editor-left-[50px] yoo-editor-top-[2px] yoo-editor-opacity-0 yoo-editor-transition-opacity yoopta-element-actions data-[hovered-state-open="true"]:yoo-editor-opacity-100'},{children:[s&&u&&e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:y},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(v,Object.assign({},g))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=No(n,{at:[o.meta.order]});if(!t)return;const r=document.querySelector(`[data-yoopta-block-id="${o.id}"]`),i=S.string(t,[0]),a=ii(n.blocks[o.type].elements),l=0===i.trim().length;if(u&&l&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType))n.setSelection([o.meta.order]),n.focusBlock(o.id),d.setReference(r),h(!0);else{const e=Q({id:G()}),t=[o.meta.order+1];n.setSelection([o.meta.order]),n.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{r&&d.setReference(r.nextSibling),h(!0)}),0)}},className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoo-editor-w-[24px] yoopta-element-actions-plus"},{children:e(Lo,{})})),e("button",Object.assign({type:"button",className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoopta-element-actions-drag",ref:e=>{E(e),m.setReference(e)}},C,D,{onClick:e=>{e.stopPropagation(),i(o.id);const t=No(n,{at:[o.meta.order]});n.focusBlock(o.id),t&&setTimeout((()=>{n.blocks[o.type].hasCustomEditor||(w.blur(t),w.deselect(t),_.deselect(t)),n.setBlockSelected([o.meta.order],{only:!0}),n.setSelection([o.meta.order]),c(!0)}),10)}},{children:e(To,{})})),e(pi,{isOpen:k,refs:m,style:R,onClose:()=>c(!1)})]}))},gi=({children:o,block:n,blockId:r})=>{var i;const a=z(),[l,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:y,isOver:g,isDragging:v}=Co({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:y,opacity:v?.7:1,marginLeft:20*n.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(n.meta.order),w=l===r,x={borderBottom:g&&!v?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||c(r)},onMouseLeave:()=>{a.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":r},{children:[!a.readOnly&&e(yi,{block:n,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:o})),b&&!a.readOnly&&e("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function vi(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;var mi={};Object.defineProperty(mi,"__esModule",{value:!0});for(var bi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),wi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},xi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:bi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},ki={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},Oi=1;Oi<20;Oi++)ki["f"+Oi]=111+Oi;function Ei(e,t,o){t&&!("byKey"in t)&&(o=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map((function(e){return Ci(e,t)})),r=function(e){return n.some((function(t){return Si(t,e)}))};return null==o?r:r(o)}function Ci(e,t){var o=t&&t.byKey,n={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in wi)n[wi[a]]=!1;var l=!0,c=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Di(f),y=wi[h];if(f.length>1&&!y&&!xi[f]&&!ki[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&y||(o?n.key=h:n.which=_i(f)),y&&(n[y]=!p||null)}}catch(e){c=!0,s=e}finally{try{!l&&u.return&&u.return()}finally{if(c)throw s}}return n}function Si(e,t){for(var o in e){var n=e[o],r=void 0;if(null!=n&&((null!=(r="key"===o&&null!=t.key?t.key.toLowerCase():"which"===o?91===n&&93===t.which?91:t.which:t[o])||!1!==n)&&r!==n))return!1}return!0}function _i(e){return e=Di(e),ki[e]||e.toUpperCase().charCodeAt(0)}function Di(e){return e=e.toLowerCase(),e=xi[e]||e}mi.default=Ei,mi.isHotkey=Ei,mi.isCodeHotkey=function(e,t){return Ei(e,t)};var Ri=mi.isKeyHotkey=function(e,t){return Ei(e,{byKey:!0},t)};mi.parseHotkey=Ci,mi.compareHotkey=Si,mi.toKeyCode=_i,mi.toKeyName=Di;const ji={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"},Bi={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"},Ai={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ti=e=>{const t=ji[e],o=Bi[e],n=Ai[e],r=t&&Ri(t),i=o&&Ri(o),a=n&&Ri(n);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},Mi={isBold:Ti("bold"),isCompose:Ti("compose"),isArrowLeft:Ti("arrowLeft"),isArrowRight:Ti("arrowRight"),isArrowUp:Ti("arrowUp"),isArrowDown:Ti("arrowDown"),isDeleteBackward:Ti("deleteBackward"),isDeleteForward:Ti("deleteForward"),isDeleteLineBackward:Ti("deleteLineBackward"),isDeleteLineForward:Ti("deleteLineForward"),isDeleteWordBackward:Ti("deleteWordBackward"),isDeleteWordForward:Ti("deleteWordForward"),isExtendBackward:Ti("extendBackward"),isExtendForward:Ti("extendForward"),isExtendLineBackward:Ti("extendLineBackward"),isExtendLineForward:Ti("extendLineForward"),isItalic:Ti("italic"),isMoveLineBackward:Ti("moveLineBackward"),isMoveLineForward:Ti("moveLineForward"),isCtrlLeft:Ti("ctrlLeft"),isCtrlRight:Ti("ctrlRight"),isRedo:Ti("redo"),isShiftEnter:Ti("shiftEnter"),isEnter:Ti("enter"),isTransposeCharacter:Ti("transposeCharacter"),isUndo:Ti("undo"),isSpace:Ti("space"),isSelect:Ti("select"),isTab:Ti("tab"),isShiftTab:Ti("shiftTab"),isBackspace:Ti("backspace"),isCmdEnter:Ti("cmdEnter"),isCmd:Ti("cmd"),isEscape:Ti("escape"),isSlashCommand:Ti("slashCommand"),isShiftArrowUp:Ti("shiftArrowUp"),isShiftArrowDown:Ti("shiftArrowDown"),isKekceburek:Ti("kekCeburek")};const Li={onKeyDown:function(e){return t=>{const o=No(e,{at:e.selection});if(!o||!o.selection)return;const n=D.parent(o.selection.anchor.path);if(Mi.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void o.insertText("\n")}if(Mi.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(o,o.selection.anchor,n),i=S.isEnd(o,o.selection.anchor,n);if(!r&&!i)return void e.splitBlock({slate:o,focus:!0});const a=Q({id:G()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:l,slate:o,focus:!0})}else if(Mi.isBackspace(t)){if(t.isDefaultPrevented())return;const n=N(e,{at:e.selection}),r=e.blocks[(null==n?void 0:n.type)||""],i=D.parent(o.selection.anchor.path);if(S.isStart(o,o.selection.anchor,i)){t.preventDefault();const n=S.string(o,i),a=e.selection?e.selection[0]-1:0,l=No(e,{at:[a]});let c;if(l&&!r.hasCustomEditor&&(c=function(e,t){const[,o]=S.last(e,t);return{path:o,offset:S.string(e,o).length}}(l,i)),0===n.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(R.isExpanded(o.selection))return _.delete(o,{at:o.selection});if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[a],focus:!0,focusAt:c});const t=Array.from(S.nodes(o,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(o,e)),mode:"highest"})).map((([e])=>e));return _.insertNodes(l,t,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(Mi.isSelect(t)){if(t.isDefaultPrevented())return;const[,n]=S.first(o,[0]),[,r]=S.last(o,[o.children.length-1]),i=S.range(o,n,r),a=R.equals(o.selection,i);if(R.isExpanded(o.selection)&&a)return t.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),void e.setBlockSelected([],{allSelected:!0})}if(Mi.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Mi.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Mi.isArrowUp(t)){if(t.isDefaultPrevented())return;const n=D.parent(o.selection.anchor.path);if(S.isStart(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]-1]:null,n=No(e,{at:o}),r=N(e,{at:o});if(n&&r){const[,o]=S.last(n,[0]),i={path:o,offset:S.string(n,o).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Mi.isArrowDown(t)){if(t.isDefaultPrevented())return;const n=D.parent(o.selection.anchor.path);if(S.isEnd(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]+1]:null,r=No(e,{at:o}),i=N(e,{at:o});if(r&&i){const o=function(e,t){const[,o]=S.first(e,t);return{path:o,offset:0}}(r,n);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:o,waitExecution:!1})}}}if(R.isExpanded(o.selection)){if(Object.values(e.formats).length>0)for(const o of Object.values(e.formats))if(o.hotkey&&Ri(o.hotkey)(t)){t.preventDefault(),e.formats[o.type].toggle();break}}}}}},Ni=({children:t,attributes:o,placeholder:n})=>{const r=x(),i=Object.assign({},o);return r&&n&&(i["data-placeholder"]=n,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Ii(e){try{return new URL(e),!0}catch(e){return!1}}const Pi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{_.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:o}=e,n=o&&R.isCollapsed(o),r={type:"link",children:n?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};n?_.insertNodes(e,r):(_.wrapNodes(e,r,{split:!0}),_.collapse(e,{edge:"end"}))};function Fi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const zi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Hi(e,t,o){var n,r,i;if(3===o.nodeType){return null===(n=o.textContent)||void 0===n?void 0:n.replace(/[\t\n\r\f\v]+/g," ")}if(1!==o.nodeType)return null;if("BR"===o.nodeName)return"\n";const a=o;let l=Array.from(a.childNodes).map((o=>Hi(e,t,o))).flat();if(zi[o.nodeName]){return{[zi[o.nodeName].type]:!0,text:null===(r=o.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(t[o.nodeName]){const n=t[o.nodeName],r=e.blocks[n.type],a=ri(r.elements)||"",c=r.elements[a],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:a,children:s&&!r.hasCustomEditor?[{text:""}]:l.map(Ui),props:Object.assign({nodeType:"block"},c.props)};if(n.parse){const e=n.parse(o);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:n.type,value:[d],meta:{order:0,depth:0}})}return l}function Ui(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Fi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Vi={html:{deserialize:function(e,t){console.log("pasted html",t);const o=function(e){const t={};return Object.keys(e.plugins).forEach((o=>{const n=e.plugins[o],{parsers:r}=n;if(r){const{html:e}=r;if(e){const{deserialize:n}=e;if(n){const{nodeNames:e}=n;e&&e.forEach((e=>{t[e]={type:o,parse:n.parse}}))}}}})),t}(e);return Hi(e,o,t).filter(Fi)},serialize:function(){}},markdown:{}},Ki=({id:t,customEditor:o,elements:n,marks:r,events:i,options:a,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),y=H(t),g=l(y.value).current,v=y.type,m=d((()=>(e=>{const t={};return Object.keys(e).forEach((o=>t[o]=e[o].render)),t})(n)),[n]),b=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),w=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(n).forEach((t=>{var o;const r=null===(o=n[t].props)||void 0===o?void 0:o.nodeType,i="inline"===r,a="void"===r,l="inlineVoid"===r;l&&(e.markableVoid=e=>e.type===t),(a||l)&&(e.isVoid=e=>e.type===t),(i||l)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:o}=e;return e.insertText=t=>{t&&Ii(t)?Pi(e,t):o(t)},e.insertData=o=>{const n=o.getData("text/plain");n&&Ii(n)?Pi(e,n):t(o)},e})(e))})),e}),[]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Mi,currentBlock:y,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((o=>{t[o]=function(t){if(i[o]){i[o](h,w,e)(t)}}})),t}),[i,h,y]),k=u((e=>h.updateBlock(t,{value:e})),[t]),O=u((o=>{const n=m[o.element.type];return n?e(n,Object.assign({},o,{blockId:t,HTMLAttributes:null==a?void 0:a.HTMLAttributes})):e(E,Object.assign({},o))}),[n]),C=u((t=>{var o,n,r,i,a;let{children:l,leaf:s,attributes:d}=t;const u=vi(s,["text"]),f=(null===(o=h.selection)||void 0===o?void 0:o[0])===y.meta.order;u&&Object.keys(u).forEach((e=>{const t=b[e];t&&(l=t.render({children:l,leaf:s}))}));const p=!("void"===(null===(a=null===(i=null===(r=null===(n=t.children)||void 0===n?void 0:n.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&f&&s.withPlaceholder;return e(Ni,Object.assign({attributes:d,placeholder:p?c:void 0},{children:l}))}),[r]),_=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),Li.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],y.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),j=u((e=>{var t,o;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==y.meta.order&&h.setSelection([y.meta.order]),null===(o=null==x?void 0:x.onClick)||void 0===o||o.call(x,e))}),[x.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],y.meta.order]),B=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),A=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e)}),[x.onFocus,h.readOnly]),T=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const o=e.clipboardData.getData("text/html"),n=(new DOMParser).parseFromString(o,"text/html");if(n.body.childNodes.length>0){const e=Vi.html.deserialize(h,n.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),M=u((e=>{var t;const o=[];if(h.readOnly)return o;const[n,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===y.meta.order;return w.selection&&i&&!S.isEditor(n)&&""===S.string(w,[r[0]])&&R.includes(w.selection,r)&&R.isCollapsed(w.selection)&&o.push(Object.assign(Object.assign({},w.selection),{withPlaceholder:!0})),o}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],y.meta.order]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":v},{children:e(Wi,{id:t,slate:w,initialValue:g,onChange:k,decorate:M,renderLeaf:C,renderElement:O,eventHandlers:x,onKeyDown:_,onKeyUp:D,onFocus:A,onClick:j,onBlur:B,customEditor:o,readOnly:h.readOnly,onPaste:T})}))},Wi=p((({id:t,slate:o,initialValue:n,onChange:r,renderLeaf:i,renderElement:a,eventHandlers:l,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:y,readOnly:g})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:o,initialValue:n,onChange:r},{children:e(O,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:a,renderLeaf:i,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:y,onBlur:f,readOnly:g,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Wi.displayName="SlateEditorInstance";const Yi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Te(Et,{activationConstraint:{delay:100,tolerance:0}}),Te(bt,{coordinateGetter:Do})),handleDragEnd:u((t=>{const{active:o,over:n}=t;if(o&&n&&o.id!==n.id){const t=e.children[n.id].meta.order;e.moveBlock(o.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),$i=[],Xi=({editor:t,marks:n,placeholder:r})=>{const i=K(),{sensors:a,handleDragEnd:l,handleDragStart:c}=Yi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?$i:s.sort(((e,o)=>t.children[e].meta.order-t.children[o].meta.order))),[s]),f=[];for(let o=0;o<u.length;o++){const i=u[o],a=t.children[i],l=t.plugins[a.type];a&&l?f.push(e(gi,Object.assign({block:a,blockId:i},{children:e(Ki,{type:a.type,id:i,marks:n,customEditor:l.customEditor,events:l.events,elements:l.elements,options:l.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e(o,{children:f}):e(oo,Object.assign({sensors:a,collisionDetection:He,onDragStart:c,onDragEnd:l},{children:e(mo,Object.assign({disabled:i,items:u,strategy:yo},{children:f}))}))},Zi=({editor:e,yooptaEditorRef:t,root:o})=>{const[n,r]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var a;if(e.readOnly||!1===o)return;const l=null===(a=t.current)||void 0===a?void 0:a.contains(i.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||r({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!n.selection||e.readOnly||!1===o)return;r((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t)=>{const o=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((n,r)=>{if(!n)return;const i=n.getBoundingClientRect(),a=Math.min(e[1],t[1]),l=Math.min(e[0],t[0]),c=Math.max(e[1],t[1]),s=Math.max(e[0],t[0]);a<i.bottom&&c>i.top&&l<i.right&&s>i.left&&o.push(r)})),o})(n.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===o)return;const r=o&&"current"in o?o.current:o||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=t.current)||void 0===n?void 0:n.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,o,e.readOnly]);const c=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},qi=({origin:t,coords:o,isOpen:n})=>{if(!n)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(o[1]-t[1]-1),width:Math.abs(o[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>o[1]&&t[0]>o[0]?"scaleY(-1) scaleX(-1)":t[1]>o[1]?"scaleY(-1)":t[0]>o[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})},Gi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Ji=({placeholder:o,marks:n,className:r,selectionBoxRoot:i,width:a,autoFocus:c=!0})=>{const d=z(),u=K(),f=l(null),p=Zi({editor:d,yooptaEditorRef:f,root:i});let h=l(Gi).current;s((()=>{if(!c||u)return;const e=N(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.selectedBlocks,u]);const y=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},g=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},v=e=>{var t,o,n,r,i;if(!u){if(Mi.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(Mi.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(o=d.selectedBlocks)||void 0===o?void 0:o.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void g();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void g()}if(Mi.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===(r=d.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=N(d),o=No(d);if(!o||!o.selection||!t)return;const n=D.parent(o.selection.anchor.path),i=S.isStart(o,o.selection.focus,n);if(R.isExpanded(o.selection)&&i){const n=d.selection?[d.selection[0]-1]:[0],r=N(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),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(Mi.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 o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=N(d),o=No(d);if(!o||!o.selection||!t)return;const n=D.parent(o.selection.anchor.path),r=S.isEnd(o,o.selection.focus,n);if(R.isExpanded(o.selection)&&r){const n=d.selection?[d.selection[0]+1]:[0],r=N(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),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:a},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({id:"yoopta-editor",className:r,style:m,ref:f,onClick:e=>{u||(g(),(e=>{var t;const o=f.current;if(!o)return;const{bottom:n}=o.getBoundingClientRect(),r=n-parseInt(getComputedStyle(o).paddingBottom,10),i=Q({id:G()});if(e.clientY>=r){const e=Object.keys(d.children).length-1,o=N(d,{at:[e]}),n=No(d,{at:[e]});if(o&&n&&n.selection){const e=S.string(n,n.selection.anchor.path),r=D.parent(n.selection.anchor.path),[a]=S.node(n,r);if(o.type===i.type&&B.isElement(a)&&"void"!==(null===(t=a.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(o.id,{slate:n})}const r=e+1;d.insertBlock(i,{at:[r],focus:!0})}})(e),y())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(g(),y())}},{children:[e(Xi,{editor:d,marks:n,placeholder:o}),!1!==i&&e(qi,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},Qi=({children:e,fallback:t=null})=>{const[o,n]=f(!1);return s((()=>n(!0)),[]),o?e:t};
|
|
2
7
|
/*!
|
|
3
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
4
9
|
*
|
|
5
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
11
|
* Released under the MIT License.
|
|
7
|
-
*/function Ar(e){return"[object Object]"===Object.prototype.toString.call(e)}function xr(e){var t,n;return!1!==Ar(e)&&(void 0===(t=e.constructor)||!1!==Ar(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var Fr=Symbol.for("immer-nothing"),Or=Symbol.for("immer-draftable"),kr=Symbol.for("immer-state");function Sr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var jr=Object.getPrototypeOf;function Pr(e){return!!e&&!!e[kr]}function Rr(e){return!!e&&(Nr(e)||Array.isArray(e)||!!e[Or]||!!e.constructor?.[Or]||zr(e)||Wr(e))}var Tr=Object.prototype.constructor.toString();function Nr(e){if(!e||"object"!=typeof e)return!1;const t=jr(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Tr}function _r(e,t){0===Mr(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function Mr(e){const t=e[kr];return t?t.type_:Array.isArray(e)?1:zr(e)?2:Wr(e)?3:0}function Lr(e,t){return 2===Mr(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ir(e,t,n){const r=Mr(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function zr(e){return e instanceof Map}function Wr(e){return e instanceof Set}function Vr(e){return e.copy_||e.base_}function qr(e,t){if(zr(e))return new Map(e);if(Wr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Nr(e)){if(!jr(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[kr];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(jr(e),n)}function Ur(e,t=!1){return Kr(e)||Pr(e)||!Rr(e)||(Mr(e)>1&&(e.set=e.add=e.clear=e.delete=Hr),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Ur(t,!0)))),e}function Hr(){Sr(2)}function Kr(e){return Object.isFrozen(e)}var $r,Xr={};function Yr(e){const t=Xr[e];return t||Sr(0),t}function Zr(){return $r}function Jr(e,t){t&&(Yr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gr(e){Qr(e),e.drafts_.forEach(to),e.drafts_=null}function Qr(e){e===$r&&($r=e.parent_)}function eo(e){return $r={drafts_:[],parent_:$r,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function to(e){const t=e[kr];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function no(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[kr].modified_&&(Gr(t),Sr(4)),Rr(e)&&(e=ro(t,e),t.parent_||io(t,e)),t.patches_&&Yr("Patches").generateReplacementPatches_(n[kr].base_,e,t.patches_,t.inversePatches_)):e=ro(t,n,[]),Gr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Fr?e:void 0}function ro(e,t,n){if(Kr(t))return t;const r=t[kr];if(!r)return _r(t,((o,i)=>oo(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return io(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),_r(o,((o,a)=>oo(e,r,t,o,a,n,i))),io(e,t,!1),n&&e.patches_&&Yr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function oo(e,t,n,r,o,i,a){if(Pr(o)){const a=ro(e,o,i&&t&&3!==t.type_&&!Lr(t.assigned_,r)?i.concat(r):void 0);if(Ir(n,r,a),!Pr(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(Rr(o)&&!Kr(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ro(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||io(e,o)}}function io(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ur(t,n)}var ao={get(e,t){if(t===kr)return e;const n=Vr(e);if(!Lr(n,t))return function(e,t,n){const r=lo(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Rr(r)?r:r===so(e.base_,t)?(fo(e),e.copy_[t]=ho(r,e)):r},has:(e,t)=>t in Vr(e),ownKeys:e=>Reflect.ownKeys(Vr(e)),set(e,t,n){const r=lo(Vr(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=so(Vr(e),t),a=r?.[kr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||Lr(e.base_,t)))return!0;fo(e),co(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==so(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,fo(e),co(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Vr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Sr(11)},getPrototypeOf:e=>jr(e.base_),setPrototypeOf(){Sr(12)}},uo={};function so(e,t){const n=e[kr];return(n?Vr(n):e)[t]}function lo(e,t){if(!(t in e))return;let n=jr(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=jr(n)}}function co(e){e.modified_||(e.modified_=!0,e.parent_&&co(e.parent_))}function fo(e){e.copy_||(e.copy_=qr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}_r(ao,((e,t)=>{uo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),uo.deleteProperty=function(e,t){return uo.set.call(this,e,t,void 0)},uo.set=function(e,t,n){return ao.set.call(this,e[0],t,n,e[0])};function ho(e,t){const n=zr(e)?Yr("MapSet").proxyMap_(e,t):Wr(e)?Yr("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Zr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ao;n&&(o=[r],i=uo);const{revoke:a,proxy:u}=Proxy.revocable(o,i);return r.draft_=u,r.revoke_=a,u}(e,t);return(t?t.scope_:Zr()).drafts_.push(n),n}function po(e){if(!Rr(e)||Kr(e))return e;const t=e[kr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=qr(e,t.scope_.immer_.useStrictShallowCopy_)}else n=qr(e,!0);return _r(n,((e,t)=>{Ir(n,e,po(t))})),t&&(t.finalized_=!1),n}var vo=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&Sr(6),void 0!==n&&"function"!=typeof n&&Sr(7),Rr(e)){const o=eo(this),i=ho(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Gr(o):Qr(o)}return Jr(o,n),no(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Fr&&(r=void 0),this.autoFreeze_&&Ur(r,!0),n){const t=[],o=[];Yr("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Sr(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Rr(e)||Sr(8),Pr(e)&&(e=function(e){Pr(e)||Sr(10);return po(e)}(e));const t=eo(this),n=ho(e,void 0);return n[kr].isManual_=!0,Qr(t),n}finishDraft(e,t){const n=e&&e[kr];n&&n.isManual_||Sr(9);const{scope_:r}=n;return Jr(r,t),no(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Yr("Patches").applyPatches_;return Pr(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},go=vo.produce;vo.produceWithPatches.bind(vo),vo.setAutoFreeze.bind(vo),vo.setUseStrictShallowCopy.bind(vo),vo.applyPatches.bind(vo);var mo=vo.createDraft.bind(vo),Do=vo.finishDraft.bind(vo),bo={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=ko.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},yo={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=ri.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Co={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Vo.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},wo=new WeakMap,Bo=new WeakMap,Eo=new WeakMap,Ao=new WeakMap,xo=new WeakMap,Fo=new WeakMap,Oo=new WeakMap,ko={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=ko.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r];if(o!==t[r])break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return ko.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return ko.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return ko.equals(r,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===ko.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===ko.compare(e,t),isBefore:(e,t)=>-1===ko.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===ko.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===ko.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===ko.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===ko.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&ko.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!ko.isAncestor(t,e)&&!ko.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(ko.equals(i,r)||ko.endsBefore(i,r)||ko.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(ko.equals(a,r)||ko.isAncestor(a,r))return null;ko.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:u,position:s}=t;ko.equals(u,r)||ko.endsBefore(u,r)?r[u.length-1]-=1:ko.isAncestor(u,r)&&(r[u.length-1]-=1,r[u.length]+=s);break;case"split_node":var{path:l,position:c}=t;if(ko.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else ko.endsBefore(l,r)?r[l.length-1]+=1:ko.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:d,newPath:f}=t;if(ko.equals(d,f))return r;if(ko.isAncestor(d,r)||ko.equals(d,r)){var h=f.slice();return ko.endsBefore(d,f)&&d.length<f.length&&(h[d.length-1]-=1),h.concat(r.slice(d.length))}ko.isSibling(d,f)&&(ko.isAncestor(f,r)||ko.equals(f,r))?ko.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:ko.endsBefore(f,r)||ko.equals(f,r)||ko.isAncestor(f,r)?(ko.endsBefore(d,r)&&(r[d.length-1]-=1),r[f.length-1]+=1):ko.endsBefore(d,r)&&(ko.equals(f,r)&&(r[f.length-1]+=1),r[d.length-1]-=1)}return r}};function So(e){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},So(e)}function jo(e){var t=function(e,t){if("object"!==So(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==So(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===So(t)?t:String(t)}function Po(e,t,n){return(t=jo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ro(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ro(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var No={transform(e,t){e.children=mo(e.children);var n=e.selection&&mo(e.selection);try{n=((e,t,n)=>{switch(n.type){case"insert_node":var{path:r,node:o}=n,i=Xo.parent(e,r),a=r[r.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[u,s]of Vo.points(t))t[s]=ri.transform(u,n);break;case"insert_text":var{path:l,offset:c,text:d}=n;if(0===d.length)break;var f=Xo.leaf(e,l),h=f.text.slice(0,c),p=f.text.slice(c);if(f.text=h+d+p,t)for(var[v,g]of Vo.points(t))t[g]=ri.transform(v,n);break;case"merge_node":var{path:m}=n,D=Xo.get(e,m),b=ko.previous(m),y=Xo.get(e,b),C=Xo.parent(e,m),w=m[m.length-1];if(di.isText(D)&&di.isText(y))y.text+=D.text;else{if(di.isText(D)||di.isText(y))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(ii.stringify(D)," ").concat(ii.stringify(y)));y.children.push(...D.children)}if(C.children.splice(w,1),t)for(var[B,E]of Vo.points(t))t[E]=ri.transform(B,n);break;case"move_node":var{path:A,newPath:x}=n;if(ko.isAncestor(A,x))throw new Error("Cannot move a path [".concat(A,"] to new path [").concat(x,"] because the destination is inside itself."));var F=Xo.get(e,A),O=Xo.parent(e,A),k=A[A.length-1];O.children.splice(k,1);var S=ko.transform(A,n),j=Xo.get(e,ko.parent(S)),P=S[S.length-1];if(j.children.splice(P,0,F),t)for(var[R,T]of Vo.points(t))t[T]=ri.transform(R,n);break;case"remove_node":var{path:N}=n,_=N[N.length-1];if(Xo.parent(e,N).children.splice(_,1),t)for(var[M,L]of Vo.points(t)){var I=ri.transform(M,n);if(null!=t&&null!=I)t[L]=I;else{var z=void 0,W=void 0;for(var[V,q]of Xo.texts(e)){if(-1!==ko.compare(q,N)){W=[V,q];break}z=[V,q]}var U=!1;z&&W&&(U=ko.equals(W[1],N)?!ko.hasPrevious(W[1]):ko.common(z[1],N).length<ko.common(W[1],N).length),z&&!U?(M.path=z[1],M.offset=z[0].text.length):W?(M.path=W[1],M.offset=0):t=null}}break;case"remove_text":var{path:H,offset:K,text:$}=n;if(0===$.length)break;var X=Xo.leaf(e,H),Y=X.text.slice(0,K),Z=X.text.slice(K+$.length);if(X.text=Y+Z,t)for(var[J,G]of Vo.points(t))t[G]=ri.transform(J,n);break;case"set_node":var{path:Q,properties:ee,newProperties:te}=n;if(0===Q.length)throw new Error("Cannot set properties on the root node!");var ne=Xo.get(e,Q);for(var re in te){if("children"===re||"text"===re)throw new Error('Cannot set the "'.concat(re,'" property of nodes!'));var oe=te[re];null==oe?delete ne[re]:ne[re]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete ne[ie];break;case"set_selection":var{newProperties:ae}=n;if(null==ae)t=ae;else{if(null==t){if(!Vo.isRange(ae))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(ii.stringify(ae)," when there is no current selection."));t=To({},ae)}for(var ue in ae){var se=ae[ue];if(null==se){if("anchor"===ue||"focus"===ue)throw new Error('Cannot remove the "'.concat(ue,'" selection property'));delete t[ue]}else t[ue]=se}}break;case"split_node":var{path:le,position:ce,properties:de}=n;if(0===le.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(le,"] because the root node cannot be split."));var fe,he=Xo.get(e,le),pe=Xo.parent(e,le),ve=le[le.length-1];if(di.isText(he)){var ge=he.text.slice(0,ce),me=he.text.slice(ce);he.text=ge,fe=To(To({},de),{},{text:me})}else{var De=he.children.slice(0,ce),be=he.children.slice(ce);he.children=De,fe=To(To({},de),{},{children:be})}if(pe.children.splice(ve+1,0,fe),t)for(var[ye,Ce]of Vo.points(t))t[Ce]=ri.transform(ye,n)}return t})(e,n,t)}finally{e.children=Do(e.children),e.selection=n?Pr(n)?Do(n):n:null}}},_o={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},Mo={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Lo=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(xr(r)&&xr(o)){if(!Lo(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(r!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0};function Io(e,t){if(null==e)return{};var n,r,o=function(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}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var zo=["anchor","focus"];function Wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Vo={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Vo.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Vo.edges(e);return t},equals:(e,t)=>ri.equals(e.anchor,t.anchor)&&ri.equals(e.focus,t.focus),includes(e,t){if(Vo.isRange(t)){if(Vo.includes(e,t.anchor)||Vo.includes(e,t.focus))return!0;var[n,r]=Vo.edges(e),[o,i]=Vo.edges(t);return ri.isBefore(n,o)&&ri.isAfter(r,i)}var[a,u]=Vo.edges(e),s=!1,l=!1;return ri.isPoint(t)?(s=ri.compare(t,a)>=0,l=ri.compare(t,u)<=0):(s=ko.compare(t,a.path)>=0,l=ko.compare(t,u.path)<=0),s&&l},intersection(e,t){var n=Io(e,zo),[r,o]=Vo.edges(e),[i,a]=Vo.edges(t),u=ri.isBefore(r,i)?i:r,s=ri.isBefore(o,a)?o:a;return ri.isBefore(s,u)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wo(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({anchor:u,focus:s},n)},isBackward(e){var{anchor:t,focus:n}=e;return ri.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return ri.equals(t,n)},isExpanded:e=>!Vo.isCollapsed(e),isForward:e=>!Vo.isBackward(e),isRange:e=>xr(e)&&ri.isPoint(e.anchor)&&ri.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Vo.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return go(e,(e=>{if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=Vo.isCollapsed(e);Vo.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?Vo.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var u=ri.transform(e.anchor,t,{affinity:r}),s=ri.transform(e.focus,t,{affinity:o});if(!u||!s)return null;e.anchor=u,e.focus=s}))}},qo=e=>xr(e)&&Xo.isNodeList(e.children)&&!Qo.isEditor(e),Uo={isAncestor:e=>xr(e)&&Xo.isNodeList(e.children),isElement:qo,isElementList:e=>Array.isArray(e)&&e.every((e=>Uo.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return qo(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Ho=["children"],Ko=["text"],$o=new WeakMap,Xo={ancestor(e,t){var n=Xo.get(e,t);if(di.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(ii.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of ko.ancestors(t,n)){var o=[Xo.ancestor(e,r),r];yield o}}()},child(e,t){if(di.isText(e))throw new Error("Cannot get the child of a text node: ".concat(ii.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(ii.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Xo.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a<i.length;){var u=Xo.child(o,a),s=t.concat(a);yield[u,s],a=r?a-1:a+1}}()},common(e,t,n){var r=ko.common(t,n);return[Xo.get(e,r),r]},descendant(e,t){var n=Xo.get(e,t);if(Qo.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(ii.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Xo.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Xo.nodes(e,t))Uo.isElement(n)&&(yield[n,r])}()},extractProps:e=>Uo.isAncestor(e)?Io(e,Ho):Io(e,Ko),first(e,t){for(var n=t.slice(),r=Xo.get(e,n);r&&!di.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(di.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(ii.stringify(e)));var n=go({children:e.children},(e=>{var[n,r]=Vo.edges(t),o=Xo.nodes(e,{reverse:!0,pass:e=>{var[,n]=e;return!Vo.includes(t,n)}});for(var[,i]of o){if(!Vo.includes(t,i)){var a=Xo.parent(e,i),u=i[i.length-1];a.children.splice(u,1)}if(ko.equals(i,r.path)){var s=Xo.leaf(e,i);s.text=s.text.slice(0,r.offset)}if(ko.equals(i,n.path)){var l=Xo.leaf(e,i);l.text=l.text.slice(n.offset)}}Qo.isEditor(e)&&(e.selection=null)}));return n.children},get(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(di.isText(n)||!n.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(ii.stringify(e)));n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(di.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode:e=>di.isText(e)||Uo.isElement(e)||Qo.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=$o.get(e);if(void 0!==t)return t;var n=e.every((e=>Xo.isNode(e)));return $o.set(e,n),n},last(e,t){for(var n=t.slice(),r=Xo.get(e,n);r&&!di.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Xo.get(e,t);if(!di.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(ii.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of ko.levels(t,n)){var o=Xo.get(e,r);yield[o,r]}}()},matches:(e,t)=>Uo.isElement(e)&&Uo.isElementProps(t)&&Uo.matches(e,t)||di.isText(e)&&di.isTextProps(t)&&di.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,u=[],s=e;!i||!(r?ko.isBefore(u,i):ko.isAfter(u,i));)if(a.has(s)||(yield[s,u]),a.has(s)||di.isText(s)||0===s.children.length||null!=n&&!1!==n([s,u])){if(0===u.length)break;if(!r){var l=ko.next(u);if(Xo.has(e,l)){u=l,s=Xo.get(e,u);continue}}if(r&&0!==u[u.length-1])u=ko.previous(u),s=Xo.get(e,u);else u=ko.parent(u),s=Xo.get(e,u),a.add(s)}else{a.add(s);var c=r?s.children.length-1:0;ko.isAncestor(u,o)&&(c=o[u.length]),u=u.concat(c),s=Xo.get(e,u)}}()},parent(e,t){var n=ko.parent(t),r=Xo.get(e,n);if(di.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>di.isText(e)?e.text:e.children.map(Xo.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Xo.nodes(e,t))di.isText(n)&&(yield[n,r])}()}};function Yo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yo(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jo={isNodeOperation:e=>Jo.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!xr(e))return!1;switch(e.type){case"insert_node":case"remove_node":return ko.isPath(e.path)&&Xo.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&ko.isPath(e.path);case"merge_node":return"number"==typeof e.position&&ko.isPath(e.path)&&xr(e.properties);case"move_node":return ko.isPath(e.path)&&ko.isPath(e.newPath);case"set_node":return ko.isPath(e.path)&&xr(e.properties)&&xr(e.newProperties);case"set_selection":return null===e.properties&&Vo.isRange(e.newProperties)||null===e.newProperties&&Vo.isRange(e.properties)||xr(e.properties)&&xr(e.newProperties);case"split_node":return ko.isPath(e.path)&&"number"==typeof e.position&&xr(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>Jo.isOperation(e))),isSelectionOperation:e=>Jo.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Jo.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Zo(Zo({},e),{},{type:"remove_node"});case"insert_text":return Zo(Zo({},e),{},{type:"remove_text"});case"merge_node":return Zo(Zo({},e),{},{type:"split_node",path:ko.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(ko.equals(t,n))return e;if(ko.isSibling(n,t))return Zo(Zo({},e),{},{path:t,newPath:n});var r=ko.transform(n,e),o=ko.transform(ko.next(n),e);return Zo(Zo({},e),{},{path:r,newPath:o});case"remove_node":return Zo(Zo({},e),{},{type:"insert_node"});case"remove_text":return Zo(Zo({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Zo(Zo({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:u,newProperties:s}=e;return Zo(Zo({},e),{},null==u?{properties:s,newProperties:null}:null==s?{properties:null,newProperties:u}:{properties:s,newProperties:u});case"split_node":return Zo(Zo({},e),{},{type:"merge_node",path:ko.next(e.path)})}}},Go=new WeakMap,Qo={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:e=>(e=>{var t=Go.get(e);if(void 0!==t)return t;if(!xr(e))return!1;var n="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||xr(e.marks))&&(null===e.selection||Vo.isRange(e.selection))&&Xo.isNodeList(e.children)&&Jo.isOperationList(e.operations);return Go.set(e,n),n})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}},ei={isSpan:e=>Array.isArray(e)&&2===e.length&&e.every(ko.isPath)};function ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ri={compare(e,t){var n=ko.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===ri.compare(e,t),isBefore:(e,t)=>-1===ri.compare(e,t),equals:(e,t)=>e.offset===t.offset&&ko.equals(e.path,t.path),isPoint:e=>xr(e)&&"number"==typeof e.offset&&ko.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return go(e,(e=>{if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=ko.transform(o,t,n);break;case"insert_text":ko.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(e.offset+=t.text.length);break;case"merge_node":ko.equals(t.path,o)&&(e.offset+=t.position),e.path=ko.transform(o,t,n);break;case"remove_text":ko.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(ko.equals(t.path,o)||ko.isAncestor(t.path,o))return null;e.path=ko.transform(o,t,n);break;case"split_node":if(ko.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(e.offset-=t.position,e.path=ko.transform(o,t,ni(ni({},n),{},{affinity:"forward"})))}else e.path=ko.transform(o,t,n)}}))}},oi=void 0,ii={setScrubber(e){oi=e},stringify:e=>JSON.stringify(e,oi)},ai=["text"],ui=["anchor","focus"];function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?si(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):si(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ci,di={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return Io(e,ai)}return Lo(r?o(e):e,r?o(t):t)},isText:e=>xr(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>di.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[li({},e)];for(var r of t){var o=Io(r,ui),[i,a]=Vo.edges(r),u=[],s=0,l=i.offset,c=a.offset;for(var d of n){var{length:f}=d.text,h=s;if(s+=f,l<=h&&s<=c)Object.assign(d,o),u.push(d);else if(l!==c&&(l===s||c===h)||l>s||c<h||c===h&&0!==h)u.push(d);else{var p=d,v=void 0,g=void 0;if(c<s){var m=c-h;g=li(li({},p),{},{text:p.text.slice(m)}),p=li(li({},p),{},{text:p.text.slice(0,m)})}if(l>h){var D=l-h;v=li(li({},p),{},{text:p.text.slice(0,D)}),p=li(li({},p),{},{text:p.text.slice(D)})}Object.assign(p,o),v&&u.push(v),u.push(p),g&&u.push(g)}}n=u}return n}},fi=e=>e.selection?e.selection:e.children.length>0?Qo.end(e,[]):[0],hi=(e,t)=>{var[n]=Qo.node(e,t);return e=>e===n},pi=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?yi(e):e,o=ci.None,i=ci.None,a=0,u=null;for(var s of r){var l=s.codePointAt(0);if(!l)break;var c=Pi(s,l);if([o,i]=n?[i,c]:[c,o],Ri(o,ci.ZWJ)&&Ri(i,ci.ExtPict)&&!Mi(n?e.substring(0,a):e.substring(0,e.length-a)))break;if(Ri(o,ci.RI)&&Ri(i,ci.RI)&&!(u=null!==u?!u:!!n||Ii(e.substring(0,e.length-a))))break;if(o!==ci.None&&i!==ci.None&&Ni(o,i))break;a+=s.length}return a||1},vi=/\s/,gi=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,mi=/['\u2018\u2019]/,Di=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},bi=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(vi.test(t))return!1;if(mi.test(t)){var o=pi(n,r),[i,a]=Di(n,o,r);if(e(i,a,r))return!0}return!gi.test(t)},yi=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(wi(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(Ci(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},Ci=e=>e>=55296&&e<=56319,wi=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(ci||(ci={}));var Bi=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Ei=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Ai=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,xi=/^[\u1100-\u115F\uA960-\uA97C]$/,Fi=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Oi=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,ki=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,Si=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,ji=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Pi=(e,t)=>{var n=ci.Any;return-1!==e.search(Bi)&&(n|=ci.Extend),8205===t&&(n|=ci.ZWJ),t>=127462&&t<=127487&&(n|=ci.RI),-1!==e.search(Ei)&&(n|=ci.Prepend),-1!==e.search(Ai)&&(n|=ci.SpacingMark),-1!==e.search(xi)&&(n|=ci.L),-1!==e.search(Fi)&&(n|=ci.V),-1!==e.search(Oi)&&(n|=ci.T),-1!==e.search(ki)&&(n|=ci.LV),-1!==e.search(Si)&&(n|=ci.LVT),-1!==e.search(ji)&&(n|=ci.ExtPict),n};function Ri(e,t){return!!(e&t)}var Ti=[[ci.L,ci.L|ci.V|ci.LV|ci.LVT],[ci.LV|ci.V,ci.V|ci.T],[ci.LVT|ci.T,ci.T],[ci.Any,ci.Extend|ci.ZWJ],[ci.Any,ci.SpacingMark],[ci.Prepend,ci.Any],[ci.ZWJ,ci.ExtPict],[ci.RI,ci.RI]];function Ni(e,t){return-1===Ti.findIndex((n=>Ri(e,n[0])&&Ri(t,n[1])))}var _i=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Mi=e=>-1!==e.search(_i),Li=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Ii=e=>{var t=e.match(Li);return null!==t&&t[0].length/2%2==1},zi={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Qo.withoutNormalizing(e,(()=>{var{voids:r=!1}=n,{at:o=fi(e)}=n;if(ko.isPath(o)&&(o=Qo.range(e,o)),Vo.isRange(o))if(Vo.isCollapsed(o))o=o.anchor;else{var i=Vo.end(o);if(!r&&Qo.void(e,{at:i}))return;var a=Vo.start(o),u=Qo.pointRef(e,a),s=Qo.pointRef(e,i);qi.delete(e,{at:o,voids:r});var l=u.unref(),c=s.unref();o=l||c,qi.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Qo.void(e,{at:o})||Qo.elementReadOnly(e,{at:o}))){var{path:d,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:f,text:t})}}))}};function Wi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qi=Vi(Vi(Vi(Vi({},No),_o),Mo),zi),Ui=new WeakMap;function Hi(e,t,n){var r,o,i=wo.get(e)||[],a=Bo.get(e)||new Set,u=e=>{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var s of(r=[],o=new Set,i)){u(n(s))}else r=i,o=a;for(var l of t)u(l);wo.set(e,r),Bo.set(e,o)}var Ki=(e,t)=>{for(var n of Qo.pathRefs(e))bo.transform(n,t);for(var r of Qo.pointRefs(e))yo.transform(r,t);for(var o of Qo.rangeRefs(e))Co.transform(o,t);if(!(e=>Ui.get(e)||!1)(e)){var i=ko.operationCanTransformPath(t)?e=>ko.transform(e,t):void 0;Hi(e,e.getDirtyPaths(t),i)}qi.transform(e,t),e.operations.push(t),Qo.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),Eo.get(e)||(Eo.set(e,!0),Promise.resolve().then((()=>{Eo.set(e,!1),e.onChange({operation:t}),e.operations=[]})))};function $i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$i(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ji(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ji(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var oa=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ra(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({text:t},o);qi.insertNodes(e,i,{at:n.at,voids:n.voids})}else qi.insertText(e,t,n);e.marks=null}};var ia=["text"],aa=["text"];var ua=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>wo.get(e)||[],i=e=>{var t=o(e).pop(),n=t.join(",");return(e=>Bo.get(e)||new Set)(e).delete(n),t};if(Qo.isNormalizing(e)){if(n){var a=Array.from(Xo.nodes(e),(e=>{var[,t]=e;return t})),u=new Set(a.map((e=>e.join(","))));wo.set(e,a),Bo.set(e,u)}0!==o(e).length&&Qo.withoutNormalizing(e,(()=>{for(var t of o(e))if(Xo.has(e,t)){var n=Qo.node(e,t),[a,u]=n;Uo.isElement(a)&&0===a.children.length&&e.normalizeNode(n,{operation:r})}for(var s=o(e),l=s.length,c=0;0!==s.length;){if(!e.shouldNormalize({dirtyPaths:s,iteration:c,initialDirtyPathsLength:l,operation:r}))return;var d=i(e);if(Xo.has(e,d)){var f=Qo.node(e,d);e.normalizeNode(f,{operation:r})}c++,s=o(e)}}))}};function sa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1,ignoreNonSelectable:a=!1}=t;if(n){var u=Qo.range(e,n),[s,l]=Vo.edges(u),c=o?l:s,d=!1,f="",h=0,p=0,v=0;for(var[g,m]of Qo.nodes(e,{at:n,reverse:o,voids:i,ignoreNonSelectable:a})){if(Uo.isElement(g)){if(!i&&(e.isVoid(g)||e.isElementReadOnly(g))){yield Qo.start(e,m);continue}if(e.isInline(g))continue;if(Qo.hasInlines(e,g)){var D=ko.isAncestor(m,l.path)?l:Qo.end(e,m),b=ko.isAncestor(m,s.path)?s:Qo.start(e,m);f=Qo.string(e,{anchor:b,focus:D},{voids:i}),d=!0}}if(di.isText(g)){var y=ko.equals(m,c.path);for(y?(p=o?c.offset:g.text.length-c.offset,v=c.offset):(p=g.text.length,v=o?p:0),(y||d||"offset"===r)&&(yield{path:m,offset:v},d=!1);;){if(0===h){if(""===f)break;h=C(f,r,o),f=Di(f,h,o)[1]}if(v=o?v-h:v+h,(p-=h)<0){h=-p;break}h=0,yield{path:m,offset:v}}}}}function C(e,t,n){return"character"===t?pi(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=pi(e,t),[i,a]=Di(e,o,t);if(bi(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function la(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ca=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!di.isText(t))return!1;var[r,o]=Qo.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=Vo.isExpanded(n),i=!1;if(!o){var[a,u]=Qo.node(e,n);if(a&&r(a,u)){var[s]=Qo.parent(e,u);i=s&&e.markableVoid(s)}}if(o||i)qi.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?la(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Qo.marks(e)||{});delete l[t],e.marks=l,Eo.get(e)||e.onChange()}}};function da(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?da(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):da(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ha=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Qo.withoutNormalizing(e,(()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:u,match:s,select:l}=n;if(Xo.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(u||(u=fi(e),!1!==l&&(l=!0)),null==l&&(l=!1),Vo.isRange(u))if(r||(u=Qo.unhangRange(e,u,{voids:o})),Vo.isCollapsed(u))u=u.anchor;else{var[,d]=Vo.edges(u),f=Qo.pointRef(e,d);qi.delete(e,{at:u}),u=f.unref()}if(ri.isPoint(u)){null==s&&(s=di.isText(c)?e=>di.isText(e):e.isInline(c)?t=>di.isText(t)||Qo.isInline(e,t):t=>Uo.isElement(t)&&Qo.isBlock(e,t));var[h]=Qo.nodes(e,{at:u.path,match:s,mode:i,voids:o});if(!h)return;var[,p]=h,v=Qo.pathRef(e,p),g=Qo.isEnd(e,u,p);qi.splitNodes(e,{at:u,match:s,mode:i,voids:o});var m=v.unref();u=g?ko.next(m):m}var D=ko.parent(u),b=u[u.length-1];if(o||!Qo.void(e,{at:D})){if(a){var y=[],C=ko.levels(D);((e,t,n)=>{var r=Ui.get(e)||!1;Ui.set(e,!0);try{t(),n()}finally{Ui.set(e,r)}})(e,(()=>{var n=function(){var t=D.concat(b);b++;var n={type:"insert_node",path:t,node:r};e.apply(n),u=ko.next(u),y.push(n),di.isText?C.push(...Array.from(Xo.nodes(r),(e=>{var[,n]=e;return t.concat(n)}))):C.push(t)};for(var r of t)n()}),(()=>{Hi(e,C,(e=>{var t=e;for(var n of y)if(ko.operationCanTransformPath(n)&&!(t=ko.transform(t,n)))return null;return t}))}))}else for(var w of t){var B=D.concat(b);b++,e.apply({type:"insert_node",path:B,node:w}),u=ko.next(u)}if(u=ko.previous(u),l){var E=Qo.end(e,u);E&&qi.select(e,E)}}}}))},pa=["text"],va=["children"],ga=(e,t)=>{if(Uo.isElement(t)){var n=t;return!!Qo.isVoid(e,t)||1===n.children.length&&ga(e,n.children[0])}return!Qo.isEditor(t)},ma=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qo.withoutNormalizing(e,(()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:u=!1}=t;if(null==o&&(o=t=>Uo.isElement(t)&&Qo.isBlock(e,t)),Vo.isRange(i)&&(i=((e,t)=>{if(Vo.isCollapsed(t))return t.anchor;var[,n]=Vo.edges(t),r=Qo.pointRef(e,n);return qi.delete(e,{at:t}),r.unref()})(e,i)),ko.isPath(i)){var s=i,l=Qo.point(e,s),[c]=Qo.parent(e,s);o=e=>e===c,a=l.path.length-s.length+1,i=l,u=!0}if(i){var d,f=Qo.pointRef(e,i,{affinity:"backward"});try{var[h]=Qo.nodes(e,{at:i,match:o,mode:n,voids:r});if(!h)return;var p=Qo.void(e,{at:i,mode:"highest"});if(!r&&p){var[v,g]=p;if(Uo.isElement(v)&&e.isInline(v)){var m=Qo.after(e,g);if(!m){var D=ko.next(g);qi.insertNodes(e,{text:""},{at:D,voids:r}),m=Qo.point(e,D)}i=m,u=!0}a=i.path.length-g.length+1,u=!0}d=Qo.pointRef(e,i);var b=i.path.length-a,[,y]=h,C=i.path.slice(0,b),w=0===a?i.offset:i.path[b]+0;for(var[B,E]of Qo.levels(e,{at:C,reverse:!0,voids:r})){var A=!1;if(E.length<y.length||0===E.length||!r&&Uo.isElement(B)&&Qo.isVoid(e,B))break;var x=f.current,F=Qo.isEnd(e,x,E);if(u||!f||!Qo.isEdge(e,x,E)){A=!0;var O=Xo.extractProps(B);e.apply({type:"split_node",path:E,position:w,properties:O})}w=E[E.length-1]+(A||F?1:0)}if(null==t.at){var k=d.current||Qo.end(e,[]);qi.select(e,k)}}finally{var S;f.unref(),null===(S=d)||void 0===S||S.unref()}}}))};function Da(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Da(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Da(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ya,Ca=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ki(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var{selection:r}=e;if(r){var o=(t,n)=>{if(!di.isText(t))return!1;var[r,o]=Qo.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=Vo.isExpanded(r),a=!1;if(!i){var[u,s]=Qo.node(e,r);if(u&&o(u,s)){var[l]=Qo.parent(e,s);a=l&&e.markableVoid(l)}}if(i||a)qi.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=Xi(Xi({},Qo.marks(e)||{}),{},{[t]:n});e.marks=c,Eo.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Vo.isCollapsed(n)&&qi.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Vo.isCollapsed(n)&&qi.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&Vo.isExpanded(n)&&qi.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;return t?Xo.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{qi.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{qi.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Qo.withoutNormalizing(e,(()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=fi(e),batchDirty:a=!0}=n;if(t.length){if(Vo.isRange(i))if(r||(i=Qo.unhangRange(e,i,{voids:o})),Vo.isCollapsed(i))i=i.anchor;else{var[,u]=Vo.edges(i);if(!o&&Qo.void(e,{at:u}))return;var s=Qo.pointRef(e,u);qi.delete(e,{at:i}),i=s.unref()}else ko.isPath(i)&&(i=Qo.start(e,i));if(o||!Qo.void(e,{at:i})){var l=Qo.above(e,{at:i,match:t=>Uo.isElement(t)&&Qo.isInline(e,t),mode:"highest",voids:o});if(l){var[,c]=l;Qo.isEnd(e,i,c)?i=Qo.after(e,c):Qo.isStart(e,i,c)&&(i=Qo.before(e,c))}var d=Qo.above(e,{match:t=>Uo.isElement(t)&&Qo.isBlock(e,t),at:i,voids:o}),[,f]=d,h=Qo.isStart(e,i,f),p=Qo.isEnd(e,i,f),v=h&&p,g=!h||h&&p,m=!p,[,D]=Xo.first({children:t},[]),[,b]=Xo.last({children:t},[]),y=[],C=t=>{var[n,r]=t;return!(0===r.length||!v&&(g&&ko.isAncestor(r,D)&&Uo.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||m&&ko.isAncestor(r,b)&&Uo.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))};for(var w of Xo.nodes({children:t},{pass:C}))C(w)&&y.push(w);var B=[],E=[],A=[],x=!0,F=!1;for(var[O]of y)Uo.isElement(O)&&!e.isInline(O)?(x=!1,F=!0,E.push(O)):x?B.push(O):A.push(O);var[k]=Qo.nodes(e,{at:i,match:t=>di.isText(t)||Qo.isInline(e,t),mode:"highest",voids:o}),[,S]=k,j=Qo.isStart(e,i,S),P=Qo.isEnd(e,i,S),R=Qo.pathRef(e,p&&!A.length?ko.next(f):f),T=Qo.pathRef(e,P?ko.next(S):S);qi.splitNodes(e,{at:i,match:t=>F?Uo.isElement(t)&&Qo.isBlock(e,t):di.isText(t)||Qo.isInline(e,t),mode:F?"lowest":"highest",always:F&&(!h||B.length>0)&&(!p||A.length>0),voids:o});var N,_=Qo.pathRef(e,!j||j&&P?ko.next(S):S);if(qi.insertNodes(e,B,{at:_.current,match:t=>di.isText(t)||Qo.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),v&&!B.length&&E.length&&!A.length&&qi.delete(e,{at:f,voids:o}),qi.insertNodes(e,E,{at:R.current,match:t=>Uo.isElement(t)&&Qo.isBlock(e,t),mode:"lowest",voids:o,batchDirty:a}),qi.insertNodes(e,A,{at:T.current,match:t=>di.isText(t)||Qo.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),!n.at&&(A.length>0&&T.current?N=ko.previous(T.current):E.length>0&&R.current?N=ko.previous(R.current):_.current&&(N=ko.previous(_.current)),N)){var M=Qo.end(e,N);qi.select(e,M)}_.unref(),R.unref(),T.unref()}}}))}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{qi.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oa(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var[n,r]=t;if(!di.isText(n))if(Uo.isElement(n)&&0===n.children.length)qi.insertNodes(e,{text:""},{at:r.concat(0),voids:!0});else for(var o=!Qo.isEditor(n)&&Uo.isElement(n)&&(e.isInline(n)||0===n.children.length||di.isText(n.children[0])||e.isInline(n.children[0])),i=0,a=0;a<n.children.length;a++,i++){var u=Xo.get(e,r);if(!di.isText(u)){var s=u.children[i],l=u.children[i-1],c=a===n.children.length-1;(di.isText(s)||Uo.isElement(s)&&e.isInline(s))!==o?(qi.removeNodes(e,{at:r.concat(i),voids:!0}),i--):Uo.isElement(s)?e.isInline(s)&&(null!=l&&di.isText(l)?c&&(qi.insertNodes(e,{text:""},{at:r.concat(i+1),voids:!0}),i++):(qi.insertNodes(e,{text:""},{at:r.concat(i),voids:!0}),i++)):null!=l&&di.isText(l)&&(di.equals(s,l,{loose:!0})?(qi.mergeNodes(e,{at:r.concat(i),voids:!0}),i--):""===l.text?(qi.removeNodes(e,{at:r.concat(i-1),voids:!0}),i--):""===s.text&&(qi.removeNodes(e,{at:r.concat(i),voids:!0}),i--))}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ca(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return ko.levels(n);case"insert_node":var{node:r,path:o}=t,i=ko.levels(o),a=di.isText(r)?[]:Array.from(Xo.nodes(r),(e=>{var[,t]=e;return o.concat(t)}));return[...i,...a];case"merge_node":var{path:u}=t;return[...ko.ancestors(u),ko.previous(u)];case"move_node":var{path:s,newPath:l}=t;if(ko.equals(s,l))return[];var c=[],d=[];for(var f of ko.ancestors(s)){var h=ko.transform(f,t);c.push(h)}for(var p of ko.ancestors(l)){var v=ko.transform(p,t);d.push(v)}var g=d[d.length-1],m=l[l.length-1],D=g.concat(m);return[...c,...d,D];case"remove_node":var{path:b}=t;return[...ko.ancestors(b)];case"split_node":var{path:y}=t;return[...ko.levels(y),ko.next(y)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=Qo.path(e,o),u="lowest"===r;for(var[s,l]of Qo.levels(e,{at:a,voids:n,match:i,reverse:u}))if(!di.isText(s))if(Vo.isRange(o)){if(ko.isAncestor(l,o.anchor.path)&&ko.isAncestor(l,o.focus.path))return[s,l]}else if(!ko.equals(a,l))return[s,l]}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Qo.point(e,t,{edge:"end"}),focus:Qo.end(e,[])},{distance:i=1}=r,a=0;for(var u of Qo.positions(e,Zi(Zi({},r),{},{at:o}))){if(a>i)break;0!==a&&(n=u),a++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Qo.start(e,[]),focus:Qo.point(e,t,{edge:"start"})},{distance:i=1}=r,a=0;for(var u of Qo.positions(e,Gi(Gi({},r),{},{at:o,reverse:!0}))){if(a>i)break;0!==a&&(n=u),a++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)qi.select(e,r.anchor);else if("focus"===n)qi.select(e,r.focus);else if("start"===n){var[o]=Vo.edges(r);qi.select(e,o)}else if("end"===n){var[,i]=Vo.edges(r);qi.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qo.withoutNormalizing(e,(()=>{var n,r,{reverse:o=!1,unit:i="character",distance:a=1,voids:u=!1}=t,{at:s=e.selection,hanging:l=!1}=t;if(s){var c=!1;if(Vo.isRange(s)&&Vo.isCollapsed(s)&&(c=!0,s=s.anchor),ri.isPoint(s)){var d=Qo.void(e,{at:s,mode:"highest"});if(!u&&d){var[,f]=d;s=f}else{var h={unit:i,distance:a};s={anchor:s,focus:o?Qo.before(e,s,h)||Qo.start(e,[]):Qo.after(e,s,h)||Qo.end(e,[])},l=!0}}if(ko.isPath(s))qi.removeNodes(e,{at:s,voids:u});else if(!Vo.isCollapsed(s)){if(!l){var[,p]=Vo.edges(s),v=Qo.end(e,[]);ri.equals(p,v)||(s=Qo.unhangRange(e,s,{voids:u}))}var[g,m]=Vo.edges(s),D=Qo.above(e,{match:t=>Uo.isElement(t)&&Qo.isBlock(e,t),at:g,voids:u}),b=Qo.above(e,{match:t=>Uo.isElement(t)&&Qo.isBlock(e,t),at:m,voids:u}),y=D&&b&&!ko.equals(D[1],b[1]),C=ko.equals(g.path,m.path),w=u?null:null!==(n=Qo.void(e,{at:g,mode:"highest"}))&&void 0!==n?n:Qo.elementReadOnly(e,{at:g,mode:"highest"}),B=u?null:null!==(r=Qo.void(e,{at:m,mode:"highest"}))&&void 0!==r?r:Qo.elementReadOnly(e,{at:m,mode:"highest"});if(w){var E=Qo.before(e,g);E&&D&&ko.isAncestor(D[1],E.path)&&(g=E)}if(B){var A=Qo.after(e,m);A&&b&&ko.isAncestor(b[1],A.path)&&(m=A)}var x,F=[];for(var O of Qo.nodes(e,{at:s,voids:u})){var[k,S]=O;x&&0===ko.compare(S,x)||(!u&&Uo.isElement(k)&&(Qo.isVoid(e,k)||Qo.isElementReadOnly(e,k))||!ko.isCommon(S,g.path)&&!ko.isCommon(S,m.path))&&(F.push(O),x=S)}var j=Array.from(F,(t=>{var[,n]=t;return Qo.pathRef(e,n)})),P=Qo.pointRef(e,g),R=Qo.pointRef(e,m),T="";if(!C&&!w){var N=P.current,[_]=Qo.leaf(e,N),{path:M}=N,{offset:L}=g,I=_.text.slice(L);I.length>0&&(e.apply({type:"remove_text",path:M,offset:L,text:I}),T=I)}if(j.reverse().map((e=>e.unref())).filter((e=>null!==e)).forEach((t=>qi.removeNodes(e,{at:t,voids:u}))),!B){var z=R.current,[W]=Qo.leaf(e,z),{path:V}=z,q=C?g.offset:0,U=W.text.slice(q,m.offset);U.length>0&&(e.apply({type:"remove_text",path:V,offset:q,text:U}),T=U)}!C&&y&&R.current&&P.current&&qi.mergeNodes(e,{at:R.current,hanging:!0,voids:u}),c&&o&&"character"===i&&T.length>1&&T.match(/[\u0E00-\u0E7F]+/)&&qi.insertText(e,T.slice(0,T.length-a));var H=P.unref(),K=R.unref(),$=o?H||K:K||H;null==t.at&&$&&qi.select(e,$)}}}))}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>[Qo.start(e,t),Qo.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Qo.above(e,ea(ea({},t),{},{match:t=>Uo.isElement(t)&&Qo.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Qo.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Qo.path(e,t,{edge:"start"});return Qo.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Qo.range(e,t);return Xo.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:o}=n;if(t)return t;if(Vo.isExpanded(n)){if(Qo.isEnd(e,r,r.path)){var i=Qo.after(e,r);i&&(r=i)}var[a]=Qo.nodes(e,{match:di.isText,at:{anchor:r,focus:o}});if(a){var[u]=a;return Io(u,ia)}return{}}var{path:s}=r,[l]=Qo.leaf(e,s);if(0===r.offset){var c=Qo.previous(e,{at:s,match:di.isText}),d=Qo.above(e,{match:t=>Uo.isElement(t)&&Qo.isVoid(e,t)&&e.markableVoid(t)});if(!d){var f=Qo.above(e,{match:t=>Uo.isElement(t)&&Qo.isBlock(e,t)});if(c&&f){var[h,p]=c,[,v]=f;ko.isAncestor(v,p)&&(l=h)}}}return Io(l,aa)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some((t=>Uo.isElement(t)&&Qo.isBlock(e,t))))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some((t=>di.isText(t)||Qo.isInline(e,t))))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Xo.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.every((e=>di.isText(e))))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ha(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>Qo.isStart(e,t,n)||Qo.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&di.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var r=Qo.end(e,n);return ri.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Ao.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{if(0!==t.offset)return!1;var r=Qo.start(e,n);return ri.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Qo.path(e,t,{edge:"end"});return Qo.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Qo.path(e,t,n);return[Xo.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],u=Qo.path(e,n);for(var[s,l]of Xo.levels(e,u))if(i(s,l)&&(a.push([s,l]),!o&&Uo.isElement(s)&&Qo.isVoid(e,s)))break;r&&a.reverse(),yield*a}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qo.withoutNormalizing(e,(()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(null==i&&(i=ko.isPath(n)?hi(e,n):t=>Uo.isElement(t)&&Qo.isBlock(e,t)),n){var a=Qo.nodes(e,{at:n,match:i,mode:r,voids:o}),u=Array.from(a,(t=>{var[,n]=t;return Qo.pathRef(e,n)}));for(var s of u){var l=s.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=Qo.node(e,ko.parent(l)),[d,f]=c,h=l[l.length-1],{length:p}=d.children;if(1===p){var v=ko.next(f);qi.moveNodes(e,{at:l,to:v,voids:o}),qi.removeNodes(e,{at:f,voids:o})}else if(0===h)qi.moveNodes(e,{at:l,to:f,voids:o});else if(h===p-1){var g=ko.next(f);qi.moveNodes(e,{at:l,to:g,voids:o})}else{var m=ko.next(l),D=ko.next(f);qi.splitNodes(e,{at:m,voids:o}),qi.moveNodes(e,{at:l,to:D,voids:o})}}}}))}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qo.withoutNormalizing(e,(()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){if(null==n)if(ko.isPath(r)){var[u]=Qo.parent(e,r);n=e=>u.children.includes(e)}else n=t=>Uo.isElement(t)&&Qo.isBlock(e,t);if(!o&&Vo.isRange(r)&&(r=Qo.unhangRange(e,r,{voids:i})),Vo.isRange(r))if(Vo.isCollapsed(r))r=r.anchor;else{var[,s]=Vo.edges(r),l=Qo.pointRef(e,s);qi.delete(e,{at:r}),r=l.unref(),null==t.at&&qi.select(e,r)}var[c]=Qo.nodes(e,{at:r,match:n,voids:i,mode:a}),d=Qo.previous(e,{at:r,match:n,voids:i,mode:a});if(c&&d){var[f,h]=c,[p,v]=d;if(0!==h.length&&0!==v.length){var g,m,D=ko.next(v),b=ko.common(h,v),y=ko.isSibling(h,v),C=Array.from(Qo.levels(e,{at:h}),(e=>{var[t]=e;return t})).slice(b.length).slice(0,-1),w=Qo.above(e,{at:h,mode:"highest",match:t=>C.includes(t)&&ga(e,t)}),B=w&&Qo.pathRef(e,w[1]);if(di.isText(f)&&di.isText(p)){var E=Io(f,pa);m=p.text.length,g=E}else{if(!Uo.isElement(f)||!Uo.isElement(p))throw new Error("Cannot merge the node at path [".concat(h,"] with the previous sibling because it is not the same kind: ").concat(ii.stringify(f)," ").concat(ii.stringify(p)));E=Io(f,va),m=p.children.length,g=E}y||qi.moveNodes(e,{at:h,to:D,voids:i}),B&&qi.removeNodes(e,{at:B.current,voids:i}),Uo.isElement(p)&&Qo.isEmpty(e,p)||di.isText(p)&&""===p.text&&0!==v[v.length-1]?qi.removeNodes(e,{at:v,voids:i}):e.apply({type:"merge_node",path:D,position:m,properties:g}),B&&B.unref()}}}}))}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=Vo.isBackward(n)?"focus":"anchor"),"end"===a&&(a=Vo.isBackward(n)?"anchor":"focus");var{anchor:u,focus:s}=n,l={distance:r,unit:o,ignoreNonSelectable:!0},c={};if(null==a||"anchor"===a){var d=i?Qo.before(e,u,l):Qo.after(e,u,l);d&&(c.anchor=d)}if(null==a||"focus"===a){var f=i?Qo.before(e,s,l):Qo.after(e,s,l);f&&(c.focus=f)}qi.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{Qo.withoutNormalizing(e,(()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=ko.isPath(r)?hi(e,r):t=>Uo.isElement(t)&&Qo.isBlock(e,t));var u=Qo.pathRef(e,n),s=Qo.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(s,(t=>{var[,n]=t;return Qo.pathRef(e,n)}));for(var c of l){var d=c.unref(),f=u.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:f}),u.current&&ko.isSibling(f,d)&&ko.isAfter(f,d)&&(u.current=ko.next(u.current))}u.unref()}}))})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Qo.after(e,i,{voids:r});if(a){var[,u]=Qo.last(e,[]),s=[a.path,u];if(ko.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(ko.isPath(i)){var[l]=Qo.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Qo.nodes(e,{at:s,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Qo.path(e,t,n),o=Xo.get(e,r);return[o,r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1,ignoreNonSelectable:u=!1}=t,{match:s}=t;if(s||(s=()=>!0),n){var l,c;if(ei.isSpan(n))l=n[0],c=n[1];else{var d=Qo.path(e,n,{edge:"start"}),f=Qo.path(e,n,{edge:"end"});l=i?f:d,c=i?d:f}var h,p=Xo.nodes(e,{reverse:i,from:l,to:c,pass:t=>{var[n]=t;return!(!Uo.isElement(n)||(a||!Qo.isVoid(e,n)&&!Qo.isElementReadOnly(e,n))&&(!u||Qo.isSelectable(e,n)))}}),v=[];for(var[g,m]of p)if(!u||!Uo.isElement(g)||Qo.isSelectable(e,g)){var D=h&&0===ko.compare(m,h[1]);if("highest"!==r||!D)if(s(g,m))if("lowest"===r&&D)h=[g,m];else{var b="lowest"===r?h:[g,m];b&&(o?v.push(b):yield b),h=[g,m]}else if(o&&!D&&di.isText(g))return}"lowest"===r&&h&&(o?v.push(h):yield h),o&&(yield*v)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ua(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Qo.path(e,t,n),o=ko.parent(r);return Qo.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(ko.isPath(t))if("start"===o){var[,i]=Xo.first(e,t);t=i}else if("end"===o){var[,a]=Xo.last(e,t);t=a}return Vo.isRange(t)&&(t="start"===o?Vo.start(t):"end"===o?Vo.end(t):ko.common(t.anchor.path,t.focus.path)),ri.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Qo.pathRefs(e).delete(o),o.current=null,t}};return Qo.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=xo.get(e);return t||(t=new Set,xo.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(ko.isPath(t)){var o;if("end"===r){var[,i]=Xo.last(e,t);o=i}else{var[,a]=Xo.first(e,t);o=a}var u=Xo.get(e,o);if(!di.isText(u))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?u.text.length:0}}if(Vo.isRange(t)){var[s,l]=Vo.edges(t);return"start"===r?s:l}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Qo.pointRefs(e).delete(o),o.current=null,t}};return Qo.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Fo.get(e);return t||(t=new Set,Fo.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return sa(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Qo.before(e,i,{voids:r});if(a){var[,u]=Qo.first(e,[]),s=[a.path,u];if(ko.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(ko.isPath(i)){var[l]=Qo.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Qo.nodes(e,{reverse:!0,at:s,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>Vo.isRange(t)&&!n?t:{anchor:Qo.start(e,t),focus:Qo.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Qo.rangeRefs(e).delete(o),o.current=null,t}};return Qo.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Oo.get(e);return t||(t=new Set,Oo.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qo.withoutNormalizing(e,(()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=ko.isPath(i)?hi(e,i):t=>Uo.isElement(t)&&Qo.isBlock(e,t)),!n&&Vo.isRange(i)&&(i=Qo.unhangRange(e,i,{voids:r}));var u=Qo.nodes(e,{at:i,match:a,mode:o,voids:r}),s=Array.from(u,(t=>{var[,n]=t;return Qo.pathRef(e,n)}));for(var l of s){var c=l.unref();if(c){var[d]=Qo.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}}))}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;if(t=Qo.range(e,t),n)qi.setSelection(e,t);else{if(!Vo.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(ii.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Qo.withoutNormalizing(e,(()=>{var{match:r,at:o=e.selection,compare:i,merge:a}=n,{hanging:u=!1,mode:s="lowest",split:l=!1,voids:c=!1}=n;if(o){if(null==r&&(r=ko.isPath(o)?hi(e,o):t=>Uo.isElement(t)&&Qo.isBlock(e,t)),!u&&Vo.isRange(o)&&(o=Qo.unhangRange(e,o,{voids:c})),l&&Vo.isRange(o)){if(Vo.isCollapsed(o)&&Qo.leaf(e,o.anchor)[0].text.length>0)return;var d=Qo.rangeRef(e,o,{affinity:"inward"}),[f,h]=Vo.edges(o),p="lowest"===s?"lowest":"highest",v=Qo.isEnd(e,h,h.path);qi.splitNodes(e,{at:h,match:r,mode:p,voids:c,always:!v});var g=Qo.isStart(e,f,f.path);qi.splitNodes(e,{at:f,match:r,mode:p,voids:c,always:!g}),o=d.unref(),null==n.at&&qi.select(e,o)}for(var[m,D]of(i||(i=(e,t)=>e!==t),Qo.nodes(e,{at:o,match:r,mode:s,voids:c}))){var b={},y={};if(0!==D.length){var C=!1;for(var w in t)"children"!==w&&"text"!==w&&i(t[w],m[w])&&(C=!0,m.hasOwnProperty(w)&&(b[w]=m[w]),a?null!=t[w]&&(y[w]=a(m[w],t[w])):null!=t[w]&&(y[w]=t[w]));C&&e.apply({type:"set_node",path:D,properties:b,newProperties:y})}}}}))}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{Ao.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=Vo.isBackward(r)?"focus":"anchor"),"end"===o&&(o=Vo.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,u="anchor"===o?i:a;qi.setSelection(e,{["anchor"===o?"anchor":"focus"]:fa(fa({},u),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var i in t)("anchor"===i&&null!=t.anchor&&!ri.equals(t.anchor,n.anchor)||"focus"===i&&null!=t.focus&&!ri.equals(t.focus,n.focus)||"anchor"!==i&&"focus"!==i&&t[i]!==n[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ma(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Qo.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=Qo.range(e,t),[i,a]=Vo.edges(o),u="";for(var[s,l]of Qo.nodes(e,{at:o,match:di.isText,voids:r})){var c=s.text;ko.equals(l,a.path)&&(c=c.slice(0,a.offset)),ko.equals(l,i.path)&&(c=c.slice(i.offset)),u+=c}return u}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=Vo.edges(t);if(0!==o.offset||0!==i.offset||Vo.isCollapsed(t)||ko.hasPrevious(i.path))return t;var a=Qo.above(e,{at:i,match:t=>Uo.isElement(t)&&Qo.isBlock(e,t),voids:r}),u=a?a[1]:[],s={anchor:Qo.start(e,o),focus:i},l=!0;for(var[c,d]of Qo.nodes(e,{at:s,match:di.isText,reverse:!0,voids:r}))if(l)l=!1;else if(""!==c.text||ko.isBefore(d,u)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;qi.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qo.withoutNormalizing(e,(()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=ko.isPath(i)?hi(e,i):t=>Uo.isElement(t)&&Qo.isBlock(e,t)),ko.isPath(i)&&(i=Qo.range(e,i));var u=Vo.isRange(i)?Qo.rangeRef(e,i):null,s=Qo.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(s,(t=>{var[,n]=t;return Qo.pathRef(e,n)})).reverse(),c=function(){var t=d.unref(),[n]=Qo.node(e,t),i=Qo.range(e,t);r&&u&&(i=Vo.intersection(u.current,i)),qi.liftNodes(e,{at:i,match:e=>Uo.isAncestor(n)&&n.children.includes(e),voids:o})};for(var d of l)c();u&&u.unref()}}))}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Qo.above(e,na(na({},t),{},{match:t=>Uo.isElement(t)&&Qo.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Qo.isNormalizing(e);Qo.setNormalizing(e,!1);try{t()}finally{Qo.setNormalizing(e,n)}Qo.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Qo.withoutNormalizing(e,(()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:u=e.selection}=n;if(u){if(null==a&&(a=ko.isPath(u)?hi(e,u):e.isInline(t)?t=>Uo.isElement(t)&&Qo.isInline(e,t)||di.isText(t):t=>Uo.isElement(t)&&Qo.isBlock(e,t)),o&&Vo.isRange(u)){var[s,l]=Vo.edges(u),c=Qo.rangeRef(e,u,{affinity:"inward"});qi.splitNodes(e,{at:l,match:a,voids:i}),qi.splitNodes(e,{at:s,match:a,voids:i}),u=c.unref(),null==n.at&&qi.select(e,u)}var d=Array.from(Qo.nodes(e,{at:u,match:e.isInline(t)?t=>Uo.isElement(t)&&Qo.isBlock(e,t):e=>Qo.isEditor(e),mode:"lowest",voids:i})),f=function(){var n=Vo.isRange(u)?Vo.intersection(u,Qo.range(e,h)):u;if(!n)return 0;var o=Array.from(Qo.nodes(e,{at:n,match:a,mode:r,voids:i}));if(o.length>0){var[s]=o,l=o[o.length-1],[,c]=s,[,d]=l;if(0===c.length&&0===d.length)return 0;var f=ko.equals(c,d)?ko.parent(c):ko.common(c,d),p=Qo.range(e,c,d),v=Qo.node(e,f),[g]=v,m=f.length+1,D=ko.next(d.slice(0,m)),b=ba(ba({},t),{},{children:[]});qi.insertNodes(e,b,{at:D,voids:i}),qi.moveNodes(e,{at:p,match:e=>Uo.isAncestor(g)&&g.children.includes(e),to:D.concat(0),voids:i})}};for(var[,h]of d)f()}}))}(e,...n)}};return e},wa=[],Ba="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(ya||(ya={}));var Ea,Aa=function(e){return Object.freeze(e)},xa=function(e,t){this.inlineSize=e,this.blockSize=t,Aa(this)},Fa=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Aa(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Oa=function(e){return e instanceof SVGElement&&"getBBox"in e},ka=function(e){if(Oa(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Sa=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},ja="undefined"!=typeof window?window:{},Pa=new WeakMap,Ra=/auto|scroll/,Ta=/^tb|vertical/,Na=/msie|trident/i.test(ja.navigator&&ja.navigator.userAgent),_a=function(e){return parseFloat(e||"0")},Ma=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new xa((n?t:e)||0,(n?e:t)||0)},La=Aa({devicePixelContentBoxSize:Ma(),borderBoxSize:Ma(),contentBoxSize:Ma(),contentRect:new Fa(0,0,0,0)}),Ia=function(e,t){if(void 0===t&&(t=!1),Pa.has(e)&&!t)return Pa.get(e);if(ka(e))return Pa.set(e,La),La;var n=getComputedStyle(e),r=Oa(e)&&e.ownerSVGElement&&e.getBBox(),o=!Na&&"border-box"===n.boxSizing,i=Ta.test(n.writingMode||""),a=!r&&Ra.test(n.overflowY||""),u=!r&&Ra.test(n.overflowX||""),s=r?0:_a(n.paddingTop),l=r?0:_a(n.paddingRight),c=r?0:_a(n.paddingBottom),d=r?0:_a(n.paddingLeft),f=r?0:_a(n.borderTopWidth),h=r?0:_a(n.borderRightWidth),p=r?0:_a(n.borderBottomWidth),v=d+l,g=s+c,m=(r?0:_a(n.borderLeftWidth))+h,D=f+p,b=u?e.offsetHeight-D-e.clientHeight:0,y=a?e.offsetWidth-m-e.clientWidth:0,C=o?v+m:0,w=o?g+D:0,B=r?r.width:_a(n.width)-C-y,E=r?r.height:_a(n.height)-w-b,A=B+v+y+m,x=E+g+b+D,F=Aa({devicePixelContentBoxSize:Ma(Math.round(B*devicePixelRatio),Math.round(E*devicePixelRatio),i),borderBoxSize:Ma(A,x,i),contentBoxSize:Ma(B,E,i),contentRect:new Fa(d,s,B,E)});return Pa.set(e,F),F},za=function(e,t,n){var r=Ia(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case ya.DEVICE_PIXEL_CONTENT_BOX:return a;case ya.BORDER_BOX:return o;default:return i}},Wa=function(e){var t=Ia(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Aa([t.borderBoxSize]),this.contentBoxSize=Aa([t.contentBoxSize]),this.devicePixelContentBoxSize=Aa([t.devicePixelContentBoxSize])},Va=function(e){if(ka(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},qa=function(){var e=1/0,t=[];wa.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Wa(t.target),o=Va(t.target);r.push(n),t.lastReportedSize=za(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},Ua=function(e){wa.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(Va(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Ha=function(){var e,t=0;for(Ua(t);wa.some((function(e){return e.activeTargets.length>0}));)t=qa(),Ua(t);return wa.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Ba}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Ba),window.dispatchEvent(e)),t>0},Ka=[],$a=function(e){if(!Ea){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Ka.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Ea=function(){n.textContent="".concat(t?t--:t++)}}Ka.push(e),Ea()},Xa=0,Ya={attributes:!0,characterData:!0,childList:!0,subtree:!0},Za=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ja=function(e){return void 0===e&&(e=0),Date.now()+e},Ga=!1,Qa=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!Ga){Ga=!0;var n,r=Ja(e);n=function(){var n=!1;try{n=Ha()}finally{if(Ga=!1,e=r-Ja(),!Xa)return;n?t.run(1e3):e>0?t.run(e):t.start()}},$a((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Ya)};document.body?t():ja.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Za.forEach((function(t){return ja.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Za.forEach((function(t){return ja.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),eu=function(e){!Xa&&e>0&&Qa.start(),!(Xa+=e)&&Qa.stop()},tu=function(){function e(e,t){this.target=e,this.observedBox=t||ya.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=za(this.target,this.observedBox,!0);return e=this.target,Oa(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),nu=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ru=new WeakMap,ou=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},iu=function(){function e(){}return e.connect=function(e,t){var n=new nu(e,t);ru.set(e,n)},e.observe=function(e,t,n){var r=ru.get(e),o=0===r.observationTargets.length;ou(r.observationTargets,t)<0&&(o&&wa.push(r),r.observationTargets.push(new tu(t,n&&n.box)),eu(1),Qa.schedule())},e.unobserve=function(e,t){var n=ru.get(e),r=ou(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&wa.splice(wa.indexOf(n),1),n.observationTargets.splice(r,1),eu(-1))},e.disconnect=function(e){var t=this,n=ru.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),au=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");iu.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Sa(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");iu.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Sa(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");iu.unobserve(this,e)},e.prototype.disconnect=function(){iu.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),uu={};Object.defineProperty(uu,"__esModule",{value:!0});for(var su="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),lu={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},cu={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:su?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},du={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},fu=1;fu<20;fu++)du["f"+fu]=111+fu;function hu(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return pu(e,t)})),o=function(e){return r.some((function(t){return vu(t,e)}))};return null==n?o:o(n)}function pu(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var a in lu)r[lu[a]]=!1;var u=!0,s=!1,l=void 0;try{for(var c,d=o[Symbol.iterator]();!(u=(c=d.next()).done);u=!0){var f=c.value,h=f.endsWith("?")&&f.length>1;h&&(f=f.slice(0,-1));var p=mu(f),v=lu[p];if(f.length>1&&!v&&!cu[f]&&!du[p])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&v||(n?r.key=p:r.which=gu(f)),v&&(r[v]=!h||null)}}catch(e){s=!0,l=e}finally{try{!u&&d.return&&d.return()}finally{if(s)throw l}}return r}function vu(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 gu(e){return e=mu(e),du[e]||e.toUpperCase().charCodeAt(0)}function mu(e){return e=e.toLowerCase(),e=cu[e]||e}uu.default=hu;var Du=uu.isHotkey=hu;uu.isCodeHotkey=function(e,t){return hu(e,t)};var bu=uu.isKeyHotkey=function(e,t){return hu(e,{byKey:!0},t)};function yu(e,t){if(null==e)return{};var n,r,o=function(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}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Cu(e){return Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(e)}function wu(e){var t=function(e,t){if("object"!==Cu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Cu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Cu(t)?t:String(t)}function Bu(e,t,n){return(t=wu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}uu.parseHotkey=pu,uu.compareHotkey=vu,uu.toKeyCode=gu,uu.toKeyName=mu;var Eu=i(null),Au=()=>{var e=a(Eu);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},xu=parseInt(o.version.split(".")[0],10),Fu="undefined"!=typeof navigator&&"undefined"!=typeof window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ou="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),ku="undefined"!=typeof navigator&&/Android/.test(navigator.userAgent),Su="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ju="undefined"!=typeof navigator&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),Pu="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Ru="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),Tu="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Nu=ku&&"undefined"!=typeof navigator&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),_u="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),Mu="undefined"!=typeof navigator&&/.*UCBrowser/.test(navigator.userAgent),Lu="undefined"!=typeof navigator&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Iu=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),zu=(!Tu||!Nu)&&!Pu&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,Wu=new WeakMap,Vu=new WeakMap,qu=new WeakMap,Uu=new WeakMap,Hu=new WeakMap,Ku=new WeakMap,$u=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,Gu=new WeakMap,Qu=new WeakMap,es=new WeakMap,ts=new WeakMap,ns=new WeakMap,rs=new WeakMap,os=new WeakMap,is=new WeakMap,as=new WeakMap,us=new WeakMap,ss=Symbol("placeholder"),ls=Symbol("mark-placeholder"),cs=globalThis.Text,ds=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,fs=e=>hs(e)&&1===e.nodeType,hs=e=>{var t=ds(e);return!!t&&e instanceof t.Node},ps=e=>{var t=e&&e.anchorNode&&ds(e.anchorNode);return!!t&&e instanceof t.Selection},vs=e=>hs(e)&&3===e.nodeType,gs=(e,t,n)=>{for(var r,{childNodes:o}=e,i=o[t],a=t,u=!1,s=!1;(hs(r=i)&&8===r.nodeType||fs(i)&&0===i.childNodes.length||fs(i)&&"false"===i.getAttribute("contenteditable"))&&(!u||!s);)a>=o.length?(u=!0,a=t-1,n="backward"):a<0?(s=!0,a=t+1,n="forward"):(i=o[a],t=a,a+="forward"===n?1:-1);return[i,t]},ms=(e,t,n)=>{var[r]=gs(e,t,n);return r},Ds=e=>{var t="";if(vs(e)&&e.nodeValue)return e.nodeValue;if(fs(e)){for(var n of Array.from(e.childNodes))t+=Ds(n);var r=getComputedStyle(e).getPropertyValue("display");"block"!==r&&"list"!==r&&"BR"!==e.tagName||(t+="\n")}return t},bs=/data-slate-fragment="(.+?)"/m,ys=(e,t,n)=>{var{target:r}=t;if(fs(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:o}=Bs.getWindow(e);if(o.contains(r))return Bs.hasDOMNode(e,r,{editable:!0});var i=n.find((e=>{var{addedNodes:t,removedNodes:n}=e;for(var o of t)if(o===r||o.contains(r))return!0;for(var i of n)if(i===r||i.contains(r))return!0}));return!(!i||i===t)&&ys(e,i,n)},Cs=0;class ws{constructor(){Bu(this,"id",void 0),this.id="".concat(Cs++)}}var Bs={androidPendingDiffs:e=>os.get(e),androidScheduleFlush:e=>{var t;null===(t=ts.get(e))||void 0===t||t()},blur:e=>{var t=Bs.toDOMNode(e,e),n=Bs.findDocumentOrShadowRoot(e);Ju.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=Bs.findDocumentOrShadowRoot(e).getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),t&&qi.deselect(e)},findDocumentOrShadowRoot:e=>{var t=Bs.toDOMNode(e,e),n=t.getRootNode();return(n instanceof Document||n instanceof ShadowRoot)&&null!=n.getSelection?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:o}=t;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=Bs.toSlateNode(e,t.target),u=Bs.findPath(e,a);if(Uo.isElement(a)&&Qo.isVoid(e,a)){var s=o.getBoundingClientRect(),l=e.isInline(a)?n-s.left<s.left+s.width-n:r-s.top<s.top+s.height-r,c=Qo.point(e,u,{edge:l?"start":"end"}),d=l?Qo.before(e,c):Qo.after(e,c);if(d)return Qo.range(e,d)}var{document:f}=Bs.getWindow(e);if(f.caretRangeFromPoint)i=f.caretRangeFromPoint(n,r);else{var h=f.caretPositionFromPoint(n,r);h&&((i=f.createRange()).setStart(h.offsetNode,h.offset),i.setEnd(h.offsetNode,h.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return Bs.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},findKey:(e,t)=>{var n=Xu.get(t);return n||(n=new ws,Xu.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var o=Vu.get(r);if(null==o){if(Qo.isEditor(r))return n;break}var i=Wu.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(ii.stringify(t)))},focus:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{retries:5};if(!Ju.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(e.operations.length>0)setTimeout((()=>{Bs.focus(e,{retries:t.retries-1})}),10);else{var n=Bs.toDOMNode(e,e),r=Bs.findDocumentOrShadowRoot(e);if(r.activeElement!==n){if(e.selection&&r instanceof Document){var o=r.getSelection(),i=Bs.toDOMRange(e,e.selection);null==o||o.removeAllRanges(),null==o||o.addRange(i)}e.selection||(qi.select(e,Qo.start(e,[])),e.onChange()),Ju.set(e,!0),n.focus({preventScroll:!0})}}}},getWindow:e=>{var t=qu.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{editable:o=!1}=r,i=Bs.toDOMNode(e,e);try{n=fs(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!n&&!(n.closest("[data-slate-editor]")!==i||o&&!n.isContentEditable&&("boolean"!=typeof n.isContentEditable||n.closest('[contenteditable="false"]')!==i)&&!n.getAttribute("data-slate-zero-width"))},hasEditableTarget:(e,t)=>hs(t)&&Bs.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return Qo.hasPath(e,n.path)&&Qo.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>Bs.hasEditableTarget(e,t)||Bs.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>hs(t)&&Bs.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!Gu.get(e),isFocused:e=>!!Ju.get(e),isReadOnly:e=>!!Zu.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Zu.get(e))return!1;var n=Bs.hasTarget(e,t)&&Bs.toSlateNode(e,t);return Uo.isElement(n)&&Qo.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=Yu.get(e),r=Qo.isEditor(t)?Uu.get(e):null==n?void 0:n.get(Bs.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(ii.stringify(t)));return r},toDOMPoint:(e,t)=>{var n,[r]=Qo.node(e,t.path),o=Bs.toDOMNode(e,r);Qo.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i=Array.from(o.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),a=0,u=0;u<i.length;u++){var s=i[u],l=s.childNodes[0];if(null!=l&&null!=l.textContent){var{length:c}=l.textContent,d=s.getAttribute("data-slate-length"),f=a+(null==d?c:parseInt(d,10)),h=i[u+1];if(t.offset===f&&null!=h&&h.hasAttribute("data-slate-mark-placeholder")){var p,v=h.childNodes[0];n=[v instanceof cs?v:h,null!==(p=h.textContent)&&void 0!==p&&p.startsWith("\ufeff")?1:0];break}if(t.offset<=f){n=[l,Math.min(c,Math.max(0,t.offset-a))];break}a=f}}if(!n)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(ii.stringify(t)));return n},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,o=Vo.isBackward(t),i=Bs.toDOMPoint(e,n),a=Vo.isCollapsed(t)?i:Bs.toDOMPoint(e,r),u=Bs.getWindow(e).document.createRange(),[s,l]=o?a:i,[c,d]=o?i:a,f=!!(fs(s)?s:s.parentElement).getAttribute("data-slate-zero-width"),h=!!(fs(c)?c:c.parentElement).getAttribute("data-slate-zero-width");return u.setStart(s,f?1:l),u.setEnd(c,h?1:d),u},toSlateNode:(e,t)=>{var n=fs(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Ku.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:o}=n,[i,a]=r?t:(e=>{var[t,n]=e;if(fs(t)&&t.childNodes.length){var r=n===t.childNodes.length,o=r?n-1:n;for([t,o]=gs(t,o,r?"backward":"forward"),r=o<n;fs(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=ms(t,i,r?"backward":"forward")}n=r&&null!=t.textContent?t.textContent.length:0}return[t,n]})(t),u=i.parentNode,s=null,l=0;if(u){var c,d,f=Bs.toDOMNode(e,e),h=u.closest('[data-slate-void="true"]'),p=h&&f.contains(h)?h:null,v=u.closest("[data-slate-leaf]"),g=null;if(v){if(s=v.closest('[data-slate-node="text"]')){var m=Bs.getWindow(e).document.createRange();m.setStart(s,0),m.setEnd(i,a);var D=m.cloneContents();[...Array.prototype.slice.call(D.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(D.querySelectorAll("[contenteditable=false]"))].forEach((e=>{ku&&!r&&e.hasAttribute("data-slate-zero-width")&&e.textContent.length>0&&"\ufeff"!==e.textContext?e.textContent.startsWith("\ufeff")&&(e.textContent=e.textContent.slice(1)):e.parentNode.removeChild(e)})),l=D.textContent.length,g=s}}else if(p){for(var b=p.querySelectorAll("[data-slate-leaf]"),y=0;y<b.length;y++){var C=b[y];if(Bs.hasDOMNode(e,C)){v=C;break}}v?(s=v.closest('[data-slate-node="text"]'),l=(g=v).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((e=>{l-=e.textContent.length}))):l=1}g&&l===g.textContent.length&&ku&&"z"===g.getAttribute("data-slate-zero-width")&&null!==(c=g.textContent)&&void 0!==c&&c.startsWith("\ufeff")&&(u.hasAttribute("data-slate-zero-width")||Su&&null!==(d=g.textContent)&&void 0!==d&&d.endsWith("\n\n"))&&l--}if(ku&&!s&&!r){var w=u.hasAttribute("data-slate-node")?u:u.closest("[data-slate-node]");if(w&&Bs.hasDOMNode(e,w,{editable:!0})){var B=Bs.toSlateNode(e,w),{path:E,offset:A}=Qo.start(e,Bs.findPath(e,B));return w.querySelector("[data-slate-leaf]")||(A=a),{path:E,offset:A}}}if(!s){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var x=Bs.toSlateNode(e,s);return{path:Bs.findPath(e,x),offset:l}},toSlateRange:(e,t,n)=>{var r,o,i,a,u,s,l,{exactMatch:c,suppressThrow:d}=n;if(ps(t)?t.anchorNode:t.startContainer)if(ps(t)){if(Su&&t.rangeCount>1){a=t.focusNode;var f=t.getRangeAt(0),h=t.getRangeAt(t.rangeCount-1);if(a instanceof HTMLTableRowElement&&f.startContainer instanceof HTMLTableRowElement&&h.startContainer instanceof HTMLTableRowElement){function C(e){return e.childElementCount>0?C(e.children[0]):e}var p=f.startContainer,v=h.startContainer,g=C(p.children[f.startOffset]),m=C(v.children[h.startOffset]);u=0,o=m.childNodes.length>0?m.childNodes[0]:m,a=g.childNodes.length>0?g.childNodes[0]:g,i=m instanceof HTMLElement?m.innerHTML.length:0}else f.startContainer===a?(o=h.endContainer,i=h.endOffset,u=f.startOffset):(o=f.startContainer,i=f.endOffset,u=h.startOffset)}else o=t.anchorNode,i=t.anchorOffset,a=t.focusNode,u=t.focusOffset;s=Ru&&(e=>{for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1})(o)||Su?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed}else o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,s=t.collapsed;if(null==o||null==a||null==i||null==u)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));(Su&&null!==(r=a.textContent)&&void 0!==r&&r.endsWith("\n\n")&&u===a.textContent.length&&u--,"getAttribute"in a&&"false"===a.getAttribute("contenteditable")&&"true"!==a.getAttribute("data-slate-void"))&&(a=o,u=(null===(l=o.textContent)||void 0===l?void 0:l.length)||0);var D=Bs.toSlatePoint(e,[o,i],{exactMatch:c,suppressThrow:d});if(!D)return null;var b=s?D:Bs.toSlatePoint(e,[a,u],{exactMatch:c,suppressThrow:d});if(!b)return null;var y={anchor:D,focus:b};return Vo.isExpanded(y)&&Vo.isForward(y)&&fs(a)&&Qo.void(e,{at:y.focus,mode:"highest"})&&(y=Qo.unhangRange(e,y,{voids:!0})),y}};function Es(e,t){var{path:n,diff:r}=t;if(!Qo.hasPath(e,n))return!1;var o=Xo.get(e,n);if(!di.isText(o))return!1;if(r.start!==o.text.length||0===r.text.length)return o.text.slice(r.start,r.start+r.text.length)===r.text;var i=ko.next(n);if(!Qo.hasPath(e,i))return!1;var a=Xo.get(e,i);return di.isText(a)&&a.text.startsWith(r.text)}function As(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce(((e,t)=>e.slice(0,t.start)+t.text+e.slice(t.end)),e)}function xs(e,t){var{start:n,end:r,text:o}=t,i=e.slice(n,r),a=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return n}(i,o),u=function(e,t,n){for(var r=Math.min(e.length,t.length,n),o=0;o<r;o++)if(e.charAt(e.length-o-1)!==t.charAt(t.length-o-1))return o;return r}(i,o,Math.min(i.length-a,o.length-a)),s={start:n+a,end:r-u,text:o.slice(a,o.length-u)};return s.start===s.end&&0===s.text.length?null:s}function Fs(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function Os(e,t){var{path:n,offset:r}=t;if(!Qo.hasPath(e,n))return null;var o=Xo.get(e,n);if(!di.isText(o))return null;var i=Qo.above(e,{match:t=>Uo.isElement(t)&&Qo.isBlock(e,t),at:n});if(!i)return null;for(;r>o.text.length;){var a=Qo.next(e,{at:n,match:di.isText});if(!a||!ko.isDescendant(a[1],i[1]))return null;r-=o.text.length,o=a[0],n=a[1]}return{path:n,offset:r}}function ks(e,t){var n=Os(e,t.anchor);if(!n)return null;if(Vo.isCollapsed(t))return{anchor:n,focus:n};var r=Os(e,t.focus);return r?{anchor:n,focus:r}:null}function Ss(e,t,n){var r=os.get(e),o=null==r?void 0:r.find((e=>{var{path:n}=e;return ko.equals(n,t.path)}));if(!o||t.offset<=o.diff.start)return ri.transform(t,n,{affinity:"backward"});var{diff:i}=o;if(t.offset<=i.start+i.text.length){var a={path:t.path,offset:i.start},u=ri.transform(a,n,{affinity:"backward"});return u?{path:u.path,offset:u.offset+t.offset-i.start}:null}var s={path:t.path,offset:t.offset-i.text.length+i.end-i.start},l=ri.transform(s,n,{affinity:"backward"});return l?"split_node"===n.type&&ko.equals(n.path,t.path)&&s.offset<n.position&&i.start<n.position?l:{path:l.path,offset:l.offset+i.text.length-i.end+i.start}:null}function js(e,t,n){var r=Ss(e,t.anchor,n);if(!r)return null;if(Vo.isCollapsed(t))return{anchor:r,focus:r};var o=Ss(e,t.focus,n);return o?{anchor:r,focus:o}:null}function Ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ps(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ts(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,o=!1,i=null,a=null,u=null,s=0,l=!1,c=()=>{var e=as.get(t);if(as.delete(t),e){var{selection:n}=t,r=ks(t,e);!r||n&&Vo.equals(r,n)||qi.select(t,r)}},d=()=>{if(a&&(clearTimeout(a),a=null),u&&(clearTimeout(u),u=null),g()||v()){o||(o=!0,setTimeout((()=>o=!1))),v()&&(o="action");var e=t.selection&&Qo.rangeRef(t,t.selection,{affinity:"forward"});rs.set(t,t.marks),is.get(t),os.get(t);for(var i,s=g();i=null===(d=os.get(t))||void 0===d?void 0:d[0];){var d,f,h=ns.get(t);void 0!==h&&(ns.delete(t),t.marks=h),h&&!1===l&&(l=null);var p=Fs(i);t.selection&&Vo.equals(t.selection,p)||qi.select(t,p),i.diff.text?Qo.insertText(t,i.diff.text):Qo.deleteFragment(t),os.set(t,null===(f=os.get(t))||void 0===f?void 0:f.filter((e=>{var{id:t}=e;return t!==i.id}))),Es(t,i)||(s=!1,is.delete(t),rs.delete(t),o="action",as.delete(t),n.cancel(),r.cancel(),null==e||e.unref())}var m=null==e?void 0:e.unref();if(!m||as.get(t)||t.selection&&Vo.equals(m,t.selection)||qi.select(t,m),v())(()=>{var e=is.get(t);if(is.delete(t),e){if(e.at){var n=ri.isPoint(e.at)?Os(t,e.at):ks(t,e.at);if(!n)return;var r=Qo.range(t,n);t.selection&&Vo.equals(t.selection,r)||qi.select(t,n)}e.run()}})();else{s&&n(),n.flush(),r.flush(),c();var D=rs.get(t);rs.delete(t),void 0!==D&&(t.marks=D,t.onChange())}}else c()},f=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Hu.get(t);n&&(g()||e?n.style.display="none":n.style.removeProperty("display"))},h=(e,n)=>{var r,o=null!==(r=os.get(t))&&void 0!==r?r:[];os.set(t,o);var i=Xo.leaf(t,e),a=o.findIndex((t=>ko.equals(t.path,e)));if(a<0)return xs(i.text,n)&&o.push({path:e,diff:n,id:s++}),void f();var u=function(e,t,n){var r=Math.min(t.start,n.start),o=Math.max(0,Math.min(t.start+t.text.length,n.end)-n.start),i=As(e,t,n),a=Math.max(n.start+n.text.length,t.start+t.text.length+(t.start+t.text.length>n.start?n.text.length:0)-o),u=i.slice(r,a);return xs(e,{start:r,end:Math.max(t.end,n.end-t.text.length+(t.end-t.start)),text:u})}(i.text,o[a].diff,n);if(!u)return o.splice(a,1),void f();o[a]=Rs(Rs({},o[a]),{},{diff:u})},p=function(e){var{at:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l=!1,as.delete(t),n.cancel(),r.cancel(),v()&&d(),is.set(t,{at:o,run:e}),u=setTimeout(d)},v=()=>!!is.get(t),g=()=>{var e;return!(null===(e=os.get(t))||void 0===e||!e.length)},m=e=>{as.set(t,e),a&&(clearTimeout(a),a=null);var{selection:n}=t;if(e){var r=!n||!ko.equals(n.anchor.path,e.anchor.path),o=!n||!ko.equals(n.anchor.path.slice(0,-1),e.anchor.path.slice(0,-1));(r&&l||o)&&(l=!1),(r||g())&&(a=setTimeout(d,200))}},D=()=>{v()||(u=setTimeout(d))};return{flush:d,scheduleFlush:D,hasPendingDiffs:g,hasPendingAction:v,hasPendingChanges:()=>v()||g(),isFlushing:()=>o,handleUserSelect:m,handleCompositionEnd:e=>{i&&clearTimeout(i),i=setTimeout((()=>{Gu.set(t,!1),d()}),25)},handleCompositionStart:e=>{Gu.set(t,!0),i&&(clearTimeout(i),i=null)},handleDOMBeforeInput:e=>{var n;a&&(clearTimeout(a),a=null);var{inputType:r}=e,o=null,i=e.dataTransfer||e.data||void 0;!1!==l&&"insertText"!==r&&"insertCompositionText"!==r&&(l=!1);var[u]=e.getTargetRanges();u&&(o=Bs.toSlateRange(t,u,{exactMatch:!1,suppressThrow:!0}));var s=Bs.getWindow(t).getSelection();if(!o&&s&&(u=s,o=Bs.toSlateRange(t,s,{exactMatch:!1,suppressThrow:!0})),o=null!==(n=o)&&void 0!==n?n:t.selection){var c,d=!0;if(r.startsWith("delete")){if(Vo.isExpanded(o)){var[f,v]=Vo.edges(o);if(Xo.leaf(t,f.path).text.length===f.offset&&0===v.offset){var g=Qo.next(t,{at:f.path,match:di.isText});g&&ko.equals(g[1],v.path)&&(o={anchor:v,focus:v})}}var b=r.endsWith("Backward")?"backward":"forward",[y,C]=Vo.edges(o),[w,B]=Qo.leaf(t,y.path),E={text:"",start:y.offset,end:C.offset},A=os.get(t),x=null==A?void 0:A.find((e=>ko.equals(e.path,B))),F=x?[x.diff,E]:[E];if(0===As(w.text,...F).length&&(d=!1),Vo.isExpanded(o)){if(d&&ko.equals(o.anchor.path,o.focus.path)){var O={path:o.anchor.path,offset:y.offset},k=Qo.range(t,O,O);return m(k),h(o.anchor.path,{text:"",end:C.offset,start:y.offset})}return p((()=>Qo.deleteFragment(t,{direction:b})),{at:o})}}switch(r){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return p((()=>Qo.deleteFragment(t)),{at:o});case"deleteContent":case"deleteContentForward":var{anchor:S}=o;if(d&&Vo.isCollapsed(o)){var j=Xo.leaf(t,S.path);if(S.offset<j.text.length)return h(S.path,{text:"",start:S.offset,end:S.offset+1})}return p((()=>Qo.deleteForward(t)),{at:o});case"deleteContentBackward":var P,{anchor:R}=o,T=ps(u)?u.isCollapsed:!(null===(P=u)||void 0===P||!P.collapsed);return d&&T&&Vo.isCollapsed(o)&&R.offset>0?h(R.path,{text:"",start:R.offset-1,end:R.offset}):p((()=>Qo.deleteBackward(t)),{at:o});case"deleteEntireSoftLine":return p((()=>{Qo.deleteBackward(t,{unit:"line"}),Qo.deleteForward(t,{unit:"line"})}),{at:o});case"deleteHardLineBackward":return p((()=>Qo.deleteBackward(t,{unit:"block"})),{at:o});case"deleteSoftLineBackward":return p((()=>Qo.deleteBackward(t,{unit:"line"})),{at:o});case"deleteHardLineForward":return p((()=>Qo.deleteForward(t,{unit:"block"})),{at:o});case"deleteSoftLineForward":return p((()=>Qo.deleteForward(t,{unit:"line"})),{at:o});case"deleteWordBackward":return p((()=>Qo.deleteBackward(t,{unit:"word"})),{at:o});case"deleteWordForward":return p((()=>Qo.deleteForward(t,{unit:"word"})),{at:o});case"insertLineBreak":return p((()=>Qo.insertSoftBreak(t)),{at:o});case"insertParagraph":return p((()=>Qo.insertBreak(t)),{at:o});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("DataTransfer"===(null==(c=i)?void 0:c.constructor.name))return p((()=>Bs.insertData(t,i)),{at:o});var N=null!=i?i:"";if(ns.get(t)&&(N=N.replace("\ufeff","")),"insertText"===r&&/.*\n.*\n$/.test(N)&&(N=N.slice(0,-1)),N.includes("\n"))return p((()=>{var e=N.split("\n");e.forEach(((n,r)=>{n&&Qo.insertText(t,n),r!==e.length-1&&Qo.insertSoftBreak(t)}))}),{at:o});if(ko.equals(o.anchor.path,o.focus.path)){var[_,M]=Vo.edges(o),L={start:_.offset,end:M.offset,text:N};if(N&&l&&"insertCompositionText"===r){var I=l.start+l.text.search(/\S|$/);L.start+L.text.search(/\S|$/)===I+1&&L.end===l.start+l.text.length?(L.start-=1,l=null,D()):l=!1}else l="insertText"===r&&(null===l?L:!(!l||!Vo.isCollapsed(o)||l.end+l.text.length!==_.offset)&&Rs(Rs({},l),{},{text:l.text+N}));if(d)return void h(_.path,L)}return p((()=>Qo.insertText(t,N)),{at:o})}}},handleKeyDown:e=>{g()||(f(!0),setTimeout(f))},handleDomMutations:e=>{var n;g()||v()||e.some((n=>ys(t,n,e)))&&(null===(n=us.get(t))||void 0===n||n())},handleInput:()=>{!v()&&g()||d()}}}var Ns=Iu?s:l;var _s=["node"];function Ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ls={subtree:!0,childList:!0,characterData:!0},Is=ku?e=>{var{node:t}=e,n=yu(e,_s);if(!ku)return null;var r,o=Au(),i=(r=u(!1),l((()=>(r.current=!0,()=>{r.current=!1})),[]),r.current),[a]=f((()=>Ts(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ms(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ms(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({editor:o},n))));return function(e,t,n){var[r]=f((()=>new MutationObserver(t)));Ns((()=>{r.takeRecords()})),l((()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()}),[r,e,n])}(t,a.handleDomMutations,Ls),ts.set(o,a.scheduleFlush),i&&a.flush(),a}:()=>null,zs=["anchor","focus"],Ws=["anchor","focus"],Vs=(e,t)=>{var n,r,o=yu(e,zs),i=yu(t,Ws);return e[ss]===t[ss]&&(n=o,r=i,Object.keys(n).length===Object.keys(r).length&&Object.keys(n).every((e=>r.hasOwnProperty(e)&&n[e]===r[e])))};function qs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Us=e=>{var{isLast:t,leaf:n,parent:r,text:i}=e,a=Au(),u=Bs.findPath(a,i),s=ko.parent(u),l=Boolean(n[ls]);return a.isVoid(r)?o.createElement($s,{length:Xo.string(r).length}):""!==n.text||r.children[r.children.length-1]!==i||a.isInline(r)||""!==Qo.string(a,s)?""===n.text?o.createElement($s,{isMarkPlaceholder:l}):t&&"\n"===n.text.slice(-1)?o.createElement(Hs,{isTrailing:!0,text:n.text}):o.createElement(Hs,{text:n.text}):o.createElement($s,{isLineBreak:!0,isMarkPlaceholder:l})},Hs=e=>{var{text:t,isTrailing:n=!1}=e,r=u(null),i=()=>"".concat(null!=t?t:"").concat(n?"\n":""),[a]=f(i);return Ns((()=>{var e=i();r.current&&r.current.textContent!==e&&(r.current.textContent=e)})),o.createElement(Ks,{ref:r},a)},Ks=h(g(((e,t)=>o.createElement("span",{"data-slate-string":!0,ref:t},e.children)))),$s=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,i={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(i["data-slate-mark-placeholder"]=!0),o.createElement("span",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qs(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i),ku&&n?null:"\ufeff",n?o.createElement("br",null):null)};function Xs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xs(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zs=ku?300:0;function Js(e){e.current&&(clearTimeout(e.current),e.current=null)}var Gs=e=>{var{leaf:t,isLast:n,text:r,parent:i,renderPlaceholder:a,renderLeaf:s=(e=>o.createElement(el,Ys({},e)))}=e,c=Au(),h=u(null),p=u(null),[v,g]=f(!1),m=u(null),D=d((e=>{if(function(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}(h,null==e),null==e){var n;Hu.delete(c),null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,null)}else{if(Hu.set(c,e),!h.current){var r=window.ResizeObserver||au;h.current=new r((()=>{var n;null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,e)}))}h.current.observe(e),p.current=e}}),[p,t,c]),b=o.createElement(Us,{isLast:n,leaf:t,parent:i,text:r}),y=Boolean(t[ss]);if(l((()=>(y?m.current||(m.current=setTimeout((()=>{g(!0),m.current=null}),Zs)):(Js(m),g(!1)),()=>Js(m))),[y,g]),y&&v){var C={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:ju?"inherit":void 0},contentEditable:!1,ref:D}};b=o.createElement(o.Fragment,null,a(C),b)}return s({attributes:{"data-slate-leaf":!0},children:b,leaf:t,text:r})},Qs=o.memo(Gs,((e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&di.equals(t.leaf,e.leaf)&&t.leaf[ss]===e.leaf[ss])),el=e=>{var{attributes:t,children:n}=e;return o.createElement("span",Ys({},t),n)},tl=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:i,renderLeaf:a,text:s}=e,l=Au(),c=u(null),f=di.decorations(s,t),h=Bs.findKey(l,s),p=[],v=0;v<f.length;v++){var g=f[v];p.push(o.createElement(Qs,{isLast:n&&v===f.length-1,key:"".concat(h.id,"-").concat(v),renderPlaceholder:i,leaf:g,text:s,parent:r,renderLeaf:a}))}var m=d((e=>{var t=Yu.get(l);e?(null==t||t.set(h,e),$u.set(s,e),Ku.set(e,s)):(null==t||t.delete(h),$u.delete(s),c.current&&Ku.delete(c.current)),c.current=e}),[c,l,h,s]);return o.createElement("span",{"data-slate-node":"text",ref:m},p)},nl=o.memo(tl,((e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&((e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],o=t[n];if(r.anchor.offset!==o.anchor.offset||r.focus.offset!==o.focus.offset||!Vs(r,o))return!1}return!0})(t.decorations,e.decorations)));function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rl(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var il=e=>{var{decorations:t,element:n,renderElement:r=(e=>o.createElement(ul,ol({},e))),renderPlaceholder:i,renderLeaf:a,selection:u}=e,s=Au(),l=fl(),c=s.isInline(n),f=Bs.findKey(s,n),h=d((e=>{var t=Yu.get(s);e?(null==t||t.set(f,e),$u.set(n,e),Ku.set(e,n)):(null==t||t.delete(f),$u.delete(n))}),[s,f,n]),p=cl({decorations:t,node:n,renderElement:r,renderPlaceholder:i,renderLeaf:a,selection:u}),v={"data-slate-node":"element",ref:h};if(c&&(v["data-slate-inline"]=!0),!c&&Qo.hasInlines(s,n)){var g=Xo.string(n),m=Fn(g);"rtl"===m&&(v.dir=m)}if(Qo.isVoid(s,n)){v["data-slate-void"]=!0,!l&&c&&(v.contentEditable=!1);var D=c?"span":"div",[[b]]=Xo.texts(n);p=o.createElement(D,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},o.createElement(nl,{renderPlaceholder:i,decorations:[],isLast:!1,parent:n,text:b})),Wu.set(b,0),Vu.set(b,n)}return r({attributes:v,children:p,element:n})},al=o.memo(il,((e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&((e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],o=t[n];if(!Vo.equals(r,o)||!Vs(r,o))return!1}return!0})(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Vo.equals(e.selection,t.selection)))),ul=e=>{var{attributes:t,children:n,element:r}=e,i=Au().isInline(r)?"span":"div";return o.createElement(i,ol(ol({},t),{},{style:{position:"relative"}}),n)},sl=i((()=>[])),ll=i(!1),cl=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:i,renderLeaf:u,selection:s}=e,l=a(sl),c=Au(),d=Bs.findPath(c,n),f=[],h=Uo.isElement(n)&&!c.isInline(n)&&Qo.hasInlines(c,n),p=0;p<n.children.length;p++){var v=d.concat(p),g=n.children[p],m=Bs.findKey(c,g),D=Qo.range(c,v),b=s&&Vo.intersection(D,s),y=l([g,v]);for(var C of t){var w=Vo.intersection(C,D);w&&y.push(w)}Uo.isElement(g)?f.push(o.createElement(ll.Provider,{key:"provider-".concat(m.id),value:!!b},o.createElement(al,{decorations:y,element:g,key:m.id,renderElement:r,renderPlaceholder:i,renderLeaf:u,selection:b}))):f.push(o.createElement(nl,{decorations:y,key:m.id,isLast:h&&p===n.children.length-1,parent:n,renderPlaceholder:i,renderLeaf:u,text:g})),Wu.set(g,p),Vu.set(g,n)}return f},dl=i(!1),fl=()=>a(dl),hl=i(null);var pl={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},vl={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"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"},gl={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},ml=e=>{var t=pl[e],n=vl[e],r=gl[e],o=t&&Du(t),i=n&&Du(n),a=r&&Du(r);return e=>!(!o||!o(e))||(!!(Ou&&i&&i(e))||!(Ou||!a||!a(e)))},Dl={isBold:ml("bold"),isCompose:ml("compose"),isMoveBackward:ml("moveBackward"),isMoveForward:ml("moveForward"),isDeleteBackward:ml("deleteBackward"),isDeleteForward:ml("deleteForward"),isDeleteLineBackward:ml("deleteLineBackward"),isDeleteLineForward:ml("deleteLineForward"),isDeleteWordBackward:ml("deleteWordBackward"),isDeleteWordForward:ml("deleteWordForward"),isExtendBackward:ml("extendBackward"),isExtendForward:ml("extendForward"),isExtendLineBackward:ml("extendLineBackward"),isExtendLineForward:ml("extendLineForward"),isItalic:ml("italic"),isMoveLineBackward:ml("moveLineBackward"),isMoveLineForward:ml("moveLineForward"),isMoveWordBackward:ml("moveWordBackward"),isMoveWordForward:ml("moveWordForward"),isRedo:ml("redo"),isSoftBreak:ml("insertSoftBreak"),isSplitBlock:ml("splitBlock"),isTransposeCharacter:ml("transposeCharacter"),isUndo:ml("undo")},bl={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class yl extends v{constructor(){super(...arguments),Bu(this,"context",null),Bu(this,"manager",null),Bu(this,"mutationObserver",null)}observe(){var e,{node:t}=this.props;if(!t.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");null===(e=this.mutationObserver)||void 0===e||e.observe(t.current,bl)}componentDidMount(){var{receivedUserInput:e}=this.props,t=this.context;this.manager=((e,t)=>{var n=[],r=()=>{n=[]};return{registerMutations:r=>{if(t.current){var o=r.filter((t=>ys(e,t,r)));n.push(...o)}},restoreDOM:function(){n.length>0&&(n.reverse().forEach((e=>{"characterData"!==e.type&&(e.removedNodes.forEach((t=>{e.target.insertBefore(t,e.nextSibling)})),e.addedNodes.forEach((t=>{e.target.removeChild(t)})))})),r())},clear:r}})(t,e),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var e,t,n,r,o=null===(e=this.mutationObserver)||void 0===e?void 0:e.takeRecords();null!=o&&o.length&&(null===(r=this.manager)||void 0===r||r.registerMutations(o));return null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(n=this.manager)||void 0===n||n.restoreDOM(),null}componentDidUpdate(){var e;null===(e=this.manager)||void 0===e||e.clear(),this.observe()}componentWillUnmount(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect()}render(){return this.props.children}}Bu(yl,"contextType",Eu);var Cl=ku?yl:e=>{var{children:t}=e;return o.createElement(o.Fragment,null,t)},wl=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],Bl=["text"];function El(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?El(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):El(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xl=e=>o.createElement(o.Fragment,null,cl(e)),Fl=e=>{var t=d((e=>o.createElement(Ol,Al({},e))),[]),{autoFocus:n,decorate:r=kl,onDOMBeforeInput:i,placeholder:s,readOnly:h=!1,renderElement:v,renderLeaf:g,renderPlaceholder:m=t,scrollSelectionIntoView:D=Sl,style:b={},as:y="div",disableDefaultStyles:C=!1}=e,w=yu(e,wl),B=(()=>{var e=a(hl);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t})(),[E,A]=f(!1),x=u(null),F=u([]),[O,k]=f(),{onUserInput:S,receivedUserInput:j}=function(){var e=Au(),t=u(!1),n=u(0),r=d((()=>{if(!t.current){t.current=!0;var r=Bs.getWindow(e);r.cancelAnimationFrame(n.current),n.current=r.requestAnimationFrame((()=>{t.current=!1}))}}),[e]);return l((()=>()=>cancelAnimationFrame(n.current)),[]),{receivedUserInput:t,onUserInput:r}}(),[,P]=p((e=>e+1),0);us.set(B,P),Zu.set(B,h);var R=c((()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1})),[]);l((()=>{x.current&&n&&x.current.focus()}),[n]);var T=u(),N=c((()=>mr((()=>{var e=T.current;if((ku||!Bs.isComposing(B))&&(!R.isUpdatingSelection||null!=e&&e.isFlushing())&&!R.isDraggingInternally){var t=Bs.findDocumentOrShadowRoot(B),{activeElement:n}=t,r=Bs.toDOMNode(B,B),o=t.getSelection();if(n===r?(R.latestElement=n,Ju.set(B,!0)):Ju.delete(B),!o)return qi.deselect(B);var{anchorNode:i,focusNode:a}=o,u=Bs.hasEditableTarget(B,i)||Bs.isTargetInsideNonReadonlyVoid(B,i),s=Bs.hasEditableTarget(B,a)||Bs.isTargetInsideNonReadonlyVoid(B,a);if(u&&s){var l=Bs.toSlateRange(B,o,{exactMatch:!1,suppressThrow:!0});l&&(Bs.isComposing(B)||null!=e&&e.hasPendingChanges()||null!=e&&e.isFlushing()?null==e||e.handleUserSelect(l):qi.select(B,l))}!h||u&&s||qi.deselect(B)}}),100)),[B,h,R]),_=c((()=>pr(N,0)),[N]);T.current=Is({node:x,onDOMSelectionChange:N,scheduleOnDOMSelectionChange:_}),Ns((()=>{var e,t,n;x.current&&(n=ds(x.current))?(qu.set(B,n),Uu.set(B,x.current),$u.set(B,x.current),Ku.set(x.current,B)):$u.delete(B);var{selection:r}=B,o=Bs.findDocumentOrShadowRoot(B).getSelection();if(o&&Bs.isFocused(B)&&(null===(e=T.current)||void 0===e||!e.hasPendingAction())){var i=e=>{var t="None"!==o.type;if(r||t){var n,i=o.focusNode;if(Su&&o.rangeCount>1){var a=o.getRangeAt(0),u=o.getRangeAt(o.rangeCount-1);n=a.startContainer===i?u.endContainer:a.startContainer}else n=o.anchorNode;var s=Uu.get(B),l=!1;if(s.contains(n)&&s.contains(i)&&(l=!0),t&&l&&r&&!e){var c=Bs.toSlateRange(B,o,{exactMatch:!0,suppressThrow:!0});if(c&&Vo.equals(c,r)){var d;if(!R.hasMarkPlaceholder)return;if(null!==(d=n)&&void 0!==d&&null!==(d=d.parentElement)&&void 0!==d&&d.hasAttribute("data-slate-mark-placeholder"))return}}if(!r||Bs.hasRange(B,r)){R.isUpdatingSelection=!0;var f=r&&Bs.toDOMRange(B,r);return f?(Bs.isComposing(B)&&!ku?o.collapseToEnd():Vo.isBackward(r)?o.setBaseAndExtent(f.endContainer,f.endOffset,f.startContainer,f.startOffset):o.setBaseAndExtent(f.startContainer,f.startOffset,f.endContainer,f.endOffset),D(B,f)):o.removeAllRanges(),f}B.selection=Bs.toSlateRange(B,o,{exactMatch:!1,suppressThrow:!0})}};o.rangeCount<=1&&i();var a="action"===(null===(t=T.current)||void 0===t?void 0:t.isFlushing());if(ku&&a){var u=null,s=requestAnimationFrame((()=>{if(a){var e=e=>{try{Bs.toDOMNode(B,B).focus(),i(e)}catch(e){}};e(),u=setTimeout((()=>{e(!0),R.isUpdatingSelection=!1}))}}));return()=>{cancelAnimationFrame(s),u&&clearTimeout(u)}}setTimeout((()=>{R.isUpdatingSelection=!1}))}}));var M=d((e=>{if(S(),!h&&Bs.hasEditableTarget(B,e.target)&&!Rl(e,i)){var t;if(T.current)return T.current.handleDOMBeforeInput(e);_.flush(),N.flush();var{selection:n}=B,{inputType:r}=e,o=e.dataTransfer||e.data||void 0,a="insertCompositionText"===r||"deleteCompositionText"===r;if(a&&Bs.isComposing(B))return;var u=!1;if("insertText"===r&&n&&Vo.isCollapsed(n)&&e.data&&1===e.data.length&&/[a-z ]/i.test(e.data)&&0!==n.anchor.offset){var s,l;u=!0,B.marks&&(u=!1);var{anchor:c}=n,[d,f]=Bs.toDOMPoint(B,c),p=null===(s=d.parentElement)||void 0===s?void 0:s.closest("a"),v=Bs.getWindow(B);if(u&&p&&Bs.hasDOMNode(B,p)){var g,m=null==v?void 0:v.document.createTreeWalker(p,NodeFilter.SHOW_TEXT).lastChild();m===d&&(null===(g=m.textContent)||void 0===g?void 0:g.length)===f&&(u=!1)}if(u&&d.parentElement&&"pre"===(null==v||null===(l=v.getComputedStyle(d.parentElement))||void 0===l?void 0:l.whiteSpace)){var D=Qo.above(B,{at:c.path,match:e=>Uo.isElement(e)&&Qo.isBlock(B,e)});D&&Xo.string(D[0]).includes("\t")&&(u=!1)}}if(!r.startsWith("delete")||r.startsWith("deleteBy")){var[b]=e.getTargetRanges();if(b){var y=Bs.toSlateRange(B,b,{exactMatch:!1,suppressThrow:!1});if(!n||!Vo.equals(n,y)){u=!1;var C=!a&&B.selection&&Qo.rangeRef(B,B.selection);qi.select(B,y),C&&Qu.set(B,C)}}}if(a)return;if(u||e.preventDefault(),n&&Vo.isExpanded(n)&&r.startsWith("delete")){var w=r.endsWith("Backward")?"backward":"forward";return void Qo.deleteFragment(B,{direction:w})}switch(r){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":Qo.deleteFragment(B);break;case"deleteContent":case"deleteContentForward":Qo.deleteForward(B);break;case"deleteContentBackward":Qo.deleteBackward(B);break;case"deleteEntireSoftLine":Qo.deleteBackward(B,{unit:"line"}),Qo.deleteForward(B,{unit:"line"});break;case"deleteHardLineBackward":Qo.deleteBackward(B,{unit:"block"});break;case"deleteSoftLineBackward":Qo.deleteBackward(B,{unit:"line"});break;case"deleteHardLineForward":Qo.deleteForward(B,{unit:"block"});break;case"deleteSoftLineForward":Qo.deleteForward(B,{unit:"line"});break;case"deleteWordBackward":Qo.deleteBackward(B,{unit:"word"});break;case"deleteWordForward":Qo.deleteForward(B,{unit:"word"});break;case"insertLineBreak":Qo.insertSoftBreak(B);break;case"insertParagraph":Qo.insertBreak(B);break;case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":"insertFromComposition"===r&&Bs.isComposing(B)&&(A(!1),Gu.set(B,!1)),"DataTransfer"===(null==o?void 0:o.constructor.name)?Bs.insertData(B,o):"string"==typeof o&&(u?F.current.push((()=>Qo.insertText(B,o))):Qo.insertText(B,o))}var E=null===(t=Qu.get(B))||void 0===t?void 0:t.unref();Qu.delete(B),!E||B.selection&&Vo.equals(B.selection,E)||qi.select(B,E)}}),[B,N,S,i,h,_]),L=d((e=>{null==e?(N.cancel(),_.cancel(),Uu.delete(B),$u.delete(B),x.current&&zu&&x.current.removeEventListener("beforeinput",M)):zu&&e.addEventListener("beforeinput",M),x.current=e}),[N,_,B,M]);Ns((()=>{var e=Bs.getWindow(B);return e.document.addEventListener("selectionchange",_),()=>{e.document.removeEventListener("selectionchange",_)}}),[_]);var I=r([B,[]]),z=s&&1===B.children.length&&1===Array.from(Xo.texts(B)).length&&""===Xo.string(B)&&!E,W=d((e=>{var t;e&&z?k(null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.height):k(void 0)}),[z]);if(z){var V=Qo.start(B,[]);I.push({[ss]:!0,placeholder:s,onPlaceholderResize:W,anchor:V,focus:V})}var{marks:q}=B;if(R.hasMarkPlaceholder=!1,B.selection&&Vo.isCollapsed(B.selection)&&q){var{anchor:U}=B.selection,H=Xo.leaf(B,U.path),K=yu(H,Bl);if(!di.equals(H,q,{loose:!0})){R.hasMarkPlaceholder=!0;var $=Object.fromEntries(Object.keys(K).map((e=>[e,null])));I.push(Al(Al(Al({[ls]:!0},$),q),{},{anchor:U,focus:U}))}}return l((()=>{setTimeout((()=>{var{selection:e}=B;if(e){var{anchor:t}=e,n=Xo.leaf(B,t.path);if(q&&!di.equals(n,q,{loose:!0}))return void ns.set(B,q)}ns.delete(B)}))})),o.createElement(dl.Provider,{value:h},o.createElement(sl.Provider,{value:r},o.createElement(Cl,{node:x,receivedUserInput:j},o.createElement(y,Al(Al({role:h?void 0:"textbox","aria-multiline":!h||void 0},w),{},{spellCheck:!(!zu&&Iu)&&w.spellCheck,autoCorrect:zu||!Iu?w.autoCorrect:"false",autoCapitalize:zu||!Iu?w.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!h,zindex:-1,suppressContentEditableWarning:!0,ref:L,style:Al(Al({},C?{}:Al({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},O?{minHeight:O}:{})),b),onBeforeInput:d((e=>{if(!zu&&!h&&!jl(e,w.onBeforeInput)&&Bs.hasSelectableTarget(B,e.target)&&(e.preventDefault(),!Bs.isComposing(B))){var t=e.data;Qo.insertText(B,t)}}),[w.onBeforeInput,B,h]),onInput:d((e=>{if(!jl(e,w.onInput))if(T.current)T.current.handleInput();else{for(var t of F.current)t();F.current=[]}}),[w.onInput]),onBlur:d((e=>{if(!h&&!R.isUpdatingSelection&&Bs.hasSelectableTarget(B,e.target)&&!jl(e,w.onBlur)){var t=Bs.findDocumentOrShadowRoot(B);if(R.latestElement!==t.activeElement){var{relatedTarget:n}=e;if(!(n===Bs.toDOMNode(B,B)||fs(n)&&n.hasAttribute("data-slate-spacer"))){if(null!=n&&hs(n)&&Bs.hasDOMNode(B,n)){var r=Bs.toSlateNode(B,n);if(Uo.isElement(r)&&!B.isVoid(r))return}if(ju){var o=t.getSelection();null==o||o.removeAllRanges()}Ju.delete(B)}}}}),[h,R.isUpdatingSelection,R.latestElement,B,w.onBlur]),onClick:d((e=>{if(Bs.hasTarget(B,e.target)&&!jl(e,w.onClick)&&hs(e.target)){var t=Bs.toSlateNode(B,e.target),n=Bs.findPath(B,t);if(!Qo.hasPath(B,n)||Xo.get(B,n)!==t)return;if(3===e.detail&&n.length>=1){var r=n;if(!Uo.isElement(t)||!Qo.isBlock(B,t)){var o,i=Qo.above(B,{match:e=>Uo.isElement(e)&&Qo.isBlock(B,e),at:n});r=null!==(o=null==i?void 0:i[1])&&void 0!==o?o:n.slice(0,1)}var a=Qo.range(B,r);return void qi.select(B,a)}if(h)return;var u=Qo.start(B,n),s=Qo.end(B,n),l=Qo.void(B,{at:u}),c=Qo.void(B,{at:s});if(l&&c&&ko.equals(l[1],c[1])){var d=Qo.range(B,u);qi.select(B,d)}}}),[B,w.onClick,h]),onCompositionEnd:d((e=>{if(Bs.hasSelectableTarget(B,e.target)){var t;if(Bs.isComposing(B)&&Promise.resolve().then((()=>{A(!1),Gu.set(B,!1)})),null===(t=T.current)||void 0===t||t.handleCompositionEnd(e),jl(e,w.onCompositionEnd)||ku)return;if(!ju&&!_u&&!Fu&&!Lu&&!Mu&&e.data){var n=ns.get(B);ns.delete(B),void 0!==n&&(rs.set(B,B.marks),B.marks=n),Qo.insertText(B,e.data);var r=rs.get(B);rs.delete(B),void 0!==r&&(B.marks=r)}}}),[w.onCompositionEnd,B]),onCompositionUpdate:d((e=>{Bs.hasSelectableTarget(B,e.target)&&!jl(e,w.onCompositionUpdate)&&(Bs.isComposing(B)||(A(!0),Gu.set(B,!0)))}),[w.onCompositionUpdate,B]),onCompositionStart:d((e=>{if(Bs.hasSelectableTarget(B,e.target)){var t;if(null===(t=T.current)||void 0===t||t.handleCompositionStart(e),jl(e,w.onCompositionStart)||ku)return;A(!0);var{selection:n}=B;if(n&&Vo.isExpanded(n))return void Qo.deleteFragment(B)}}),[w.onCompositionStart,B]),onCopy:d((e=>{!Bs.hasSelectableTarget(B,e.target)||jl(e,w.onCopy)||Pl(e)||(e.preventDefault(),Bs.setFragmentData(B,e.clipboardData,"copy"))}),[w.onCopy,B]),onCut:d((e=>{if(!h&&Bs.hasSelectableTarget(B,e.target)&&!jl(e,w.onCut)&&!Pl(e)){e.preventDefault(),Bs.setFragmentData(B,e.clipboardData,"cut");var{selection:t}=B;if(t)if(Vo.isExpanded(t))Qo.deleteFragment(B);else{var n=Xo.parent(B,t.anchor.path);Qo.isVoid(B,n)&&qi.delete(B)}}}),[h,B,w.onCut]),onDragOver:d((e=>{if(Bs.hasTarget(B,e.target)&&!jl(e,w.onDragOver)){var t=Bs.toSlateNode(B,e.target);Uo.isElement(t)&&Qo.isVoid(B,t)&&e.preventDefault()}}),[w.onDragOver,B]),onDragStart:d((e=>{if(!h&&Bs.hasTarget(B,e.target)&&!jl(e,w.onDragStart)){var t=Bs.toSlateNode(B,e.target),n=Bs.findPath(B,t);if(Uo.isElement(t)&&Qo.isVoid(B,t)||Qo.void(B,{at:n,voids:!0})){var r=Qo.range(B,n);qi.select(B,r)}R.isDraggingInternally=!0,Bs.setFragmentData(B,e.dataTransfer,"drag")}}),[h,B,w.onDragStart,R]),onDrop:d((e=>{if(!h&&Bs.hasTarget(B,e.target)&&!jl(e,w.onDrop)){e.preventDefault();var t=B.selection,n=Bs.findEventRange(B,e),r=e.dataTransfer;qi.select(B,n),R.isDraggingInternally&&(!t||Vo.equals(t,n)||Qo.void(B,{at:n,voids:!0})||qi.delete(B,{at:t})),Bs.insertData(B,r),Bs.isFocused(B)||Bs.focus(B)}R.isDraggingInternally=!1}),[h,B,w.onDrop,R]),onDragEnd:d((e=>{!h&&R.isDraggingInternally&&w.onDragEnd&&Bs.hasTarget(B,e.target)&&w.onDragEnd(e),R.isDraggingInternally=!1}),[h,R,w,B]),onFocus:d((e=>{if(!h&&!R.isUpdatingSelection&&Bs.hasEditableTarget(B,e.target)&&!jl(e,w.onFocus)){var t=Bs.toDOMNode(B,B),n=Bs.findDocumentOrShadowRoot(B);if(R.latestElement=n.activeElement,Su&&e.target!==t)return void t.focus();Ju.set(B,!0)}}),[h,R,B,w.onFocus]),onKeyDown:d((e=>{if(!h&&Bs.hasEditableTarget(B,e.target)){var t;null===(t=T.current)||void 0===t||t.handleKeyDown(e);var{nativeEvent:n}=e;if(Bs.isComposing(B)&&!1===n.isComposing&&(Gu.set(B,!1),A(!1)),jl(e,w.onKeyDown)||Bs.isComposing(B))return;var{selection:r}=B,o=B.children[null!==r?r.focus.path[0]:0],i="rtl"===Fn(Xo.string(o));if(Dl.isRedo(n)){e.preventDefault();var a=B;return void("function"==typeof a.redo&&a.redo())}if(Dl.isUndo(n)){e.preventDefault();var u=B;return void("function"==typeof u.undo&&u.undo())}if(Dl.isMoveLineBackward(n))return e.preventDefault(),void qi.move(B,{unit:"line",reverse:!0});if(Dl.isMoveLineForward(n))return e.preventDefault(),void qi.move(B,{unit:"line"});if(Dl.isExtendLineBackward(n))return e.preventDefault(),void qi.move(B,{unit:"line",edge:"focus",reverse:!0});if(Dl.isExtendLineForward(n))return e.preventDefault(),void qi.move(B,{unit:"line",edge:"focus"});if(Dl.isMoveBackward(n))return e.preventDefault(),void(r&&Vo.isCollapsed(r)?qi.move(B,{reverse:!i}):qi.collapse(B,{edge:i?"end":"start"}));if(Dl.isMoveForward(n))return e.preventDefault(),void(r&&Vo.isCollapsed(r)?qi.move(B,{reverse:i}):qi.collapse(B,{edge:i?"start":"end"}));if(Dl.isMoveWordBackward(n))return e.preventDefault(),r&&Vo.isExpanded(r)&&qi.collapse(B,{edge:"focus"}),void qi.move(B,{unit:"word",reverse:!i});if(Dl.isMoveWordForward(n))return e.preventDefault(),r&&Vo.isExpanded(r)&&qi.collapse(B,{edge:"focus"}),void qi.move(B,{unit:"word",reverse:i});if(zu){if((Ru||ju)&&r&&(Dl.isDeleteBackward(n)||Dl.isDeleteForward(n))&&Vo.isCollapsed(r)){var s=Xo.parent(B,r.anchor.path);if(Uo.isElement(s)&&Qo.isVoid(B,s)&&(Qo.isInline(B,s)||Qo.isBlock(B,s)))return e.preventDefault(),void Qo.deleteBackward(B,{unit:"block"})}}else{if(Dl.isBold(n)||Dl.isItalic(n)||Dl.isTransposeCharacter(n))return void e.preventDefault();if(Dl.isSoftBreak(n))return e.preventDefault(),void Qo.insertSoftBreak(B);if(Dl.isSplitBlock(n))return e.preventDefault(),void Qo.insertBreak(B);if(Dl.isDeleteBackward(n))return e.preventDefault(),void(r&&Vo.isExpanded(r)?Qo.deleteFragment(B,{direction:"backward"}):Qo.deleteBackward(B));if(Dl.isDeleteForward(n))return e.preventDefault(),void(r&&Vo.isExpanded(r)?Qo.deleteFragment(B,{direction:"forward"}):Qo.deleteForward(B));if(Dl.isDeleteLineBackward(n))return e.preventDefault(),void(r&&Vo.isExpanded(r)?Qo.deleteFragment(B,{direction:"backward"}):Qo.deleteBackward(B,{unit:"line"}));if(Dl.isDeleteLineForward(n))return e.preventDefault(),void(r&&Vo.isExpanded(r)?Qo.deleteFragment(B,{direction:"forward"}):Qo.deleteForward(B,{unit:"line"}));if(Dl.isDeleteWordBackward(n))return e.preventDefault(),void(r&&Vo.isExpanded(r)?Qo.deleteFragment(B,{direction:"backward"}):Qo.deleteBackward(B,{unit:"word"}));if(Dl.isDeleteWordForward(n))return e.preventDefault(),void(r&&Vo.isExpanded(r)?Qo.deleteFragment(B,{direction:"forward"}):Qo.deleteForward(B,{unit:"word"}))}}}),[h,B,w.onKeyDown]),onPaste:d((e=>{h||!Bs.hasEditableTarget(B,e.target)||jl(e,w.onPaste)||(!zu||(e=>e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length)(e.nativeEvent)||ju)&&(e.preventDefault(),Bs.insertData(B,e.clipboardData))}),[h,B,w.onPaste])}),o.createElement(xl,{decorations:I,node:B,renderElement:v,renderPlaceholder:m,renderLeaf:g,selection:B.selection})))))},Ol=e=>{var{attributes:t,children:n}=e;return o.createElement("span",Al({},t),n,ku&&o.createElement("br",null))},kl=()=>[],Sl=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Vo.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),Er(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},jl=(e,t)=>{if(!t)return!1;var n=t(e);return null!=n?n:e.isDefaultPrevented()||e.isPropagationStopped()},Pl=e=>hs(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),Rl=(e,t)=>{if(!t)return!1;var n=t(e);return null!=n?n:e.defaultPrevented},Tl=i(!1),Nl=i({});var _l=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],Ml=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:i,onValueChange:a,initialValue:s}=e,h=yu(e,_l),[p,v]=o.useState((()=>{if(!Xo.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(ii.stringify(s)));if(!Qo.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(ii.stringify(t)));return t.children=s,Object.assign(t,h),{v:0,editor:t}})),{selectorContext:g,onChange:m}=function(e){var t=u([]).current,n=u({editor:e}).current,r=d((e=>{n.editor=e,t.forEach((t=>t(e)))}),[t,n]);return{selectorContext:c((()=>({getSlate:()=>n.editor,addEventListener:e=>(t.push(e),()=>{t.splice(t.indexOf(e),1)})})),[t,n]),onChange:r}}(t),D=d((e=>{var n;if(r&&r(t.children),"set_selection"===(null==e||null===(n=e.operation)||void 0===n?void 0:n.type))null==i||i(t.selection);else null==a||a(t.children);v((e=>({v:e.v+1,editor:t}))),m(t)}),[t,m,r,i,a]);l((()=>(es.set(t,D),()=>{es.set(t,(()=>{}))})),[t,D]);var[b,y]=f(Bs.isFocused(t));return l((()=>{y(Bs.isFocused(t))}),[t]),Ns((()=>{var e=()=>y(Bs.isFocused(t));return xu>=17?(document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",e)}):(document.addEventListener("focus",e,!0),document.addEventListener("blur",e,!0),()=>{document.removeEventListener("focus",e,!0),document.removeEventListener("blur",e,!0)})}),[]),o.createElement(Nl.Provider,{value:g},o.createElement(hl.Provider,{value:p},o.createElement(Eu.Provider,{value:p.editor},o.createElement(Tl.Provider,{value:b},n))))},Ll=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Il=(e,t,n)=>{var r=Bs.toDOMRange(e,t).getBoundingClientRect(),o=Bs.toDOMRange(e,n).getBoundingClientRect();return Ll(r,o)&&Ll(o,r)};function zl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zl(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Vl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x-slate-fragment",n=e,{apply:r,onChange:o,deleteBackward:i,addMark:a,removeMark:u}=n;return Yu.set(n,new WeakMap),n.addMark=(e,t)=>{var r,o;null===(r=ts.get(n))||void 0===r||r(),!ns.get(n)&&null!==(o=os.get(n))&&void 0!==o&&o.length&&ns.set(n,null),rs.delete(n),a(e,t)},n.removeMark=e=>{var t;!ns.get(n)&&null!==(t=os.get(n))&&void 0!==t&&t.length&&ns.set(n,null),rs.delete(n),u(e)},n.deleteBackward=e=>{if("line"!==e)return i(e);if(n.selection&&Vo.isCollapsed(n.selection)){var t=Qo.above(n,{match:e=>Uo.isElement(e)&&Qo.isBlock(n,e),at:n.selection});if(t){var[,r]=t,o=Qo.range(n,r,n.selection.anchor),a=((e,t)=>{var n=Qo.range(e,Vo.end(t)),r=Array.from(Qo.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if(Il(e,Qo.range(e,r[o]),n))return Qo.range(e,r[o],n);if(r.length<2)return Qo.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)Il(e,Qo.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return Qo.range(e,r[i],n)})(n,o);Vo.isCollapsed(a)||qi.delete(n,{at:a})}}},n.apply=t=>{var o=[],i=[],a=os.get(n);if(null!=a&&a.length){var u=a.map((e=>function(e,t){var{path:n,diff:r,id:o}=e;switch(t.type){case"insert_text":return!ko.equals(t.path,n)||t.offset>=r.end?e:t.offset<=r.start?{diff:{start:t.text.length+r.start,end:t.text.length+r.end,text:r.text},id:o,path:n}:{diff:{start:r.start,end:r.end+t.text.length,text:r.text},id:o,path:n};case"remove_text":return!ko.equals(t.path,n)||t.offset>=r.end?e:t.offset+t.text.length<=r.start?{diff:{start:r.start-t.text.length,end:r.end-t.text.length,text:r.text},id:o,path:n}:{diff:{start:r.start,end:r.end-t.text.length,text:r.text},id:o,path:n};case"split_node":return!ko.equals(t.path,n)||t.position>=r.end?{diff:r,id:o,path:ko.transform(n,t,{affinity:"backward"})}:t.position>r.start?{diff:{start:r.start,end:Math.min(t.position,r.end),text:r.text},id:o,path:n}:{diff:{start:r.start-t.position,end:r.end-t.position,text:r.text},id:o,path:ko.transform(n,t,{affinity:"forward"})};case"merge_node":return ko.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:o,path:ko.transform(n,t)}:{diff:r,id:o,path:ko.transform(n,t)}}var i=ko.transform(n,t);return i?{diff:r,path:i,id:o}:null}(e,t))).filter(Boolean);os.set(n,u)}var s=as.get(n);s&&as.set(n,js(n,s,t));var l=is.get(n);if(null!=l&&l.at){var c=ri.isPoint(null==l?void 0:l.at)?Ss(n,l.at,t):js(n,l.at,t);is.set(n,c?Wl(Wl({},l),{},{at:c}):null)}switch(t.type){case"insert_text":case"remove_text":case"set_node":case"split_node":o.push(...ql(n,t.path));break;case"set_selection":var d;null===(d=Qu.get(n))||void 0===d||d.unref(),Qu.delete(n);break;case"insert_node":case"remove_node":o.push(...ql(n,ko.parent(t.path)));break;case"merge_node":var f=ko.previous(t.path);o.push(...ql(n,f));break;case"move_node":var h,p=ko.common(ko.parent(t.path),ko.parent(t.newPath));o.push(...ql(n,p)),ko.isBefore(t.path,t.newPath)?(o.push(...ql(n,ko.parent(t.path))),h=t.newPath):(o.push(...ql(n,ko.parent(t.newPath))),h=t.path);var v=Xo.get(e,ko.parent(h)),g=Bs.findKey(n,v),m=Qo.pathRef(n,ko.parent(h));i.push([m,g])}for(var[D,b]of(r(t),o)){var[y]=Qo.node(n,D);Xu.set(y,b)}for(var[C,w]of i)if(C.current){var[B]=Qo.node(n,C.current);Xu.set(B,w)}},n.setFragmentData=e=>{var{selection:r}=n;if(r){var[o,i]=Vo.edges(r),a=Qo.void(n,{at:o.path}),u=Qo.void(n,{at:i.path});if(!Vo.isCollapsed(r)||a){var s=Bs.toDOMRange(n,r),l=s.cloneContents(),c=l.childNodes[0];if(l.childNodes.forEach((e=>{e.textContent&&""!==e.textContent.trim()&&(c=e)})),u){var[d]=u,f=s.cloneRange(),h=Bs.toDOMNode(n,d);f.setEndAfter(h),l=f.cloneContents()}if(a&&(c=l.querySelector("[data-slate-spacer]")),Array.from(l.querySelectorAll("[data-slate-zero-width]")).forEach((e=>{var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""})),vs(c)){var p=c.ownerDocument.createElement("span");p.style.whiteSpace="pre",p.appendChild(c),l.appendChild(p),c=p}var v=n.getFragment(),g=JSON.stringify(v),m=window.btoa(encodeURIComponent(g));c.setAttribute("data-slate-fragment",m),e.setData("application/".concat(t),m);var D=l.ownerDocument.createElement("div");return D.appendChild(l),D.setAttribute("hidden","true"),l.ownerDocument.body.appendChild(D),e.setData("text/html",D.innerHTML),e.setData("text/plain",Ds(D)),l.ownerDocument.body.removeChild(D),e}}},n.insertData=e=>{n.insertFragmentData(e)||n.insertTextData(e)},n.insertFragmentData=e=>{var r=e.getData("application/".concat(t))||(e=>{var t=e.getData("text/html"),[,n]=t.match(bs)||[];return n})(e);if(r){var o=decodeURIComponent(window.atob(r)),i=JSON.parse(o);return n.insertFragment(i),!0}return!1},n.insertTextData=e=>{var t=e.getData("text/plain");if(t){var r=t.split(/\r\n|\r|\n/),o=!1;for(var i of r)o&&qi.splitNodes(n,{always:!0}),n.insertText(i),o=!0;return!0}return!1},n.onChange=e=>{(xu<18?C.unstable_batchedUpdates:e=>e())((()=>{var t=es.get(n);t&&t(e),o(e)}))},n},ql=(e,t)=>{var n=[];for(var[r,o]of Qo.levels(e,{at:t})){var i=Bs.findKey(e,r);n.push([o,i])}return n};function Ul(e){return $l(e)?(e.nodeName||"").toLowerCase():"#document"}function Hl(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Kl(e){var t;return null==(t=($l(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $l(e){return e instanceof Node||e instanceof Hl(e).Node}function Xl(e){return e instanceof Element||e instanceof Hl(e).Element}function Yl(e){return e instanceof HTMLElement||e instanceof Hl(e).HTMLElement}function Zl(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Hl(e).ShadowRoot)}function Jl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Gl(e){return["table","td","th"].includes(Ul(e))}function Ql(e){const t=ec(),n=nc(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ec(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function tc(e){return["html","body","#document"].includes(Ul(e))}function nc(e){return Hl(e).getComputedStyle(e)}function rc(e){return Xl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function oc(e){if("html"===Ul(e))return e;const t=e.assignedSlot||e.parentNode||Zl(e)&&e.host||Kl(e);return Zl(t)?t.host:t}function ic(e){const t=oc(e);return tc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yl(t)&&Jl(t)?t:ic(t)}function ac(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ic(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Hl(o);return i?t.concat(a,a.visualViewport||[],Jl(o)?o:[],a.frameElement&&n?ac(a.frameElement):[]):t.concat(o,ac(o,[],n))}const uc=Math.min,sc=Math.max,lc=Math.round,cc=Math.floor,dc=e=>({x:e,y:e}),fc={left:"right",right:"left",bottom:"top",top:"bottom"},hc={start:"end",end:"start"};function pc(e,t,n){return sc(e,uc(t,n))}function vc(e,t){return"function"==typeof e?e(t):e}function gc(e){return e.split("-")[0]}function mc(e){return e.split("-")[1]}function Dc(e){return"x"===e?"y":"x"}function bc(e){return"y"===e?"height":"width"}function yc(e){return["top","bottom"].includes(gc(e))?"y":"x"}function Cc(e){return Dc(yc(e))}function wc(e){return e.replace(/start|end/g,(e=>hc[e]))}function Bc(e){return e.replace(/left|right|bottom|top/g,(e=>fc[e]))}function Ec(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ac(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function xc(e,t,n){let{reference:r,floating:o}=e;const i=yc(t),a=Cc(t),u=bc(a),s=gc(t),l="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[u]/2-o[u]/2;let h;switch(s){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(mc(t)){case"start":h[a]-=f*(n&&l?-1:1);break;case"end":h[a]+=f*(n&&l?-1:1)}return h}async function Fc(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:u,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=vc(t,e),p=Ec(h),v=u[f?"floating"===d?"reference":"floating":d],g=Ac(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:l,rootBoundary:c,strategy:s})),m="floating"===d?{...a.floating,x:r,y:o}:a.reference,D=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),b=await(null==i.isElement?void 0:i.isElement(D))&&await(null==i.getScale?void 0:i.getScale(D))||{x:1,y:1},y=Ac(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:m,offsetParent:D,strategy:s}):m);return{top:(g.top-y.top+p.top)/b.y,bottom:(y.bottom-g.bottom+p.bottom)/b.y,left:(g.left-y.left+p.left)/b.x,right:(y.right-g.right+p.right)/b.x}}function Oc(e){const t=uc(...e.map((e=>e.left))),n=uc(...e.map((e=>e.top)));return{x:t,y:n,width:sc(...e.map((e=>e.right)))-t,height:sc(...e.map((e=>e.bottom)))-n}}const kc=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:u}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=gc(n),u=mc(n),s="y"===yc(n),l=["left","top"].includes(a)?-1:1,c=i&&s?-1:1,d=vc(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return u&&"number"==typeof p&&(h="end"===u?-1*p:p),s?{x:h*c,y:f*l}:{x:f*l,y:h*c}}(t,e);return a===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}};function Sc(e){const t=nc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Yl(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,u=lc(n)!==i||lc(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function jc(e){return Xl(e)?e:e.contextElement}function Pc(e){const t=jc(e);if(!Yl(t))return dc(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Sc(t);let a=(i?lc(n.width):n.width)/r,u=(i?lc(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),u&&Number.isFinite(u)||(u=1),{x:a,y:u}}const Rc=dc(0);function Tc(e){const t=Hl(e);return ec()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Rc}function Nc(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=jc(e);let a=dc(1);t&&(r?Xl(r)&&(a=Pc(r)):a=Pc(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Hl(e))&&t}(i,n,r)?Tc(i):dc(0);let s=(o.left+u.x)/a.x,l=(o.top+u.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=Hl(i),t=r&&Xl(r)?Hl(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=Pc(o),t=o.getBoundingClientRect(),r=nc(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,l*=e.y,c*=e.x,d*=e.y,s+=i,l+=a,n=Hl(o),o=n.frameElement}}return Ac({width:c,height:d,x:s,y:l})}const _c=[":popover-open",":modal"];function Mc(e){return _c.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Lc(e){return Nc(Kl(e)).left+rc(e).scrollLeft}function Ic(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Hl(e),r=Kl(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,u=0,s=0;if(o){i=o.width,a=o.height;const e=ec();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:u,y:s}}(e,n);else if("document"===t)r=function(e){const t=Kl(e),n=rc(e),r=e.ownerDocument.body,o=sc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=sc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Lc(e);const u=-n.scrollTop;return"rtl"===nc(r).direction&&(a+=sc(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:u}}(Kl(e));else if(Xl(t))r=function(e,t){const n=Nc(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Yl(e)?Pc(e):dc(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Tc(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Ac(r)}function zc(e,t){const n=oc(e);return!(n===t||!Xl(n)||tc(n))&&("fixed"===nc(n).position||zc(n,t))}function Wc(e,t,n){const r=Yl(t),o=Kl(t),i="fixed"===n,a=Nc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=dc(0);if(r||!r&&!i)if(("body"!==Ul(t)||Jl(o))&&(u=rc(t)),r){const e=Nc(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Lc(o));return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function Vc(e,t){return Yl(e)&&"fixed"!==nc(e).position?t?t(e):e.offsetParent:null}function qc(e,t){const n=Hl(e);if(!Yl(e)||Mc(e))return n;let r=Vc(e,t);for(;r&&Gl(r)&&"static"===nc(r).position;)r=Vc(r,t);return r&&("html"===Ul(r)||"body"===Ul(r)&&"static"===nc(r).position&&!Ql(r))?n:r||function(e){let t=oc(e);for(;Yl(t)&&!tc(t);){if(Ql(t))return t;t=oc(t)}return null}(e)||n}const Uc={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Kl(r),u=!!t&&Mc(t.floating);if(r===a||u&&i)return n;let s={scrollLeft:0,scrollTop:0},l=dc(1);const c=dc(0),d=Yl(r);if((d||!d&&!i)&&(("body"!==Ul(r)||Jl(a))&&(s=rc(r)),Yl(r))){const e=Nc(r);l=Pc(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+c.x,y:n.y*l.y-s.scrollTop*l.y+c.y}},getDocumentElement:Kl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ac(e,[],!1).filter((e=>Xl(e)&&"body"!==Ul(e))),o=null;const i="fixed"===nc(e).position;let a=i?oc(e):e;for(;Xl(a)&&!tc(a);){const t=nc(a),n=Ql(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Jl(a)&&!n&&zc(e,a))?r=r.filter((e=>e!==a)):o=t,a=oc(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],u=a[0],s=a.reduce(((e,n)=>{const r=Ic(t,n,o);return e.top=sc(r.top,e.top),e.right=uc(r.right,e.right),e.bottom=uc(r.bottom,e.bottom),e.left=sc(r.left,e.left),e}),Ic(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:qc,getElementRects:async function(e){const t=this.getOffsetParent||qc,n=this.getDimensions;return{reference:Wc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Sc(e);return{width:t,height:n}},getScale:Pc,isElement:Xl,isRTL:function(e){return"rtl"===nc(e).direction}};function Hc(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,l=jc(e),c=o||i?[...l?ac(l):[],...ac(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&u?function(e,t){let n,r=null;const o=Kl(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(u,s){void 0===u&&(u=!1),void 0===s&&(s=1),i();const{left:l,top:c,width:d,height:f}=e.getBoundingClientRect();if(u||t(),!d||!f)return;const h={rootMargin:-cc(c)+"px "+-cc(o.clientWidth-(l+d))+"px "+-cc(o.clientHeight-(c+f))+"px "+-cc(l)+"px",threshold:sc(0,uc(1,s))||1};let p=!0;function v(e){const t=e[0].intersectionRatio;if(t!==s){if(!p)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}p=!1}try{r=new IntersectionObserver(v,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,h)}r.observe(e)}(!0),i}(l,n):null;let f,h=-1,p=null;a&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),l&&!s&&p.observe(l),p.observe(t));let v=s?Nc(e):null;return s&&function t(){const r=Nc(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,s&&cancelAnimationFrame(f)}}const Kc=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=vc(e,t),l={x:n,y:r},c=await Fc(t,s),d=yc(gc(o)),f=Dc(d);let h=l[f],p=l[d];if(i){const e="y"===f?"bottom":"right";h=pc(h+c["y"===f?"top":"left"],h,h-c[e])}if(a){const e="y"===d?"bottom":"right";p=pc(p+c["y"===d?"top":"left"],p,p-c[e])}const v=u.fn({...t,[f]:h,[d]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}},$c=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:u,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=vc(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const m=gc(o),D=gc(u)===u,b=await(null==s.isRTL?void 0:s.isRTL(l.floating)),y=f||(D||!v?[Bc(u)]:function(e){const t=Bc(e);return[wc(e),t,wc(t)]}(u));f||"none"===p||y.push(...function(e,t,n,r){const o=mc(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(gc(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(wc)))),i}(u,v,p,b));const C=[u,...y],w=await Fc(t,g),B=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&B.push(w[m]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=mc(e),o=Cc(e),i=bc(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Bc(a)),[a,Bc(a)]}(o,a,b);B.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:o,overflows:B}],!B.every((e=>e<=0))){var A,x;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(x=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:x.placement;if(!n)switch(h){case"bestFit":{var F;const e=null==(F=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Xc=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:u=2,x:s,y:l}=vc(e,t),c=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),d=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let r=null;for(let e=0;e<t.length;e++){const o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map((e=>Ac(Oc(e))))}(c),f=Ac(Oc(c)),h=Ec(u);const p=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=s&&null!=l)return d.find((e=>s>e.left-h.left&&s<e.right+h.right&&l>e.top-h.top&&l<e.bottom+h.bottom))||f;if(d.length>=2){if("y"===yc(n)){const e=d[0],t=d[d.length-1],r="top"===gc(n),o=e.top,i=t.bottom,a=r?e.left:t.left,u=r?e.right:t.right;return{top:o,bottom:i,left:a,right:u,width:u-a,height:i-o,x:a,y:o}}const e="left"===gc(n),t=sc(...d.map((e=>e.right))),r=uc(...d.map((e=>e.left))),o=d.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return f}},floating:r.floating,strategy:a});return o.reference.x!==p.reference.x||o.reference.y!==p.reference.y||o.reference.width!==p.reference.width||o.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},Yc=(e,t,n)=>{const r=new Map,o={platform:Uc,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,u=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=xc(l,r,s),f=r,h={},p=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:m,data:D,reset:b}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=m?m:d,h={...h,[i]:{...h[i],...D}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(l=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=xc(l,f,s))),n=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Zc="undefined"!=typeof document?s:l;function Jc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Jc(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Jc(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Gc(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qc(e,t){const n=Gc(e);return Math.round(t*n)/n}function ed(e){const t=r.useRef(e);return Zc((()=>{t.current=e})),t}
|
|
8
|
-
/*!
|
|
9
|
-
* tabbable 6.2.0
|
|
10
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
11
|
-
*/
|
|
12
|
-
var td=["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(","),nd="undefined"==typeof Element,rd=nd?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,od=!nd&&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},id=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)},ad=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!id(a,!1))if("SLOT"===a.tagName){var u=a.assignedElements(),s=e(u.length?u:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{rd.call(a,td)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!id(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&c){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},ud=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},sd=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))&&!ud(e)?0:e.tabIndex},ld=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},cd=function(e){return"INPUT"===e.tagName},dd=function(e){return function(e){return cd(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||od(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)},fd=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},hd=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=rd.call(e,"details>summary:first-of-type")?e.parentElement:e;if(rd.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return fd(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,u=od(e);if(a&&!a.shadowRoot&&!0===r(a))return fd(e);e=e.assignedSlot?e.assignedSlot:a||u===e.ownerDocument?a:u.host}e=i}if(function(e){var t,n,r,o,i=e&&od(e),a=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&a;){var s,l,c;u=!(null===(l=a=null===(s=i=od(a))||void 0===s?void 0:s.host)||void 0===l||null===(c=l.ownerDocument)||void 0===c||!c.contains(a))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},pd=function(e,t){return!(t.disabled||id(t)||function(e){return cd(e)&&"hidden"===e.type}(t)||hd(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!!rd.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},vd=function(e,t){return!(dd(t)||sd(t)<0||!pd(e,t))},gd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},md=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,u=function(e,t){var n=sd(e);return n<0&&t&&!ud(e)?0:n}(a,i),s=i?e(t.candidates):a;0===u?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:s})})),r.sort(ld).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Dd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ad([e],t.includeContainer,{filter:vd.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:gd}):function(e,t,n){if(id(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(td));return t&&rd.call(e,td)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,vd.bind(null,t)),md(n)};const bd=r["useInsertionEffect".toString()]||(e=>e());var yd="undefined"!=typeof document?s:l;function Cd(){return Cd=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},Cd.apply(this,arguments)}let wd=!1,Bd=0;const Ed=()=>"floating-ui-"+Bd++;const Ad=r["useId".toString()]||function(){const[e,t]=r.useState((()=>wd?Ed():void 0));return yd((()=>{null==e&&t(Ed())}),[]),r.useEffect((()=>{wd||(wd=!0)}),[]),e};const xd=r.createContext(null),Fd=r.createContext(null);function Od(e){return"data-floating-ui-"+e}function kd(e){const t=u(e);return yd((()=>{t.current=e})),t}const Sd=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jd(e,t){const n=Dd(e,Sd());"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}(function(e){return(null==e?void 0:e.ownerDocument)||document}(e)));return n.slice(r+1)[0]}function Pd(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&&Zl(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Rd(e){Dd(e,Sd()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Td(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 Nd={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 _d(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Md=r.forwardRef((function(e,t){const[n,o]=r.useState();yd((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",_d),()=>{document.removeEventListener("keydown",_d)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Od("focus-guard")]:"",style:Nd};return r.createElement("span",Cd({},e,i))})),Ld=r.createContext(null),Id=Od("portal");function zd(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),a=Ad(),u=Wd(),s=r.useRef(null);return yd((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{s.current=null}))}),[o]),yd((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=a,n.setAttribute(Id,""),e.appendChild(n),s.current=n,i(n)}),[t,a]),yd((()=>{if(s.current)return;let e=n||(null==u?void 0:u.portalNode);e&&!Xl(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=a,o.setAttribute(Id,""),e=r||e,e.appendChild(o),s.current=o,i(o)}),[t,n,a,u]),o}({id:n,root:o}),[u,s]=r.useState(null),l=r.useRef(null),c=r.useRef(null),d=r.useRef(null),f=r.useRef(null),h=!!u&&!u.modal&&u.open&&i&&!(!o&&!a);return r.useEffect((()=>{if(a&&i&&(null==u||!u.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Pd(e)){("focusin"===e.type?Td:Rd)(a)}}}),[a,i,null==u?void 0:u.modal]),r.createElement(Ld.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:s})),[i,a])},h&&a&&r.createElement(Md,{"data-type":"outside",ref:l,onFocus:e=>{if(Pd(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=jd(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),h&&a&&r.createElement("span",{"aria-owns":a.id,style:Nd}),a&&B(t,a),h&&a&&r.createElement(Md,{"data-type":"outside",ref:c,onFocus:e=>{if(Pd(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=jd(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent))}}}))}const Wd=()=>r.useContext(Ld),Vd=new Set,qd=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=Ad();return yd((()=>{if(!n)return;Vd.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,a=t.left?parseFloat(t.left):window.pageXOffset,u=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,l;const e=(null==(s=window.visualViewport)?void 0:s.offsetLeft)||0,n=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(u-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Vd.delete(i),0===Vd.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,u)))}}),[i,n]),r.createElement("div",Cd({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Ud(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[a,u]=r.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||a,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:u}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=r.useState(o);Jc(h,o)||p(o);const[v,g]=r.useState(null),[m,D]=r.useState(null),b=r.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),C=r.useCallback((e=>{e!==A.current&&(A.current=e,D(e))}),[]),w=a||v,B=u||m,E=r.useRef(null),A=r.useRef(null),x=r.useRef(d),F=null!=l,O=ed(l),k=ed(i),S=r.useCallback((()=>{if(!E.current||!A.current)return;const e={placement:t,strategy:n,middleware:h};k.current&&(e.platform=k.current),Yc(E.current,A.current,e).then((e=>{const t={...e,isPositioned:!0};j.current&&!Jc(x.current,t)&&(x.current=t,y.flushSync((()=>{f(t)})))}))}),[h,t,n,k]);Zc((()=>{!1===c&&x.current.isPositioned&&(x.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const j=r.useRef(!1);Zc((()=>(j.current=!0,()=>{j.current=!1})),[]),Zc((()=>{if(w&&(E.current=w),B&&(A.current=B),w&&B){if(O.current)return O.current(w,B,S);S()}}),[w,B,S,O,F]);const P=r.useMemo((()=>({reference:E,floating:A,setReference:b,setFloating:C})),[b,C]),R=r.useMemo((()=>({reference:w,floating:B})),[w,B]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Qc(R.floating,d.x),r=Qc(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Gc(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:S,refs:P,elements:R,floatingStyles:T})),[d,S,P,R,T])}(e),c=r.useContext(Fd),d=null!=((null==(f=r.useContext(xd))?void 0:f.id)||null);var f;const h=function(e){const t=r.useRef((()=>{}));return bd((()=>{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&&(v.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:n,nested:d}),null==o||o(e,t,n)})),p=r.useRef(null),v=r.useRef({}),g=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=Ad(),D=r.useCallback((e=>{const t=Xl(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),b=r.useCallback((e=>{(Xl(e)||null===e)&&(p.current=e,u(e)),(Xl(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!Xl(e))&&l.refs.setReference(e)}),[l.refs]),C=r.useMemo((()=>({...l.refs,setReference:b,setPositionReference:D,domReference:p})),[l.refs,b,D]),w=r.useMemo((()=>({...l.elements,domReference:s})),[l.elements,s]),B=r.useMemo((()=>({...l,refs:C,elements:w,dataRef:v,nodeId:i,floatingId:m,events:g,open:n,onOpenChange:h})),[l,i,m,g,n,h,C,w]);return yd((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=B)})),r.useMemo((()=>({...l,context:B,refs:C,elements:w})),[l,C,w,B])}const Hd=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Kd(e,t){return"function"==typeof e?e(t):e}function $d(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[u,s]=r.useState(!1),[l,c]=r.useState("unmounted"),d=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,a);return yd((()=>{u&&!d&&c("unmounted")}),[u,d]),yd((()=>{if(o){if(n){c("initial");const e=requestAnimationFrame((()=>{c("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),c("close")}}),[n,o]),{isMounted:d,status:l}}function Xd(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:a,duration:u=250}=t,s=e.placement,l=s.split("-")[0],c=r.useMemo((()=>({side:l,placement:s})),[l,s]),d="number"==typeof u,f=(d?u:u.open)||0,h=(d?u:u.close)||0,[p,v]=r.useState((()=>({...Kd(a,c),...Kd(n,c)}))),{isMounted:g,status:m}=$d(e,{duration:u}),D=kd(n),b=kd(o),y=kd(i),C=kd(a);return yd((()=>{const e=Kd(D.current,c),t=Kd(y.current,c),n=Kd(C.current,c),r=Kd(b.current,c)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===m&&v((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===m&&v({transitionProperty:Object.keys(r).map(Hd).join(","),transitionDuration:f+"ms",...n,...r}),"close"===m){const r=t||e;v({transitionProperty:Object.keys(r).map(Hd).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,y,D,b,C,f,m,c]),{isMounted:g,styles:p}}var Yd;function Zd(){return Zd=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},Zd.apply(this,arguments)}var Jd=function(e){return r.createElement("svg",Zd({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Yd||(Yd=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 Gd(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 Qd=["color"],ef=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Gd(e,Qd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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"}))})),tf=["color"],nf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Gd(e,tf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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"}))})),rf=["color"],of=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Gd(e,rf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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"}))})),af=["color"],uf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Gd(e,af);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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"}))})),sf=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()}},lf={"text/plain":"Text","text/html":"Url",default:"Text"};var cf=function(e,t){var n,r,o,i,a,u,s=!1;t||(t={}),n=t.debug||!1;try{if(o=sf(),i=document.createRange(),a=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.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=lf[t.format]||lf.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(u),i.selectNodeContents(u),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),u&&document.body.removeChild(u),o()}return s};function df(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ff(e){if(!e)return;const t=df(e);return t?e[t]:void 0}const hf=i(void 0),pf=({children:r,tools:o})=>{const i=c((()=>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=c((()=>o?Object.keys(o).map((t=>{var n,r,i;const a=null===(n=null==o?void 0:o[t])||void 0===n?void 0:n.tool,u=null===(r=null==o?void 0:o[t])||void 0===r?void 0:r.render,s=null===(i=null==o?void 0:o[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:u},s),t):null})):null),[c]);return e(hf.Provider,Object.assign({value:i},{children:t(n,{children:[a,r]})}))},vf=()=>{const e=a(hf);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e},gf=({children:t})=>e("div",Object.assign({className:"flex flex-col"},{children:t})),mf=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"bg-[#FFF] relative min-w-[200px] w-auto overflow-hidden rounded-md border bg-popover py-[6px] px-0 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"},{children:t})),Df=({children:t})=>e("div",Object.assign({className:"relative flex cursor-default select-none items-center text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"},{children:t})),bf=({isOpen:n,onClose:r,refs:o,style:i,children:a})=>{var u;const s=k(),l=vf(),[c,d]=f(!1),{refs:h,floatingStyles:p,context:v}=Ud({placement:"right",open:c,onOpenChange:d,middleware:[Xc(),$c(),Kc(),kc(10)],whileElementsMounted:Hc}),{isMounted:g,styles:m}=Xd(v,{duration:100});if(!n)return null;const D=A(s,{at:s.selection}),b=ff(s.blocks[(null==D?void 0:D.type)||""].elements),y="void"===(null===(u=null==b?void 0:b.props)||void 0===u?void 0:u.nodeType),C=l.ActionMenu,w=Object.assign(Object.assign({},p),m);return e(zd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(qd,Object.assign({lockScroll:!0,className:"z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(mf,{children:[t(gf,{children:[e(Df,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(uf,{className:"w-4 h-4 mr-2"}),"Delete"]}))}),e(Df,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(ef,{className:"w-4 h-4 mr-2"}),"Duplicate"]}))}),!y&&t(Df,{children:[g&&!!C&&e(zd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(qd,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>d(!1)},{children:e("div",Object.assign({style:w,ref:h.setFloating},{children:e(C,{actions:Object.keys(s.blocks),editor:s,selectedAction:"",onClose:()=>d(!1),empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",ref:h.setReference,onClick:()=>d((e=>!e))},{children:[e(Jd,{className:"w-4 h-4 mr-2"}),"Turn into"]}))]}),e(Df,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=A(s);e&&cf(`${window.location.origin}${window.location.pathname}#${e.id}`),r()}},{children:[e(of,{className:"w-4 h-4 mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var yf=Object.freeze({__proto__:null,BlockOptions:bf,BlockOptionsMenuContent:mf,BlockOptionsMenuGroup:gf,BlockOptionsMenuItem:Df,BlockOptionsSeparator:({className:t})=>e("div",{className:`h-[1px] bg-[#37352f14] my-[4px] w-full ${t}`})});function Cf(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var wf={actions:"vuZgncnq",hovered:"_8Eqjiv7m",actionButton:"WabGEp54",plusButton:"_0C8RpLmz"};function Bf(...e){return e.filter(Boolean).join(" ")}Cf(".vuZgncnq{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}._8Eqjiv7m{opacity:1}.WabGEp54{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}.WabGEp54:active,.WabGEp54:focus,.WabGEp54:hover{background-color:rgba(55,54,47,.08)}._0C8RpLmz{width:24px}");const Ef=({block:n,editor:r,dragHandleProps:o,showActions:i,onChangeActiveBlock:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c,context:d}=Ud({placement:"right-start",open:u,onOpenChange:s,middleware:[Xc(),$c(),Kc(),kc()]}),{isMounted:h,styles:p}=Xd(d,{duration:100}),{setActivatorNodeRef:v,attributes:g,listeners:m}=o,D=Object.assign(Object.assign({},c),p);return t("div",Object.assign({contentEditable:!1,className:Bf(wf.actions,i&&wf.hovered,"yoopta-element-actions")},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=q({id:W()}),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0})},className:Bf(wf.actionButton,wf.plusButton,"yoopta-element-actions-plus")},{children:e(An,{})})),e("button",Object.assign({type:"button",className:Bf(wf.actionButton,"yoopta-element-actions-drag"),ref:e=>{v(e),l.setReference(e)}},g,m,{onClick:e=>{e.stopPropagation(),a(n.id),console.log("editor.children",r.children);const t=xn(r,{at:[n.meta.order]});console.log("block",n),console.log("slate",t),r.focusBlock(n.id),t&&setTimeout((()=>{Bs.blur(t),Bs.deselect(t),qi.deselect(t),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),s(!0)}),10)}},{children:e(Bn,{})})),e(bf,{isOpen:h,refs:l,style:D,onClose:()=>s(!1)})]}))},Af=({children:n,block:r,blockId:o})=>{var i;const a=k(),[u,s]=f(null),{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:h,transform:p,transition:v,active:g,over:m,isOver:D,isDragging:b}=vn({id:o}),y={transform:p?`translate3d(${p.x}px, ${p.y}px, 0)`:"none",transition:v,opacity:b?.7:1,marginLeft:20*r.meta.depth+"px"},C=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=u===o,B=e=>s(e);return t("div",Object.assign({className:"relative py-0 px-[2px] mt-[2px] mb-[1px] rounded yoopta-block-wrapper",onMouseEnter:()=>B(o),onMouseLeave:()=>s(null),"data-yoopta-block-id":o,style:y,"data-yoopta-block":!0,ref:d},{children:[e(Ef,{block:r,editor:a,dragHandleProps:{setActivatorNodeRef:h,attributes:l,listeners:c},showActions:w,onChangeActiveBlock:B}),e("div",Object.assign({className:wf.content,style:{borderBottom:D&&!b?"2px solid #007aff":"none"}},{children:n})),C&&e("div",{className:"absolute left-0 top-0 bg-[#2383e224] z-[90] rounded opacity-100 h-full w-full pointer-events-none yoopta-selection-block"})]}))};function xf(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;const Ff={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"},Of={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"},kf={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Sf=e=>{const t=Ff[e],n=Of[e],r=kf[e],o=t&&bu(t),i=n&&bu(n),a=r&&bu(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!a||!a(e)))},jf={isBold:Sf("bold"),isCompose:Sf("compose"),isArrowLeft:Sf("arrowLeft"),isArrowRight:Sf("arrowRight"),isArrowUp:Sf("arrowUp"),isArrowDown:Sf("arrowDown"),isDeleteBackward:Sf("deleteBackward"),isDeleteForward:Sf("deleteForward"),isDeleteLineBackward:Sf("deleteLineBackward"),isDeleteLineForward:Sf("deleteLineForward"),isDeleteWordBackward:Sf("deleteWordBackward"),isDeleteWordForward:Sf("deleteWordForward"),isExtendBackward:Sf("extendBackward"),isExtendForward:Sf("extendForward"),isExtendLineBackward:Sf("extendLineBackward"),isExtendLineForward:Sf("extendLineForward"),isItalic:Sf("italic"),isMoveLineBackward:Sf("moveLineBackward"),isMoveLineForward:Sf("moveLineForward"),isCtrlLeft:Sf("ctrlLeft"),isCtrlRight:Sf("ctrlRight"),isRedo:Sf("redo"),isShiftEnter:Sf("shiftEnter"),isEnter:Sf("enter"),isTransposeCharacter:Sf("transposeCharacter"),isUndo:Sf("undo"),isSpace:Sf("space"),isSelect:Sf("select"),isTab:Sf("tab"),isShiftTab:Sf("shiftTab"),isBackspace:Sf("backspace"),isCmdEnter:Sf("cmdEnter"),isCmd:Sf("cmd"),isEscape:Sf("escape"),isSlashCommand:Sf("slashCommand"),isShiftArrowUp:Sf("shiftArrowUp"),isShiftArrowDown:Sf("shiftArrowDown"),isKekceburek:Sf("kekCeburek")};const Pf={onKeyDown:function(e){return t=>{const n=xn(e,{at:e.selection});if(!n||!n.selection)return;const r=ko.parent(n.selection.anchor.path);if(jf.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(jf.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=Qo.isStart(n,n.selection.anchor,r),i=Qo.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const a=q({id:W()}),u=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:u,slate:n,focus:!0})}else if(jf.isBackspace(t)){if(t.isDefaultPrevented())return;const r=ko.parent(n.selection.anchor.path);if(Qo.isStart(n,n.selection.anchor,r)){t.preventDefault();const o=Qo.string(n,r),i=e.selection?e.selection[0]-1:0,a=xn(e,{at:[i]});let u;if(a&&(u=function(e,t){const[,n]=Qo.last(e,t);return{path:n,offset:Qo.string(e,n).length}}(a,r)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:u});{if(Vo.isExpanded(n.selection))return qi.delete(n,{at:n.selection});if(!a)return;if(0===Qo.string(a,[0,0]).length)return e.deleteBlock({at:[i],focus:!0,focusAt:u});const t=Array.from(Qo.nodes(n,{at:[0],match:e=>!Qo.isEditor(e)&&(di.isText(e)||Qo.isInline(n,e)),mode:"highest"})),r=t.map((([e])=>e));return qi.insertNodes(a,r,{at:Qo.end(a,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:u})}}}else{if(jf.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=Qo.first(n,[0]),[,o]=Qo.last(n,[n.children.length-1]),i=Qo.range(n,r,o),a=Vo.equals(n.selection,i);if(Vo.isExpanded(n.selection)&&a)return t.preventDefault(),Bs.blur(n),Bs.deselect(n),qi.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(jf.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(jf.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(jf.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=ko.parent(n.selection.anchor.path);if(Qo.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=xn(e,{at:n}),o=A(e,{at:n});if(r&&o){const[,n]=Qo.last(r,[0]),i={path:n,offset:Qo.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(jf.isArrowDown(t)){const r=ko.parent(n.selection.anchor.path);if(Qo.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=xn(e,{at:n}),i=A(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=Qo.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(Vo.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&bu(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Rf=({children:t,attributes:n,placeholder:r})=>{const o=a(ll),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Tf(e){try{return new URL(e),!0}catch(e){return!1}}const Nf=(e,t)=>{(e=>{const[t]=Qo.nodes(e,{match:e=>!Qo.isEditor(e)&&Uo.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{qi.unwrapNodes(e,{match:e=>!Qo.isEditor(e)&&Uo.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&Vo.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};r?qi.insertNodes(e,o):(qi.wrapNodes(e,o,{split:!0}),qi.collapse(e,{edge:"end"}))},_f=i(null),Mf={didCatch:!1,error:null};class Lf extends v{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Mf}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:o,reason:"imperative-api"}),this.setState(Mf)}}componentDidCatch(e,t){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:r}=this.props;var o,i;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,r)&&(null===(o=(i=this.props).onReset)||void 0===o||o.call(i,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(Mf))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:o,error:i}=this.state;let a=e;if(o){const e={error:i,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=m(n,e);else{if(null!==r&&!D(r))throw i;a=r}}return m(_f.Provider,{value:{didCatch:o,error:i,resetErrorBoundary:this.resetErrorBoundary}},a)}}const If=({id:t,customEditor:r,elements:o,marks:i,events:a,options:s,placeholder:l="Type '/' for commands"})=>{const d=k(),f=S(t),h=u(f.value).current,p=f.type,v=c((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),g=c((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(i)),[i]),m=c((()=>{let e=d.blockEditorsMap[t];return Object.keys(o).forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,a="void"===r,u="inlineVoid"===r;u&&(e.markableVoid=e=>e.type===t),(a||u)&&(e.isVoid=e=>e.type===t),(i||u)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n,isInline:r,isElementReadOnly:o,isSelectable:i}=e;return e.isInline=e=>["link","mention"].includes(e.type)||r(e),e.insertText=t=>{t&&Tf(t)?Nf(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Tf(r)?Nf(e,r):t(n)},e})(e))})),e}),[]),D=c((()=>{if(!a)return{};const e={hotkeys:jf,currentBlock:f,defaultBlock:q({id:W()})},t={};return Object.keys(a).forEach((n=>{t[n]=function(t){if(a[n]){a[n](d,m,e)(t)}}})),t}),[a,d,f]);return e(Lf,Object.assign({onError:(e,t)=>{console.log("ERROR IN SLATE EDITOR",e),console.log("INFO FOR ERROR",t)},fallbackRender:()=>e("div",{children:"Something went wrong with Editor"})},{children:e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":p},{children:e(zf,{id:t,slate:m,initialValue:h,onChange:e=>d.updateBlock(t,{value:e}),decorate:e=>{var t;const n=[],[r,o]=e,i=(null===(t=d.selection)||void 0===t?void 0:t[0])===f.meta.order;return m.selection&&i&&!Qo.isEditor(r)&&""===Qo.string(m,[o[0]])&&Vo.includes(m.selection,o)&&Vo.isCollapsed(m.selection)&&n.push(Object.assign(Object.assign({},m.selection),{withPlaceholder:!0})),n},renderLeaf:t=>{var n,r,o,i,a;let{children:u,leaf:s,attributes:c}=t;const h=xf(s,["text"]),p=(null===(n=d.selection)||void 0===n?void 0:n[0])===f.meta.order;h&&Object.keys(h).forEach((e=>{const t=g[e];t&&(u=t.render({children:u,leaf:s}))}));const v=!("void"===(null===(a=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===a?void 0:a.nodeType))&&p&&s.withPlaceholder;return e(Rf,Object.assign({attributes:c,placeholder:v?l:void 0},{children:u}))},renderElement:r=>{const o=v[r.element.type];return o?e(o,Object.assign({},r,{blockId:t,options:s})):e(n,{})},eventHandlers:D,onKeyDown:e=>{var t;null===(t=D.onKeyDown)||void 0===t||t.call(D,e),Pf.onKeyDown(d)(e)},onKeyUp:e=>{var t;null===(t=null==D?void 0:D.onKeyUp)||void 0===t||t.call(D,e)},onFocus:e=>{var t;null===(t=null==D?void 0:D.onFocus)||void 0===t||t.call(D,e)},onMouseDown:e=>{var t,n;(null===(t=d.selection)||void 0===t?void 0:t[0])!==f.meta.order&&d.setSelection([f.meta.order]),null===(n=null==D?void 0:D.onMouseDown)||void 0===n||n.call(D,e)},onBlur:e=>{var t;e.preventDefault(),null===(t=null==D?void 0:D.onBlur)||void 0===t||t.call(D,e)},customEditor:r})}))}))},zf=h((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:a,eventHandlers:u,onKeyDown:s,onKeyUp:l,onFocus:c,onMouseDown:d,onBlur:f,customEditor:h,decorate:p})=>(console.log("Slate instance",n),console.log("Slate initialValue",r),e(Ml,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(Fl,Object.assign({renderElement:a,renderLeaf:i,className:"focus-visible:outline-none focus:outline-none",spellCheck:!0},u,{onKeyDown:s,onKeyUp:l,onFocus:c,onMouseDown:d,decorate:p,onBlur:f}),`editable-${t}`)}),`slate-${t}`))));zf.displayName="SlateEditorInstance";const Wf=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c((()=>[...t].filter((e=>null!=e))),[...t])}(Be(pt,{activationConstraint:{delay:100,tolerance:0}}),Be(lt,{coordinateGetter:Dn})),handleDragEnd:d((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:d((t=>{e.setBlockSelected(null)}),[])}),Vf=[],qf=({editor:t,marks:n})=>{const{sensors:r,handleDragEnd:o,handleDragStart:i}=Wf({editor:t}),a=Object.keys(t.children),u=c((()=>0===a.length?Vf:a.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[a]),s=[];for(let r=0;r<u.length;r++){const o=u[r],i=t.children[o],a=t.plugins[i.type];i&&a?s.push(e(Af,Object.assign({block:i,blockId:o},{children:e(If,{type:i.type,id:o,marks:n,events:a.events,elements:a.elements,options:a.options},o)}),o)):console.error(`Plugin ${i.type} not found`)}return e(Kt,Object.assign({sensors:r,collisionDetection:je,onDragStart:i,onDragEnd:o},{children:e(sn,Object.assign({items:u,strategy:on},{children:s}))}))},Uf=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=n=>{var i;const a=null===(i=t.current)||void 0===i?void 0:i.contains(n.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),s();a||o({origin:[n.pageX,n.pageY-window.pageYOffset],coords:[n.pageX,n.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!r.selection)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const n=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((r,o)=>{if(!r)return;const i=r.getBoundingClientRect(),a=Math.min(e[1],t[1]),u=Math.min(e[0],t[0]),s=Math.max(e[1],t[1]),l=Math.max(e[0],t[0]);a<i.bottom&&s>i.top&&u<i.right&&l>i.left&&n.push(o)})),n})(r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(n,{only:!0})},u=()=>{s()};l((()=>{var e;const r=n&&"current"in n?n.current:n||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(e=t.current)||void 0===e?void 0:e.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",u),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",u)}}),[e.selectedBlocks,r,n]);const s=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:s})},Hf=({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})},Kf={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},$f=({marks:n,className:r,autoFocus:o=!0,selectionBoxRoot:i})=>{const a=k(),s=u(null),c=Uf({editor:a,yooptaEditorRef:s,root:i});let d=u(Kf).current;console.log("editor.children",a.children),console.log("editor.blockEditorsMap",a.blockEditorsMap),l((()=>{if(!o)return;const e=A(a,{at:[0]});e&&a.focusBlock(e.id,{waitExecution:!0})}),[o]),l((()=>(document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p))),[a.selectedBlocks]);const f=()=>{Array.isArray(a.selectedBlocks)&&a.selectedBlocks.length>0&&a.setBlockSelected(null)},h=()=>{d.indexToSelect=null,d.startedIndexToSelect=null,d.selectionStarted=!1},p=e=>{var t,n,r,o,i;if(jf.isSelect(e)){if((null===(t=a.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(a.children).length)return void e.preventDefault();if(d.selectionStarted)return e.preventDefault(),void a.setBlockSelected([],{allSelected:!0})}if(jf.isBackspace(e)){e.stopPropagation();if(Array.isArray(a.selectedBlocks)&&(null===(n=a.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(a.children).length)return e.preventDefault(),a.deleteBlock({deleteAll:!0}),a.setBlockSelected(null),void h();if(Array.isArray(a.selectedBlocks)&&(null===(r=a.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),a.deleteBlock({fromPaths:a.selectedBlocks}),a.setBlockSelected(null),void h()}if(jf.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(d.selectionStarted&&null!==d.startedIndexToSelect&&null!==d.indexToSelect){const e=d.indexToSelect,t=e-1;if(0===e)return;if(e===d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if(t<d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if((null===(o=a.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==d.startedIndexToSelect){const n=a.selectedBlocks.filter((t=>t!==e));return a.setBlockSelected(n,{only:!0}),void(d.indexToSelect=t)}return}const t=A(a),n=xn(a);if(!n||!n.selection||!t)return;const r=ko.parent(n.selection.anchor.path),i=Qo.isStart(n,n.selection.focus,r);if(Vo.isExpanded(n.selection)&&i){const r=a.selection?[a.selection[0]-1]:[0],o=A(a,{at:r});t&&o&&(e.preventDefault(),Bs.blur(n),Bs.deselect(n),qi.deselect(n),a.setSelection(null),a.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)-1]),d.startedIndexToSelect=t.meta.order,d.indexToSelect=t.meta.order-1,d.selectionStarted=!0)}}if(jf.isShiftArrowDown(e)){if(d.selectionStarted&&null!==d.indexToSelect&&null!==d.startedIndexToSelect){const e=d.indexToSelect,t=e+1;if(t===Object.keys(a.children).length)return;if(e===d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if(t>d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if((null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==d.startedIndexToSelect){const n=a.selectedBlocks.filter((t=>t!==e));return a.setBlockSelected(n,{only:!0}),void(d.indexToSelect=t)}return}const t=A(a),n=xn(a);if(!n||!n.selection||!t)return;const r=ko.parent(n.selection.anchor.path),o=Qo.isEnd(n,n.selection.focus,r);if(Vo.isExpanded(n.selection)&&o){const r=a.selection?[a.selection[0]+1]:[0],o=A(a,{at:r});t&&o&&(e.preventDefault(),Bs.blur(n),Bs.deselect(n),qi.deselect(n),a.setSelection(null),a.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),d.startedIndexToSelect=t.meta.order,d.indexToSelect=t.meta.order+1,d.selectionStarted=!0)}}},v=(g={userSelect:c.selection?"none":"auto",pointerEvents:c.selection?"none":"auto"},Object.assign({paddingBottom:150},g));var g;return t("div",Object.assign({id:"yoopta-editor",className:r,style:v,ref:s,onClick:e=>{h(),(e=>{var t;const n=s.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10);if(e.clientY>=o){const e=Object.keys(a.children).length-1,n=A(a,{at:[e]}),r=xn(a,{at:[e]});if(n&&r&&r.selection){const e=Qo.string(r,r.selection.anchor.path),o=ko.parent(r.selection.anchor.path),[i]=Qo.node(r,o);if(Uo.isElement(i)&&"void"!==(null===(t=i.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void a.focusBlock(n.id,{slate:r})}const o=q({id:W()}),i=e+1;a.insertBlock(o,{at:[i],focus:!0})}})(e),f()},onBlur:e=>{var t;(null===(t=s.current)||void 0===t?void 0:t.contains(e.relatedTarget))||(h(),f())}},{children:[e(qf,{editor:a,marks:n}),e(Hf,{origin:c.origin,coords:c.coords,isOpen:c.selection})]}))},Xf=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return l((()=>r(!0)),[]),n?e:t};function Yf(e,t){const n=xn(e);if(!n)return!1;const r=Qo.marks(n);return!!(null==r?void 0:r[t])}const Zf=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var o;const{selection:i}=t;if(" "===r&&i&&Vo.isCollapsed(i)){const{anchor:a}=i,u=Qo.above(t,{match:e=>Uo.isElement(e)&&Qo.isBlock(t,e),mode:"lowest"});if(!u)return;const[,s]=u,l=Qo.parent(t,s),[c]=l;if(Uo.isElement(c)&&!di.isText(c.children[0]))return n(r);const d=u?s:[],f={anchor:a,focus:Qo.start(t,d)},h=Qo.string(t,f),p=null===(o=e.shortcuts)||void 0===o?void 0:o[h];if(!!p&&!p.isActive())return qi.select(t,f),qi.delete(t),void p.create({deleteText:!1})}n(r)},t};function Jf(e,t,n){e.children=mo(e.children);let r=!1;const o=e.children[t];if(!o)throw Error(`Block with id ${t} not found`);n.id&&(o.id=n.id,r=!0),n.type&&(o.type=n.type,r=!0),n.meta&&(o.meta=n.meta,r=!0),n.value&&(o.value=n.value),e.children=Do(e.children),e.emit("change",e.children),r&&e.applyChanges()}function Gf(e,t,n){e.children=mo(e.children);const r=A(e,{at:e.selection});if(!r)throw new Error("Block from not found at current selection");const o=df(e.blocks[r.type].elements);if(r.type===t)return void(e.children=Do(e.children));const i=xn(e,{at:[r.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${r.meta.order}`);const a=df(e.blocks[t].elements);Qo.withoutNormalizing(i,(()=>{const n=function(e,t={}){var n;const{at:r,elementType:o}=t,i=r||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!i)return;let a=e=>!Qo.isEditor(e)&&Uo.isElement(e);o&&(a=e=>!Qo.isEditor(e)&&Uo.isElement(e)&&e.type===o);const u=ko.parent(i),s=Qo.nodes(e,{at:u,match:a,mode:"lowest"});if(s){const[e]=s;return e}}(i,{elementType:o});console.log({fromBlockRootElementType:o,node:n}),qi.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>Uo.isElement(e)&&!Qo.isInline(i,e)});const u={id:r.id,type:t,meta:Object.assign(Object.assign({},r.meta),{order:r.meta.order}),value:i.children};e.blockEditorsMap[r.id]=i,e.children[r.id]=u,e.children=Do(e.children),e.applyChanges()}))}function Qf(e,t={}){const{at:n=e.selection,deleteAll:r=!1,fromPaths:o,focus:i}=t;if(console.log("BEFORE options.focusAt",t.focusAt),Array.isArray(o)&&o.length>0){e.children=mo(e.children),o.forEach((t=>{const n=A(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=Do(e.children),void e.applyChanges()}if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=q({id:W()}),n=Zf(e,Vl(Ca()));return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),void e.applyChanges()}if(!n)return;e.children=mo(e.children);const[a]=n,u=Object.keys(e.children),s=u.find((t=>e.children[t].meta.order===a));if(u.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),s&&(delete e.children[s],delete e.blockEditorsMap[s]),e.children=Do(e.children),e.applyChanges(),i){const n=e.selection?e.selection[0]-1:0,r=A(e,{at:[n]});r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}function eh(e,t){const n={};return t.forEach((t=>{const r=t.type;n[r]={hotkey:t.hotkey,type:r,getValue:()=>function(e,t){const n=xn(e);if(!n)return null;const r=Qo.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>Yf(e,r),toggle:()=>function(e,t){const n=xn(e),r=Yf(e,t);n&&(r?Qo.removeMark(n,t):Qo.addMark(n,t,!0),e.applyChanges())}(e,r),update:t=>function(e,t,n){const r=xn(e);console.log("update editor.selection",e.selection),console.log("text format slate.selection",r),r&&r.selection&&Vo.isExpanded(r.selection)&&(Qo.addMark(r,t,n),e.applyChanges())}(e,r,t)}})),n}function th(e,t){const n={};return t.forEach(((t,r)=>{var o;const i=ff(t.elements),a=null===(o=null==i?void 0:i.props)||void 0===o?void 0:o.nodeType;if(!("inline"===a||"inlineVoid"===a)){const r={};Object.keys(t.elements).forEach((e=>{const n=xf(t.elements[e],["render"]);r[e]=n}));const{display:o,placeholder:i,align:a,shortcuts:u}=t.options||{};n[t.type]={type:t.type,elements:r,options:{display:o,placeholder:i,align:a,shortcuts:u},isActive:()=>{const n=A(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{Gf(e,t)},create:n=>{!function(e,t,n){var r;e.children=mo(e.children);const o=A(e);if(!o)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==n?void 0:n.slate)||xn(e,{at:[null==o?void 0:o.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],u=df(a.elements),s=a.elements[u];if(!s)return;const l=Object.assign({nodeType:(null===(r=s.props)||void 0===r?void 0:r.nodeType)||"block"},s.props),c=V({id:W(),type:u,props:l});qi.setNodes(i,c,{at:[0,0],match:e=>Uo.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&qi.delete(i,{at:[0,0]});const d=q({id:o.id,type:a.type,meta:{order:o.meta.order,depth:o.meta.depth},value:[c]}),f=d.id;e.children[f]=d,e.blockEditorsMap[f]=i,e.children=Do(e.children),e.applyChanges(),(null==n?void 0:n.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{Jf(e,t,n)},updateElement:(t,n,r)=>{!function(e,t,n,r){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const i=xn(e,{at:[o.meta.order]});i?Qo.withoutNormalizing(i,(()=>{const[t]=Qo.nodes(i,{at:[0],match:e=>Uo.isElement(e)&&e.type===n}),o=null==t?void 0:t[0],a=(null==o?void 0:o.props)||{},u={props:Object.assign(Object.assign({},a),r)};console.log("updatedNode",u),qi.setNodes(i,u,{at:[0],match:e=>Uo.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges()})):console.warn("No slate found")}(e,t,n,r)},delete:t=>{Qf(e,t)}}}})),n}function nh(e){return Zf(e,Vl(Ca()))}const rh=(()=>{const e=W();return{[e]:q({id:e})}})(),oh=new M,ih=(e,t)=>oh.on(e,t),ah=(e,t)=>oh.once(e,t),uh=(e,t)=>oh.off(e,t),sh=(e,t)=>oh.emit(e,t);const lh=({editor:n,value:r,marks:o,plugins:i,autoFocus:a,className:u,tools:s,selectionBoxRoot:l,children:d})=>{const h=()=>{g((e=>Object.assign(Object.assign({},e),{version:e.version+1}))),n.emit("change",n.children)},p=c((()=>i.map((e=>e.getPlugin))),[i]),[v,g]=f((()=>(n.applyChanges=h,o&&(n.formats=eh(n,o)),n.blocks=th(n,p),n.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r)?r:rh,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=nh(e);t[n]=r})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,r,o,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(r=e.options)||void 0===r?void 0:r.shortcuts.length)>0&&(null===(i=null===(o=e.options)||void 0===o?void 0:o.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var r;const o=e.elements[t],i=null===(r=o.props)||void 0===r?void 0:r.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=o)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const r=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:r})}})),t}(p),n.on=ih,n.once=ah,n.off=uh,n.emit=sh,{editor:n,version:0})));return e(Xf,{children:e(O,Object.assign({editorState:v},{children:t(pf,Object.assign({tools:s},{children:[e($f,{marks:o,autoFocus:a,className:u,selectionBoxRoot:l}),d]}))}))})},ch=Object.assign(Object.assign({},yf),{ExtendedBlockActions:({className:r,style:o,onClick:i,children:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c,context:d}=Ud({placement:"bottom-start",open:u,onOpenChange:s,middleware:[Xc(),$c(),Kc(),kc(10)],whileElementsMounted:Hc}),{isMounted:h,styles:p}=Xd(d,{duration:100}),v=Object.assign(Object.assign({},p),c);return t(n,{children:[h&&e(bf,Object.assign({isOpen:!0,onClose:()=>s(!1),refs:l,style:v},{children:a})),e("button",Object.assign({type:"button",ref:l.setReference,className:`absolute right-[10px] top-[10px] flex items-center justify-between z-10 opacity-1 bg-[#eee] w-[22px] h-[22px] transition-opacity duration-150 ease-in border-none cursor-pointer rounded-[2px] p-[0_4px] ${r}`,onClick:()=>{null==i||i(),s(!0)},style:o},{children:e(nf,{})}))]})}});function dh(e,t){const n=Object.keys(e.children),{type:r}=t||{},o=n.find((t=>e.children[t].type===r));return o?e.children[o]:null}function fh(e,t,n={}){const{focusAt:r,waitExecution:o=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=n,u=()=>{const o=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!o||!i)return;const u=function(e,t){if(ri.isPoint(t))return t;if(ko.isPath(t))return{path:t,offset:0};const[,n]=Qo.first(e,[0]);return{path:n||[0,0],offset:0}}(o,r);Bs.focus(o),a&&setTimeout((()=>{qi.select(o,u),e.setSelection([i.meta.order])}),0)};o?setTimeout((()=>u()),i):u()}function hh(e){return Array.from(new Set(e))}var ph={};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",u="[object Function]",s="[object GeneratorFunction]",l="[object Map]",c="[object Number]",d="[object Object]",f="[object Promise]",h="[object RegExp]",p="[object Set]",v="[object String]",g="[object Symbol]",m="[object WeakMap]",D="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",w="[object Int8Array]",B="[object Int16Array]",E="[object Int32Array]",A="[object Uint8Array]",x="[object Uint8ClampedArray]",F="[object Uint16Array]",O="[object Uint32Array]",k=/\w*$/,S=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,P={};P[o]=P["[object Array]"]=P[D]=P[b]=P[i]=P[a]=P[y]=P[C]=P[w]=P[B]=P[E]=P[l]=P[c]=P[d]=P[h]=P[p]=P[v]=P[g]=P[A]=P[x]=P[F]=P[O]=!0,P["[object Error]"]=P[u]=P[m]=!1;var R="object"==typeof N&&N&&N.Object===Object&&N,T="object"==typeof self&&self&&self.Object===Object&&self,_=R||T||Function("return this")(),M=t&&!t.nodeType&&t,L=M&&e&&!e.nodeType&&e,I=L&&L.exports===M;function z(e,t){return e.set(t[0],t[1]),e}function W(e,t){return e.add(t),e}function V(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function q(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function U(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function H(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,Y=Function.prototype,Z=Object.prototype,J=_["__core-js_shared__"],G=($=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Y.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=I?_.Buffer:void 0,oe=_.Symbol,ie=_.Uint8Array,ae=H(Object.getPrototypeOf,Object),ue=Object.create,se=Z.propertyIsEnumerable,le=X.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=H(Object.keys,Object),he=Le(_,"DataView"),pe=Le(_,"Map"),ve=Le(_,"Promise"),ge=Le(_,"Set"),me=Le(_,"WeakMap"),De=Le(Object,"create"),be=qe(he),ye=qe(pe),Ce=qe(ve),we=qe(ge),Be=qe(me),Ee=oe?oe.prototype:void 0,Ae=Ee?Ee.valueOf:void 0;function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ke(e){this.__data__=new Fe(e)}function Se(e,t){var n=He(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!se.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||We(a,r))||n.push(a);return n}function je(e,t,n){var r=e[t];ee.call(e,t)&&Ue(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Pe(e,t){for(var n=e.length;n--;)if(Ue(e[n][0],t))return n;return-1}function Re(e,t,n,r,f,m,S){var j;if(r&&(j=m?r(e,f,m,S):r(e)),void 0!==j)return j;if(!Ye(e))return e;var R=He(e);if(R){if(j=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,j)}else{var T=ze(e),N=T==u||T==s;if($e(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(T==d||T==o||N&&!m){if(q(e))return m?e:{};if(j=function(e){return"function"!=typeof e.constructor||Ve(e)?{}:(t=ae(e),Ye(t)?ue(t):{});var t}(N?{}:e),!t)return function(e,t){return _e(e,Ie(e),t)}(e,function(e,t){return e&&_e(t,Ze(t),e)}(j,e))}else{if(!P[T])return m?e:{};j=function(e,t,n,r){var o=e.constructor;switch(t){case D:return Ne(e);case i:case a:return new o(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case y:case C:case w:case B:case E:case A:case x:case F:case O:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(U(e),!0):U(e);return V(r,z,new e.constructor)}(e,r,n);case c:case v:return new o(e);case h:return function(e){var t=new e.constructor(e.source,k.exec(e));return t.lastIndex=e.lastIndex,t}(e);case p:return function(e,t,n){var r=t?n(K(e),!0):K(e);return V(r,W,new e.constructor)}(e,r,n);case g:return u=e,Ae?Object(Ae.call(u)):{}}var u}(e,T,Re,t)}}S||(S=new ke);var _=S.get(e);if(_)return _;if(S.set(e,j),!R)var M=n?function(e){return function(e,t,n){var r=t(e);return He(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ze,Ie)}(e):Ze(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(M||e,(function(o,i){M&&(o=e[i=o]),je(j,i,Re(o,t,n,r,i,e,S))})),j}function Te(e){return!(!Ye(e)||(t=e,G&&G in t))&&(Xe(e)||q(e)?ne:S).test(qe(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function _e(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],u=r?r(n[a],e[a],a,n,e):void 0;je(n,a,void 0===u?e[a]:u)}return n}function Me(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Te(n)?n:void 0}xe.prototype.clear=function(){this.__data__=De?De(null):{}},xe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},xe.prototype.get=function(e){var t=this.__data__;if(De){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},xe.prototype.has=function(e){var t=this.__data__;return De?void 0!==t[e]:ee.call(t,e)},xe.prototype.set=function(e,t){return this.__data__[e]=De&&void 0===t?n:t,this},Fe.prototype.clear=function(){this.__data__=[]},Fe.prototype.delete=function(e){var t=this.__data__,n=Pe(t,e);return!(n<0)&&(n==t.length-1?t.pop():le.call(t,n,1),!0)},Fe.prototype.get=function(e){var t=this.__data__,n=Pe(t,e);return n<0?void 0:t[n][1]},Fe.prototype.has=function(e){return Pe(this.__data__,e)>-1},Fe.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Oe.prototype.clear=function(){this.__data__={hash:new xe,map:new(pe||Fe),string:new xe}},Oe.prototype.delete=function(e){return Me(this,e).delete(e)},Oe.prototype.get=function(e){return Me(this,e).get(e)},Oe.prototype.has=function(e){return Me(this,e).has(e)},Oe.prototype.set=function(e,t){return Me(this,e).set(e,t),this},ke.prototype.clear=function(){this.__data__=new Fe},ke.prototype.delete=function(e){return this.__data__.delete(e)},ke.prototype.get=function(e){return this.__data__.get(e)},ke.prototype.has=function(e){return this.__data__.has(e)},ke.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Fe){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Oe(r)}return n.set(e,t),this};var Ie=ce?H(ce,Object):function(){return[]},ze=function(e){return te.call(e)};function We(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function Ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function qe(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ue(e,t){return e===t||e!=e&&t!=t}(he&&ze(new he(new ArrayBuffer(1)))!=b||pe&&ze(new pe)!=l||ve&&ze(ve.resolve())!=f||ge&&ze(new ge)!=p||me&&ze(new me)!=m)&&(ze=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?qe(n):void 0;if(r)switch(r){case be:return b;case ye:return l;case Ce:return f;case we:return p;case Be:return m}return t});var He=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Xe(e)}var $e=de||function(){return!1};function Xe(e){var t=Ye(e)?te.call(e):"";return t==u||t==s}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?Se(e):function(e){if(!Ve(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Re(e,!0,!0)}}({get exports(){return ph},set exports(e){ph=e}},ph);var vh=ph;function gh(e,t={}){const{blockId:n,focus:r}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let o=null;if(n&&(o=e.children[n],!o))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(o=A(e,{at:t.at}),!o))throw new Error(`Block in path ${t.at} not found`);if(!o)throw new Error("Block not found");e.children=mo(e.children);Object.values(e.children).forEach((e=>{e.meta.order>o.meta.order&&(e.meta.order+=1)}));const i=(a=o,"function"==typeof window.structuredClone?window.structuredClone(a):vh(a));var a;const u=nh(e);i.id=W(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=u;const s=i.id;e.children=Do(e.children),e.applyChanges(),r&&e.focusBlock(s,{waitExecution:!0})}function mh(e,t){Bs.blur(t),Bs.deselect(t),qi.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const Dh=()=>{const e={children:{},selection:null,selectedBlocks:null,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=mo(e.children);const{at:r=null,focus:o=!1,slate:i=null}=n,a=A(e),u=r,s={id:W(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let l=!1;if(i&&i.selection){const e=Qo.string(i,i.selection.anchor.path);l=Qo.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(u){const[t]=u;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),s.meta.order=t}else{const t=Object.keys(e.children).length;s.meta.order=t}const c=nh(e);e.blockEditorsMap[s.id]=c,l&&a&&(s.meta.order=a.meta.order,a.meta.order+=1),e.children[s.id]=s;const d=null==a?void 0:a.id;e.children=Do(e.children),e.applyChanges(),o&&e.focusBlock(l&&d?d:s.id)}(e,...t),deleteBlock:(...t)=>Qf(e,...t),duplicateBlock:(...t)=>gh(e,...t),toggleBlock:(...t)=>Gf(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=mo(e.children);const r=A(e);r&&(r.meta.depth=r.meta.depth+1,e.children=Do(e.children),e.applyChanges())}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=mo(e.children);const r=A(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=Do(e.children),e.applyChanges())}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=mo(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r));console.log("blockInNewPosition meta",Object.assign({},i).meta.depth);const a=o.meta.order<i.meta.order,u=o.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>o.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:u&&e.meta.order<o.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),o.meta.order=r,o.meta.depth=i.meta.depth,e.children=Do(e.children),e.applyChanges()}(e,...t),focusBlock:(...t)=>fh(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>Jf(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,o=A(e);n&&n.selection&&o&&Qo.withoutNormalizing(n,(()=>{e.children=mo(e.children);const t=ko.parent(n.selection.anchor.path);qi.splitNodes(n,{at:n.selection,match:e=>Uo.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=n.children.slice()[i];qi.removeNodes(n,{at:[i],match:e=>Uo.isElement(e),mode:"highest"});const u={id:W(),type:o.type,meta:{order:o.meta.order+1,depth:o.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=u.meta.order&&(e.meta.order+=1)}));const s=nh(e);e.blockEditorsMap[u.id]=s,e.children[u.id]=u,e.children=Do(e.children),e.applyChanges(),r&&e.focusBlock(u.id,{slate:s})}))}(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:r=!0}=n;e.selection=t,r&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:r=!1,allSelected:o=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(r)e.selectedBlocks=t;else if(o){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=hh(t)}else e.selectedBlocks=hh(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:xn(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>mh(e,r)),i):(mh(e,r),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};function bh({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}Cf('/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.right-\\[10px\\]{right:10px}.top-0{top:0}.top-\\[10px\\]{top:10px}.z-10{z-index:10}.z-\\[100\\]{z-index:100}.z-\\[90\\]{z-index:90}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.mb-\\[1px\\]{margin-bottom:1px}.mr-2{margin-right:.5rem}.mt-\\[2px\\]{margin-top:2px}.\\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.h-4{height:1rem}.h-\\[1px\\]{height:1px}.h-\\[22px\\]{height:22px}.h-full{height:100%}.w-4{width:1rem}.w-\\[22px\\]{width:22px}.w-auto{width:auto}.w-full{width:100%}.min-w-\\[200px\\]{min-width:200px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.bg-\\[\\#2383e224\\]{background-color:#2383e224}.bg-\\[\\#37352f14\\]{background-color:#37352f14}.bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.p-\\[0_4px\\]{padding:0 4px}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.text-sm{font-size:.875rem;line-height:1.25rem}.italic{font-style:italic}.leading-\\[120\\%\\]{line-height:120%}.opacity-100{opacity:1}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}');export{jf as HOTKEYS,ch as UI,E as YooptaPlugin,q as buildBlockData,V as buildBlockElement,Dh as createYooptaEditor,bh as createYooptaMark,lh as default,A as findPluginBlockBySelectionPath,dh as findPluginBlockByType,xn as findSlateBySelectionPath,W as generateId,ff as getRootBlockElement,df as getRootBlockElementType,S as useBlockData,T as useBlockSelected,j as useYooptaBlock,k as useYooptaEditor,P as useYooptaPlugin,R as useYooptaPluginOptions,vf as useYooptaTools};
|
|
12
|
+
*/
|
|
13
|
+
function ea(e){return"[object Object]"===Object.prototype.toString.call(e)}var ta={isHistory(e){return!1!==ea(t=e)&&(void 0===(o=t.constructor)||!1!==ea(n=o.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,o,n}},oa=new WeakMap,na=new WeakMap,ra={isHistoryEditor:e=>ta.isHistory(e.history)&&S.isEditor(e),isMerging:e=>na.get(e),isSaving:e=>oa.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var o=ra.isMerging(e);na.set(e,!1),t(),na.set(e,o)},withoutSaving(e,t){var o=ra.isSaving(e);oa.set(e,!1),t(),oa.set(e,o)}},ia=e=>{var t=e,{apply:o}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:o}=e;if(o.length>0){var n=o[o.length-1];n.selectionBefore&&_.setSelection(t,n.selectionBefore),ra.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of n.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",n)}},t.undo=()=>{var{history:e}=t,{undos:o}=e;if(o.length>0){var n=o[o.length-1];ra.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=n.operations.map(A.inverse).reverse();for(var o of e)t.apply(o);n.selectionBefore&&_.setSelection(t,n.selectionBefore)}))})),t.writeHistory("redos",n),e.undos.pop()}},t.apply=e=>{var{operations:n,history:r}=t,{undos:i}=r,a=i[i.length-1],l=a&&a.operations[a.operations.length-1],c=ra.isSaving(t),s=ra.isMerging(t);if(null==c&&(c=la(e)),c){if(null==s&&(s=null!=a&&(0!==n.length||aa(e,l))),a&&s)a.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();r.redos=[]}o(e)},t.writeHistory=(e,o)=>{t.history[e].push(o)},t},aa=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!D.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!D.equals(e.path,t.path)),la=(e,t)=>"set_selection"!==e.type,ca=Symbol.for("immer-nothing"),sa=Symbol.for("immer-draftable"),da=Symbol.for("immer-state");function ua(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fa=Object.getPrototypeOf;function pa(e){return!!e&&!!e[da]}function ha(e){return!!e&&(ga(e)||Array.isArray(e)||!!e[sa]||!!e.constructor?.[sa]||xa(e)||ka(e))}var ya=Object.prototype.constructor.toString();function ga(e){if(!e||"object"!=typeof e)return!1;const t=fa(e);if(null===t)return!0;const o=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return o===Object||"function"==typeof o&&Function.toString.call(o)===ya}function va(e,t){0===ma(e)?Reflect.ownKeys(e).forEach((o=>{t(o,e[o],e)})):e.forEach(((o,n)=>t(n,o,e)))}function ma(e){const t=e[da];return t?t.type_:Array.isArray(e)?1:xa(e)?2:ka(e)?3:0}function ba(e,t){return 2===ma(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wa(e,t,o){const n=ma(e);2===n?e.set(t,o):3===n?e.add(o):e[t]=o}function xa(e){return e instanceof Map}function ka(e){return e instanceof Set}function Oa(e){return e.copy_||e.base_}function Ea(e,t){if(xa(e))return new Map(e);if(ka(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&ga(e)){if(!fa(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const o=Object.getOwnPropertyDescriptors(e);delete o[da];let n=Reflect.ownKeys(o);for(let t=0;t<n.length;t++){const r=n[t],i=o[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(fa(e),o)}function Ca(e,t=!1){return _a(e)||pa(e)||!ha(e)||(ma(e)>1&&(e.set=e.add=e.clear=e.delete=Sa),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Ca(t,!0)))),e}function Sa(){ua(2)}function _a(e){return Object.isFrozen(e)}var Da,Ra={};function ja(e){const t=Ra[e];return t||ua(0),t}function Ba(){return Da}function Aa(e,t){t&&(ja("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ta(e){Ma(e),e.drafts_.forEach(Na),e.drafts_=null}function Ma(e){e===Da&&(Da=e.parent_)}function La(e){return Da={drafts_:[],parent_:Da,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Na(e){const t=e[da];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ia(e,t){t.unfinalizedDrafts_=t.drafts_.length;const o=t.drafts_[0];return void 0!==e&&e!==o?(o[da].modified_&&(Ta(t),ua(4)),ha(e)&&(e=Pa(t,e),t.parent_||za(t,e)),t.patches_&&ja("Patches").generateReplacementPatches_(o[da].base_,e,t.patches_,t.inversePatches_)):e=Pa(t,o,[]),Ta(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ca?e:void 0}function Pa(e,t,o){if(_a(t))return t;const n=t[da];if(!n)return va(t,((r,i)=>Fa(e,n,t,r,i,o))),t;if(n.scope_!==e)return t;if(!n.modified_)return za(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let r=t,i=!1;3===n.type_&&(r=new Set(t),t.clear(),i=!0),va(r,((r,a)=>Fa(e,n,t,r,a,o,i))),za(e,t,!1),o&&e.patches_&&ja("Patches").generatePatches_(n,o,e.patches_,e.inversePatches_)}return n.copy_}function Fa(e,t,o,n,r,i,a){if(pa(r)){const a=Pa(e,r,i&&t&&3!==t.type_&&!ba(t.assigned_,n)?i.concat(n):void 0);if(wa(o,n,a),!pa(a))return;e.canAutoFreeze_=!1}else a&&o.add(r);if(ha(r)&&!_a(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Pa(e,r),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(o,n)||za(e,r)}}function za(e,t,o=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ca(t,o)}var Ha={get(e,t){if(t===da)return e;const o=Oa(e);if(!ba(o,t))return function(e,t,o){const n=Ka(t,o);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,o,t);const n=o[t];return e.finalized_||!ha(n)?n:n===Va(e.base_,t)?(Ya(e),e.copy_[t]=$a(n,e)):n},has:(e,t)=>t in Oa(e),ownKeys:e=>Reflect.ownKeys(Oa(e)),set(e,t,o){const n=Ka(Oa(e),t);if(n?.set)return n.set.call(e.draft_,o),!0;if(!e.modified_){const n=Va(Oa(e),t),a=n?.[da];if(a&&a.base_===o)return e.copy_[t]=o,e.assigned_[t]=!1,!0;if(((r=o)===(i=n)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==o||ba(e.base_,t)))return!0;Ya(e),Wa(e)}var r,i;return e.copy_[t]===o&&(void 0!==o||t in e.copy_)||Number.isNaN(o)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=o,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Va(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ya(e),Wa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const o=Oa(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:o[t]}:n},defineProperty(){ua(11)},getPrototypeOf:e=>fa(e.base_),setPrototypeOf(){ua(12)}},Ua={};function Va(e,t){const o=e[da];return(o?Oa(o):e)[t]}function Ka(e,t){if(!(t in e))return;let o=fa(e);for(;o;){const e=Object.getOwnPropertyDescriptor(o,t);if(e)return e;o=fa(o)}}function Wa(e){e.modified_||(e.modified_=!0,e.parent_&&Wa(e.parent_))}function Ya(e){e.copy_||(e.copy_=Ea(e.base_,e.scope_.immer_.useStrictShallowCopy_))}va(Ha,((e,t)=>{Ua[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ua.deleteProperty=function(e,t){return Ua.set.call(this,e,t,void 0)},Ua.set=function(e,t,o){return Ha.set.call(this,e[0],t,o,e[0])};function $a(e,t){const o=xa(e)?ja("MapSet").proxyMap_(e,t):ka(e)?ja("MapSet").proxySet_(e,t):function(e,t){const o=Array.isArray(e),n={type_:o?1:0,scope_:t?t.scope_:Ba(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=n,i=Ha;o&&(r=[n],i=Ua);const{revoke:a,proxy:l}=Proxy.revocable(r,i);return n.draft_=l,n.revoke_=a,l}(e,t);return(t?t.scope_:Ba()).drafts_.push(o),o}function Xa(e){if(!ha(e)||_a(e))return e;const t=e[da];let o;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,o=Ea(e,t.scope_.immer_.useStrictShallowCopy_)}else o=Ea(e,!0);return va(o,((e,t)=>{wa(o,e,Xa(t))})),t&&(t.finalized_=!1),o}var Za=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,o)=>{if("function"==typeof e&&"function"!=typeof t){const o=t;t=e;const n=this;return function(e=o,...r){return n.produce(e,(e=>t.call(this,e,...r)))}}let n;if("function"!=typeof t&&ua(6),void 0!==o&&"function"!=typeof o&&ua(7),ha(e)){const r=La(this),i=$a(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?Ta(r):Ma(r)}return Aa(r,o),Ia(n,r)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===ca&&(n=void 0),this.autoFreeze_&&Ca(n,!0),o){const t=[],r=[];ja("Patches").generateReplacementPatches_(e,n,t,r),o(t,r)}return n}ua(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...o)=>this.produceWithPatches(t,(t=>e(t,...o)));let o,n;return[this.produce(e,t,((e,t)=>{o=e,n=t})),o,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ha(e)||ua(8),pa(e)&&(e=function(e){pa(e)||ua(10);return Xa(e)}(e));const t=La(this),o=$a(e,void 0);return o[da].isManual_=!0,Ma(t),o}finishDraft(e,t){const o=e&&e[da];o&&o.isManual_||ua(9);const{scope_:n}=o;return Aa(n,t),Ia(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let o;for(o=t.length-1;o>=0;o--){const n=t[o];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}o>-1&&(t=t.slice(o+1));const n=ja("Patches").applyPatches_;return pa(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};Za.produce,Za.produceWithPatches.bind(Za),Za.setAutoFreeze.bind(Za),Za.setUseStrictShallowCopy.bind(Za),Za.applyPatches.bind(Za);var qa=Za.createDraft.bind(Za),Ga=Za.finishDraft.bind(Za);function Ja(e,t){const o=No(e);if(!o)return!1;const n=S.marks(o);return!!(null==n?void 0:n[t])}const Qa=(e,t)=>{const{insertText:o}=t;return t.insertText=n=>{var r;const{selection:i}=t;if(" "===n&&i&&R.isCollapsed(i)){const{anchor:a}=i,l=S.above(t,{match:e=>B.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,s=S.parent(t,c),[d]=s;if(B.isElement(d)&&!j.isText(d.children[0]))return o(n);const u=l?c:[],f={anchor:a,focus:S.start(t,u)},p=S.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return _.select(t,f),_.delete(t),void h.create({deleteText:!1})}o(n)},t};function el(e,t,o){e.children=qa(e.children);let n=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);o.id&&(r.id=o.id,n=!0),o.type&&(r.type=o.type,n=!0),o.meta&&(r.meta=o.meta,n=!0),o.value&&(r.value=o.value),e.children=Ga(e.children),n&&e.applyChanges(),e.emit("change",e.children)}const tl="Paragraph";function ol(e,t,o){e.children=qa(e.children);const n=N(e,{at:(null==o?void 0:o.at)||e.selection});if(!n)throw new Error("Block from not found at current selection");let r=t;n.type===r&&(r=tl);const i=No(e,{at:[n.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${n.meta.order}`);const a=ri(e.blocks[r].elements);S.withoutNormalizing(i,(()=>{_.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>B.isElement(e)&&!S.isInline(i,e)}),(null==o?void 0:o.deleteText)&&_.delete(i,{at:[0,0]});const t={id:n.id,type:r,meta:Object.assign(Object.assign({},n.meta),{order:n.meta.order}),value:i.children};e.blockEditorsMap[n.id]=i,e.children[n.id]=t,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(t.id,{slate:i})}))}function nl(e,t={}){const{at:o=e.selection,deleteAll:n=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=qa(e.children),r.forEach((t=>{const o=N(e,{at:[t]});o&&(delete e.children[o.id],delete e.blockEditorsMap[o.id])}));return Object.keys(e.children).forEach(((t,o)=>{e.children[t].meta.order=o})),e.children=Ga(e.children),e.applyChanges(),void e.emit("change",e.children)}if(n||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=Q({id:G()}),o=al(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=o,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:o,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!o)return;e.children=qa(e.children);const[a]=o,l=Object.keys(e.children),c=l.find((t=>e.children[t].meta.order===a));if(l.forEach((t=>{const o=e.children[t];o.meta.order>a&&(o.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),i){const o=e.selection?e.selection[0]-1:0,n=N(e,{at:[o]});n&&e.focusBlock(n.id,{focusAt:t.focusAt})}}function rl(e,t){const o={};return t.forEach((t=>{const n=t.type;o[n]={hotkey:t.hotkey,type:n,getValue:()=>function(e,t){const o=No(e);if(!o)return null;const n=S.marks(o);return null==n?void 0:n[t]}(e,n),isActive:()=>Ja(e,n),toggle:()=>function(e,t){const o=No(e),n=Ja(e,t);o&&(n?S.removeMark(o,t):S.addMark(o,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,n),update:t=>function(e,t,o){const n=No(e);n&&n.selection&&R.isExpanded(n.selection)&&(S.addMark(n,t,o),e.applyChanges(),e.emit("change",e.children))}(e,n,t)}})),o}function il(e,t){const o={};return t.forEach(((t,n)=>{var r;const i=ii(t.elements),a=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.nodeType;if(!("inline"===a||"inlineVoid"===a)){const n={};Object.keys(t.elements).forEach((e=>{const o=vi(t.elements[e],["render"]);n[e]=o}));const{display:r,placeholder:i,align:a,shortcuts:l}=t.options||{};o[t.type]={type:t.type,elements:n,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,align:a,shortcuts:l},isActive:()=>{const o=N(e,{at:e.selection});return(null==o?void 0:o.type)===t.type},toggle:o=>{ol(e,t.type,o)},create:o=>{!function(e,t,o){var n;e.children=qa(e.children);const r=N(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==o?void 0:o.slate)||No(e,{at:[null==r?void 0:r.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],l=ri(a.elements),c=a.elements[l];if(!c)return;const s=Object.assign({nodeType:(null===(n=c.props)||void 0===n?void 0:n.nodeType)||"block"},c.props),d=J({id:G(),type:l,props:s});_.setNodes(i,d,{at:[0,0],match:e=>B.isElement(e),mode:"highest"}),(null==o?void 0:o.deleteText)&&_.delete(i,{at:[0,0]});const u=Q({id:r.id,type:a.type,meta:{order:r.meta.order,depth:r.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,o)},update:(t,o)=>{el(e,t,o)},updateElement:(t,o,n)=>{!function(e,t,o,n){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=No(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:[0],match:e=>B.isElement(e)&&e.type===o}),r=null==t?void 0:t[0],a=(null==r?void 0:r.props)||{},l={props:Object.assign(Object.assign({},a),n)};_.setNodes(i,l,{at:[0],match:e=>B.isElement(e)&&e.type===o,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,o,n)},delete:t=>{nl(e,t)}}}})),o}function al(e){return Qa(e,ia(C(T())))}function ll({type:e,hotkey:t,render:o}){return{type:e,hotkey:t,render:o}}const cl=ll({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),sl=(()=>{const e=G();return{[e]:Q({id:e})}})(),dl=new Z,ul=(e,t)=>dl.on(e,t),fl=(e,t)=>dl.once(e,t),pl=(e,t)=>dl.off(e,t),hl=(e,t)=>dl.emit(e,t);const yl=({editor:o,value:n,marks:r,plugins:i,autoFocus:a,className:l,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:y})=>{const g=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=d((()=>r?[cl,...r]:[cl]),[r]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>{o.applyChanges=g,o.readOnly=h||!1,v&&(o.formats=rl(o,v)),o.blocks=il(o,m);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(n);return e||void 0===n||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(n)}`),o.children=e?n:sl,o.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((o=>{const n=al(e);t[o]=n})),t}(o),o.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var o,n,r,i;e.options&&Array.isArray(null===(o=e.options)||void 0===o?void 0:o.shortcuts)&&(null===(n=e.options)||void 0===n?void 0:n.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((o=>{t[o]=e})))})),t}(o),o.plugins=function(e){const t={},o={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var n;const r=e.elements[t],i=null===(n=r.props)||void 0===n?void 0:n.nodeType;"inline"!==i&&"inlineVoid"!==i||(o[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const n=Object.assign(Object.assign({},e.elements),o);t[e.type]=Object.assign(Object.assign({},e),{elements:n})}})),t}(m),o.on=ul,o.once=fl,o.off=pl,o.emit=hl,{editor:o,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(n)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(Qi,{children:e(F,Object.assign({editorState:b},{children:t(li,Object.assign({tools:c},{children:[e(Ji,{placeholder:p,marks:v,autoFocus:a,className:l,selectionBoxRoot:s,width:y}),u]}))}))})},gl=Object.assign(Object.assign({},hi),{ExtendedBlockActions:({id:n,className:r,style:i,onClick:a,children:l})=>{const c=K(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Pr({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Un(),Hn(),zn(),On(10)],whileElementsMounted:Fn}),{isMounted:y,styles:g}=Ur(h,{duration:100}),v=Object.assign(Object.assign({},g),p);return c?null:t(o,{children:[y&&e(pi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:v},{children:l})),e("button",Object.assign({type:"button",ref:u.setReference,id:n,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${r||""} yoopta-extended-block-actions`,onClick:()=>{null==a||a(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qr,{})}))]})}});function vl(e,t){const o=Object.keys(e.children),{type:n}=t||{},r=o.find((t=>e.children[t].type===n));return r?e.children[r]:null}function ml(e,t,o={}){try{const{focusAt:n,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=o,l=()=>{const r=o.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(M.isPoint(t))return t;if(D.isPath(t))return{path:t,offset:0};const[,o]=S.first(e,[0]);return{path:o||[0,0],offset:0}}(r,n);_.select(r,e),w.focus(r)}a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>l()),i):l()}catch(e){}}function bl(e){return Array.from(new Set(e))}var wl={};!function(e,t){var o="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",l="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",y="[object String]",g="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",S="[object Uint8ClampedArray]",_="[object Uint16Array]",D="[object Uint32Array]",R=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[a]=A[w]=A[x]=A[k]=A[O]=A[E]=A[s]=A[d]=A[u]=A[p]=A[h]=A[y]=A[g]=A[C]=A[S]=A[_]=A[D]=!0,A["[object Error]"]=A[l]=A[v]=!1;var T="object"==typeof $&&$&&$.Object===Object&&$,M="object"==typeof self&&self&&self.Object===Object&&self,L=T||M||Function("return this")(),N=t&&!t.nodeType&&t,I=N&&e&&!e.nodeType&&e,P=I&&I.exports===N;function F(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function H(e,t,o,n){var r=-1,i=e?e.length:0;for(n&&i&&(o=e[++r]);++r<i;)o=t(o,e[r],r,e);return o}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,o=Array(e.size);return e.forEach((function(e,n){o[++t]=[n,e]})),o}function K(e,t){return function(o){return e(t(o))}}function W(e){var t=-1,o=Array(e.size);return e.forEach((function(e){o[++t]=e})),o}var Y,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=L["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,oe=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=P?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=K(Object.getPrototypeOf,Object),le=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,fe=K(Object.keys,Object),pe=Pe(L,"DataView"),he=Pe(L,"Map"),ye=Pe(L,"Promise"),ge=Pe(L,"Set"),ve=Pe(L,"WeakMap"),me=Pe(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ye),ke=Ve(ge),Oe=Ve(ve),Ee=re?re.prototype:void 0,Ce=Ee?Ee.valueOf:void 0;function Se(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function _e(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function De(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function Re(e){this.__data__=new _e(e)}function je(e,t){var o=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}(e.length,String):[],n=o.length,i=!!n;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||He(a,n))||o.push(a);return o}function Be(e,t,o){var n=e[t];ee.call(e,t)&&Ke(n,o)&&(void 0!==o||t in e)||(e[t]=o)}function Ae(e,t){for(var o=e.length;o--;)if(Ke(e[o][0],t))return o;return-1}function Te(e,t,o,n,f,v,j){var B;if(n&&(B=v?n(e,f,v,j):n(e)),void 0!==B)return B;if(!Ze(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,o=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(o.index=e.index,o.input=e.input);return o}(e),!t)return function(e,t){var o=-1,n=e.length;t||(t=Array(n));for(;++o<n;)t[o]=e[o];return t}(e,B)}else{var M=ze(e),L=M==l||M==c;if($e(e))return function(e,t){if(t)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}(e,t);if(M==u||M==r||L&&!v){if(U(e))return v?e:{};if(B=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=ae(e),Ze(t)?le(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,Fe(e),t)}(e,function(e,t){return e&&Ne(t,qe(t),e)}(B,e))}else{if(!A[M])return v?e:{};B=function(e,t,o,n){var r=e.constructor;switch(t){case m:return Le(e);case i:case a:return new r(+e);case b:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}(e,n);case w:case x:case k:case O:case E:case C:case S:case _:case D:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}(e,n);case s:return function(e,t,o){var n=t?o(V(e),!0):V(e);return H(n,F,new e.constructor)}(e,n,o);case d:case y:return new r(e);case p:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,o){var n=t?o(W(e),!0):W(e);return H(n,z,new e.constructor)}(e,n,o);case g:return l=e,Ce?Object(Ce.call(l)):{}}var l}(e,M,Te,t)}}j||(j=new Re);var N=j.get(e);if(N)return N;if(j.set(e,B),!T)var I=o?function(e){return function(e,t,o){var n=t(e);return We(e)?n:function(e,t){for(var o=-1,n=t.length,r=e.length;++o<n;)e[r+o]=t[o];return e}(n,o(e))}(e,qe,Fe)}(e):qe(e);return function(e,t){for(var o=-1,n=e?e.length:0;++o<n&&!1!==t(e[o],o,e););}(I||e,(function(r,i){I&&(r=e[i=r]),Be(B,i,Te(r,t,o,n,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?oe:j).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,o,n){o||(o={});for(var r=-1,i=t.length;++r<i;){var a=t[r],l=n?n(o[a],e[a],a,o,e):void 0;Be(o,a,void 0===l?e[a]:l)}return o}function Ie(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function Pe(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(o)?o:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===o?void 0:n}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?o:t,this},_e.prototype.clear=function(){this.__data__=[]},_e.prototype.delete=function(e){var t=this.__data__,o=Ae(t,e);return!(o<0)&&(o==t.length-1?t.pop():se.call(t,o,1),!0)},_e.prototype.get=function(e){var t=this.__data__,o=Ae(t,e);return o<0?void 0:t[o][1]},_e.prototype.has=function(e){return Ae(this.__data__,e)>-1},_e.prototype.set=function(e,t){var o=this.__data__,n=Ae(o,e);return n<0?o.push([e,t]):o[n][1]=t,this},De.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||_e),string:new Se}},De.prototype.delete=function(e){return Ie(this,e).delete(e)},De.prototype.get=function(e){return Ie(this,e).get(e)},De.prototype.has=function(e){return Ie(this,e).has(e)},De.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Re.prototype.clear=function(){this.__data__=new _e},Re.prototype.delete=function(e){return this.__data__.delete(e)},Re.prototype.get=function(e){return this.__data__.get(e)},Re.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.set=function(e,t){var o=this.__data__;if(o instanceof _e){var n=o.__data__;if(!he||n.length<199)return n.push([e,t]),this;o=this.__data__=new De(n)}return o.set(e,t),this};var Fe=de?K(de,Object):function(){return[]},ze=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=s||ye&&ze(ye.resolve())!=f||ge&&ze(new ge)!=h||ve&&ze(new ve)!=v)&&(ze=function(e){var t=te.call(e),o=t==u?e.constructor:void 0,n=o?Ve(o):void 0;if(n)switch(n){case be:return b;case we:return s;case xe:return f;case ke:return h;case Oe:return v}return t});var We=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=Ze(e)?te.call(e):"";return t==l||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!Ue(e))return fe(e);var t=[];for(var o in Object(e))ee.call(e,o)&&"constructor"!=o&&t.push(o);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return wl},set exports(e){wl=e}},wl);var xl=wl;function kl(e,t={}){const{blockId:o,focus:n}=t;if(!o&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(o&&(r=e.children[o],!r))throw new Error(`Block not with blockId: ${o} found`);if(t.at&&(r=N(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=qa(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):xl(a));var a;const l=al(e);i.id=G(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=l;const c=i.id;e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(c,{waitExecution:!0})}function Ol(e,t){w.blur(t),w.deselect(t),_.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const El=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,o={}){e.children=qa(e.children);const{at:n=null,focus:r=!1,slate:i=null}=o,a=N(e),l=n,c={id:G(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=al(e);e.blockEditorsMap[c.id]=d,s&&a&&(c.meta.order=a.meta.order,a.meta.order+=1),e.children[c.id]=c;const u=null==a?void 0:a.id;e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,o={}){e.children=qa(e.children);const{at:n,focus:r}=o;let i=n||[0];const a=N(e),l=No(e);let c=!1,s=!1;if(l&&l.selection){const t=D.parent(l.selection.anchor.path),o=S.string(l,t).trim(),n=S.isStart(l,l.selection.anchor,t);c=""===o&&n,s=!n||o.length>0,w.blur(l),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,o)=>{const n={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+o})};d.push(n.meta.order),e.children[n.id]=n;const r=al(e);e.blockEditorsMap[n.id]=r})),a&&c){const t=a.meta.order;delete e.children[a.id],delete e.blockEditorsMap[a.id],Object.keys(e.children).forEach((o=>{const n=e.children[o];n.meta.order>t&&(n.meta.order-=1)}))}e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>nl(e,...t),duplicateBlock:(...t)=>kl(e,...t),toggleBlock:(...t)=>ol(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=qa(e.children);const n=N(e);n&&(n.meta.depth=n.meta.depth+1,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=qa(e.children);const n=N(e);n&&(n.meta.depth=0===n.meta.depth?0:n.meta.depth-1,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,o){e.children=qa(e.children);const[n]=o,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===n)),a=r.meta.order<i.meta.order,l=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:l&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=n,r.meta.depth=i.meta.depth,e.setSelection([n]),e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>ml(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>el(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:o,focus:n=!0}=t,r=N(e);o&&o.selection&&r&&S.withoutNormalizing(o,(()=>{e.children=qa(e.children);const t=D.parent(o.selection.anchor.path);_.splitNodes(o,{at:o.selection,match:e=>B.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=o.children.slice()[i];_.removeNodes(o,{at:[i],match:e=>B.isElement(e),mode:"highest"});const l={id:G(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=al(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,o={}){const{applyChanges:n=!0}=o;e.selection=t,n&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,o={}){const{only:n=!1,allSelected:r=!1}=o,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(n)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=bl(t)}else e.selectedBlocks=bl(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var o;const n=null!==(o=t.slate)&&void 0!==o?o:No(e);if(!n)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>Ol(e,n)),i):(Ol(e,n),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('#yoopta-editor .yoo-editor-pointer-events-none{pointer-events:none}#yoopta-editor .yoo-editor-absolute{position:absolute}#yoopta-editor .yoo-editor-relative{position:relative}#yoopta-editor .-yoo-editor-left-\\[50px\\]{left:-50px}#yoopta-editor .yoo-editor-left-0{left:0}#yoopta-editor .yoo-editor-right-\\[8px\\]{right:8px}#yoopta-editor .yoo-editor-top-0{top:0}#yoopta-editor .yoo-editor-top-\\[2px\\]{top:2px}#yoopta-editor .yoo-editor-top-\\[8px\\]{top:8px}#yoopta-editor .yoo-editor-z-10{z-index:10}#yoopta-editor .yoo-editor-z-\\[100\\]{z-index:100}#yoopta-editor .yoo-editor-z-\\[90\\]{z-index:90}#yoopta-editor .yoo-editor-m-\\[0_1px\\]{margin:0 1px}#yoopta-editor .yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}#yoopta-editor .yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}#yoopta-editor .yoo-editor-mb-\\[1px\\]{margin-bottom:1px}#yoopta-editor .yoo-editor-mr-2{margin-right:.5rem}#yoopta-editor .yoo-editor-mt-\\[2px\\]{margin-top:2px}#yoopta-editor .yoo-editor-flex{display:flex}#yoopta-editor .yoo-editor-h-4{height:1rem}#yoopta-editor .yoo-editor-h-\\[1px\\]{height:1px}#yoopta-editor .yoo-editor-h-\\[22px\\]{height:22px}#yoopta-editor .yoo-editor-h-\\[24px\\]{height:24px}#yoopta-editor .yoo-editor-h-full{height:100%}#yoopta-editor .yoo-editor-w-4{width:1rem}#yoopta-editor .yoo-editor-w-\\[18px\\]{width:18px}#yoopta-editor .yoo-editor-w-\\[22px\\]{width:22px}#yoopta-editor .yoo-editor-w-\\[24px\\]{width:24px}#yoopta-editor .yoo-editor-w-auto{width:auto}#yoopta-editor .yoo-editor-w-full{width:100%}#yoopta-editor .yoo-editor-min-w-\\[200px\\]{min-width:200px}#yoopta-editor .yoo-editor-cursor-default{cursor:default}#yoopta-editor .yoo-editor-cursor-pointer{cursor:pointer}#yoopta-editor .yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .yoo-editor-flex-col{flex-direction:column}#yoopta-editor .yoo-editor-items-center{align-items:center}#yoopta-editor .yoo-editor-justify-start{justify-content:flex-start}#yoopta-editor .yoo-editor-justify-center{justify-content:center}#yoopta-editor .yoo-editor-justify-between{justify-content:space-between}#yoopta-editor .yoo-editor-overflow-hidden{overflow:hidden}#yoopta-editor .yoo-editor-rounded{border-radius:.25rem}#yoopta-editor .yoo-editor-rounded-\\[2px\\]{border-radius:2px}#yoopta-editor .yoo-editor-rounded-\\[6px\\]{border-radius:6px}#yoopta-editor .yoo-editor-rounded-md{border-radius:.375rem}#yoopta-editor .yoo-editor-rounded-sm{border-radius:.125rem}#yoopta-editor .yoo-editor-border{border-width:1px}#yoopta-editor .yoo-editor-border-solid{border-style:solid}#yoopta-editor .yoo-editor-border-none{border-style:none}#yoopta-editor .yoo-editor-border-\\[\\#e5e7eb\\]{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}#yoopta-editor .yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}#yoopta-editor .yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-inherit{background-color:inherit}#yoopta-editor .yoo-editor-bg-transparent{background-color:transparent}#yoopta-editor .yoo-editor-p-0{padding:0}#yoopta-editor .yoo-editor-p-\\[0_4px\\]{padding:0 4px}#yoopta-editor .yoo-editor-px-0{padding-left:0;padding-right:0}#yoopta-editor .yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}#yoopta-editor .yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}#yoopta-editor .yoo-editor-py-0{padding-bottom:0;padding-top:0}#yoopta-editor .yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}#yoopta-editor .yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#yoopta-editor .yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}#yoopta-editor .yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}#yoopta-editor .yoo-editor-leading-\\[120\\%\\]{line-height:120%}#yoopta-editor .yoo-editor-text-\\[rgba\\(55\\,53\\,47\\,0\\.35\\)\\]{color:rgba(55,53,47,.35)}#yoopta-editor .yoo-editor-opacity-0{opacity:0}#yoopta-editor .yoo-editor-opacity-100{opacity:1}#yoopta-editor .yoo-editor-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#yoopta-editor .yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-duration-150{transition-duration:.15s}#yoopta-editor .yoo-editor-duration-\\[180ms\\]{transition-duration:.18s}#yoopta-editor .yoo-editor-ease-\\[cubic-bezier\\(0\\.4\\,0\\,0\\.2\\,1\\)\\]{transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}#yoopta-editor *,#yoopta-editor :after,#yoopta-editor :before{box-sizing:border-box}#yoopta-editor button{background-color:transparent;border:none;cursor:pointer}#yoopta-editor blockquote,#yoopta-editor dd,#yoopta-editor dl,#yoopta-editor figure,#yoopta-editor h1,#yoopta-editor h2,#yoopta-editor h3,#yoopta-editor h4,#yoopta-editor h5,#yoopta-editor h6,#yoopta-editor hr,#yoopta-editor p,#yoopta-editor pre{margin:0}#yoopta-editor ::-moz-selection{background:#c6ddf8}#yoopta-editor ::selection{background:#c6ddf8}#yoopta-editor #yoopta-editor{height:auto;min-width:400px}#yoopta-editor .yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}#yoopta-editor .focus\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:focus,#yoopta-editor .hover\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:hover{background-color:rgba(55,54,47,.08)}#yoopta-editor .focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .active\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:active{background-color:rgba(55,54,47,.08)}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}#yoopta-editor .data-\\[hovered-state-open\\=\\"true\\"\\]\\:yoo-editor-opacity-100[data-hovered-state-open=true]{opacity:1}');export{Mi as HOTKEYS,gl as UI,L as YooptaPlugin,Q as buildBlockData,J as buildBlockElement,El as createYooptaEditor,ll as createYooptaMark,yl as default,N as findPluginBlockBySelectionPath,vl as findPluginBlockByType,No as findSlateBySelectionPath,G as generateId,ii as getRootBlockElement,ri as getRootBlockElementType,H as useBlockData,Y as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,V as useYooptaPlugin,W as useYooptaPluginOptions,K as useYooptaReadOnly,ci as useYooptaTools};
|