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CACzD/I,KAAKwI,gBAAkB,IAAI,GAJR,IAM3B,CACApC,sBACI,IAAIuD,EAAgB,KAChBC,EAAmB5J,KAAKgE,mBAC5BhE,KAAK6F,aAAahB,MAAMkE,YAAY,oBAAqB,mCACzD,MAAMpB,EAASkC,IACX,GAAgC,IAA5B7J,KAAKgE,oBACL4F,IAAqB5J,KAAKgE,mBAC1B,OAEkB,OAAlB2F,IACAA,EAAgBE,GAEpB,MAAsCC,GAArBD,EAAMF,GA7QN,mBA6QoE3J,KAAKgE,mBAC1FhE,KAAK2H,MAAMmC,GAEXJ,YAAW,IAAMnF,OAAOwF,sBAAsBpC,IAAQ,GACtDgC,EAAgBE,CAAG,EAEvBtF,OAAOwF,sBAAsBpC,EACjC,CACA/B,qBACI5F,KAAKgE,mBAAqB,EAC1BhE,KAAK6F,aAAahB,MAAMkE,YAAY,oBAAqB,iCAC7D,EAEkB,oBAAXxE,QACPA,OAAOyF,eAAeC,OAAO,wBAAyB7G,E","sources":["webpack://img-comparison-slider/./src/styles.scss","webpack://img-comparison-slider/../../node_modules/css-loader/dist/runtime/api.js","webpack://img-comparison-slider/webpack/bootstrap","webpack://img-comparison-slider/webpack/runtime/compat get default export","webpack://img-comparison-slider/webpack/runtime/define property getters","webpack://img-comparison-slider/webpack/runtime/hasOwnProperty shorthand","webpack://img-comparison-slider/./src/template.html","webpack://img-comparison-slider/./src/defaults.ts","webpack://img-comparison-slider/./src/index.ts","webpack://img-comparison-slider/./src/inBetween.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":host{--divider-width: 1px;--divider-color: #fff;--divider-shadow: none;--default-handle-width: 50px;--default-handle-color: #fff;--default-handle-opacity: 1;--default-handle-shadow: none;--handle-position-start: 50%;position:relative;display:inline-block;overflow:hidden;line-height:0;direction:ltr}@media screen and (-webkit-min-device-pixel-ratio: 0)and (min-resolution: 0.001dpcm){:host{outline-offset:1px}}::slotted(*){-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.first{position:absolute;left:0;top:0;right:0;line-height:normal;font-size:100%;max-height:100%;height:100%;width:100%;--exposure: 50%;--keyboard-transition-time: 0ms;--default-transition-time: 0ms;--transition-time: var(--default-transition-time)}.first .first-overlay-container{position:relative;clip-path:inset(0 var(--exposure) 0 0);transition:clip-path var(--transition-time);height:100%}.first .first-overlay{overflow:hidden;height:100%}.first.focused{will-change:clip-path}.first.focused .first-overlay-container{will-change:clip-path}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.first{--keyboard-transition-time: 50ms;--default-transition-time: 10ms;transform:translateX(calc(var(--exposure) * -1));transition:transform var(--transition-time);right:auto}.first .first-overlay-container{transform:translateX(var(--exposure));transition:transform var(--transition-time);clip-path:none}.first.focused{will-change:auto}.first.focused .first-overlay-container{will-change:auto}}}.second{position:relative}.handle-container{transform:translateX(50%);position:absolute;top:0;right:var(--exposure);height:100%;transition:right var(--transition-time),bottom var(--transition-time)}.focused .handle-container{will-change:right}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.handle-container{right:0}.focused .handle-container{will-change:auto}}}.divider{position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.divider:after{content:\\\" \\\";display:block;height:100%;border-left-width:var(--divider-width);border-left-style:solid;border-left-color:var(--divider-color);box-shadow:var(--divider-shadow)}.handle{position:absolute;top:var(--handle-position-start);pointer-events:none;box-sizing:border-box;margin-left:1px;transform:translate(calc(-50% - 0.5px), -50%);line-height:0}.default-handle{width:var(--default-handle-width);opacity:var(--default-handle-opacity);transition:all 1s;filter:drop-shadow(var(--default-handle-shadow))}.default-handle path{stroke:var(--default-handle-color)}.vertical .first-overlay-container{clip-path:inset(0 0 var(--exposure) 0)}.vertical .handle-container{transform:translateY(50%);height:auto;top:unset;bottom:var(--exposure);width:100%;left:0;flex-direction:row}.vertical .divider:after{height:1px;width:100%;border-top-width:var(--divider-width);border-top-style:solid;border-top-color:var(--divider-color);border-left:0}.vertical .handle{top:auto;left:var(--handle-position-start);transform:translate(calc(-50% - 0.5px), -50%) rotate(90deg)}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.vertical.first{transform:translateY(calc(var(--exposure) * -1))}.vertical .first-overlay-container{transform:translateY(var(--exposure));clip-path:none}.vertical .handle-container{bottom:0}}}\", \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\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\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// Module\nvar code = \"
\";\n// Exports\nexport default code;","export const TABINDEX = 0;\nexport const RENDERED_CLASS = 'rendered';\n","import styles from './styles.scss';\nimport { inBetween } from './inBetween';\nimport templateHtml from './template.html';\nimport { TABINDEX, RENDERED_CLASS } from './defaults';\nconst templateElement = document.createElement('template');\ntemplateElement.innerHTML = templateHtml;\nconst KeySlideOffset = {\n ArrowLeft: -1,\n ArrowRight: 1,\n};\nconst slideDirections = ['horizontal', 'vertical'];\nconst getTouchPagePoint = (e) => ({\n x: e.touches[0].pageX,\n y: e.touches[0].pageY,\n});\nconst getMousePagePoint = (e) => ({\n x: e.pageX,\n y: e.pageY,\n});\nconst slideAnimationPeriod = 1000 / 60;\nexport class HTMLImgComparisonSliderElement extends HTMLElement {\n constructor() {\n super();\n this.exposure = this.hasAttribute('value')\n ? parseFloat(this.getAttribute('value'))\n : 50;\n this.slideOnHover = false;\n this.slideDirection = 'horizontal';\n this.keyboard = 'enabled';\n this.isMouseDown = false;\n this.animationDirection = 0;\n this.isFocused = false;\n this.onMouseMove = (e) => {\n if (this.isMouseDown || this.slideOnHover) {\n const currentPoint = getMousePagePoint(e);\n this.slideToPage(currentPoint);\n }\n };\n this.bodyUserSelectStyle = '';\n this.onMouseDown = (e) => {\n if (this.slideOnHover) {\n return;\n }\n window.addEventListener('mousemove', this.onMouseMove);\n window.addEventListener('mouseup', this.onWindowMouseUp);\n this.isMouseDown = true;\n this.enableTransition();\n const currentPoint = getMousePagePoint(e);\n this.slideToPage(currentPoint);\n this.focus();\n this.bodyUserSelectStyle = window.document.body.style.userSelect;\n window.document.body.style.userSelect = 'none';\n };\n this.onWindowMouseUp = () => {\n this.isMouseDown = false;\n window.document.body.style.userSelect = this.bodyUserSelectStyle;\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.onWindowMouseUp);\n };\n this.isTouchComparing = false;\n this.hasTouchMoved = false;\n this.onTouchStart = (e) => {\n this.touchStartPoint = getTouchPagePoint(e);\n if (this.isFocused) {\n this.enableTransition();\n this.slideToPage(this.touchStartPoint);\n }\n };\n this.onTouchMove = (e) => {\n const currentPoint = getTouchPagePoint(e);\n if (this.isTouchComparing) {\n this.slideToPage(currentPoint);\n e.preventDefault();\n return false;\n }\n if (!this.hasTouchMoved) {\n const offsetY = Math.abs(currentPoint.y - this.touchStartPoint.y);\n const offsetX = Math.abs(currentPoint.x - this.touchStartPoint.x);\n if ((this.slideDirection === 'horizontal' && offsetY < offsetX) ||\n (this.slideDirection === 'vertical' && offsetY > offsetX)) {\n this.isTouchComparing = true;\n this.focus();\n this.slideToPage(currentPoint);\n e.preventDefault();\n return false;\n }\n this.hasTouchMoved = true;\n }\n };\n this.onTouchEnd = () => {\n this.isTouchComparing = false;\n this.hasTouchMoved = false;\n };\n this.onBlur = () => {\n this.stopSlideAnimation();\n this.isFocused = false;\n this.firstElement.classList.remove('focused');\n };\n this.onFocus = () => {\n this.isFocused = true;\n this.firstElement.classList.add('focused');\n };\n this.onKeyDown = (e) => {\n if (this.keyboard === 'disabled') {\n return;\n }\n const direction = KeySlideOffset[e.key];\n if (this.animationDirection === direction) {\n return;\n }\n if (direction === undefined) {\n return;\n }\n this.animationDirection = direction;\n this.startSlideAnimation();\n };\n this.onKeyUp = (e) => {\n if (this.keyboard === 'disabled') {\n return;\n }\n const direction = KeySlideOffset[e.key];\n if (direction === undefined) {\n return;\n }\n if (this.animationDirection !== direction) {\n return;\n }\n this.stopSlideAnimation();\n };\n this.resetDimensions = () => {\n this.imageWidth = this.offsetWidth;\n this.imageHeight = this.offsetHeight;\n };\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const styleEl = document.createElement('style');\n styleEl.innerHTML = styles;\n if (this.getAttribute('nonce')) {\n styleEl.setAttribute('nonce', this.getAttribute('nonce'));\n }\n shadowRoot.appendChild(styleEl);\n shadowRoot.appendChild(templateElement.content.cloneNode(true));\n this.firstElement = shadowRoot.getElementById('first');\n this.secondElement = shadowRoot.getElementById('second');\n }\n get value() {\n return this.exposure;\n }\n set value(newValue) {\n const newExposure = parseFloat(newValue);\n if (newExposure === this.exposure) {\n return;\n }\n this.exposure = newExposure;\n this.enableTransition();\n this.setExposure();\n }\n get hover() {\n return this.slideOnHover;\n }\n set hover(newValue) {\n this.slideOnHover = newValue.toString().toLowerCase() !== 'false';\n this.removeEventListener('mousemove', this.onMouseMove);\n if (this.slideOnHover) {\n this.addEventListener('mousemove', this.onMouseMove);\n }\n }\n get direction() {\n return this.slideDirection;\n }\n set direction(newValue) {\n this.slideDirection = newValue.toString().toLowerCase();\n this.slide(0);\n this.firstElement.classList.remove(...slideDirections);\n if (!slideDirections.includes(this.slideDirection)) {\n return;\n }\n this.firstElement.classList.add(this.slideDirection);\n }\n static get observedAttributes() {\n return ['hover', 'direction'];\n }\n connectedCallback() {\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = TABINDEX;\n }\n this.addEventListener('dragstart', (e) => {\n e.preventDefault();\n return false;\n });\n const resizeObserver = new ResizeObserver(this.resetDimensions);\n resizeObserver.observe(this);\n this.setExposure(0);\n this.keyboard =\n this.hasAttribute('keyboard') &&\n this.getAttribute('keyboard') === 'disabled'\n ? 'disabled'\n : 'enabled';\n this.addEventListener('keydown', this.onKeyDown);\n this.addEventListener('keyup', this.onKeyUp);\n this.addEventListener('focus', this.onFocus);\n this.addEventListener('blur', this.onBlur);\n this.addEventListener('touchstart', this.onTouchStart, {\n passive: true,\n });\n this.addEventListener('touchmove', this.onTouchMove, {\n passive: false,\n });\n this.addEventListener('touchend', this.onTouchEnd);\n this.addEventListener('mousedown', this.onMouseDown);\n this.hover = this.hasAttribute('hover')\n ? this.getAttribute('hover')\n : false;\n this.direction = this.hasAttribute('direction')\n ? this.getAttribute('direction')\n : 'horizontal';\n this.resetDimensions();\n if (!this.classList.contains(RENDERED_CLASS)) {\n this.classList.add(RENDERED_CLASS);\n }\n if (this.querySelectorAll('[slot=\"before\"], [slot=\"after\"]').length > 0) {\n console.warn(': ' +\n 'slot names \"before\" and \"after\" are deprecated and soon won\\'t be supported. ' +\n 'Please use slot=\"first\" instead of slot=\"after\", and slot=\"second\" instead of slot=\"before\".');\n }\n }\n disconnectedCallback() {\n if (this.transitionTimer) {\n window.clearTimeout(this.transitionTimer);\n }\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'hover') {\n this.hover = newValue;\n }\n if (name === 'direction') {\n this.direction = newValue;\n }\n if (name === 'keyboard') {\n this.keyboard = newValue === 'disabled' ? 'disabled' : 'enabled';\n }\n }\n setExposure(increment = 0) {\n this.exposure = inBetween(this.exposure + increment, 0, 100);\n this.firstElement.style.setProperty('--exposure', `${100 - this.exposure}%`);\n }\n slide(increment = 0) {\n this.setExposure(increment);\n const event = new Event('slide');\n this.dispatchEvent(event);\n }\n slideToPage(currentPoint) {\n if (this.slideDirection === 'horizontal') {\n this.slideToPageX(currentPoint.x);\n }\n if (this.slideDirection === 'vertical') {\n this.slideToPageY(currentPoint.y);\n }\n }\n slideToPageX(pageX) {\n const x = pageX - this.getBoundingClientRect().left - window.scrollX;\n this.exposure = (x / this.imageWidth) * 100;\n this.slide(0);\n }\n slideToPageY(pageY) {\n const y = pageY - this.getBoundingClientRect().top - window.scrollY;\n this.exposure = (y / this.imageHeight) * 100;\n this.slide(0);\n }\n enableTransition() {\n const transitionTime = 100;\n this.firstElement.style.setProperty('--transition-time', `${transitionTime}ms`);\n this.transitionTimer = window.setTimeout(() => {\n this.firstElement.style.setProperty('--transition-time', `var(--default-transition-time)`);\n this.transitionTimer = null;\n }, transitionTime);\n }\n startSlideAnimation() {\n let lastTimestamp = null;\n let initialDirection = this.animationDirection;\n this.firstElement.style.setProperty('--transition-time', `var(--keyboard-transition-time)`);\n const slide = (now) => {\n if (this.animationDirection === 0 ||\n initialDirection !== this.animationDirection) {\n return;\n }\n if (lastTimestamp === null) {\n lastTimestamp = now;\n }\n const interval = now - lastTimestamp, distance = (interval / slideAnimationPeriod) * this.animationDirection;\n this.slide(distance);\n // This is necessary to speed up the key up event in Desktop Safari\n setTimeout(() => window.requestAnimationFrame(slide), 0);\n lastTimestamp = now;\n };\n window.requestAnimationFrame(slide);\n }\n stopSlideAnimation() {\n this.animationDirection = 0;\n this.firstElement.style.setProperty('--transition-time', `var(--default-transition-time)`);\n }\n}\nif (typeof window !== 'undefined') {\n window.customElements.define('img-comparison-slider', HTMLImgComparisonSliderElement);\n}\n","export const inBetween = (actual, min, max) => {\n if (actual < min) {\n return min;\n }\n if (actual > max) {\n return max;\n }\n return actual;\n};\n"],"names":["___CSS_LOADER_EXPORT___","i","push","module","id","exports","cssWithMappingToString","list","toString","this","map","item","content","concat","join","modules","mediaQuery","dedupe","alreadyImportedModules","length","_i","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","RENDERED_CLASS","templateElement","document","createElement","innerHTML","KeySlideOffset","ArrowLeft","ArrowRight","slideDirections","getTouchPagePoint","e","x","touches","pageX","y","pageY","getMousePagePoint","HTMLImgComparisonSliderElement","HTMLElement","constructor","super","exposure","hasAttribute","parseFloat","getAttribute","slideOnHover","slideDirection","keyboard","isMouseDown","animationDirection","isFocused","onMouseMove","currentPoint","slideToPage","bodyUserSelectStyle","onMouseDown","window","addEventListener","onWindowMouseUp","enableTransition","focus","body","style","userSelect","removeEventListener","isTouchComparing","hasTouchMoved","onTouchStart","touchStartPoint","onTouchMove","preventDefault","offsetY","Math","abs","offsetX","onTouchEnd","onBlur","stopSlideAnimation","firstElement","classList","remove","onFocus","add","onKeyDown","direction","startSlideAnimation","onKeyUp","resetDimensions","imageWidth","offsetWidth","imageHeight","offsetHeight","shadowRoot","attachShadow","mode","styleEl","styles","setAttribute","appendChild","cloneNode","getElementById","secondElement","value","newValue","newExposure","setExposure","hover","toLowerCase","slide","includes","observedAttributes","connectedCallback","tabIndex","ResizeObserver","observe","passive","contains","querySelectorAll","console","warn","disconnectedCallback","transitionTimer","clearTimeout","attributeChangedCallback","name","oldValue","increment","actual","setProperty","event","Event","dispatchEvent","slideToPageX","slideToPageY","getBoundingClientRect","left","scrollX","top","scrollY","setTimeout","lastTimestamp","initialDirection","now","distance","requestAnimationFrame","customElements","define"],"sourceRoot":""}