{"version":3,"file":"default/js/vi-lazyload.js","mappings":";;;;;;;;;AAAA;AACA,IAAI,KAAyC;AAC7C,IAAI,iCAAO,EAAE,mCAAE;AACf;AACA,KAAK;AAAA,kGAAC,GAAG,CAGsD;AAC/D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yBAAyB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B,gEAAgE;AAC7F;AACA;AACA;AACA,CAAC;;;;;;UCzGD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,WAAW;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;;;;;;;ACzID,mBAAO,CAAC,yEAAe,IAAI","sources":["webpack://sfra-startup-kit/./node_modules/svg4everybody/dist/svg4everybody.js","webpack://sfra-startup-kit/webpack/bootstrap","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/vi-lazyload.js","webpack://sfra-startup-kit/./node_modules/svg-spritemap-webpack-plugin/svg4everybody-helper.js"],"sourcesContent":["!function(root, factory) {\n \"function\" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set\n define([], function() {\n return root.svg4everybody = factory();\n }) : \"object\" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory() : root.svg4everybody = factory();\n}(this, function() {\n /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */\n function embed(parent, svg, target) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n fragment.appendChild(clone.firstChild);\n }\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }\n function loadreadystatechange(xhr) {\n // listen to changes in the request\n xhr.onreadystatechange = function() {\n // if the request is ready\n if (4 === xhr.readyState) {\n // get the cached html document\n var cachedDocument = xhr._cachedDocument;\n // ensure the cached html document based on the xhr response\n cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(\"\"), \n cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item\n xhr._embeds.splice(0).map(function(item) {\n // get the cached target\n var target = xhr._cachedTarget[item.id];\n // ensure the cached target\n target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), \n // embed the target into the svg\n embed(item.parent, item.svg, target);\n });\n }\n }, // test the ready state change immediately\n xhr.onreadystatechange();\n }\n function svg4everybody(rawopts) {\n function oninterval() {\n // while the index exists in the live collection\n for (// get the cached index\n var index = 0; index < uses.length; ) {\n // get the current \n var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute(\"xlink:href\") || use.getAttribute(\"href\");\n if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)), \n svg && src) {\n if (polyfill) {\n if (!opts.validate || opts.validate(src, svg, use)) {\n // remove the element\n parent.removeChild(use);\n // parse the src and get the url and id\n var srcSplit = src.split(\"#\"), url = srcSplit.shift(), id = srcSplit.join(\"#\");\n // if the link is external\n if (url.length) {\n // get the cached xhr request\n var xhr = requests[url];\n // ensure the xhr request exists\n xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open(\"GET\", url), xhr.send(), \n xhr._embeds = []), // add the svg and id as an item to the xhr embeds list\n xhr._embeds.push({\n parent: parent,\n svg: svg,\n id: id\n }), // prepare the xhr ready state change event\n loadreadystatechange(xhr);\n } else {\n // embed the local id into the svg\n embed(parent, svg, document.getElementById(id));\n }\n } else {\n // increase the index when the previous value was not \"valid\"\n ++index, ++numberOfSvgUseElementsToBypass;\n }\n }\n } else {\n // increase the index when the previous value was not \"valid\"\n ++index;\n }\n }\n // continue the interval\n (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);\n }\n var polyfill, opts = Object(rawopts), newerIEUA = /\\bTrident\\/[567]\\b|\\bMSIE (?:9|10)\\.0\\b/, webkitUA = /\\bAppleWebKit\\/(\\d+)\\b/, olderEdgeUA = /\\bEdge\\/12\\.(\\d+)\\b/, edgeUA = /\\bEdge\\/.(\\d+)\\b/, inIframe = window.top !== window.self;\n polyfill = \"polyfill\" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;\n // create xhr requests object\n var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName(\"use\"), numberOfSvgUseElementsToBypass = 0;\n // conditionally start the interval if the polyfill is active\n polyfill && oninterval();\n }\n function getSVGAncestor(node) {\n for (var svg = node; \"svg\" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}\n return svg;\n }\n return svg4everybody;\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/*!\r\n * Vimeo LazyLoad \r\n * v2.1.0\r\n * https://github.com/the-muda-organization/vimeo-lazyload\r\n * MIT License\r\n */\r\n\r\n(function(){\r\n /*\r\n * IDEAS FOR THE FUTURE:\r\n * - Add data-title attribute to add overlay with title [optional]\r\n * - \r\n */\r\n \r\n /********************************************************************\r\n ************************** MAIN VARIABLES ***************************\r\n *********************************************************************/\r\n var vimeo = document.querySelectorAll('.vi-lazyload'),\r\n \r\n vimeo_observer, //Intersection Observer API\r\n \r\n template_wrap,\r\n template_content,\r\n template_playbtn,\r\n template_logo,\r\n template_iframe,\r\n \r\n settings_observer_rootMargin = '200px 0px', //Intersection Observer API option - rootMargin (Y, X)\r\n settings_thumb_base_url = 'https://raw.githubusercontent.com/the-muda-organization/vimeo-lazyload/master/demo-img/', //Base URL where thumbnails are stored\r\n settings_thumb_extension = 'webp'; //Thumbnail extension\r\n \r\n \r\n \r\n /********************************************************************\r\n ************************ IF ELEMENTS EXIST **************************\r\n *********************************************************************/\r\n if(vimeo.length > 0){\r\n \r\n //create elements\r\n template_wrap = document.createElement('div');\r\n template_content = document.createElement('div');\r\n template_playbtn = document.createElement('div');\r\n template_logo = document.createElement('a');\r\n template_iframe = document.createElement('iframe');\r\n \r\n //set attributes\r\n template_wrap.classList.add('vi-lazyload-wrap');\r\n template_content.classList.add('vi-lazyload-content');\r\n \r\n template_playbtn.classList.add('vi-lazyload-playbtn');\r\n \r\n template_logo.classList.add('vi-lazyload-logo');\r\n template_logo.target = '_blank';\r\n template_logo.rel = 'noreferrer';\r\n \r\n template_iframe.setAttribute('allow','autoplay;fullscreen;picture-in-picture');\r\n template_iframe.setAttribute('allowfullscreen','');\r\n \r\n \r\n /********************************************************************\r\n ********************* INTERSECTION OBSERVER API *********************\r\n *********************************************************************/\r\n vimeo_observer = new IntersectionObserver(function(elements){\r\n \r\n elements.forEach(function(e){\r\n \r\n //VARIABLES\r\n var this_element = e.target,\r\n \r\n this_wrap,\r\n this_content,\r\n this_playbtn,\r\n this_logo,\r\n this_iframe,\r\n \r\n this_data_id = e.target.dataset.id,\r\n this_data_thumb = e.target.dataset.thumb,\r\n this_data_logo = e.target.dataset.logo;\r\n \r\n \r\n //if element appears in viewport\r\n if(e.isIntersecting === true){\r\n \r\n //wrap\r\n this_wrap = template_wrap.cloneNode();\r\n this_element.append(this_wrap);\r\n \r\n //content\r\n this_content = template_content.cloneNode();\r\n this_wrap.append(this_content);\r\n \r\n //background-image\r\n this_content.style.setProperty('--vi-lazyload-img','url(\"' + settings_thumb_base_url + this_data_id + this_data_thumb + '.' + settings_thumb_extension + '\")');\r\n \r\n //play btn\r\n this_playbtn = template_playbtn.cloneNode();\r\n this_content.append(this_playbtn);\r\n \r\n //logo link\r\n if(this_data_logo !== '0'){\r\n this_logo = template_logo.cloneNode();\r\n this_logo.href = 'https://vimeo.com/' + this_data_id;\r\n this_content.append(this_logo);\r\n }\r\n \r\n //onclick create iframe\r\n this_playbtn.addEventListener('click',function(){\r\n this_iframe = template_iframe.cloneNode();\r\n this_iframe.src = 'https://player.vimeo.com/video/' + this_data_id + '?autoplay=1&autopause=0';\r\n this_content.append(this_iframe);\r\n });\r\n \r\n //Unobserve after image lazyloaded\r\n vimeo_observer.unobserve(this_element);\r\n \r\n //LOG\r\n //console.log('DONE - ' + this_data_id);\r\n }\r\n \r\n });\r\n \r\n },{\r\n rootMargin: settings_observer_rootMargin,\r\n });\r\n \r\n \r\n /********************************************************************\r\n ********************* ITERATE THROUGH ELEMENTS **********************\r\n *********************************************************************/\r\n vimeo.forEach(function(e){\r\n \r\n //Intersection Observer API - observe elements\r\n vimeo_observer.observe(e);\r\n \r\n });\r\n }\r\n \r\n})();\r\n","require('svg4everybody')({});\n"],"names":[],"sourceRoot":""}