@yoopta/file 4.0.0-rc.1 → 4.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import{useYooptaPluginOptions as e,useYooptaEditor as t,UI as o,useBlockData as n,useYooptaReadOnly as i,useBlockSelected as r,YooptaPlugin as l}from"@yoopta/editor";import{jsx as a,jsxs as f}from"react/jsx-runtime";import*as s from"react";import{forwardRef as c,createElement as u,useLayoutEffect as d,useEffect as p,useState as y}from"react";import*as m from"react-dom";import{createPortal as g}from"react-dom";function h(e,t){if(null==e)return{};var o,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||(i[o]=e[o]);return i}var x=["color"],b=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,x);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),u("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),v=["color"],w=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,v);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),u("path",{d:"M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),C=["color"],R=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,C);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),u("path",{d:"M3 2.5C3 2.22386 3.22386 2 3.5 2H9.08579C9.21839 2 9.34557 2.05268 9.43934 2.14645L11.8536 4.56066C11.9473 4.65443 12 4.78161 12 4.91421V12.5C12 12.7761 11.7761 13 11.5 13H3.5C3.22386 13 3 12.7761 3 12.5V2.5ZM3.5 1C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V4.91421C13 4.51639 12.842 4.13486 12.5607 3.85355L10.1464 1.43934C9.86514 1.15804 9.48361 1 9.08579 1H3.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5C4 4.77614 4.22386 5 4.5 5H7.5C7.77614 5 8 4.77614 8 4.5C8 4.22386 7.77614 4 7.5 4H4.5ZM4.5 7C4.22386 7 4 7.22386 4 7.5C4 7.77614 4.22386 8 4.5 8H10.5C10.7761 8 11 7.77614 11 7.5C11 7.22386 10.7761 7 10.5 7H4.5ZM4.5 10C4.22386 10 4 10.2239 4 10.5C4 10.7761 4.22386 11 4.5 11H10.5C10.7761 11 11 10.7761 11 10.5C11 10.2239 10.7761 10 10.5 10H4.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));function E(e){if("number"!=typeof e||isNaN(e))return null;return(e/1024).toFixed(2)+" KB"}const S=({name:e,src:t,size:o,format:n})=>{if(!t)return null;return a("div",Object.assign({className:"yoo-file-w-full yoo-file-cursor-pointer",contentEditable:!1,onClick:e=>{t&&(e.preventDefault(),e.stopPropagation(),window.open(t,"_blank"))}},{children:f("div",Object.assign({className:"yoo-file-flex yoo-file-items-center yoo-file-rounded-[4px] yoo-file-py-[8px] yoo-file-px-2 hover:yoo-file-bg-[rgba(55,53,47,0.04)] yoo-file-border-b-[1px] hover:yoo-file-border-[rgba(55,53,47,0.16)] yoo-file-border-[transparent]"},{children:[f("div",Object.assign({className:"yoo-file-flex yoo-file-items-center yoo-file-leading-[1.2] yoo-file-font-medium yoo-file-text-[#000000]"},{children:[a(R,{width:16,height:16}),a("span",Object.assign({className:"yoo-file-ml-[6px] yoo-file-text-[14px]"},{children:n?`${e}.${n}`:`${e}`}))]})),a("div",Object.assign({className:"yoo-file-ml-[8px] yoo-file-text-[10px] yoo-file-font-normal yoo-file-text-[#37352fa6]"},{children:E(o)}))]}))}))};function k(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function O(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return e instanceof Node||e instanceof _(e).Node}function L(e){return e instanceof Element||e instanceof _(e).Element}function T(e){return e instanceof HTMLElement||e instanceof _(e).HTMLElement}function j(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof _(e).ShadowRoot)}function A(e){const{overflow:t,overflowX:o,overflowY:n,display:i}=F(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(i)}function M(e){return["table","td","th"].includes(k(e))}function I(e){const t=P(),o=F(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 P(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function D(e){return["html","body","#document"].includes(k(e))}function F(e){return _(e).getComputedStyle(e)}function H(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(e){if("html"===k(e))return e;const t=e.assignedSlot||e.parentNode||j(e)&&e.host||O(e);return j(t)?t.host:t}function B(e){const t=V(e);return D(t)?e.ownerDocument?e.ownerDocument.body:e.body:T(t)&&A(t)?t:B(t)}function z(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const i=B(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),l=_(i);return r?t.concat(l,l.visualViewport||[],A(i)?i:[],l.frameElement&&o?z(l.frameElement):[]):t.concat(i,z(i,[],o))}const U=Math.min,W=Math.max,Z=Math.round,$=e=>({x:e,y:e}),q={left:"right",right:"left",bottom:"top",top:"bottom"},X={start:"end",end:"start"};function Y(e,t,o){return W(e,U(t,o))}function G(e,t){return"function"==typeof e?e(t):e}function K(e){return e.split("-")[0]}function J(e){return e.split("-")[1]}function Q(e){return"x"===e?"y":"x"}function ee(e){return"y"===e?"height":"width"}function te(e){return["top","bottom"].includes(K(e))?"y":"x"}function oe(e){return Q(te(e))}function ne(e){return e.replace(/start|end/g,(e=>X[e]))}function ie(e){return e.replace(/left|right|bottom|top/g,(e=>q[e]))}function re(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 le(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ae(e,t,o){let{reference:n,floating:i}=e;const r=te(t),l=oe(t),a=ee(l),f=K(t),s="y"===r,c=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let p;switch(f){case"top":p={x:c,y:n.y-i.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-i.width,y:u};break;default:p={x:n.x,y:n.y}}switch(J(t)){case"start":p[l]-=d*(o&&s?-1:1);break;case"end":p[l]+=d*(o&&s?-1:1)}return p}async function fe(e,t){var o;void 0===t&&(t={});const{x:n,y:i,platform:r,rects:l,elements:a,strategy:f}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=G(t,e),y=re(p),m=a[d?"floating"===u?"reference":"floating":u],g=le(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(m)))||o?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:s,rootBoundary:c,strategy:f})),h="floating"===u?{...l.floating,x:n,y:i}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},v=le(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:h,offsetParent:x,strategy:f}):h);return{top:(g.top-v.top+y.top)/b.y,bottom:(v.bottom-g.bottom+y.bottom)/b.y,left:(g.left-v.left+y.left)/b.x,right:(v.right-g.right+y.right)/b.x}}function se(e){const t=U(...e.map((e=>e.left))),o=U(...e.map((e=>e.top)));return{x:t,y:o,width:W(...e.map((e=>e.right)))-t,height:W(...e.map((e=>e.bottom)))-o}}const ce=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:i,y:r,placement:l,middlewareData:a}=t,f=await async function(e,t){const{placement:o,platform:n,elements:i}=e,r=await(null==n.isRTL?void 0:n.isRTL(i.floating)),l=K(o),a=J(o),f="y"===te(o),s=["left","top"].includes(l)?-1:1,c=r&&f?-1:1,u=G(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:y}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof y&&(p="end"===a?-1*y:y),f?{x:p*c,y:d*s}:{x:d*s,y:p*c}}(t,e);return l===(null==(o=a.offset)?void 0:o.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}};function ue(e){const t=F(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=T(e),r=i?e.offsetWidth:o,l=i?e.offsetHeight:n,a=Z(o)!==r||Z(n)!==l;return a&&(o=r,n=l),{width:o,height:n,$:a}}function de(e){return L(e)?e:e.contextElement}function pe(e){const t=de(e);if(!T(t))return $(1);const o=t.getBoundingClientRect(),{width:n,height:i,$:r}=ue(t);let l=(r?Z(o.width):o.width)/n,a=(r?Z(o.height):o.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const ye=$(0);function me(e){const t=_(e);return P()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ye}function ge(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const i=e.getBoundingClientRect(),r=de(e);let l=$(1);t&&(n?L(n)&&(l=pe(n)):l=pe(e));const a=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==_(e))&&t}(r,o,n)?me(r):$(0);let f=(i.left+a.x)/l.x,s=(i.top+a.y)/l.y,c=i.width/l.x,u=i.height/l.y;if(r){const e=_(r),t=n&&L(n)?_(n):n;let o=e,i=o.frameElement;for(;i&&n&&t!==o;){const e=pe(i),t=i.getBoundingClientRect(),n=F(i),r=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;f*=e.x,s*=e.y,c*=e.x,u*=e.y,f+=r,s+=l,o=_(i),i=o.frameElement}}return le({width:c,height:u,x:f,y:s})}const he=[":popover-open",":modal"];function xe(e){return he.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function be(e){return ge(O(e)).left+H(e).scrollLeft}function ve(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=_(e),n=O(e),i=o.visualViewport;let r=n.clientWidth,l=n.clientHeight,a=0,f=0;if(i){r=i.width,l=i.height;const e=P();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,f=i.offsetTop)}return{width:r,height:l,x:a,y:f}}(e,o);else if("document"===t)n=function(e){const t=O(e),o=H(e),n=e.ownerDocument.body,i=W(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=W(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-o.scrollLeft+be(e);const a=-o.scrollTop;return"rtl"===F(n).direction&&(l+=W(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:l,y:a}}(O(e));else if(L(t))n=function(e,t){const o=ge(e,!0,"fixed"===t),n=o.top+e.clientTop,i=o.left+e.clientLeft,r=T(e)?pe(e):$(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:i*r.x,y:n*r.y}}(t,o);else{const o=me(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return le(n)}function we(e,t){const o=V(e);return!(o===t||!L(o)||D(o))&&("fixed"===F(o).position||we(o,t))}function Ce(e,t,o){const n=T(t),i=O(t),r="fixed"===o,l=ge(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const f=$(0);if(n||!n&&!r)if(("body"!==k(t)||A(i))&&(a=H(t)),n){const e=ge(t,!0,r,t);f.x=e.x+t.clientLeft,f.y=e.y+t.clientTop}else i&&(f.x=be(i));return{x:l.left+a.scrollLeft-f.x,y:l.top+a.scrollTop-f.y,width:l.width,height:l.height}}function Re(e,t){return T(e)&&"fixed"!==F(e).position?t?t(e):e.offsetParent:null}function Ee(e,t){const o=_(e);if(!T(e)||xe(e))return o;let n=Re(e,t);for(;n&&M(n)&&"static"===F(n).position;)n=Re(n,t);return n&&("html"===k(n)||"body"===k(n)&&"static"===F(n).position&&!I(n))?o:n||function(e){let t=V(e);for(;T(t)&&!D(t);){if(I(t))return t;t=V(t)}return null}(e)||o}const Se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:i}=e;const r="fixed"===i,l=O(n),a=!!t&&xe(t.floating);if(n===l||a&&r)return o;let f={scrollLeft:0,scrollTop:0},s=$(1);const c=$(0),u=T(n);if((u||!u&&!r)&&(("body"!==k(n)||A(l))&&(f=H(n)),T(n))){const e=ge(n);s=pe(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-f.scrollLeft*s.x+c.x,y:o.y*s.y-f.scrollTop*s.y+c.y}},getDocumentElement:O,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:i}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=z(e,[],!1).filter((e=>L(e)&&"body"!==k(e))),i=null;const r="fixed"===F(e).position;let l=r?V(e):e;for(;L(l)&&!D(l);){const t=F(l),o=I(l);o||"fixed"!==t.position||(i=null),(r?!o&&!i:!o&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||A(l)&&!o&&we(e,l))?n=n.filter((e=>e!==l)):i=t,l=V(l)}return t.set(e,n),n}(t,this._c):[].concat(o),n],l=r[0],a=r.reduce(((e,o)=>{const n=ve(t,o,i);return e.top=W(n.top,e.top),e.right=U(n.right,e.right),e.bottom=U(n.bottom,e.bottom),e.left=W(n.left,e.left),e}),ve(t,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ee,getElementRects:async function(e){const t=this.getOffsetParent||Ee,o=this.getDimensions;return{reference:Ce(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}=ue(e);return{width:t,height:o}},getScale:pe,isElement:L,isRTL:function(e){return"rtl"===F(e).direction}},ke=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...f}=G(e,t),s={x:o,y:n},c=await fe(t,f),u=te(K(i)),d=Q(u);let p=s[d],y=s[u];if(r){const e="y"===d?"bottom":"right";p=Y(p+c["y"===d?"top":"left"],p,p-c[e])}if(l){const e="y"===u?"bottom":"right";y=Y(y+c["y"===u?"top":"left"],y,y-c[e])}const m=a.fn({...t,[d]:p,[u]:y});return{...m,data:{x:m.x-o,y:m.y-n}}}}},_e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:i,middlewareData:r,rects:l,initialPlacement:a,platform:f,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...g}=G(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const h=K(i),x=K(a)===a,b=await(null==f.isRTL?void 0:f.isRTL(s.floating)),v=d||(x||!m?[ie(a)]:function(e){const t=ie(e);return[ne(e),t,ne(t)]}(a));d||"none"===y||v.push(...function(e,t,o,n){const i=J(e);let r=function(e,t,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return o?t?i:n:t?n:i;case"left":case"right":return t?r:l;default:return[]}}(K(e),"start"===o,n);return i&&(r=r.map((e=>e+"-"+i)),t&&(r=r.concat(r.map(ne)))),r}(a,m,y,b));const w=[a,...v],C=await fe(t,g),R=[];let E=(null==(n=r.flip)?void 0:n.overflows)||[];if(c&&R.push(C[h]),u){const e=function(e,t,o){void 0===o&&(o=!1);const n=J(e),i=oe(e),r=ee(i);let l="x"===i?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=ie(l)),[l,ie(l)]}(i,l,b);R.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:i,overflows:R}],!R.every((e=>e<=0))){var S,k;const e=((null==(S=r.flip)?void 0:S.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let o=null==(k=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.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=a}if(i!==o)return{reset:{placement:o}}}return{}}}},Oe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:i,platform:r,strategy:l}=t,{padding:a=2,x:f,y:s}=G(e,t),c=Array.from(await(null==r.getClientRects?void 0:r.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 i=t[e];!n||i.y-n.y>n.height/2?o.push([i]):o[o.length-1].push(i),n=i}return o.map((e=>le(se(e))))}(c),d=le(se(c)),p=re(a);const y=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=f&&null!=s)return u.find((e=>f>e.left-p.left&&f<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||d;if(u.length>=2){if("y"===te(o)){const e=u[0],t=u[u.length-1],n="top"===K(o),i=e.top,r=t.bottom,l=n?e.left:t.left,a=n?e.right:t.right;return{top:i,bottom:r,left:l,right:a,width:a-l,height:r-i,x:l,y:i}}const e="left"===K(o),t=W(...u.map((e=>e.right))),n=U(...u.map((e=>e.left))),i=u.filter((o=>e?o.left===n:o.right===t)),r=i[0].top,l=i[i.length-1].bottom;return{top:r,bottom:l,left:n,right:t,width:t-n,height:l-r,x:n,y:r}}return d}},floating:n.floating,strategy:l});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},Ne=(e,t,o)=>{const n=new Map,i={platform:Se,...o},r={...i.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:l}=o,a=r.filter(Boolean),f=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:u}=ae(s,n,f),d=n,p={},y=0;for(let o=0;o<a.length;o++){const{name:r,fn:m}=a[o],{x:g,y:h,data:x,reset:b}=await m({x:c,y:u,initialPlacement:n,placement:d,strategy:i,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});c=null!=g?g:c,u=null!=h?h:u,p={...p,[r]:{...p[r],...x}},b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:c,y:u}=ae(s,d,f))),o=-1)}return{x:c,y:u,placement:d,strategy:i,middlewareData:p}})(e,t,{...i,platform:r})};var Le="undefined"!=typeof document?d:p;function Te(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,i;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(!Te(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),o=i.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=o;0!=n--;){const o=i[n];if(("_owner"!==o||!e.$$typeof)&&!Te(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function je(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ae(e,t){const o=je(e);return Math.round(t*o)/o}function Me(e){const t=s.useRef(e);return Le((()=>{t.current=e})),t}
1
+ import{useYooptaPluginOptions as e,useYooptaEditor as t,UI as o,useBlockData as n,useYooptaReadOnly as i,useBlockSelected as r,YooptaPlugin as l}from"@yoopta/editor";import{jsx as a,jsxs as f}from"react/jsx-runtime";import*as s from"react";import{forwardRef as c,createElement as d,useLayoutEffect as u,useEffect as p,useState as y}from"react";import*as m from"react-dom";import{createPortal as g}from"react-dom";function h(e,t){if(null==e)return{};var o,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||(i[o]=e[o]);return i}var x=["color"],b=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,x);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),d("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),v=["color"],w=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,v);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),d("path",{d:"M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),C=["color"],R=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,C);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),d("path",{d:"M3 2.5C3 2.22386 3.22386 2 3.5 2H9.08579C9.21839 2 9.34557 2.05268 9.43934 2.14645L11.8536 4.56066C11.9473 4.65443 12 4.78161 12 4.91421V12.5C12 12.7761 11.7761 13 11.5 13H3.5C3.22386 13 3 12.7761 3 12.5V2.5ZM3.5 1C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V4.91421C13 4.51639 12.842 4.13486 12.5607 3.85355L10.1464 1.43934C9.86514 1.15804 9.48361 1 9.08579 1H3.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5C4 4.77614 4.22386 5 4.5 5H7.5C7.77614 5 8 4.77614 8 4.5C8 4.22386 7.77614 4 7.5 4H4.5ZM4.5 7C4.22386 7 4 7.22386 4 7.5C4 7.77614 4.22386 8 4.5 8H10.5C10.7761 8 11 7.77614 11 7.5C11 7.22386 10.7761 7 10.5 7H4.5ZM4.5 10C4.22386 10 4 10.2239 4 10.5C4 10.7761 4.22386 11 4.5 11H10.5C10.7761 11 11 10.7761 11 10.5C11 10.2239 10.7761 10 10.5 10H4.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));function E(e){if("number"!=typeof e||isNaN(e))return null;return(e/1024).toFixed(2)+" KB"}const S=({name:e,src:t,size:o,format:n})=>{if(!t)return null;return a("div",Object.assign({className:"yoo-file-w-full yoo-file-cursor-pointer",contentEditable:!1,onClick:e=>{t&&(e.preventDefault(),e.stopPropagation(),window.open(t,"_blank"))}},{children:f("div",Object.assign({className:"yoo-file-flex yoo-file-items-center yoo-file-rounded-[4px] yoo-file-py-[8px] yoo-file-px-2 hover:yoo-file-bg-[rgba(55,53,47,0.04)] yoo-file-border-b-[1px] hover:yoo-file-border-[rgba(55,53,47,0.16)] yoo-file-border-[transparent]"},{children:[f("div",Object.assign({className:"yoo-file-flex yoo-file-items-center yoo-file-leading-[1.2] yoo-file-font-medium yoo-file-text-[#000000]"},{children:[a(R,{width:16,height:16}),a("span",Object.assign({className:"yoo-file-ml-[6px] yoo-file-text-[14px]"},{children:n?`${e}.${n}`:`${e}`}))]})),a("div",Object.assign({className:"yoo-file-ml-[8px] yoo-file-text-[10px] yoo-file-font-normal yoo-file-text-[#37352fa6]"},{children:E(o)}))]}))}))};function k(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function O(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return e instanceof Node||e instanceof _(e).Node}function L(e){return e instanceof Element||e instanceof _(e).Element}function T(e){return e instanceof HTMLElement||e instanceof _(e).HTMLElement}function j(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof _(e).ShadowRoot)}function A(e){const{overflow:t,overflowX:o,overflowY:n,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(i)}function M(e){return["table","td","th"].includes(k(e))}function I(e){const t=P(),o=H(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 P(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function D(e){return["html","body","#document"].includes(k(e))}function H(e){return _(e).getComputedStyle(e)}function F(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(e){if("html"===k(e))return e;const t=e.assignedSlot||e.parentNode||j(e)&&e.host||O(e);return j(t)?t.host:t}function B(e){const t=V(e);return D(t)?e.ownerDocument?e.ownerDocument.body:e.body:T(t)&&A(t)?t:B(t)}function z(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const i=B(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),l=_(i);return r?t.concat(l,l.visualViewport||[],A(i)?i:[],l.frameElement&&o?z(l.frameElement):[]):t.concat(i,z(i,[],o))}const W=Math.min,U=Math.max,Z=Math.round,$=e=>({x:e,y:e}),q={left:"right",right:"left",bottom:"top",top:"bottom"},X={start:"end",end:"start"};function Y(e,t,o){return U(e,W(t,o))}function G(e,t){return"function"==typeof e?e(t):e}function K(e){return e.split("-")[0]}function J(e){return e.split("-")[1]}function Q(e){return"x"===e?"y":"x"}function ee(e){return"y"===e?"height":"width"}function te(e){return["top","bottom"].includes(K(e))?"y":"x"}function oe(e){return Q(te(e))}function ne(e){return e.replace(/start|end/g,(e=>X[e]))}function ie(e){return e.replace(/left|right|bottom|top/g,(e=>q[e]))}function re(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 le(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ae(e,t,o){let{reference:n,floating:i}=e;const r=te(t),l=oe(t),a=ee(l),f=K(t),s="y"===r,c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,u=n[a]/2-i[a]/2;let p;switch(f){case"top":p={x:c,y:n.y-i.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(J(t)){case"start":p[l]-=u*(o&&s?-1:1);break;case"end":p[l]+=u*(o&&s?-1:1)}return p}async function fe(e,t){var o;void 0===t&&(t={});const{x:n,y:i,platform:r,rects:l,elements:a,strategy:f}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:u=!1,padding:p=0}=G(t,e),y=re(p),m=a[u?"floating"===d?"reference":"floating":d],g=le(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(m)))||o?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:s,rootBoundary:c,strategy:f})),h="floating"===d?{...l.floating,x:n,y:i}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},v=le(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:h,offsetParent:x,strategy:f}):h);return{top:(g.top-v.top+y.top)/b.y,bottom:(v.bottom-g.bottom+y.bottom)/b.y,left:(g.left-v.left+y.left)/b.x,right:(v.right-g.right+y.right)/b.x}}function se(e){const t=W(...e.map((e=>e.left))),o=W(...e.map((e=>e.top)));return{x:t,y:o,width:U(...e.map((e=>e.right)))-t,height:U(...e.map((e=>e.bottom)))-o}}const ce=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:i,y:r,placement:l,middlewareData:a}=t,f=await async function(e,t){const{placement:o,platform:n,elements:i}=e,r=await(null==n.isRTL?void 0:n.isRTL(i.floating)),l=K(o),a=J(o),f="y"===te(o),s=["left","top"].includes(l)?-1:1,c=r&&f?-1:1,d=G(t,e);let{mainAxis:u,crossAxis:p,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof y&&(p="end"===a?-1*y:y),f?{x:p*c,y:u*s}:{x:u*s,y:p*c}}(t,e);return l===(null==(o=a.offset)?void 0:o.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}};function de(e){const t=H(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=T(e),r=i?e.offsetWidth:o,l=i?e.offsetHeight:n,a=Z(o)!==r||Z(n)!==l;return a&&(o=r,n=l),{width:o,height:n,$:a}}function ue(e){return L(e)?e:e.contextElement}function pe(e){const t=ue(e);if(!T(t))return $(1);const o=t.getBoundingClientRect(),{width:n,height:i,$:r}=de(t);let l=(r?Z(o.width):o.width)/n,a=(r?Z(o.height):o.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const ye=$(0);function me(e){const t=_(e);return P()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ye}function ge(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const i=e.getBoundingClientRect(),r=ue(e);let l=$(1);t&&(n?L(n)&&(l=pe(n)):l=pe(e));const a=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==_(e))&&t}(r,o,n)?me(r):$(0);let f=(i.left+a.x)/l.x,s=(i.top+a.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(r){const e=_(r),t=n&&L(n)?_(n):n;let o=e,i=o.frameElement;for(;i&&n&&t!==o;){const e=pe(i),t=i.getBoundingClientRect(),n=H(i),r=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;f*=e.x,s*=e.y,c*=e.x,d*=e.y,f+=r,s+=l,o=_(i),i=o.frameElement}}return le({width:c,height:d,x:f,y:s})}const he=[":popover-open",":modal"];function xe(e){return he.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function be(e){return ge(O(e)).left+F(e).scrollLeft}function ve(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=_(e),n=O(e),i=o.visualViewport;let r=n.clientWidth,l=n.clientHeight,a=0,f=0;if(i){r=i.width,l=i.height;const e=P();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,f=i.offsetTop)}return{width:r,height:l,x:a,y:f}}(e,o);else if("document"===t)n=function(e){const t=O(e),o=F(e),n=e.ownerDocument.body,i=U(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=U(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-o.scrollLeft+be(e);const a=-o.scrollTop;return"rtl"===H(n).direction&&(l+=U(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:l,y:a}}(O(e));else if(L(t))n=function(e,t){const o=ge(e,!0,"fixed"===t),n=o.top+e.clientTop,i=o.left+e.clientLeft,r=T(e)?pe(e):$(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:i*r.x,y:n*r.y}}(t,o);else{const o=me(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return le(n)}function we(e,t){const o=V(e);return!(o===t||!L(o)||D(o))&&("fixed"===H(o).position||we(o,t))}function Ce(e,t,o){const n=T(t),i=O(t),r="fixed"===o,l=ge(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const f=$(0);if(n||!n&&!r)if(("body"!==k(t)||A(i))&&(a=F(t)),n){const e=ge(t,!0,r,t);f.x=e.x+t.clientLeft,f.y=e.y+t.clientTop}else i&&(f.x=be(i));return{x:l.left+a.scrollLeft-f.x,y:l.top+a.scrollTop-f.y,width:l.width,height:l.height}}function Re(e,t){return T(e)&&"fixed"!==H(e).position?t?t(e):e.offsetParent:null}function Ee(e,t){const o=_(e);if(!T(e)||xe(e))return o;let n=Re(e,t);for(;n&&M(n)&&"static"===H(n).position;)n=Re(n,t);return n&&("html"===k(n)||"body"===k(n)&&"static"===H(n).position&&!I(n))?o:n||function(e){let t=V(e);for(;T(t)&&!D(t);){if(I(t))return t;t=V(t)}return null}(e)||o}const Se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:i}=e;const r="fixed"===i,l=O(n),a=!!t&&xe(t.floating);if(n===l||a&&r)return o;let f={scrollLeft:0,scrollTop:0},s=$(1);const c=$(0),d=T(n);if((d||!d&&!r)&&(("body"!==k(n)||A(l))&&(f=F(n)),T(n))){const e=ge(n);s=pe(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-f.scrollLeft*s.x+c.x,y:o.y*s.y-f.scrollTop*s.y+c.y}},getDocumentElement:O,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:i}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=z(e,[],!1).filter((e=>L(e)&&"body"!==k(e))),i=null;const r="fixed"===H(e).position;let l=r?V(e):e;for(;L(l)&&!D(l);){const t=H(l),o=I(l);o||"fixed"!==t.position||(i=null),(r?!o&&!i:!o&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||A(l)&&!o&&we(e,l))?n=n.filter((e=>e!==l)):i=t,l=V(l)}return t.set(e,n),n}(t,this._c):[].concat(o),n],l=r[0],a=r.reduce(((e,o)=>{const n=ve(t,o,i);return e.top=U(n.top,e.top),e.right=W(n.right,e.right),e.bottom=W(n.bottom,e.bottom),e.left=U(n.left,e.left),e}),ve(t,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ee,getElementRects:async function(e){const t=this.getOffsetParent||Ee,o=this.getDimensions;return{reference:Ce(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}=de(e);return{width:t,height:o}},getScale:pe,isElement:L,isRTL:function(e){return"rtl"===H(e).direction}},ke=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...f}=G(e,t),s={x:o,y:n},c=await fe(t,f),d=te(K(i)),u=Q(d);let p=s[u],y=s[d];if(r){const e="y"===u?"bottom":"right";p=Y(p+c["y"===u?"top":"left"],p,p-c[e])}if(l){const e="y"===d?"bottom":"right";y=Y(y+c["y"===d?"top":"left"],y,y-c[e])}const m=a.fn({...t,[u]:p,[d]:y});return{...m,data:{x:m.x-o,y:m.y-n}}}}},_e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:i,middlewareData:r,rects:l,initialPlacement:a,platform:f,elements:s}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...g}=G(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const h=K(i),x=K(a)===a,b=await(null==f.isRTL?void 0:f.isRTL(s.floating)),v=u||(x||!m?[ie(a)]:function(e){const t=ie(e);return[ne(e),t,ne(t)]}(a));u||"none"===y||v.push(...function(e,t,o,n){const i=J(e);let r=function(e,t,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return o?t?i:n:t?n:i;case"left":case"right":return t?r:l;default:return[]}}(K(e),"start"===o,n);return i&&(r=r.map((e=>e+"-"+i)),t&&(r=r.concat(r.map(ne)))),r}(a,m,y,b));const w=[a,...v],C=await fe(t,g),R=[];let E=(null==(n=r.flip)?void 0:n.overflows)||[];if(c&&R.push(C[h]),d){const e=function(e,t,o){void 0===o&&(o=!1);const n=J(e),i=oe(e),r=ee(i);let l="x"===i?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=ie(l)),[l,ie(l)]}(i,l,b);R.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:i,overflows:R}],!R.every((e=>e<=0))){var S,k;const e=((null==(S=r.flip)?void 0:S.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let o=null==(k=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.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=a}if(i!==o)return{reset:{placement:o}}}return{}}}},Oe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:i,platform:r,strategy:l}=t,{padding:a=2,x:f,y:s}=G(e,t),c=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(n.reference))||[]),d=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 i=t[e];!n||i.y-n.y>n.height/2?o.push([i]):o[o.length-1].push(i),n=i}return o.map((e=>le(se(e))))}(c),u=le(se(c)),p=re(a);const y=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=f&&null!=s)return d.find((e=>f>e.left-p.left&&f<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||u;if(d.length>=2){if("y"===te(o)){const e=d[0],t=d[d.length-1],n="top"===K(o),i=e.top,r=t.bottom,l=n?e.left:t.left,a=n?e.right:t.right;return{top:i,bottom:r,left:l,right:a,width:a-l,height:r-i,x:l,y:i}}const e="left"===K(o),t=U(...d.map((e=>e.right))),n=W(...d.map((e=>e.left))),i=d.filter((o=>e?o.left===n:o.right===t)),r=i[0].top,l=i[i.length-1].bottom;return{top:r,bottom:l,left:n,right:t,width:t-n,height:l-r,x:n,y:r}}return u}},floating:n.floating,strategy:l});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},Ne=(e,t,o)=>{const n=new Map,i={platform:Se,...o},r={...i.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:l}=o,a=r.filter(Boolean),f=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=ae(s,n,f),u=n,p={},y=0;for(let o=0;o<a.length;o++){const{name:r,fn:m}=a[o],{x:g,y:h,data:x,reset:b}=await m({x:c,y:d,initialPlacement:n,placement:u,strategy:i,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=h?h:d,p={...p,[r]:{...p[r],...x}},b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:c,y:d}=ae(s,u,f))),o=-1)}return{x:c,y:d,placement:u,strategy:i,middlewareData:p}})(e,t,{...i,platform:r})};var Le="undefined"!=typeof document?u:p;function Te(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,i;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(!Te(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),o=i.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=o;0!=n--;){const o=i[n];if(("_owner"!==o||!e.$$typeof)&&!Te(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function je(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ae(e,t){const o=je(e);return Math.round(t*o)/o}function Me(e){const t=s.useRef(e);return Le((()=>{t.current=e})),t}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var Ie=["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(","),Pe="undefined"==typeof Element,De=Pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Fe=!Pe&&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},He=function e(t,o){var n;void 0===o&&(o=!0);var i=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===i||"true"===i||o&&t&&e(t.parentNode)},Ve=function e(t,o,n){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!He(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),f=e(a.length?a:l.children,!0,n);n.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else{De.call(l,Ie)&&n.filter(l)&&(o||!t.includes(l))&&i.push(l);var s=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),c=!He(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(l));if(s&&c){var u=e(!0===s?l.children:s.children,!0,n);n.flatten?i.push.apply(i,u):i.push({scopeParent:l,candidates:u})}else r.unshift.apply(r,l.children)}}return i},Be=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ze=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))&&!Be(e)?0:e.tabIndex},Ue=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},We=function(e){return"INPUT"===e.tagName},Ze=function(e){return function(e){return We(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||Fe(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 i=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!i||i===e}(e)},$e=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},qe=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=De.call(e,"details>summary:first-of-type")?e.parentElement:e;if(De.call(i,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return $e(e)}else{if("function"==typeof n){for(var r=e;e;){var l=e.parentElement,a=Fe(e);if(l&&!l.shadowRoot&&!0===n(l))return $e(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=r}if(function(e){var t,o,n,i,r=e&&Fe(e),l=null===(t=r)||void 0===t?void 0:t.host,a=!1;if(r&&r!==e)for(a=!!(null!==(o=l)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(l)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!a&&l;){var f,s,c;a=!(null===(s=l=null===(f=r=Fe(l))||void 0===f?void 0:f.host)||void 0===s||null===(c=s.ownerDocument)||void 0===c||!c.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},Xe=function(e,t){return!(t.disabled||He(t)||function(e){return We(e)&&"hidden"===e.type}(t)||qe(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!!De.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ye=function(e,t){return!(Ze(t)||ze(t)<0||!Xe(e,t))},Ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ke=function e(t){var o=[],n=[];return t.forEach((function(t,i){var r=!!t.scopeParent,l=r?t.scopeParent:t,a=function(e,t){var o=ze(e);return o<0&&t&&!Be(e)?0:o}(l,r),f=r?e(t.candidates):l;0===a?r?o.push.apply(o,f):o.push(l):n.push({documentOrder:i,tabIndex:a,item:t,isScope:r,content:f})})),n.sort(Ue).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},Je=function(e,t){var o;return o=(t=t||{}).getShadowRoot?Ve([e],t.includeContainer,{filter:Ye.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ge}):function(e,t,o){if(He(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ie));return t&&De.call(e,Ie)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,Ye.bind(null,t)),Ke(o)};const Qe=s["useInsertionEffect".toString()]||(e=>e());var et="undefined"!=typeof document?d:p;function tt(){return tt=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},tt.apply(this,arguments)}let ot=!1,nt=0;const it=()=>"floating-ui-"+nt++;const rt=s["useId".toString()]||function(){const[e,t]=s.useState((()=>ot?it():void 0));return et((()=>{null==e&&t(it())}),[]),s.useEffect((()=>{ot||(ot=!0)}),[]),e};const lt=s.createContext(null),at=s.createContext(null);function ft(e){return"data-floating-ui-"+e}const st=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const o=Je(e,st());"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==(i=e)?void 0:i.ownerDocument)||document));var i;return o.slice(n+1)[0]}function ut(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&&j(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function dt(e){Je(e,st()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function pt(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 yt={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 mt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const gt=s.forwardRef((function(e,t){const[o,n]=s.useState();et((()=>(/apple/i.test(navigator.vendor)&&n("button"),document.addEventListener("keydown",mt),()=>{document.removeEventListener("keydown",mt)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[ft("focus-guard")]:"",style:yt};return s.createElement("span",tt({},e,i))})),ht=s.createContext(null),xt=ft("portal");function bt(e){let{children:t,id:o,root:n=null,preserveTabOrder:i=!0}=e;const r=function(e){let{id:t,root:o}=void 0===e?{}:e;const[n,i]=s.useState(null),r=rt(),l=vt(),a=s.useRef(null);return et((()=>()=>{null==n||n.remove(),queueMicrotask((()=>{a.current=null}))}),[n]),et((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=r,o.setAttribute(xt,""),e.appendChild(o),a.current=o,i(o)}),[t,r]),et((()=>{if(a.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!L(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const f=document.createElement("div");f.id=r,f.setAttribute(xt,""),e=n||e,e.appendChild(f),a.current=f,i(f)}),[t,o,r,l]),n}({id:o,root:n}),[l,a]=s.useState(null),f=s.useRef(null),c=s.useRef(null),u=s.useRef(null),d=s.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!n&&!r);return s.useEffect((()=>{if(r&&i&&(null==l||!l.modal))return r.addEventListener("focusin",e,!0),r.addEventListener("focusout",e,!0),()=>{r.removeEventListener("focusin",e,!0),r.removeEventListener("focusout",e,!0)};function e(e){if(r&&ut(e)){("focusin"===e.type?pt:dt)(r)}}}),[r,i,null==l?void 0:l.modal]),s.createElement(ht.Provider,{value:s.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:f,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:r,setFocusManagerState:a})),[i,r])},p&&r&&s.createElement(gt,{"data-type":"outside",ref:f,onFocus:e=>{if(ut(e,r)){var t;null==(t=u.current)||t.focus()}else{const e=ct(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&r&&s.createElement("span",{"aria-owns":r.id,style:yt}),r&&g(t,r),p&&r&&s.createElement(gt,{"data-type":"outside",ref:c,onFocus:e=>{if(ut(e,r)){var t;null==(t=d.current)||t.focus()}else{const t=ct(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 vt=()=>s.useContext(ht),wt=new Set,Ct=s.forwardRef((function(e,t){let{lockScroll:o=!1,...n}=e;const i=rt();return et((()=>{if(!o)return;wt.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,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var f,s;const e=(null==(f=window.visualViewport)?void 0:f.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(o))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{wt.delete(i),0===wt.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,o]),s.createElement("div",tt({ref:t},n,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}}))}));function Rt(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:n,nodeId:i}=e,[r,l]=s.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||r,f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:n=[],platform:i,elements:{reference:r,floating:l}={},transform:a=!0,whileElementsMounted:f,open:c}=e,[u,d]=s.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=s.useState(n);Te(p,n)||y(n);const[g,h]=s.useState(null),[x,b]=s.useState(null),v=s.useCallback((e=>{e!==E.current&&(E.current=e,h(e))}),[]),w=s.useCallback((e=>{e!==S.current&&(S.current=e,b(e))}),[]),C=r||g,R=l||x,E=s.useRef(null),S=s.useRef(null),k=s.useRef(u),_=null!=f,O=Me(f),N=Me(i),L=s.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:o,middleware:p};N.current&&(e.platform=N.current),Ne(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!Te(k.current,t)&&(k.current=t,m.flushSync((()=>{d(t)})))}))}),[p,t,o,N]);Le((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const T=s.useRef(!1);Le((()=>(T.current=!0,()=>{T.current=!1})),[]),Le((()=>{if(C&&(E.current=C),R&&(S.current=R),C&&R){if(O.current)return O.current(C,R,L);L()}}),[C,R,L,O,_]);const j=s.useMemo((()=>({reference:E,floating:S,setReference:v,setFloating:w})),[v,w]),A=s.useMemo((()=>({reference:C,floating:R})),[C,R]),M=s.useMemo((()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=Ae(A.floating,u.x),n=Ae(A.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...je(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,a,A.floating,u.x,u.y]);return s.useMemo((()=>({...u,update:L,refs:j,elements:A,floatingStyles:M})),[u,L,j,A,M])}(e),c=s.useContext(at),u=null!=((null==(d=s.useContext(lt))?void 0:d.id)||null);var d;const p=function(e){const t=s.useRef((()=>{}));return Qe((()=>{t.current=e})),s.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&&(g.current.openEvent=t),h.emit("openchange",{open:e,event:t,reason:o,nested:u}),null==n||n(e,t,o)})),y=s.useRef(null),g=s.useRef({}),h=s.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],x=rt(),b=s.useCallback((e=>{const t=L(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),v=s.useCallback((e=>{(L(e)||null===e)&&(y.current=e,l(e)),(L(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!L(e))&&f.refs.setReference(e)}),[f.refs]),w=s.useMemo((()=>({...f.refs,setReference:v,setPositionReference:b,domReference:y})),[f.refs,v,b]),C=s.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),R=s.useMemo((()=>({...f,refs:w,elements:C,dataRef:g,nodeId:i,floatingId:x,events:h,open:o,onOpenChange:p})),[f,i,x,h,o,p,w,C]);return et((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=R)})),s.useMemo((()=>({...f,context:R,refs:w,elements:C})),[f,w,C,R])}function Et(e,t,o,n){return new(o||(o=Promise))((function(i,r){function l(e){try{f(n.next(e))}catch(e){r(e)}}function a(e){try{f(n.throw(e))}catch(e){r(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,a)}f((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const St=({accept:o="",onClose:n,blockId:i,onSetLoading:r})=>{const l=e("File"),s=t();return a("div",Object.assign({className:"yoo-file-user-select-none yoo-file-transition-bg yoo-file-duration-20 yoo-file-ease-in yoo-file-white-space-nowrap yoo-file-rounded-[4px] yoo-file-h-[32px] yoo-file-px-[12px] yoo-file-border yoo-file-border-[rgba(55,53,47,0.16)] yoo-file-w-full yoo-file-cursor-pointer"},{children:f("label",Object.assign({htmlFor:"file-uploader",className:"yoo-file-text-[14px] yoo-file-leading-[1.2] yoo-file-font-medium yoo-file-cursor-pointer yoo-file-w-full yoo-file-flex yoo-file-items-center yoo-file-justify-center yoo-file-h-full"},{children:[a("input",{type:"file",id:"file-uploader",className:"yoo-file-absolute yoo-file-left-0 yoo-file-top-0 yoo-file-invisible",accept:(null==l?void 0:l.accept)||o,onChange:e=>{const t=e.target.files[0];t&&(e=>{Et(void 0,void 0,void 0,(function*(){if(console.log("options?.onUpload",null==l?void 0:l.onUpload),!(null==l?void 0:l.onUpload))throw new Error("onUpload not provided in plugin options. Check File.extend({}) method");n(),r(!0);try{const t=yield null==l?void 0:l.onUpload(e),o=t.format||e.name.split(".").pop()||null;s.blocks.File.updateElement(i,"file",{src:t.src,name:t.name||e.name,size:t.size||e.size,format:o})}catch(e){}finally{r(!1)}}))})(t)},multiple:!1}),"Upload file"]}))}))},kt=({floatingStyles:e,refs:t,onClose:o,blockId:n,onSetLoading:i})=>a(bt,Object.assign({id:"yoo-file-uploader-portal",root:document.getElementById("yoopta-editor")},{children:a(Ct,Object.assign({lockScroll:!0,className:"yoo-file-z-[100]",onClick:o},{children:a("div",Object.assign({ref:t.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:f("div",Object.assign({className:"yoo-file-flex yoo-file-flex-col yoo-file-min-w-[540px] yoo-file-max-w-[calc(100vw-24px)] yoo-file-h-full yoo-file-max-h-[420px] yoo-file-bg-white yoo-file-shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[a("div",Object.assign({className:"yoo-file-w-full yoo-file-flex yoo-file-text-[14px] yoo-file-p-[0_8px] yoo-file-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-file-relative yoo-file-z-10 yoo-file-h-[40px]"},{children:a("button",Object.assign({type:"button",style:{borderBottom:"2px solid #2483e2"},className:"yoo-file-py-[6px] yoo-file-whitespace-nowrap yoo-file-min-w-0 yoo-file-flex-shrink-0 yoo-file-text-[rgb(55,53,47)] yoo-file-relative yoo-file-cursor-pointer yoo-file-user-select-none yoo-file-bg-inherit yoo-file-transition-[height_20ms_ease-in] yoo-file-inline-flex yoo-file-items-center yoo-file-h-full yoo-file-text-[14px] yoo-file-leading-[1.2] yoo-file-px-[8px]"},{children:"Upload"}))})),a("div",Object.assign({className:"yoo-file-pt-[6px] yoo-file-pb-[6px] yoo-file-mt-[4px] yoo-file-flex yoo-file-justify-center yoo-file-mr-[12px] yoo-file-ml-[12px]"},{children:a(St,{onClose:o,blockId:n,onSetLoading:i})}))]}))}))}))})),_t=({className:e,width:t,height:o,children:n})=>f("div",Object.assign({className:e},{children:[n,a("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-file-h-4 yoo-file-w-4 yoo-file-animate-spin"},{children:a("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Ot=({attributes:e,children:t,blockId:o})=>{const[n,i]=y(!1),[r,l]=y(!1),{refs:s,floatingStyles:c}=Rt({placement:"bottom",open:n,onOpenChange:i,middleware:[Oe(),_e(),ke(),ce(10)]});return f("div",Object.assign({className:"yoo-file-w-full yoo-file-user-select-none yoo-file-m-[20px_0_10px] yoo-file-relative yoo-file-flex"},e,{contentEditable:!1},{children:[f("button",Object.assign({className:"yoo-file-p-[12px_36px_12px_12px] yoo-file-flex yoo-file-items-center yoo-file-text-left yoo-file-w-full yoo-file-overflow-hidden yoo-file-rounded-[3px] yoo-file-text-[14px] yoo-file-text-[rgba(55,53,47,0.65)] yoo-file-relative yoo-file-cursor-pointer yoo-file-border-none yoo-file-bg-[#efefef] yoo-file-transition-[background-color_100ms_ease-in] hover:yoo-file-bg-[#e3e3e3]",onClick:()=>i(!0),ref:s.setReference},{children:[a(r?_t:w,{className:"yoo-file-mr-2 yoo-file-user-select-none",width:24,height:24}),a("span",Object.assign({className:"yoo-file-font-medium"},{children:r?"Loading...":"Click to add file"})),r&&a("div",{className:"yoo-file-absolute yoo-file-top-0 yoo-file-left-0 yoo-file-h-full yoo-file-bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),n&&a(kt,{blockId:o,floatingStyles:c,refs:s,onClose:()=>i(!1),onSetLoading:e=>l(e)}),t]}))},{ExtendedBlockActions:Nt,BlockOptionsMenuGroup:Lt,BlockOptionsMenuItem:Tt,BlockOptionsSeparator:jt}=o,At=({editor:e,block:t,props:o})=>f(Nt,Object.assign({onClick:()=>e.setSelection([t.meta.order])},{children:[a(jt,{}),a(Lt,{children:a(Tt,{children:f("button",Object.assign({type:"button",className:"yoo-file-rounded-sm hover:yoo-file-bg-[#37352f14] yoo-file-leading-[120%] yoo-file-px-2 yoo-file-py-1.5 yoo-file-mx-[4px] yoo-file-cursor-pointer yoo-file-w-full yoo-file-flex yoo-file-justify-start",onClick:()=>{(null==o?void 0:o.src)&&window.open(null==o?void 0:o.src,"_blank")}},{children:[a(b,{width:16,height:16,className:"yoo-file-w-4 yoo-file-h-4 yoo-file-mr-2"}),"Open"]}))})})]})),Mt=new l({type:"File",elements:{file:{render:({element:o,attributes:l,children:s,blockId:c})=>{const{name:u,src:d,format:p,size:y}=o.props||{},m=n(c),g=t();e("File");const h=i(),x=r({blockId:c});return d?f("div",Object.assign({"data-element-type":o.type,contentEditable:!1,draggable:!1,className:"yoo-file-mt-4 yoo-file-relative yoo-file-flex yoopta-file"},l,{children:[x&&a("div",{className:"yoo-file-absolute yoo-file-pointer-events-none yoo-file-inset-0 yoo-file-bg-[rgba(35,131,226,0.14)] yoo-file-z-[81] yoo-file-rounded-[3px] yoo-file-opacity-100 yoo-file-transition-opacity yoo-file-duration-150 yoo-file-ease-in"}),a(S,{name:u,format:p,src:d,size:y,blockId:c}),!h&&a(At,{block:m,editor:g,props:o.props}),s]})):a(Ot,Object.assign({attributes:l,blockId:c},{children:s}))},props:{size:0,name:null,src:null,format:null,nodeType:"void"}}},options:{display:{title:"File",description:"For file videos, google maps and more"},accept:""},parsers:{}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".yoo-file-pointer-events-none{pointer-events:none}.yoo-file-invisible{visibility:hidden}.yoo-file-absolute{position:absolute}.yoo-file-relative{position:relative}.yoo-file-inset-0{inset:0}.yoo-file-left-0{left:0}.yoo-file-top-0{top:0}.yoo-file-z-10{z-index:10}.yoo-file-z-\\[100\\]{z-index:100}.yoo-file-z-\\[81\\]{z-index:81}.yoo-file-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-file-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-file-ml-\\[12px\\]{margin-left:12px}.yoo-file-ml-\\[6px\\]{margin-left:6px}.yoo-file-ml-\\[8px\\]{margin-left:8px}.yoo-file-mr-2{margin-right:.5rem}.yoo-file-mr-\\[12px\\]{margin-right:12px}.yoo-file-mt-4{margin-top:1rem}.yoo-file-mt-\\[4px\\]{margin-top:4px}.yoo-file-flex{display:flex}.yoo-file-inline-flex{display:inline-flex}.yoo-file-h-4{height:1rem}.yoo-file-h-\\[32px\\]{height:32px}.yoo-file-h-\\[40px\\]{height:40px}.yoo-file-h-full{height:100%}.yoo-file-max-h-\\[420px\\]{max-height:420px}.yoo-file-w-4{width:1rem}.yoo-file-w-full{width:100%}.yoo-file-min-w-0{min-width:0}.yoo-file-min-w-\\[540px\\]{min-width:540px}.yoo-file-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-file-flex-shrink-0{flex-shrink:0}@keyframes yoo-file-spin{to{transform:rotate(1turn)}}.yoo-file-animate-spin{animation:yoo-file-spin 1s linear infinite}.yoo-file-cursor-pointer{cursor:pointer}.yoo-file-flex-col{flex-direction:column}.yoo-file-items-center{align-items:center}.yoo-file-justify-start{justify-content:flex-start}.yoo-file-justify-center{justify-content:center}.yoo-file-overflow-hidden{overflow:hidden}.yoo-file-whitespace-nowrap{white-space:nowrap}.yoo-file-rounded-\\[3px\\]{border-radius:3px}.yoo-file-rounded-\\[4px\\]{border-radius:4px}.yoo-file-rounded-sm{border-radius:.125rem}.yoo-file-border{border-width:1px}.yoo-file-border-b-\\[1px\\]{border-bottom-width:1px}.yoo-file-border-none{border-style:none}.yoo-file-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-file-border-\\[transparent\\]{border-color:transparent}.yoo-file-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-file-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-file-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-file-bg-inherit{background-color:inherit}.yoo-file-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-file-p-\\[0_8px\\]{padding:0 8px}.yoo-file-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-file-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-file-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-file-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-file-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-file-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-file-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-file-py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.yoo-file-pb-\\[6px\\]{padding-bottom:6px}.yoo-file-pt-\\[6px\\]{padding-top:6px}.yoo-file-text-left{text-align:left}.yoo-file-text-\\[10px\\]{font-size:10px}.yoo-file-text-\\[14px\\]{font-size:14px}.yoo-file-font-medium{font-weight:500}.yoo-file-font-normal{font-weight:400}.yoo-file-leading-\\[1\\.2\\]{line-height:1.2}.yoo-file-leading-\\[120\\%\\]{line-height:120%}.yoo-file-text-\\[\\#000000\\]{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.yoo-file-text-\\[\\#37352fa6\\]{color:#37352fa6}.yoo-file-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-file-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-file-opacity-100{opacity:1}.yoo-file-shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\,_rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\,_rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-file-shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-file-transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-file-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-file-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-file-duration-150{transition-duration:.15s}.yoo-file-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-file .yoopta-extended-block-actions{opacity:0;transition:opacity .15s ease-in-out}.yoopta-file:hover .yoopta-extended-block-actions{opacity:1}.hover\\:yoo-file-border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]:hover{border-color:rgba(55,53,47,.16)}.hover\\:yoo-file-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-file-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.hover\\:yoo-file-bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.04\\)\\]:hover{background-color:rgba(55,53,47,.04)}");export{Mt as default};
6
+ var Ie=["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(","),Pe="undefined"==typeof Element,De=Pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,He=!Pe&&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},Fe=function e(t,o){var n;void 0===o&&(o=!0);var i=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===i||"true"===i||o&&t&&e(t.parentNode)},Ve=function e(t,o,n){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!Fe(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),f=e(a.length?a:l.children,!0,n);n.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else{De.call(l,Ie)&&n.filter(l)&&(o||!t.includes(l))&&i.push(l);var s=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),c=!Fe(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(l));if(s&&c){var d=e(!0===s?l.children:s.children,!0,n);n.flatten?i.push.apply(i,d):i.push({scopeParent:l,candidates:d})}else r.unshift.apply(r,l.children)}}return i},Be=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ze=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))&&!Be(e)?0:e.tabIndex},We=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ue=function(e){return"INPUT"===e.tagName},Ze=function(e){return function(e){return Ue(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||He(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 i=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!i||i===e}(e)},$e=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},qe=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=De.call(e,"details>summary:first-of-type")?e.parentElement:e;if(De.call(i,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return $e(e)}else{if("function"==typeof n){for(var r=e;e;){var l=e.parentElement,a=He(e);if(l&&!l.shadowRoot&&!0===n(l))return $e(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=r}if(function(e){var t,o,n,i,r=e&&He(e),l=null===(t=r)||void 0===t?void 0:t.host,a=!1;if(r&&r!==e)for(a=!!(null!==(o=l)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(l)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!a&&l;){var f,s,c;a=!(null===(s=l=null===(f=r=He(l))||void 0===f?void 0:f.host)||void 0===s||null===(c=s.ownerDocument)||void 0===c||!c.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},Xe=function(e,t){return!(t.disabled||Fe(t)||function(e){return Ue(e)&&"hidden"===e.type}(t)||qe(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!!De.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ye=function(e,t){return!(Ze(t)||ze(t)<0||!Xe(e,t))},Ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ke=function e(t){var o=[],n=[];return t.forEach((function(t,i){var r=!!t.scopeParent,l=r?t.scopeParent:t,a=function(e,t){var o=ze(e);return o<0&&t&&!Be(e)?0:o}(l,r),f=r?e(t.candidates):l;0===a?r?o.push.apply(o,f):o.push(l):n.push({documentOrder:i,tabIndex:a,item:t,isScope:r,content:f})})),n.sort(We).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},Je=function(e,t){var o;return o=(t=t||{}).getShadowRoot?Ve([e],t.includeContainer,{filter:Ye.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ge}):function(e,t,o){if(Fe(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ie));return t&&De.call(e,Ie)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,Ye.bind(null,t)),Ke(o)};const Qe=s["useInsertionEffect".toString()]||(e=>e());var et="undefined"!=typeof document?u:p;function tt(){return tt=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},tt.apply(this,arguments)}let ot=!1,nt=0;const it=()=>"floating-ui-"+nt++;const rt=s["useId".toString()]||function(){const[e,t]=s.useState((()=>ot?it():void 0));return et((()=>{null==e&&t(it())}),[]),s.useEffect((()=>{ot||(ot=!0)}),[]),e};const lt=s.createContext(null),at=s.createContext(null);function ft(e){return"data-floating-ui-"+e}const st=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const o=Je(e,st());"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==(i=e)?void 0:i.ownerDocument)||document));var i;return o.slice(n+1)[0]}function dt(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&&j(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function ut(e){Je(e,st()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function pt(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 yt={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 mt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const gt=s.forwardRef((function(e,t){const[o,n]=s.useState();et((()=>(/apple/i.test(navigator.vendor)&&n("button"),document.addEventListener("keydown",mt),()=>{document.removeEventListener("keydown",mt)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[ft("focus-guard")]:"",style:yt};return s.createElement("span",tt({},e,i))})),ht=s.createContext(null),xt=ft("portal");function bt(e){let{children:t,id:o,root:n=null,preserveTabOrder:i=!0}=e;const r=function(e){let{id:t,root:o}=void 0===e?{}:e;const[n,i]=s.useState(null),r=rt(),l=vt(),a=s.useRef(null);return et((()=>()=>{null==n||n.remove(),queueMicrotask((()=>{a.current=null}))}),[n]),et((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=r,o.setAttribute(xt,""),e.appendChild(o),a.current=o,i(o)}),[t,r]),et((()=>{if(a.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!L(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const f=document.createElement("div");f.id=r,f.setAttribute(xt,""),e=n||e,e.appendChild(f),a.current=f,i(f)}),[t,o,r,l]),n}({id:o,root:n}),[l,a]=s.useState(null),f=s.useRef(null),c=s.useRef(null),d=s.useRef(null),u=s.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!n&&!r);return s.useEffect((()=>{if(r&&i&&(null==l||!l.modal))return r.addEventListener("focusin",e,!0),r.addEventListener("focusout",e,!0),()=>{r.removeEventListener("focusin",e,!0),r.removeEventListener("focusout",e,!0)};function e(e){if(r&&dt(e)){("focusin"===e.type?pt:ut)(r)}}}),[r,i,null==l?void 0:l.modal]),s.createElement(ht.Provider,{value:s.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:f,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:r,setFocusManagerState:a})),[i,r])},p&&r&&s.createElement(gt,{"data-type":"outside",ref:f,onFocus:e=>{if(dt(e,r)){var t;null==(t=d.current)||t.focus()}else{const e=ct(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&r&&s.createElement("span",{"aria-owns":r.id,style:yt}),r&&g(t,r),p&&r&&s.createElement(gt,{"data-type":"outside",ref:c,onFocus:e=>{if(dt(e,r)){var t;null==(t=u.current)||t.focus()}else{const t=ct(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 vt=()=>s.useContext(ht),wt=new Set,Ct=s.forwardRef((function(e,t){let{lockScroll:o=!1,...n}=e;const i=rt();return et((()=>{if(!o)return;wt.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,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var f,s;const e=(null==(f=window.visualViewport)?void 0:f.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(o))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{wt.delete(i),0===wt.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,o]),s.createElement("div",tt({ref:t},n,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}}))}));function Rt(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:n,nodeId:i}=e,[r,l]=s.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||r,f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:n=[],platform:i,elements:{reference:r,floating:l}={},transform:a=!0,whileElementsMounted:f,open:c}=e,[d,u]=s.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=s.useState(n);Te(p,n)||y(n);const[g,h]=s.useState(null),[x,b]=s.useState(null),v=s.useCallback((e=>{e!==E.current&&(E.current=e,h(e))}),[]),w=s.useCallback((e=>{e!==S.current&&(S.current=e,b(e))}),[]),C=r||g,R=l||x,E=s.useRef(null),S=s.useRef(null),k=s.useRef(d),_=null!=f,O=Me(f),N=Me(i),L=s.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:o,middleware:p};N.current&&(e.platform=N.current),Ne(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!Te(k.current,t)&&(k.current=t,m.flushSync((()=>{u(t)})))}))}),[p,t,o,N]);Le((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const T=s.useRef(!1);Le((()=>(T.current=!0,()=>{T.current=!1})),[]),Le((()=>{if(C&&(E.current=C),R&&(S.current=R),C&&R){if(O.current)return O.current(C,R,L);L()}}),[C,R,L,O,_]);const j=s.useMemo((()=>({reference:E,floating:S,setReference:v,setFloating:w})),[v,w]),A=s.useMemo((()=>({reference:C,floating:R})),[C,R]),M=s.useMemo((()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=Ae(A.floating,d.x),n=Ae(A.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...je(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,a,A.floating,d.x,d.y]);return s.useMemo((()=>({...d,update:L,refs:j,elements:A,floatingStyles:M})),[d,L,j,A,M])}(e),c=s.useContext(at),d=null!=((null==(u=s.useContext(lt))?void 0:u.id)||null);var u;const p=function(e){const t=s.useRef((()=>{}));return Qe((()=>{t.current=e})),s.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&&(g.current.openEvent=t),h.emit("openchange",{open:e,event:t,reason:o,nested:d}),null==n||n(e,t,o)})),y=s.useRef(null),g=s.useRef({}),h=s.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],x=rt(),b=s.useCallback((e=>{const t=L(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),v=s.useCallback((e=>{(L(e)||null===e)&&(y.current=e,l(e)),(L(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!L(e))&&f.refs.setReference(e)}),[f.refs]),w=s.useMemo((()=>({...f.refs,setReference:v,setPositionReference:b,domReference:y})),[f.refs,v,b]),C=s.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),R=s.useMemo((()=>({...f,refs:w,elements:C,dataRef:g,nodeId:i,floatingId:x,events:h,open:o,onOpenChange:p})),[f,i,x,h,o,p,w,C]);return et((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=R)})),s.useMemo((()=>({...f,context:R,refs:w,elements:C})),[f,w,C,R])}function Et(e,t,o,n){return new(o||(o=Promise))((function(i,r){function l(e){try{f(n.next(e))}catch(e){r(e)}}function a(e){try{f(n.throw(e))}catch(e){r(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,a)}f((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const St=({accept:o="",onClose:n,blockId:i,onSetLoading:r})=>{const l=e("File"),s=t();return a("div",Object.assign({className:"yoo-file-user-select-none yoo-file-transition-bg yoo-file-duration-20 yoo-file-ease-in yoo-file-white-space-nowrap yoo-file-rounded-[4px] yoo-file-h-[32px] yoo-file-px-[12px] yoo-file-border yoo-file-border-[rgba(55,53,47,0.16)] yoo-file-w-full yoo-file-cursor-pointer"},{children:f("label",Object.assign({htmlFor:"file-uploader",className:"yoo-file-text-[14px] yoo-file-leading-[1.2] yoo-file-font-medium yoo-file-cursor-pointer yoo-file-w-full yoo-file-flex yoo-file-items-center yoo-file-justify-center yoo-file-h-full"},{children:[a("input",{type:"file",id:"file-uploader",className:"yoo-file-absolute yoo-file-left-0 yoo-file-top-0 yoo-file-invisible",accept:(null==l?void 0:l.accept)||o,onChange:e=>{const t=e.target.files[0];t&&(e=>{Et(void 0,void 0,void 0,(function*(){if(!(null==l?void 0:l.onUpload))throw new Error("onUpload not provided in plugin options. Check File.extend({}) method");n(),r(!0);try{const t=yield null==l?void 0:l.onUpload(e),o=t.format||e.name.split(".").pop()||null;s.blocks.File.updateElement(i,"file",{src:t.src,name:t.name||e.name,size:t.size||e.size,format:o})}catch(e){}finally{r(!1)}}))})(t)},multiple:!1}),"Upload file"]}))}))},kt=({floatingStyles:e,refs:t,onClose:o,blockId:n,onSetLoading:i})=>a(bt,Object.assign({id:"yoo-file-uploader-portal",root:document.getElementById("yoopta-editor")},{children:a(Ct,Object.assign({lockScroll:!0,className:"yoo-file-z-[100]",onClick:o},{children:a("div",Object.assign({ref:t.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:f("div",Object.assign({className:"yoo-file-flex yoo-file-flex-col yoo-file-min-w-[540px] yoo-file-max-w-[calc(100vw-24px)] yoo-file-h-full yoo-file-max-h-[420px] yoo-file-bg-white yoo-file-shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[a("div",Object.assign({className:"yoo-file-w-full yoo-file-flex yoo-file-text-[14px] yoo-file-p-[0_8px] yoo-file-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-file-relative yoo-file-z-10 yoo-file-h-[40px]"},{children:a("button",Object.assign({type:"button",style:{borderBottom:"2px solid #2483e2"},className:"yoo-file-py-[6px] yoo-file-whitespace-nowrap yoo-file-min-w-0 yoo-file-flex-shrink-0 yoo-file-text-[rgb(55,53,47)] yoo-file-relative yoo-file-cursor-pointer yoo-file-user-select-none yoo-file-bg-inherit yoo-file-transition-[height_20ms_ease-in] yoo-file-inline-flex yoo-file-items-center yoo-file-h-full yoo-file-text-[14px] yoo-file-leading-[1.2] yoo-file-px-[8px]"},{children:"Upload"}))})),a("div",Object.assign({className:"yoo-file-pt-[6px] yoo-file-pb-[6px] yoo-file-mt-[4px] yoo-file-flex yoo-file-justify-center yoo-file-mr-[12px] yoo-file-ml-[12px]"},{children:a(St,{onClose:o,blockId:n,onSetLoading:i})}))]}))}))}))})),_t=({className:e,width:t,height:o,children:n})=>f("div",Object.assign({className:e},{children:[n,a("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-file-h-4 yoo-file-w-4 yoo-file-animate-spin"},{children:a("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Ot=({attributes:e,children:t,blockId:o})=>{const[n,i]=y(!1),[r,l]=y(!1),{refs:s,floatingStyles:c}=Rt({placement:"bottom",open:n,onOpenChange:i,middleware:[Oe(),_e(),ke(),ce(10)]});return f("div",Object.assign({className:"yoo-file-w-full yoo-file-user-select-none yoo-file-m-[20px_0_10px] yoo-file-relative yoo-file-flex"},e,{contentEditable:!1},{children:[f("button",Object.assign({className:"yoo-file-p-[12px_36px_12px_12px] yoo-file-flex yoo-file-items-center yoo-file-text-left yoo-file-w-full yoo-file-overflow-hidden yoo-file-rounded-[3px] yoo-file-text-[14px] yoo-file-text-[rgba(55,53,47,0.65)] yoo-file-relative yoo-file-cursor-pointer yoo-file-border-none yoo-file-bg-[#efefef] yoo-file-transition-[background-color_100ms_ease-in] hover:yoo-file-bg-[#e3e3e3]",onClick:()=>i(!0),ref:s.setReference},{children:[a(r?_t:w,{className:"yoo-file-mr-2 yoo-file-user-select-none",width:24,height:24}),a("span",Object.assign({className:"yoo-file-font-medium"},{children:r?"Loading...":"Click to add file"})),r&&a("div",{className:"yoo-file-absolute yoo-file-top-0 yoo-file-left-0 yoo-file-h-full yoo-file-bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),n&&a(kt,{blockId:o,floatingStyles:c,refs:s,onClose:()=>i(!1),onSetLoading:e=>l(e)}),t]}))},{ExtendedBlockActions:Nt,BlockOptionsMenuGroup:Lt,BlockOptionsMenuItem:Tt,BlockOptionsSeparator:jt}=o,At=({editor:e,block:t,props:o})=>f(Nt,Object.assign({onClick:()=>e.setSelection([t.meta.order])},{children:[a(jt,{}),a(Lt,{children:a(Tt,{children:f("button",Object.assign({type:"button",className:"yoo-file-rounded-sm hover:yoo-file-bg-[#37352f14] yoo-file-leading-[120%] yoo-file-px-2 yoo-file-py-1.5 yoo-file-mx-[4px] yoo-file-cursor-pointer yoo-file-w-full yoo-file-flex yoo-file-justify-start",onClick:()=>{(null==o?void 0:o.src)&&window.open(null==o?void 0:o.src,"_blank")}},{children:[a(b,{width:16,height:16,className:"yoo-file-w-4 yoo-file-h-4 yoo-file-mr-2"}),"Open"]}))})})]})),Mt=new l({type:"File",elements:{file:{render:({element:e,attributes:o,children:l,blockId:s})=>{const{name:c,src:d,format:u,size:p}=e.props||{},y=n(s),m=t(),g=i(),h=r({blockId:s});return d?f("div",Object.assign({"data-element-type":e.type,contentEditable:!1,draggable:!1,className:"yoo-file-mt-4 yoo-file-relative yoo-file-flex yoopta-file"},o,{children:[h&&a("div",{className:"yoo-file-absolute yoo-file-pointer-events-none yoo-file-inset-0 yoo-file-bg-[rgba(35,131,226,0.14)] yoo-file-z-[81] yoo-file-rounded-[3px] yoo-file-opacity-100 yoo-file-transition-opacity yoo-file-duration-150 yoo-file-ease-in"}),a(S,{name:c,format:u,src:d,size:p,blockId:s}),!g&&a(At,{block:y,editor:m,props:e.props}),l]})):a(Ot,Object.assign({attributes:o,blockId:s},{children:l}))},props:{size:0,name:null,src:null,format:null,nodeType:"void"}}},options:{display:{title:"File",description:"For file videos, google maps and more"},accept:""},parsers:{}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("#yoopta-editor .yoo-file-pointer-events-none{pointer-events:none}#yoopta-editor .yoo-file-invisible{visibility:hidden}#yoopta-editor .yoo-file-absolute{position:absolute}#yoopta-editor .yoo-file-relative{position:relative}#yoopta-editor .yoo-file-inset-0{inset:0}#yoopta-editor .yoo-file-left-0{left:0}#yoopta-editor .yoo-file-top-0{top:0}#yoopta-editor .yoo-file-z-10{z-index:10}#yoopta-editor .yoo-file-z-\\[100\\]{z-index:100}#yoopta-editor .yoo-file-z-\\[81\\]{z-index:81}#yoopta-editor .yoo-file-m-\\[20px_0_10px\\]{margin:20px 0 10px}#yoopta-editor .yoo-file-mx-\\[4px\\]{margin-left:4px;margin-right:4px}#yoopta-editor .yoo-file-ml-\\[12px\\]{margin-left:12px}#yoopta-editor .yoo-file-ml-\\[6px\\]{margin-left:6px}#yoopta-editor .yoo-file-ml-\\[8px\\]{margin-left:8px}#yoopta-editor .yoo-file-mr-2{margin-right:.5rem}#yoopta-editor .yoo-file-mr-\\[12px\\]{margin-right:12px}#yoopta-editor .yoo-file-mt-4{margin-top:1rem}#yoopta-editor .yoo-file-mt-\\[4px\\]{margin-top:4px}#yoopta-editor .yoo-file-flex{display:flex}#yoopta-editor .yoo-file-inline-flex{display:inline-flex}#yoopta-editor .yoo-file-h-4{height:1rem}#yoopta-editor .yoo-file-h-\\[32px\\]{height:32px}#yoopta-editor .yoo-file-h-\\[40px\\]{height:40px}#yoopta-editor .yoo-file-h-full{height:100%}#yoopta-editor .yoo-file-max-h-\\[420px\\]{max-height:420px}#yoopta-editor .yoo-file-w-4{width:1rem}#yoopta-editor .yoo-file-w-full{width:100%}#yoopta-editor .yoo-file-min-w-0{min-width:0}#yoopta-editor .yoo-file-min-w-\\[540px\\]{min-width:540px}#yoopta-editor .yoo-file-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}#yoopta-editor .yoo-file-flex-shrink-0{flex-shrink:0}@keyframes yoo-file-spin{#yoopta-editor to{transform:rotate(1turn)}}#yoopta-editor .yoo-file-animate-spin{animation:yoo-file-spin 1s linear infinite}#yoopta-editor .yoo-file-cursor-pointer{cursor:pointer}#yoopta-editor .yoo-file-flex-col{flex-direction:column}#yoopta-editor .yoo-file-items-center{align-items:center}#yoopta-editor .yoo-file-justify-start{justify-content:flex-start}#yoopta-editor .yoo-file-justify-center{justify-content:center}#yoopta-editor .yoo-file-overflow-hidden{overflow:hidden}#yoopta-editor .yoo-file-whitespace-nowrap{white-space:nowrap}#yoopta-editor .yoo-file-rounded-\\[3px\\]{border-radius:3px}#yoopta-editor .yoo-file-rounded-\\[4px\\]{border-radius:4px}#yoopta-editor .yoo-file-rounded-sm{border-radius:.125rem}#yoopta-editor .yoo-file-border{border-width:1px}#yoopta-editor .yoo-file-border-b-\\[1px\\]{border-bottom-width:1px}#yoopta-editor .yoo-file-border-none{border-style:none}#yoopta-editor .yoo-file-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}#yoopta-editor .yoo-file-border-\\[transparent\\]{border-color:transparent}#yoopta-editor .yoo-file-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}#yoopta-editor .yoo-file-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}#yoopta-editor .yoo-file-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}#yoopta-editor .yoo-file-bg-inherit{background-color:inherit}#yoopta-editor .yoo-file-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}#yoopta-editor .yoo-file-p-\\[0_8px\\]{padding:0 8px}#yoopta-editor .yoo-file-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}#yoopta-editor .yoo-file-px-2{padding-left:.5rem;padding-right:.5rem}#yoopta-editor .yoo-file-px-\\[12px\\]{padding-left:12px;padding-right:12px}#yoopta-editor .yoo-file-px-\\[8px\\]{padding-left:8px;padding-right:8px}#yoopta-editor .yoo-file-py-1{padding-bottom:.25rem;padding-top:.25rem}#yoopta-editor .yoo-file-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#yoopta-editor .yoo-file-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}#yoopta-editor .yoo-file-py-\\[8px\\]{padding-bottom:8px;padding-top:8px}#yoopta-editor .yoo-file-pb-\\[6px\\]{padding-bottom:6px}#yoopta-editor .yoo-file-pt-\\[6px\\]{padding-top:6px}#yoopta-editor .yoo-file-text-left{text-align:left}#yoopta-editor .yoo-file-text-\\[10px\\]{font-size:10px}#yoopta-editor .yoo-file-text-\\[14px\\]{font-size:14px}#yoopta-editor .yoo-file-font-medium{font-weight:500}#yoopta-editor .yoo-file-font-normal{font-weight:400}#yoopta-editor .yoo-file-leading-\\[1\\.2\\]{line-height:1.2}#yoopta-editor .yoo-file-leading-\\[120\\%\\]{line-height:120%}#yoopta-editor .yoo-file-text-\\[\\#000000\\]{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}#yoopta-editor .yoo-file-text-\\[\\#37352fa6\\]{color:#37352fa6}#yoopta-editor .yoo-file-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}#yoopta-editor .yoo-file-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}#yoopta-editor .yoo-file-opacity-100{opacity:1}#yoopta-editor .yoo-file-shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\,_rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\,_rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px 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-file-shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px 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-file-transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-file-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-file-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-file-duration-150{transition-duration:.15s}#yoopta-editor .yoo-file-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}#yoopta-editor .yoopta-file .yoopta-extended-block-actions{opacity:0;transition:opacity .15s ease-in-out}#yoopta-editor .yoopta-file:hover .yoopta-extended-block-actions{opacity:1}#yoopta-editor .hover\\:yoo-file-border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]:hover{border-color:rgba(55,53,47,.16)}#yoopta-editor .hover\\:yoo-file-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}#yoopta-editor .hover\\:yoo-file-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}#yoopta-editor .hover\\:yoo-file-bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.04\\)\\]:hover{background-color:rgba(55,53,47,.04)}");export{Mt as default};
package/dist/types.d.ts CHANGED
@@ -11,7 +11,7 @@ export type OnUploadResponse = Partial<FileElementProps> & {
11
11
  src: string;
12
12
  };
13
13
  export type FilePluginOptions = {
14
- onUpload: (file: File) => Promise<OnUploadResponse>;
14
+ onUpload?: (file: File) => Promise<OnUploadResponse>;
15
15
  accept?: string;
16
16
  };
17
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/ui/File.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAKzB,MAAM,gBAAgB,CAAC;AAOxB,QAAA,MAAM,UAAU,+CAAgD,wBAAwB,4CAiCvF,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/ui/File.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAIzB,MAAM,gBAAgB,CAAC;AAIxB,QAAA,MAAM,UAAU,+CAAgD,wBAAwB,4CAgCvF,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,YAAY,+CAAqD,KAAK,4CAqD3E,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,YAAY,+CAAqD,KAAK,4CAmD3E,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/file",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.3",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -38,5 +38,5 @@
38
38
  "@floating-ui/react": "^0.26.9",
39
39
  "@radix-ui/react-icons": "^1.3.0"
40
40
  },
41
- "gitHead": "520057761efabc31e3d87b58a16f9ebe76e6fe22"
41
+ "gitHead": "47486295e1f53b2033ef0c859d1e4c831832b1e3"
42
42
  }