@yoopta/image 4.0.0-rc.6 → 4.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/ui/Image.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{useYooptaEditor as t,useYooptaPluginOptions as e,UI as i,useBlockData as n,useYooptaReadOnly as o,useBlockSelected as r,YooptaPlugin as s}from"@yoopta/editor";import{jsx as a,jsxs as l,Fragment as c}from"react/jsx-runtime";import*as d from"react";import{useLayoutEffect as p,useEffect as u,forwardRef as h,createElement as f,useState as g,useMemo as m}from"react";import*as x from"react-dom";import{flushSync as w,createPortal as b}from"react-dom";const v=({width:t,height:e,src:i,alt:n,fit:o,bgColor:r,layout:s="intrinsic"})=>{const l={objectFit:o||"contain",backgroundColor:r||"transparent"},c="fixed"===s,d="fill"===s,p="intrinsic"===s;return"responsive"===s&&(l.width="100%",l.height="auto"),c&&(l.width="100%",l.height="100%"),d&&(l.width="100%",l.height="100%"),p&&(l.width="100%",l.height="100%"),a("div",Object.assign({className:"w-full","data-layout":s},{children:i&&a("img",{src:i,width:t,height:e,alt:n||"",decoding:"async",loading:"lazy",style:l})}))};var y,C=(y=function(t,e){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},y(t,e)},function(t,e){function i(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),z=function(){return z=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},z.apply(this,arguments)},R={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},S={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},_={width:"20px",height:"20px",position:"absolute"},k={top:z(z({},R),{top:"-5px"}),right:z(z({},S),{left:void 0,right:"-5px"}),bottom:z(z({},R),{top:void 0,bottom:"-5px"}),left:z(z({},S),{left:"-5px"}),topRight:z(z({},_),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:z(z({},_),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:z(z({},_),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:z(z({},_),{left:"-10px",top:"-10px",cursor:"nw-resize"})},E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return C(e,t),e.prototype.render=function(){return d.createElement("div",{className:this.props.className||"",style:z(z({position:"absolute",userSelect:"none"},k[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},e}(d.PureComponent),L=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=function(){return O=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},O.apply(this,arguments)},N={width:"auto",height:"auto"},M=function(t,e,i){return Math.max(Math.min(t,i),e)},W=function(t,e){return Math.round(t/e)*e},j=function(t,e){return new RegExp(t,"i").test(e)},T=function(t){return Boolean(t.touches&&t.touches.length)},A=function(t,e,i){void 0===i&&(i=0);var n=e.reduce((function(i,n,o){return Math.abs(n-t)<Math.abs(e[i]-t)?o:i}),0),o=Math.abs(e[n]-t);return 0===i||o<i?e[n]:t},B=function(t){return"auto"===(t=t.toString())||t.endsWith("px")||t.endsWith("%")||t.endsWith("vh")||t.endsWith("vw")||t.endsWith("vmax")||t.endsWith("vmin")?t:t+"px"},H=function(t,e,i,n){if(t&&"string"==typeof t){if(t.endsWith("px"))return Number(t.replace("px",""));if(t.endsWith("%"))return e*(Number(t.replace("%",""))/100);if(t.endsWith("vw"))return i*(Number(t.replace("vw",""))/100);if(t.endsWith("vh"))return n*(Number(t.replace("vh",""))/100)}return t},P=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],I="__resizable_base__",D=function(t){function e(e){var i=t.call(this,e)||this;return i.ratio=1,i.resizable=null,i.parentLeft=0,i.parentTop=0,i.resizableLeft=0,i.resizableRight=0,i.resizableTop=0,i.resizableBottom=0,i.targetLeft=0,i.targetTop=0,i.appendBase=function(){if(!i.resizable||!i.window)return null;var t=i.parentNode;if(!t)return null;var e=i.window.document.createElement("div");return e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.transform="scale(0, 0)",e.style.left="0",e.style.flex="0 0 100%",e.classList?e.classList.add(I):e.className+=I,t.appendChild(e),e},i.removeBase=function(t){var e=i.parentNode;e&&e.removeChild(t)},i.ref=function(t){t&&(i.resizable=t)},i.state={isResizing:!1,width:void 0===(i.propsSize&&i.propsSize.width)?"auto":i.propsSize&&i.propsSize.width,height:void 0===(i.propsSize&&i.propsSize.height)?"auto":i.propsSize&&i.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},i.onResizeStart=i.onResizeStart.bind(i),i.onMouseMove=i.onMouseMove.bind(i),i.onMouseUp=i.onMouseUp.bind(i),i}return L(e,t),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||N},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var t=0,e=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,n=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),t="auto"!==this.resizable.style.width?this.resizable.offsetWidth:i,e="auto"!==this.resizable.style.height?this.resizable.offsetHeight:n,this.resizable.style.position=o}return{width:t,height:e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sizeStyle",{get:function(){var t=this,e=this.props.size,i=function(e){if(void 0===t.state[e]||"auto"===t.state[e])return"auto";if(t.propsSize&&t.propsSize[e]&&t.propsSize[e].toString().endsWith("%")){if(t.state[e].toString().endsWith("%"))return t.state[e].toString();var i=t.getParentSize();return Number(t.state[e].toString().replace("px",""))/i[e]*100+"%"}return B(t.state[e])};return{width:e&&void 0!==e.width&&!this.state.isResizing?B(e.width):i("width"),height:e&&void 0!==e.height&&!this.state.isResizing?B(e.height):i("height")}},enumerable:!1,configurable:!0}),e.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var e=!1,i=this.parentNode.style.flexWrap;"wrap"!==i&&(e=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var n={width:t.offsetWidth,height:t.offsetHeight};return e&&(this.parentNode.style.flexWrap=i),this.removeBase(t),n},e.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},e.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},e.prototype.componentDidMount=function(){if(this.resizable&&this.window){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==t.flexBasis?t.flexBasis:void 0})}},e.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},e.prototype.createSizeForCssProperty=function(t,e){var i=this.propsSize&&this.propsSize[e];return"auto"!==this.state[e]||this.state.original[e]!==t||void 0!==i&&"auto"!==i?t:"auto"},e.prototype.calculateNewMaxFromBoundary=function(t,e){var i,n,o=this.props.boundsByDirection,r=this.state.direction,s=o&&j("left",r),a=o&&j("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(i=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),n=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(i=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,n=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(i=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),n=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return i&&Number.isFinite(i)&&(t=t&&t<i?t:i),n&&Number.isFinite(n)&&(e=e&&e<n?e:n),{maxWidth:t,maxHeight:e}},e.prototype.calculateNewSizeFromDirection=function(t,e){var i=this.props.scale||1,n=this.props.resizeRatio||1,o=this.state,r=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,d=a.lockAspectRatioExtraWidth,p=s.width,u=s.height,h=c||0,f=d||0;return j("right",r)&&(p=s.width+(t-s.x)*n/i,l&&(u=(p-f)/this.ratio+h)),j("left",r)&&(p=s.width-(t-s.x)*n/i,l&&(u=(p-f)/this.ratio+h)),j("bottom",r)&&(u=s.height+(e-s.y)*n/i,l&&(p=(u-h)*this.ratio+f)),j("top",r)&&(u=s.height-(e-s.y)*n/i,l&&(p=(u-h)*this.ratio+f)),{newWidth:p,newHeight:u}},e.prototype.calculateNewSizeFromAspectRatio=function(t,e,i,n){var o=this.props,r=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===n.width?10:n.width,c=void 0===i.width||i.width<0?t:i.width,d=void 0===n.height?10:n.height,p=void 0===i.height||i.height<0?e:i.height,u=s||0,h=a||0;if(r){var f=(d-u)*this.ratio+h,g=(p-u)*this.ratio+h,m=(l-h)/this.ratio+u,x=(c-h)/this.ratio+u,w=Math.max(l,f),b=Math.min(c,g),v=Math.max(d,m),y=Math.min(p,x);t=M(t,w,b),e=M(e,v,y)}else t=M(t,l,c),e=M(e,d,p);return{newWidth:t,newHeight:e}},e.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var t=this.parentNode;if(t){var e=t.getBoundingClientRect();this.parentLeft=e.left,this.parentTop=e.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var n=this.resizable.getBoundingClientRect(),o=n.left,r=n.top,s=n.right,a=n.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=a}},e.prototype.onResizeStart=function(t,e){if(this.resizable&&this.window){var i,n=0,o=0;if(t.nativeEvent&&function(t){return Boolean((t.clientX||0===t.clientX)&&(t.clientY||0===t.clientY))}(t.nativeEvent)?(n=t.nativeEvent.clientX,o=t.nativeEvent.clientY):t.nativeEvent&&T(t.nativeEvent)&&(n=t.nativeEvent.touches[0].clientX,o=t.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(t,e,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",i=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:n,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:O(O({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:e,flexBasis:i};this.setState(l)}},e.prototype.onMouseMove=function(t){var e=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&T(t))try{t.preventDefault(),t.stopPropagation()}catch(t){}var i=this.props,n=i.maxWidth,o=i.maxHeight,r=i.minWidth,s=i.minHeight,a=T(t)?t.touches[0].clientX:t.clientX,l=T(t)?t.touches[0].clientY:t.clientY,c=this.state,d=c.direction,p=c.original,u=c.width,h=c.height,f=this.getParentSize(),g=function(t,e,i,n,o,r,s){return n=H(n,t.width,e,i),o=H(o,t.height,e,i),r=H(r,t.width,e,i),s=H(s,t.height,e,i),{maxWidth:void 0===n?void 0:Number(n),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,n,o,r,s);n=g.maxWidth,o=g.maxHeight,r=g.minWidth,s=g.minHeight;var m=this.calculateNewSizeFromDirection(a,l),x=m.newHeight,b=m.newWidth,v=this.calculateNewMaxFromBoundary(n,o);this.props.snap&&this.props.snap.x&&(b=A(b,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=A(x,this.props.snap.y,this.props.snapGap));var y=this.calculateNewSizeFromAspectRatio(b,x,{width:v.maxWidth,height:v.maxHeight},{width:r,height:s});if(b=y.newWidth,x=y.newHeight,this.props.grid){var C=W(b,this.props.grid[0]),z=W(x,this.props.grid[1]),R=this.props.snapGap||0;b=0===R||Math.abs(C-b)<=R?C:b,x=0===R||Math.abs(z-x)<=R?z:x}var S={width:b-p.width,height:x-p.height};if(u&&"string"==typeof u)if(u.endsWith("%"))b=b/f.width*100+"%";else if(u.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))x=x/f.height*100+"%";else if(h.endsWith("vw")){x=x/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){x=x/this.window.innerHeight*100+"vh"}var _={width:this.createSizeForCssProperty(b,"width"),height:this.createSizeForCssProperty(x,"height")};"row"===this.flexDir?_.flexBasis=_.width:"column"===this.flexDir&&(_.flexBasis=_.height),w((function(){e.setState(_)})),this.props.onResize&&this.props.onResize(t,d,this.resizable,S)}},e.prototype.onMouseUp=function(t){var e=this.state,i=e.isResizing,n=e.direction,o=e.original;if(i&&this.resizable){var r={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(t,n,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:O(O({},this.state.backgroundStyle),{cursor:"auto"})})}},e.prototype.updateSize=function(t){this.setState({width:t.width,height:t.height})},e.prototype.renderResizer=function(){var t=this,e=this.props,i=e.enable,n=e.handleStyles,o=e.handleClasses,r=e.handleWrapperStyle,s=e.handleWrapperClass,a=e.handleComponent;if(!i)return null;var l=Object.keys(i).map((function(e){return!1!==i[e]?d.createElement(E,{key:e,direction:e,onResizeStart:t.onResizeStart,replaceStyles:n&&n[e],className:o&&o[e]},a&&a[e]?a[e]:null):null}));return d.createElement("div",{className:s,style:r},l)},e.prototype.render=function(){var t=this,e=Object.keys(this.props).reduce((function(e,i){return-1!==P.indexOf(i)||(e[i]=t.props[i]),e}),{}),i=O(O(O({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var n=this.props.as||"div";return d.createElement(n,O({ref:this.ref,style:i,className:this.props.className},e),this.state.isResizing&&d.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},e.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},e}(d.PureComponent);function F(t){return Z(t)?(t.nodeName||"").toLowerCase():"#document"}function V(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function U(t){var e;return null==(e=(Z(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Z(t){return t instanceof Node||t instanceof V(t).Node}function X(t){return t instanceof Element||t instanceof V(t).Element}function Y(t){return t instanceof HTMLElement||t instanceof V(t).HTMLElement}function G(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof V(t).ShadowRoot)}function $(t){const{overflow:e,overflowX:i,overflowY:n,display:o}=tt(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&!["inline","contents"].includes(o)}function q(t){return["table","td","th"].includes(F(t))}function J(t){const e=K(),i=tt(t);return"none"!==i.transform||"none"!==i.perspective||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function K(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Q(t){return["html","body","#document"].includes(F(t))}function tt(t){return V(t).getComputedStyle(t)}function et(t){return X(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function it(t){if("html"===F(t))return t;const e=t.assignedSlot||t.parentNode||G(t)&&t.host||U(t);return G(e)?e.host:e}function nt(t){const e=it(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:Y(e)&&$(e)?e:nt(e)}function ot(t,e,i){var n;void 0===e&&(e=[]),void 0===i&&(i=!0);const o=nt(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),s=V(o);return r?e.concat(s,s.visualViewport||[],$(o)?o:[],s.frameElement&&i?ot(s.frameElement):[]):e.concat(o,ot(o,[],i))}const rt=Math.min,st=Math.max,at=Math.round,lt=t=>({x:t,y:t}),ct={left:"right",right:"left",bottom:"top",top:"bottom"},dt={start:"end",end:"start"};function pt(t,e,i){return st(t,rt(e,i))}function ut(t,e){return"function"==typeof t?t(e):t}function ht(t){return t.split("-")[0]}function ft(t){return t.split("-")[1]}function gt(t){return"x"===t?"y":"x"}function mt(t){return"y"===t?"height":"width"}function xt(t){return["top","bottom"].includes(ht(t))?"y":"x"}function wt(t){return gt(xt(t))}function bt(t){return t.replace(/start|end/g,(t=>dt[t]))}function vt(t){return t.replace(/left|right|bottom|top/g,(t=>ct[t]))}function yt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Ct(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function zt(t,e,i){let{reference:n,floating:o}=t;const r=xt(e),s=wt(e),a=mt(s),l=ht(e),c="y"===r,d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,u=n[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:n.y-o.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(ft(e)){case"start":h[s]-=u*(i&&c?-1:1);break;case"end":h[s]+=u*(i&&c?-1:1)}return h}async function Rt(t,e){var i;void 0===e&&(e={});const{x:n,y:o,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=ut(e,t),f=yt(h),g=a[u?"floating"===p?"reference":"floating":p],m=Ct(await r.getClippingRect({element:null==(i=await(null==r.isElement?void 0:r.isElement(g)))||i?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x="floating"===p?{...s.floating,x:n,y:o}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=Ct(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(m.top-v.top+f.top)/b.y,bottom:(v.bottom-m.bottom+f.bottom)/b.y,left:(m.left-v.left+f.left)/b.x,right:(v.right-m.right+f.right)/b.x}}function St(t){const e=rt(...t.map((t=>t.left))),i=rt(...t.map((t=>t.top)));return{x:e,y:i,width:st(...t.map((t=>t.right)))-e,height:st(...t.map((t=>t.bottom)))-i}}const _t=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,n;const{x:o,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:n,elements:o}=t,r=await(null==n.isRTL?void 0:n.isRTL(o.floating)),s=ht(i),a=ft(i),l="y"===xt(i),c=["left","top"].includes(s)?-1:1,d=r&&l?-1:1,p=ut(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&"number"==typeof f&&(h="end"===a?-1*f:f),l?{x:h*d,y:u*c}:{x:u*c,y:h*d}}(e,t);return s===(null==(i=a.offset)?void 0:i.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}};function kt(t){const e=tt(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=Y(t),r=o?t.offsetWidth:i,s=o?t.offsetHeight:n,a=at(i)!==r||at(n)!==s;return a&&(i=r,n=s),{width:i,height:n,$:a}}function Et(t){return X(t)?t:t.contextElement}function Lt(t){const e=Et(t);if(!Y(e))return lt(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:r}=kt(e);let s=(r?at(i.width):i.width)/n,a=(r?at(i.height):i.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Ot=lt(0);function Nt(t){const e=V(t);return K()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ot}function Mt(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1);const o=t.getBoundingClientRect(),r=Et(t);let s=lt(1);e&&(n?X(n)&&(s=Lt(n)):s=Lt(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==V(t))&&e}(r,i,n)?Nt(r):lt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(r){const t=V(r),e=n&&X(n)?V(n):n;let i=t,o=i.frameElement;for(;o&&n&&e!==i;){const t=Lt(o),e=o.getBoundingClientRect(),n=tt(o),r=e.left+(o.clientLeft+parseFloat(n.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(n.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,p*=t.y,l+=r,c+=s,i=V(o),o=i.frameElement}}return Ct({width:d,height:p,x:l,y:c})}const Wt=[":popover-open",":modal"];function jt(t){return Wt.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function Tt(t){return Mt(U(t)).left+et(t).scrollLeft}function At(t,e,i){let n;if("viewport"===e)n=function(t,e){const i=V(t),n=U(t),o=i.visualViewport;let r=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=K();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a,y:l}}(t,i);else if("document"===e)n=function(t){const e=U(t),i=et(t),n=t.ownerDocument.body,o=st(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=st(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-i.scrollLeft+Tt(t);const a=-i.scrollTop;return"rtl"===tt(n).direction&&(s+=st(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:a}}(U(t));else if(X(e))n=function(t,e){const i=Mt(t,!0,"fixed"===e),n=i.top+t.clientTop,o=i.left+t.clientLeft,r=Y(t)?Lt(t):lt(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:n*r.y}}(e,i);else{const i=Nt(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Ct(n)}function Bt(t,e){const i=it(t);return!(i===e||!X(i)||Q(i))&&("fixed"===tt(i).position||Bt(i,e))}function Ht(t,e,i){const n=Y(e),o=U(e),r="fixed"===i,s=Mt(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=lt(0);if(n||!n&&!r)if(("body"!==F(e)||$(o))&&(a=et(e)),n){const t=Mt(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&(l.x=Tt(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Pt(t,e){return Y(t)&&"fixed"!==tt(t).position?e?e(t):t.offsetParent:null}function It(t,e){const i=V(t);if(!Y(t)||jt(t))return i;let n=Pt(t,e);for(;n&&q(n)&&"static"===tt(n).position;)n=Pt(n,e);return n&&("html"===F(n)||"body"===F(n)&&"static"===tt(n).position&&!J(n))?i:n||function(t){let e=it(t);for(;Y(e)&&!Q(e);){if(J(e))return e;e=it(e)}return null}(t)||i}const Dt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const r="fixed"===o,s=U(n),a=!!e&&jt(e.floating);if(n===s||a&&r)return i;let l={scrollLeft:0,scrollTop:0},c=lt(1);const d=lt(0),p=Y(n);if((p||!p&&!r)&&(("body"!==F(n)||$(s))&&(l=et(n)),Y(n))){const t=Mt(n);c=Lt(n),d.x=t.x+n.clientLeft,d.y=t.y+n.clientTop}return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x,y:i.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:U,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const r=[..."clippingAncestors"===i?function(t,e){const i=e.get(t);if(i)return i;let n=ot(t,[],!1).filter((t=>X(t)&&"body"!==F(t))),o=null;const r="fixed"===tt(t).position;let s=r?it(t):t;for(;X(s)&&!Q(s);){const e=tt(s),i=J(s);i||"fixed"!==e.position||(o=null),(r?!i&&!o:!i&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||$(s)&&!i&&Bt(t,s))?n=n.filter((t=>t!==s)):o=e,s=it(s)}return e.set(t,n),n}(e,this._c):[].concat(i),n],s=r[0],a=r.reduce(((t,i)=>{const n=At(e,i,o);return t.top=st(n.top,t.top),t.right=rt(n.right,t.right),t.bottom=rt(n.bottom,t.bottom),t.left=st(n.left,t.left),t}),At(e,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:It,getElementRects:async function(t){const e=this.getOffsetParent||It,i=this.getDimensions;return{reference:Ht(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await i(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=kt(t);return{width:e,height:i}},getScale:Lt,isElement:X,isRTL:function(t){return"rtl"===tt(t).direction}},Ft=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:n,placement:o}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=ut(t,e),c={x:i,y:n},d=await Rt(e,l),p=xt(ht(o)),u=gt(p);let h=c[u],f=c[p];if(r){const t="y"===u?"bottom":"right";h=pt(h+d["y"===u?"top":"left"],h,h-d[t])}if(s){const t="y"===p?"bottom":"right";f=pt(f+d["y"===p?"top":"left"],f,f-d[t])}const g=a.fn({...e,[u]:h,[p]:f});return{...g,data:{x:g.x-i,y:g.y-n}}}}},Vt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,n;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=ut(t,e);if(null!=(i=r.arrow)&&i.alignmentOffset)return{};const x=ht(o),w=ht(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),v=u||(w||!g?[vt(a)]:function(t){const e=vt(t);return[bt(t),e,bt(e)]}(a));u||"none"===f||v.push(...function(t,e,i,n){const o=ft(t);let r=function(t,e,i){const n=["left","right"],o=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return i?e?o:n:e?n:o;case"left":case"right":return e?r:s;default:return[]}}(ht(t),"start"===i,n);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(bt)))),r}(a,g,f,b));const y=[a,...v],C=await Rt(e,m),z=[];let R=(null==(n=r.flip)?void 0:n.overflows)||[];if(d&&z.push(C[x]),p){const t=function(t,e,i){void 0===i&&(i=!1);const n=ft(t),o=wt(t),r=mt(o);let s="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=vt(s)),[s,vt(s)]}(o,s,b);z.push(C[t[0]],C[t[1]])}if(R=[...R,{placement:o,overflows:z}],!z.every((t=>t<=0))){var S,_;const t=((null==(S=r.flip)?void 0:S.index)||0)+1,e=y[t];if(e)return{data:{index:t,overflows:R},reset:{placement:e}};let i=null==(_=R.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:_.placement;if(!i)switch(h){case"bestFit":{var k;const t=null==(k=R.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(i=t);break}case"initialPlacement":i=a}if(o!==i)return{reset:{placement:i}}}return{}}}},Ut=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:i,elements:n,rects:o,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=ut(t,e),d=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(n.reference))||[]),p=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),i=[];let n=null;for(let t=0;t<e.length;t++){const o=e[t];!n||o.y-n.y>n.height/2?i.push([o]):i[i.length-1].push(o),n=o}return i.map((t=>Ct(St(t))))}(d),u=Ct(St(d)),h=yt(a);const f=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=c)return p.find((t=>l>t.left-h.left&&l<t.right+h.right&&c>t.top-h.top&&c<t.bottom+h.bottom))||u;if(p.length>=2){if("y"===xt(i)){const t=p[0],e=p[p.length-1],n="top"===ht(i),o=t.top,r=e.bottom,s=n?t.left:e.left,a=n?t.right:e.right;return{top:o,bottom:r,left:s,right:a,width:a-s,height:r-o,x:s,y:o}}const t="left"===ht(i),e=st(...p.map((t=>t.right))),n=rt(...p.map((t=>t.left))),o=p.filter((i=>t?i.left===n:i.right===e)),r=o[0].top,s=o[o.length-1].bottom;return{top:r,bottom:s,left:n,right:e,width:e-n,height:s-r,x:n,y:r}}return u}},floating:n.floating,strategy:s});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Zt=(t,e,i)=>{const n=new Map,o={platform:Dt,...i},r={...o.platform,_c:n};return(async(t,e,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=i,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:p}=zt(c,n,l),u=n,h={},f=0;for(let i=0;i<a.length;i++){const{name:r,fn:g}=a[i],{x:m,y:x,data:w,reset:b}=await g({x:d,y:p,initialPlacement:n,placement:u,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});d=null!=m?m:d,p=null!=x?x:p,h={...h,[r]:{...h[r],...w}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):b.rects),({x:d,y:p}=zt(c,u,l))),i=-1)}return{x:d,y:p,placement:u,strategy:o,middlewareData:h}})(t,e,{...o,platform:r})};var Xt="undefined"!=typeof document?p:u;function Yt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let i,n,o;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(i=t.length,i!==e.length)return!1;for(n=i;0!=n--;)if(!Yt(t[n],e[n]))return!1;return!0}if(o=Object.keys(t),i=o.length,i!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!{}.hasOwnProperty.call(e,o[n]))return!1;for(n=i;0!=n--;){const i=o[n];if(("_owner"!==i||!t.$$typeof)&&!Yt(t[i],e[i]))return!1}return!0}return t!=t&&e!=e}function Gt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $t(t,e){const i=Gt(t);return Math.round(e*i)/i}function qt(t){const e=d.useRef(t);return Xt((()=>{e.current=t})),e}
|
|
1
|
+
import{useYooptaEditor as t,useYooptaPluginOptions as e,UI as i,useBlockData as n,useYooptaReadOnly as o,useBlockSelected as r,YooptaPlugin as s,generateId as a}from"@yoopta/editor";import{jsx as l,jsxs as c,Fragment as d}from"react/jsx-runtime";import*as p from"react";import{useLayoutEffect as u,useEffect as h,forwardRef as f,createElement as g,useState as m,useMemo as x}from"react";import*as w from"react-dom";import{flushSync as b,createPortal as v}from"react-dom";const y=({width:t,height:e,src:i,alt:n,fit:o,bgColor:r,layout:s="intrinsic"})=>{const a={objectFit:o||"contain",backgroundColor:r||"transparent"},c="fixed"===s,d="fill"===s,p="intrinsic"===s;return"responsive"===s&&(a.width="100%",a.height="auto"),c&&(a.width="100%",a.height="100%"),d&&(a.width="100%",a.height="100%"),p&&(a.width="100%",a.height="100%"),l("div",Object.assign({className:"w-full","data-layout":s},{children:i&&l("img",{src:i,width:t,height:e,alt:n||"",decoding:"async",loading:"lazy",style:a})}))};var C,z=(C=function(t,e){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},C(t,e)},function(t,e){function i(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),R=function(){return R=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},R.apply(this,arguments)},S={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},_={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},k={width:"20px",height:"20px",position:"absolute"},E={top:R(R({},S),{top:"-5px"}),right:R(R({},_),{left:void 0,right:"-5px"}),bottom:R(R({},S),{top:void 0,bottom:"-5px"}),left:R(R({},_),{left:"-5px"}),topRight:R(R({},k),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:R(R({},k),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:R(R({},k),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:R(R({},k),{left:"-10px",top:"-10px",cursor:"nw-resize"})},L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return z(e,t),e.prototype.render=function(){return p.createElement("div",{className:this.props.className||"",style:R(R({position:"absolute",userSelect:"none"},E[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},e}(p.PureComponent),N=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=function(){return O=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},O.apply(this,arguments)},M={width:"auto",height:"auto"},W=function(t,e,i){return Math.max(Math.min(t,i),e)},j=function(t,e){return Math.round(t/e)*e},A=function(t,e){return new RegExp(t,"i").test(e)},T=function(t){return Boolean(t.touches&&t.touches.length)},B=function(t,e,i){void 0===i&&(i=0);var n=e.reduce((function(i,n,o){return Math.abs(n-t)<Math.abs(e[i]-t)?o:i}),0),o=Math.abs(e[n]-t);return 0===i||o<i?e[n]:t},H=function(t){return"auto"===(t=t.toString())||t.endsWith("px")||t.endsWith("%")||t.endsWith("vh")||t.endsWith("vw")||t.endsWith("vmax")||t.endsWith("vmin")?t:t+"px"},P=function(t,e,i,n){if(t&&"string"==typeof t){if(t.endsWith("px"))return Number(t.replace("px",""));if(t.endsWith("%"))return e*(Number(t.replace("%",""))/100);if(t.endsWith("vw"))return i*(Number(t.replace("vw",""))/100);if(t.endsWith("vh"))return n*(Number(t.replace("vh",""))/100)}return t},I=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],D="__resizable_base__",F=function(t){function e(e){var i=t.call(this,e)||this;return i.ratio=1,i.resizable=null,i.parentLeft=0,i.parentTop=0,i.resizableLeft=0,i.resizableRight=0,i.resizableTop=0,i.resizableBottom=0,i.targetLeft=0,i.targetTop=0,i.appendBase=function(){if(!i.resizable||!i.window)return null;var t=i.parentNode;if(!t)return null;var e=i.window.document.createElement("div");return e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.transform="scale(0, 0)",e.style.left="0",e.style.flex="0 0 100%",e.classList?e.classList.add(D):e.className+=D,t.appendChild(e),e},i.removeBase=function(t){var e=i.parentNode;e&&e.removeChild(t)},i.ref=function(t){t&&(i.resizable=t)},i.state={isResizing:!1,width:void 0===(i.propsSize&&i.propsSize.width)?"auto":i.propsSize&&i.propsSize.width,height:void 0===(i.propsSize&&i.propsSize.height)?"auto":i.propsSize&&i.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},i.onResizeStart=i.onResizeStart.bind(i),i.onMouseMove=i.onMouseMove.bind(i),i.onMouseUp=i.onMouseUp.bind(i),i}return N(e,t),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||M},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var t=0,e=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,n=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),t="auto"!==this.resizable.style.width?this.resizable.offsetWidth:i,e="auto"!==this.resizable.style.height?this.resizable.offsetHeight:n,this.resizable.style.position=o}return{width:t,height:e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sizeStyle",{get:function(){var t=this,e=this.props.size,i=function(e){if(void 0===t.state[e]||"auto"===t.state[e])return"auto";if(t.propsSize&&t.propsSize[e]&&t.propsSize[e].toString().endsWith("%")){if(t.state[e].toString().endsWith("%"))return t.state[e].toString();var i=t.getParentSize();return Number(t.state[e].toString().replace("px",""))/i[e]*100+"%"}return H(t.state[e])};return{width:e&&void 0!==e.width&&!this.state.isResizing?H(e.width):i("width"),height:e&&void 0!==e.height&&!this.state.isResizing?H(e.height):i("height")}},enumerable:!1,configurable:!0}),e.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var e=!1,i=this.parentNode.style.flexWrap;"wrap"!==i&&(e=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var n={width:t.offsetWidth,height:t.offsetHeight};return e&&(this.parentNode.style.flexWrap=i),this.removeBase(t),n},e.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},e.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},e.prototype.componentDidMount=function(){if(this.resizable&&this.window){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==t.flexBasis?t.flexBasis:void 0})}},e.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},e.prototype.createSizeForCssProperty=function(t,e){var i=this.propsSize&&this.propsSize[e];return"auto"!==this.state[e]||this.state.original[e]!==t||void 0!==i&&"auto"!==i?t:"auto"},e.prototype.calculateNewMaxFromBoundary=function(t,e){var i,n,o=this.props.boundsByDirection,r=this.state.direction,s=o&&A("left",r),a=o&&A("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(i=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),n=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(i=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,n=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(i=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),n=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return i&&Number.isFinite(i)&&(t=t&&t<i?t:i),n&&Number.isFinite(n)&&(e=e&&e<n?e:n),{maxWidth:t,maxHeight:e}},e.prototype.calculateNewSizeFromDirection=function(t,e){var i=this.props.scale||1,n=this.props.resizeRatio||1,o=this.state,r=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,d=a.lockAspectRatioExtraWidth,p=s.width,u=s.height,h=c||0,f=d||0;return A("right",r)&&(p=s.width+(t-s.x)*n/i,l&&(u=(p-f)/this.ratio+h)),A("left",r)&&(p=s.width-(t-s.x)*n/i,l&&(u=(p-f)/this.ratio+h)),A("bottom",r)&&(u=s.height+(e-s.y)*n/i,l&&(p=(u-h)*this.ratio+f)),A("top",r)&&(u=s.height-(e-s.y)*n/i,l&&(p=(u-h)*this.ratio+f)),{newWidth:p,newHeight:u}},e.prototype.calculateNewSizeFromAspectRatio=function(t,e,i,n){var o=this.props,r=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===n.width?10:n.width,c=void 0===i.width||i.width<0?t:i.width,d=void 0===n.height?10:n.height,p=void 0===i.height||i.height<0?e:i.height,u=s||0,h=a||0;if(r){var f=(d-u)*this.ratio+h,g=(p-u)*this.ratio+h,m=(l-h)/this.ratio+u,x=(c-h)/this.ratio+u,w=Math.max(l,f),b=Math.min(c,g),v=Math.max(d,m),y=Math.min(p,x);t=W(t,w,b),e=W(e,v,y)}else t=W(t,l,c),e=W(e,d,p);return{newWidth:t,newHeight:e}},e.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var t=this.parentNode;if(t){var e=t.getBoundingClientRect();this.parentLeft=e.left,this.parentTop=e.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var n=this.resizable.getBoundingClientRect(),o=n.left,r=n.top,s=n.right,a=n.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=a}},e.prototype.onResizeStart=function(t,e){if(this.resizable&&this.window){var i,n=0,o=0;if(t.nativeEvent&&function(t){return Boolean((t.clientX||0===t.clientX)&&(t.clientY||0===t.clientY))}(t.nativeEvent)?(n=t.nativeEvent.clientX,o=t.nativeEvent.clientY):t.nativeEvent&&T(t.nativeEvent)&&(n=t.nativeEvent.touches[0].clientX,o=t.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(t,e,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",i=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:n,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:O(O({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:e,flexBasis:i};this.setState(l)}},e.prototype.onMouseMove=function(t){var e=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&T(t))try{t.preventDefault(),t.stopPropagation()}catch(t){}var i=this.props,n=i.maxWidth,o=i.maxHeight,r=i.minWidth,s=i.minHeight,a=T(t)?t.touches[0].clientX:t.clientX,l=T(t)?t.touches[0].clientY:t.clientY,c=this.state,d=c.direction,p=c.original,u=c.width,h=c.height,f=this.getParentSize(),g=function(t,e,i,n,o,r,s){return n=P(n,t.width,e,i),o=P(o,t.height,e,i),r=P(r,t.width,e,i),s=P(s,t.height,e,i),{maxWidth:void 0===n?void 0:Number(n),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,n,o,r,s);n=g.maxWidth,o=g.maxHeight,r=g.minWidth,s=g.minHeight;var m=this.calculateNewSizeFromDirection(a,l),x=m.newHeight,w=m.newWidth,v=this.calculateNewMaxFromBoundary(n,o);this.props.snap&&this.props.snap.x&&(w=B(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=B(x,this.props.snap.y,this.props.snapGap));var y=this.calculateNewSizeFromAspectRatio(w,x,{width:v.maxWidth,height:v.maxHeight},{width:r,height:s});if(w=y.newWidth,x=y.newHeight,this.props.grid){var C=j(w,this.props.grid[0]),z=j(x,this.props.grid[1]),R=this.props.snapGap||0;w=0===R||Math.abs(C-w)<=R?C:w,x=0===R||Math.abs(z-x)<=R?z:x}var S={width:w-p.width,height:x-p.height};if(u&&"string"==typeof u)if(u.endsWith("%"))w=w/f.width*100+"%";else if(u.endsWith("vw")){w=w/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){w=w/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))x=x/f.height*100+"%";else if(h.endsWith("vw")){x=x/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){x=x/this.window.innerHeight*100+"vh"}var _={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(x,"height")};"row"===this.flexDir?_.flexBasis=_.width:"column"===this.flexDir&&(_.flexBasis=_.height),b((function(){e.setState(_)})),this.props.onResize&&this.props.onResize(t,d,this.resizable,S)}},e.prototype.onMouseUp=function(t){var e=this.state,i=e.isResizing,n=e.direction,o=e.original;if(i&&this.resizable){var r={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(t,n,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:O(O({},this.state.backgroundStyle),{cursor:"auto"})})}},e.prototype.updateSize=function(t){this.setState({width:t.width,height:t.height})},e.prototype.renderResizer=function(){var t=this,e=this.props,i=e.enable,n=e.handleStyles,o=e.handleClasses,r=e.handleWrapperStyle,s=e.handleWrapperClass,a=e.handleComponent;if(!i)return null;var l=Object.keys(i).map((function(e){return!1!==i[e]?p.createElement(L,{key:e,direction:e,onResizeStart:t.onResizeStart,replaceStyles:n&&n[e],className:o&&o[e]},a&&a[e]?a[e]:null):null}));return p.createElement("div",{className:s,style:r},l)},e.prototype.render=function(){var t=this,e=Object.keys(this.props).reduce((function(e,i){return-1!==I.indexOf(i)||(e[i]=t.props[i]),e}),{}),i=O(O(O({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var n=this.props.as||"div";return p.createElement(n,O({ref:this.ref,style:i,className:this.props.className},e),this.state.isResizing&&p.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},e.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},e}(p.PureComponent);function V(t){return X(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Z(t){var e;return null==(e=(X(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function X(t){return t instanceof Node||t instanceof U(t).Node}function Y(t){return t instanceof Element||t instanceof U(t).Element}function G(t){return t instanceof HTMLElement||t instanceof U(t).HTMLElement}function $(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}function q(t){const{overflow:e,overflowX:i,overflowY:n,display:o}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&!["inline","contents"].includes(o)}function J(t){return["table","td","th"].includes(V(t))}function K(t){const e=Q(),i=et(t);return"none"!==i.transform||"none"!==i.perspective||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function Q(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function tt(t){return["html","body","#document"].includes(V(t))}function et(t){return U(t).getComputedStyle(t)}function it(t){return Y(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function nt(t){if("html"===V(t))return t;const e=t.assignedSlot||t.parentNode||$(t)&&t.host||Z(t);return $(e)?e.host:e}function ot(t){const e=nt(t);return tt(e)?t.ownerDocument?t.ownerDocument.body:t.body:G(e)&&q(e)?e:ot(e)}function rt(t,e,i){var n;void 0===e&&(e=[]),void 0===i&&(i=!0);const o=ot(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),s=U(o);return r?e.concat(s,s.visualViewport||[],q(o)?o:[],s.frameElement&&i?rt(s.frameElement):[]):e.concat(o,rt(o,[],i))}const st=Math.min,at=Math.max,lt=Math.round,ct=t=>({x:t,y:t}),dt={left:"right",right:"left",bottom:"top",top:"bottom"},pt={start:"end",end:"start"};function ut(t,e,i){return at(t,st(e,i))}function ht(t,e){return"function"==typeof t?t(e):t}function ft(t){return t.split("-")[0]}function gt(t){return t.split("-")[1]}function mt(t){return"x"===t?"y":"x"}function xt(t){return"y"===t?"height":"width"}function wt(t){return["top","bottom"].includes(ft(t))?"y":"x"}function bt(t){return mt(wt(t))}function vt(t){return t.replace(/start|end/g,(t=>pt[t]))}function yt(t){return t.replace(/left|right|bottom|top/g,(t=>dt[t]))}function Ct(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function zt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Rt(t,e,i){let{reference:n,floating:o}=t;const r=wt(e),s=bt(e),a=xt(s),l=ft(e),c="y"===r,d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,u=n[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:n.y-o.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(gt(e)){case"start":h[s]-=u*(i&&c?-1:1);break;case"end":h[s]+=u*(i&&c?-1:1)}return h}async function St(t,e){var i;void 0===e&&(e={});const{x:n,y:o,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=ht(e,t),f=Ct(h),g=a[u?"floating"===p?"reference":"floating":p],m=zt(await r.getClippingRect({element:null==(i=await(null==r.isElement?void 0:r.isElement(g)))||i?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x="floating"===p?{...s.floating,x:n,y:o}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=zt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(m.top-v.top+f.top)/b.y,bottom:(v.bottom-m.bottom+f.bottom)/b.y,left:(m.left-v.left+f.left)/b.x,right:(v.right-m.right+f.right)/b.x}}function _t(t){const e=st(...t.map((t=>t.left))),i=st(...t.map((t=>t.top)));return{x:e,y:i,width:at(...t.map((t=>t.right)))-e,height:at(...t.map((t=>t.bottom)))-i}}const kt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,n;const{x:o,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:n,elements:o}=t,r=await(null==n.isRTL?void 0:n.isRTL(o.floating)),s=ft(i),a=gt(i),l="y"===wt(i),c=["left","top"].includes(s)?-1:1,d=r&&l?-1:1,p=ht(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&"number"==typeof f&&(h="end"===a?-1*f:f),l?{x:h*d,y:u*c}:{x:u*c,y:h*d}}(e,t);return s===(null==(i=a.offset)?void 0:i.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}};function Et(t){const e=et(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=G(t),r=o?t.offsetWidth:i,s=o?t.offsetHeight:n,a=lt(i)!==r||lt(n)!==s;return a&&(i=r,n=s),{width:i,height:n,$:a}}function Lt(t){return Y(t)?t:t.contextElement}function Nt(t){const e=Lt(t);if(!G(e))return ct(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:r}=Et(e);let s=(r?lt(i.width):i.width)/n,a=(r?lt(i.height):i.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Ot=ct(0);function Mt(t){const e=U(t);return Q()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ot}function Wt(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1);const o=t.getBoundingClientRect(),r=Lt(t);let s=ct(1);e&&(n?Y(n)&&(s=Nt(n)):s=Nt(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==U(t))&&e}(r,i,n)?Mt(r):ct(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(r){const t=U(r),e=n&&Y(n)?U(n):n;let i=t,o=i.frameElement;for(;o&&n&&e!==i;){const t=Nt(o),e=o.getBoundingClientRect(),n=et(o),r=e.left+(o.clientLeft+parseFloat(n.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(n.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,p*=t.y,l+=r,c+=s,i=U(o),o=i.frameElement}}return zt({width:d,height:p,x:l,y:c})}const jt=[":popover-open",":modal"];function At(t){return jt.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function Tt(t){return Wt(Z(t)).left+it(t).scrollLeft}function Bt(t,e,i){let n;if("viewport"===e)n=function(t,e){const i=U(t),n=Z(t),o=i.visualViewport;let r=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=Q();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a,y:l}}(t,i);else if("document"===e)n=function(t){const e=Z(t),i=it(t),n=t.ownerDocument.body,o=at(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=at(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-i.scrollLeft+Tt(t);const a=-i.scrollTop;return"rtl"===et(n).direction&&(s+=at(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:a}}(Z(t));else if(Y(e))n=function(t,e){const i=Wt(t,!0,"fixed"===e),n=i.top+t.clientTop,o=i.left+t.clientLeft,r=G(t)?Nt(t):ct(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:n*r.y}}(e,i);else{const i=Mt(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return zt(n)}function Ht(t,e){const i=nt(t);return!(i===e||!Y(i)||tt(i))&&("fixed"===et(i).position||Ht(i,e))}function Pt(t,e,i){const n=G(e),o=Z(e),r="fixed"===i,s=Wt(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ct(0);if(n||!n&&!r)if(("body"!==V(e)||q(o))&&(a=it(e)),n){const t=Wt(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&(l.x=Tt(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function It(t,e){return G(t)&&"fixed"!==et(t).position?e?e(t):t.offsetParent:null}function Dt(t,e){const i=U(t);if(!G(t)||At(t))return i;let n=It(t,e);for(;n&&J(n)&&"static"===et(n).position;)n=It(n,e);return n&&("html"===V(n)||"body"===V(n)&&"static"===et(n).position&&!K(n))?i:n||function(t){let e=nt(t);for(;G(e)&&!tt(e);){if(K(e))return e;e=nt(e)}return null}(t)||i}const Ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const r="fixed"===o,s=Z(n),a=!!e&&At(e.floating);if(n===s||a&&r)return i;let l={scrollLeft:0,scrollTop:0},c=ct(1);const d=ct(0),p=G(n);if((p||!p&&!r)&&(("body"!==V(n)||q(s))&&(l=it(n)),G(n))){const t=Wt(n);c=Nt(n),d.x=t.x+n.clientLeft,d.y=t.y+n.clientTop}return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x,y:i.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:Z,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const r=[..."clippingAncestors"===i?function(t,e){const i=e.get(t);if(i)return i;let n=rt(t,[],!1).filter((t=>Y(t)&&"body"!==V(t))),o=null;const r="fixed"===et(t).position;let s=r?nt(t):t;for(;Y(s)&&!tt(s);){const e=et(s),i=K(s);i||"fixed"!==e.position||(o=null),(r?!i&&!o:!i&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||q(s)&&!i&&Ht(t,s))?n=n.filter((t=>t!==s)):o=e,s=nt(s)}return e.set(t,n),n}(e,this._c):[].concat(i),n],s=r[0],a=r.reduce(((t,i)=>{const n=Bt(e,i,o);return t.top=at(n.top,t.top),t.right=st(n.right,t.right),t.bottom=st(n.bottom,t.bottom),t.left=at(n.left,t.left),t}),Bt(e,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Dt,getElementRects:async function(t){const e=this.getOffsetParent||Dt,i=this.getDimensions;return{reference:Pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await i(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=Et(t);return{width:e,height:i}},getScale:Nt,isElement:Y,isRTL:function(t){return"rtl"===et(t).direction}},Vt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:n,placement:o}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=ht(t,e),c={x:i,y:n},d=await St(e,l),p=wt(ft(o)),u=mt(p);let h=c[u],f=c[p];if(r){const t="y"===u?"bottom":"right";h=ut(h+d["y"===u?"top":"left"],h,h-d[t])}if(s){const t="y"===p?"bottom":"right";f=ut(f+d["y"===p?"top":"left"],f,f-d[t])}const g=a.fn({...e,[u]:h,[p]:f});return{...g,data:{x:g.x-i,y:g.y-n}}}}},Ut=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,n;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=ht(t,e);if(null!=(i=r.arrow)&&i.alignmentOffset)return{};const x=ft(o),w=ft(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),v=u||(w||!g?[yt(a)]:function(t){const e=yt(t);return[vt(t),e,vt(e)]}(a));u||"none"===f||v.push(...function(t,e,i,n){const o=gt(t);let r=function(t,e,i){const n=["left","right"],o=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return i?e?o:n:e?n:o;case"left":case"right":return e?r:s;default:return[]}}(ft(t),"start"===i,n);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(vt)))),r}(a,g,f,b));const y=[a,...v],C=await St(e,m),z=[];let R=(null==(n=r.flip)?void 0:n.overflows)||[];if(d&&z.push(C[x]),p){const t=function(t,e,i){void 0===i&&(i=!1);const n=gt(t),o=bt(t),r=xt(o);let s="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=yt(s)),[s,yt(s)]}(o,s,b);z.push(C[t[0]],C[t[1]])}if(R=[...R,{placement:o,overflows:z}],!z.every((t=>t<=0))){var S,_;const t=((null==(S=r.flip)?void 0:S.index)||0)+1,e=y[t];if(e)return{data:{index:t,overflows:R},reset:{placement:e}};let i=null==(_=R.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:_.placement;if(!i)switch(h){case"bestFit":{var k;const t=null==(k=R.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(i=t);break}case"initialPlacement":i=a}if(o!==i)return{reset:{placement:i}}}return{}}}},Zt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:i,elements:n,rects:o,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=ht(t,e),d=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(n.reference))||[]),p=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),i=[];let n=null;for(let t=0;t<e.length;t++){const o=e[t];!n||o.y-n.y>n.height/2?i.push([o]):i[i.length-1].push(o),n=o}return i.map((t=>zt(_t(t))))}(d),u=zt(_t(d)),h=Ct(a);const f=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=c)return p.find((t=>l>t.left-h.left&&l<t.right+h.right&&c>t.top-h.top&&c<t.bottom+h.bottom))||u;if(p.length>=2){if("y"===wt(i)){const t=p[0],e=p[p.length-1],n="top"===ft(i),o=t.top,r=e.bottom,s=n?t.left:e.left,a=n?t.right:e.right;return{top:o,bottom:r,left:s,right:a,width:a-s,height:r-o,x:s,y:o}}const t="left"===ft(i),e=at(...p.map((t=>t.right))),n=st(...p.map((t=>t.left))),o=p.filter((i=>t?i.left===n:i.right===e)),r=o[0].top,s=o[o.length-1].bottom;return{top:r,bottom:s,left:n,right:e,width:e-n,height:s-r,x:n,y:r}}return u}},floating:n.floating,strategy:s});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Xt=(t,e,i)=>{const n=new Map,o={platform:Ft,...i},r={...o.platform,_c:n};return(async(t,e,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=i,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:p}=Rt(c,n,l),u=n,h={},f=0;for(let i=0;i<a.length;i++){const{name:r,fn:g}=a[i],{x:m,y:x,data:w,reset:b}=await g({x:d,y:p,initialPlacement:n,placement:u,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});d=null!=m?m:d,p=null!=x?x:p,h={...h,[r]:{...h[r],...w}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):b.rects),({x:d,y:p}=Rt(c,u,l))),i=-1)}return{x:d,y:p,placement:u,strategy:o,middlewareData:h}})(t,e,{...o,platform:r})};var Yt="undefined"!=typeof document?u:h;function Gt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let i,n,o;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(i=t.length,i!==e.length)return!1;for(n=i;0!=n--;)if(!Gt(t[n],e[n]))return!1;return!0}if(o=Object.keys(t),i=o.length,i!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!{}.hasOwnProperty.call(e,o[n]))return!1;for(n=i;0!=n--;){const i=o[n];if(("_owner"!==i||!t.$$typeof)&&!Gt(t[i],e[i]))return!1}return!0}return t!=t&&e!=e}function $t(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(t,e){const i=$t(t);return Math.round(e*i)/i}function Jt(t){const e=p.useRef(t);return Yt((()=>{e.current=t})),e}
|
|
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 Jt=["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(","),Kt="undefined"==typeof Element,Qt=Kt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,te=!Kt&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},ee=function t(e,i){var n;void 0===i&&(i=!0);var o=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===o||"true"===o||i&&e&&t(e.parentNode)},ie=function t(e,i,n){for(var o=[],r=Array.from(e);r.length;){var s=r.shift();if(!ee(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=t(a.length?a:s.children,!0,n);n.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{Qt.call(s,Jt)&&n.filter(s)&&(i||!e.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),d=!ee(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(c&&d){var p=t(!0===c?s.children:c.children,!0,n);n.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else r.unshift.apply(r,s.children)}}return o},ne=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},oe=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,i=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===i||"true"===i}(t))&&!ne(t)?0:t.tabIndex},re=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},se=function(t){return"INPUT"===t.tagName},ae=function(t){return function(t){return se(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,i=t.form||te(t),n=function(t){return i.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=n(window.CSS.escape(t.name));else try{e=n(t.name)}catch(t){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",t.message),!1}var o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===e)return t[i]}(e,t.form);return!o||o===t}(t)},le=function(t){var e=t.getBoundingClientRect(),i=e.width,n=e.height;return 0===i&&0===n},ce=function(t,e){var i=e.displayCheck,n=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var o=Qt.call(t,"details>summary:first-of-type")?t.parentElement:t;if(Qt.call(o,"details:not([open]) *"))return!0;if(i&&"full"!==i&&"legacy-full"!==i){if("non-zero-area"===i)return le(t)}else{if("function"==typeof n){for(var r=t;t;){var s=t.parentElement,a=te(t);if(s&&!s.shadowRoot&&!0===n(s))return le(t);t=t.assignedSlot?t.assignedSlot:s||a===t.ownerDocument?s:a.host}t=r}if(function(t){var e,i,n,o,r=t&&te(t),s=null===(e=r)||void 0===e?void 0:e.host,a=!1;if(r&&r!==t)for(a=!!(null!==(i=s)&&void 0!==i&&null!==(n=i.ownerDocument)&&void 0!==n&&n.contains(s)||null!=t&&null!==(o=t.ownerDocument)&&void 0!==o&&o.contains(t));!a&&s;){var l,c,d;a=!(null===(c=s=null===(l=r=te(s))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(s))}return a}(t))return!t.getClientRects().length;if("legacy-full"!==i)return!0}return!1},de=function(t,e){return!(e.disabled||ee(e)||function(t){return se(t)&&"hidden"===t.type}(e)||ce(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var i=0;i<e.children.length;i++){var n=e.children.item(i);if("LEGEND"===n.tagName)return!!Qt.call(e,"fieldset[disabled] *")||!n.contains(t)}return!0}e=e.parentElement}return!1}(e))},pe=function(t,e){return!(ae(e)||oe(e)<0||!de(t,e))},ue=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},he=function t(e){var i=[],n=[];return e.forEach((function(e,o){var r=!!e.scopeParent,s=r?e.scopeParent:e,a=function(t,e){var i=oe(t);return i<0&&e&&!ne(t)?0:i}(s,r),l=r?t(e.candidates):s;0===a?r?i.push.apply(i,l):i.push(s):n.push({documentOrder:o,tabIndex:a,item:e,isScope:r,content:l})})),n.sort(re).reduce((function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t}),[]).concat(i)},fe=function(t,e){var i;return i=(e=e||{}).getShadowRoot?ie([t],e.includeContainer,{filter:pe.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:ue}):function(t,e,i){if(ee(t))return[];var n=Array.prototype.slice.apply(t.querySelectorAll(Jt));return e&&Qt.call(t,Jt)&&n.unshift(t),n.filter(i)}(t,e.includeContainer,pe.bind(null,e)),he(i)};const ge=d["useInsertionEffect".toString()]||(t=>t());var me="undefined"!=typeof document?p:u;function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},xe.apply(this,arguments)}let we=!1,be=0;const ve=()=>"floating-ui-"+be++;const ye=d["useId".toString()]||function(){const[t,e]=d.useState((()=>we?ve():void 0));return me((()=>{null==t&&e(ve())}),[]),d.useEffect((()=>{we||(we=!0)}),[]),t};const Ce=d.createContext(null),ze=d.createContext(null);function Re(t){return"data-floating-ui-"+t}const Se=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _e(t,e){const i=fe(t,Se());"prev"===e&&i.reverse();const n=i.indexOf(function(t){let e=t.activeElement;for(;null!=(null==(i=e)||null==(i=i.shadowRoot)?void 0:i.activeElement);){var i;e=e.shadowRoot.activeElement}return e}((null==(o=t)?void 0:o.ownerDocument)||document));var o;return i.slice(n+1)[0]}function ke(t,e){const i=e||t.currentTarget,n=t.relatedTarget;return!n||!function(t,e){if(!t||!e)return!1;const i=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(i&&G(i)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}(i,n)}function Ee(t){fe(t,Se()).forEach((t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}))}function Le(t){t.querySelectorAll("[data-tabindex]").forEach((t=>{const e=t.dataset.tabindex;delete t.dataset.tabindex,e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")}))}const Oe={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 Ne(t){"Tab"===t.key&&(t.target,clearTimeout(undefined))}const Me=d.forwardRef((function(t,e){const[i,n]=d.useState();me((()=>(/apple/i.test(navigator.vendor)&&n("button"),document.addEventListener("keydown",Ne),()=>{document.removeEventListener("keydown",Ne)})),[]);const o={ref:e,tabIndex:0,role:i,"aria-hidden":!i||void 0,[Re("focus-guard")]:"",style:Oe};return d.createElement("span",xe({},t,o))})),We=d.createContext(null),je=Re("portal");function Te(t){let{children:e,id:i,root:n=null,preserveTabOrder:o=!0}=t;const r=function(t){let{id:e,root:i}=void 0===t?{}:t;const[n,o]=d.useState(null),r=ye(),s=Ae(),a=d.useRef(null);return me((()=>()=>{null==n||n.remove(),queueMicrotask((()=>{a.current=null}))}),[n]),me((()=>{if(a.current)return;const t=e?document.getElementById(e):null;if(!t)return;const i=document.createElement("div");i.id=r,i.setAttribute(je,""),t.appendChild(i),a.current=i,o(i)}),[e,r]),me((()=>{if(a.current)return;let t=i||(null==s?void 0:s.portalNode);t&&!X(t)&&(t=t.current),t=t||document.body;let n=null;e&&(n=document.createElement("div"),n.id=e,t.appendChild(n));const l=document.createElement("div");l.id=r,l.setAttribute(je,""),t=n||t,t.appendChild(l),a.current=l,o(l)}),[e,i,r,s]),n}({id:i,root:n}),[s,a]=d.useState(null),l=d.useRef(null),c=d.useRef(null),p=d.useRef(null),u=d.useRef(null),h=!!s&&!s.modal&&s.open&&o&&!(!n&&!r);return d.useEffect((()=>{if(r&&o&&(null==s||!s.modal))return r.addEventListener("focusin",t,!0),r.addEventListener("focusout",t,!0),()=>{r.removeEventListener("focusin",t,!0),r.removeEventListener("focusout",t,!0)};function t(t){if(r&&ke(t)){("focusin"===t.type?Le:Ee)(r)}}}),[r,o,null==s?void 0:s.modal]),d.createElement(We.Provider,{value:d.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:p,afterInsideRef:u,portalNode:r,setFocusManagerState:a})),[o,r])},h&&r&&d.createElement(Me,{"data-type":"outside",ref:l,onFocus:t=>{if(ke(t,r)){var e;null==(e=p.current)||e.focus()}else{const t=_e(document.body,"prev")||(null==s?void 0:s.refs.domReference.current);null==t||t.focus()}}}),h&&r&&d.createElement("span",{"aria-owns":r.id,style:Oe}),r&&b(e,r),h&&r&&d.createElement(Me,{"data-type":"outside",ref:c,onFocus:t=>{if(ke(t,r)){var e;null==(e=u.current)||e.focus()}else{const e=_e(document.body,"next")||(null==s?void 0:s.refs.domReference.current);null==e||e.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,t.nativeEvent))}}}))}const Ae=()=>d.useContext(We),Be=new Set,He=d.forwardRef((function(t,e){let{lockScroll:i=!1,...n}=t;const o=ye();return me((()=>{if(!i)return;Be.add(o);const t=/iP(hone|ad|od)|iOS/.test(function(){const t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}()),e=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,s=e.left?parseFloat(e.left):window.pageXOffset,a=e.top?parseFloat(e.top):window.pageYOffset;if(e.overflow="hidden",r&&(e[n]=r+"px"),t){var l,c;const t=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,i=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(e,{position:"fixed",top:-(a-Math.floor(i))+"px",left:-(s-Math.floor(t))+"px",right:"0"})}return()=>{Be.delete(o),0===Be.size&&(Object.assign(e,{overflow:"",[n]:""}),t&&(Object.assign(e,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a)))}}),[o,i]),d.createElement("div",xe({ref:e},n,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}}))}));function Pe(t){var e;void 0===t&&(t={});const{open:i=!1,onOpenChange:n,nodeId:o}=t,[r,s]=d.useState(null),a=(null==(e=t.elements)?void 0:e.reference)||r,l=function(t){void 0===t&&(t={});const{placement:e="bottom",strategy:i="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[p,u]=d.useState({x:0,y:0,strategy:i,placement:e,middlewareData:{},isPositioned:!1}),[h,f]=d.useState(n);Yt(h,n)||f(n);const[g,m]=d.useState(null),[w,b]=d.useState(null),v=d.useCallback((t=>{t!==R.current&&(R.current=t,m(t))}),[]),y=d.useCallback((t=>{t!==S.current&&(S.current=t,b(t))}),[]),C=r||g,z=s||w,R=d.useRef(null),S=d.useRef(null),_=d.useRef(p),k=null!=l,E=qt(l),L=qt(o),O=d.useCallback((()=>{if(!R.current||!S.current)return;const t={placement:e,strategy:i,middleware:h};L.current&&(t.platform=L.current),Zt(R.current,S.current,t).then((t=>{const e={...t,isPositioned:!0};N.current&&!Yt(_.current,e)&&(_.current=e,x.flushSync((()=>{u(e)})))}))}),[h,e,i,L]);Xt((()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,u((t=>({...t,isPositioned:!1}))))}),[c]);const N=d.useRef(!1);Xt((()=>(N.current=!0,()=>{N.current=!1})),[]),Xt((()=>{if(C&&(R.current=C),z&&(S.current=z),C&&z){if(E.current)return E.current(C,z,O);O()}}),[C,z,O,E,k]);const M=d.useMemo((()=>({reference:R,floating:S,setReference:v,setFloating:y})),[v,y]),W=d.useMemo((()=>({reference:C,floating:z})),[C,z]),j=d.useMemo((()=>{const t={position:i,left:0,top:0};if(!W.floating)return t;const e=$t(W.floating,p.x),n=$t(W.floating,p.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...Gt(W.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:e,top:n}}),[i,a,W.floating,p.x,p.y]);return d.useMemo((()=>({...p,update:O,refs:M,elements:W,floatingStyles:j})),[p,O,M,W,j])}(t),c=d.useContext(ze),p=null!=((null==(u=d.useContext(Ce))?void 0:u.id)||null);var u;const h=function(t){const e=d.useRef((()=>{}));return ge((()=>{e.current=t})),d.useCallback((function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return null==e.current?void 0:e.current(...i)}),[])}(((t,e,i)=>{t&&(g.current.openEvent=e),m.emit("openchange",{open:t,event:e,reason:i,nested:p}),null==n||n(t,e,i)})),f=d.useRef(null),g=d.useRef({}),m=d.useState((()=>function(){const t=new Map;return{emit(e,i){var n;null==(n=t.get(e))||n.forEach((t=>t(i)))},on(e,i){t.set(e,[...t.get(e)||[],i])},off(e,i){var n;t.set(e,(null==(n=t.get(e))?void 0:n.filter((t=>t!==i)))||[])}}}()))[0],w=ye(),b=d.useCallback((t=>{const e=X(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),contextElement:t}:t;l.refs.setReference(e)}),[l.refs]),v=d.useCallback((t=>{(X(t)||null===t)&&(f.current=t,s(t)),(X(l.refs.reference.current)||null===l.refs.reference.current||null!==t&&!X(t))&&l.refs.setReference(t)}),[l.refs]),y=d.useMemo((()=>({...l.refs,setReference:v,setPositionReference:b,domReference:f})),[l.refs,v,b]),C=d.useMemo((()=>({...l.elements,domReference:a})),[l.elements,a]),z=d.useMemo((()=>({...l,refs:y,elements:C,dataRef:g,nodeId:o,floatingId:w,events:m,open:i,onOpenChange:h})),[l,o,w,m,i,h,y,C]);return me((()=>{const t=null==c?void 0:c.nodesRef.current.find((t=>t.id===o));t&&(t.context=z)})),d.useMemo((()=>({...l,context:z,refs:y,elements:C})),[l,y,C,z])}function Ie(t,e){if(null==t)return{};var i,n,o={},r=Object.keys(t);for(n=0;n<r.length;n++)i=r[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}var De=["color"],Fe=h((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=Ie(t,De);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),f("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Ve=["color"],Ue=h((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=Ie(t,Ve);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),f("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Ze=["color"],Xe=h((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=Ie(t,Ze);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),f("path",{d:"M7.81832 0.68179C7.64258 0.506054 7.35766 0.506054 7.18192 0.68179L5.18192 2.68179C5.00619 2.85753 5.00619 3.14245 5.18192 3.31819C5.35766 3.49392 5.64258 3.49392 5.81832 3.31819L7.05012 2.08638L7.05012 5.50023C7.05012 5.74876 7.25159 5.95023 7.50012 5.95023C7.74865 5.95023 7.95012 5.74876 7.95012 5.50023L7.95012 2.08638L9.18192 3.31819C9.35766 3.49392 9.64258 3.49392 9.81832 3.31819C9.99406 3.14245 9.99406 2.85753 9.81832 2.68179L7.81832 0.68179ZM7.95012 12.9136V9.50023C7.95012 9.2517 7.74865 9.05023 7.50012 9.05023C7.25159 9.05023 7.05012 9.2517 7.05012 9.50023V12.9136L5.81832 11.6818C5.64258 11.5061 5.35766 11.5061 5.18192 11.6818C5.00619 11.8575 5.00619 12.1424 5.18192 12.3182L7.18192 14.3182C7.26632 14.4026 7.38077 14.45 7.50012 14.45C7.61947 14.45 7.73393 14.4026 7.81832 14.3182L9.81832 12.3182C9.99406 12.1424 9.99406 11.8575 9.81832 11.6818C9.64258 11.5061 9.35766 11.5061 9.18192 11.6818L7.95012 12.9136ZM1.49994 7.00017C1.2238 7.00017 0.999939 7.22403 0.999939 7.50017C0.999939 7.77631 1.2238 8.00017 1.49994 8.00017L13.4999 8.00017C13.7761 8.00017 13.9999 7.77631 13.9999 7.50017C13.9999 7.22403 13.7761 7.00017 13.4999 7.00017L1.49994 7.00017Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Ye=["color"],Ge=h((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=Ie(t,Ye);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),f("path",{d:"M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),$e=["color"],qe=h((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=Ie(t,$e);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),f("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));const Je=({blockId:e,onClose:i})=>{const n=t(),[o,r]=g(""),s=0===o.length;return l("div",Object.assign({className:"cursor-pointer user-select-none transition-bg duration-20 ease-in white-space-nowrap w-full"},{children:[a("input",{type:"text",placeholder:"Paste image link",value:o,className:"items-center bg-[hsla(45,13%,94%,.6)] rounded-[4px] shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] cursor-text flex text-[14px] h-[32px] leading-[20px] px-[6px] relative w-full border-none",onChange:t=>r(t.target.value)}),a("button",Object.assign({type:"button",className:"user-select-none transition-bg duration-20 ease-in cursor-pointer flex items-center justify-center flex-shrink-0 white-space-nowrap h-[28px] rounded-[4px] shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] bg-[rgb(35,131,226)] text-white fill-white leading-[1.2] px-[12px] text-[14px] font-medium w-full max-w-[300px] mx-auto m-[12px_0_6px] disabled:bg-[rgba(35,131,226,0.5)] disabled:cursor-not-allowed",disabled:s,onClick:()=>{0!==o.length&&(n.blocks.Image.updateElement(e,"image",{src:o}),i())}},{children:"Embed image"}))]}))};function Ke(t,e,i,n){return new(i||(i=Promise))((function(o,r){function s(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Qe=({accept:i="image/*",onClose:n,blockId:o,onSetLoading:r})=>{const s=e("Image"),c=t();return a("div",Object.assign({className:"user-select-none transition-bg duration-20 ease-in white-space-nowrap rounded-[4px] h-[32px] px-[12px] border border-[rgba(55,53,47,0.16)] w-full cursor-pointer"},{children:l("label",Object.assign({htmlFor:"image-uploader",className:"text-[14px] leading-[1.2] font-medium cursor-pointer w-full flex items-center justify-center h-full"},{children:[a("input",{type:"file",id:"image-uploader",className:"absolute left-0 top-0 invisible",accept:(null==s?void 0:s.accept)||i,onChange:t=>{const e=t.target.files[0];e&&(t=>{Ke(void 0,void 0,void 0,(function*(){if(null==s?void 0:s.onUpload){n(),r(!0);try{const e=yield null==s?void 0:s.onUpload(t);c.blocks.Image.updateElement(o,"image",{src:e.src,alt:e.alt,sizes:e.sizes,bgColor:e.bgColor,fit:"contain"})}catch(t){}finally{r(!1)}}else console.warn("onUpload not provided")}))})(e)},multiple:!1}),"Upload image"]}))}))},ti=({floatingStyles:t,refs:e,onClose:i,blockId:n,onSetLoading:o})=>{const[r,s]=g("upload"),c=t=>s(t),d="upload"===r,p="embed"===r,u=t=>({borderBottom:t?"2px solid #2483e2":"2px solid transparent"});return a(Te,Object.assign({root:document.getElementById("yoopta-editor")},{children:a(He,Object.assign({lockScroll:!0,className:"z-[100]",onClick:i},{children:a("div",Object.assign({ref:e.setFloating,style:t,onClick:t=>t.stopPropagation()},{children:l("div",Object.assign({className:"flex flex-col min-w-[540px] max-w-[calc(100vw-24px)] h-full max-h-[420px] bg-white 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:[l("div",Object.assign({className:"w-full flex text-[14px] p-[0_8px] shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] relative z-10 h-[40px]"},{children:[a("button",Object.assign({type:"button",onClick:()=>c("upload"),style:u(d),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Upload"})),a("button",Object.assign({type:"button",onClick:()=>c("embed"),style:u(p),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Image link"}))]})),l("div",Object.assign({className:"pt-[6px] pb-[6px] mt-[4px] flex justify-center mr-[12px] ml-[12px]"},{children:[p&&a(Je,{onClose:i,blockId:n}),d&&a(Qe,{onClose:i,blockId:n,onSetLoading:o})]}))]}))}))}))}))},ei=({className:t,width:e,height:i,children:n})=>l("div",Object.assign({className:t},{children:[n,a("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:e,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 h-4 w-4 animate-spin"},{children:a("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),ii=({attributes:t,children:e,blockId:i})=>{const[n,o]=g(!1),[r,s]=g(!1),{refs:c,floatingStyles:d}=Pe({placement:"bottom",open:n,onOpenChange:o,middleware:[Ut(),Vt(),Ft(),_t(10)]});return l("div",Object.assign({className:"w-full user-select-none m-[20px_0_10px] relative flex"},t,{contentEditable:!1},{children:[l("button",Object.assign({className:"p-[12px_36px_12px_12px] flex items-center text-left w-full overflow-hidden rounded-[3px] text-[14px] text-[rgba(55,53,47,0.65)] relative cursor-pointer border-none bg-[#efefef] transition-[background-color_100ms_ease-in] hover:bg-[#e3e3e3]",onClick:()=>o(!0),disabled:r,ref:c.setReference},{children:[a(r?ei:Ue,{className:"mr-2 user-select-none",width:24,height:24}),a("span",Object.assign({className:"font-medium"},{children:r?"Loading...":"Click to add image"})),r&&a("div",{className:"absolute top-0 left-0 h-full bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),n&&a(ti,{blockId:i,floatingStyles:d,refs:c,onClose:()=>o(!1),onSetLoading:t=>s(t)}),e]}))},{ExtendedBlockActions:ni,BlockOptionsMenuGroup:oi,BlockOptionsMenuItem:ri,BlockOptionsSeparator:si}=i,ai=({editor:t,block:e,props:i})=>l(ni,Object.assign({onClick:()=>t.setSelection([e.meta.order]),className:"yoopta-image-options"},{children:[a(si,{}),l(oi,{children:[a(ri,{children:l("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"contain"})}},{children:[a(Xe,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fit"]}))}),a(ri,{children:l("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"fill"})}},{children:[a(qe,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fill"]}))}),a(ri,{children:l("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"cover"})}},{children:[a(Ge,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Cover"]}))})]}),a(si,{}),a(oi,{children:a(ri,{children:l("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{if(!i||!i.src)return;const t=document.createElement("a");t.href=i.src,t.download=i.alt||i.src,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)}},{children:[a(Fe,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Download"]}))})})]})),li=({position:t})=>a("div",Object.assign({contentEditable:!1,className:"absolute pointer-events-none flex items-center justify-center z-10 opacity-1 h-full w-[15px] cursor-col-resize transition-opacity duration-150 ease-in "+("left"===t?"left-0 top-0":"right-0 top-0")},{children:a("div",{className:"opacity-100 transition-opacity duration-300 ease-in rounded-[20px] bg-[rgba(15,15,15,0.6)] border border-[rgba(255,255,255,0.9)] w-[6px] h-[48px] max-h-[50%] shadow-[0_0_0_.5px_#FFF]"})})),ci=new s({type:"Image",elements:{image:{render:({element:i,attributes:s,children:d,blockId:p})=>{const{src:h,alt:f,srcSet:x,bgColor:w,fit:b,sizes:y}=i.props||{},C=n(p),z=t(),R=o(),S=e("Image"),[_,k]=g({width:(null==y?void 0:y.width)||650,height:(null==y?void 0:y.height)||440});u((()=>k({width:(null==y?void 0:y.width)||650,height:(null==y?void 0:y.height)||440})),[i.props]);const E=r({blockId:p}),L=m((()=>{var t,e;return{minWidth:300,size:{width:_.width,height:_.height},maxWidth:(null===(t=null==S?void 0:S.maxSizes)||void 0===t?void 0:t.maxWidth)||800,maxHeight:(null===(e=null==S?void 0:S.maxSizes)||void 0===e?void 0:e.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!R,right:!R},handleStyles:{left:{left:0},right:{right:0}},onResize:(t,e,i)=>{R||k({width:i.offsetWidth,height:i.offsetHeight})},onResizeStop:(t,e,i)=>{R||z.blocks.Image.updateElement(p,"image",{sizes:{width:i.offsetWidth,height:i.offsetHeight}})},handleComponent:{left:R?a(c,{}):a(li,{position:"left"}),right:R?a(c,{}):a(li,{position:"right"})}}}),[_.width,_.height]);return h?a("div",Object.assign({"data-element-type":i.type,contentEditable:!1,draggable:!1,className:"mt-4 relative yoopta-image"},s,{children:l(D,Object.assign({},L,{className:"mx-auto my-0 flex"},{children:[E&&a("div",{className:"absolute pointer-events-none inset-0 bg-[rgba(35,131,226,0.14)] z-[81] rounded-[3px] opacity-100 transition-opacity duration-150 ease-in"}),a(v,{src:h,alt:f,srcSet:x,fit:b,width:null==_?void 0:_.width,bgColor:w,height:null==_?void 0:_.height}),!R&&a(ai,{block:C,editor:z,props:i.props}),d]}))})):R?null:a(ii,Object.assign({attributes:s,blockId:p},{children:d}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},options:{display:{title:"Image",description:"Upload from device or embed with link"},onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}}});!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-\\[100\\]{z-index:100}.z-\\[81\\]{z-index:81}.m-\\[12px_0_6px\\]{margin:12px 0 6px}.m-\\[20px_0_10px\\]{margin:20px 0 10px}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.ml-\\[12px\\]{margin-left:12px}.mr-2{margin-right:.5rem}.mr-\\[12px\\]{margin-right:12px}.mt-4{margin-top:1rem}.mt-\\[4px\\]{margin-top:4px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.h-4{height:1rem}.h-\\[28px\\]{height:28px}.h-\\[32px\\]{height:32px}.h-\\[40px\\]{height:40px}.h-\\[48px\\]{height:48px}.h-full{height:100%}.max-h-\\[420px\\]{max-height:420px}.max-h-\\[50\\%\\]{max-height:50%}.w-4{width:1rem}.w-\\[15px\\]{width:15px}.w-\\[6px\\]{width:6px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[540px\\]{min-width:540px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.flex-shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.border-\\[rgba\\(255\\2c 255\\2c 255\\2c 0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.bg-\\[hsla\\(45\\2c 13\\%\\2c 94\\%\\2c \\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.bg-\\[rgb\\(35\\2c 131\\2c 226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.bg-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.bg-inherit{background-color:inherit}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\[0_8px\\]{padding:0 8px}.p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-\\[6px\\]{padding-top:6px}.pb-\\[6px\\],.py-\\[6px\\]{padding-bottom:6px}.pt-\\[6px\\]{padding-top:6px}.text-left{text-align:left}.text-\\[14px\\]{font-size:14px}.font-medium{font-weight:500}.leading-\\[1\\.2\\]{line-height:1.2}.leading-\\[120\\%\\]{line-height:120%}.leading-\\[20px\\]{line-height:20px}.text-\\[rgb\\(55\\2c 53\\2c 47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.text-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.65\\)\\]{color:rgba(55,53,47,.65)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-100{opacity:1}.shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color)}.shadow-\\[0_0_0_\\.5px_\\#FFF\\],.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color)}.shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\2c _rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\2c _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)}.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)}.shadow-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_0px_0px_1px_inset\\2c _rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-image .yoopta-image-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-image:hover .yoopta-image-options{opacity:1}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}");export{ci as default};
|
|
6
|
+
var Kt=["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(","),Qt="undefined"==typeof Element,te=Qt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ee=!Qt&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},ie=function t(e,i){var n;void 0===i&&(i=!0);var o=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===o||"true"===o||i&&e&&t(e.parentNode)},ne=function t(e,i,n){for(var o=[],r=Array.from(e);r.length;){var s=r.shift();if(!ie(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=t(a.length?a:s.children,!0,n);n.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{te.call(s,Kt)&&n.filter(s)&&(i||!e.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),d=!ie(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(c&&d){var p=t(!0===c?s.children:c.children,!0,n);n.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else r.unshift.apply(r,s.children)}}return o},oe=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},re=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,i=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===i||"true"===i}(t))&&!oe(t)?0:t.tabIndex},se=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},ae=function(t){return"INPUT"===t.tagName},le=function(t){return function(t){return ae(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,i=t.form||ee(t),n=function(t){return i.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=n(window.CSS.escape(t.name));else try{e=n(t.name)}catch(t){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",t.message),!1}var o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===e)return t[i]}(e,t.form);return!o||o===t}(t)},ce=function(t){var e=t.getBoundingClientRect(),i=e.width,n=e.height;return 0===i&&0===n},de=function(t,e){var i=e.displayCheck,n=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var o=te.call(t,"details>summary:first-of-type")?t.parentElement:t;if(te.call(o,"details:not([open]) *"))return!0;if(i&&"full"!==i&&"legacy-full"!==i){if("non-zero-area"===i)return ce(t)}else{if("function"==typeof n){for(var r=t;t;){var s=t.parentElement,a=ee(t);if(s&&!s.shadowRoot&&!0===n(s))return ce(t);t=t.assignedSlot?t.assignedSlot:s||a===t.ownerDocument?s:a.host}t=r}if(function(t){var e,i,n,o,r=t&&ee(t),s=null===(e=r)||void 0===e?void 0:e.host,a=!1;if(r&&r!==t)for(a=!!(null!==(i=s)&&void 0!==i&&null!==(n=i.ownerDocument)&&void 0!==n&&n.contains(s)||null!=t&&null!==(o=t.ownerDocument)&&void 0!==o&&o.contains(t));!a&&s;){var l,c,d;a=!(null===(c=s=null===(l=r=ee(s))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(s))}return a}(t))return!t.getClientRects().length;if("legacy-full"!==i)return!0}return!1},pe=function(t,e){return!(e.disabled||ie(e)||function(t){return ae(t)&&"hidden"===t.type}(e)||de(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var i=0;i<e.children.length;i++){var n=e.children.item(i);if("LEGEND"===n.tagName)return!!te.call(e,"fieldset[disabled] *")||!n.contains(t)}return!0}e=e.parentElement}return!1}(e))},ue=function(t,e){return!(le(e)||re(e)<0||!pe(t,e))},he=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},fe=function t(e){var i=[],n=[];return e.forEach((function(e,o){var r=!!e.scopeParent,s=r?e.scopeParent:e,a=function(t,e){var i=re(t);return i<0&&e&&!oe(t)?0:i}(s,r),l=r?t(e.candidates):s;0===a?r?i.push.apply(i,l):i.push(s):n.push({documentOrder:o,tabIndex:a,item:e,isScope:r,content:l})})),n.sort(se).reduce((function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t}),[]).concat(i)},ge=function(t,e){var i;return i=(e=e||{}).getShadowRoot?ne([t],e.includeContainer,{filter:ue.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:he}):function(t,e,i){if(ie(t))return[];var n=Array.prototype.slice.apply(t.querySelectorAll(Kt));return e&&te.call(t,Kt)&&n.unshift(t),n.filter(i)}(t,e.includeContainer,ue.bind(null,e)),fe(i)};const me=p["useInsertionEffect".toString()]||(t=>t());var xe="undefined"!=typeof document?u:h;function we(){return we=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},we.apply(this,arguments)}let be=!1,ve=0;const ye=()=>"floating-ui-"+ve++;const Ce=p["useId".toString()]||function(){const[t,e]=p.useState((()=>be?ye():void 0));return xe((()=>{null==t&&e(ye())}),[]),p.useEffect((()=>{be||(be=!0)}),[]),t};const ze=p.createContext(null),Re=p.createContext(null);function Se(t){return"data-floating-ui-"+t}const _e=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ke(t,e){const i=ge(t,_e());"prev"===e&&i.reverse();const n=i.indexOf(function(t){let e=t.activeElement;for(;null!=(null==(i=e)||null==(i=i.shadowRoot)?void 0:i.activeElement);){var i;e=e.shadowRoot.activeElement}return e}((null==(o=t)?void 0:o.ownerDocument)||document));var o;return i.slice(n+1)[0]}function Ee(t,e){const i=e||t.currentTarget,n=t.relatedTarget;return!n||!function(t,e){if(!t||!e)return!1;const i=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(i&&$(i)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}(i,n)}function Le(t){ge(t,_e()).forEach((t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}))}function Ne(t){t.querySelectorAll("[data-tabindex]").forEach((t=>{const e=t.dataset.tabindex;delete t.dataset.tabindex,e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")}))}const Oe={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 Me(t){"Tab"===t.key&&(t.target,clearTimeout(undefined))}const We=p.forwardRef((function(t,e){const[i,n]=p.useState();xe((()=>(/apple/i.test(navigator.vendor)&&n("button"),document.addEventListener("keydown",Me),()=>{document.removeEventListener("keydown",Me)})),[]);const o={ref:e,tabIndex:0,role:i,"aria-hidden":!i||void 0,[Se("focus-guard")]:"",style:Oe};return p.createElement("span",we({},t,o))})),je=p.createContext(null),Ae=Se("portal");function Te(t){let{children:e,id:i,root:n=null,preserveTabOrder:o=!0}=t;const r=function(t){let{id:e,root:i}=void 0===t?{}:t;const[n,o]=p.useState(null),r=Ce(),s=Be(),a=p.useRef(null);return xe((()=>()=>{null==n||n.remove(),queueMicrotask((()=>{a.current=null}))}),[n]),xe((()=>{if(a.current)return;const t=e?document.getElementById(e):null;if(!t)return;const i=document.createElement("div");i.id=r,i.setAttribute(Ae,""),t.appendChild(i),a.current=i,o(i)}),[e,r]),xe((()=>{if(a.current)return;let t=i||(null==s?void 0:s.portalNode);t&&!Y(t)&&(t=t.current),t=t||document.body;let n=null;e&&(n=document.createElement("div"),n.id=e,t.appendChild(n));const l=document.createElement("div");l.id=r,l.setAttribute(Ae,""),t=n||t,t.appendChild(l),a.current=l,o(l)}),[e,i,r,s]),n}({id:i,root:n}),[s,a]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),h=!!s&&!s.modal&&s.open&&o&&!(!n&&!r);return p.useEffect((()=>{if(r&&o&&(null==s||!s.modal))return r.addEventListener("focusin",t,!0),r.addEventListener("focusout",t,!0),()=>{r.removeEventListener("focusin",t,!0),r.removeEventListener("focusout",t,!0)};function t(t){if(r&&Ee(t)){("focusin"===t.type?Ne:Le)(r)}}}),[r,o,null==s?void 0:s.modal]),p.createElement(je.Provider,{value:p.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:r,setFocusManagerState:a})),[o,r])},h&&r&&p.createElement(We,{"data-type":"outside",ref:l,onFocus:t=>{if(Ee(t,r)){var e;null==(e=d.current)||e.focus()}else{const t=ke(document.body,"prev")||(null==s?void 0:s.refs.domReference.current);null==t||t.focus()}}}),h&&r&&p.createElement("span",{"aria-owns":r.id,style:Oe}),r&&v(e,r),h&&r&&p.createElement(We,{"data-type":"outside",ref:c,onFocus:t=>{if(Ee(t,r)){var e;null==(e=u.current)||e.focus()}else{const e=ke(document.body,"next")||(null==s?void 0:s.refs.domReference.current);null==e||e.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,t.nativeEvent))}}}))}const Be=()=>p.useContext(je),He=new Set,Pe=p.forwardRef((function(t,e){let{lockScroll:i=!1,...n}=t;const o=Ce();return xe((()=>{if(!i)return;He.add(o);const t=/iP(hone|ad|od)|iOS/.test(function(){const t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}()),e=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,s=e.left?parseFloat(e.left):window.pageXOffset,a=e.top?parseFloat(e.top):window.pageYOffset;if(e.overflow="hidden",r&&(e[n]=r+"px"),t){var l,c;const t=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,i=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(e,{position:"fixed",top:-(a-Math.floor(i))+"px",left:-(s-Math.floor(t))+"px",right:"0"})}return()=>{He.delete(o),0===He.size&&(Object.assign(e,{overflow:"",[n]:""}),t&&(Object.assign(e,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a)))}}),[o,i]),p.createElement("div",we({ref:e},n,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}}))}));function Ie(t){var e;void 0===t&&(t={});const{open:i=!1,onOpenChange:n,nodeId:o}=t,[r,s]=p.useState(null),a=(null==(e=t.elements)?void 0:e.reference)||r,l=function(t){void 0===t&&(t={});const{placement:e="bottom",strategy:i="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,u]=p.useState({x:0,y:0,strategy:i,placement:e,middlewareData:{},isPositioned:!1}),[h,f]=p.useState(n);Gt(h,n)||f(n);const[g,m]=p.useState(null),[x,b]=p.useState(null),v=p.useCallback((t=>{t!==R.current&&(R.current=t,m(t))}),[]),y=p.useCallback((t=>{t!==S.current&&(S.current=t,b(t))}),[]),C=r||g,z=s||x,R=p.useRef(null),S=p.useRef(null),_=p.useRef(d),k=null!=l,E=Jt(l),L=Jt(o),N=p.useCallback((()=>{if(!R.current||!S.current)return;const t={placement:e,strategy:i,middleware:h};L.current&&(t.platform=L.current),Xt(R.current,S.current,t).then((t=>{const e={...t,isPositioned:!0};O.current&&!Gt(_.current,e)&&(_.current=e,w.flushSync((()=>{u(e)})))}))}),[h,e,i,L]);Yt((()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,u((t=>({...t,isPositioned:!1}))))}),[c]);const O=p.useRef(!1);Yt((()=>(O.current=!0,()=>{O.current=!1})),[]),Yt((()=>{if(C&&(R.current=C),z&&(S.current=z),C&&z){if(E.current)return E.current(C,z,N);N()}}),[C,z,N,E,k]);const M=p.useMemo((()=>({reference:R,floating:S,setReference:v,setFloating:y})),[v,y]),W=p.useMemo((()=>({reference:C,floating:z})),[C,z]),j=p.useMemo((()=>{const t={position:i,left:0,top:0};if(!W.floating)return t;const e=qt(W.floating,d.x),n=qt(W.floating,d.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...$t(W.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:e,top:n}}),[i,a,W.floating,d.x,d.y]);return p.useMemo((()=>({...d,update:N,refs:M,elements:W,floatingStyles:j})),[d,N,M,W,j])}(t),c=p.useContext(Re),d=null!=((null==(u=p.useContext(ze))?void 0:u.id)||null);var u;const h=function(t){const e=p.useRef((()=>{}));return me((()=>{e.current=t})),p.useCallback((function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return null==e.current?void 0:e.current(...i)}),[])}(((t,e,i)=>{t&&(g.current.openEvent=e),m.emit("openchange",{open:t,event:e,reason:i,nested:d}),null==n||n(t,e,i)})),f=p.useRef(null),g=p.useRef({}),m=p.useState((()=>function(){const t=new Map;return{emit(e,i){var n;null==(n=t.get(e))||n.forEach((t=>t(i)))},on(e,i){t.set(e,[...t.get(e)||[],i])},off(e,i){var n;t.set(e,(null==(n=t.get(e))?void 0:n.filter((t=>t!==i)))||[])}}}()))[0],x=Ce(),b=p.useCallback((t=>{const e=Y(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),contextElement:t}:t;l.refs.setReference(e)}),[l.refs]),v=p.useCallback((t=>{(Y(t)||null===t)&&(f.current=t,s(t)),(Y(l.refs.reference.current)||null===l.refs.reference.current||null!==t&&!Y(t))&&l.refs.setReference(t)}),[l.refs]),y=p.useMemo((()=>({...l.refs,setReference:v,setPositionReference:b,domReference:f})),[l.refs,v,b]),C=p.useMemo((()=>({...l.elements,domReference:a})),[l.elements,a]),z=p.useMemo((()=>({...l,refs:y,elements:C,dataRef:g,nodeId:o,floatingId:x,events:m,open:i,onOpenChange:h})),[l,o,x,m,i,h,y,C]);return xe((()=>{const t=null==c?void 0:c.nodesRef.current.find((t=>t.id===o));t&&(t.context=z)})),p.useMemo((()=>({...l,context:z,refs:y,elements:C})),[l,y,C,z])}function De(t,e){if(null==t)return{};var i,n,o={},r=Object.keys(t);for(n=0;n<r.length;n++)i=r[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}var Fe=["color"],Ve=f((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=De(t,Fe);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),g("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Ue=["color"],Ze=f((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=De(t,Ue);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),g("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Xe=["color"],Ye=f((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=De(t,Xe);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),g("path",{d:"M7.81832 0.68179C7.64258 0.506054 7.35766 0.506054 7.18192 0.68179L5.18192 2.68179C5.00619 2.85753 5.00619 3.14245 5.18192 3.31819C5.35766 3.49392 5.64258 3.49392 5.81832 3.31819L7.05012 2.08638L7.05012 5.50023C7.05012 5.74876 7.25159 5.95023 7.50012 5.95023C7.74865 5.95023 7.95012 5.74876 7.95012 5.50023L7.95012 2.08638L9.18192 3.31819C9.35766 3.49392 9.64258 3.49392 9.81832 3.31819C9.99406 3.14245 9.99406 2.85753 9.81832 2.68179L7.81832 0.68179ZM7.95012 12.9136V9.50023C7.95012 9.2517 7.74865 9.05023 7.50012 9.05023C7.25159 9.05023 7.05012 9.2517 7.05012 9.50023V12.9136L5.81832 11.6818C5.64258 11.5061 5.35766 11.5061 5.18192 11.6818C5.00619 11.8575 5.00619 12.1424 5.18192 12.3182L7.18192 14.3182C7.26632 14.4026 7.38077 14.45 7.50012 14.45C7.61947 14.45 7.73393 14.4026 7.81832 14.3182L9.81832 12.3182C9.99406 12.1424 9.99406 11.8575 9.81832 11.6818C9.64258 11.5061 9.35766 11.5061 9.18192 11.6818L7.95012 12.9136ZM1.49994 7.00017C1.2238 7.00017 0.999939 7.22403 0.999939 7.50017C0.999939 7.77631 1.2238 8.00017 1.49994 8.00017L13.4999 8.00017C13.7761 8.00017 13.9999 7.77631 13.9999 7.50017C13.9999 7.22403 13.7761 7.00017 13.4999 7.00017L1.49994 7.00017Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Ge=["color"],$e=f((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=De(t,Ge);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),g("path",{d:"M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),qe=["color"],Je=f((function(t,e){var i=t.color,n=void 0===i?"currentColor":i,o=De(t,qe);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),g("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));const Ke=({blockId:e,onClose:i})=>{const n=t(),[o,r]=m(""),s=0===o.length;return c("div",Object.assign({className:"cursor-pointer user-select-none transition-bg duration-20 ease-in white-space-nowrap w-full"},{children:[l("input",{type:"text",placeholder:"Paste image link",value:o,className:"items-center bg-[hsla(45,13%,94%,.6)] rounded-[4px] shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] cursor-text flex text-[14px] h-[32px] leading-[20px] px-[6px] relative w-full border-none",onChange:t=>r(t.target.value)}),l("button",Object.assign({type:"button",className:"user-select-none transition-bg duration-20 ease-in cursor-pointer flex items-center justify-center flex-shrink-0 white-space-nowrap h-[28px] rounded-[4px] shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] bg-[rgb(35,131,226)] text-white fill-white leading-[1.2] px-[12px] text-[14px] font-medium w-full max-w-[300px] mx-auto m-[12px_0_6px] disabled:bg-[rgba(35,131,226,0.5)] disabled:cursor-not-allowed",disabled:s,onClick:()=>{0!==o.length&&(n.blocks.Image.updateElement(e,"image",{src:o}),i())}},{children:"Embed image"}))]}))};function Qe(t,e,i,n){return new(i||(i=Promise))((function(o,r){function s(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const ti=({accept:i="image/*",onClose:n,blockId:o,onSetLoading:r})=>{const s=e("Image"),a=t();return l("div",Object.assign({className:"user-select-none transition-bg duration-20 ease-in white-space-nowrap rounded-[4px] h-[32px] px-[12px] border border-[rgba(55,53,47,0.16)] w-full cursor-pointer"},{children:c("label",Object.assign({htmlFor:"image-uploader",className:"text-[14px] leading-[1.2] font-medium cursor-pointer w-full flex items-center justify-center h-full"},{children:[l("input",{type:"file",id:"image-uploader",className:"absolute left-0 top-0 invisible",accept:(null==s?void 0:s.accept)||i,onChange:t=>{const e=t.target.files[0];e&&(t=>{Qe(void 0,void 0,void 0,(function*(){if(null==s?void 0:s.onUpload){n(),r(!0);try{const e=yield null==s?void 0:s.onUpload(t);a.blocks.Image.updateElement(o,"image",{src:e.src,alt:e.alt,sizes:e.sizes,bgColor:e.bgColor,fit:"contain"})}catch(t){}finally{r(!1)}}else console.warn("onUpload not provided")}))})(e)},multiple:!1}),"Upload image"]}))}))},ei=({floatingStyles:t,refs:e,onClose:i,blockId:n,onSetLoading:o})=>{const[r,s]=m("upload"),a=t=>s(t),d="upload"===r,p="embed"===r,u=t=>({borderBottom:t?"2px solid #2483e2":"2px solid transparent"});return l(Te,Object.assign({root:document.getElementById("yoopta-editor")},{children:l(Pe,Object.assign({lockScroll:!0,className:"z-[100]",onClick:i},{children:l("div",Object.assign({ref:e.setFloating,style:t,onClick:t=>t.stopPropagation()},{children:c("div",Object.assign({className:"flex flex-col min-w-[540px] max-w-[calc(100vw-24px)] h-full max-h-[420px] bg-white 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:[c("div",Object.assign({className:"w-full flex text-[14px] p-[0_8px] shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] relative z-10 h-[40px]"},{children:[l("button",Object.assign({type:"button",onClick:()=>a("upload"),style:u(d),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Upload"})),l("button",Object.assign({type:"button",onClick:()=>a("embed"),style:u(p),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Image link"}))]})),c("div",Object.assign({className:"pt-[6px] pb-[6px] mt-[4px] flex justify-center mr-[12px] ml-[12px]"},{children:[p&&l(Ke,{onClose:i,blockId:n}),d&&l(ti,{onClose:i,blockId:n,onSetLoading:o})]}))]}))}))}))}))},ii=({className:t,width:e,height:i,children:n})=>c("div",Object.assign({className:t},{children:[n,l("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:e,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 h-4 w-4 animate-spin"},{children:l("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),ni=({attributes:t,children:e,blockId:i})=>{const[n,o]=m(!1),[r,s]=m(!1),{refs:a,floatingStyles:d}=Ie({placement:"bottom",open:n,onOpenChange:o,middleware:[Zt(),Ut(),Vt(),kt(10)]});return c("div",Object.assign({className:"w-full user-select-none m-[20px_0_10px] relative flex"},t,{contentEditable:!1},{children:[c("button",Object.assign({className:"p-[12px_36px_12px_12px] flex items-center text-left w-full overflow-hidden rounded-[3px] text-[14px] text-[rgba(55,53,47,0.65)] relative cursor-pointer border-none bg-[#efefef] transition-[background-color_100ms_ease-in] hover:bg-[#e3e3e3]",onClick:()=>o(!0),disabled:r,ref:a.setReference},{children:[l(r?ii:Ze,{className:"mr-2 user-select-none",width:24,height:24}),l("span",Object.assign({className:"font-medium"},{children:r?"Loading...":"Click to add image"})),r&&l("div",{className:"absolute top-0 left-0 h-full bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),n&&l(ei,{blockId:i,floatingStyles:d,refs:a,onClose:()=>o(!1),onSetLoading:t=>s(t)}),e]}))},{ExtendedBlockActions:oi,BlockOptionsMenuGroup:ri,BlockOptionsMenuItem:si,BlockOptionsSeparator:ai}=i,li=({editor:t,block:e,props:i})=>c(oi,Object.assign({onClick:()=>t.setSelection([e.meta.order]),className:"yoopta-image-options"},{children:[l(ai,{}),c(ri,{children:[l(si,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"contain"})}},{children:[l(Ye,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fit"]}))}),l(si,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"fill"})}},{children:[l(Je,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fill"]}))}),l(si,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"cover"})}},{children:[l($e,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Cover"]}))})]}),l(ai,{}),l(ri,{children:l(si,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{if(!i||!i.src)return;const t=document.createElement("a");t.href=i.src,t.download=i.alt||i.src,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)}},{children:[l(Ve,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Download"]}))})})]})),ci=({position:t})=>l("div",Object.assign({contentEditable:!1,className:"absolute pointer-events-none flex items-center justify-center z-10 opacity-1 h-full w-[15px] cursor-col-resize transition-opacity duration-150 ease-in "+("left"===t?"left-0 top-0":"right-0 top-0")},{children:l("div",{className:"opacity-100 transition-opacity duration-300 ease-in rounded-[20px] bg-[rgba(15,15,15,0.6)] border border-[rgba(255,255,255,0.9)] w-[6px] h-[48px] max-h-[50%] shadow-[0_0_0_.5px_#FFF]"})})),di=new s({type:"Image",elements:{image:{render:({element:i,attributes:s,children:a,blockId:p})=>{const{src:u,alt:f,srcSet:g,bgColor:w,fit:b,sizes:v}=i.props||{},C=n(p),z=t(),R=o(),S=e("Image"),[_,k]=m({width:(null==v?void 0:v.width)||650,height:(null==v?void 0:v.height)||440});h((()=>k({width:(null==v?void 0:v.width)||650,height:(null==v?void 0:v.height)||440})),[i.props]);const E=r({blockId:p}),L=x((()=>{var t,e;return{minWidth:300,size:{width:_.width,height:_.height},maxWidth:(null===(t=null==S?void 0:S.maxSizes)||void 0===t?void 0:t.maxWidth)||800,maxHeight:(null===(e=null==S?void 0:S.maxSizes)||void 0===e?void 0:e.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!R,right:!R},handleStyles:{left:{left:0},right:{right:0}},onResize:(t,e,i)=>{R||k({width:i.offsetWidth,height:i.offsetHeight})},onResizeStop:(t,e,i)=>{R||z.blocks.Image.updateElement(p,"image",{sizes:{width:i.offsetWidth,height:i.offsetHeight}})},handleComponent:{left:R?l(d,{}):l(ci,{position:"left"}),right:R?l(d,{}):l(ci,{position:"right"})}}}),[_.width,_.height]);return u?l("div",Object.assign({"data-element-type":i.type,contentEditable:!1,draggable:!1,className:"mt-4 relative yoopta-image"},s,{children:c(F,Object.assign({},L,{className:"mx-auto my-0 flex"},{children:[E&&l("div",{className:"absolute pointer-events-none inset-0 bg-[rgba(35,131,226,0.14)] z-[81] rounded-[3px] opacity-100 transition-opacity duration-150 ease-in"}),l(y,{src:u,alt:f,srcSet:g,fit:b,width:null==_?void 0:_.width,bgColor:w,height:null==_?void 0:_.height}),!R&&l(li,{block:C,editor:z,props:i.props}),a]}))})):R?null:l(ni,Object.assign({attributes:s,blockId:p},{children:a}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},options:{display:{title:"Image",description:"Upload from device or embed with link"},onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:t=>{if("IMG"===t.nodeName){const e={src:t.getAttribute("src")||"",alt:t.getAttribute("alt")||"",srcSet:t.getAttribute("srcset")||"",sizes:{width:t.getAttribute("width")?parseInt(t.getAttribute("width")||"650",10):650,height:t.getAttribute("height")?parseInt(t.getAttribute("height")||"500",10):500}};return{id:a(),type:"image",children:[{text:""}],props:e}}}}}}});!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-\\[100\\]{z-index:100}.z-\\[81\\]{z-index:81}.m-\\[12px_0_6px\\]{margin:12px 0 6px}.m-\\[20px_0_10px\\]{margin:20px 0 10px}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.ml-\\[12px\\]{margin-left:12px}.mr-2{margin-right:.5rem}.mr-\\[12px\\]{margin-right:12px}.mt-4{margin-top:1rem}.mt-\\[4px\\]{margin-top:4px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.h-4{height:1rem}.h-\\[28px\\]{height:28px}.h-\\[32px\\]{height:32px}.h-\\[40px\\]{height:40px}.h-\\[48px\\]{height:48px}.h-full{height:100%}.max-h-\\[420px\\]{max-height:420px}.max-h-\\[50\\%\\]{max-height:50%}.w-4{width:1rem}.w-\\[15px\\]{width:15px}.w-\\[6px\\]{width:6px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[540px\\]{min-width:540px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.flex-shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.border-\\[rgba\\(255\\2c 255\\2c 255\\2c 0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.bg-\\[hsla\\(45\\2c 13\\%\\2c 94\\%\\2c \\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.bg-\\[rgb\\(35\\2c 131\\2c 226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.bg-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.bg-inherit{background-color:inherit}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\[0_8px\\]{padding:0 8px}.p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-\\[6px\\]{padding-top:6px}.pb-\\[6px\\],.py-\\[6px\\]{padding-bottom:6px}.pt-\\[6px\\]{padding-top:6px}.text-left{text-align:left}.text-\\[14px\\]{font-size:14px}.font-medium{font-weight:500}.leading-\\[1\\.2\\]{line-height:1.2}.leading-\\[120\\%\\]{line-height:120%}.leading-\\[20px\\]{line-height:20px}.text-\\[rgb\\(55\\2c 53\\2c 47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.text-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.65\\)\\]{color:rgba(55,53,47,.65)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-100{opacity:1}.shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color)}.shadow-\\[0_0_0_\\.5px_\\#FFF\\],.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color)}.shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\2c _rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\2c _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)}.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)}.shadow-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_0px_0px_1px_inset\\2c _rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-image .yoopta-image-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-image:hover .yoopta-image-options{opacity:1}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}");export{di as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAuB,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAItF,QAAA,MAAM,KAAK,8DAsDT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/ui/Image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/ui/Image.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAKzB,MAAM,gBAAgB,CAAC;AAQxB,QAAA,MAAM,WAAW,+CAAgD,wBAAwB,
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/ui/Image.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAKzB,MAAM,gBAAgB,CAAC;AAQxB,QAAA,MAAM,WAAW,+CAAgD,wBAAwB,mDA8FxF,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/image",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.7",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@radix-ui/react-icons": "^1.3.0",
|
|
40
40
|
"re-resizable": "^6.9.11"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "f5e7f29c79b383ea691a66682a44fc5a438516a2"
|
|
43
43
|
}
|