MOON
Server: Apache
System: Linux res.emeff.ca 3.10.0-962.3.2.lve1.5.24.10.el7.x86_64 #1 SMP Wed Mar 20 07:36:02 EDT 2019 x86_64
User: accemeff (1004)
PHP: 7.0.33
Disabled: NONE
Upload Files
File: /home/accemeff/vendor/craftcms/cms/lib/element-resize-detector/element-resize-detector.js
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).elementResizeDetectorMaker=e()}}(function(){return function r(a,s,l){function d(n,e){if(!s[n]){if(!a[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(c)return c(n,!0);var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var o=s[n]={exports:{}};a[n][0].call(o.exports,function(e){var t=a[n][1][e];return d(t||e)},o,o.exports,r,a,s,l)}return s[n].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)d(l[e]);return d}({1:[function(e,t,n){"use strict";var d=e("./utils");function c(){var i={},n=0,o=0,r=0;return{add:function(e,t){t||(t=e,e=0),o<e?o=e:e<r&&(r=e),i[e]||(i[e]=[]),i[e].push(t),n++},process:function(){for(var e=r;e<=o;e++)for(var t=i[e],n=0;n<t.length;n++)(0,t[n])()},size:function(){return n}}}t.exports=function(e){var t=(e=e||{}).reporter,n=d.getOption(e,"async",!0),i=d.getOption(e,"auto",!0);i&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,r=c(),a=!1;function s(){for(a=!0;r.size();){var e=r;r=c(),e.process()}a=!1}function l(){var e;e=s,o=setTimeout(e,0)}return{add:function(e,t){!a&&i&&n&&0===r.size()&&l(),r.add(e,t)},force:function(e){a||(void 0===e&&(e=n),o&&(clearTimeout(o),o=null),e?l():s())}}}},{"./utils":2}],2:[function(e,t,n){"use strict";(t.exports={}).getOption=function(e,t,n){var i=e[t];return null!=i||void 0===n?i:n}},{}],3:[function(e,t,n){"use strict";var i=t.exports={};i.isIE=function(e){return(-1!==(t=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/"))&&(!e||e===function(){for(var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e",n[0];);return 4<e?e:void 0}());var t},i.isLegacyOpera=function(){return!!window.opera}},{}],4:[function(e,t,n){"use strict";(t.exports={}).forEach=function(e,t){for(var n=0;n<e.length;n++){var i=t(e[n]);if(i)return i}}},{}],5:[function(e,t,n){"use strict";var c=e("../browser-detector");t.exports=function(e){var s=(e=e||{}).reporter,l=e.batchProcessor,d=e.stateHandler.getState;if(!s)throw new Error("Missing required dependency: reporter.");function i(e){return d(e).object}return{makeDetectable:function(e,t,n){n||(n=t,t=e,e=null),(e=e||{}).debug,c.isIE(8)?n(t):function(n,i){var o=!1,r=window.getComputedStyle(n),e=n.offsetWidth,t=n.offsetHeight;function a(){function e(){if("static"===r.position){n.style.position="relative";var e=function(e,t,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(e.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",t),t.style[i]=0)};e(s,n,r,"top"),e(s,n,r,"right"),e(s,n,r,"bottom"),e(s,n,r,"left")}}""!==r.position&&(e(),o=!0);var t=document.createElement("object");t.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",t.tabIndex=-1,t.type="text/html",t.onload=function(){o||e(),function e(t,n){t.contentDocument?n(t.contentDocument):setTimeout(function(){e(t,n)},100)}(this,function(e){i(n)})},c.isIE()||(t.data="about:blank"),n.appendChild(t),d(n).object=t,c.isIE()&&(t.data="about:blank")}d(n).startSize={width:e,height:t},l?l.add(a):a()}(t,n)},addListener:function(e,t){if(!i(e))throw new Error("Element is not detectable by this strategy.");function n(){t(e)}c.isIE(8)?(d(e).object={proxy:n},e.attachEvent("onresize",n)):i(e).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(e){c.isIE(8)?e.detachEvent("onresize",d(e).object.proxy):e.removeChild(i(e)),delete d(e).object}}}},{"../browser-detector":3}],6:[function(e,t,n){"use strict";var D=e("../collection-utils").forEach;t.exports=function(e){var x=(e=e||{}).reporter,E=e.batchProcessor,S=e.stateHandler.getState,z=(e.stateHandler.hasState,e.idHandler);if(!E)throw new Error("Missing required dependency: batchProcessor");if(!x)throw new Error("Missing required dependency: reporter.");var A=function(){var e=document.createElement("div");e.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var t=document.createElement("div");t.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,i=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:i}}(),k="erd_scroll_detection_container";function H(e,t,n){if(e.addEventListener)e.addEventListener(t,n);else{if(!e.attachEvent)return x.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+t,n)}}function n(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n);else{if(!e.detachEvent)return x.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+t,n)}}function L(e){return S(e).container.childNodes[0].childNodes[0].childNodes[0]}function C(e){return S(e).container.childNodes[0].childNodes[0].childNodes[1]}return function(i,e){if(!document.getElementById(i)){var t=e+"_animation",n=e+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+e+" > div::-webkit-scrollbar { display: none; }\n\n",o+="."+n+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+t+"; animation-name: "+t+"; }\n",o+="@-webkit-keyframes "+t+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(e,t){t=t||function(e){document.head.appendChild(e)};var n=document.createElement("style");n.innerHTML=e,n.id=i,t(n)}(o+="@keyframes "+t+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",k),{makeDetectable:function(a,v,e){function m(){if(a.debug){var e=Array.prototype.slice.call(arguments);if(e.unshift(z.get(v),"Scroll: "),x.log.apply)x.log.apply(null,e);else for(var t=0;t<e.length;t++)x.log(e[t])}}function s(e){var t=S(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function t(){var e=window.getComputedStyle(v),t={};return t.position=e.position,t.width=v.offsetWidth,t.height=v.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function n(){if(m("storeStyle invoked."),S(v)){var e=t();S(v).style=e}else m("Aborting because element has been uninstalled")}function l(e,t,n){S(e).lastWidth=t,S(e).lastHeight=n}function d(){return 2*A.width+1}function c(){return 2*A.height+1}function u(e){return e+10+d()}function f(e){return e+10+c()}function h(e,t,n){var i=L(e),o=C(e),r=u(t),a=f(n),s=2*t+d(),l=2*n+c();i.scrollLeft=r,i.scrollTop=a,o.scrollLeft=s,o.scrollTop=l}function b(){var e=S(v).container;if(!e){(e=document.createElement("div")).className=k,e.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",(S(v).container=e).className+=" "+k+"_animation_active",v.appendChild(e);var t=function(){S(v).onRendered&&S(v).onRendered()};H(e,"animationstart",t),S(v).onAnimationStart=t}return e}function i(){if(m("Injecting elements"),S(v)){!function(){var e=S(v).style;if("static"===e.position){v.style.position="relative";var t=function(e,t,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(e.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",t),t.style[i]=0)};t(x,v,e,"top"),t(x,v,e,"right"),t(x,v,e,"bottom"),t(x,v,e,"left")}}();var e=S(v).container;e||(e=b());var t,n,i,o,r=A.width,a=A.height,s="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; left: "+(t=(t=-(1+r))?t+"px":"0")+"; top: "+(n=(n=-(1+a))?n+"px":"0")+"; right: "+(o=(o=-r)?o+"px":"0")+"; bottom: "+(i=(i=-a)?i+"px":"0")+";",l=document.createElement("div"),d=document.createElement("div"),c=document.createElement("div"),u=document.createElement("div"),f=document.createElement("div"),h=document.createElement("div");l.dir="ltr",l.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",l.className=k,d.className=k,d.style.cssText=s,c.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",u.style.cssText="position: absolute; left: 0; top: 0;",f.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",h.style.cssText="position: absolute; width: 200%; height: 200%;",c.appendChild(u),f.appendChild(h),d.appendChild(c),d.appendChild(f),l.appendChild(d),e.appendChild(l),H(c,"scroll",g),H(f,"scroll",p),S(v).onExpandScroll=g,S(v).onShrinkScroll=p}else m("Aborting because element has been uninstalled");function g(){S(v).onExpand&&S(v).onExpand()}function p(){S(v).onShrink&&S(v).onShrink()}}function o(){function o(e,t,n){var i=L(e).childNodes[0],o=u(t),r=f(n);i.style.width=o+"px",i.style.height=r+"px"}function n(e){var n=v.offsetWidth,i=v.offsetHeight;m("Storing current size",n,i),l(v,n,i),E.add(0,function(){if(S(v))if(r()){if(a.debug){var e=v.offsetWidth,t=v.offsetHeight;e===n&&t===i||x.warn(z.get(v),"Scroll: Size changed before updating detector elements.")}o(v,n,i)}else m("Aborting because element container has not been initialized");else m("Aborting because element has been uninstalled")}),E.add(1,function(){S(v)?r()?h(v,n,i):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),e&&E.add(2,function(){S(v)?r()?e():m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")})}function r(){return!!S(v).container}function i(){m("notifyListenersIfNeeded invoked");var e=S(v);return void 0===S(v).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?m("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?m("Not notifying: Size already notified"):(m("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void D(S(v).listeners,function(e){e(v)}))}function e(){if(m("Scroll detected."),s(v))m("Scroll event fired while unrendered. Ignoring...");else{var e=v.offsetWidth,t=v.offsetHeight;e!==S(v).lastWidth||t!==S(v).lastHeight?(m("Element size changed."),n(i)):m("Element size has not changed ("+e+"x"+t+").")}}if(m("registerListenersAndPositionElements invoked."),S(v)){S(v).onRendered=function(){if(m("startanimation triggered."),s(v))m("Ignoring since element is still unrendered...");else{m("Element rendered.");var e=L(v),t=C(v);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(m("Scrollbars out of sync. Updating detector elements..."),n(i))}},S(v).onExpand=e,S(v).onShrink=e;var t=S(v).style;o(v,t.width,t.height)}else m("Aborting because element has been uninstalled")}function r(){if(m("finalizeDomMutation invoked."),S(v)){var e=S(v).style;l(v,e.width,e.height),h(v,e.width,e.height)}else m("Aborting because element has been uninstalled")}function g(){e(v)}function p(){var e;m("Installing..."),S(v).listeners=[],e=t(),S(v).startSize={width:e.width,height:e.height},m("Element start size",S(v).startSize),E.add(0,n),E.add(1,i),E.add(2,o),E.add(3,r),E.add(4,g)}var y,w;e||(e=v,v=a,a=null),a=a||{},m("Making detectable..."),(w=y=v)!==w.ownerDocument.body&&!w.ownerDocument.body.contains(w)||null===window.getComputedStyle(y)?(m("Element is detached"),b(),m("Waiting until element is attached..."),S(v).onRendered=function(){m("Element is now attached"),p()}):p()},addListener:function(e,t){if(!S(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");S(e).listeners.push(t)},uninstall:function(e){var t=S(e);t&&(t.onExpandScroll&&n(L(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&n(C(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&n(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))}}}},{"../collection-utils":4}],7:[function(e,t,n){"use strict";var y=e("./collection-utils").forEach,s=e("./element-utils"),l=e("./listener-handler"),d=e("./id-generator"),c=e("./id-handler"),u=e("./reporter"),f=e("./browser-detector"),w=e("batch-processor"),x=e("./state-handler"),E=e("./detection-strategy/object.js"),S=e("./detection-strategy/scroll.js");function z(e){return Array.isArray(e)||void 0!==e.length}function A(e){if(Array.isArray(e))return e;var t=[];return y(e,function(e){t.push(e)}),t}function k(e){return e&&1===e.nodeType}function H(e,t,n){var i=e[t];return null==i&&void 0!==n?n:i}t.exports=function(t){var n;if((t=t||{}).idHandler)n={get:function(e){return t.idHandler.get(e,!0)},set:t.idHandler.set};else{var e=d(),i=c({idGenerator:e,stateHandler:x});n=i}var h=t.reporter;h||(h=u(!1===h));var o=H(t,"batchProcessor",w({reporter:h})),g={};g.callOnAdd=!!H(t,"callOnAdd",!0),g.debug=!!H(t,"debug",!1);var p,v=l(n),m=s({stateHandler:x}),r=H(t,"strategy","object"),a={reporter:h,batchProcessor:o,stateHandler:x,idHandler:n};if("scroll"===r&&(f.isLegacyOpera()?(h.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),r="object"):f.isIE(9)&&(h.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),r="object")),"scroll"===r)p=S(a);else{if("object"!==r)throw new Error("Invalid strategy name: "+r);p=E(a)}var b={};return{listenTo:function(e,r,a){function s(t){var e=v.get(t);y(e,function(e){e(t)})}function l(e,t,n){v.add(t,n),e&&n(t)}if(a||(a=r,r=e,e={}),!r)throw new Error("At least one element required.");if(!a)throw new Error("Listener required.");if(k(r))r=[r];else{if(!z(r))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");r=A(r)}var d=0,c=H(e,"callOnAdd",g.callOnAdd),u=H(e,"onReady",function(){}),f=H(e,"debug",g.debug);y(r,function(e){x.getState(e)||(x.initState(e),n.set(e));var o=n.get(e);if(f&&h.log("Attaching listener to element",o,e),!m.isDetectable(e))return f&&h.log(o,"Not detectable."),m.isBusy(e)?(f&&h.log(o,"System busy making it detectable"),l(c,e,a),b[o]=b[o]||[],void b[o].push(function(){++d===r.length&&u()})):(f&&h.log(o,"Making detectable..."),m.markBusy(e,!0),p.makeDetectable({debug:f},e,function(e){if(f&&h.log(o,"onElementDetectable"),x.getState(e)){m.markAsDetectable(e),m.markBusy(e,!1),p.addListener(e,s),l(c,e,a);var t=x.getState(e);if(t&&t.startSize){var n=e.offsetWidth,i=e.offsetHeight;t.startSize.width===n&&t.startSize.height===i||s(e)}b[o]&&y(b[o],function(e){e()})}else f&&h.log(o,"Element uninstalled before being detectable.");delete b[o],++d===r.length&&u()}));f&&h.log(o,"Already detecable, adding listener."),l(c,e,a),d++}),d===r.length&&u()},removeListener:v.removeListener,removeAllListeners:v.removeAllListeners,uninstall:function(e){if(!e)return h.error("At least one element is required.");if(k(e))e=[e];else{if(!z(e))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=A(e)}y(e,function(e){v.removeAllListeners(e),p.uninstall(e),x.cleanState(e)})}}}},{"./browser-detector":3,"./collection-utils":4,"./detection-strategy/object.js":5,"./detection-strategy/scroll.js":6,"./element-utils":8,"./id-generator":9,"./id-handler":10,"./listener-handler":11,"./reporter":12,"./state-handler":13,"batch-processor":1}],8:[function(e,t,n){"use strict";t.exports=function(e){var n=e.stateHandler.getState;return{isDetectable:function(e){var t=n(e);return t&&!!t.isDetectable},markAsDetectable:function(e){n(e).isDetectable=!0},isBusy:function(e){return!!n(e).busy},markBusy:function(e,t){n(e).busy=!!t}}}},{}],9:[function(e,t,n){"use strict";t.exports=function(){var e=1;return{generate:function(){return e++}}}},{}],10:[function(e,t,n){"use strict";t.exports=function(e){var i=e.idGenerator,o=e.stateHandler.getState;return{get:function(e){var t=o(e);return t&&void 0!==t.id?t.id:null},set:function(e){var t=o(e);if(!t)throw new Error("setId required the element to have a resize detection state.");var n=i.generate();return t.id=n}}}},{}],11:[function(e,t,n){"use strict";t.exports=function(i){var o={};function r(e){var t=i.get(e);return void 0===t?[]:o[t]||[]}return{get:r,add:function(e,t){var n=i.get(e);o[n]||(o[n]=[]),o[n].push(t)},removeListener:function(e,t){for(var n=r(e),i=0,o=n.length;i<o;++i)if(n[i]===t){n.splice(i,1);break}},removeAllListeners:function(e){var t=r(e);t&&(t.length=0)}}}},{}],12:[function(e,t,n){"use strict";t.exports=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var i=function(e,n){e[n]=function(){var e=console[n];if(e.apply)e.apply(console,arguments);else for(var t=0;t<arguments.length;t++)e(arguments[t])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}},{}],13:[function(e,t,n){"use strict";var i="_erd";function o(e){return e[i]}t.exports={initState:function(e){return e[i]={},o(e)},getState:o,cleanState:function(e){delete e[i]}}},{}]},{},[7])(7)});
//# sourceMappingURL=element-resize-detector.js.map