1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8446],{30073:function(e,t,o){var n=o(64836);t.Z=void 0;var r=n(o(64938)),i=o(85893),a=(0,r.default)([(0,i.jsx)("path",{d:"M8 16h12V4H8v12zm2-7h3V6h2v3h3v2h-3v3h-2v-3h-3V9z",opacity:".3"},"0"),(0,i.jsx)("path",{d:"M4 22h14v-2H4V6H2v14c0 1.1.9 2 2 2zM8 2c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2H8zm12 14H8V4h12v12zm-7-2h2v-3h3V9h-3V6h-2v3h-3v2h3z"},"1")],"LibraryAddTwoTone");t.Z=a},9404:function(e,t,o){o.d(t,{Z:function(){return n}});const n=(0,o(45711).Z)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},62841:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowContainer=void 0;var r=o(85893),i=o(67294),a=o(9512);t.ArrowContainer=function(e){var t=e.childRect,o=e.popoverRect,c=e.position,u=e.arrowColor,l=e.arrowSize,d=e.arrowClassName,s=e.arrowStyle,p=e.className,f=e.children,v=e.style,h=(0,a.useArrowContainer)({childRect:t,popoverRect:o,position:c,arrowColor:u,arrowSize:l}),g=h.arrowContainerStyle,m=h.arrowStyle,b=(0,i.useMemo)((function(){return n(n({},g),v)}),[g,v]),y=(0,i.useMemo)((function(){return n(n({},m),s)}),[m,s]);return(0,r.jsxs)("div",{className:p,style:b,children:[(0,r.jsx)("div",{style:y,className:d}),f]})}},82106:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Popover=t.usePopover=t.ArrowContainer=t.useArrowContainer=void 0;var r=o(85893),i=o(67294),a=o(95114),c=o(62319),u=o(91101);Object.defineProperty(t,"usePopover",{enumerable:!0,get:function(){return u.usePopover}});var l=o(16444),d=o(9270),s=o(9512);Object.defineProperty(t,"useArrowContainer",{enumerable:!0,get:function(){return s.useArrowContainer}});var p=o(62841);Object.defineProperty(t,"ArrowContainer",{enumerable:!0,get:function(){return p.ArrowContainer}});var f=["top","left","right","bottom"],v=(0,i.forwardRef)((function(e,t){var o=e.isOpen,n=e.children,s=e.content,p=e.positions,v=void 0===p?f:p,h=e.align,g=void 0===h?"center":h,m=e.padding,b=void 0===m?0:m,y=e.reposition,R=void 0===y||y,w=e.parentElement,P=void 0===w?window.document.body:w,C=e.boundaryElement,E=void 0===C?P:C,M=e.containerClassName,x=e.containerStyle,_=e.transform,j=e.transformMode,O=void 0===j?"absolute":j,N=e.boundaryInset,T=void 0===N?0:N,A=e.onClickOutside,k=e.clickOutsideCapture,L=void 0!==k&&k,V=(0,l.useMemoizedArray)(Array.isArray(v)?v:[v]),I=(0,d.useHandlePrevValues)({positions:V,reposition:R,transformMode:O,transform:_,boundaryElement:E,boundaryInset:T}),S=I.prev,z=I.updatePrevValues,B=(0,i.useRef)(),Y=(0,i.useState)({align:g,nudgedLeft:0,nudgedTop:0,position:V[0],padding:b,childRect:c.EMPTY_RECT,popoverRect:c.EMPTY_RECT,parentRect:c.EMPTY_RECT,boundaryRect:c.EMPTY_RECT,boundaryInset:T,violations:c.EMPTY_RECT,hasViolations:!1}),H=Y[0],F=Y[1],q=(0,i.useCallback)((function(e){return F(e)}),[]),Z=(0,u.usePopover)({isOpen:o,childRef:B,containerClassName:M,parentElement:P,boundaryElement:E,transform:_,transformMode:O,positions:V,align:g,padding:b,boundaryInset:T,reposition:R,onPositionPopover:q}),D=Z.positionPopover,G=Z.popoverRef,J=Z.scoutRef;(0,i.useLayoutEffect)((function(){var e=!0,t=function(){var n,r;if(o&&e){var i=null===(n=null===B||void 0===B?void 0:B.current)||void 0===n?void 0:n.getBoundingClientRect(),a=null===(r=null===G||void 0===G?void 0:G.current)||void 0===r?void 0:r.getBoundingClientRect();null==i||null==a||(0,c.rectsAreEqual)(i,H.childRect)&&a.width===H.popoverRect.width&&a.height===H.popoverRect.height&&H.padding===b&&H.align===g&&V===S.positions&&R===S.reposition&&O===S.transformMode&&_===S.transform&&E===S.boundaryElement&&T===S.boundaryInset||D(),z(),e&&window.requestAnimationFrame(t)}};return window.requestAnimationFrame(t),function(){e=!1}}),[g,E,T,o,b,G,H.align,H.childRect,H.padding,H.popoverRect.height,H.popoverRect.width,D,V,S.boundaryElement,S.boundaryInset,S.positions,S.reposition,S.transform,S.transformMode,R,_,O,z]),(0,i.useEffect)((function(){var e=G.current;return Object.assign(e.style,x),function(){Object.keys(null!==x&&void 0!==x?x:{}).forEach((function(t){return delete e.style[t]}))}}),[x,o,G]);var K=(0,i.useCallback)((function(e){var t,n;!o||(null===(t=G.current)||void 0===t?void 0:t.contains(e.target))||(null===(n=B.current)||void 0===n?void 0:n.contains(e.target))||null===A||void 0===A||A(e)}),[o,A,G]),Q=(0,i.useCallback)((function(){B.current&&window.requestAnimationFrame((function(){return D()}))}),[D]);(0,i.useEffect)((function(){var e=P.ownerDocument.body;return e.addEventListener("click",K,L),e.addEventListener("contextmenu",K,L),e.addEventListener("resize",Q),function(){e.removeEventListener("click",K,L),e.removeEventListener("contextmenu",K,L),e.removeEventListener("resize",Q)}}),[L,K,Q,P]);var U=(0,i.useCallback)((function(e){B.current=e,null!=t&&("object"===typeof t?t.current=e:"function"===typeof t&&t(e))}),[t]);return(0,r.jsxs)(r.Fragment,{children:[(0,i.cloneElement)(n,{ref:U}),o?(0,r.jsx)(a.PopoverPortal,{element:G.current,scoutElement:J.current,container:P,children:"function"===typeof s?s(H):s}):null]})}));t.Popover=(0,i.forwardRef)((function(e,t){return"undefined"===typeof window?e.children:(0,r.jsx)(v,n({},e,{ref:t}))}))},95114:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPortal=void 0;var n=o(67294),r=o(73935);t.PopoverPortal=function(e){var t=e.container,o=e.element,i=e.scoutElement,a=e.children;return(0,n.useLayoutEffect)((function(){return t.appendChild(o),t.appendChild(i),function(){t.removeChild(o),t.removeChild(i)}}),[t,o,i]),(0,r.createPortal)(a,o)}},9512:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useArrowContainer=void 0;var r=o(67294);t.useArrowContainer=function(e){var t=e.childRect,o=e.popoverRect,i=e.position,a=e.arrowSize,c=e.arrowColor;return{arrowContainerStyle:(0,r.useMemo)((function(){return{padding:a}}),[a]),arrowStyle:(0,r.useMemo)((function(){return n({position:"absolute"},function(){var e=2*a,n=t.top-o.top+t.height/2-e/2,r=t.left-o.left+t.width/2-e/2,u=a,l=o.width-a,d=o.height-a;switch(r=(r=r<u?u:r)+e>l?l-e:r,n=(n=n<u?u:n)+e>d?d-e:n,n=Number.isNaN(n)?0:n,r=Number.isNaN(r)?0:r,i){case"right":return{borderTop:"".concat(a,"px solid transparent"),borderBottom:"".concat(a,"px solid transparent"),borderRight:"".concat(a,"px solid ").concat(c),left:0,top:n};case"left":return{borderTop:"".concat(a,"px solid transparent"),borderBottom:"".concat(a,"px solid transparent"),borderLeft:"".concat(a,"px solid ").concat(c),right:0,top:n};case"bottom":return{borderLeft:"".concat(a,"px solid transparent"),borderRight:"".concat(a,"px solid transparent"),borderBottom:"".concat(a,"px solid ").concat(c),top:0,left:r};case"top":return{borderLeft:"".concat(a,"px solid transparent"),borderRight:"".concat(a,"px solid transparent"),borderTop:"".concat(a,"px solid ").concat(c),bottom:0,left:r};default:return{display:"hidden"}}}())}),[c,a,t.height,t.left,t.top,t.width,o.height,o.left,o.top,o.width,i])}}},83423:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.useElementRef=void 0;var n=o(67294),r=o(62319);t.useElementRef=function(e){var t=e.containerClassName,o=e.containerStyle,i=(0,n.useRef)(),a=(0,n.useState)((function(){return(0,r.createContainer)({containerStyle:o,containerClassName:t})}))[0];return(0,n.useLayoutEffect)((function(){a.className=t}),[t,a]),(0,n.useLayoutEffect)((function(){Object.assign(a.style,o)}),[o,a]),i.current=a,i}},9270:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.useHandlePrevValues=void 0;var n=o(67294);t.useHandlePrevValues=function(e){var t=(0,n.useRef)(e.positions),o=(0,n.useRef)(e.reposition),r=(0,n.useRef)(e.transformMode),i=(0,n.useRef)(e.transform),a=(0,n.useRef)(e.boundaryElement),c=(0,n.useRef)(e.boundaryInset),u=(0,n.useCallback)((function(){t.current=e.positions,o.current=e.reposition,r.current=e.transformMode,i.current=e.transform,a.current=e.boundaryElement,c.current=e.boundaryInset}),[e.boundaryElement,e.boundaryInset,e.positions,e.reposition,e.transform,e.transformMode]);return{prev:{positions:t.current,reposition:o.current,transformMode:r.current,transform:i.current,boundaryElement:a.current,boundaryInset:c.current},updatePrevValues:u}}},16444:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.useMemoizedArray=void 0;var n=o(67294);t.useMemoizedArray=function(e){var t=(0,n.useRef)(e);return(0,n.useMemo)((function(){if(t.current===e)return t.current;if(t.current.length!==e.length)return t.current=e,e;for(var o=0;o<e.length;o+=1)if(e[o]!==t.current[o])return t.current=e,e;return t.current}),[e])}},91101:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.usePopover=void 0;var n=o(67294),r=o(62319),i=o(83423),a={position:"fixed",overflow:"visible",top:"0px",left:"0px"},c={position:"fixed",top:"0px",left:"0px",width:"0px",height:"0px",visibility:"hidden"};t.usePopover=function(e){var t=e.isOpen,o=e.childRef,u=e.positions,l=e.containerClassName,d=e.parentElement,s=e.transform,p=e.transformMode,f=e.align,v=e.padding,h=e.reposition,g=e.boundaryInset,m=e.boundaryElement,b=e.onPositionPopover,y=(0,i.useElementRef)({containerClassName:"react-tiny-popover-scout",containerStyle:c}),R=(0,i.useElementRef)({containerClassName:null!=l&&l.length>0&&"react-tiny-popover-container"!==l?"react-tiny-popover-container ".concat(l):"react-tiny-popover-container",containerStyle:a}),w=(0,n.useCallback)((function(e){var n,i,a=void 0===e?{}:e,c=a.positionIndex,l=void 0===c?0:c,P=a.parentRect,C=void 0===P?d.getBoundingClientRect():P,E=a.childRect,M=void 0===E?null===(n=null===o||void 0===o?void 0:o.current)||void 0===n?void 0:n.getBoundingClientRect():E,x=a.scoutRect,_=void 0===x?null===(i=null===y||void 0===y?void 0:y.current)||void 0===i?void 0:i.getBoundingClientRect():x,j=a.popoverRect,O=void 0===j?R.current.getBoundingClientRect():j,N=a.boundaryRect,T=void 0===N?m===d?C:m.getBoundingClientRect():N;if(M&&C&&t){if(s&&"absolute"===p){var A="function"===typeof s?s({childRect:M,popoverRect:O,parentRect:C,boundaryRect:T,padding:v,align:f,nudgedTop:0,nudgedLeft:0,boundaryInset:g,violations:r.EMPTY_RECT,hasViolations:!1}):s,k=A.top,L=A.left,V=Math.round(C.left+L-_.left),I=Math.round(C.top+k-_.top);return R.current.style.transform="translate(".concat(V,"px, ").concat(I,"px)"),void b({childRect:M,popoverRect:(0,r.createRect)({left:V,top:I,width:O.width,height:O.height}),parentRect:C,boundaryRect:T,padding:v,align:f,transform:{top:k,left:L},nudgedTop:0,nudgedLeft:0,boundaryInset:g,violations:r.EMPTY_RECT,hasViolations:!1})}var S=l===u.length,z=S?u[0]:u[l],B=(0,r.getNewPopoverRect)({childRect:M,popoverRect:O,boundaryRect:T,position:z,align:f,padding:v,reposition:h},g),Y=B.rect;if(B.boundaryViolation&&h&&!S)w({positionIndex:l+1,childRect:M,popoverRect:O,parentRect:C,boundaryRect:T});else{var H=Y.top,F=Y.left,q=Y.width,Z=Y.height,D=h&&!S,G=(0,r.getNudgedPopoverRect)(Y,T,g),J=G.left,K=G.top,Q=H,U=F;D&&(Q=K,U=J),Q=Math.round(Q-_.top),U=Math.round(U-_.left),R.current.style.transform="translate(".concat(U,"px, ").concat(Q,"px)");var W={top:T.top+g-Q,left:T.left+g-U,right:U+q-T.right+g,bottom:Q+Z-T.bottom+g},X={childRect:M,popoverRect:(0,r.createRect)({left:U,top:Q,width:q,height:Z}),parentRect:C,boundaryRect:T,position:z,align:f,padding:v,nudgedTop:K-H,nudgedLeft:J-F,boundaryInset:g,violations:{top:W.top<=0?0:W.top,left:W.left<=0?0:W.left,right:W.right<=0?0:W.right,bottom:W.bottom<=0?0:W.bottom},hasViolations:W.top>0||W.left>0||W.right>0||W.bottom>0};if(s){b(X);var $="function"===typeof s?s(X):s,ee=$.top,te=$.left;R.current.style.transform="translate(".concat(Math.round(U+(null!==te&&void 0!==te?te:0)),"px, ").concat(Math.round(Q+(null!==ee&&void 0!==ee?ee:0)),"px)"),X.nudgedLeft+=null!==te&&void 0!==te?te:0,X.nudgedTop+=null!==ee&&void 0!==ee?ee:0,X.transform={top:ee,left:te}}b(X)}}}),[d,o,y,R,m,t,s,p,u,f,v,h,g,b]);return{positionPopover:w,popoverRef:R,scoutRef:y}}},62319:function(e,t){var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},o.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getNudgedPopoverRect=t.getNewPopoverRect=t.popoverRectForPosition=t.createContainer=t.rectsAreEqual=t.createRect=t.EMPTY_RECT=void 0,t.EMPTY_RECT={top:0,left:0,right:0,bottom:0,width:0,height:0};t.createRect=function(e){var t=e.top,o=e.left,n=e.width,r=e.height;return{top:t,left:o,width:n,height:r,right:o+n,bottom:t+r}};t.rectsAreEqual=function(e,t){return e===t||(null===e||void 0===e?void 0:e.bottom)===(null===t||void 0===t?void 0:t.bottom)&&(null===e||void 0===e?void 0:e.height)===(null===t||void 0===t?void 0:t.height)&&(null===e||void 0===e?void 0:e.left)===(null===t||void 0===t?void 0:t.left)&&(null===e||void 0===e?void 0:e.right)===(null===t||void 0===t?void 0:t.right)&&(null===e||void 0===e?void 0:e.top)===(null===t||void 0===t?void 0:t.top)&&(null===e||void 0===e?void 0:e.width)===(null===t||void 0===t?void 0:t.width)};t.createContainer=function(e){var t=e.containerStyle,o=e.containerClassName,n=window.document.createElement("div");return o&&(n.className=o),Object.assign(n.style,t),n};t.popoverRectForPosition=function(e,o,n,r,i){var a,c,u=o.left+o.width/2,l=o.top+o.height/2,d=n.width,s=n.height;switch(e){case"left":a=l-s/2,c=o.left-r-d,"start"===i&&(a=o.top),"end"===i&&(a=o.bottom-s);break;case"bottom":a=o.bottom+r,c=u-d/2,"start"===i&&(c=o.left),"end"===i&&(c=o.right-d);break;case"right":a=l-s/2,c=o.right+r,"start"===i&&(a=o.top),"end"===i&&(a=o.bottom-s);break;default:a=o.top-s-r,c=u-d/2,"start"===i&&(c=o.left),"end"===i&&(c=o.right-d)}return(0,t.createRect)({left:c,top:a,width:d,height:s})};t.getNewPopoverRect=function(e,o){var n=e.position,r=e.align,i=e.childRect,a=e.popoverRect,c=e.boundaryRect,u=e.padding,l=e.reposition,d=(0,t.popoverRectForPosition)(n,i,a,u,r);return{rect:d,boundaryViolation:l&&("top"===n&&d.top<c.top+o||"left"===n&&d.left<c.left+o||"right"===n&&d.right>c.right-o||"bottom"===n&&d.bottom>c.bottom-o)}};t.getNudgedPopoverRect=function(e,n,r){var i=n.top+r,a=n.left+r,c=n.right-r,u=n.bottom-r,l=e.top<i?i:e.top;l=l+e.height>u?u-e.height:l;var d=e.left<a?a:e.left;return d=d+e.width>c?c-e.width:d,(0,t.createRect)(o(o({},e),{top:l,left:d}))}}}]); |