Sid Gifari File Manager
🏠 Root
/
home2
/
iuywvcmy
/
public_html
/
wp-content
/
plugins
/
beaver-builder-lite-version
/
js
/
build
/
Editing: vendor-react-laag.bundle.min.js
(()=>{"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})();
Save
Cancel