{"version":3,"sources":["webpack:///./node_modules/enquire.js/src/Util.js","webpack:///./node_modules/enquire.js/src/index.js","webpack:///./node_modules/enquire.js/src/MediaQueryDispatch.js","webpack:///./node_modules/enquire.js/src/MediaQuery.js","webpack:///./node_modules/enquire.js/src/QueryHandler.js"],"names":["module","exports","isFunction","target","isArray","Object","prototype","toString","apply","each","collection","fn","i","length","MediaQueryDispatch","MediaQuery","Util","window","matchMedia","Error","this","queries","browserIsIncapable","matches","constructor","register","q","options","shouldDegrade","isUnconditional","match","handler","addHandler","unregister","query","removeHandler","clear","QueryHandler","handlers","mql","self","listener","currentTarget","assess","addListener","constuctor","qh","push","on","h","equals","destroy","splice","removeListener","action","deferSetup","setup","initialised","off","unmatch"],"mappings":"4EAuCAA,EAAOC,QAAU,CACbC,WALJ,SAAoBC,GAChB,MAAyB,mBAAXA,GAKdC,QAhBJ,SAAiBD,GACb,MAAmD,mBAA5CE,OAAOC,UAAUC,SAASC,MAAML,IAgBvCM,KApCJ,SAAcC,EAAYC,GAKtB,IAJA,IAAIC,EAAS,EACTC,EAASH,EAAWG,OAGjBD,EAAIC,IAEK,IADLF,EAAGD,EAAWE,GAAIA,GADVA,S,oBCXvB,IAAIE,EAAqB,EAAQ,KACjCd,EAAOC,QAAU,IAAIa,G,oBCDrB,IAAIC,EAAa,EAAQ,KACrBC,EAAO,EAAQ,KACfP,EAAOO,EAAKP,KACZP,EAAac,EAAKd,WAClBE,EAAUY,EAAKZ,QAQnB,SAASU,IACL,IAAIG,OAAOC,WACP,MAAM,IAAIC,MAAM,8DAGpBC,KAAKC,QAAU,GACfD,KAAKE,oBAAsBL,OAAOC,WAAW,YAAYK,QAG7DT,EAAmBR,UAAY,CAE3BkB,YAAcV,EAadW,SAAW,SAASC,EAAGC,EAASC,GAC5B,IAAIP,EAAkBD,KAAKC,QACvBQ,EAAkBD,GAAiBR,KAAKE,mBAoB5C,OAlBID,EAAQK,KACRL,EAAQK,GAAK,IAAIX,EAAWW,EAAGG,IAIhC3B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IW,EAASlC,KAAKG,UAAY,KAAO,MAErCd,EAAKW,KAAKkB,UAAU,SAASP,GACzBA,EAAQuB,UAKpBtD,EAAOC,QAAUc,G,kBClFjB,SAASsB,EAAaV,GAClBP,KAAKO,QAAUA,GACdA,EAAQ4B,YAAcnC,KAAKoC,QAGhCnB,EAAa/B,UAAY,CAErBkB,YAAca,EAOdmB,MAAQ,WACDpC,KAAKO,QAAQ6B,OACZpC,KAAKO,QAAQ6B,QAEjBpC,KAAKqC,aAAc,GAQvBT,GAAK,YACA5B,KAAKqC,aAAerC,KAAKoC,QAC1BpC,KAAKO,QAAQG,OAASV,KAAKO,QAAQG,SAQvC4B,IAAM,WACFtC,KAAKO,QAAQgC,SAAWvC,KAAKO,QAAQgC,WASzCR,QAAU,WACN/B,KAAKO,QAAQwB,QAAU/B,KAAKO,QAAQwB,UAAY/B,KAAKsC,OAUzDR,OAAS,SAAS/C,GACd,OAAOiB,KAAKO,UAAYxB,GAAUiB,KAAKO,QAAQG,QAAU3B,IAKjEH,EAAOC,QAAUoC","file":"npm.enquire.js.c920b4ddeb9b68365139.js","sourcesContent":["/**\n * Helper function for iterating over a collection\n *\n * @param collection\n * @param fn\n */\nfunction each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}\n\n/**\n * Helper function for determining whether target object is an array\n *\n * @param target the object under test\n * @return {Boolean} true if array, false otherwise\n */\nfunction isArray(target) {\n return Object.prototype.toString.apply(target) === '[object Array]';\n}\n\n/**\n * Helper function for determining whether target object is a function\n *\n * @param target the object under test\n * @return {Boolean} true if function, false otherwise\n */\nfunction isFunction(target) {\n return typeof target === 'function';\n}\n\nmodule.exports = {\n isFunction : isFunction,\n isArray : isArray,\n each : each\n};\n","var MediaQueryDispatch = require('./MediaQueryDispatch');\nmodule.exports = new MediaQueryDispatch();\n","var MediaQuery = require('./MediaQuery');\nvar Util = require('./Util');\nvar each = Util.each;\nvar isFunction = Util.isFunction;\nvar isArray = Util.isArray;\n\n/**\n * Allows for registration of query handlers.\n * Manages the query handler's state and is responsible for wiring up browser events\n *\n * @constructor\n */\nfunction MediaQueryDispatch () {\n if(!window.matchMedia) {\n throw new Error('matchMedia not present, legacy browsers require a polyfill');\n }\n\n this.queries = {};\n this.browserIsIncapable = !window.matchMedia('only all').matches;\n}\n\nMediaQueryDispatch.prototype = {\n\n constructor : MediaQueryDispatch,\n\n /**\n * Registers a handler for the given media query\n *\n * @param {string} q the media query\n * @param {object || Array || Function} options either a single query handler object, a function, or an array of query handlers\n * @param {function} options.match fired when query matched\n * @param {function} [options.unmatch] fired when a query is no longer matched\n * @param {function} [options.setup] fired when handler first triggered\n * @param {boolean} [options.deferSetup=false] whether setup should be run immediately or deferred until query is first matched\n * @param {boolean} [shouldDegrade=false] whether this particular media query should always run on incapable browsers\n */\n register : function(q, options, shouldDegrade) {\n var queries = this.queries,\n isUnconditional = shouldDegrade && this.browserIsIncapable;\n\n if(!queries[q]) {\n queries[q] = new MediaQuery(q, isUnconditional);\n }\n\n //normalise to object in an array\n if(isFunction(options)) {\n options = { match : options };\n }\n if(!isArray(options)) {\n options = [options];\n }\n each(options, function(handler) {\n if (isFunction(handler)) {\n handler = { match : handler };\n }\n queries[q].addHandler(handler);\n });\n\n return this;\n },\n\n /**\n * unregisters a query and all it's handlers, or a specific handler for a query\n *\n * @param {string} q the media query to target\n * @param {object || function} [handler] specific handler to unregister\n */\n unregister : function(q, handler) {\n var query = this.queries[q];\n\n if(query) {\n if(handler) {\n query.removeHandler(handler);\n }\n else {\n query.clear();\n delete this.queries[q];\n }\n }\n\n return this;\n }\n};\n\nmodule.exports = MediaQueryDispatch;\n","var QueryHandler = require('./QueryHandler');\nvar each = require('./Util').each;\n\n/**\n * Represents a single media query, manages it's state and registered handlers for this query\n *\n * @constructor\n * @param {string} query the media query string\n * @param {boolean} [isUnconditional=false] whether the media query should run regardless of whether the conditions are met. Primarily for helping older browsers deal with mobile-first design\n */\nfunction MediaQuery(query, isUnconditional) {\n this.query = query;\n this.isUnconditional = isUnconditional;\n this.handlers = [];\n this.mql = window.matchMedia(query);\n\n var self = this;\n this.listener = function(mql) {\n // Chrome passes an MediaQueryListEvent object, while other browsers pass MediaQueryList directly\n self.mql = mql.currentTarget || mql;\n self.assess();\n };\n this.mql.addListener(this.listener);\n}\n\nMediaQuery.prototype = {\n\n constuctor : MediaQuery,\n\n /**\n * add a handler for this query, triggering if already active\n *\n * @param {object} handler\n * @param {function} handler.match callback for when query is activated\n * @param {function} [handler.unmatch] callback for when query is deactivated\n * @param {function} [handler.setup] callback for immediate execution when a query handler is registered\n * @param {boolean} [handler.deferSetup=false] should the setup callback be deferred until the first time the handler is matched?\n */\n addHandler : function(handler) {\n var qh = new QueryHandler(handler);\n this.handlers.push(qh);\n\n this.matches() && qh.on();\n },\n\n /**\n * removes the given handler from the collection, and calls it's destroy methods\n *\n * @param {object || function} handler the handler to remove\n */\n removeHandler : function(handler) {\n var handlers = this.handlers;\n each(handlers, function(h, i) {\n if(h.equals(handler)) {\n h.destroy();\n return !handlers.splice(i,1); //remove from array and exit each early\n }\n });\n },\n\n /**\n * Determine whether the media query should be considered a match\n *\n * @return {Boolean} true if media query can be considered a match, false otherwise\n */\n matches : function() {\n return this.mql.matches || this.isUnconditional;\n },\n\n /**\n * Clears all handlers and unbinds events\n */\n clear : function() {\n each(this.handlers, function(handler) {\n handler.destroy();\n });\n this.mql.removeListener(this.listener);\n this.handlers.length = 0; //clear array\n },\n\n /*\n * Assesses the query, turning on all handlers if it matches, turning them off if it doesn't match\n */\n assess : function() {\n var action = this.matches() ? 'on' : 'off';\n\n each(this.handlers, function(handler) {\n handler[action]();\n });\n }\n};\n\nmodule.exports = MediaQuery;\n","/**\n * Delegate to handle a media query being matched and unmatched.\n *\n * @param {object} options\n * @param {function} options.match callback for when the media query is matched\n * @param {function} [options.unmatch] callback for when the media query is unmatched\n * @param {function} [options.setup] one-time callback triggered the first time a query is matched\n * @param {boolean} [options.deferSetup=false] should the setup callback be run immediately, rather than first time query is matched?\n * @constructor\n */\nfunction QueryHandler(options) {\n this.options = options;\n !options.deferSetup && this.setup();\n}\n\nQueryHandler.prototype = {\n\n constructor : QueryHandler,\n\n /**\n * coordinates setup of the handler\n *\n * @function\n */\n setup : function() {\n if(this.options.setup) {\n this.options.setup();\n }\n this.initialised = true;\n },\n\n /**\n * coordinates setup and triggering of the handler\n *\n * @function\n */\n on : function() {\n !this.initialised && this.setup();\n this.options.match && this.options.match();\n },\n\n /**\n * coordinates the unmatch event for the handler\n *\n * @function\n */\n off : function() {\n this.options.unmatch && this.options.unmatch();\n },\n\n /**\n * called when a handler is to be destroyed.\n * delegates to the destroy or unmatch callbacks, depending on availability.\n *\n * @function\n */\n destroy : function() {\n this.options.destroy ? this.options.destroy() : this.off();\n },\n\n /**\n * determines equality by reference.\n * if object is supplied compare options, if function, compare match callback\n *\n * @function\n * @param {object || function} [target] the target for comparison\n */\n equals : function(target) {\n return this.options === target || this.options.match === target;\n }\n\n};\n\nmodule.exports = QueryHandler;\n"],"sourceRoot":""}