PluginProbe
Assistant – Every Day Productivity Apps / 1.4.7
Assistant – Every Day Productivity Apps v1.4.7
1.5.5.1 1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 All 72 releases
← All changes | build/vendor-react-laag.js +1 -1 0.7.0.4 → 1.4.7 View file →
@@ -1 +1 @@
1 -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=220)}({0:function(e,t){e.exports=React},19:function(e,t){e.exports=ReactDOM},220:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"Arrow",(function(){return ue})),r.d(n,"ToggleLayer",(function(){return oe})),r.d(n,"Transition",(function(){return ge})),r.d(n,"anchor",(function(){return P})),r.d(n,"useBreakpoint",(function(){return he})),r.d(n,"useHover",(function(){return fe})),r.d(n,"useToggleLayer",(function(){return ae})),r.d(n,"useTooltip",(function(){return de}));var o=r(0),i=r.n(o),c=r(19);function l(e,t,r,n=!0,i=!1){return Object(o.useEffect)((()=>{if(!n||!e)return;const o=r,c=Array.isArray(e)?e:[e],l=Array.isArray(t)?t:[t];return c.forEach((e=>{l.forEach((t=>{e.addEventListener(t,o,i)}))})),()=>{c.forEach((e=>{l.forEach((t=>{e.removeEventListener(t,o,i)}))}))}}),[r,e,n,t,i])}const s=i.a.createContext({});function u(e,t){if(e===t)return!0;if(e.children&&e.children.length>0)for(let r=0;r<e.children.length;r++){const n=e.children[r];if(n&&u(n,t))return!0}return!1}function a({refs:e,children:t}){return"function"==typeof i.a.useContext(s)?t:i.a.createElement(s.Provider,{value:i.a.useCallback((t=>{e.current.add(t)}),[])},t)}function f(e,t){const[r]=i.a.useState(["click"]);!function(e){const t=i.a.useContext(s);i.a.useEffect((()=>{const[r]=e.current.values();"function"==typeof t&&r&&t(r)}),[t,e])}(e),l("undefined"!=typeof document?document:null,r,i.a.useCallback((r=>{for(const t of e.current)if(t.current&&u(t.current,r.target))return;t()}),[t]),!0,!0)}function h(e,t,r,n=!0){l(Object(o.useMemo)((()=>void 0!==r?[r,...e]:[]),[e]),"scroll",t,n)}function g(e,t,r=!0){l(void 0!==t?t:null,"resize",e,r)}const d="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;function p(e,t,r,n,i,c){const l=Object(o.useRef)(i);l.current=i;const s=e||(void 0===c?class{}:c.ResizeObserver);if(!s)throw new Error("This browser does not support `ResizeObserver` out of the box. Please provide a polyfill as a prop.");const u=Object(o.useRef)(new s((()=>{t.current&&l.current()})));return d((()=>{n?r&&u.current.observe(r):(r&&u.current.unobserve(r),t.current&&u.current.unobserve(t.current))}),[n,r]),Object(o.useEffect)((()=>()=>{u.current.disconnect()}),[]),u.current}const O={};function T(e){return null!=e}function m(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o=0;o<Math.max(r.length,n.length);o++){const i=r[o]||n[o];if(e[i]!==t[i])return!1}return!0}function y(e,t){return!m(e.layer,t.layer)||!m(e.arrow,t.arrow)}function b(e){return{top:0,left:0,right:e?e.innerWidth:0,bottom:e?e.innerHeight:0,height:e?e.innerHeight:0,width:e?e.innerWidth:0}}const w=e=>parseFloat(e.replace("px",""));function E(e,t){if(!t)return{width:0,height:0};const{width:r,height:n,boxSizing:o,borderLeft:i,borderRight:c,borderTop:l,borderBottom:s,paddingLeft:u,paddingRight:a,paddingTop:f,paddingBottom:h}=t.getComputedStyle(e);return{width:"border-box"===o?w(r):[r,i,c,u,a].reduce(((e,t)=>e+(t?w(t):0)),0),height:"border-box"===o?w(n):[n,l,s,f,h].reduce(((e,t)=>e+(t?w(t):0)),0)}}function R(e){return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function v(e,{min:t,max:r}){return e<t?t:e>r?r:e}function C(e){const[t]=Object(o.useState)({layer:O,arrow:O,layerSide:e.split("_")[0].toLowerCase()}),[r,n]=Object(o.useState)(t),i=Object(o.useRef)(r);return{styles:r,lastStyles:i,setStyles:n,resetLastStyles:()=>{i.current=t}}}const P={BOTTOM_LEFT:"BOTTOM_LEFT",BOTTOM_RIGHT:"BOTTOM_RIGHT",BOTTOM_CENTER:"BOTTOM_CENTER",TOP_LEFT:"TOP_LEFT",TOP_CENTER:"TOP_CENTER",TOP_RIGHT:"TOP_RIGHT",LEFT_BOTTOM:"LEFT_BOTTOM",LEFT_CENTER:"LEFT_CENTER",LEFT_TOP:"LEFT_TOP",RIGHT_BOTTOM:"RIGHT_BOTTOM",RIGHT_CENTER:"RIGHT_CENTER",RIGHT_TOP:"RIGHT_TOP"},S=Object.keys(P);function L(e){return e.startsWith("TOP_")||e.startsWith("BOTTOM_")?"Y":"X"}function j(e){return"TOP"===e||"BOTTOM"===e}function B(e){const[t,r]=e.split("_");return{primary:t,secondary:r}}function M(e){return"CENTER"===e?"center":B(e).primary.toLowerCase()}function _(e,t,r,n,o){const{primary:i,secondary:c}="CENTER"!==e?B(e):{primary:n,secondary:"CENTER"};let l=S.map(((e,t)=>function(e,t,r,n){const o=j(t);return e<3?t:e<6?o?r:n:e<9?o?["LEFT","RIGHT"].filter((e=>e!==r))[0]:["TOP","BOTTOM"].filter((e=>e!==n))[0]:o?["TOP","BOTTOM"].filter((e=>e!==t))[0]:["LEFT","RIGHT"].filter((e=>e!==t))[0]}(t,i,r,n)+"_"+function(e,t,r,n){const o=j(t),i=n.trigger.height>n.layer.height,c=n.trigger.width>n.layer.width;switch(e){case 9:case 0:return r;case 1:case 10:return"CENTER"===r?o?"RIGHT":"BOTTOM":"CENTER";case 4:case 7:return"CENTER";case 2:case 11:return o?["LEFT","RIGHT"].filter((e=>e!==r))[0]:["TOP","BOTTOM"].filter((e=>e!==r))[0];case 3:case 6:return o?"BOTTOM"===t?i?"BOTTOM":"TOP":i?"TOP":"BOTTOM":"LEFT"===t?c?"LEFT":"RIGHT":c?"RIGHT":"LEFT";case 5:case 8:return o?"BOTTOM"===t?i?"TOP":"BOTTOM":i?"BOTTOM":"TOP":"LEFT"===t?c?"RIGHT":"LEFT":c?"LEFT":"RIGHT"}return"LEFT"}(t,i,c,o))).filter((e=>t.indexOf(e)>-1));return-1===l.indexOf(e)&&(l=[e,...l]),l}function x(e,t,r,n){const o="TOP"===e||"BOTTOM"===e?"top":"left",i="TOP"===e||"BOTTOM"===e?"height":"width";return"TOP"===e||"LEFT"===e?{[o]:t.trigger[o]-t.layer[i]-(t.relativeParent[o]-r[o])-n}:{[o]:t.trigger[o]+t.trigger[i]-(t.relativeParent[o]-r[o])+n}}function F(e,t,r,n,o){return v(e.trigger[n]-e.relativeParent[n]+t[n]+e.trigger[o]/2-e.layer[o]/2-r,H(e,t)[n])}function H(e,t){const r=e.trigger.top-e.relativeParent.top+t.top,n=e.trigger.left-e.relativeParent.left+t.left;return{top:{min:r-(e.layer.height-e.arrow.height),max:r+(e.trigger.height-e.arrow.height)},left:{min:n-(e.layer.width-e.arrow.width),max:n+(e.trigger.width-e.arrow.width)}}}function A(e,t,r,n,o){if("CENTER"===e){const e="X"===o?"top":"left";return{[e]:F(t,r,n,e,"X"===o?"height":"width")}}const i="TOP"===e||"BOTTOM"===e?"top":"left",c="TOP"===e||"BOTTOM"===e?"height":"width";return"TOP"===e||"LEFT"===e?{[i]:v(t.trigger[i]-t.relativeParent[i]+r[i]+n,H(t,r)[i])}:{[i]:v(t.trigger[i]+t.trigger[c]-t.layer[c]-(t.relativeParent[i]-r[i])-n,H(t,r)[i])}}const I={TOP:{side1:"bottom",side2:"top",size:"height",factor:-1},BOTTOM:{side1:"top",side2:"bottom",size:"height",factor:1},LEFT:{side1:"right",side2:"left",size:"width",factor:-1},RIGHT:{side1:"left",side2:"right",size:"width",factor:1}};function N(e,t,r,n,o){const i=e[n]+e[o]/2-t[o]/2-r;return{[n]:i,["left"===n?"right":"bottom"]:i+t[o]}}function z({trigger:e,layer:t,anchor:r,triggerOffset:n,scrollOffset:o=0,offsetSecondary:i=0,layerDimensions:c}){let l,s;const u=c?function(e,t,r){const n="function"==typeof r?r(M(t)):r;return{...R(e),...n}}(t,r,c):t;if("CENTER"===r)l=N(e,u,0,"top","height"),s=N(e,u,0,"left","width");else{const{primary:t,secondary:o}=B(r),c=L(r);l=function(e,t,r,n){const{side1:o,side2:i,size:c,factor:l}=I[e],s=t[i]+n*l;return{[o]:s,[i]:s+r[c]*l}}(t,e,u,n),s=function(e,t,r,n,o){if("CENTER"===e)return N(t,r,n,"X"===o?"top":"left","X"===o?"height":"width");const{side1:i,side2:c,size:l,factor:s}=I[e],u=t[c]-n*s;return{[c]:u,[i]:u-r[l]*s}}(o,e,u,i,c)}const a={...u,...l,...s};return a.top=a.top-o,a.right=a.right+o,a.left=a.left-o,a.bottom=a.bottom+o,a}const k=["bottom","top","left","right"];function G(e,t){return{top:e.top-t.top,bottom:t.bottom-e.bottom,left:e.left-t.left,right:t.right-e.right}}function X(e,t){return t.map((t=>G(e,t)))}function D(e,t){return t.some((t=>e.bottom<=t.top||e.right<=t.left||e.top>=t.bottom||e.left>=t.right))}function Y(e,t){return X(e,t).every((e=>k.every((t=>e[t]>=0))))}function W(e){const t=e.reduce(((e,t)=>(k.forEach((r=>{e[r]=[...e[r],t[r]]})),e)),{top:[],bottom:[],left:[],right:[]});return k.reduce(((e,r)=>(e[r]=t[r].sort(((e,t)=>e-t))[0],e)),{})}function q(e,t){return t.map((t=>function(e,t){const r=G(e,t),{width:n,height:o}=k.filter((e=>r[e]<0)).reduce(((e,t)=>{const n="top"===t||"bottom"===t?"height":"width";return{...e,[n]:e[n]+r[t]}}),e),i=n*o;return n<0&&o<0?-i:i}(e,t))).sort(((e,t)=>e-t))[0]}function V(e,t,r,n,o){return Y(z({anchor:e,trigger:t.trigger,layer:t.layer,triggerOffset:r,scrollOffset:n,layerDimensions:o}),t.scrollParents)}function Z(e,t,r,n){return X(z({anchor:e,trigger:t.trigger,layer:t.layer,triggerOffset:r,scrollOffset:n,layerDimensions:null}),t.scrollParents)}function J(e,t,r){return("top"===e||"bottom"===e)&&r.width>t.width||("left"===e||"right"===e)&&r.height>t.height}function K(e,t,r,n,o){return t.map((t=>{const i=z({anchor:t,layer:e.layer,trigger:e.trigger,scrollOffset:n,triggerOffset:r,layerDimensions:o});return{anchor:t,square:q(i,e.scrollParents)-function(e,t,r,n){const o=L(e);return(t["X"===o?"width":"height"]-r-2*n)*(t["X"===o?"height":"width"]-r-2*n)}(t,i,r,n)}})).sort(((e,t)=>t.square-e.square))[0].anchor}function Q(e,t,r,n,o){const i=L(e);return function(e){const t=W(e);return k.filter((e=>t[e]<0))}(Z(t,r,n,o)).find((e=>"X"===i?"top"===e||"bottom"===e:"left"===e||"right"===e))}function U({rects:e,scrollTop:t,scrollLeft:r,triggerOffset:n,scrollOffset:o,possibleAnchors:i,preferedAnchor:c,preferedX:l,preferedY:s,autoAdjust:u,snapToAnchor:a,layerDimensions:f}){const h=_(c,i,l,s,e),g=u?function(e,t,r,n,o){return t.find((t=>V(t,e,r,n,o)))||K(e,t,r,n,o)}(e,h,n,o,f):c,d=u&&!a&&"CENTER"!==g?function(e,t,r,n,o){const{primary:i}=B(e),c=function(e,t){return t.filter((t=>t.startsWith(e)))}(i,t),l=0===c.indexOf(e),s=V(e,r,n,o,null);if(l&&s)return 0;const u=Q(e,c.find((e=>!V(e,r,n,o,null))),r,n,o);if(!u)return 0;let a=-W(Z(e,r,n,o))[u];const f=J(M(e),r.layer,r.trigger),h=e.includes("_CENTER"),g=e.includes("_LEFT"),d=e.includes("_TOP");return f&&(g&&"right"===u||"left"===u||d&&"bottom"===u||"top"===u)?a=-a:f||!h||"top"!==u&&"left"!==u||(a=-a),a}(g,h,e,n,o):0,p=function({anchor:e,rects:t,triggerOffset:r,offsetSecondary:n,scrollLeft:o,scrollTop:i}){const c={left:o,top:i};if("CENTER"===e)return{top:F(t,c,0,"top","height"),left:F(t,c,0,"left","width")};const{primary:l,secondary:s}=B(e),u=L(e);return{...x(l,t,c,r),...A(s,t,c,n,u)}}({anchor:g,rects:e,triggerOffset:n,offsetSecondary:d,scrollLeft:r,scrollTop:t}),O=z({anchor:g,trigger:e.trigger,layer:e.layer,triggerOffset:n,offsetSecondary:d,layerDimensions:f});return f&&(p.width=O.width,p.height=O.height),{layerStyle:p,layerRect:O,anchor:g}}function $(e,t){const r=e.querySelector("[data-arrow]");if(!r)return{top:0,bottom:0,left:0,right:0,width:0,height:0};const n=r.getBoundingClientRect();return{...R(n),width:n.width+2*t,height:n.height+2*t}}const ee={autoAdjust:!1,snapToAnchor:!1,anchor:"TOP_CENTER",layerDimensions:null,possibleAnchors:S,preferX:"RIGHT",preferY:"BOTTOM",scrollOffset:10,triggerOffset:0,arrowOffset:0};function te({triggerRect:e,layerElement:t,relativeParentElement:r,scrollParents:n,placement:o={},environment:i,fixed:c}){if(0===e.height)return;if(!t)return;const l=c?[b(i)]:[...n.map((e=>function(e,t,r){const n=e.width-t,o=e.height-r;return{left:e.left,top:e.top,width:e.width-n,right:e.right-n,height:e.height-o,bottom:e.bottom-o}}(e.getBoundingClientRect(),e.clientWidth,e.clientHeight))),b(i)],s={autoAdjust:o.autoAdjust||ee.autoAdjust,snapToAnchor:o.snapToAnchor||ee.snapToAnchor,triggerOffset:T(o.triggerOffset)?o.triggerOffset:ee.triggerOffset,scrollOffset:T(o.scrollOffset)?o.scrollOffset:ee.scrollOffset,possibleAnchors:o.possibleAnchors||ee.possibleAnchors,preferedAnchor:o.anchor||ee.anchor,preferedX:o.preferX||ee.preferX,preferedY:o.preferY||ee.preferY,scrollLeft:r===document.body?0:r.scrollLeft,scrollTop:r===document.body?0:r.scrollTop,relativeParentElement:r,layerDimensions:o.layerDimensions||ee.layerDimensions},u=t.getBoundingClientRect(),a={layer:{top:u.top,left:u.left,right:u.right,bottom:u.bottom,...E(t,i)},relativeParent:r.getBoundingClientRect(),scrollParents:l,trigger:e,arrow:$(t,o.arrowOffset||ee.arrowOffset)},{layerRect:f,layerStyle:h,anchor:g}=U({rects:a,...s});c&&(h.top=f.top,h.left=f.left);const d=M(g);return{styles:{layer:h,arrow:"CENTER"===g?O:function(e,t,r,n){const o=J(r,e,t),i={left:{min:n.width/2,max:e.width-n.width/2},top:{min:n.height/2,max:e.height-n.height/2}},c=function(e,t,r){const n=e.left+e.width/2-t.left-r.width/2,o=e.right-e.width/2-t.right+r.width/2,i=e.top+e.height/2-t.top-r.height/2,c=e.bottom-e.height/2-t.bottom+r.height/2;return{left:n<0?-n:0,right:o>0?-o:0,top:i<0?-i:0,bottom:c>0?-c:0}}(e,t,n);return"bottom"===r?{bottom:"100%",top:null,left:v(o?e.width/2+(c.left+c.right):t.left+t.width/2-e.left,i.left),right:null}:"right"===r?{right:"100%",left:null,top:v(o?e.height/2+(c.top+c.bottom):t.top+t.height/2-e.top,i.top),bottom:null}:"top"===r?{top:"100%",bottom:null,left:v(o?e.width/2+(c.left+c.right):t.left+t.width/2-e.left,i.left),right:null}:{left:"100%",right:null,top:v(o?e.height/2+(c.top+c.bottom):t.top+t.height/2-e.top,i.top),bottom:null}}(f,e,d,a.arrow),layerSide:d},layerRect:f}}function re(e,t){const r=[];if(!e||!t)return r;if(e===document.body)return r;const{overflow:n,overflowX:o,overflowY:i}=t.getComputedStyle(e);return[n,o,i].some((e=>"auto"===e||"scroll"===e))&&r.push(e),[...r,...re(e.parentElement,t)]}function ne(e,t,r){return function(e,t){const[r,n]=Object(o.useState)(e||null),i=Object(o.useRef)(null);return[Object(o.useCallback)((e=>{e&&e!==i.current&&(i.current=e,n(t?t(e):e))}),[]),r,i]}({triggerElement:null,relativeParentElement:null,scrollParents:[]},Object(o.useCallback)((e=>{const t=re(e,r),n=t[0]||document.body;return n===document.body&&(document.body.style.position="relative"),{triggerElement:e,relativeParentElement:n,scrollParents:t}}),[]))}const oe=({children:e,renderLayer:t,placement:r={},onStyle:n,isOpen:i,closeOnOutsideClick:l,onOutsideClick:s,onDisappear:u,closeOnDisappear:m,fixed:w,container:E,environment:R=("undefined"!=typeof window?window:void 0),...v})=>{const[P,{relativeParentElement:S,triggerElement:L,scrollParents:j},B]=ne(0,0,R),{styles:M,setStyles:_,lastStyles:x,resetLastStyles:F}=C(r.anchor||ee.anchor),H=Object(o.useRef)(null),[A,I]=Object(o.useState)(!1),N=function(e,t){const r=Object(o.useRef)(t),n=!r.current&&(T(t)?t:e),i=Object(o.useState)(!1)[1];return Object(o.useEffect)((()=>{r.current&&(r.current=!1,i(!0))}),[]),n}(A,i),z=Object(o.useCallback)((()=>{if(!L)throw new Error("Could not find a valid reference of the trigger element. See https://www.react-laag.com/docs/togglelayer/#children for more info.");const e=L.getBoundingClientRect(),t=te({triggerRect:e,layerElement:H.current,placement:r,relativeParentElement:S,scrollParents:j,fixed:w,environment:R});if(!t)return;const{layerRect:o,styles:c}=t;y(x.current,c)&&(T(n)?(x.current=c,n(c.layer,c.arrow,c.layerSide)):_(c));const l=T(u),s=m&&!T(i);if(l||s){const t=[...j.map((e=>e.getBoundingClientRect())),b(R)],r=!Y(w?e:o,t),n=D(w?e:o,t);l?(r||n)&&u(n?"full":"partial"):("partial"===m&&r&&I(!1),"full"===m&&n&&I(!1))}}),[S,N,L,j,w,r]),k=p(v.ResizeObserver,H,L,N,z,R);d((()=>{const e=!T(n);M!==x.current&&e?x.current=M:N?z():F()})),g(z,R,N),h(j,z,R,N);const G=Object(o.useRef)(new Set([H,B]));f(G,Object(o.useCallback)((()=>{N&&(s&&s(),l&&!T(i)&&I(!1))}),[N,I,i,s]));const X="function"==typeof E?E():E;return Object(o.createElement)(o.Fragment,null,e({isOpen:N,close:()=>{if(T(i))throw new Error("You cannot call `close()` while using the `isOpen` prop");I(!1)},open:()=>{if(T(i))throw new Error("You cannot call `open()` while using the `isOpen` prop");I(!0)},toggle:()=>{if(T(i))throw new Error("You cannot call `toggle()` while using the `isOpen` prop");I(!A)},triggerRef:P,layerSide:N?M.layerSide:null}),S&&Object(o.createElement)(a,{refs:G},Object(c.createPortal)(t({layerProps:{ref:e=>{e&&k.observe(e),H.current=e},style:{...T(n)?O:M.layer,position:w?"fixed":"absolute",willChange:"top, bottom, left, right, width, height"}},arrowStyle:{...T(n)?O:M.arrow,position:"absolute",willChange:"top, bottom, left, right"},isOpen:N,layerSide:M.layerSide,triggerRect:L?L.getBoundingClientRect():null,close:()=>{if(T(i))throw new Error("You cannot call `close()` while using the `isOpen` prop");I(!1)}}),X||S)))};function ie(e,t){return Math.tan(e*(Math.PI/180))*t}function ce(e,t,r,n){switch(r){case"bottom":return"0 "+-n+" "+t+" "+e;case"top":return"0 0 "+t+" "+(e+n);case"right":return-n+" 0 "+e+" "+t;case"left":return"0 0 "+(e+n)+" "+t}return""}function le({sizeA:e,sizeB:t,layerSide:r,roundness:n,angle:o}){const i=n/10*e*2,c="bottom"===r?"0 "+e:"top"===r?"0 0":"right"===r?e+" "+t:"0 "+t,l=("bottom"===r||"top"===r?"H":"V")+" "+("bottom"===r||"top"===r?t:0),s=t/2,u=t/2+ie(o,e/8),a=e/8,f="bottom"===r?"C "+u+" "+a+" "+(s+i)+" 0 "+s+" 0":"top"===r?"C "+u+" "+(e-a)+" "+(s+i)+" "+e+" "+s+" "+e:"right"===r?"C "+a+" "+(t-u)+" 0 "+(s-i)+" 0 "+s:"C "+(e-a)+" "+(t-u)+" "+e+" "+(s-i)+" "+e+" "+s,h=t/2-ie(o,e/8),g=e/8;return"M "+c+" "+l+" "+f+" "+("bottom"===r?"C "+(s-i)+" 0 "+h+" "+g+" "+c:"top"===r?"C "+(s-i)+" "+e+" "+h+" "+(e-g)+" "+c:"right"===r?"C 0 "+(s+i)+" "+g+" "+(t-h)+" "+c:"C"+e+" "+(s+i)+" "+(e-g)+" "+(t-h)+" "+c)}function se({sizeA:e,sizeB:t,borderWidth:r,layerSide:n,angle:o}){const i=ie(o,r);return"bottom"===n||"top"===n?"M "+r+" "+("bottom"===n?e:0)+" H "+(t-r)+" L "+(t-r-i)+" "+("bottom"===n?e-r:r)+" H "+(i+r)+" Z":"M "+("right"===n?e:0)+" "+r+" V "+(t-r)+" L "+("right"===n?e-r:r)+" "+(t-r-i)+" V "+(i+r)+" Z"}const ue=({size:e=8,angle:t=45,borderWidth:r=0,borderColor:n="black",roundness:i=0,backgroundColor:c="white",layerSide:l="top",style:s={}})=>{if("center"===l)return null;const u=e,a=2*ie(t,e);return Object(o.createElement)("svg",{style:{...s,transform:"translate"+("left"===l||"right"===l?"Y":"X")+"(-50%)"},"data-arrow":"true",width:"left"===l||"right"===l?u:a,viewBox:ce(u,a,l,r)},Object(o.createElement)("path",{fill:c,strokeWidth:r,stroke:n,d:le({angle:t,layerSide:l,roundness:i,sizeA:u,sizeB:a})}),Object(o.createElement)("path",{fill:c,d:se({sizeA:u,sizeB:a,angle:t,borderWidth:r,layerSide:l})}))};function ae(e,{onStyle:t,closeOnOutsideClick:r,closeOnDisappear:n,fixed:i,container:l,placement:s={},environment:u=("undefined"!=typeof window?window:void 0),...m}={}){const[w,{relativeParentElement:E,triggerElement:R,scrollParents:v},P]=ne(0,0,u),{styles:S,setStyles:L,lastStyles:j,resetLastStyles:B}=C(s.anchor||ee.anchor),M=Object(o.useRef)(null),_=Object(o.useRef)(null);function x(){return"function"==typeof _.current?_.current():_.current}const[F,H]=Object(o.useState)(!1);function A(){_.current=null,H(!1)}const I=Object(o.useCallback)((()=>{const e=x();if(!e)return;const r=te({triggerRect:e,layerElement:M.current,placement:s,relativeParentElement:E,scrollParents:v,fixed:i,environment:u});if(!r)return;const{layerRect:o,styles:c}=r;if(y(j.current,c)&&(T(t)?(j.current=c,t(c.layer,c.arrow,c.layerSide)):L(c)),n){const t=[...v.map((e=>e.getBoundingClientRect())),b(u)],r=!Y(i?e:o,t),c=D(i?e:o,t);"partial"===n&&r&&A(),"full"===n&&c&&A()}}),[E,F,R,v,i,s]),N=p(m.ResizeObserver,M,R,F,I,u);d((()=>{const e=!T(t);S!==j.current&&e?j.current=S:F?I():B()})),g(I,u,F),h(v,I,u,F);const z=Object(o.useRef)(new Set([M,P]));f(z,Object(o.useCallback)((()=>{F&&r&&A()}),[F,H,r]));const k="function"==typeof l?l():l;function G({clientRect:e,target:t}){_.current=e,F&&t===R?I():(w(t),H(!0))}const X={isOpen:F,close:A,open:G,openFromContextMenuEvent:e=>{e.preventDefault();const t=e.target;G({clientRect:{top:e.clientY,left:e.clientX,bottom:e.clientY+1,right:e.clientX+1,width:1,height:1},target:t})},openFromMouseEvent:e=>{const t=e.currentTarget;if(!t||!t.getBoundingClientRect)return;G({clientRect:()=>t.getBoundingClientRect(),target:t})},openFromRef:e=>{e.current?G({target:e.current,clientRect:e.current.getBoundingClientRect()}):console.error("Error inside useTooltip(): Expected a valid ref to a trigger element, but got "+typeof e.current)},openFromSelection:e=>{if(!e.anchorNode||e.isCollapsed)return;const t=function(e){let t=e;for(;!t.getBoundingClientRect;){if(!t.parentElement)return null;t=t.parentElement}return t}(e.anchorNode);if(!t)return;const r=e.getRangeAt(0);G({clientRect:()=>r.getBoundingClientRect(),target:t})},layerSide:F?S.layerSide:null},W=E&&Object(c.createPortal)(e({layerProps:{ref:e=>{e&&N.observe(e),M.current=e},style:{...T(t)?O:S.layer,position:i?"fixed":"absolute",willChange:"top, bottom, left, right, width, height"}},arrowStyle:{...T(t)?O:S.arrow,position:"absolute",willChange:"top, bottom, left, right"},isOpen:F,layerSide:S.layerSide,triggerRect:x(),close:()=>{A()}}),k||E);return[Object(o.createElement)(a,{refs:z},W),X]}function fe(e){const{delayEnter:t=0,delayLeave:r=0,hideOnScroll:n=!0,onShow:i,onHide:c}=e||{},[l,s]=Object(o.useState)(!1),u=Object(o.useRef)(null),a=Object(o.useRef)(null),f=Object(o.useRef)(!1);function h(e){if(e)return i&&i(),void s(!0);c&&c(),s(!1)}Object(o.useEffect)((()=>{const e=u.current;function t(){u.current&&(clearTimeout(u.current),u.current=null)}function r(){l&&n&&(t(),h(!1))}function o(){l&&(t(),h(!1))}return window.addEventListener("scroll",r,!0),window.addEventListener("touchend",o,!0),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("touchend",o,!0),e&&clearTimeout(e)}}),[l,n]);const g={onMouseEnter:function(){"leaving"===a.current&&u.current&&(clearTimeout(u.current),u.current=null,a.current=null),l||(a.current="entering",u.current=setTimeout((()=>{h(!0),u.current=null,a.current=null}),t))},onMouseLeave:function(){"entering"===a.current&&u.current&&(clearTimeout(u.current),u.current=null),l&&(a.current="leaving",u.current=setTimeout((()=>{h(!1),u.current=null}),r))},onTouchStart:()=>{f.current=!1},onTouchMove:()=>{f.current=!0},onTouchEnd:()=>{f.current||l||h(!0),f.current=!1}};return i?g:[l,g]}function he(e){const[t,r]=Object(o.useState)("undefined"!=typeof window&&window.matchMedia("(max-width: "+e+"px)").matches);return Object(o.useEffect)((()=>{const t=window.matchMedia("(max-width: "+e+"px)");function n(e){r(e.matches)}return t.addListener(n),()=>{t.removeListener(n)}}),[e]),t}function ge({isOpen:e,children:t}){const[r,n]=Object(o.useState)({isOpenInternal:e,isLeaving:!1}),i=Object(o.useRef)(!1);return Object(o.useEffect)((()=>{e?n({isOpenInternal:!0,isLeaving:!1}):i.current&&n({isOpenInternal:!1,isLeaving:!0})}),[e,n]),Object(o.useEffect)((()=>{i.current=!0}),[]),e||r.isOpenInternal||r.isLeaving?t(r.isOpenInternal,(()=>{r.isOpenInternal||n((e=>({...e,isLeaving:!1})))}),r.isLeaving):null}function de(e,{delayEnter:t,delayLeave:r,hideOnScroll:n,...i}={}){const c=Object(o.useRef)(),[l,{openFromRef:s,close:u}]=ae(e,i),a=fe({delayEnter:t,delayLeave:r,hideOnScroll:n,onShow:()=>s(c),onHide:u});return[l,{ref:c,...a}]}window.ReactLaag=window.ReactLaag||n}});
1 +(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Arrow:()=>re,DEFAULT_OPTIONS:()=>X,PLACEMENT_TYPES:()=>E,Transition:()=>oe,mergeRefs:()=>m,setGlobalContainer:()=>N,useHover:()=>ne,useLayer:()=>F,useMousePositionAsTrigger:()=>d});const r=React,n=ReactDOM;function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){var t=(0,r.useRef)(null);return function(r){r&&r!==t.current&&(t.current=r,e(r))}}var f="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;var p={top:0,left:0,right:1,bottom:1,width:1,height:1};function d(e){var t=void 0===e?{}:e,n=t.enabled,o=void 0===n||n,i=t.preventDefault,s=void 0===i||i,u=(0,r.useRef)(null),a=(0,r.useState)(p),c=a[0],l=a[1];return{hasMousePosition:c!==p,resetMousePosition:function(){l(p)},handleMouseEvent:function(e){if(o){s&&e.preventDefault();var t=e.clientX,r=e.clientY;l({top:r,left:t,width:1,height:1,right:t+1,bottom:r+1})}},trigger:{getBounds:function(){return c},getParent:u.current?function(){return u.current}:void 0},parentRef:u}}function h(e){return parseFloat(e.replace("px",""))}function g(e,t,r){return e<t?t:e>r?r:e}function v(e){return null!=e}function m(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r,n=c(t);!(r=n()).done;){var o=r.value;o&&("function"==typeof o?o(e):o.current=e)}}}function y(e,t){var r=[];if(!e||!t||e===document.body)return r;var n=t.getComputedStyle(e);return[n.overflow,n.overflowX,n.overflowY].some((function(e){return["auto","scroll"].includes(e)}))&&r.push(e),[].concat(r,y(e.parentElement,t))}function b(e){return"react-laag: Could not find a valid reference for the "+e+" element. There might be 2 causes:\n - Make sure that the 'ref' is set correctly on the "+e+' element when isOpen: true. Also make sure your component forwards the ref with "forwardRef()".\n - Make sure that you are actually rendering the '+e+" when the isOpen prop is set to true"}function w(e){var t=e.enabled,n=e.onChange,o=e.environment,i=e.ResizeObserverPolyfill,u=e.overflowContainer,a=e.triggerOption,p=function(e,t){if(void 0!==e)return t||e.ResizeObserver}(o,i);(0,r.useEffect)((function(){}),[p]);var d,g,v,m=(0,r.useRef)(null),w=Boolean(a),C=(d={scrollContainers:[],trigger:null,layer:null},g=(0,r.useRef)(d),(0,r.useMemo)((function(){return[function(){return g.current},function(e){g.current="function"==typeof e?e(g.current):e}]}),[])),O=C[0],S=C[1],E=(v=(0,r.useRef)([]),(0,r.useMemo)((function(){return{hasEventSubscriptions:function(){return v.current.length>0},removeAllEventSubscriptions:function(){for(var e,t=c(v.current);!(e=t()).done;)(0,e.value)();v.current=[]},addEventSubscription:function(e){v.current.push(e)}}}),[])),P=E.hasEventSubscriptions,B=E.addEventSubscription,L=E.removeAllEventSubscriptions,j=(0,r.useCallback)((function(){var e=O(),t=e.layer,r=e.trigger,i=e.scrollContainers,s=i[0];if(!t)throw new Error(b("layer"));if(!r&&!w)throw new Error(b("trigger"));var u={top:0,left:0};if(s){var a=s.scrollLeft;u={top:s.scrollTop,left:a}}else{var c=o.scrollX;u={top:o.scrollY,left:c}}var l={left:0,top:0};if(s){var f=o.getComputedStyle(s),p=f.borderLeftWidth,d=f.borderTopWidth;l={left:h(p)||0,top:h(d)||0}}n({layer:t,trigger:r,scrollContainers:i,arrow:m.current},u,l)}),[O,n,o,m,w]),T=(0,r.useCallback)((function(){var e=O(),t=e.trigger,r=e.layer,n=e.scrollContainers;if(!r)throw new Error(b("layer"));if(!t&&!w)throw new Error(b("trigger"));if(p){for(var i=!1,s=new p((function(){i?j():i=!0})),u=0,a=[t,r,document.body];u<a.length;u++){var l=a[u];l&&s.observe(l)}B((function(){for(var e=0,n=[t,r,document.body];e<n.length;e++){var o=n[e];o&&s.unobserve(o)}s.disconnect()}))}for(var f,d=function(){var e=f.value;e.addEventListener("scroll",j),B((function(){return e.removeEventListener("scroll",j)}))},h=c([o].concat(n));!(f=h()).done;)d()}),[O,B,j,o,p,w]),R=(0,r.useCallback)((function(e,r){t&&e&&e!==r&&(L(),T(),j())}),[L,T,j,t]),k=l((0,r.useCallback)((function(e){var t=O().layer;S((function(t){return s({},t,{layer:e})})),R(t,e)}),[O,S,R])),H=(0,r.useCallback)((function(e){var t=y(e,o),r=t[0];if(r){var n=o.getComputedStyle(r).position;["relative","absolute","fixed"].includes(n)||u||(r.style.position="relative")}return t}),[o,u]),M=l((0,r.useCallback)((function(e){var t=H(e),r=O().trigger;S((function(r){return s({},r,{trigger:e,scrollContainers:t})})),R(r,e)}),[O,S,R,H])),z=null==a||null==a.getParent?void 0:a.getParent();return f((function(){z&&S((function(e){return s({},e,{scrollContainers:H(z)})}))}),[z,S,H]),f((function(){return t&&(P()||T()),function(){P()&&L()}}),[t,P,T,L]),f((function(){t&&j()})),{triggerRef:M,layerRef:k,arrowRef:m,closestScrollContainer:O().scrollContainers[0]||null}}var C=(0,r.createContext)({});function O(e){var t=e.children,n=e.registrations,o=(0,r.useCallback)((function(e){return n.current.add(e),function(){return n.current.delete(e)}}),[n]);return(0,r.createElement)(C.Provider,{value:o},t)}function S(e){var t=e.isOpen,n=e.onOutsideClick,o=e.onParentClose,i=(0,r.useRef)(null),s=(0,r.useRef)(null),u=(0,r.useRef)(new Set),a=(0,r.useContext)(C),l=(0,r.useCallback)((function(e){var t=e.target,r=i.current&&i.current.contains(t),n=s.current&&s.current.contains(t),o=function(e,t){for(var r,n=c(e);!(r=n()).done;)if(!(0,r.value.shouldCloseWhenClickedOutside)(t))return!1;return!0}(u.current,e);return n&&o&&u.current.forEach((function(e){return(0,e.closeChild)()})),!r&&!n&&o}),[i,s,u]);return(0,r.useEffect)((function(){if("function"==typeof a)return a({shouldCloseWhenClickedOutside:l,closeChild:function(){o&&o()}})}),[a,l,o,u]),(0,r.useEffect)((function(){if(!(!t||!n||"function"==typeof a))return document.addEventListener("click",e,!0),function(){return document.removeEventListener("click",e,!0)};function e(e){l(e)&&n()}}),[t,n,l,a]),(0,r.useEffect)((function(){t||u.current.forEach((function(e){return(0,e.closeChild)()}))}),[t]),{closeOnOutsideClickRefs:{trigger:i,layer:s},registrations:u}}var E=["bottom-start","bottom-end","bottom-center","top-start","top-center","top-end","left-end","left-center","left-start","right-end","right-center","right-start","center"],P={top:"bottom",left:"right",bottom:"top",right:"left",center:"center"},B=function(){function e(e,t,r,n,o,i,s,u,a){this.prop=void 0,this.opposite=void 0,this.isHorizontal=void 0,this.sizeProp=void 0,this.oppositeSizeProp=void 0,this.cssProp=void 0,this.oppositeCssProp=void 0,this.isCenter=void 0,this.isPush=void 0,this.prop=e,this.opposite=t,this.isHorizontal=r,this.sizeProp=n,this.oppositeSizeProp=o,this.cssProp=i,this.oppositeCssProp=s,this.isCenter=u,this.isPush=a}var t=e.prototype;return t.factor=function(e){return e*(this.isPush?1:-1)},t.isOppositeDirection=function(e){return this.isHorizontal!==e.isHorizontal},e}();function L(e,t){void 0===t&&(t=!0);var r=["left","right"].includes(e);return new B(e,t?L(P[e],!1):null,r,r?"width":"height",r?"height":"width",r?"left":"top",r?"top":"left","center"===e,!["right","bottom"].includes(e))}var j={top:L("top"),bottom:L("bottom"),left:L("left"),right:L("right")},T=s({},j,{center:L("center")}),R=["top","left","bottom","right"],k=function(){function e(e){return this.top=void 0,this.left=void 0,this.right=void 0,this.bottom=void 0,Object.assign(this,e)}return e.mergeSmallestSides=function(t){var r=t[0],n=t.slice(1);if(!r)throw new Error("Please provide at least 1 bounds objects in order to merge");for(var o,i=Object.fromEntries(R.map((function(e){return[e,r[e]]}))),s=c(n);!(o=s()).done;)for(var u,a=o.value,l=c(R);!(u=l()).done;){var f=u.value;i[f]=Math.min(i[f],a[f])}return new e(i)},i(e,[{key:"allSidesArePositive",get:function(){var e=this;return R.every((function(t){return e[t]>=0}))}},{key:"negativeSides",get:function(){var e=this;return Object.fromEntries(R.filter((function(t){return e[t]<0})).map((function(t){return[t,e[t]]})))}}]),e}();function H(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce((function(e,t){return e+(t?h(t):0)}),0)}function M(e){return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}var z={top:0,left:0,right:0,bottom:0,width:0,height:0},I=function(){function e(e){return void 0===e&&(e={}),this.top=void 0,this.left=void 0,this.right=void 0,this.bottom=void 0,this.width=void 0,this.height=void 0,Object.assign(this,z,e)}e.create=function(t){return new e(t)},e.fromElement=function(t,r){void 0===r&&(r={});var n=r,o=n.withTransform,i=void 0===o||o,u=n.environment,a=void 0===u?window:u,c=n.withScrollbars,l=void 0===c||c,f=new e(M(t.getBoundingClientRect()));if(!i){var p=a.getComputedStyle(t),d=p.width,g=p.height,v=p.boxSizing,m=p.borderLeft,y=p.borderRight,b=p.borderTop,w=p.borderBottom,C=p.paddingLeft,O=p.paddingRight,S=p.paddingTop,E=p.paddingBottom;f=new e(s({},f,{width:"border-box"===v?h(d):H(d,m,y,C,O),height:"border-box"===v?h(g):H(g,b,w,S,E)}))}if(!l){var P=f.width-t.clientWidth,B=f.height-t.clientHeight;return f.substract({right:P,bottom:B})}return f},e.empty=function(){return new e},e.fromWindow=function(t){var r,n=null!=(r=null==t?void 0:t.document.scrollingElement)?r:null==t?void 0:t.document.documentElement,o=null!=n?n:{},i=o.clientWidth,s=void 0===i?0:i,u=o.clientHeight,a=void 0===u?0:u;return new e({width:s,height:a,right:s,bottom:a})};var t=e.prototype;return t.toObject=function(){return M(this)},t.merge=function(t){var r=this.toObject();return new e(s({},r,"function"==typeof t?t(r):t))},t.substract=function(t){for(var r=this.toObject(),n=0,o=Object.entries(t);n<o.length;n++){var i=o[n],s=i[0],u=i[1];if(s in j){var a=j[s];r[s]+=a.factor(u),r[a.isHorizontal?"width":"height"]-=u}else r[s]-=u||0}return new e(r)},t.offsetsTo=function(e){return new k({top:e.top-this.top,bottom:this.bottom-e.bottom,left:e.left-this.left,right:this.right-e.right})},t.mapSides=function(t){for(var r=this.toObject(),n=0,o=Object.values(j);n<o.length;n++){var i=o[n];r[i.prop]=t(i,r[i.prop])}return new e(r)},i(e,[{key:"surface",get:function(){return this.width*this.height}}]),e}(),A=function(){function e(e,t,r,n,o){this.primary=void 0,this.secondary=void 0,this.offsets=void 0,this.subjectsBounds=void 0,this._cachedLayerBounds=null,this._cachedContainerOffsets=null,this.primary=e,this.secondary=t,this.offsets=o,this.setSubjectsBounds(r,n)}var t=e.prototype;return t.setSubjectsBounds=function(e,t){if(t){var r="function"==typeof t?t(this.primary.prop):t;this.subjectsBounds=e.merge({layer:s({},e.layer,r)})}else this.subjectsBounds=e},t.getLayerBounds=function(e){if(void 0===e&&(e=0),this._cachedLayerBounds&&0===e)return this._cachedLayerBounds;var t=this.primary,r=this.secondary,n=this.subjectsBounds,o=n.trigger,i=n.layer,s=n.arrow,u=t.isHorizontal,a=t.oppositeCssProp,c=t.oppositeSizeProp,l=t.prop,f=t.opposite,p=I.empty();p[f.prop]=o[l]-t.factor(this.offsets.trigger),p[l]=p[f.prop]-t.factor(i[t.sizeProp]);var d=2*this.offsets.arrow,h=o[a]-(i[c]-s[c])+d,v=o[a]+(o[c]-s[c])-d;if(r.isPush||(h+=i[c],v+=i[c]),r.isCenter){var m=(u?j.top:j.left).prop,y=(u?j.bottom:j.right).prop;p[m]=g(o[m]+o[c]/2-i[c]/2+e,h,v),p[y]=p[m]+i[c]}else{var b=r,w=o[b.prop],C=w<h?h-w:w>v?v-w:0;p[b.prop]=g(w+e+C,h,v),p[b.opposite.prop]=p[b.prop]+r.factor(i[c])}p.width=p.right-p.left,p.height=p.bottom-p.top;var O=I.create(p);return 0===e&&(this._cachedLayerBounds=O),O},t.getLayerCollisionBounds=function(){var e=this.offsets.container;return this.getLayerBounds().mapSides((function(t,r){return r-t.factor(e)})).merge((function(t){var r=t.width,n=t.height;return{width:r+2*e,height:n+2*e}}))},t.getContainerOffsets=function(e){if(this._cachedContainerOffsets&&!e)return this._cachedContainerOffsets;var t=this.subjectsBounds.merge({layer:e||this.getLayerCollisionBounds()}),r=k.mergeSmallestSides(t.layerOffsetsToScrollContainers);return e||(this._cachedContainerOffsets=r),r},i(e,[{key:"type",get:function(){return this.primary.prop+"-"+("center"===this.secondary.prop?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var e=this.secondary.isHorizontal,t=this.subjectsBounds,r=t.triggerHasBiggerWidth,n=t.triggerHasBiggerHeight;return e&&r||!e&&n}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var e=this.getLayerBounds(),t=this.getContainerOffsets(e).negativeSides;for(var r in t)t[r]=-t[r];return e.substract(t).surface}},{key:"secondaryOffsetSide",get:function(){var e,t,r=this,n=this.getContainerOffsets();return(null!=(e=null==(t=Object.entries(n.negativeSides).map((function(e){var t=e[0],r=e[1];return[j[t],r]})).filter((function(e){var t=e[0];return r.primary.isOppositeDirection(t)})).sort((function(e,t){var r=e[1];return t[1]-r})))?void 0:t[0])?e:[])[0]||null}}]),e}(),x=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,u(t,r),n.prototype.getLayerBounds=function(){var e=this.subjectsBounds,t=e.trigger,r=e.layer,n=I.empty();return n.top=t.top+t.height/2-r.height/2,n.bottom=n.top+r.height,n.left=t.left+t.width/2-r.width/2,n.right=n.left+r.width,n.width=n.right-n.left,n.height=n.bottom-n.top,n},n}(A);var D={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};var W=function(){function e(e,t,r){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=e,this.config=t,this.subjectsBounds=r}e.getSidesFromPlacementType=function(e){var t=e.split("-"),r=t[0],n=t[1],o=j[r];return[o,"center"===n?T.center:o.isHorizontal?"start"===n?T.top:T.bottom:"start"===n?T.left:T.right]},e.create=function(t,r){var n={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function o(o){void 0===o&&(o=r.placement);var i=e.getSidesFromPlacementType(o),s=i[0],u=i[1],a=j[s.isHorizontal?r.preferY:r.preferX],c=!s.isHorizontal&&t.triggerHasBiggerWidth||s.isHorizontal&&t.triggerHasBiggerHeight;function l(e,o){return new A(e,o,t,r.layerDimensions,n)}var f=[];return f[0]=l(s,u),f[1]=l(s,u.isCenter?a:T.center),f[2]=l(s,T[(u.opposite.isCenter?a.opposite:u.opposite).prop]),f[3]=l(a,c?s:T[s.opposite.prop]),f[4]=l(a,T.center),f[5]=l(a,c?T[s.opposite.prop]:s),f[6]=l(j[a.opposite.prop],c?s:T[s.opposite.prop]),f[7]=l(j[a.opposite.prop],T.center),f[8]=l(j[a.opposite.prop],c?T[s.opposite.prop]:s),f[9]=l(j[s.opposite.prop],u),f[10]=l(j[s.opposite.prop],u.isCenter?a:T.center),f[11]=l(j[s.opposite.prop],T[(u.opposite.isCenter?a.opposite:u.opposite).prop]),f=f.filter((function(e){return e.type===r.placement||r.possiblePlacements.includes(e.type)}))}return"center"===r.placement?new e([new x(T.center,T.center,t,r.layerDimensions,n)].concat(o(r.preferY+"-"+r.preferX)),r,t):new e(o(),r,t)};var t=e.prototype;return t.filterPlacementsBySide=function(e){return this.placements.filter((function(t){return t.primary===e}))},t.findFirstPlacementThatFits=function(){return this.placements.find((function(e){return e.fitsContainer}))},t.placementWithBiggestVisibleSurface=function(){return this.placements.map((function(e){return{placement:e,surface:e.visibleSurface}})).sort((function(e,t){return t.surface-e.surface}))[0].placement},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(e){var t=this.config,r=t.auto,n=t.snap;if(!r||n||e instanceof x)return 0;var o=this.filterPlacementsBySide(e.primary);if(0===o.indexOf(e)&&e.fitsContainer)return 0;var i=o.find((function(e){return!e.fitsContainer}));if(!i)return 0;var s=i.secondaryOffsetSide;if(!s)return 0;var u,a=e.getContainerOffsets(),c=e.secondary;return u=e.triggerIsBigger||i===e?s.isPush?-1:1:c===T.left||[T.top,T.center].includes(c)&&s.isPush?-1:1,a[s.prop]*u},t.getStyles=function(e,t,r,n){var o={willChange:"top, left, width, height"},i=function(e,t,r){var n;if(t.primary.isCenter)return D;var o=e.layer,i=e.trigger,u=e.arrow,a=t.primary.oppositeSizeProp,c=i[a]>o[a],l=r+u[a]/2,f=o[a]-u[a]/2-r,p=function(e,t,r){var n=e.layer,o=e.trigger,i=e.arrow,s=t.primary.oppositeSizeProp,u=t.primary.isHorizontal?["top","bottom"]:["left","right"],a=u[0],c=u[1],l=n[a]+n[s]/2-o[a]-i[s]/2-r,f=n[c]-n[s]/2-o[c]+i[s]/2+r;return(l<0?-l:0)+(f>0?-f:0)}(e,t,r),d=t.primary.prop,h=t.primary.oppositeCssProp,v=c?o[a]/2+p:i[h]+i[a]/2-o[h];return s({},D,((n={})[d]="100%",n[h]=g(v,l,f),n))}(this.subjectsBounds.merge({layer:e}),t,this.config.arrowOffset);return{arrow:i,layer:this.config.overflowContainer?s({},o,{position:"fixed",top:e.top,left:e.left}):s({},o,{position:"absolute",top:e.top-this.subjectsBounds.parent.top+r.top-n.top,left:e.left-this.subjectsBounds.parent.left+r.left-n.left})}},t.getHasDisappeared=function(e){var t=this.config.overflowContainer?this.subjectsBounds.trigger:e,r=k.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(t,!0));return Object.entries(r.negativeSides).some((function(e){var r=e[0];return e[1]<=-t[j[r].sizeProp]}))?"full":r.allSidesArePositive?null:"partial"},t.result=function(e,t){var r=this.findSuitablePlacement(),n=this.getSecondaryOffset(r),o=r.getLayerBounds(n);return{styles:this.getStyles(o,r,e,t),layerSide:r.primary.prop,placement:r,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),_=function(){function e(e,t){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=t,Object.assign(this,e)}e.create=function(t,r,n,o,i,s,u,a){var c=I.fromWindow(t);return new e({layer:I.fromElement(r,{environment:t,withTransform:!1}),trigger:a?I.create(M(a())):I.fromElement(n),arrow:i?I.fromElement(i):I.empty(),parent:o?I.fromElement(o):c,window:c,scrollContainers:[c].concat(s.map((function(e){return I.fromElement(e,{withScrollbars:!1})})))},u)};var t=e.prototype;return t.merge=function(t){return new e(s({},this,t),this.overflowContainer)},t.offsetsToScrollContainers=function(e,t){return void 0===t&&(t=!1),(this.overflowContainer&&!t?[this.window]:this.scrollContainers).map((function(t){return t.offsetsTo(e)}))},i(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),Y=null;function N(e){"undefined"!=typeof document&&(Y="function"==typeof e?e():"string"==typeof e?document.getElementById(e):e)}var X={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:E,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function F(e){var t,o=e.isOpen,i=void 0!==o&&o,s=e.overflowContainer,u=void 0===s?X.overflowContainer:s,a=e.environment,c=void 0===a?"undefined"!=typeof window?window:void 0:a,l=e.ResizeObserver,f=e.placement,p=void 0===f?X.placement:f,d=e.possiblePlacements,h=void 0===d?X.possiblePlacements:d,g=e.preferX,y=void 0===g?X.preferX:g,b=e.preferY,C=void 0===b?X.preferY:b,E=e.auto,P=void 0===E?X.auto:E,B=e.snap,L=void 0===B?X.snap:B,j=e.triggerOffset,T=void 0===j?X.triggerOffset:j,R=e.containerOffset,k=void 0===R?X.containerOffset:R,H=e.arrowOffset,M=void 0===H?X.arrowOffset:H,z=e.container,I=void 0===z?X.container:z,A=e.layerDimensions,x=void 0===A?null:A,D=e.onDisappear,N=e.onOutsideClick,F=e.onParentClose,V=e.trigger,U=(0,r.useState)((function(){return{layerSide:"center"===p?"center":W.getSidesFromPlacementType(p)[0].prop,styles:{layer:{position:u?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}})),Z=U[0],$=U[1],q=(0,r.useRef)(null),J=function(e,t){var n=(0,r.useRef)(e);return t?(n.current=e,n):(n.current=null,n)}(Z,i),K=(0,r.useRef)({cancelled:!1});(0,r.useEffect)((function(){return function(){K.current.cancelled=!0}}),[]);var Q=(0,r.useCallback)((function(e,t,r){var n=e.arrow,o=e.layer,i=e.scrollContainers,s=e.trigger,a=i[0],l=_.create(c,o,s,a,n,i,u,null==V?void 0:V.getBounds),f={placement:p,possiblePlacements:h,auto:P,layerDimensions:x,arrowOffset:M,containerOffset:k,triggerOffset:T,preferX:y,preferY:C,snap:L,overflowContainer:u},d=W.create(l,f).result(t,r),g=d.hasDisappeared,m={layerSide:d.layerSide,styles:d.styles};if(!J.current||function(e,t){if(e.layerSide!==t.layerSide)return!0;for(var r=0,n=["position","top","left","right","bottom"];r<n.length;r++){var o=n[r];if(e.styles.layer[o]!==t.styles.layer[o]||e.styles.arrow[o]!==t.styles.arrow[o])return!0}return!1}(J.current,m)){J.current=m,K.current.cancelled=!0;var b={cancelled:!1};K.current=b,Promise.resolve().then((function(){b.cancelled||$(m)}))}v(g)&&v(D)&&D(g)}),[M,P,k,c,x,D,u,p,h,y,C,L,T,J,V]),ee=w({ResizeObserverPolyfill:l,environment:c,enabled:i,overflowContainer:u,onChange:Q,triggerOption:V}),te=ee.triggerRef,re=ee.layerRef,ne=ee.arrowRef,oe=ee.closestScrollContainer,ie=S({isOpen:i,onOutsideClick:N,onParentClose:F}),se=ie.closeOnOutsideClickRefs,ue=ie.registrations,ae={triggerProps:Boolean(V)?{}:{ref:m(te,se.trigger,q)},layerProps:{ref:m(re,se.layer),style:Z.styles.layer},arrowProps:{ref:ne,style:Z.styles.arrow,layerSide:Z.layerSide},layerSide:Z.layerSide,triggerBounds:i?V?V.getBounds():null==(t=q.current)?void 0:t.getBoundingClientRect():null,renderLayer:function(e){return"undefined"!=typeof document?(0,n.createPortal)((0,r.createElement)(O,{registrations:ue,children:e}),u||!oe?function(e){var t;if("function"==typeof e){if(!((t=e())&&t instanceof HTMLElement))throw new Error("react-laag: You've passed a function to the 'container' prop, but it returned no valid HTMLElement")}else if(e instanceof HTMLElement)t=e;else if("string"==typeof e){if(!(t=document.getElementById(e)))throw new Error("react-laag: You've passed element with id '"+e+"' to the 'container' prop, but it returned no valid HTMLElement")}else{if(Y instanceof HTMLElement)return Y;(t=document.getElementById(G))||((t=document.createElement("div")).id=G,t.style.cssText="\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n ",document.body.appendChild(t))}return t}(I):oe):null}};return ae}var G="layers";var V=["size","angle","borderWidth","borderColor","roundness","backgroundColor","layerSide","style"],U="left",Z="top",$="bottom",q="right";function J(e,t){return Math.tan(e*(Math.PI/180))*t}function K(e,t,r,n){var o;return((o={})[$]="0 "+-n+" "+t+" "+e,o[Z]="0 0 "+t+" "+(e+n),o[q]=-n+" 0 "+e+" "+t,o[U]="0 0 "+(e+n)+" "+t,o)[r.prop]}function Q(e,t,r,n,o){var i,s,u,a=n/10*e*2,c=(i={},i[$]=[0,e],i[Z]=[0,0],i[q]=[e,t],i[U]=[0,t],i)[r.prop].join(" "),l=r.isHorizontal?"V 0":"H "+t,f=t/2,p=t/2+J(o,e/8),d=e/8,h=(s={},s[$]=["C",p,d,f+a,0,f,0],s[Z]=["C",p,e-d,f+a,e,f,e],s[q]=["C",d,t-p,0,f-a,0,f],s[U]=["C",e-d,t-p,e,f-a,e,f],s)[r.prop].join(" "),g=t/2-J(o,e/8),v=e/8;return["M",c,l,h,(u={},u[$]=["C",f-a,0,g,v,c],u[Z]=["C",f-a,e,g,e-v,c],u[q]=["C",0,f+a,v,t-g,c],u[U]=["C",e,f+a,e-v,t-g,c],u)[r.prop].join(" ")].join(" ")}function ee(e,t,r,n,o){var i=J(o,r),s=n.isPush?[0,r]:[e,e-r],u=s[0],a=s[1];return n.isHorizontal?["M",u,r,"V",t-r,"L",a,t-r-i,"V",i+r,"Z"].join(" "):["M",r,u,"H",t-r,"L",t-r-i,a,"H",i+r,"Z"].join(" ")}var te,re=(0,r.forwardRef)((function(e,t){var n=e.size,o=void 0===n?8:n,i=e.angle,u=void 0===i?45:i,a=e.borderWidth,c=void 0===a?0:a,l=e.borderColor,f=void 0===l?"black":l,p=e.roundness,d=void 0===p?0:p,h=e.backgroundColor,g=void 0===h?"white":h,v=e.layerSide,m=void 0===v?"top":v,y=e.style,b=void 0===y?{}:y,w=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,V);if("center"===m)return null;var C=j[m],O=o,S=2*J(u,o),E=Math.max(O,S);return(0,r.createElement)("svg",s({ref:t},w,{style:s({},b,{transform:"translate"+(C.isHorizontal?"Y":"X")+"(-50%)"}),width:E,height:E,preserveAspectRatio:C.isPush?"xMinYMin":"xMaxYMax",viewBox:K(O,S,C,c)}),(0,r.createElement)("path",{fill:g,strokeWidth:c,stroke:f,d:Q(O,S,C,d,u)}),(0,r.createElement)("path",{fill:g,d:ee(O,S,c,C,u)}))}));function ne(e){var t=void 0===e?{}:e,n=t.delayEnter,o=void 0===n?0:n,i=t.delayLeave,s=void 0===i?0:i,u=t.hideOnScroll,a=void 0===u||u,c=(0,r.useState)(!1),l=c[0],f=c[1],p=(0,r.useRef)(null),d=(0,r.useRef)(te.IDLE),h=(0,r.useRef)(!1),g=(0,r.useCallback)((function(){clearTimeout(p.current),p.current=null,d.current=te.IDLE}),[]);function v(e,t){if(d.current===te.ENTERING&&p.current&&g(),l){if(t)return f(!1),p.current=null,void(d.current=te.IDLE);d.current=te.LEAVING,p.current=window.setTimeout((function(){f(!1),p.current=null,d.current=te.IDLE}),s)}}return(0,r.useEffect)((function(){function e(){l&&a&&(g(),f(!1))}return window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0),p.current&&clearTimeout(p.current)}}),[l,a,g]),[l,{onMouseEnter:function(){d.current===te.LEAVING&&p.current&&g(),l||(d.current=te.ENTERING,p.current=window.setTimeout((function(){f(!0),p.current=null,d.current=te.IDLE}),o))},onMouseLeave:v,onTouchStart:function(){h.current=!1},onTouchMove:function(){h.current=!0},onTouchEnd:function(){h.current||l||f(!0),h.current=!1}},function(){return v(0,!0)}]}function oe(e){var t=e.isOpen,n=e.children,o=(0,r.useState)({isOpenInternal:t,isLeaving:!1}),i=o[0],u=o[1],a=(0,r.useRef)(!1);return(0,r.useEffect)((function(){t?u({isOpenInternal:!0,isLeaving:!1}):a.current&&u({isOpenInternal:!1,isLeaving:!0})}),[t,u]),(0,r.useEffect)((function(){}),[n]),(0,r.useEffect)((function(){a.current=!0}),[]),t||i.isOpenInternal||i.isLeaving?n(i.isOpenInternal,(function(){i.isOpenInternal||u((function(e){return s({},e,{isLeaving:!1})}))}),i.isLeaving):null}!function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"}(te||(te={})),window.ReactLaag=window.ReactLaag||t})();