biofriction-wp-theme/node_modules/foundation-sites/dist/js/plugins/foundation.util.box.min.js

3 lines
5.0 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./foundation.core"),require("./foundation.core.utils")):"function"==typeof define&&define.amd?define(["./foundation.core","./foundation.core.utils"],e):"object"==typeof exports?exports["foundation.util.box"]=e(require("./foundation.core"),require("./foundation.core.utils")):(t.__FOUNDATION_EXTERNAL__=t.__FOUNDATION_EXTERNAL__||{},t.__FOUNDATION_EXTERNAL__["foundation.util.box"]=e(t.__FOUNDATION_EXTERNAL__["foundation.core"],t.__FOUNDATION_EXTERNAL__["foundation.core"]))}(window,function(o,i){return function(o){var i={};function n(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return o[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}return n.m=o,n.c=i,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=21)}({"./foundation.core":function(t,e){t.exports=o},"./foundation.core.utils":function(t,e){t.exports=i},"./js/entries/plugins/foundation.util.box.js":function(t,e,o){"use strict";o.r(e);var i=o("./foundation.core");o.d(e,"Foundation",function(){return i.Foundation});var n=o("./js/foundation.util.box.js");o.d(e,"Box",function(){return n.Box}),i.Foundation.Box=n.Box},"./js/foundation.util.box.js":function(t,e,o){"use strict";o.r(e),o.d(e,"Box",function(){return i});var r=o("./foundation.core.utils"),i={ImNotTouchingYou:function(t,e,o,i,n){return 0===f(t,e,o,i,n)},OverlapArea:f,GetDimensions:l,GetOffsets:function(t,e,o,i,n,f){switch(console.log("NOTE: GetOffsets is deprecated in favor of GetExplicitOffsets and will be removed in 6.5"),o){case"top":return Object(r.rtl)()?s(t,e,"top","left",i,n,f):s(t,e,"top","right",i,n,f);case"bottom":return Object(r.rtl)()?s(t,e,"bottom","left",i,n,f):s(t,e,"bottom","right",i,n,f);case"center top":return s(t,e,"top","center",i,n,f);case"center bottom":return s(t,e,"bottom","center",i,n,f);case"center left":return s(t,e,"left","center",i,n,f);case"center right":return s(t,e,"right","center",i,n,f);case"left bottom":return s(t,e,"bottom","left",i,n,f);case"right bottom":return s(t,e,"bottom","right",i,n,f);case"center":return{left:$eleDims.windowDims.offset.left+$eleDims.windowDims.width/2-$eleDims.width/2+n,top:$eleDims.windowDims.offset.top+$eleDims.windowDims.height/2-($eleDims.height/2+i)};case"reveal":return{left:($eleDims.windowDims.width-$eleDims.width)/2+n,top:$eleDims.windowDims.offset.top+i};case"reveal full":return{left:$eleDims.windowDims.offset.left,top:$eleDims.windowDims.offset.top};default:return{left:Object(r.rtl)()?$anchorDims.offset.left-$eleDims.width+$anchorDims.width-n:$anchorDims.offset.left+n,top:$anchorDims.offset.top+$anchorDims.height+i}}},GetExplicitOffsets:s};function f(t,e,o,i,n){var f,r,s,u,c=l(t);if(e){var a=l(e);r=a.height+a.offset.top-(c.offset.top+c.height),f=c.offset.top-a.offset.top,s=c.offset.left-a.offset.left,u=a.width+a.offset.left-(c.offset.left+c.width)}else r=c.windowDims.height+c.windowDims.offset.top-(c.offset.top+c.height),f=c.offset.top-c.windowDims.offset.top,s=c.offset.left-c.windowDims.offset.left,u=c.windowDims.width-(c.offset.left+c.width);return r=n?0:Math.min(r,0),f=Math.min(f,0),s=Math.min(s,0),u=Math.min(u,0),o?s+u:i?f+r:Math.sqrt(f*f+r*r+s*s+u*u)}function l(t){if((t=t.length?t[0]:t)===window||t===document)throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");var e=t.getBoundingClientRect(),o=t.parentNode.getBoundingClientRect(),i=document.body.getBoundingClientRect(),n=window.pageYOffset,f=window.pageXOffset;return{width:e.width,height:e.height,offset:{top:e.top+n,left:e.left+f},parentDims:{width:o.width,height:o.height,offset:{top:o.top+n,left:o.left+f}},windowDims:{width:i.width,height:i.height,offset:{top:n,left:f}}}}function s(t,e,o,i,n,f,r){var s,u,c=l(t),a=e?l(e):null;switch(o){case"top":s=a.offset.top-(c.height+n);break;case"bottom":s=a.offset.top+a.height+n;break;case"left":u=a.offset.left-(c.width+f);break;case"right":u=a.offset.left+a.width+f}switch(o){case"top":case"bottom":switch(i){case"left":u=a.offset.left+f;break;case"right":u=a.offset.left-c.width+a.width-f;break;case"center":u=r?f:a.offset.left+a.width/2-c.width/2+f}break;case"right":case"left":switch(i){case"bottom":s=a.offset.top-n+a.height-c.height;break;case"top":s=a.offset.top+n;break;case"center":s=a.offset.top+n+a.height/2-c.height/2}}return{top:s,left:u}}},21:function(t,e,o){t.exports=o("./js/entries/plugins/foundation.util.box.js")}})});
//# sourceMappingURL=foundation.util.box.min.js.map