1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2829],{5471:(e,t,r)=>{let o=r(5979),{mergeAttributesWithElements:n}=r(8205);e.exports=(e,t={})=>o(n(e),t)},5979:e=>{e.exports=(e,t={})=>{let r=t.char||" ",o=t.count||2,n=0,i=[];return e.reverse().reduce((e,t)=>{i.length&&n&&i[n]&&i[n]===t.substring(1,i[n].length+1)&&(i.splice(n,1),n--);let a=r.repeat(n?n*o:0),c=[`${a}${t}`,...e];return"</"===t.substring(0,2)&&(i[++n]=t.substring(2,t.length-1)),c},[]).join("\n")}},8205:e=>{let t=e=>e.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,"");e.exports={mergeAttributesWithElements:e=>{let r=t(e).split("\n"),o=[],n="";for(let e=0;e<r.length;e+=1){let t=r[e];if(t.endsWith("/>")){o.push(`${n}${t.slice(0,-2)} />`),n="";continue}if(t.endsWith(">")){o.push(`${n}${t.startsWith(">")||t.startsWith("<")?"":" "}${t}`),n="";continue}n+=n.length?` ${t}`:t}return o},removeEmptyLines:t}},1356:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});let o=(0,r(5737).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},9894:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});let o=(0,r(5737).A)("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]])},3238:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});let o=(0,r(5737).A)("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"}]])},6446:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});let o=(0,r(5737).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},640:function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowContainer=void 0;var n=r(4848),i=r(6540),a=r(6305);t.ArrowContainer=function(e){var t=e.childRect,r=e.popoverRect,c=e.position,s=e.arrowColor,u=e.arrowSize,l=e.arrowClassName,d=e.arrowStyle,p=e.className,f=e.children,v=e.style,h=(0,a.useArrowContainer)({childRect:t,popoverRect:r,position:c,arrowColor:s,arrowSize:u}),g=h.arrowContainerStyle,y=h.arrowStyle,m=(0,i.useMemo)(function(){return o(o({},g),v)},[g,v]),b=(0,i.useMemo)(function(){return o(o({},y),d)},[y,d]);return(0,n.jsxs)("div",{className:p,style:m,children:[(0,n.jsx)("div",{style:b,className:l}),f]})}},5143:function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Popover=t.usePopover=t.ArrowContainer=t.useArrowContainer=void 0;var n=r(4848),i=r(6540),a=r(1953),c=r(2456),s=r(3148);Object.defineProperty(t,"usePopover",{enumerable:!0,get:function(){return s.usePopover}});var u=r(1292),l=r(2128),d=r(6305);Object.defineProperty(t,"useArrowContainer",{enumerable:!0,get:function(){return d.useArrowContainer}});var p=r(640);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 r=e.isOpen,o=e.children,d=e.content,p=e.positions,v=void 0===p?f:p,h=e.align,g=void 0===h?"center":h,y=e.padding,m=void 0===y?0:y,b=e.reposition,R=void 0===b||b,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,O=e.transformMode,j=void 0===O?"absolute":O,k=e.boundaryInset,A=void 0===k?0:k,N=e.onClickOutside,T=e.clickOutsideCapture,L=void 0!==T&&T,I=(0,u.useMemoizedArray)(Array.isArray(v)?v:[v]),S=(0,l.useHandlePrevValues)({positions:I,reposition:R,transformMode:j,transform:_,boundaryElement:E,boundaryInset:A}),V=S.prev,z=S.updatePrevValues,B=(0,i.useRef)(),Y=(0,i.useState)({align:g,nudgedLeft:0,nudgedTop:0,position:I[0],padding:m,childRect:c.EMPTY_RECT,popoverRect:c.EMPTY_RECT,parentRect:c.EMPTY_RECT,boundaryRect:c.EMPTY_RECT,boundaryInset:A,violations:c.EMPTY_RECT,hasViolations:!1}),$=Y[0],F=Y[1],q=(0,i.useCallback)(function(e){return F(e)},[]),W=(0,s.usePopover)({isOpen:r,childRef:B,containerClassName:M,parentElement:P,boundaryElement:E,transform:_,transformMode:j,positions:I,align:g,padding:m,boundaryInset:A,reposition:R,onPositionPopover:q}),H=W.positionPopover,D=W.popoverRef,G=W.scoutRef;(0,i.useLayoutEffect)(function(){var e=!0,t=function(){var o,n;if(r&&e){var i=null===(o=null==B?void 0:B.current)||void 0===o?void 0:o.getBoundingClientRect(),a=null===(n=null==D?void 0:D.current)||void 0===n?void 0:n.getBoundingClientRect();null==i||null==a||(0,c.rectsAreEqual)(i,$.childRect)&&a.width===$.popoverRect.width&&a.height===$.popoverRect.height&&$.padding===m&&$.align===g&&I===V.positions&&R===V.reposition&&j===V.transformMode&&_===V.transform&&E===V.boundaryElement&&A===V.boundaryInset||H(),z(),e&&window.requestAnimationFrame(t)}};return t(),function(){e=!1}},[g,E,A,r,m,D,$.align,$.childRect,$.padding,$.popoverRect.height,$.popoverRect.width,H,I,V.boundaryElement,V.boundaryInset,V.positions,V.reposition,V.transform,V.transformMode,R,_,j,z]),(0,i.useEffect)(function(){var e=D.current;return Object.assign(e.style,x),function(){Object.keys(null!=x?x:{}).forEach(function(t){return delete e.style[t]})}},[x,r,D]);var J=(0,i.useCallback)(function(e){var t,o;!r||(null===(t=D.current)||void 0===t?void 0:t.contains(e.target))||(null===(o=B.current)||void 0===o?void 0:o.contains(e.target))||null==N||N(e)},[r,N,D]),K=(0,i.useCallback)(function(){B.current&&window.requestAnimationFrame(function(){return H()})},[H]);(0,i.useEffect)(function(){var e=P.ownerDocument.body;return e.addEventListener("click",J,L),e.addEventListener("contextmenu",J,L),e.addEventListener("resize",K),function(){e.removeEventListener("click",J,L),e.removeEventListener("contextmenu",J,L),e.removeEventListener("resize",K)}},[L,J,K,P]);var Q=(0,i.useCallback)(function(e){B.current=e,null!=t&&("object"==typeof t?t.current=e:"function"==typeof t&&t(e))},[t]);return(0,n.jsxs)(n.Fragment,{children:[(0,i.cloneElement)(o,{ref:Q}),r?(0,n.jsx)(a.PopoverPortal,{element:D.current,scoutElement:G.current,container:P,children:"function"==typeof d?d($):d}):null]})});t.Popover=(0,i.forwardRef)(function(e,t){return"undefined"==typeof window?e.children:(0,n.jsx)(v,o({},e,{ref:t}))})},1953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPortal=void 0;var o=r(6540),n=r(961);t.PopoverPortal=function(e){var t=e.container,r=e.element,i=e.scoutElement,a=e.children;return(0,o.useLayoutEffect)(function(){return t.appendChild(r),t.appendChild(i),function(){t.removeChild(r),t.removeChild(i)}},[t,r,i]),(0,n.createPortal)(a,r)}},6305:function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useArrowContainer=void 0;var n=r(6540);t.useArrowContainer=function(e){var t=e.childRect,r=e.popoverRect,i=e.position,a=e.arrowSize,c=e.arrowColor;return{arrowContainerStyle:(0,n.useMemo)(function(){return{padding:a}},[a]),arrowStyle:(0,n.useMemo)(function(){return o({position:"absolute"},function(){var e=2*a,o=t.top-r.top+t.height/2-e/2,n=t.left-r.left+t.width/2-e/2,s=r.width-a,u=r.height-a;switch(n=(n=n<a?a:n)+e>s?s-e:n,o=Number.isNaN(o=(o=o<a?a:o)+e>u?u-e:o)?0:o,n=Number.isNaN(n)?0:n,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:o};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:o};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:n};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:n};default:return{display:"hidden"}}}())},[c,a,t.height,t.left,t.top,t.width,r.height,r.left,r.top,r.width,i])}}},5116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useElementRef=void 0;var o=r(6540),n=r(2456);t.useElementRef=function(e){var t=e.containerClassName,r=e.containerStyle,i=(0,o.useRef)(),a=(0,o.useState)(function(){return(0,n.createContainer)({containerStyle:r,containerClassName:t})})[0];return(0,o.useLayoutEffect)(function(){a.className=t},[t,a]),(0,o.useLayoutEffect)(function(){Object.assign(a.style,r)},[r,a]),i.current=a,i}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useHandlePrevValues=void 0;var o=r(6540);t.useHandlePrevValues=function(e){var t=(0,o.useRef)(e.positions),r=(0,o.useRef)(e.reposition),n=(0,o.useRef)(e.transformMode),i=(0,o.useRef)(e.transform),a=(0,o.useRef)(e.boundaryElement),c=(0,o.useRef)(e.boundaryInset),s=(0,o.useCallback)(function(){t.current=e.positions,r.current=e.reposition,n.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:r.current,transformMode:n.current,transform:i.current,boundaryElement:a.current,boundaryInset:c.current},updatePrevValues:s}}},1292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useMemoizedArray=void 0;var o=r(6540);t.useMemoizedArray=function(e){var t=(0,o.useRef)(e);return(0,o.useMemo)(function(){if(t.current===e)return t.current;if(t.current.length!==e.length)return t.current=e,e;for(var r=0;r<e.length;r+=1)if(e[r]!==t.current[r])return t.current=e,e;return t.current},[e])}},3148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopover=void 0;var o=r(6540),n=r(2456),i=r(5116),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,r=e.childRef,s=e.positions,u=e.containerClassName,l=e.parentElement,d=e.transform,p=e.transformMode,f=e.align,v=e.padding,h=e.reposition,g=e.boundaryInset,y=e.boundaryElement,m=e.onPositionPopover,b=(0,i.useElementRef)({containerClassName:"react-tiny-popover-scout",containerStyle:c}),R=(0,i.useElementRef)({containerClassName:null!=u&&u.length>0&&"react-tiny-popover-container"!==u?"react-tiny-popover-container ".concat(u):"react-tiny-popover-container",containerStyle:a}),w=(0,o.useCallback)(function(e){var o,i,a=void 0===e?{}:e,c=a.positionIndex,u=void 0===c?0:c,P=a.parentRect,C=void 0===P?l.getBoundingClientRect():P,E=a.childRect,M=void 0===E?null===(o=null==r?void 0:r.current)||void 0===o?void 0:o.getBoundingClientRect():E,x=a.scoutRect,_=void 0===x?null===(i=null==b?void 0:b.current)||void 0===i?void 0:i.getBoundingClientRect():x,O=a.popoverRect,j=void 0===O?R.current.getBoundingClientRect():O,k=a.boundaryRect,A=void 0===k?y===l?C:y.getBoundingClientRect():k;if(M&&C&&t){if(d&&"absolute"===p){var N="function"==typeof d?d({childRect:M,popoverRect:j,parentRect:C,boundaryRect:A,padding:v,align:f,nudgedTop:0,nudgedLeft:0,boundaryInset:g,violations:n.EMPTY_RECT,hasViolations:!1}):d,T=N.top,L=N.left,I=Math.round(C.left+L-_.left),S=Math.round(C.top+T-_.top);R.current.style.transform="translate(".concat(I,"px, ").concat(S,"px)"),m({childRect:M,popoverRect:(0,n.createRect)({left:I,top:S,width:j.width,height:j.height}),parentRect:C,boundaryRect:A,padding:v,align:f,transform:{top:T,left:L},nudgedTop:0,nudgedLeft:0,boundaryInset:g,violations:n.EMPTY_RECT,hasViolations:!1});return}var V=u===s.length,z=V?s[0]:s[u],B=(0,n.getNewPopoverRect)({childRect:M,popoverRect:j,boundaryRect:A,position:z,align:f,padding:v,reposition:h},g),Y=B.rect;if(B.boundaryViolation&&h&&!V){w({positionIndex:u+1,childRect:M,popoverRect:j,parentRect:C,boundaryRect:A});return}var $=Y.top,F=Y.left,q=Y.width,W=Y.height,H=h&&!V,D=(0,n.getNudgedPopoverRect)(Y,A,g),G=D.left,J=D.top,K=$,Q=F;H&&(K=J,Q=G),K=Math.round(K-_.top),Q=Math.round(Q-_.left),R.current.style.transform="translate(".concat(Q,"px, ").concat(K,"px)");var U={top:A.top+g-K,left:A.left+g-Q,right:Q+q-A.right+g,bottom:K+W-A.bottom+g},X={childRect:M,popoverRect:(0,n.createRect)({left:Q,top:K,width:q,height:W}),parentRect:C,boundaryRect:A,position:z,align:f,padding:v,nudgedTop:J-$,nudgedLeft:G-F,boundaryInset:g,violations:{top:U.top<=0?0:U.top,left:U.left<=0?0:U.left,right:U.right<=0?0:U.right,bottom:U.bottom<=0?0:U.bottom},hasViolations:U.top>0||U.left>0||U.right>0||U.bottom>0};if(d){m(X);var Z="function"==typeof d?d(X):d,ee=Z.top,et=Z.left;R.current.style.transform="translate(".concat(Math.round(Q+(null!=et?et:0)),"px, ").concat(Math.round(K+(null!=ee?ee:0)),"px)"),X.nudgedLeft+=null!=et?et:0,X.nudgedTop+=null!=ee?ee:0,X.transform={top:ee,left:et}}m(X)}},[l,r,b,R,y,t,d,p,s,f,v,h,g,m]);return{positionPopover:w,popoverRef:R,scoutRef:b}}},2456:function(e,t){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).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,r=e.left,o=e.width,n=e.height;return{top:t,left:r,width:o,height:n,right:r+o,bottom:t+n}},t.rectsAreEqual=function(e,t){return e===t||(null==e?void 0:e.bottom)===(null==t?void 0:t.bottom)&&(null==e?void 0:e.height)===(null==t?void 0:t.height)&&(null==e?void 0:e.left)===(null==t?void 0:t.left)&&(null==e?void 0:e.right)===(null==t?void 0:t.right)&&(null==e?void 0:e.top)===(null==t?void 0:t.top)&&(null==e?void 0:e.width)===(null==t?void 0:t.width)},t.createContainer=function(e){var t=e.containerStyle,r=e.containerClassName,o=window.document.createElement("div");return r&&(o.className=r),Object.assign(o.style,t),o},t.popoverRectForPosition=function(e,r,o,n,i){var a,c,s=r.left+r.width/2,u=r.top+r.height/2,l=o.width,d=o.height;switch(e){case"left":a=u-d/2,c=r.left-n-l,"start"===i&&(a=r.top),"end"===i&&(a=r.bottom-d);break;case"bottom":a=r.bottom+n,c=s-l/2,"start"===i&&(c=r.left),"end"===i&&(c=r.right-l);break;case"right":a=u-d/2,c=r.right+n,"start"===i&&(a=r.top),"end"===i&&(a=r.bottom-d);break;default:a=r.top-d-n,c=s-l/2,"start"===i&&(c=r.left),"end"===i&&(c=r.right-l)}return(0,t.createRect)({left:c,top:a,width:l,height:d})},t.getNewPopoverRect=function(e,r){var o=e.position,n=e.align,i=e.childRect,a=e.popoverRect,c=e.boundaryRect,s=e.padding,u=e.reposition,l=(0,t.popoverRectForPosition)(o,i,a,s,n),d=u&&("top"===o&&l.top<c.top+r||"left"===o&&l.left<c.left+r||"right"===o&&l.right>c.right-r||"bottom"===o&&l.bottom>c.bottom-r);return{rect:l,boundaryViolation:d}},t.getNudgedPopoverRect=function(e,o,n){var i=o.top+n,a=o.left+n,c=o.right-n,s=o.bottom-n,u=e.top<i?i:e.top;u=u+e.height>s?s-e.height:u;var l=e.left<a?a:e.left;return l=l+e.width>c?c-e.width:l,(0,t.createRect)(r(r({},e),{top:u,left:l}))}}}]); |