{"remainingRequest":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/buble-loader/index.js??ref--2-1!/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/foundation-sites/js/foundation.interchange.js","dependencies":[{"path":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/foundation-sites/js/foundation.interchange.js","mtime":1560429080762},{"path":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/cache-loader/dist/cjs.js","mtime":1560429090832},{"path":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/buble-loader/index.js","mtime":1560429088235}],"contextDependencies":[],"result":["'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Plugin } from './foundation.plugin';\nimport { GetYoDigits } from './foundation.util.core';\n\n\n/**\n * Interchange module.\n * @module foundation.interchange\n * @requires foundation.util.mediaQuery\n */\n\nvar Interchange = (function (Plugin) {\n  function Interchange () {\n    Plugin.apply(this, arguments);\n  }\n\n  if ( Plugin ) Interchange.__proto__ = Plugin;\n  Interchange.prototype = Object.create( Plugin && Plugin.prototype );\n  Interchange.prototype.constructor = Interchange;\n\n  Interchange.prototype._setup = function _setup (element, options) {\n    this.$element = element;\n    this.options = $.extend({}, Interchange.defaults, options);\n    this.rules = [];\n    this.currentPath = '';\n    this.className = 'Interchange'; // ie9 back compat\n\n    this._init();\n    this._events();\n  };\n\n  /**\n   * Initializes the Interchange plugin and calls functions to get interchange functioning on load.\n   * @function\n   * @private\n   */\n  Interchange.prototype._init = function _init () {\n    MediaQuery._init();\n\n    var id = this.$element[0].id || GetYoDigits(6, 'interchange');\n    this.$element.attr({\n      'data-resize': id,\n      'id': id\n    });\n\n    this._addBreakpoints();\n    this._generateRules();\n    this._reflow();\n  };\n\n  /**\n   * Initializes events for Interchange.\n   * @function\n   * @private\n   */\n  Interchange.prototype._events = function _events () {\n    var this$1 = this;\n\n    this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () { return this$1._reflow(); });\n  };\n\n  /**\n   * Calls necessary functions to update Interchange upon DOM change\n   * @function\n   * @private\n   */\n  Interchange.prototype._reflow = function _reflow () {\n    var this$1 = this;\n\n    var match;\n\n    // Iterate through each rule, but only save the last match\n    for (var i in this$1.rules) {\n      if(this$1.rules.hasOwnProperty(i)) {\n        var rule = this$1.rules[i];\n        if (window.matchMedia(rule.query).matches) {\n          match = rule;\n        }\n      }\n    }\n\n    if (match) {\n      this.replace(match.path);\n    }\n  };\n\n  /**\n   * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.\n   * @function\n   * @private\n   */\n  Interchange.prototype._addBreakpoints = function _addBreakpoints () {\n    for (var i in MediaQuery.queries) {\n      if (MediaQuery.queries.hasOwnProperty(i)) {\n        var query = MediaQuery.queries[i];\n        Interchange.SPECIAL_QUERIES[query.name] = query.value;\n      }\n    }\n  };\n\n  /**\n   * Checks the Interchange element for the provided media query + content pairings\n   * @function\n   * @private\n   * @param {Object} element - jQuery object that is an Interchange instance\n   * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys\n   */\n  Interchange.prototype._generateRules = function _generateRules (element) {\n    var rulesList = [];\n    var rules;\n\n    if (this.options.rules) {\n      rules = this.options.rules;\n    }\n    else {\n      rules = this.$element.data('interchange');\n    }\n\n    rules =  typeof rules === 'string' ? rules.match(/\\[.*?\\]/g) : rules;\n\n    for (var i in rules) {\n      if(rules.hasOwnProperty(i)) {\n        var rule = rules[i].slice(1, -1).split(', ');\n        var path = rule.slice(0, -1).join('');\n        var query = rule[rule.length - 1];\n\n        if (Interchange.SPECIAL_QUERIES[query]) {\n          query = Interchange.SPECIAL_QUERIES[query];\n        }\n\n        rulesList.push({\n          path: path,\n          query: query\n        });\n      }\n    }\n\n    this.rules = rulesList;\n  };\n\n  /**\n   * Update the `src` property of an image, or change the HTML of a container, to the specified path.\n   * @function\n   * @param {String} path - Path to the image or HTML partial.\n   * @fires Interchange#replaced\n   */\n  Interchange.prototype.replace = function replace (path) {\n    if (this.currentPath === path) { return; }\n\n    var _this = this,\n        trigger = 'replaced.zf.interchange';\n\n    // Replacing images\n    if (this.$element[0].nodeName === 'IMG') {\n      this.$element.attr('src', path).on('load', function() {\n        _this.currentPath = path;\n      })\n      .trigger(trigger);\n    }\n    // Replacing background images\n    else if (path.match(/\\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) {\n      path = path.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n      this.$element.css({ 'background-image': 'url('+path+')' })\n          .trigger(trigger);\n    }\n    // Replacing HTML\n    else {\n      $.get(path, function(response) {\n        _this.$element.html(response)\n             .trigger(trigger);\n        $(response).foundation();\n        _this.currentPath = path;\n      });\n    }\n\n    /**\n     * Fires when content in an Interchange element is done being loaded.\n     * @event Interchange#replaced\n     */\n    // this.$element.trigger('replaced.zf.interchange');\n  };\n\n  /**\n   * Destroys an instance of interchange.\n   * @function\n   */\n  Interchange.prototype._destroy = function _destroy () {\n    this.$element.off('resizeme.zf.trigger')\n  };\n\n  return Interchange;\n}(Plugin));\n\n/**\n * Default settings for plugin\n */\nInterchange.defaults = {\n  /**\n   * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.\n   * @option\n   * @type {?array}\n   * @default null\n   */\n  rules: null\n};\n\nInterchange.SPECIAL_QUERIES = {\n  'landscape': 'screen and (orientation: landscape)',\n  'portrait': 'screen and (orientation: portrait)',\n  'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)'\n};\n\nexport {Interchange};\n",{"version":3,"file":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/foundation-sites/js/foundation.interchange.js","sources":["node_modules/foundation-sites/js/foundation.interchange.js"],"sourcesContent":["'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Plugin } from './foundation.plugin';\nimport { GetYoDigits } from './foundation.util.core';\n\n\n/**\n * Interchange module.\n * @module foundation.interchange\n * @requires foundation.util.mediaQuery\n */\n\nclass Interchange extends Plugin {\n  /**\n   * Creates a new instance of Interchange.\n   * @class\n   * @name Interchange\n   * @fires Interchange#init\n   * @param {Object} element - jQuery object to add the trigger to.\n   * @param {Object} options - Overrides to the default plugin settings.\n   */\n  _setup(element, options) {\n    this.$element = element;\n    this.options = $.extend({}, Interchange.defaults, options);\n    this.rules = [];\n    this.currentPath = '';\n    this.className = 'Interchange'; // ie9 back compat\n\n    this._init();\n    this._events();\n  }\n\n  /**\n   * Initializes the Interchange plugin and calls functions to get interchange functioning on load.\n   * @function\n   * @private\n   */\n  _init() {\n    MediaQuery._init();\n\n    var id = this.$element[0].id || GetYoDigits(6, 'interchange');\n    this.$element.attr({\n      'data-resize': id,\n      'id': id\n    });\n\n    this._addBreakpoints();\n    this._generateRules();\n    this._reflow();\n  }\n\n  /**\n   * Initializes events for Interchange.\n   * @function\n   * @private\n   */\n  _events() {\n    this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', () => this._reflow());\n  }\n\n  /**\n   * Calls necessary functions to update Interchange upon DOM change\n   * @function\n   * @private\n   */\n  _reflow() {\n    var match;\n\n    // Iterate through each rule, but only save the last match\n    for (var i in this.rules) {\n      if(this.rules.hasOwnProperty(i)) {\n        var rule = this.rules[i];\n        if (window.matchMedia(rule.query).matches) {\n          match = rule;\n        }\n      }\n    }\n\n    if (match) {\n      this.replace(match.path);\n    }\n  }\n\n  /**\n   * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.\n   * @function\n   * @private\n   */\n  _addBreakpoints() {\n    for (var i in MediaQuery.queries) {\n      if (MediaQuery.queries.hasOwnProperty(i)) {\n        var query = MediaQuery.queries[i];\n        Interchange.SPECIAL_QUERIES[query.name] = query.value;\n      }\n    }\n  }\n\n  /**\n   * Checks the Interchange element for the provided media query + content pairings\n   * @function\n   * @private\n   * @param {Object} element - jQuery object that is an Interchange instance\n   * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys\n   */\n  _generateRules(element) {\n    var rulesList = [];\n    var rules;\n\n    if (this.options.rules) {\n      rules = this.options.rules;\n    }\n    else {\n      rules = this.$element.data('interchange');\n    }\n\n    rules =  typeof rules === 'string' ? rules.match(/\\[.*?\\]/g) : rules;\n\n    for (var i in rules) {\n      if(rules.hasOwnProperty(i)) {\n        var rule = rules[i].slice(1, -1).split(', ');\n        var path = rule.slice(0, -1).join('');\n        var query = rule[rule.length - 1];\n\n        if (Interchange.SPECIAL_QUERIES[query]) {\n          query = Interchange.SPECIAL_QUERIES[query];\n        }\n\n        rulesList.push({\n          path: path,\n          query: query\n        });\n      }\n    }\n\n    this.rules = rulesList;\n  }\n\n  /**\n   * Update the `src` property of an image, or change the HTML of a container, to the specified path.\n   * @function\n   * @param {String} path - Path to the image or HTML partial.\n   * @fires Interchange#replaced\n   */\n  replace(path) {\n    if (this.currentPath === path) return;\n\n    var _this = this,\n        trigger = 'replaced.zf.interchange';\n\n    // Replacing images\n    if (this.$element[0].nodeName === 'IMG') {\n      this.$element.attr('src', path).on('load', function() {\n        _this.currentPath = path;\n      })\n      .trigger(trigger);\n    }\n    // Replacing background images\n    else if (path.match(/\\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) {\n      path = path.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n      this.$element.css({ 'background-image': 'url('+path+')' })\n          .trigger(trigger);\n    }\n    // Replacing HTML\n    else {\n      $.get(path, function(response) {\n        _this.$element.html(response)\n             .trigger(trigger);\n        $(response).foundation();\n        _this.currentPath = path;\n      });\n    }\n\n    /**\n     * Fires when content in an Interchange element is done being loaded.\n     * @event Interchange#replaced\n     */\n    // this.$element.trigger('replaced.zf.interchange');\n  }\n\n  /**\n   * Destroys an instance of interchange.\n   * @function\n   */\n  _destroy() {\n    this.$element.off('resizeme.zf.trigger')\n  }\n}\n\n/**\n * Default settings for plugin\n */\nInterchange.defaults = {\n  /**\n   * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.\n   * @option\n   * @type {?array}\n   * @default null\n   */\n  rules: null\n};\n\nInterchange.SPECIAL_QUERIES = {\n  'landscape': 'screen and (orientation: landscape)',\n  'portrait': 'screen and (orientation: portrait)',\n  'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)'\n};\n\nexport {Interchange};\n"],"names":["this"],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,SAAS,UAAU,QAAQ,8BAA8B,CAAC;AAC1D,SAAS,MAAM,QAAQ,qBAAqB,CAAC;AAC7C,SAAS,WAAW,QAAQ,wBAAwB,CAAC;;;;;;;;;AASrD,IAAM,WAAW,GAAe;EAAC;;;;;;;;EAAA,AAS/B,sBAAA,MAAM,mBAAA,CAAC,OAAO,EAAE,OAAO,EAAE;IACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IACxB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACtB,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;;IAE/B,IAAI,CAAC,KAAK,EAAE,CAAC;IACb,IAAI,CAAC,OAAO,EAAE,CAAC;GAChB,CAAA;;;;;;;EAOD,sBAAA,KAAK,kBAAA,GAAG;IACN,UAAU,CAAC,KAAK,EAAE,CAAC;;IAEnB,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ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