@ws-ui/shared 1.8.4-rc3 → 1.8.4-rc4
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/components/Portal.d.ts +6 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var tO=Object.defineProperty;var th=e=>{throw TypeError(e)};var nO=(e,t,n)=>t in e?tO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var me=(e,t,n)=>nO(e,typeof t!="symbol"?t+"":t,n),dl=(e,t,n)=>t.has(e)||th("Cannot "+n);var ne=(e,t,n)=>(dl(e,t,"read from private field"),n?n.call(e):t.get(e)),xt=(e,t,n)=>t.has(e)?th("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ve=(e,t,n,i)=>(dl(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),$e=(e,t,n)=>(dl(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react/jsx-runtime"),W=require("react"),Lo=require("react-dom"),et=require("@ws-ui/icons"),Cv=require("@emotion/styled"),rO=require("@emotion/react"),iO=require("re-resizable");function kv(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $=kv(W),oO=kv(Lo),$v=({children:e})=>Lo.createPortal(e,document.querySelector("body"));var nh=function(t){return t.reduce(function(n,i){var s=i[0],a=i[1];return n[s]=a,n},{})},rh=typeof window<"u"&&window.document&&window.document.createElement?$.useLayoutEffect:$.useEffect,It="top",sn="bottom",an="right",Lt="left",Rc="auto",Mo=[It,sn,an,Lt],vi="start",_o="end",sO="clippingParents",Iv="viewport",Wi="popper",aO="reference",ih=Mo.reduce(function(e,t){return e.concat([t+"-"+vi,t+"-"+_o])},[]),Lv=[].concat(Mo,[Rc]).reduce(function(e,t){return e.concat([t,t+"-"+vi,t+"-"+_o])},[]),uO="beforeRead",lO="read",cO="afterRead",fO="beforeMain",dO="main",pO="afterMain",hO="beforeWrite",gO="write",vO="afterWrite",mO=[uO,lO,cO,fO,dO,pO,hO,gO,vO];function Pn(e){return e?(e.nodeName||"").toLowerCase():null}function Ht(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function zr(e){var t=Ht(e).Element;return e instanceof t||e instanceof Element}function on(e){var t=Ht(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Pc(e){if(typeof ShadowRoot>"u")return!1;var t=Ht(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yO(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},a=t.elements[n];!on(a)||!Pn(a)||(Object.assign(a.style,i),Object.keys(s).forEach(function(l){var c=s[l];c===!1?a.removeAttribute(l):a.setAttribute(l,c===!0?"":c)}))})}function wO(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],a=t.attributes[i]||{},l=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),c=l.reduce(function(d,m){return d[m]="",d},{});!on(s)||!Pn(s)||(Object.assign(s.style,c),Object.keys(a).forEach(function(d){s.removeAttribute(d)}))})}}const bO={name:"applyStyles",enabled:!0,phase:"write",fn:yO,effect:wO,requires:["computeStyles"]};function Tn(e){return e.split("-")[0]}var Nr=Math.max,da=Math.min,mi=Math.round;function nc(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Mv(){return!/^((?!chrome|android).)*safari/i.test(nc())}function yi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),s=1,a=1;t&&on(e)&&(s=e.offsetWidth>0&&mi(i.width)/e.offsetWidth||1,a=e.offsetHeight>0&&mi(i.height)/e.offsetHeight||1);var l=zr(e)?Ht(e):window,c=l.visualViewport,d=!Mv()&&n,m=(i.left+(d&&c?c.offsetLeft:0))/s,v=(i.top+(d&&c?c.offsetTop:0))/a,g=i.width/s,p=i.height/a;return{width:g,height:p,top:v,right:m+g,bottom:v+p,left:m,x:m,y:v}}function Cc(e){var t=yi(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function Fv(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Pc(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Kn(e){return Ht(e).getComputedStyle(e)}function xO(e){return["table","td","th"].indexOf(Pn(e))>=0}function gr(e){return((zr(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return Pn(e)==="html"?e:e.assignedSlot||e.parentNode||(Pc(e)?e.host:null)||gr(e)}function oh(e){return!on(e)||Kn(e).position==="fixed"?null:e.offsetParent}function SO(e){var t=/firefox/i.test(nc()),n=/Trident/i.test(nc());if(n&&on(e)){var i=Kn(e);if(i.position==="fixed")return null}var s=Aa(e);for(Pc(s)&&(s=s.host);on(s)&&["html","body"].indexOf(Pn(s))<0;){var a=Kn(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}function Fo(e){for(var t=Ht(e),n=oh(e);n&&xO(n)&&Kn(n).position==="static";)n=oh(n);return n&&(Pn(n)==="html"||Pn(n)==="body"&&Kn(n).position==="static")?t:n||SO(e)||t}function kc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wo(e,t,n){return Nr(e,da(t,n))}function EO(e,t,n){var i=wo(e,t,n);return i>n?n:i}function Dv(){return{top:0,right:0,bottom:0,left:0}}function Nv(e){return Object.assign({},Dv(),e)}function jv(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var _O=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Nv(typeof t!="number"?t:jv(t,Mo))};function OO(e){var t,n=e.state,i=e.name,s=e.options,a=n.elements.arrow,l=n.modifiersData.popperOffsets,c=Tn(n.placement),d=kc(c),m=[Lt,an].indexOf(c)>=0,v=m?"height":"width";if(!(!a||!l)){var g=_O(s.padding,n),p=Cc(a),w=d==="y"?It:Lt,x=d==="y"?sn:an,f=n.rects.reference[v]+n.rects.reference[d]-l[d]-n.rects.popper[v],b=l[d]-n.rects.reference[d],h=Fo(a),S=h?d==="y"?h.clientHeight||0:h.clientWidth||0:0,E=f/2-b/2,R=g[w],O=S-p[v]-g[x],k=S/2-p[v]/2+E,U=wo(R,k,O),M=d;n.modifiersData[i]=(t={},t[M]=U,t.centerOffset=U-k,t)}}function AO(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Fv(t.elements.popper,s)&&(t.elements.arrow=s))}const TO={name:"arrow",enabled:!0,phase:"main",fn:OO,effect:AO,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wi(e){return e.split("-")[1]}var RO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function PO(e,t){var n=e.x,i=e.y,s=t.devicePixelRatio||1;return{x:mi(n*s)/s||0,y:mi(i*s)/s||0}}function sh(e){var t,n=e.popper,i=e.popperRect,s=e.placement,a=e.variation,l=e.offsets,c=e.position,d=e.gpuAcceleration,m=e.adaptive,v=e.roundOffsets,g=e.isFixed,p=l.x,w=p===void 0?0:p,x=l.y,f=x===void 0?0:x,b=typeof v=="function"?v({x:w,y:f}):{x:w,y:f};w=b.x,f=b.y;var h=l.hasOwnProperty("x"),S=l.hasOwnProperty("y"),E=Lt,R=It,O=window;if(m){var k=Fo(n),U="clientHeight",M="clientWidth";if(k===Ht(n)&&(k=gr(n),Kn(k).position!=="static"&&c==="absolute"&&(U="scrollHeight",M="scrollWidth")),k=k,s===It||(s===Lt||s===an)&&a===_o){R=sn;var F=g&&k===O&&O.visualViewport?O.visualViewport.height:k[U];f-=F-i.height,f*=d?1:-1}if(s===Lt||(s===It||s===sn)&&a===_o){E=an;var G=g&&k===O&&O.visualViewport?O.visualViewport.width:k[M];w-=G-i.width,w*=d?1:-1}}var j=Object.assign({position:c},m&&RO),L=v===!0?PO({x:w,y:f},Ht(n)):{x:w,y:f};if(w=L.x,f=L.y,d){var B;return Object.assign({},j,(B={},B[R]=S?"0":"",B[E]=h?"0":"",B.transform=(O.devicePixelRatio||1)<=1?"translate("+w+"px, "+f+"px)":"translate3d("+w+"px, "+f+"px, 0)",B))}return Object.assign({},j,(t={},t[R]=S?f+"px":"",t[E]=h?w+"px":"",t.transform="",t))}function CO(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,a=n.adaptive,l=a===void 0?!0:a,c=n.roundOffsets,d=c===void 0?!0:c,m={placement:Tn(t.placement),variation:wi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,sh(Object.assign({},m,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,sh(Object.assign({},m,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const kO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:CO,data:{}};var Ls={passive:!0};function $O(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,a=s===void 0?!0:s,l=i.resize,c=l===void 0?!0:l,d=Ht(t.elements.popper),m=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&m.forEach(function(v){v.addEventListener("scroll",n.update,Ls)}),c&&d.addEventListener("resize",n.update,Ls),function(){a&&m.forEach(function(v){v.removeEventListener("scroll",n.update,Ls)}),c&&d.removeEventListener("resize",n.update,Ls)}}const IO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$O,data:{}};var LO={left:"right",right:"left",bottom:"top",top:"bottom"};function na(e){return e.replace(/left|right|bottom|top/g,function(t){return LO[t]})}var MO={start:"end",end:"start"};function ah(e){return e.replace(/start|end/g,function(t){return MO[t]})}function $c(e){var t=Ht(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ic(e){return yi(gr(e)).left+$c(e).scrollLeft}function FO(e,t){var n=Ht(e),i=gr(e),s=n.visualViewport,a=i.clientWidth,l=i.clientHeight,c=0,d=0;if(s){a=s.width,l=s.height;var m=Mv();(m||!m&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}return{width:a,height:l,x:c+Ic(e),y:d}}function DO(e){var t,n=gr(e),i=$c(e),s=(t=e.ownerDocument)==null?void 0:t.body,a=Nr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=Nr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),c=-i.scrollLeft+Ic(e),d=-i.scrollTop;return Kn(s||n).direction==="rtl"&&(c+=Nr(n.clientWidth,s?s.clientWidth:0)-a),{width:a,height:l,x:c,y:d}}function Lc(e){var t=Kn(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function zv(e){return["html","body","#document"].indexOf(Pn(e))>=0?e.ownerDocument.body:on(e)&&Lc(e)?e:zv(Aa(e))}function bo(e,t){var n;t===void 0&&(t=[]);var i=zv(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),a=Ht(i),l=s?[a].concat(a.visualViewport||[],Lc(i)?i:[]):i,c=t.concat(l);return s?c:c.concat(bo(Aa(l)))}function rc(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function NO(e,t){var n=yi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function uh(e,t,n){return t===Iv?rc(FO(e,n)):zr(t)?NO(t,n):rc(DO(gr(e)))}function jO(e){var t=bo(Aa(e)),n=["absolute","fixed"].indexOf(Kn(e).position)>=0,i=n&&on(e)?Fo(e):e;return zr(i)?t.filter(function(s){return zr(s)&&Fv(s,i)&&Pn(s)!=="body"}):[]}function zO(e,t,n,i){var s=t==="clippingParents"?jO(e):[].concat(t),a=[].concat(s,[n]),l=a[0],c=a.reduce(function(d,m){var v=uh(e,m,i);return d.top=Nr(v.top,d.top),d.right=da(v.right,d.right),d.bottom=da(v.bottom,d.bottom),d.left=Nr(v.left,d.left),d},uh(e,l,i));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function Wv(e){var t=e.reference,n=e.element,i=e.placement,s=i?Tn(i):null,a=i?wi(i):null,l=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,d;switch(s){case It:d={x:l,y:t.y-n.height};break;case sn:d={x:l,y:t.y+t.height};break;case an:d={x:t.x+t.width,y:c};break;case Lt:d={x:t.x-n.width,y:c};break;default:d={x:t.x,y:t.y}}var m=s?kc(s):null;if(m!=null){var v=m==="y"?"height":"width";switch(a){case vi:d[m]=d[m]-(t[v]/2-n[v]/2);break;case _o:d[m]=d[m]+(t[v]/2-n[v]/2);break}}return d}function Oo(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,a=n.strategy,l=a===void 0?e.strategy:a,c=n.boundary,d=c===void 0?sO:c,m=n.rootBoundary,v=m===void 0?Iv:m,g=n.elementContext,p=g===void 0?Wi:g,w=n.altBoundary,x=w===void 0?!1:w,f=n.padding,b=f===void 0?0:f,h=Nv(typeof b!="number"?b:jv(b,Mo)),S=p===Wi?aO:Wi,E=e.rects.popper,R=e.elements[x?S:p],O=zO(zr(R)?R:R.contextElement||gr(e.elements.popper),d,v,l),k=yi(e.elements.reference),U=Wv({reference:k,element:E,placement:s}),M=rc(Object.assign({},E,U)),F=p===Wi?M:k,G={top:O.top-F.top+h.top,bottom:F.bottom-O.bottom+h.bottom,left:O.left-F.left+h.left,right:F.right-O.right+h.right},j=e.modifiersData.offset;if(p===Wi&&j){var L=j[s];Object.keys(G).forEach(function(B){var q=[an,sn].indexOf(B)>=0?1:-1,C=[It,sn].indexOf(B)>=0?"y":"x";G[B]+=L[C]*q})}return G}function WO(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,a=n.rootBoundary,l=n.padding,c=n.flipVariations,d=n.allowedAutoPlacements,m=d===void 0?Lv:d,v=wi(i),g=v?c?ih:ih.filter(function(x){return wi(x)===v}):Mo,p=g.filter(function(x){return m.indexOf(x)>=0});p.length===0&&(p=g);var w=p.reduce(function(x,f){return x[f]=Oo(e,{placement:f,boundary:s,rootBoundary:a,padding:l})[Tn(f)],x},{});return Object.keys(w).sort(function(x,f){return w[x]-w[f]})}function BO(e){if(Tn(e)===Rc)return[];var t=na(e);return[ah(e),t,ah(t)]}function UO(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,a=s===void 0?!0:s,l=n.altAxis,c=l===void 0?!0:l,d=n.fallbackPlacements,m=n.padding,v=n.boundary,g=n.rootBoundary,p=n.altBoundary,w=n.flipVariations,x=w===void 0?!0:w,f=n.allowedAutoPlacements,b=t.options.placement,h=Tn(b),S=h===b,E=d||(S||!x?[na(b)]:BO(b)),R=[b].concat(E).reduce(function(re,ce){return re.concat(Tn(ce)===Rc?WO(t,{placement:ce,boundary:v,rootBoundary:g,padding:m,flipVariations:x,allowedAutoPlacements:f}):ce)},[]),O=t.rects.reference,k=t.rects.popper,U=new Map,M=!0,F=R[0],G=0;G<R.length;G++){var j=R[G],L=Tn(j),B=wi(j)===vi,q=[It,sn].indexOf(L)>=0,C=q?"width":"height",J=Oo(t,{placement:j,boundary:v,rootBoundary:g,altBoundary:p,padding:m}),X=q?B?an:Lt:B?sn:It;O[C]>k[C]&&(X=na(X));var te=na(X),de=[];if(a&&de.push(J[L]<=0),c&&de.push(J[X]<=0,J[te]<=0),de.every(function(re){return re})){F=j,M=!1;break}U.set(j,de)}if(M)for(var Z=x?3:1,Q=function(ce){var fe=R.find(function(ye){var ve=U.get(ye);if(ve)return ve.slice(0,ce).every(function(Ee){return Ee})});if(fe)return F=fe,"break"},se=Z;se>0;se--){var ue=Q(se);if(ue==="break")break}t.placement!==F&&(t.modifiersData[i]._skip=!0,t.placement=F,t.reset=!0)}}const HO={name:"flip",enabled:!0,phase:"main",fn:UO,requiresIfExists:["offset"],data:{_skip:!1}};function lh(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ch(e){return[It,an,sn,Lt].some(function(t){return e[t]>=0})}function qO(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,l=Oo(t,{elementContext:"reference"}),c=Oo(t,{altBoundary:!0}),d=lh(l,i),m=lh(c,s,a),v=ch(d),g=ch(m);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:m,isReferenceHidden:v,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":v,"data-popper-escaped":g})}const ZO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qO};function KO(e,t,n){var i=Tn(e),s=[Lt,It].indexOf(i)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=a[0],c=a[1];return l=l||0,c=(c||0)*s,[Lt,an].indexOf(i)>=0?{x:c,y:l}:{x:l,y:c}}function GO(e){var t=e.state,n=e.options,i=e.name,s=n.offset,a=s===void 0?[0,0]:s,l=Lv.reduce(function(v,g){return v[g]=KO(g,t.rects,a),v},{}),c=l[t.placement],d=c.x,m=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=m),t.modifiersData[i]=l}const VO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GO};function XO(e){var t=e.state,n=e.name;t.modifiersData[n]=Wv({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const YO={name:"popperOffsets",enabled:!0,phase:"read",fn:XO,data:{}};function JO(e){return e==="x"?"y":"x"}function QO(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,a=s===void 0?!0:s,l=n.altAxis,c=l===void 0?!1:l,d=n.boundary,m=n.rootBoundary,v=n.altBoundary,g=n.padding,p=n.tether,w=p===void 0?!0:p,x=n.tetherOffset,f=x===void 0?0:x,b=Oo(t,{boundary:d,rootBoundary:m,padding:g,altBoundary:v}),h=Tn(t.placement),S=wi(t.placement),E=!S,R=kc(h),O=JO(R),k=t.modifiersData.popperOffsets,U=t.rects.reference,M=t.rects.popper,F=typeof f=="function"?f(Object.assign({},t.rects,{placement:t.placement})):f,G=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(k){if(a){var B,q=R==="y"?It:Lt,C=R==="y"?sn:an,J=R==="y"?"height":"width",X=k[R],te=X+b[q],de=X-b[C],Z=w?-M[J]/2:0,Q=S===vi?U[J]:M[J],se=S===vi?-M[J]:-U[J],ue=t.elements.arrow,re=w&&ue?Cc(ue):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Dv(),fe=ce[q],ye=ce[C],ve=wo(0,U[J],re[J]),Ee=E?U[J]/2-Z-ve-fe-G.mainAxis:Q-ve-fe-G.mainAxis,Ae=E?-U[J]/2+Z+ve+ye+G.mainAxis:se+ve+ye+G.mainAxis,qe=t.elements.arrow&&Fo(t.elements.arrow),ie=qe?R==="y"?qe.clientTop||0:qe.clientLeft||0:0,mt=(B=j==null?void 0:j[R])!=null?B:0,ut=X+Ee-mt-ie,mn=X+Ae-mt,Uo=wo(w?da(te,ut):te,X,w?Nr(de,mn):de);k[R]=Uo,L[R]=Uo-X}if(c){var Kt,Ho=R==="x"?It:Lt,Ha=R==="x"?sn:an,Mt=k[O],yt=O==="y"?"height":"width",Gn=Mt+b[Ho],wr=Mt-b[Ha],Oi=[It,Lt].indexOf(h)!==-1,Vn=(Kt=j==null?void 0:j[O])!=null?Kt:0,qo=Oi?Gn:Mt-U[yt]-M[yt]-Vn+G.altAxis,Xn=Oi?Mt+U[yt]+M[yt]-Vn-G.altAxis:wr,$n=w&&Oi?EO(qo,Mt,Xn):wo(w?qo:Gn,Mt,w?Xn:wr);k[O]=$n,L[O]=$n-Mt}t.modifiersData[i]=L}}const eA={name:"preventOverflow",enabled:!0,phase:"main",fn:QO,requiresIfExists:["offset"]};function tA(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function nA(e){return e===Ht(e)||!on(e)?$c(e):tA(e)}function rA(e){var t=e.getBoundingClientRect(),n=mi(t.width)/e.offsetWidth||1,i=mi(t.height)/e.offsetHeight||1;return n!==1||i!==1}function iA(e,t,n){n===void 0&&(n=!1);var i=on(t),s=on(t)&&rA(t),a=gr(t),l=yi(e,s,n),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(i||!i&&!n)&&((Pn(t)!=="body"||Lc(a))&&(c=nA(t)),on(t)?(d=yi(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=Ic(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function oA(e){var t=new Map,n=new Set,i=[];e.forEach(function(a){t.set(a.name,a)});function s(a){n.add(a.name);var l=[].concat(a.requires||[],a.requiresIfExists||[]);l.forEach(function(c){if(!n.has(c)){var d=t.get(c);d&&s(d)}}),i.push(a)}return e.forEach(function(a){n.has(a.name)||s(a)}),i}function sA(e){var t=oA(e);return mO.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function aA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function uA(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var fh={placement:"bottom",modifiers:[],strategy:"absolute"};function dh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function lA(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,i=n===void 0?[]:n,s=t.defaultOptions,a=s===void 0?fh:s;return function(c,d,m){m===void 0&&(m=a);var v={placement:"bottom",orderedModifiers:[],options:Object.assign({},fh,a),modifiersData:{},elements:{reference:c,popper:d},attributes:{},styles:{}},g=[],p=!1,w={state:v,setOptions:function(h){var S=typeof h=="function"?h(v.options):h;f(),v.options=Object.assign({},a,v.options,S),v.scrollParents={reference:zr(c)?bo(c):c.contextElement?bo(c.contextElement):[],popper:bo(d)};var E=sA(uA([].concat(i,v.options.modifiers)));return v.orderedModifiers=E.filter(function(R){return R.enabled}),x(),w.update()},forceUpdate:function(){if(!p){var h=v.elements,S=h.reference,E=h.popper;if(dh(S,E)){v.rects={reference:iA(S,Fo(E),v.options.strategy==="fixed"),popper:Cc(E)},v.reset=!1,v.placement=v.options.placement,v.orderedModifiers.forEach(function(G){return v.modifiersData[G.name]=Object.assign({},G.data)});for(var R=0;R<v.orderedModifiers.length;R++){if(v.reset===!0){v.reset=!1,R=-1;continue}var O=v.orderedModifiers[R],k=O.fn,U=O.options,M=U===void 0?{}:U,F=O.name;typeof k=="function"&&(v=k({state:v,options:M,name:F,instance:w})||v)}}}},update:aA(function(){return new Promise(function(b){w.forceUpdate(),b(v)})}),destroy:function(){f(),p=!0}};if(!dh(c,d))return w;w.setOptions(m).then(function(b){!p&&m.onFirstUpdate&&m.onFirstUpdate(b)});function x(){v.orderedModifiers.forEach(function(b){var h=b.name,S=b.options,E=S===void 0?{}:S,R=b.effect;if(typeof R=="function"){var O=R({state:v,name:h,instance:w,options:E}),k=function(){};g.push(O||k)}})}function f(){g.forEach(function(b){return b()}),g=[]}return w}}var cA=[IO,YO,kO,bO,VO,HO,eA,TO,ZO],fA=lA({defaultModifiers:cA}),Ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pl,ph;function dA(){if(ph)return pl;ph=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",i=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(a,l){if(a===l)return!0;if(a&&l&&typeof a=="object"&&typeof l=="object"){if(a.constructor!==l.constructor)return!1;var c,d,m;if(Array.isArray(a)){if(c=a.length,c!=l.length)return!1;for(d=c;d--!==0;)if(!s(a[d],l[d]))return!1;return!0}var v;if(t&&a instanceof Map&&l instanceof Map){if(a.size!==l.size)return!1;for(v=a.entries();!(d=v.next()).done;)if(!l.has(d.value[0]))return!1;for(v=a.entries();!(d=v.next()).done;)if(!s(d.value[1],l.get(d.value[0])))return!1;return!0}if(n&&a instanceof Set&&l instanceof Set){if(a.size!==l.size)return!1;for(v=a.entries();!(d=v.next()).done;)if(!l.has(d.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(l)){if(c=a.length,c!=l.length)return!1;for(d=c;d--!==0;)if(a[d]!==l[d])return!1;return!0}if(a.constructor===RegExp)return a.source===l.source&&a.flags===l.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof l.valueOf=="function")return a.valueOf()===l.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof l.toString=="function")return a.toString()===l.toString();if(m=Object.keys(a),c=m.length,c!==Object.keys(l).length)return!1;for(d=c;d--!==0;)if(!Object.prototype.hasOwnProperty.call(l,m[d]))return!1;if(e&&a instanceof Element)return!1;for(d=c;d--!==0;)if(!((m[d]==="_owner"||m[d]==="__v"||m[d]==="__o")&&a.$$typeof)&&!s(a[m[d]],l[m[d]]))return!1;return!0}return a!==a&&l!==l}return pl=function(l,c){try{return s(l,c)}catch(d){if((d.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw d}},pl}var pA=dA();const hA=Bv(pA);var gA=[],Uv=function(t,n,i){i===void 0&&(i={});var s=$.useRef(null),a={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||gA},l=$.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=l[0],d=l[1],m=$.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(w){var x=w.state,f=Object.keys(x.elements);oO.flushSync(function(){d({styles:nh(f.map(function(b){return[b,x.styles[b]||{}]})),attributes:nh(f.map(function(b){return[b,x.attributes[b]]}))})})},requires:["computeStyles"]}},[]),v=$.useMemo(function(){var p={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[m,{name:"applyStyles",enabled:!1}])};return hA(s.current,p)?s.current||p:(s.current=p,p)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,m]),g=$.useRef();return rh(function(){g.current&&g.current.setOptions(v)},[v]),rh(function(){if(!(t==null||n==null)){var p=i.createPopper||fA,w=p(t,n,v);return g.current=w,function(){w.destroy(),g.current=null}}},[t,n,i.createPopper]),{state:g.current?g.current.state:null,styles:c.styles,attributes:c.attributes,update:g.current?g.current.update:null,forceUpdate:g.current?g.current.forceUpdate:null}};const Hv=e=>D.jsx("div",{className:"absolute inset-0 z-[1999]",onClick:e.onClick}),qv=W.forwardRef(({children:e,style:t,attributes:n},i)=>D.jsx("div",{style:{...t,zIndex:2e3},...n,ref:i,className:"w-60 rounded border rounded border border-grey-50 bg-grey-900 shadow-2xl","data-cy":"dialogBody",children:e})),vA=({referenceElement:e,placement:t,isOpen:n,children:i,onClose:s})=>{const[a,l]=W.useState(null),{styles:c,attributes:d}=Uv(e,a,{placement:t||"bottom-start"}),m=W.useCallback(()=>{s&&s()},[s]);return n?D.jsxs($v,{children:[D.jsx(Hv,{onClick:()=>m()}),D.jsx(qv,{ref:l,style:c.popper,attributes:d.popper,children:i})]}):null};var hl={exports:{}};/*!
|
|
1
|
+
"use strict";var tO=Object.defineProperty;var th=e=>{throw TypeError(e)};var nO=(e,t,n)=>t in e?tO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var me=(e,t,n)=>nO(e,typeof t!="symbol"?t+"":t,n),dl=(e,t,n)=>t.has(e)||th("Cannot "+n);var ne=(e,t,n)=>(dl(e,t,"read from private field"),n?n.call(e):t.get(e)),xt=(e,t,n)=>t.has(e)?th("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ve=(e,t,n,i)=>(dl(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),$e=(e,t,n)=>(dl(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react/jsx-runtime"),W=require("react"),Lo=require("react-dom"),et=require("@ws-ui/icons"),Cv=require("@emotion/styled"),rO=require("@emotion/react"),iO=require("re-resizable");function kv(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $=kv(W),oO=kv(Lo),$v=({children:e,container:t=document.body})=>Lo.createPortal(e,t);var nh=function(t){return t.reduce(function(n,i){var s=i[0],a=i[1];return n[s]=a,n},{})},rh=typeof window<"u"&&window.document&&window.document.createElement?$.useLayoutEffect:$.useEffect,It="top",sn="bottom",an="right",Lt="left",Rc="auto",Mo=[It,sn,an,Lt],vi="start",_o="end",sO="clippingParents",Iv="viewport",Wi="popper",aO="reference",ih=Mo.reduce(function(e,t){return e.concat([t+"-"+vi,t+"-"+_o])},[]),Lv=[].concat(Mo,[Rc]).reduce(function(e,t){return e.concat([t,t+"-"+vi,t+"-"+_o])},[]),uO="beforeRead",lO="read",cO="afterRead",fO="beforeMain",dO="main",pO="afterMain",hO="beforeWrite",gO="write",vO="afterWrite",mO=[uO,lO,cO,fO,dO,pO,hO,gO,vO];function Pn(e){return e?(e.nodeName||"").toLowerCase():null}function Ht(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function zr(e){var t=Ht(e).Element;return e instanceof t||e instanceof Element}function on(e){var t=Ht(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Pc(e){if(typeof ShadowRoot>"u")return!1;var t=Ht(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yO(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},a=t.elements[n];!on(a)||!Pn(a)||(Object.assign(a.style,i),Object.keys(s).forEach(function(l){var c=s[l];c===!1?a.removeAttribute(l):a.setAttribute(l,c===!0?"":c)}))})}function wO(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],a=t.attributes[i]||{},l=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),c=l.reduce(function(d,m){return d[m]="",d},{});!on(s)||!Pn(s)||(Object.assign(s.style,c),Object.keys(a).forEach(function(d){s.removeAttribute(d)}))})}}const bO={name:"applyStyles",enabled:!0,phase:"write",fn:yO,effect:wO,requires:["computeStyles"]};function Tn(e){return e.split("-")[0]}var Nr=Math.max,da=Math.min,mi=Math.round;function nc(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Mv(){return!/^((?!chrome|android).)*safari/i.test(nc())}function yi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),s=1,a=1;t&&on(e)&&(s=e.offsetWidth>0&&mi(i.width)/e.offsetWidth||1,a=e.offsetHeight>0&&mi(i.height)/e.offsetHeight||1);var l=zr(e)?Ht(e):window,c=l.visualViewport,d=!Mv()&&n,m=(i.left+(d&&c?c.offsetLeft:0))/s,v=(i.top+(d&&c?c.offsetTop:0))/a,g=i.width/s,p=i.height/a;return{width:g,height:p,top:v,right:m+g,bottom:v+p,left:m,x:m,y:v}}function Cc(e){var t=yi(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function Fv(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Pc(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Kn(e){return Ht(e).getComputedStyle(e)}function xO(e){return["table","td","th"].indexOf(Pn(e))>=0}function gr(e){return((zr(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return Pn(e)==="html"?e:e.assignedSlot||e.parentNode||(Pc(e)?e.host:null)||gr(e)}function oh(e){return!on(e)||Kn(e).position==="fixed"?null:e.offsetParent}function SO(e){var t=/firefox/i.test(nc()),n=/Trident/i.test(nc());if(n&&on(e)){var i=Kn(e);if(i.position==="fixed")return null}var s=Aa(e);for(Pc(s)&&(s=s.host);on(s)&&["html","body"].indexOf(Pn(s))<0;){var a=Kn(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}function Fo(e){for(var t=Ht(e),n=oh(e);n&&xO(n)&&Kn(n).position==="static";)n=oh(n);return n&&(Pn(n)==="html"||Pn(n)==="body"&&Kn(n).position==="static")?t:n||SO(e)||t}function kc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wo(e,t,n){return Nr(e,da(t,n))}function EO(e,t,n){var i=wo(e,t,n);return i>n?n:i}function Dv(){return{top:0,right:0,bottom:0,left:0}}function Nv(e){return Object.assign({},Dv(),e)}function jv(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var _O=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Nv(typeof t!="number"?t:jv(t,Mo))};function OO(e){var t,n=e.state,i=e.name,s=e.options,a=n.elements.arrow,l=n.modifiersData.popperOffsets,c=Tn(n.placement),d=kc(c),m=[Lt,an].indexOf(c)>=0,v=m?"height":"width";if(!(!a||!l)){var g=_O(s.padding,n),p=Cc(a),w=d==="y"?It:Lt,x=d==="y"?sn:an,f=n.rects.reference[v]+n.rects.reference[d]-l[d]-n.rects.popper[v],b=l[d]-n.rects.reference[d],h=Fo(a),S=h?d==="y"?h.clientHeight||0:h.clientWidth||0:0,E=f/2-b/2,R=g[w],O=S-p[v]-g[x],k=S/2-p[v]/2+E,U=wo(R,k,O),M=d;n.modifiersData[i]=(t={},t[M]=U,t.centerOffset=U-k,t)}}function AO(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Fv(t.elements.popper,s)&&(t.elements.arrow=s))}const TO={name:"arrow",enabled:!0,phase:"main",fn:OO,effect:AO,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wi(e){return e.split("-")[1]}var RO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function PO(e,t){var n=e.x,i=e.y,s=t.devicePixelRatio||1;return{x:mi(n*s)/s||0,y:mi(i*s)/s||0}}function sh(e){var t,n=e.popper,i=e.popperRect,s=e.placement,a=e.variation,l=e.offsets,c=e.position,d=e.gpuAcceleration,m=e.adaptive,v=e.roundOffsets,g=e.isFixed,p=l.x,w=p===void 0?0:p,x=l.y,f=x===void 0?0:x,b=typeof v=="function"?v({x:w,y:f}):{x:w,y:f};w=b.x,f=b.y;var h=l.hasOwnProperty("x"),S=l.hasOwnProperty("y"),E=Lt,R=It,O=window;if(m){var k=Fo(n),U="clientHeight",M="clientWidth";if(k===Ht(n)&&(k=gr(n),Kn(k).position!=="static"&&c==="absolute"&&(U="scrollHeight",M="scrollWidth")),k=k,s===It||(s===Lt||s===an)&&a===_o){R=sn;var F=g&&k===O&&O.visualViewport?O.visualViewport.height:k[U];f-=F-i.height,f*=d?1:-1}if(s===Lt||(s===It||s===sn)&&a===_o){E=an;var G=g&&k===O&&O.visualViewport?O.visualViewport.width:k[M];w-=G-i.width,w*=d?1:-1}}var j=Object.assign({position:c},m&&RO),L=v===!0?PO({x:w,y:f},Ht(n)):{x:w,y:f};if(w=L.x,f=L.y,d){var B;return Object.assign({},j,(B={},B[R]=S?"0":"",B[E]=h?"0":"",B.transform=(O.devicePixelRatio||1)<=1?"translate("+w+"px, "+f+"px)":"translate3d("+w+"px, "+f+"px, 0)",B))}return Object.assign({},j,(t={},t[R]=S?f+"px":"",t[E]=h?w+"px":"",t.transform="",t))}function CO(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,a=n.adaptive,l=a===void 0?!0:a,c=n.roundOffsets,d=c===void 0?!0:c,m={placement:Tn(t.placement),variation:wi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,sh(Object.assign({},m,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,sh(Object.assign({},m,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const kO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:CO,data:{}};var Ls={passive:!0};function $O(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,a=s===void 0?!0:s,l=i.resize,c=l===void 0?!0:l,d=Ht(t.elements.popper),m=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&m.forEach(function(v){v.addEventListener("scroll",n.update,Ls)}),c&&d.addEventListener("resize",n.update,Ls),function(){a&&m.forEach(function(v){v.removeEventListener("scroll",n.update,Ls)}),c&&d.removeEventListener("resize",n.update,Ls)}}const IO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$O,data:{}};var LO={left:"right",right:"left",bottom:"top",top:"bottom"};function na(e){return e.replace(/left|right|bottom|top/g,function(t){return LO[t]})}var MO={start:"end",end:"start"};function ah(e){return e.replace(/start|end/g,function(t){return MO[t]})}function $c(e){var t=Ht(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ic(e){return yi(gr(e)).left+$c(e).scrollLeft}function FO(e,t){var n=Ht(e),i=gr(e),s=n.visualViewport,a=i.clientWidth,l=i.clientHeight,c=0,d=0;if(s){a=s.width,l=s.height;var m=Mv();(m||!m&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}return{width:a,height:l,x:c+Ic(e),y:d}}function DO(e){var t,n=gr(e),i=$c(e),s=(t=e.ownerDocument)==null?void 0:t.body,a=Nr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=Nr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),c=-i.scrollLeft+Ic(e),d=-i.scrollTop;return Kn(s||n).direction==="rtl"&&(c+=Nr(n.clientWidth,s?s.clientWidth:0)-a),{width:a,height:l,x:c,y:d}}function Lc(e){var t=Kn(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function zv(e){return["html","body","#document"].indexOf(Pn(e))>=0?e.ownerDocument.body:on(e)&&Lc(e)?e:zv(Aa(e))}function bo(e,t){var n;t===void 0&&(t=[]);var i=zv(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),a=Ht(i),l=s?[a].concat(a.visualViewport||[],Lc(i)?i:[]):i,c=t.concat(l);return s?c:c.concat(bo(Aa(l)))}function rc(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function NO(e,t){var n=yi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function uh(e,t,n){return t===Iv?rc(FO(e,n)):zr(t)?NO(t,n):rc(DO(gr(e)))}function jO(e){var t=bo(Aa(e)),n=["absolute","fixed"].indexOf(Kn(e).position)>=0,i=n&&on(e)?Fo(e):e;return zr(i)?t.filter(function(s){return zr(s)&&Fv(s,i)&&Pn(s)!=="body"}):[]}function zO(e,t,n,i){var s=t==="clippingParents"?jO(e):[].concat(t),a=[].concat(s,[n]),l=a[0],c=a.reduce(function(d,m){var v=uh(e,m,i);return d.top=Nr(v.top,d.top),d.right=da(v.right,d.right),d.bottom=da(v.bottom,d.bottom),d.left=Nr(v.left,d.left),d},uh(e,l,i));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function Wv(e){var t=e.reference,n=e.element,i=e.placement,s=i?Tn(i):null,a=i?wi(i):null,l=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,d;switch(s){case It:d={x:l,y:t.y-n.height};break;case sn:d={x:l,y:t.y+t.height};break;case an:d={x:t.x+t.width,y:c};break;case Lt:d={x:t.x-n.width,y:c};break;default:d={x:t.x,y:t.y}}var m=s?kc(s):null;if(m!=null){var v=m==="y"?"height":"width";switch(a){case vi:d[m]=d[m]-(t[v]/2-n[v]/2);break;case _o:d[m]=d[m]+(t[v]/2-n[v]/2);break}}return d}function Oo(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,a=n.strategy,l=a===void 0?e.strategy:a,c=n.boundary,d=c===void 0?sO:c,m=n.rootBoundary,v=m===void 0?Iv:m,g=n.elementContext,p=g===void 0?Wi:g,w=n.altBoundary,x=w===void 0?!1:w,f=n.padding,b=f===void 0?0:f,h=Nv(typeof b!="number"?b:jv(b,Mo)),S=p===Wi?aO:Wi,E=e.rects.popper,R=e.elements[x?S:p],O=zO(zr(R)?R:R.contextElement||gr(e.elements.popper),d,v,l),k=yi(e.elements.reference),U=Wv({reference:k,element:E,placement:s}),M=rc(Object.assign({},E,U)),F=p===Wi?M:k,G={top:O.top-F.top+h.top,bottom:F.bottom-O.bottom+h.bottom,left:O.left-F.left+h.left,right:F.right-O.right+h.right},j=e.modifiersData.offset;if(p===Wi&&j){var L=j[s];Object.keys(G).forEach(function(B){var q=[an,sn].indexOf(B)>=0?1:-1,C=[It,sn].indexOf(B)>=0?"y":"x";G[B]+=L[C]*q})}return G}function WO(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,a=n.rootBoundary,l=n.padding,c=n.flipVariations,d=n.allowedAutoPlacements,m=d===void 0?Lv:d,v=wi(i),g=v?c?ih:ih.filter(function(x){return wi(x)===v}):Mo,p=g.filter(function(x){return m.indexOf(x)>=0});p.length===0&&(p=g);var w=p.reduce(function(x,f){return x[f]=Oo(e,{placement:f,boundary:s,rootBoundary:a,padding:l})[Tn(f)],x},{});return Object.keys(w).sort(function(x,f){return w[x]-w[f]})}function BO(e){if(Tn(e)===Rc)return[];var t=na(e);return[ah(e),t,ah(t)]}function UO(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,a=s===void 0?!0:s,l=n.altAxis,c=l===void 0?!0:l,d=n.fallbackPlacements,m=n.padding,v=n.boundary,g=n.rootBoundary,p=n.altBoundary,w=n.flipVariations,x=w===void 0?!0:w,f=n.allowedAutoPlacements,b=t.options.placement,h=Tn(b),S=h===b,E=d||(S||!x?[na(b)]:BO(b)),R=[b].concat(E).reduce(function(re,ce){return re.concat(Tn(ce)===Rc?WO(t,{placement:ce,boundary:v,rootBoundary:g,padding:m,flipVariations:x,allowedAutoPlacements:f}):ce)},[]),O=t.rects.reference,k=t.rects.popper,U=new Map,M=!0,F=R[0],G=0;G<R.length;G++){var j=R[G],L=Tn(j),B=wi(j)===vi,q=[It,sn].indexOf(L)>=0,C=q?"width":"height",J=Oo(t,{placement:j,boundary:v,rootBoundary:g,altBoundary:p,padding:m}),X=q?B?an:Lt:B?sn:It;O[C]>k[C]&&(X=na(X));var te=na(X),de=[];if(a&&de.push(J[L]<=0),c&&de.push(J[X]<=0,J[te]<=0),de.every(function(re){return re})){F=j,M=!1;break}U.set(j,de)}if(M)for(var Z=x?3:1,Q=function(ce){var fe=R.find(function(ye){var ve=U.get(ye);if(ve)return ve.slice(0,ce).every(function(Ee){return Ee})});if(fe)return F=fe,"break"},se=Z;se>0;se--){var ue=Q(se);if(ue==="break")break}t.placement!==F&&(t.modifiersData[i]._skip=!0,t.placement=F,t.reset=!0)}}const HO={name:"flip",enabled:!0,phase:"main",fn:UO,requiresIfExists:["offset"],data:{_skip:!1}};function lh(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ch(e){return[It,an,sn,Lt].some(function(t){return e[t]>=0})}function qO(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,l=Oo(t,{elementContext:"reference"}),c=Oo(t,{altBoundary:!0}),d=lh(l,i),m=lh(c,s,a),v=ch(d),g=ch(m);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:m,isReferenceHidden:v,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":v,"data-popper-escaped":g})}const ZO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qO};function KO(e,t,n){var i=Tn(e),s=[Lt,It].indexOf(i)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=a[0],c=a[1];return l=l||0,c=(c||0)*s,[Lt,an].indexOf(i)>=0?{x:c,y:l}:{x:l,y:c}}function GO(e){var t=e.state,n=e.options,i=e.name,s=n.offset,a=s===void 0?[0,0]:s,l=Lv.reduce(function(v,g){return v[g]=KO(g,t.rects,a),v},{}),c=l[t.placement],d=c.x,m=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=m),t.modifiersData[i]=l}const VO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GO};function XO(e){var t=e.state,n=e.name;t.modifiersData[n]=Wv({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const YO={name:"popperOffsets",enabled:!0,phase:"read",fn:XO,data:{}};function JO(e){return e==="x"?"y":"x"}function QO(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,a=s===void 0?!0:s,l=n.altAxis,c=l===void 0?!1:l,d=n.boundary,m=n.rootBoundary,v=n.altBoundary,g=n.padding,p=n.tether,w=p===void 0?!0:p,x=n.tetherOffset,f=x===void 0?0:x,b=Oo(t,{boundary:d,rootBoundary:m,padding:g,altBoundary:v}),h=Tn(t.placement),S=wi(t.placement),E=!S,R=kc(h),O=JO(R),k=t.modifiersData.popperOffsets,U=t.rects.reference,M=t.rects.popper,F=typeof f=="function"?f(Object.assign({},t.rects,{placement:t.placement})):f,G=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(k){if(a){var B,q=R==="y"?It:Lt,C=R==="y"?sn:an,J=R==="y"?"height":"width",X=k[R],te=X+b[q],de=X-b[C],Z=w?-M[J]/2:0,Q=S===vi?U[J]:M[J],se=S===vi?-M[J]:-U[J],ue=t.elements.arrow,re=w&&ue?Cc(ue):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Dv(),fe=ce[q],ye=ce[C],ve=wo(0,U[J],re[J]),Ee=E?U[J]/2-Z-ve-fe-G.mainAxis:Q-ve-fe-G.mainAxis,Ae=E?-U[J]/2+Z+ve+ye+G.mainAxis:se+ve+ye+G.mainAxis,qe=t.elements.arrow&&Fo(t.elements.arrow),ie=qe?R==="y"?qe.clientTop||0:qe.clientLeft||0:0,mt=(B=j==null?void 0:j[R])!=null?B:0,ut=X+Ee-mt-ie,mn=X+Ae-mt,Uo=wo(w?da(te,ut):te,X,w?Nr(de,mn):de);k[R]=Uo,L[R]=Uo-X}if(c){var Kt,Ho=R==="x"?It:Lt,Ha=R==="x"?sn:an,Mt=k[O],yt=O==="y"?"height":"width",Gn=Mt+b[Ho],wr=Mt-b[Ha],Oi=[It,Lt].indexOf(h)!==-1,Vn=(Kt=j==null?void 0:j[O])!=null?Kt:0,qo=Oi?Gn:Mt-U[yt]-M[yt]-Vn+G.altAxis,Xn=Oi?Mt+U[yt]+M[yt]-Vn-G.altAxis:wr,$n=w&&Oi?EO(qo,Mt,Xn):wo(w?qo:Gn,Mt,w?Xn:wr);k[O]=$n,L[O]=$n-Mt}t.modifiersData[i]=L}}const eA={name:"preventOverflow",enabled:!0,phase:"main",fn:QO,requiresIfExists:["offset"]};function tA(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function nA(e){return e===Ht(e)||!on(e)?$c(e):tA(e)}function rA(e){var t=e.getBoundingClientRect(),n=mi(t.width)/e.offsetWidth||1,i=mi(t.height)/e.offsetHeight||1;return n!==1||i!==1}function iA(e,t,n){n===void 0&&(n=!1);var i=on(t),s=on(t)&&rA(t),a=gr(t),l=yi(e,s,n),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(i||!i&&!n)&&((Pn(t)!=="body"||Lc(a))&&(c=nA(t)),on(t)?(d=yi(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=Ic(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function oA(e){var t=new Map,n=new Set,i=[];e.forEach(function(a){t.set(a.name,a)});function s(a){n.add(a.name);var l=[].concat(a.requires||[],a.requiresIfExists||[]);l.forEach(function(c){if(!n.has(c)){var d=t.get(c);d&&s(d)}}),i.push(a)}return e.forEach(function(a){n.has(a.name)||s(a)}),i}function sA(e){var t=oA(e);return mO.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function aA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function uA(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var fh={placement:"bottom",modifiers:[],strategy:"absolute"};function dh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function lA(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,i=n===void 0?[]:n,s=t.defaultOptions,a=s===void 0?fh:s;return function(c,d,m){m===void 0&&(m=a);var v={placement:"bottom",orderedModifiers:[],options:Object.assign({},fh,a),modifiersData:{},elements:{reference:c,popper:d},attributes:{},styles:{}},g=[],p=!1,w={state:v,setOptions:function(h){var S=typeof h=="function"?h(v.options):h;f(),v.options=Object.assign({},a,v.options,S),v.scrollParents={reference:zr(c)?bo(c):c.contextElement?bo(c.contextElement):[],popper:bo(d)};var E=sA(uA([].concat(i,v.options.modifiers)));return v.orderedModifiers=E.filter(function(R){return R.enabled}),x(),w.update()},forceUpdate:function(){if(!p){var h=v.elements,S=h.reference,E=h.popper;if(dh(S,E)){v.rects={reference:iA(S,Fo(E),v.options.strategy==="fixed"),popper:Cc(E)},v.reset=!1,v.placement=v.options.placement,v.orderedModifiers.forEach(function(G){return v.modifiersData[G.name]=Object.assign({},G.data)});for(var R=0;R<v.orderedModifiers.length;R++){if(v.reset===!0){v.reset=!1,R=-1;continue}var O=v.orderedModifiers[R],k=O.fn,U=O.options,M=U===void 0?{}:U,F=O.name;typeof k=="function"&&(v=k({state:v,options:M,name:F,instance:w})||v)}}}},update:aA(function(){return new Promise(function(b){w.forceUpdate(),b(v)})}),destroy:function(){f(),p=!0}};if(!dh(c,d))return w;w.setOptions(m).then(function(b){!p&&m.onFirstUpdate&&m.onFirstUpdate(b)});function x(){v.orderedModifiers.forEach(function(b){var h=b.name,S=b.options,E=S===void 0?{}:S,R=b.effect;if(typeof R=="function"){var O=R({state:v,name:h,instance:w,options:E}),k=function(){};g.push(O||k)}})}function f(){g.forEach(function(b){return b()}),g=[]}return w}}var cA=[IO,YO,kO,bO,VO,HO,eA,TO,ZO],fA=lA({defaultModifiers:cA}),Ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pl,ph;function dA(){if(ph)return pl;ph=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",i=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(a,l){if(a===l)return!0;if(a&&l&&typeof a=="object"&&typeof l=="object"){if(a.constructor!==l.constructor)return!1;var c,d,m;if(Array.isArray(a)){if(c=a.length,c!=l.length)return!1;for(d=c;d--!==0;)if(!s(a[d],l[d]))return!1;return!0}var v;if(t&&a instanceof Map&&l instanceof Map){if(a.size!==l.size)return!1;for(v=a.entries();!(d=v.next()).done;)if(!l.has(d.value[0]))return!1;for(v=a.entries();!(d=v.next()).done;)if(!s(d.value[1],l.get(d.value[0])))return!1;return!0}if(n&&a instanceof Set&&l instanceof Set){if(a.size!==l.size)return!1;for(v=a.entries();!(d=v.next()).done;)if(!l.has(d.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(l)){if(c=a.length,c!=l.length)return!1;for(d=c;d--!==0;)if(a[d]!==l[d])return!1;return!0}if(a.constructor===RegExp)return a.source===l.source&&a.flags===l.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof l.valueOf=="function")return a.valueOf()===l.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof l.toString=="function")return a.toString()===l.toString();if(m=Object.keys(a),c=m.length,c!==Object.keys(l).length)return!1;for(d=c;d--!==0;)if(!Object.prototype.hasOwnProperty.call(l,m[d]))return!1;if(e&&a instanceof Element)return!1;for(d=c;d--!==0;)if(!((m[d]==="_owner"||m[d]==="__v"||m[d]==="__o")&&a.$$typeof)&&!s(a[m[d]],l[m[d]]))return!1;return!0}return a!==a&&l!==l}return pl=function(l,c){try{return s(l,c)}catch(d){if((d.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw d}},pl}var pA=dA();const hA=Bv(pA);var gA=[],Uv=function(t,n,i){i===void 0&&(i={});var s=$.useRef(null),a={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||gA},l=$.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=l[0],d=l[1],m=$.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(w){var x=w.state,f=Object.keys(x.elements);oO.flushSync(function(){d({styles:nh(f.map(function(b){return[b,x.styles[b]||{}]})),attributes:nh(f.map(function(b){return[b,x.attributes[b]]}))})})},requires:["computeStyles"]}},[]),v=$.useMemo(function(){var p={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[m,{name:"applyStyles",enabled:!1}])};return hA(s.current,p)?s.current||p:(s.current=p,p)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,m]),g=$.useRef();return rh(function(){g.current&&g.current.setOptions(v)},[v]),rh(function(){if(!(t==null||n==null)){var p=i.createPopper||fA,w=p(t,n,v);return g.current=w,function(){w.destroy(),g.current=null}}},[t,n,i.createPopper]),{state:g.current?g.current.state:null,styles:c.styles,attributes:c.attributes,update:g.current?g.current.update:null,forceUpdate:g.current?g.current.forceUpdate:null}};const Hv=e=>D.jsx("div",{className:"absolute inset-0 z-[1999]",onClick:e.onClick}),qv=W.forwardRef(({children:e,style:t,attributes:n},i)=>D.jsx("div",{style:{...t,zIndex:2e3},...n,ref:i,className:"w-60 rounded border rounded border border-grey-50 bg-grey-900 shadow-2xl","data-cy":"dialogBody",children:e})),vA=({referenceElement:e,placement:t,isOpen:n,children:i,onClose:s})=>{const[a,l]=W.useState(null),{styles:c,attributes:d}=Uv(e,a,{placement:t||"bottom-start"}),m=W.useCallback(()=>{s&&s()},[s]);return n?D.jsxs($v,{children:[D.jsx(Hv,{onClick:()=>m()}),D.jsx(qv,{ref:l,style:c.popper,attributes:d.popper,children:i})]}):null};var hl={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|