{"version":3,"sources":["script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","$","init","inited","each","createBoxFromDOM","window","bind","onScroll","onWindowResize","onLoad","document","keyup","onKeyUp","overlay","click","onOverlayClick","options","testMode","console","log","events","trigger","recalculateHeights","$box","this","id","parseInt","substring","boxOptions","STB_Box_Options","element","$element","boxes","Box","resizeTimer","clearTimeout","setTimeout","scrollTimer","checkBoxCriterias","keyCode","dismissAllBoxes","boxId","box","visible","config","unclosable","dismiss","showAllBoxes","show","hideAllBoxes","hide","scrollY","scrollTop","scrollHeight","windowHeight","mayAutoShow","triggerHeight","triggered","mayAutoHide","innerHeight","setCustomBoxStyling","hideBox","showBox","toggleBox","toggle","x","offsetX","y","offsetY","rect","getBoundingClientRect","margin","innerWidth","left","right","top","bottom","getElementById","STB_Global_Options","EventEmitter","ready","jQuery","./_box.js","./_event-emitter.js","2","isLoggedIn","body","hasClass","startTime","Date","getTime","title","closed","cookieSet","autoShow","calculateTriggerHeight","triggerPercentage","triggerElementSelector","isCookieSet","prototype","find","$links","$forms","target","submit","setCookie","on","load","locationHashRefersBox","style","overflowY","maxHeight","boxHeight","outerHeight","position","newTopMargin","marginTop","is","fadeToggle","animation","slideToggle","$triggerElement","first","offset","height","cookieTime","expiryDate","setDate","getDate","cookie","toUTCString","location","hash","elementId","querySelector","minimumScreenWidth","currentTime","autoHide","replace","RegExp","3","indexOfListener","listeners","listener","alias","name","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","key","_getEvents","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","value","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","args","_getOnceReturnValue","emit","slice","setOnceReturnValue","_onceReturnValue","noConflict","amd","4","STB","./_box-manager.js"],"mappings":"CAAA,WAAe,GAAIA,GAAUC,OA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oF,aAAesE,EAChBtE,GAIc,kBAAXlG,IAAyBA,EAAOmN,IAC1CnN,EAAO,WACN,MAAOkG,KAGkB,gBAAXhF,IAAuBA,EAAOJ,QAC7CI,EAAOJ,QAAUoF,EAGjBpF,EAAQoF,aAAeA,IAEvBnF,KAAK4B,WACDyK,GAAG,SAAStN,EAAQoB,EAAOJ,GACjCU,OAAO6L,IAAMvN,EAAQ,uBAClBwN,oBAAoB,SAAS","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o box.triggerHeight ) {\n\t\t\t\tif( ! box.visible ) {\n\t\t\t\t\tbox.show();\n\t\t\t\t\tbox.triggered = true;\n\t\t\t\t}\n\t\t\t} else if( box.mayAutoHide() ) {\n\t\t\t\tif( box.visible ) {\n\t\t\t\t\tbox.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// recalculate heights and variables based on height\n\tfunction recalculateHeights() {\n\t\twindowHeight = window.innerHeight;\n\n\t\tfor( var boxId in boxes ) {\n\t\t\tvar box = boxes[boxId];\n\t\t\tbox.setCustomBoxStyling();\n\t\t}\n\t}\n\n\t// dismiss a single box (or all by omitting id param)\n\tfunction dismiss(id) {\n\t\t// if no id given, dismiss all current open boxes\n\t\tif( typeof(id) === \"undefined\" ) {\n\t\t\tdismissAllBoxes();\n\t\t} else if( typeof( boxes[id] ) === \"object\" ) {\n\t\t\tboxes[id].dismiss();\n\t\t}\n\t}\n\n\tfunction hideBox(id) {\n\t\tif( typeof( boxes[id] ) === \"object\" ) {\n\t\t\tboxes[id].hide();\n\t\t}\n\t}\n\n\tfunction showBox(id) {\n\t\tif( typeof( boxes[id] ) === \"object\" ) {\n\t\t\tboxes[id].show();\n\t\t}\n\t}\n\n\tfunction toggleBox(id) {\n\t\tif( typeof( boxes[id] ) === \"object\" ) {\n\t\t\tboxes[id].toggle();\n\t\t}\n\t}\n\n\tfunction onOverlayClick(e) {\n\t\tvar x = e.offsetX;\n\t\tvar y = e.offsetY;\n\n\t\t// calculate if click was near a box to avoid closing it (click error margin)\n\t\tfor(var boxId in boxes ) {\n\t\t\tvar box = boxes[boxId];\n\t\t\tif( ! box.visible || box.config.unclosable ) { continue; }\n\n\t\t\tvar rect = box.element.getBoundingClientRect();\n\t\t\tvar margin = 100 + ( window.innerWidth * 0.05 );\n\n\t\t\t// if click was not anywhere near box, dismiss it.\n\t\t\tif( x < ( rect.left - margin ) || x > ( rect.right + margin ) || y < ( rect.top - margin ) || y > ( rect.bottom + margin ) ) {\n\t\t\t\tbox.dismiss();\n\t\t\t}\n\t\t}\n\t}\n\n\t// init on document.ready OR in 5 seconds in case event pipeline is broken\n\t$(document).ready(init);\n\twindow.setTimeout(init, 5000);\n\n\t// expose a simple API to control all registered boxes\n\treturn {\n\t\tboxes: boxes,\n\t\tshowBox: showBox,\n\t\thideBox: hideBox,\n\t\ttoggleBox: toggleBox,\n\t\tshowAllBoxes: showAllBoxes,\n\t\thideAllBoxes: hideAllBoxes,\n\t\tdismissAllBoxes: dismissAllBoxes,\n\t\tdismiss: dismiss,\n\t\tevents: events\n\t}\n\n})(window.jQuery);\n},{\"./_box.js\":2,\"./_event-emitter.js\":3}],2:[function(require,module,exports){\nmodule.exports = (function() {\n\t'use strict';\n\n\tvar $ = window.jQuery,\n\t\tconsole = window.console || { log: function() { }},\n\t\tisLoggedIn = $(document.body).hasClass('logged-in'),\n\t\tstartTime = new Date().getTime();\n\n\t// Box Object\n\tvar Box = function( config, events ) {\n\t\tthis.id \t\t= config.id;\n\t\tthis.title \t\t= config.title;\n\t\tthis.element \t= config.element;\n\t\tthis.$element \t= $(config.element);\n\n\t\t// store config values\n\t\tthis.config = config;\n\t\tthis.events = events;\n\n\t\t// store ref to overlay\n\t\tthis.overlay = document.getElementById('stb-overlay');\n\n\t\t// state\n\t\tthis.visible \t= false;\n\t\tthis.closed \t= false;\n\t\tthis.triggered \t= false;\n\t\tthis.triggerHeight = 0;\n\t\tthis.cookieSet = false;\n\n\t\t// if a trigger was given, calculate some values which might otherwise be expensive)\n\t\tif( this.config.autoShow && this.config.trigger !== '' ) {\n\n\t\t\tif( this.config.trigger === 'percentage' || this.config.trigger === 'element' ) {\n\t\t\t\tthis.triggerHeight = this.calculateTriggerHeight( config.triggerPercentage, config.triggerElementSelector );\n\t\t\t}\n\n\t\t\tthis.cookieSet = this.isCookieSet();\n\t\t}\n\n\t\t// further initialise the box\n\t\tthis.init();\n\t};\n\n\t// initialise the box\n\tBox.prototype.init = function() {\n\t\tvar box = this;\n\n\t\t// attach event to \"close\" icon inside box\n\t\tthis.$element.find('.stb-close').click(box.dismiss.bind(this));\n\n\t\t// find all links & forms in this box\n\t\tthis.$links = this.$element.find('a');\n\t\tthis.$forms = this.$element.find('form');\n\n\t\tthis.$links.click(function(e) {\n\t\t\tbox.events.trigger('box.interactions.link', [ box, e.target ] );\n\t\t});\n\n\t\tthis.$forms.submit(function(e) {\n\t\t\tbox.setCookie();\n\t\t\tbox.events.trigger('box.interactions.form', [ box, e.target ]);\n\t\t});\n\n\t\t// attach event to all links referring #stb-{box_id}\n\t\t$(document.body).on('click', 'a[href=\"#stb-' + box.id + '\"]', function() {\n\t\t\tbox.toggle();\n\t\t\treturn false;\n\t\t});\n\n\t\tif( this.config.autoShow && this.config.trigger === 'instant' && ! this.cookieSet ) {\n\t\t\t$(window).load(this.show.bind(this));\n\t\t} else {\n\t\t\t// auto-show the box if box is referenced from URL\n\t\t\tif( this.locationHashRefersBox() ) {\n\t\t\t\t$(window).load(this.show.bind(this));\n\t\t\t}\n\t\t}\n\n\n\t};\n\n\n\t// set (calculate) custom box styling depending on box options\n\tBox.prototype.setCustomBoxStyling = function() {\n\n\t\t// reset element to its initial state\n\t\tthis.element.style.overflowY = 'auto';\n\t\tthis.element.style.maxHeight = 'none';\n\n\t\t// get new dimensions\n\t\tvar windowHeight = window.innerHeight;\n\t\tvar boxHeight = this.$element.outerHeight();\n\n\t\t// add scrollbar to box and limit height\n\t\tif( boxHeight > windowHeight ) {\n\t\t\tthis.element.style.maxHeight = windowHeight + \"px\";\n\t\t\tthis.element.style.overflowY = 'scroll';\n\t\t}\n\n\t\t// set new top margin for boxes which are centered\n\t\tif( this.config.position === 'center' ) {\n\t\t\tvar newTopMargin = ( ( windowHeight - boxHeight ) / 2 );\n\t\t\tnewTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n\t\t\tthis.element.style.marginTop = newTopMargin + \"px\";\n\t\t}\n\n\t};\n\n\t// toggle visibility of the box\n\tBox.prototype.toggle = function(show) {\n\n\t\t// revert visibility if no explicit argument is given\n\t\tif( typeof( show ) === \"undefined\" ) {\n\t\t\tshow = ! this.visible;\n\t\t}\n\n\t\t// do nothing if element is being animated\n\t\tif( this.$element.is(':animated') ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// is box already at desired visibility?\n\t\tif( show === this.visible ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// set new visibility status\n\t\tthis.visible = show;\n\n\t\t// calculate custom styling for which CSS is \"too stupid\"\n\t\tthis.setCustomBoxStyling();\n\n\t\t// fadein / fadeout the overlay if position is \"center\"\n\t\tif( this.config.position === 'center' ) {\n\t\t\t$(this.overlay).fadeToggle('slow');\n\t\t}\n\n\t\t// trigger event\n\t\tthis.events.trigger('box.' + ( show ? 'show' : 'hide' ), [ this ] );\n\n\t\t// show or hide box using selected animation\n\t\tif( this.config.animation === 'fade' ) {\n\t\t\tthis.$element.fadeToggle( 'slow' );\n\t\t} else {\n\t\t\tthis.$element.slideToggle( 'slow' );\n\t\t}\n\n\t\treturn true;\n\t};\n\n\t// show the box\n\tBox.prototype.show = function() {\n\t\tthis.events.trigger('box.show', [ this ]);\n\t\treturn this.toggle(true);\n\t};\n\n\t// hide the box\n\tBox.prototype.hide = function() {\n\t\tthis.events.trigger('box.hide', [ this ]);\n\t\treturn this.toggle(false);\n\t};\n\n\t// calculate trigger height\n\tBox.prototype.calculateTriggerHeight = function( triggerPercentage, triggerElementSelector ) {\n\n\t\tif( this.config.trigger === 'element' ) {\n\t\t\tvar $triggerElement = $(triggerElementSelector).first();\n\t\t\tif( $triggerElement.length > 0 ) {\n\t\t\t\t// return top offset of element\n\t\t\t\treturn $triggerElement.offset().top;\n\t\t\t} else {\n\t\t\t\t// element was not found, disable box.\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\t// calcate % of page height\n\t\treturn ( triggerPercentage / 100 * $(document).height() );\n\t};\n\n\t// set cookie that disables automatically showing the box\n\tBox.prototype.setCookie = function() {\n\t\t// do nothing if cookieTime evaluates to false\n\t\tif(! this.config.cookieTime) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar expiryDate = new Date();\n\t\texpiryDate.setDate( expiryDate.getDate() + this.config.cookieTime );\n\t\tdocument.cookie = 'stb_box_'+ this.id + '=true; expires='+ expiryDate.toUTCString() +'; path=/';\n\t};\n\n\t// checks whether window.location.hash equals the box element ID or that of any element inside the box\n\tBox.prototype.locationHashRefersBox = function() {\n\n\t\tif( ! window.location.hash || 0 === window.location.hash.length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar elementId = window.location.hash.substring(1);\n\t\tif( elementId === this.element.id ) {\n\t\t\treturn true;\n\t\t} else if( this.element.querySelector('#' + elementId) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\t// is this box enabled?\n\tBox.prototype.mayAutoShow = function() {\n\n\t\t// don't show if autoShow is disabled\n\t\tif( ! this.config.autoShow ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// don't show if box was closed before\n\t\tif( this.closed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if box fits on given minimum screen width\n\t\tif( this.config.minimumScreenWidth > 0 && window.innerWidth < this.config.minimumScreenWidth ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// don't show if page just loaded ( 500ms)\n\t\t// todo: make an option out of this\n\t\tvar currentTime = new Date().getTime();\n\t\tif( ( startTime + 500 ) > currentTime ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// rely on cookie value (show if not set, don't show if set)\n\t\treturn ! this.cookieSet;\n\t};\n\n\tBox.prototype.mayAutoHide = function() {\n\n\t\t// check if autoHide was allowed from config\n\t\tif( ! this.config.autoHide ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// only allow autoHide when box has been autoshown (triggered)\n\t\treturn this.triggered;\n\t};\n\n\tBox.prototype.isCookieSet = function() {\n\t\t// always show on test mode\n\t\tif( isLoggedIn && this.config.testMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// check for cookie\n\t\tif( this.config.cookieTime === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'stb_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n\t\treturn cookieSet;\n\n\t};\n\n\t// disable the box\n\tBox.prototype.dismiss = function() {\n\t\tthis.hide();\n\t\tthis.setCookie();\n\t\tthis.closed = true;\n\t\tthis.events.trigger('box.dismiss', [ this ]);\n\t};\n\n\treturn Box;\n})();\n},{}],3:[function(require,module,exports){\n/*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function () {\n\t'use strict';\n\n\t/**\n\t * Class for managing events.\n\t * Can be extended to provide event functionality in other classes.\n\t *\n\t * @class EventEmitter Manages event registering and emitting.\n\t */\n\tfunction EventEmitter() {}\n\n\t// Shortcuts to improve speed and size\n\tvar proto = EventEmitter.prototype;\n\tvar exports = this;\n\tvar originalGlobalValue = exports.EventEmitter;\n\n\t/**\n\t * Finds the index of the listener for the event in its storage array.\n\t *\n\t * @param {Function[]} listeners Array of listeners to search through.\n\t * @param {Function} listener Method to look for.\n\t * @return {Number} Index of the specified listener, -1 if not found\n\t * @api private\n\t */\n\tfunction indexOfListener(listeners, listener) {\n\t\tvar i = listeners.length;\n\t\twhile (i--) {\n\t\t\tif (listeners[i].listener === listener) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Alias a method while keeping the context correct, to allow for overwriting of target method.\n\t *\n\t * @param {String} name The name of the target method.\n\t * @return {Function} The aliased method\n\t * @api private\n\t */\n\tfunction alias(name) {\n\t\treturn function aliasClosure() {\n\t\t\treturn this[name].apply(this, arguments);\n\t\t};\n\t}\n\n\t/**\n\t * Returns the listener array for the specified event.\n\t * Will initialise the event object and listener arrays if required.\n\t * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n\t * Each property in the object response is an array of listener functions.\n\t *\n\t * @param {String|RegExp} evt Name of the event to return the listeners from.\n\t * @return {Function[]|Object} All listener functions for the event.\n\t */\n\tproto.getListeners = function getListeners(evt) {\n\t\tvar events = this._getEvents();\n\t\tvar response;\n\t\tvar key;\n\n\t\t// Return a concatenated array of all matching events if\n\t\t// the selector is a regular expression.\n\t\tif (evt instanceof RegExp) {\n\t\t\tresponse = {};\n\t\t\tfor (key in events) {\n\t\t\t\tif (events.hasOwnProperty(key) && evt.test(key)) {\n\t\t\t\t\tresponse[key] = events[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tresponse = events[evt] || (events[evt] = []);\n\t\t}\n\n\t\treturn response;\n\t};\n\n\t/**\n\t * Takes a list of listener objects and flattens it into a list of listener functions.\n\t *\n\t * @param {Object[]} listeners Raw listener objects.\n\t * @return {Function[]} Just the listener functions.\n\t */\n\tproto.flattenListeners = function flattenListeners(listeners) {\n\t\tvar flatListeners = [];\n\t\tvar i;\n\n\t\tfor (i = 0; i < listeners.length; i += 1) {\n\t\t\tflatListeners.push(listeners[i].listener);\n\t\t}\n\n\t\treturn flatListeners;\n\t};\n\n\t/**\n\t * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n\t *\n\t * @param {String|RegExp} evt Name of the event to return the listeners from.\n\t * @return {Object} All listener functions for an event in an object.\n\t */\n\tproto.getListenersAsObject = function getListenersAsObject(evt) {\n\t\tvar listeners = this.getListeners(evt);\n\t\tvar response;\n\n\t\tif (listeners instanceof Array) {\n\t\t\tresponse = {};\n\t\t\tresponse[evt] = listeners;\n\t\t}\n\n\t\treturn response || listeners;\n\t};\n\n\t/**\n\t * Adds a listener function to the specified event.\n\t * The listener will not be added if it is a duplicate.\n\t * If the listener returns true then it will be removed after it is called.\n\t * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n\t *\n\t * @param {String|RegExp} evt Name of the event to attach the listener to.\n\t * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.addListener = function addListener(evt, listener) {\n\t\tvar listeners = this.getListenersAsObject(evt);\n\t\tvar listenerIsWrapped = typeof listener === 'object';\n\t\tvar key;\n\n\t\tfor (key in listeners) {\n\t\t\tif (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n\t\t\t\tlisteners[key].push(listenerIsWrapped ? listener : {\n\t\t\t\t\tlistener: listener,\n\t\t\t\t\tonce: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * Alias of addListener\n\t */\n\tproto.on = alias('addListener');\n\n\t/**\n\t * Semi-alias of addListener. It will add a listener that will be\n\t * automatically removed after its first execution.\n\t *\n\t * @param {String|RegExp} evt Name of the event to attach the listener to.\n\t * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.addOnceListener = function addOnceListener(evt, listener) {\n\t\treturn this.addListener(evt, {\n\t\t\tlistener: listener,\n\t\t\tonce: true\n\t\t});\n\t};\n\n\t/**\n\t * Alias of addOnceListener.\n\t */\n\tproto.once = alias('addOnceListener');\n\n\t/**\n\t * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n\t * You need to tell it what event names should be matched by a regex.\n\t *\n\t * @param {String} evt Name of the event to create.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.defineEvent = function defineEvent(evt) {\n\t\tthis.getListeners(evt);\n\t\treturn this;\n\t};\n\n\t/**\n\t * Uses defineEvent to define multiple events.\n\t *\n\t * @param {String[]} evts An array of event names to define.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.defineEvents = function defineEvents(evts) {\n\t\tfor (var i = 0; i < evts.length; i += 1) {\n\t\t\tthis.defineEvent(evts[i]);\n\t\t}\n\t\treturn this;\n\t};\n\n\t/**\n\t * Removes a listener function from the specified event.\n\t * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n\t *\n\t * @param {String|RegExp} evt Name of the event to remove the listener from.\n\t * @param {Function} listener Method to remove from the event.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.removeListener = function removeListener(evt, listener) {\n\t\tvar listeners = this.getListenersAsObject(evt);\n\t\tvar index;\n\t\tvar key;\n\n\t\tfor (key in listeners) {\n\t\t\tif (listeners.hasOwnProperty(key)) {\n\t\t\t\tindex = indexOfListener(listeners[key], listener);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tlisteners[key].splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * Alias of removeListener\n\t */\n\tproto.off = alias('removeListener');\n\n\t/**\n\t * Adds listeners in bulk using the manipulateListeners method.\n\t * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n\t * You can also pass it a regular expression to add the array of listeners to all events that match it.\n\t * Yeah, this function does quite a bit. That's probably a bad thing.\n\t *\n\t * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n\t * @param {Function[]} [listeners] An optional array of listener functions to add.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.addListeners = function addListeners(evt, listeners) {\n\t\t// Pass through to manipulateListeners\n\t\treturn this.manipulateListeners(false, evt, listeners);\n\t};\n\n\t/**\n\t * Removes listeners in bulk using the manipulateListeners method.\n\t * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n\t * You can also pass it an event name and an array of listeners to be removed.\n\t * You can also pass it a regular expression to remove the listeners from all events that match it.\n\t *\n\t * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n\t * @param {Function[]} [listeners] An optional array of listener functions to remove.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.removeListeners = function removeListeners(evt, listeners) {\n\t\t// Pass through to manipulateListeners\n\t\treturn this.manipulateListeners(true, evt, listeners);\n\t};\n\n\t/**\n\t * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n\t * The first argument will determine if the listeners are removed (true) or added (false).\n\t * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n\t * You can also pass it an event name and an array of listeners to be added/removed.\n\t * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n\t *\n\t * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n\t * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n\t * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n\t\tvar i;\n\t\tvar value;\n\t\tvar single = remove ? this.removeListener : this.addListener;\n\t\tvar multiple = remove ? this.removeListeners : this.addListeners;\n\n\t\t// If evt is an object then pass each of its properties to this method\n\t\tif (typeof evt === 'object' && !(evt instanceof RegExp)) {\n\t\t\tfor (i in evt) {\n\t\t\t\tif (evt.hasOwnProperty(i) && (value = evt[i])) {\n\t\t\t\t\t// Pass the single listener straight through to the singular method\n\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\tsingle.call(this, i, value);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Otherwise pass back to the multiple function\n\t\t\t\t\t\tmultiple.call(this, i, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// So evt must be a string\n\t\t\t// And listeners must be an array of listeners\n\t\t\t// Loop over it and pass each one to the multiple method\n\t\t\ti = listeners.length;\n\t\t\twhile (i--) {\n\t\t\t\tsingle.call(this, evt, listeners[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * Removes all listeners from a specified event.\n\t * If you do not specify an event then all listeners will be removed.\n\t * That means every event will be emptied.\n\t * You can also pass a regex to remove all events that match it.\n\t *\n\t * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.removeEvent = function removeEvent(evt) {\n\t\tvar type = typeof evt;\n\t\tvar events = this._getEvents();\n\t\tvar key;\n\n\t\t// Remove different things depending on the state of evt\n\t\tif (type === 'string') {\n\t\t\t// Remove all listeners for the specified event\n\t\t\tdelete events[evt];\n\t\t}\n\t\telse if (evt instanceof RegExp) {\n\t\t\t// Remove all events matching the regex.\n\t\t\tfor (key in events) {\n\t\t\t\tif (events.hasOwnProperty(key) && evt.test(key)) {\n\t\t\t\t\tdelete events[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Remove all listeners in all events\n\t\t\tdelete this._events;\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * Alias of removeEvent.\n\t *\n\t * Added to mirror the node API.\n\t */\n\tproto.removeAllListeners = alias('removeEvent');\n\n\t/**\n\t * Emits an event of your choice.\n\t * When emitted, every listener attached to that event will be executed.\n\t * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n\t * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n\t * So they will not arrive within the array on the other side, they will be separate.\n\t * You can also pass a regular expression to emit to all events that match it.\n\t *\n\t * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n\t * @param {Array} [args] Optional array of arguments to be passed to each listener.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.emitEvent = function emitEvent(evt, args) {\n\t\tvar listeners = this.getListenersAsObject(evt);\n\t\tvar listener;\n\t\tvar i;\n\t\tvar key;\n\t\tvar response;\n\n\t\tfor (key in listeners) {\n\t\t\tif (listeners.hasOwnProperty(key)) {\n\t\t\t\ti = listeners[key].length;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\t// If the listener returns true then it shall be removed from the event\n\t\t\t\t\t// The function is executed either with a basic call or an apply if there is an args array\n\t\t\t\t\tlistener = listeners[key][i];\n\n\t\t\t\t\tif (listener.once === true) {\n\t\t\t\t\t\tthis.removeListener(evt, listener.listener);\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = listener.listener.apply(this, args || []);\n\n\t\t\t\t\tif (response === this._getOnceReturnValue()) {\n\t\t\t\t\t\tthis.removeListener(evt, listener.listener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * Alias of emitEvent\n\t */\n\tproto.trigger = alias('emitEvent');\n\n\t/**\n\t * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n\t * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n\t *\n\t * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n\t * @param {...*} Optional additional arguments to be passed to each listener.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.emit = function emit(evt) {\n\t\tvar args = Array.prototype.slice.call(arguments, 1);\n\t\treturn this.emitEvent(evt, args);\n\t};\n\n\t/**\n\t * Sets the current value to check against when executing listeners. If a\n\t * listeners return value matches the one set here then it will be removed\n\t * after execution. This value defaults to true.\n\t *\n\t * @param {*} value The new value to check for when executing listeners.\n\t * @return {Object} Current instance of EventEmitter for chaining.\n\t */\n\tproto.setOnceReturnValue = function setOnceReturnValue(value) {\n\t\tthis._onceReturnValue = value;\n\t\treturn this;\n\t};\n\n\t/**\n\t * Fetches the current value to check against when executing listeners. If\n\t * the listeners return value matches this one then it should be removed\n\t * automatically. It will return true by default.\n\t *\n\t * @return {*|Boolean} The current value to check for or the default, true.\n\t * @api private\n\t */\n\tproto._getOnceReturnValue = function _getOnceReturnValue() {\n\t\tif (this.hasOwnProperty('_onceReturnValue')) {\n\t\t\treturn this._onceReturnValue;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t};\n\n\t/**\n\t * Fetches the events object and creates one if required.\n\t *\n\t * @return {Object} The events storage object.\n\t * @api private\n\t */\n\tproto._getEvents = function _getEvents() {\n\t\treturn this._events || (this._events = {});\n\t};\n\n\t/**\n\t * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n\t *\n\t * @return {Function} Non conflicting EventEmitter class.\n\t */\n\tEventEmitter.noConflict = function noConflict() {\n\t\texports.EventEmitter = originalGlobalValue;\n\t\treturn EventEmitter;\n\t};\n\n\t// Expose the class either via AMD, CommonJS or the global object\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn EventEmitter;\n\t\t});\n\t}\n\telse if (typeof module === 'object' && module.exports){\n\t\tmodule.exports = EventEmitter;\n\t}\n\telse {\n\t\texports.EventEmitter = EventEmitter;\n\t}\n}.call(this));\n},{}],4:[function(require,module,exports){\nwindow.STB = require('./_box-manager.js');\n},{\"./_box-manager.js\":1}]},{},[4]);\n })();"],"sourceRoot":"/source/"}