{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/plugin_frontend_core/cartridge/client/default/js/utils/utils_cw.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product-detail/photoswipe.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product-detail/components/photoswipe-base.js","webpack:///./cartridges/app_storefront_base/cartridge/client/default/js/product/base.js","webpack:///./node_modules/photoswipe/dist/photoswipe.js","webpack:///./node_modules/photoswipe/dist/photoswipe-ui-default.js","webpack:///./cartridges/plugin_frontend_core/cartridge/client/default/js/constants.js","webpack:///./cartridges/app_clockwork_orange/cartridge/client/default/js/pages/product-detail.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product-detail/product-detail.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product-detail/product-images.js","webpack:///./cartridges/plugin_frontend_components/cartridge/client/default/js/components/scroll-to.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product/badge.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product-detail/components/out-of-stock.js","webpack:///./cartridges/plugin_catalog/cartridge/client/default/js/product-detail/components/store-availability.js","webpack:///./cartridges/plugin_wishlists/cartridge/client/default/js/product/wishlist.js","webpack:///./cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./cartridges/plugin_frontend_core/cartridge/client/default/scss/_exports.scss?d09d","webpack:///./cartridges/plugin_frontend_core/cartridge/client/default/scss/_exports.scss","webpack:///./node_modules/css-loader/lib/css-base.js","webpack:///./node_modules/style-loader/lib/addStyles.js","webpack:///./node_modules/style-loader/lib/urls.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","CONST","require","appendParamToURL","oldUrl","queryStart","indexOf","length","encodeURIComponent","debounce","func","wait","immediate","timeout","context","this","args","arguments","callNow","later","apply","clearTimeout","setTimeout","doubleTapElement","element","window","lastTap","exists","input","getGeoLocation","callback","navigator","geolocation","getCurrentPosition","geoLocation","getWindowHeight","outerHeight","innerHeight","document","documentElement","clientHeight","isKeyInObject","isLargeScreen","$","outerWidth","isMediumScreen","isSmallScreen","isTouch","msMaxTouchPoints","loadJsonP","config","ref","getElementsByTagName","script","createElement","callbackScriptName","randomString","onSuccess","src","url","callBackFormat","parentNode","insertBefore","onload","remove","onError","onerror","rerenderElement","orgStyling","eq","css","scrollToElement","conf","rect","getBoundingClientRect","win","ownerDocument","defaultView","top","pageYOffset","duration","speed","offset","animate","scrollTop","updateComponentConfig","elementConfig","rawElementConfig","getAttribute","JSON","parse","e","extend","insertParam","history","pushState","newurl","updateQueryParams","location","href","path","removeURLParameter","isMediaBreakpoint","breakpointKey","isUp","undefined","breakpoints","Error","concat","breakpointValue","replaceSpaceWithPeriod","slickPreventBeyondEdge","$carousel","preventBeyondEdge","slick","slickObj","options","variableWidth","$slickTrack","find","selectors","track","$nextButton","nextButton","$allSlides","slide","$lastSlide","timeoutTime","trackPosition","position","left","lastSlideWidth","width","containerWidth","listWidth","attr","attributes","disabled","addClass","classes","removeClass","on","beforeChange","event","obj","len","str","Math","random","toString","slice","parameter","urlparts","split","newUrl","prefix","pars","lenPars","lastIndexOf","splice","join","string","replace","photoSwipe","init","ready","initPhotoSwipeFromDOM","PhotoSwipe","PhotoSwipeUIDefault","gallerySelector","onThumbnailsClick","preventDefault","returnValue","clickedListItem","closest","el","fn","target","srcElement","tagName","toUpperCase","index","clickedGallery","childNodes","numChildNodes","nodeIndex","nodeType","openPhotoSwipe","galleryElement","disableAnimation","fromURL","trigger","gallery","items","pswpElement","querySelectorAll","figureEl","linkEl","size","item","thumbElements","numNodes","className","children","w","parseInt","h","title","innerHTML","msrc","push","parseThumbnailElements","galleryUID","getThumbBoundsFn","thumbnail","pageYScroll","x","y","galleryPIDs","j","pid","isNaN","showAnimationDuration","listen","slickIndex","currItem","dataset","productImages","storeImages","img","querySelector","getComputedStyle","objectFit","naturalHeight","naturalWidth","style","height","MutationObserver","observer","mutations","mi","attributeName","observe","disconnect","touchPosStart","ptspOpen","$maiImagesSlider","touches","sqrt","pageX","pageY","$slider","activeSlideIndex","galleryElements","setAttribute","onclick","hashData","hash","substring","params","vars","pair","gid","photoswipeParseHash","getPidValue","$el","$atcButton","text","getQuantitySelector","getQuantitySelected","val","handleVariantResponse","response","$productContainer","isVaraint","isChoiceOfBonusProducts","parents","product","variationAttributes","attrs","attrsWithSwatches","forEach","id","values","attrValue","$attrValue","$swatchAnchor","parent","selected","removeAttr","selectable","processSwatchValues","$attr","resetUrl","processNonSwatchValues","updateAttrs","productType","data","readyToOrder","images","large","imageUrl","idx","replaceWith","price","html","empty","promotions","promotion","details","calloutMsg","getPromotionsHtml","availabilityValue","availabilityMessages","availability","messages","message","resources","info_selectforstock","updateAvailability","attributeGroup","ID","attribute","label","getAttributesHtml","attributeSelect","selectedValueUrl","container","ajax","method","success","option","$optionEl","updateOptions","quantities","optionsHtml","map","quantity","updateQuantities","spinner","stop","error","complete","parseHtml","$html","append","parseHTML","body","footer","chooseBonusProducts","bonusUrl","start","bonusChoiceRuleBased","showProductsUrlRuleBased","showProductsUrlListBased","htmlString","maxBonusItems","uuid","pliUUID","addToCartUrl","pageSize","labels","selectprods","dataType","parsedHtml","modal","getOptions","$elOption","urlValue","selectedValueId","optionId","toArray","stringify","methods","editBonusProducts","colorAttribute","off","currentTarget","selectAttribute","addToCart","pidsObj","setPids","isReady","each","$productAttribute","hasAttributeItems","noSelectedAttribute","$productAttributesContainer","$productAttributeMessage","hasClass","qty","TypeError","_readOnlyError","childProducts","form","messageType","newBonusDiscountLineItem","keys","handlePostCartAdd","selectBonusProduct","$choiceOfBonusProduct","maxPids","submittedQty","totalQty","optionID","valueId","selectedBonusProductHtml","removeBonusProduct","$selected","count","enableBonusProductSelection","available","showMoreBonusProducts","addBonusProductsToCart","$readyToOrderBonusProducts","queryString","pidsObject","bonusProducts","qtyOption","productId","errorMessage","msgSuccess","reload","define","template","UiClass","framework","features","type","listener","unbind","methodName","isArray","Array","createEl","tag","getScrollY","yOffset","reg","RegExp","test","getChildByClass","parentEl","childClassName","node","firstChild","nextSibling","arraySearch","array","o1","o2","preventOverwrite","prop","easing","sine","out","k","sin","PI","inOut","cos","cubic","detectFeatures","helperStyle","vendor","oldIE","all","addEventListener","touch","requestAnimationFrame","raf","caf","cancelAnimationFrame","pointerEvent","pointerEnabled","msPointerEnabled","ua","userAgent","platform","v","appVersion","match","isOldIOSPhone","androidversion","parseFloat","isOldAndroid","androidVersion","isMobileOpera","styleCheckItem","styleName","styleChecks","vendors","a","charAt","toLowerCase","lastTime","currTime","Date","getTime","timeToCall","max","svg","createElementNS","createSVGRect","evName","_handleEv","handleEvent","_typeof","self","_options","allowPanToNext","spacing","bgOpacity","mouseUsed","loop","pinchToClose","closeOnScroll","closeOnVerticalDrag","verticalDragRange","hideAnimationDuration","showHideOpacity","focus","escKey","arrowKeys","mainScrollEndFriction","panEndFriction","isClickableElement","getDoubleTapZoom","isMouseClick","initialZoomLevel","maxSpreadZoom","scaleMode","_isOpen","_isDestroying","_closedByScroll","_currentItemIndex","_containerStyle","_containerShiftIndex","_upMoveEvents","_downEvents","_globalEventHandlers","_currZoomLevel","_startZoomLevel","_translatePrefix","_translateSufix","_updateSizeInterval","_itemsNeedUpdate","_itemHolders","_prevItemIndex","_dragStartEvent","_dragMoveEvent","_dragEndEvent","_dragCancelEvent","_transformKey","_pointerEventEnabled","_likelyTouchDevice","_requestAF","_cancelAF","_initalClassName","_initalWindowScrollY","_oldIE","_currentWindowScrollY","_features","_orientationChangeTimeout","_gestureStartTime","_gestureCheckSpeedTime","_releaseAnimData","_isZoomingIn","_verticalDragInitiated","_oldAndroidTouchEndTimeout","_isDragging","_isMultitouch","_zoomStarted","_moved","_dragAnimFrame","_mainScrollShifted","_currentPoints","_isZooming","_startPointsDistance","_currPanBounds","_currZoomElementStyle","_mainScrollAnimating","_direction","_isFirstMove","_opacityChanged","_bgOpacity","_wasOverInitialZoom","_tempCounter","_currPanDist","_startPanOffset","_panOffset","_viewportSize","_currPositionIndex","_offset","_slideSize","_indexDiff","_isFixedPosition","_modules","_windowVisibleSize","_renderMaxResolution","_registerModule","publicMethods","_getLoopedId","numSlides","_getNumItems","_listeners","_listen","_shout","listeners","shift","_getCurrentTime","_applyBgOpacity","opacity","bg","_applyZoomTransform","styleObj","zoom","fitRatio","_applyCurrentZoomPan","allowRenderResolution","_setImageSize","_applyZoomPanToItem","initialPosition","_setTranslateX","elStyle","_moveMainScroll","dragging","newSlideIndexOffset","delta","round","_mainScrollPos","_calculatePanOffset","axis","zoomLevel","_midZoomPoint","_equalizePoints","p1","p2","_roundPoint","_mouseMoveTimeout","_onFirstMouseMove","_calculatePanBounds","update","bounds","_calculateItemSize","_getMinZoomLevel","_getMaxZoomLevel","_modifyDestPanOffset","destPanBounds","destPanOffset","destZoomLevel","min","_onKeyDown","keydownAction","keyCode","ctrlKey","altKey","shiftKey","metaKey","_onGlobalClick","stopPropagation","_updatePageScrollOffset","setScrollOffset","_animations","_numAnimations","_stopAnimation","_registerStartAnimation","_stopAllAnimations","_animateProp","b","endProp","easingFn","onUpdate","onComplete","startAnimTime","animloop","shout","viewportSize","isMainScrollAnimating","getZoomLevel","getCurrentIndex","isDragging","isZooming","applyZoomPan","panX","panY","transform","scrollWrap","itemHolders","wrap","display","allow3dTransform","perspective","zoomRatio","_setupTransforms","resize","updateSize","orientationchange","clientWidth","scroll","keydown","click","oldPhone","animationName","ui","_getItemAt","rootClasses","mainClass","setContent","updateCurrItem","setInterval","close","_showOrHide","destroy","_showOrHideTimeout","clearInterval","_stopDragUpdateLoop","panTo","force","goTo","diff","next","prev","updateCurrZoomItem","emulateSetContent","zoomElement","center","invalidateCurrItems","needsUpdate","beforeAnimation","tempHolder","diffAbs","abs","NUM_HOLDERS","pop","unshift","prevItem","windowScrollY","innerWidth","holder","hIndex","cleanSlide","zoomTo","centerPoint","updateFn","initialPanOffset","now","_currPoint","_startPoint","_currPointers","_startMainScrollPos","_posPoints","_tempPoint","_currZoomedItemIndex","_centerPoint","_lastReleaseTime","_currCenterPoint","_calculatePointsDistance","_dragUpdateLoop","_renderMovement","_closestElement","_preventObj","_preventDefaultEventBehaviour","isDown","prevent","_convertTouchToPoint","identifier","_findCenterOfPoints","pCenter","_calculateVerticalDragOpacityRatio","_ePoint1","_ePoint2","_tempPointsArr","_getTouchPoints","_panOrMoveMainScroll","panFriction","startOverDiff","newPanPos","newMainScrollPos","newOffset","dir","newMainScrollPosition","mainScrollDiff","_onDragStart","button","_initialZoomRunning","pointerIndex","pointerId","startPointsList","numPoints","_onDragMove","touchesList","_isEqualPoints","pointsDistance","_calculateZoomLevel","zoomFriction","minZoomLevel","maxZoomLevel","percent","opacityRatio","time","_pushPosPoint","_onDragRelease","releasePoint","pointerType","4","2","3","gestureType","touchList","changedTouches","releaseTimeDiff","_initDragReleaseAnimationData","calculateSwipeSpeed","initalPanY","initialBgOpacity","_finishSwipeMainScrollGesture","_completePanGesture","_completeZoomGesture","lastFlickDuration","tempReleasePos","lastFlickOffset","lastFlickDist","lastFlickSpeed","slowDownRatio","slowDownRatioReverse","speedDecelerationRatio","speedDecelerationRatioAbs","distanceOffset","backAnimDestination","backAnimStarted","calculateOverBoundsAnimOffset","pos","calculateAnimOffset","timeDiff","panAnimLoop","zoomPan","lastNow","animData","itemChanged","itemsDiff","nextCircle","totalShiftDist","isFastLastFlick","finishAnimDuration","animateToX","animateToDist","touchesDistance","initialOpacity","initGestures","addEventNames","pref","down","move","up","cancel","maxTouchPoints","likelyTouchDevice","mousedown","mousemove","mouseup","_items","_initialContentSet","completeFn","thumbBounds","initialLayout","closeWithRaf","fadeEverything","removeAttribute","loadError","miniImg","webkitBackfaceVisibility","initalBgOpacity","_tempPanAreaSize","_imagesToAppendPool","_controllerDefaultOptions","errorMsg","forceProgressiveLoading","preload","getNumItemsFn","isInitial","vGap","bottom","hRatio","vRatio","realPanElementW","realPanElementH","_calculateSingleItemPanBounds","_appendImage","baseDiv","preventAnimation","keepPlaceholder","imageAppended","appendChild","loaded","placeholder","_preloadImage","loading","loadComplete","_checkForError","cleanUp","maxRes","lastChild","_appendImagesPool","poolItem","clearPlaceholder","lazyLoadItem","initController","getItemAt","isNext","preloadBefore","preloadAfter","preloader","allowProgressiveImg","screen","placeholderClassName","tapTimer","_wheelDelta","tapReleasePoint","_dispatchTapEvent","origEvent","createEvent","eDetail","initCustomEvent","dispatchEvent","initTap","onTapStart","onTapRelease","touch0","touch1","p0","initDesktopZoom","setupDesktopZoom","onInit","events","handleMouseWheel","mouseZoomedIn","hasDraggingClass","updateZoomable","removeDraggingClass","deltaY","deltaMode","deltaX","wheelDeltaX","wheelDeltaY","wheelDelta","detail","newPanX","newPanY","toggleDesktopZoom","doubleTapZoomLevel","zoomOut","_historyUpdateTimeout","_hashChangeTimeout","_hashAnimCheckTimeout","_hashChangedByScript","_hashChangedByHistory","_hashReseted","_initialHash","_historyChanged","_closedFromURL","_urlChangedOnce","_windowLoc","_supportsPushState","_historyDefaultOptions","_getHash","_cleanHistoryTimeouts","_parseItemIndexFromURL","searchfor","_updateHash","newHash","newURL","initHistory","updateURL","onHashChange","returnToOriginal","back","pathname","search","pswp","_fullscrenAPI","_controls","_captionContainer","_fakeCaptionContainer","_indexIndicator","_shareButton","_shareModal","_initalCloseOnScrollValue","_isIdle","_loadingIndicator","_loadingIndicatorHidden","_loadingIndicatorTimeout","_galleryHasOneSlide","_blockControlsTap","_idleInterval","_idleTimer","_overlayUIUpdated","_controlsVisible","_shareModalHidden","_defaultUIOptions","barsSize","closeElClasses","timeToIdle","timeToIdleOutside","loadingIndicatorDelay","addCaptionHTMLFn","captionEl","closeEl","fullscreenEl","zoomEl","shareEl","counterEl","arrowEl","preloaderEl","tapToClose","tapToToggleControls","clickToCloseNonZoomable","shareButtons","download","getImageURLForShare","getPageURLForShare","getTextForShare","indexIndicatorSep","fitControlsWidth","_onControlsTap","_onIdleMouseMove","uiElement","found","clickedClass","_uiElements","onTap","tapDelay","_togglePswpClass","cName","add","_countNumItems","hasOneSlide","_toggleShareModalClass","_toggleShareModal","_updateShareURLs","_openWindowPopup","hasAttribute","open","shareButtonData","image_url","page_url","share_text","shareButtonOut","parseShareButtonOut","_hasCloseClass","_idleIncrement","setIdle","_onMouseLeaveWindow","from","relatedTarget","toElement","nodeName","_toggleLoadingIndicator","hide","_applyNavBarGaps","gap","bars","captionSize","isFullscreen","exit","enter","pinchControlsHidden","hideControls","showControls","point","preventObj","onGlobalTap","onMouseOver","eventK","updateFullscreen","removeChild","classAttr","loopThroughChildElements","sChildren","topBar","_setupUIElements","getFullscreenAPI","isIdle","updateIndexIndicator","supportsFullscreen","exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen","api","dE","tF","requestFullscreen","enterK","exitK","elementK","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen","Element","ALLOW_KEYBOARD_INPUT","sharedVariables","buffer","times","scrollToAnimation","cssTransitionTime","heartTransitionTime","xs","breakpoint_xs","sm","breakpoint_sm","md","breakpoint_md","lg","breakpoint_lg","xl","breakpoint_xl","pubSubEvents","hideNotification","mailChimpSuccess","showNotification","wishlist","clickAddToWishlist","addToWishlist","displayMessage","updateAmount","ajaxSuccess","beforeAddToCart","blur","bonusProductSelect","bsCollapseHidden","bsCollapseHide","bsCollapseShow","bsCollapseShown","bsModalHidden","bsModalHide","bsModalShow","bsModalShown","cart","change","focusin","focusout","idle","keypress","keyup","load","loginModalShown","minicartTriggerPopover","modalPanes","mouseenter","mouseleave","productAfterAddToCart","productAfterAttrValuesUpdate","productAfterAttributeSelect","productAfterRemoveFromCart","productAvailabilityUpdated","productBeforeAttributeSelect","productChangeQuantity","productStatusUpdate","productTileClick","productPromotionClick","productUpdateAddToCart","checkoutOption","promotionClick","searchFilter","searchSort","setShippingMethodSelection","show","showQuickview","unslick","submit","tilesLoaded","toggleMobileMenu","toggleModal","touchend","touchstart","transitionEnd","account","notAuthenticated","backdrop","column","checkbox","select","selectedOption","selectedRadio","textarea","disabledField","enabled","header","htmlBody","listItem","notTouch","activePane","pane","page","availabilityMsg","jsProductContainer","detailPage","productContainer","productID","productOption","productOptionSelected","content","tile","initialized","slider","currentSlide","notInitialized","unOrderedListItem","row","contentSearch","active","childExpanded","collapsed","dBlock","dInlineBlock","dNone","expanded","hover","invalid","modalOpen","errorState","isInWishlist","scrollLock","unselectable","action","actionUrl","addressId","alt","ariaExpanded","ariaPopUp","attributeValue","checked","class","color","dataToggle","dataUrl","storeID","outerHTML","pattern","productVariationID","valueID","slickConfig","srcset","dataTarget","textSelect","textSelected","translationResource","urlAdd","urlRemove","pipelines","cartShow","checkoutStep","states","isAnimating","cookies","queryParams","processInclude","onjQueryLoad","base","photoswipe","scrollTo","updateSizeLinks","$option","$equivalentSizeLink","handleSizeLink","classList","contains","$link","toggleClass","siblings","originalEvent","syncAllSizeSelectors","handleSizeDropdown","sizeLink","optionValue","$dropdown","onAddToCartClick","initSizeVariations","$doc","updateAttributesAndDetails","activeDetailsHeading","activeDetailsBody","attributesHtml","brand","shortDescription","longDescription","showSpinner","updateAttribute","productData","masterID","$extraDiscountBadge","hasSelectedAttribute","media","$mainImages","$thumbnails","hires","small","$variantContainer","$label","labelTextSelect","labelTextSelected","selectedValue","$shippingMessage","shippingMessage","$wishlistLink","updateAddToCart","allAvailable","every","allReady","sizeChart","adjustChatIconPosition","$addToCartStickyBar","$chatIcon","chatIconMarginBottomValue","mainImages","slidesToShow","slidesToScroll","rows","arrows","dots","fade","asNavFor","thumbnails","focusOnSelect","$container","animateScrollToElement","targetElement","scrollPosTarget","updateProductBadge","badge","addImageBadge","addStringBadge","evt","dataValues","$document","formSubmitHandler","$form","$feedback","$successScreen","serialize","successMessage","err","console","errorResource","setModalData","variationColor","$pboContainer","$pboLink","$pboModal","responseProduct","variationId","variationGroupID","attributeId","sizeValues","hasUnselectableVariant","vai","pvid","stockFormUrl","openOutOfStockErrorModal","selectedProductId","selectedProductSize","$pboSizeSelector","prependTo","sizes","$orgSelectOptions","trim","sort","$newoption","appendTo","getStoresList","userLocation","getStoresUrl","coords","latitude","longitude","storesArray","$storesList","storesHTML","store","city","address","isOpen","storeHoursMessage","productInStock","stockMessage","notInStockMessage","populateHtmlWithStores","stores","log","useLocation","geoData","searchPostalCode","$field","zipcode","postalCode","countryCode","geocoder","google","maps","Geocoder","componentRestrictions","country","Promise","resolve","reject","geocode","results","status","geometry","lat","lng","getLatlongFromPostalCode","zipCodeCountryCodeMapping","_getCountryCodeOfTheZipCode","then","result","catch","showModal","$productAttributes","onAttributeSelect","$modal","locationAnchor","postalCodeForm","searchTrigger","$self","addToWishlistData","origin","optionVal","pubSub","publish","iterator","constructor","include","locals","useSourceMap","list","cssMapping","btoa","sourceMapping","sourceMap","unescape","sourceURLs","sources","source","sourceRoot","cssWithMappingToString","mediaQuery","alreadyImportedModules","memo","stylesInDom","isOldIE","atob","getTarget","getElement","styleTarget","HTMLIFrameElement","contentDocument","head","singleton","singletonCounter","stylesInsertedAtTop","fixUrls","addStylesToDom","styles","domStyle","refs","parts","addStyle","listToStyles","newStyles","part","insertStyleElement","insertInto","lastStyleElementInsertedAtTop","insertAt","before","removeStyleElement","createStyleElement","addAttrs","styleIndex","applyToSingletonTag","URL","createObjectURL","revokeObjectURL","Blob","link","rel","createLinkElement","updateLink","applyToTag","newObj","DEBUG","newList","mayRemove","textStore","replaceText","replacement","filter","Boolean","styleSheet","cssText","cssNode","createTextNode","autoFixUrls","convertToAbsoluteUrls","blob","oldSrc","baseUrl","protocol","host","currentDir","fullMatch","origUrl","unquotedOrigUrl","$1"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,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AW,KAAOn4C,EAASo4C,KAC9CC,EAAaH,EAAUl4C,EAAS+2B,SAAS/yB,QAAQ,YAAa,KA2DnE,OA/Be5F,EAAI4F,QAAQ,uDAAuD,SAASs0C,EAAWC,GAErG,IAWI/0C,EAXAg1C,EAAkBD,EACpBnJ,OACAprC,QAAQ,YAAY,SAASxL,EAAGigD,GAAK,OAAOA,KAC5Cz0C,QAAQ,YAAY,SAASxL,EAAGigD,GAAK,OAAOA,KAG9C,MAAI,oDAAoDnjC,KAAKkjC,GACpDF,GAQR90C,EAFqC,IAAlCg1C,EAAgBp+C,QAAQ,MAElBo+C,EACkC,IAAjCA,EAAgBp+C,QAAQ,KAEzB89C,EAAUM,EAGVH,EAAaG,EAAgBx0C,QAAQ,QAAS,IAIjD,OAASzE,KAAK2R,UAAU1N,GAAU","file":"app_clockwork_orange/cartridge/static/default/js/pages/product-detail.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 354);\n","'use strict';\n\nconst CONST = require('../constants');\n\n/**\n * @namespace cwUtil\n * - keep functions in order as exported\n * - group functions by type of adjustments, e.g. device and screen size detection, ajax, typechecks.\n * - think similar setup as lodash.\n * - keep functions and exports in alphabetical order.\n */\n\n/* eslint-disable no-use-before-define */\nmodule.exports = {\n appendParamToURL,\n debounce,\n doubleTapElement,\n exists,\n getGeoLocation,\n getWindowHeight,\n isKeyInObject,\n isLargeScreen,\n isMediumScreen,\n isSmallScreen,\n isTouch,\n loadJsonP,\n randomString,\n rerenderElement,\n scrollToElement,\n updateComponentConfig,\n insertParam,\n removeURLParameter,\n updateQueryParams,\n isMediaBreakpoint,\n replaceSpaceWithPeriod,\n slickPreventBeyondEdge\n};\n/* eslint-enable */\n\n/**\n * Appends paramaters to a new url\n * @param {*} oldUrl string\n * @param {*} name value\n * @param {*} value value\n * @returns {string} new url\n */\nfunction appendParamToURL(oldUrl, name, value) {\n var queryStart = '?';\n if (oldUrl.indexOf(queryStart) !== -1 && oldUrl.indexOf(queryStart) !== oldUrl.length - 1) {\n queryStart = '&';\n }\n\n if (queryStart === '?' && oldUrl.indexOf(queryStart) !== -1) {\n queryStart = '';\n }\n\n return oldUrl + queryStart + name + '=' + encodeURIComponent(value);\n}\n\n/**\n * @LROS TODO: refactor during architecture sprint - https://clockworkjira.atlassian.net/browse/CWO-244\n * Debounce util\n * @memberof cwUtil\n * @param {Function} func callback to debounce\n * @param {*} wait in ms for settimeout\n * @param {boolean} immediate ovverride to call callback immediately\n * @returns {function} context to call callback in\n */\nfunction debounce(func, wait, immediate) {\n var timeout;\n\n return function () {\n var context = this,\n args = arguments,\n callNow = immediate && !timeout;\n\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}\n\n/**\n * @LROS TODO: refactor during architecture sprint - https://clockworkjira.atlassian.net/browse/CWO-244\n * Checks if device screen width is larger than md screen\n * @memberof cwUtil\n * @param {HtmlElement} element to check tap event against\n * @returns {boolean} yes if less than md constant\n */\nfunction doubleTapElement(element) {\n if (window.lastTap === element) {\n return true;\n }\n\n window.lastTap = element;\n return false;\n}\n\n/**\n* getGeoLocation - Gets the current GPS location of the user\n@param {function} callback - The function to call after getGeoLocation is done\n@returns {function} callback - The callback function in which the location is passed\n*/\nfunction getGeoLocation(callback) {\n navigator.geolocation.getCurrentPosition(function geoLocationCallback(geoLocation) {\n return callback(geoLocation);\n });\n}\n\n/**\n * @public exists\n * @param {*} input - The input to verify its existance\n * @returns {boolean} - Boolean value stating the existance of the input\n * @description\n * Verifies existance of a certain element by checking for type, null and length\n * Usage: use with either querySelector() or querySelectorAll()\n * querySelector will not have a 'length', e.g. this would return true if other conditions are true\n * querySelectorAll will have a 'length', e.g. this would return true if all conditions are true\n */\nfunction exists(input) {\n return typeof input !== 'undefined' && input !== null && ('length' in input ? input.length > 0 : true);\n}\n\n/**\n * @LROS TODO: refactor during architecture sprint - https://clockworkjira.atlassian.net/browse/CWO-244\n * @returns {number} browser window height\n */\nfunction getWindowHeight() {\n return window.outerHeight\n || window.innerHeight\n || document.documentElement.clientHeight;\n}\n\n/**\n* isKeyInObject\n*/\nconst isKeyInObject = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);\n\n/**\n * @deprecated in favor of using isMediaBreakpoint\n * @memberof cwUtil\n * @improvement: share screen size context with scss\n * @returns {boolean} yes if less than md constant\n */\nfunction isLargeScreen() {\n return $(window).outerWidth() >= 992;\n}\n/**\n * @memberof cwUtil\n * @param {string} breakpointKey from constants that should match css breakpoint\n * @param {boolean} [isUp] by default is true since mobile first, reverses condition\n * @return {boolean} whether window is larger than specified breakpoint\n */\nfunction isMediaBreakpoint(breakpointKey, isUp = true) {\n if (!isKeyInObject(CONST.breakpoints, breakpointKey)) {\n throw new Error(`cwUtil.isMediaBreakpoint: ${breakpointKey} -- does not exist in constants breakpoints object`);\n }\n\n const outerWidth = $(window).outerWidth();\n const breakpointValue = CONST.breakpoints[breakpointKey];\n return isUp ? (outerWidth > breakpointValue) : (outerWidth < (breakpointValue - 1));\n}\n\n/**\n * @deprecated in favor of using isMediaBreakpoint\n * @memberof cwUtil\n * @improvement: share screen size context with scss\n * @returns {boolean} yes if less than md constant\n */\nfunction isMediumScreen() {\n return $(window).outerWidth() < 992;\n}\n\n/**\n * Checks if device is small screen\n * @deprecated in favor of using isMediaBreakpoint\n * @memberof cwUtil\n * @improvement: share screen size context with scss\n * @returns {boolean} yes if less than sm constant\n */\nfunction isSmallScreen() {\n return $(window).outerWidth() < 520;\n}\n\n/**\n * Checks if browser context is a touch device\n * @memberof cwUtil\n * @returns {boolean} yes if is touch device\n */\nfunction isTouch() {\n return (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));\n}\n\n/**\n * @typedef {Object} loadJsonPConfig\n * @param {string} url to execute jsonp call against\n * @param {string} callBackFormat\n * @param {function} onError callback to handle error events\n * @param {function} onSuccess callback to handle success events\n */\n\n/**\n * Util for executing a jsonp call, for use with apis that have CORS issues or don't have ajax available\n * @memberof cwUtil\n * @param {loadJsonPConfig} config for jsonp execution\n * @returns {void}\n */\nfunction loadJsonP(config) {\n // Create script with url and callback (if specified)\n var ref = window.document.getElementsByTagName('script')[0];\n var script = window.document.createElement('script');\n var callbackScriptName = 'jsonp_' + randomString(10);\n\n window[callbackScriptName] = config.onSuccess;\n script.src = config.url + config.callBackFormat + callbackScriptName;\n\n // Insert script tag into the DOM (append to )\n ref.parentNode.insertBefore(script, ref);\n\n // After the script is loaded (and executed), remove it\n script.onload = function () {\n this.remove();\n };\n\n if (config && config.onError) {\n script.onerror = config.onError;\n }\n}\n\n/**\n * Generate a random string for jsonP callback function assignment\n * Helper for loadJsonP function\n * reference: https://github.com/larryosborn/JSONP/blob/master/src/jsonp.coffee\n * @private\n * @param {number} length of string to generate\n * @returns {string} random string for jsonp_callback\n */\nfunction randomString(length) {\n var len = length || 10;\n var str = '';\n\n while (str.length < len) {\n str += Math.random().toString(36).slice(2, 3);\n }\n\n return str;\n}\n\n/**\n* util to remove query params form a url\n* @param {string} url to remove param from\n* @param {string} parameter to remove\n* @returns {string} new url\n*/\nfunction removeURLParameter(url, parameter) {\n // prefer to use l.search if you have a location/link object\n var urlparts = url && url.split('?');\n var newUrl = url;\n if (urlparts && urlparts.length >= 2) {\n var prefix = encodeURIComponent(parameter) + '=';\n var pars = urlparts[1].split(/[&;]/g);\n\n // reverse iteration as may be destructive\n\n var lenPars = pars.length;\n for (var i = lenPars; i-- > 0;) {\n // idiom for string.startsWith\n if (pars[i].lastIndexOf(prefix, 0) !== -1) {\n pars.splice(i, 1);\n }\n }\n\n newUrl = urlparts[0] + (lenPars > 0 ? '?' + pars.join('&') : '');\n return newUrl;\n }\n\n return newUrl;\n}\n\n/**\n* replaceSpaceWithPeriod\n*/\nconst replaceSpaceWithPeriod = (string) => string.replace(/ /g, '.');\n\n/**\n * Util to rerender an element applying the same styles it had\n * @memberof cwUtil\n * @param {HTMLElement} element to rerender\n * @returns {void}\n */\nfunction rerenderElement(element) {\n var cssProperty = 'transform';\n var $element = $(element);\n var orgStyling = $element.eq(0).css(cssProperty);\n\n $(element).eq(0).css(cssProperty, 'rotateZ(0deg)');\n\n setTimeout(function () {\n $(element).eq(0).css(cssProperty, orgStyling);\n }, 10);\n}\n\n/**\n * @public scrollToElement\n * @param {HTMLElement} element - the element to scroll to\n * @param {Object} [config] - A configiguration Object\n * @param {number} [config.speed=300] - The scroll speed\n * @param {number} [config.offset=0] - an offset where to scroll to\n */\nfunction scrollToElement(element, config) {\n if (!element) {\n return;\n }\n var conf = config || {};\n var rect = element.getBoundingClientRect();\n var win = element.ownerDocument.defaultView;\n var top = rect.top + win.pageYOffset;\n\n var duration = conf.speed || 300;\n\n if (conf.offset) top -= conf.offset;\n\n $('html, body').animate({\n scrollTop: top\n }, duration);\n}\n\n/**\n * Retrieves data-component-config attribute from a node if it exists and updates the module configuration with it\n * @memberof cwUtil\n * @param {HtmlElement} element to retrieve configuration from\n * @param {Object} config to mutate and update\n * @returns {Object} updated config if applicable, default if not\n */\nfunction updateComponentConfig(element, config) {\n var configAttribute = 'data-component-settings';\n var rawElementConfig = element.getAttribute(configAttribute);\n var elementConfig;\n\n if (!rawElementConfig) {\n return config;\n }\n\n try {\n elementConfig = JSON.parse(rawElementConfig);\n } catch (e) {\n return config;\n }\n\n return $.extend(true, config, elementConfig);\n}\n/**\n * Removes query params from url and passes new ones\n * @param {string} url value\n * @param {string} key value\n * @param {*} value value\n * @returns {string} new url\n */\nfunction updateQueryParams(url, key, value) {\n var removedCurrentParamUrl = removeURLParameter(url, key);\n var newurl = appendParamToURL(removedCurrentParamUrl, key, value);\n\n return newurl;\n}\n\n/**\n * Push state supports ie10+ https://caniuse.com/#search=pushstate\n * will use graceful degradation here\n * @param {string} key to add as a param\n * @param {*} value to set the pareter to\n * @returns {void}\n */\nfunction insertParam(key, value) {\n if (history.pushState) {\n var currentUrl = window.location.href;\n // remove any param for the same key\n var newurl = updateQueryParams(currentUrl, key, value);\n window.history.pushState({ path: newurl }, '', newurl);\n }\n}\n\n/**\n* slickPreventBeyondEdge\n* This custom function will make sure that, if 'variableWidth' is true, it's not possible to\n* continue going right even when the last slide is already fully in view.\n* @param {JQuery|HTMLElement} $carousel - The slick carousel\n*/\nfunction slickPreventBeyondEdge($carousel) {\n function preventBeyondEdge(slick) {\n var slickObj = slick || $carousel[0].slick;\n\n // Stop if 'variableWidth' is not set to true and use slick's default UI\n if (!slickObj.options || !slickObj.options.variableWidth) {\n return;\n }\n\n const $slickTrack = $carousel.find(CONST.selectors.slick.track);\n const $nextButton = $carousel.find(CONST.selectors.slick.nextButton);\n const $allSlides = $carousel.find(CONST.selectors.slick.slide);\n if (!$allSlides && $allSlides.length === 0) {\n return;\n }\n const $lastSlide = $allSlides.eq($allSlides.length - 1);\n\n // Wait for slick animation to be done before doing calculations\n const timeoutTime = slick && slickObj.options ? slickObj.options.speed : 0;\n\n setTimeout(() => {\n const trackPosition = $slickTrack.position().left;\n const lastSlideWidth = $lastSlide.width();\n const containerWidth = slickObj.listWidth;\n\n // $lastSlide.position().left returns a static position because it's relative to .slick-track.\n // This is why we add the position of .slick-track to determine the position of the last slide\n // relative to the slick-carousel.\n const lastSlideVisualPosition = $lastSlide.position().left + trackPosition;\n const lastSlideFullyInView = (lastSlideVisualPosition + lastSlideWidth) < containerWidth;\n\n if (lastSlideFullyInView) {\n $nextButton.attr(CONST.attributes.disabled, true).addClass(CONST.classes.slick.disabled);\n } else {\n $nextButton.attr(CONST.attributes.disabled, false).removeClass(CONST.classes.slick.disabled);\n }\n }, timeoutTime);\n }\n\n $carousel.on({\n beforeChange: (event, slick) => {\n preventBeyondEdge(slick);\n }\n });\n\n preventBeyondEdge(false);\n}\n","'use strict';\n\nconst photoSwipe = require('./components/photoswipe-base');\n\nconst selectors = {\n productCarouselMain: '.js-product-images-main',\n storeImageCarouselMain: '.js-store-images-main'\n};\n\n/**\n* Initializes the file\n*/\nfunction init() {\n $(document).ready(() => {\n photoSwipe.initPhotoSwipeFromDOM(selectors.productCarouselMain);\n photoSwipe.initPhotoSwipeFromDOM(selectors.storeImageCarouselMain);\n });\n}\n\nmodule.exports = {\n init: init\n};\n","'use strict';\n\nvar PhotoSwipe = require('photoswipe/dist/photoswipe.js');\nvar PhotoSwipeUIDefault = require('photoswipe/dist/photoswipe-ui-default.js');\n\nmodule.exports = {\n\tinitPhotoSwipeFromDOM: function (gallerySelector) {\n\t\t// parse slide data (url, title, size ...) from DOM elements \n\t\t// (children of gallerySelector)\n\t\tvar parseThumbnailElements = function (el) {\n\t\t\tvar thumbElements = el.childNodes,\n\t\t\t\tnumNodes = thumbElements.length,\n\t\t\t\titems = [],\n\t\t\t\tfigureEl,\n\t\t\t\tlinkEl,\n\t\t\t\tsize,\n\t\t\t\titem;\n\n\t\t\tfor (var i = 0; i < numNodes; i++) {\n\t\t\t\tfigureEl = thumbElements[i]; //
element\n\n\t\t\t\t// include only element nodes \n\t\t\t\tif (figureEl.nodeType !== 1) {\n\t\t\t\t\tcontinue; // eslint-disable-line\n\t\t\t\t}\n\n\t\t\t\tif (figureEl.className.indexOf('slick-cloned') > 0) {\n\t\t\t\t\tcontinue; // eslint-disable-line\n\t\t\t\t}\n\n\n\t\t\t\tlinkEl = figureEl.children[0]; // element\n\n\t\t\t\tsize = linkEl.getAttribute('data-size').split('x');\n\n\t\t\t\t// create slide object\n\t\t\t\titem = {\n\t\t\t\t\tsrc: linkEl.getAttribute('href'),\n\t\t\t\t\tw: parseInt(size[0], 10),\n\t\t\t\t\th: parseInt(size[1], 10)\n\t\t\t\t};\n\n\t\t\t\tif (figureEl.children.length > 1) {\n\t\t\t\t\t//
content\n\t\t\t\t\titem.title = figureEl.children[1].innerHTML;\n\t\t\t\t}\n\n\t\t\t\tif (linkEl.children.length > 0) {\n\t\t\t\t\t// thumbnail element, retrieving thumbnail url\n\t\t\t\t\titem.msrc = linkEl.children[0].getAttribute('src');\n\t\t\t\t}\n\n\t\t\t\titem.el = figureEl; // save link to element for getThumbBoundsFn\n\t\t\t\titems.push(item);\n\t\t\t}\n\n\t\t\treturn items;\n\t\t};\n\n\t\t// find nearest parent element\n\t\tvar closest = function closest(el, fn) {\n\t\t\treturn el && (fn(el) ? el : closest(el.parentNode, fn)); \n\t\t};\n\n\t\t// triggers when user clicks on thumbnail\n\t\tvar onThumbnailsClick = function (event) {\n\t\t\tvar e = event || window.event;\n\t\t\te.preventDefault ? e.preventDefault() : e.returnValue = false; // eslint-disable-line\n\t\t\tvar eTarget = e.target || e.srcElement;\n\n\t\t\t// find root element of slide\n\t\t\tvar clickedListItem = closest(eTarget, function (el) {\n\t\t\t\treturn (el.tagName && el.tagName.toUpperCase() === 'FIGURE');\n\t\t\t});\n\n\t\t\tif (!clickedListItem) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// find index of clicked item by looping through all child nodes\n\t\t\t// alternatively, you may define index via data- attribute\n\t\t\tvar clickedGallery = clickedListItem.parentNode,\n\t\t\t\tchildNodes = clickedListItem.parentNode.childNodes,\n\t\t\t\tnumChildNodes = childNodes.length,\n\t\t\t\tnodeIndex = 0,\n\t\t\t\tindex;\n\n\t\t\tfor (var i = 0; i < numChildNodes; i++) {\n\t\t\t\tif (childNodes[i].nodeType !== 1) {\n\t\t\t\t\tcontinue; // eslint-disable-line\n\t\t\t\t}\n\n\t\t\t\tif (childNodes[i] === clickedListItem) {\n\t\t\t\t\tindex = nodeIndex;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnodeIndex++;\n\t\t\t}\n\n\n\t\t\tif (index >= 0) {\n\t\t\t\t// open PhotoSwipe if valid index found\n\t\t\t\topenPhotoSwipe(index, clickedGallery); // eslint-disable-line\n\t\t\t}\n\t\t};\n\n\t\t// parse picture index and gallery index from URL (${'#'}&pid=1&gid=2)\n\t\tvar photoswipeParseHash = function () {\n\t\t\tvar hash = window.location.hash.substring(1),\n\t\t\t\tparams = {};\n\n\t\t\tif (hash.length < 5) {\n\t\t\t\treturn params;\n\t\t\t}\n\n\t\t\tvar vars = hash.split('&');\n\t\t\tfor (var i = 0; i < vars.length; i++) {\n\t\t\t\tif (!vars[i]) {\n\t\t\t\t\tcontinue; // eslint-disable-line\n\t\t\t\t}\n\t\t\t\tvar pair = vars[i].split('=');\n\t\t\t\tif (pair.length < 2) {\n\t\t\t\t\tcontinue; // eslint-disable-line\n\t\t\t\t}\n\t\t\t\tparams[pair[0]] = pair[1];\n\t\t\t}\n\n\t\t\tif (params.gid) {\n\t\t\t\tparams.gid = parseInt(params.gid, 10);\n\t\t\t}\n\n\t\t\treturn params;\n\t\t};\n\n\t\tvar openPhotoSwipe = function (i, galleryElement, disableAnimation, fromURL) {\n\t\t\t$('body').addClass('photoSwipeOpen');\n\t\t\t$('body').trigger('toggleScroll', 'lock');\n\t\t\tvar pswpElement = document.querySelectorAll('.pswp')[0],\n\t\t\t\tindex = i,\n\t\t\t\tgallery,\n\t\t\t\toptions,\n\t\t\t\titems;\n\t\t\titems = parseThumbnailElements(galleryElement);\n\t\t\tindex -= 1; \n\n\t\t\t// define options (if needed)\n\t\t\toptions = {\n\t\t\t\t// define gallery index (for URL)\n\t\t\t\tgalleryUID: galleryElement.getAttribute('data-pswp-uid'),\n\n\t\t\t\tgetThumbBoundsFn: function (index) { // eslint-disable-line\n\t\t\t\t\t// See Options -> getThumbBoundsFn section of documentation for more info\n\t\t\t\t\tvar thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail\n\t\t\t\t\t\tpageYScroll = window.pageYOffset || document.documentElement.scrollTop,\n\t\t\t\t\t\trect = thumbnail.getBoundingClientRect();\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx: rect.left,\n\t\t\t\t\t\ty: rect.top + pageYScroll,\n\t\t\t\t\t\tw: rect.width\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// PhotoSwipe opened from URL\n\t\t\tif (fromURL) {\n\t\t\t\tif (options.galleryPIDs) {\n\t\t\t\t\t// parse real index when custom PIDs are used \n\t\t\t\t\t// http://photoswipe.com/documentation/faq.html${'#'}custom-pid-in-url\n\t\t\t\t\tfor (var j = 0; j < items.length; j++) {\n\t\t\t\t\t\tif (items[j].pid === index) {\n\t\t\t\t\t\t\toptions.index = j;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// in URL indexes start from 1\n\t\t\t\t\toptions.index = parseInt(index, 10) - 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toptions.index = parseInt(index, 10);\n\t\t\t}\n\n\t\t\t// exit if index not found\n\t\t\tif (isNaN(options.index)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (disableAnimation) {\n\t\t\t\toptions.showAnimationDuration = 0;\n\t\t\t}\n\n\t\t\t// Pass data to PhotoSwipe and initialize it\n\t\t\tgallery = new PhotoSwipe(pswpElement, PhotoSwipeUIDefault, items, options);\n\t\t\tgallery.init();\n\n\t\t\tgallery.listen('close', function () {\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t$('body').removeClass('photoSwipeOpen');\n\t\t\t\t\t$('body').trigger('toggleScroll', 'unlock');\n\t\t\t\t}, 500); // Swipe close animation duration = 333\n\t\t\t});\n\n\t\t\tgallery.listen('afterChange', function () {\n\t\t\t\tvar curr = gallery.currItem;\n\t\t\t\tvar slickIndex = curr.el.dataset.slickIndex;\n\t\t\t\tvar productImages = $('.js-product-images-main');\n\t\t\t\tvar storeImages = $('.js-store-images-main');\n\n\t\t\t\tproductImages.slick('slickSetOption', 'waitForAnimate', false);\n\t\t\t\tproductImages.slick('slickGoTo', slickIndex);\n\t\t\t\tproductImages.slick('slickSetOption', 'waitForAnimate', true);\n\n\t\t\t\t// This is needed so the slick slider behind the photoswipe gallery slides along with the photoswipe gallery\n\t\t\t\tif (storeImages) {\n\t\t\t\t\tstoreImages.slick('slickSetOption', 'waitForAnimate', false);\n\t\t\t\t\tstoreImages.slick('slickGoTo', slickIndex);\n\t\t\t\t\tstoreImages.slick('slickSetOption', 'waitForAnimate', true);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// For IE11 users on products with unequal width/height\n\t\t\tgallery.listen('initialZoomInEnd', function () {\n\t\t\t\tvar img = document.querySelector('img.pswp__img');\n\t\t\t\tif (!img) return;\n\t\t\t\tvar computedStyle = getComputedStyle(img).objectFit;\n\t\t\t\tvar objectFitSupport = !!computedStyle;\n\t\t\t\tif (objectFitSupport) return;\n\n\t\t\t\tif (!img.naturalHeight || !img.naturalWidth) return;\n\t\t\t\tif (img.naturalWidth === img.naturalHeight) return;\n\t\t\t\tif (img.naturalWidth > img.naturalHeight) img.style.width = '';\n\t\t\t\tif (img.naturalWidth < img.naturalHeight) img.style.height = '';\n\n\t\t\t\tif (window.MutationObserver) {\n\t\t\t\t\tvar config = { attributes: true };\n\t\t\t\t\tvar observer = new MutationObserver(function (mutations) {\n\t\t\t\t\t\tfor (var mi = 0; mi < mutations.length; mi++) {\n\t\t\t\t\t\t\tvar mutation = mutations[mi];\n\t\t\t\t\t\t\tif (mutation.attributeName === 'style') {\n\t\t\t\t\t\t\t\tif (img.style.width && img.style.height) {\n\t\t\t\t\t\t\t\t\tif (img.naturalWidth > img.naturalHeight) img.style.width = '';\n\t\t\t\t\t\t\t\t\tif (img.naturalWidth < img.naturalHeight) img.style.height = '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tobserver.observe(img, config);\n\n\t\t\t\t\tgallery.listen('destroy', function () {\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// If on Android, also open photoswipe on pinch zoom\n\t\tif ($('html[data-useragent*=\"Android\"]')[0]) {\n\t\t\tvar touchPosStart,\n\t\t\t\tptspOpen = false,\n\t\t\t\t$maiImagesSlider = $('.product-main-images'); // using the data attribute seems to give some problems?\n\t\t\t\n\t\t\t$maiImagesSlider.on('touchstart', function (e) {\n\t\t\t\tif (e.touches.length > 1) {\n\t\t\t\t\ttouchPosStart = Math.sqrt(\n\t\t\t\t\t\t(e.touches[0].pageX - e.touches[1].pageX) * (e.touches[0].pageX - e.touches[1].pageX) + // eslint-disable-line\n\t\t\t\t\t\t(e.touches[0].pageY - e.touches[1].pageY) * (e.touches[0].pageY - e.touches[1].pageY)); // eslint-disable-line\n\t\t\t\t}\n\t\t\t});\n\t\t\t\t\n\t\t\t$maiImagesSlider.on('touchmove', function (e) {\n\t\t\t\tif (e.touches.length > 1) {\n\t\t\t\t\tvar touchDistance = Math.sqrt(\n\t\t\t\t\t\t(e.touches[0].pageX - e.touches[1].pageX) * (e.touches[0].pageX - e.touches[1].pageX) + // eslint-disable-line\n\t\t\t\t\t\t(e.touches[0].pageY - e.touches[1].pageY) * (e.touches[0].pageY - e.touches[1].pageY)); // eslint-disable-line\n\t\t\t\t\t\t\n\t\t\t\t\tif (touchDistance > touchPosStart) {\n\t\t\t\t\t\tif (!ptspOpen) {\n\t\t\t\t\t\t\tvar $slider = $maiImagesSlider.find('.slick-track'),\n\t\t\t\t\t\t\tactiveSlideIndex = $slider.eq(0).find('.slick-active').index();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tptspOpen = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\tptspOpen = false;\n\t\t\t\t\t\t\t}, 500);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\topenPhotoSwipe(activeSlideIndex, $slider[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\n\t\t// loop through all gallery elements and bind events\n\t\tvar galleryElements = document.querySelectorAll(gallerySelector);\n\n\t\tfor (var i = 0, l = galleryElements.length; i < l; i++) {\n\t\t\tgalleryElements[i].setAttribute('data-pswp-uid', i + 1);\n\t\t\tgalleryElements[i].onclick = onThumbnailsClick;\n\t\t}\n\n\t\t// Parse URL and open gallery if it contains #&pid=3&gid=1\n\t\tvar hashData = photoswipeParseHash();\n\t\tif (hashData.pid && hashData.gid) {\n\t\t\topenPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true);\n\t\t}\n\t}\n};\n","'use strict';\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n var pid;\n var $atcButton = $($el);\n\n if ($atcButton.closest('.js-product-quickview').length > 0) {\n pid = $atcButton.closest('.js-product-quickview').attr('data-pid');\n } else if ($atcButton.closest('.js-product').length > 0) {\n pid = $atcButton.closest('.js-product').attr('data-pid');\n } else if ($('.product-set-detail').length > 0 || $('.product-set').length > 0) {\n pid = $atcButton.closest('.product-detail').find('.product-id').text();\n } else {\n pid = $('.product-detail:not(\".bundle-item\")').attr('data-pid');\n }\n\n return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n return $el && $('.set-items').length\n ? $($el).closest('.product-detail').find('.quantity-select')\n : $('.quantity-select');\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processSwatchValues(attr, $productContainer) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchAnchor = $attrValue.parent();\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n } else {\n $attrValue.removeClass('selected');\n }\n\n if (attrValue.url) {\n $swatchAnchor.attr('href', attrValue.url);\n } else {\n $swatchAnchor.removeAttr('href');\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n $defaultOption.attr('value', attr.resetUrl);\n\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer\n .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n $attrValue.attr('value', attrValue.url)\n .removeAttr('disabled');\n\n if (!attrValue.selectable) {\n $attrValue.attr('disabled', true);\n }\n });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAttrs(attrs, $productContainer) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithSwatches = ['color'];\n\n attrs.forEach(function (attr) {\n if (attrsWithSwatches.indexOf(attr.id) > -1) {\n processSwatchValues(attr, $productContainer);\n } else {\n processNonSwatchValues(attr, $productContainer);\n }\n });\n\n $('body').trigger('product:updateAttrValues');\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (!response.product.readyToOrder) {\n availabilityValue = '
' + response.resources.info_selectforstock + '
';\n } else {\n availabilityMessages.forEach(function (message) {\n availabilityValue += '
' + message + '
';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for promotions section\n *\n * @param {array} promotions - list of promotions\n * @return {string} - Compiled HTML\n */\nfunction getPromotionsHtml(promotions) {\n if (!promotions) {\n return '';\n }\n\n var html = '';\n\n promotions.forEach(function (promotion) {\n html += '
' + promotion.calloutMsg +\n '
';\n });\n\n return html;\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
' + attribute.label + ': '\n + attribute.value + '
';\n });\n }\n });\n\n return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} options - Ajax response options from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(options, $productContainer) {\n options.forEach(function (option) {\n var $optionEl = $productContainer.find('.product-option[data-option-id*=\"' + option.id\n + '\"]');\n option.values.forEach(function (value) {\n var valueEl = $optionEl.find('option[data-value-id*=\"' + value.id + '\"]');\n valueEl.val(value.url);\n });\n });\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n var isVaraint;\n if (response.product.variationAttributes) {\n updateAttrs(response.product.variationAttributes, $productContainer);\n isVaraint = response.product.productType === 'variant';\n if (isChoiceOfBonusProducts && isVaraint) {\n $productContainer.parent('.bonus-product-item')\n .data('pid', response.product.id);\n\n $productContainer.parent('.bonus-product-item')\n .data('ready-to-order', response.product.readyToOrder);\n }\n }\n\n // Update primary images\n var primaryImageUrls = response.product.images;\n primaryImageUrls.large.forEach(function (imageUrl, idx) {\n $productContainer.find('.primary-images').find('img').eq(idx)\n .attr('src', imageUrl.url);\n });\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n var $priceSelector = $('.prices .price', $productContainer).length\n ? $('.prices .price', $productContainer)\n : $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n $('.promotions').empty().html(getPromotionsHtml(response.product.promotions));\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product, $productContainer: $productContainer\n });\n } else {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n product: response.product, $productContainer: $productContainer\n }).trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty()\n .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n * etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n if (!($productContainer.parent('.bonus-product-item').length > 0)) {\n var optionsHtml = quantities.map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n }).join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect',\n { url: selectedValueUrl, container: $productContainer });\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer);\n updateOptions(data.product.options, $productContainer);\n updateQuantities(data.product.quantities, $productContainer); \n $('body').trigger('product:afterAttributeSelect',\n { data: data, container: $productContainer });\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n },\n complete: function () {\n $('body').trigger(\"calculateWaardechequePrices\");\n }\n });\n }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n var $html = $('
').append($.parseHTML(html));\n\n var body = $html.find('.choice-of-bonus-product');\n var footer = $html.find('.modal-footer').children();\n\n return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n $('.modal-body').spinner().start();\n\n if ($('#chooseBonusProductModal').length !== 0) {\n $('#chooseBonusProductModal').remove();\n }\n var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n var htmlString = ''\n + '
'\n + '
'\n + ''\n + '
'\n + '
'\n + ' ' + data.labels.selectprods + ''\n + ' '\n + '
'\n + '
'\n + '
'\n + '
'\n + '
'\n + '
';\n $('body').append(htmlString);\n $('.modal-body').spinner().start();\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'html',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('#chooseBonusProductModal .modal-body').empty();\n $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n $('#chooseBonusProductModal').modal('show');\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n if (response.newBonusDiscountLineItem\n && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n chooseBonusProducts(response.newBonusDiscountLineItem);\n } else {\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
'\n );\n }\n\n $('.add-to-cart-messages').append(\n '
'\n + response.message\n + '
'\n );\n\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n var childProducts = [];\n $('.bundle-item').each(function () {\n childProducts.push({\n pid: $(this).find('.product-id').text(),\n quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n });\n });\n\n return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n var options = $productContainer\n .find('.product-option')\n .map(function () {\n var $elOption = $(this).find('.options-select');\n var urlValue = $elOption.val();\n var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n .data('value-id');\n return {\n optionId: $(this).data('option-id'),\n selectedValueId: selectedValueId\n };\n }).toArray();\n\n return JSON.stringify(options);\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n colorAttribute: function () {\n $(document).off('click', '[data-attr=\"color\"] a').on('click', '[data-attr=\"color\"] a', function (e) {\n e.preventDefault();\n\n if ($(this).attr('disabled')) {\n return;\n }\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n attributeSelect(e.currentTarget.href, $productContainer);\n });\n },\n\n selectAttribute: function () {\n $(document).off('change', 'select[class*=\"select-\"], .options-select').on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n attributeSelect(e.currentTarget.value, $productContainer);\n });\n },\n\n availability: function () {\n $(document).off('change', '.quantity-select').on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n }\n\n if ($('.bundle-items', $productContainer).length === 0) {\n attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n $productContainer);\n }\n });\n },\n\n addToCart: function () {\n $(document).off('click', 'button.add-to-cart, button.add-to-cart-global').on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n const $atcButton = $(this);\n const $productContainer = $atcButton.closest('.js-product');\n let addToCartUrl;\n let pid;\n let pidsObj;\n let setPids;\n let isReady = true;\n\n // Loop over all attributes (color, size, etc)\n $productContainer.find('.product-attributes').each(function (index, el) {\n const $productAttribute = $(el);\n const hasAttributeItems = $productAttribute.find('.product-attributes__item').length > 0; // does the attribute have any items/variations?\n const noSelectedAttribute = $productAttribute.find('.product-attributes__item.selected').length === 0; // does the attribute have a selected item/variation?\n const $productAttributesContainer = $productContainer.find('.js-product-detail-variations')\n const $productAttributeMessage = $productContainer.find('.js-availability-msg');\n\n if (hasAttributeItems && noSelectedAttribute) {\n $productAttribute.addClass('product-attributes--error');\n $productAttributeMessage.removeClass('d-none');\n isReady = false;\n $('html, body').animate({\n scrollTop: $productAttributesContainer.offset().top - 150\n }, 500);\n }\n });\n\n if (!isReady) {\n return;\n }\n\n $('body').trigger('product:beforeAddToCart', this);\n $.spinner().start();\n\n if ($('.set-items').length && $atcButton.hasClass('add-to-cart-global')) {\n setPids = [];\n\n $('.product-detail').each(function () {\n if (!$(this).hasClass('product-set-detail')) {\n setPids.push({\n pid: $(this).find('.product-id').text(),\n qty: $(this).find('.quantity-select').val(),\n options: getOptions($(this))\n });\n }\n });\n pidsObj = JSON.stringify(setPids);\n }\n\n pid = getPidValue($atcButton);\n\n if (!$productContainer.length) {\n $productContainer = $atcButton.closest('.quick-view-dialog').find('.product-detail');\n }\n\n addToCartUrl = getAddToCartUrl();\n\n var form = {\n pid: pid,\n pidsObj: pidsObj,\n childProducts: getChildProducts(),\n quantity: getQuantitySelected($atcButton) || 1\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n $atcButton.trigger('updateAddToCartFormData', form);\n if (addToCartUrl) {\n $.ajax({\n url: addToCartUrl,\n method: 'POST',\n data: form,\n success: function (data) {\n if (data.error && data.message) {\n $('body').trigger('modal:ShowOutOfStock', {\n message: data.message\n });\n\n $.spinner().stop();\n } else {\n handlePostCartAdd(data);\n $('body').trigger('product:afterAddToCart', data);\n $.spinner().stop();\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n },\n\n selectBonusProduct: function () {\n $(document).off('click', '.select-bonus-product').on('click', '.select-bonus-product', function () {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $(this).data('pid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = parseInt($(this).parents('.choice-of-bonus-product').find('.bonus-quantity-select').val(), 10);\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n totalQty += submittedQty;\n var optionID = $(this).parents('.choice-of-bonus-product').find('.product-option').data('option-id');\n var valueId = $(this).parents('.choice-of-bonus-product').find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml = ''\n + '
'\n + '
'\n + $choiceOfBonusProduct.find('.product-name').html()\n + '
'\n + '
'\n + '
'\n ;\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n });\n },\n removeBonusProduct: function () {\n $(document).off('click', '.selected-pid').on('click', '.selected-pid', function () {\n $(this).remove();\n var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n var count = 0;\n if ($selected.length) {\n $selected.each(function () {\n count += parseInt($(this).data('qty'), 10);\n });\n }\n\n $('.pre-cart-products').html(count);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n });\n },\n enableBonusProductSelection: function () {\n $('body').off('bonusproduct:updateSelectButton').on('bonusproduct:updateSelectButton', function (e, response) {\n $('button.select-bonus-product', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n var pid = response.product.id;\n $('button.select-bonus-product').data('pid', pid);\n });\n },\n showMoreBonusProducts: function () {\n $(document).off('click', '.show-more-bonus-products').on('click', '.show-more-bonus-products', function () {\n var url = $(this).data('url');\n $('.modal-content').spinner().start();\n $.ajax({\n url: url,\n method: 'GET',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('.modal-body').append(parsedHtml.body);\n $('.show-more-bonus-products:first').remove();\n $('.modal-content').spinner().stop();\n },\n error: function () {\n $('.modal-content').spinner().stop();\n }\n });\n });\n },\n addBonusProductsToCart: function () {\n $(document).off('click', '.add-bonus-products').on('click', '.add-bonus-products', function () {\n var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n var queryString = '?pids=';\n var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n var pidsObject = {\n bonusProducts: []\n };\n\n $.each($readyToOrderBonusProducts, function () {\n var qtyOption =\n parseInt($(this)\n .data('qty'), 10);\n\n var option = null;\n if (qtyOption > 0) {\n if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n option = {};\n option.optionId = $(this).data('optionid');\n option.productId = $(this).data('pid');\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n pid: $(this).data('pid'),\n qty: qtyOption,\n options: [option]\n });\n pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n $.spinner().start();\n $.ajax({\n url: url + queryString,\n method: 'POST',\n success: function (data) {\n $.spinner().stop();\n if (data.error) {\n $('.error-choice-of-bonus-products')\n .html(data.errorMessage);\n } else {\n $('.configure-bonus-product-attributes').html(data);\n $('.bonus-products-step2').removeClass('hidden-xl-down');\n $('#chooseBonusProductModal').modal('hide');\n\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
'\n );\n }\n $('.minicart-quantity').html(data.totalQty);\n $('.add-to-cart-messages').append(\n '
'\n + data.msgSuccess + '
'\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n if ($('.cart-page').length) {\n location.reload();\n }\n }, 3000);\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected\n};\n","/*! PhotoSwipe - v4.1.2 - 2017-04-05\n* http://photoswipe.com\n* Copyright (c) 2017 Dmitry Semenov; */\n(function (root, factory) { \n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t} else if (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\troot.PhotoSwipe = factory();\n\t}\n})(this, function () {\n\n\t'use strict';\n\tvar PhotoSwipe = function(template, UiClass, items, options){\n\n/*>>framework-bridge*/\n/**\n *\n * Set of generic functions used by gallery.\n * \n * You're free to modify anything here as long as functionality is kept.\n * \n */\nvar framework = {\n\tfeatures: null,\n\tbind: function(target, type, listener, unbind) {\n\t\tvar methodName = (unbind ? 'remove' : 'add') + 'EventListener';\n\t\ttype = type.split(' ');\n\t\tfor(var i = 0; i < type.length; i++) {\n\t\t\tif(type[i]) {\n\t\t\t\ttarget[methodName]( type[i], listener, false);\n\t\t\t}\n\t\t}\n\t},\n\tisArray: function(obj) {\n\t\treturn (obj instanceof Array);\n\t},\n\tcreateEl: function(classes, tag) {\n\t\tvar el = document.createElement(tag || 'div');\n\t\tif(classes) {\n\t\t\tel.className = classes;\n\t\t}\n\t\treturn el;\n\t},\n\tgetScrollY: function() {\n\t\tvar yOffset = window.pageYOffset;\n\t\treturn yOffset !== undefined ? yOffset : document.documentElement.scrollTop;\n\t},\n\tunbind: function(target, type, listener) {\n\t\tframework.bind(target,type,listener,true);\n\t},\n\tremoveClass: function(el, className) {\n\t\tvar reg = new RegExp('(\\\\s|^)' + className + '(\\\\s|$)');\n\t\tel.className = el.className.replace(reg, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, ''); \n\t},\n\taddClass: function(el, className) {\n\t\tif( !framework.hasClass(el,className) ) {\n\t\t\tel.className += (el.className ? ' ' : '') + className;\n\t\t}\n\t},\n\thasClass: function(el, className) {\n\t\treturn el.className && new RegExp('(^|\\\\s)' + className + '(\\\\s|$)').test(el.className);\n\t},\n\tgetChildByClass: function(parentEl, childClassName) {\n\t\tvar node = parentEl.firstChild;\n\t\twhile(node) {\n\t\t\tif( framework.hasClass(node, childClassName) ) {\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\tnode = node.nextSibling;\n\t\t}\n\t},\n\tarraySearch: function(array, value, key) {\n\t\tvar i = array.length;\n\t\twhile(i--) {\n\t\t\tif(array[i][key] === value) {\n\t\t\t\treturn i;\n\t\t\t} \n\t\t}\n\t\treturn -1;\n\t},\n\textend: function(o1, o2, preventOverwrite) {\n\t\tfor (var prop in o2) {\n\t\t\tif (o2.hasOwnProperty(prop)) {\n\t\t\t\tif(preventOverwrite && o1.hasOwnProperty(prop)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\to1[prop] = o2[prop];\n\t\t\t}\n\t\t}\n\t},\n\teasing: {\n\t\tsine: {\n\t\t\tout: function(k) {\n\t\t\t\treturn Math.sin(k * (Math.PI / 2));\n\t\t\t},\n\t\t\tinOut: function(k) {\n\t\t\t\treturn - (Math.cos(Math.PI * k) - 1) / 2;\n\t\t\t}\n\t\t},\n\t\tcubic: {\n\t\t\tout: function(k) {\n\t\t\t\treturn --k * k * k + 1;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t\telastic: {\n\t\t\t\tout: function ( k ) {\n\n\t\t\t\t\tvar s, a = 0.1, p = 0.4;\n\t\t\t\t\tif ( k === 0 ) return 0;\n\t\t\t\t\tif ( k === 1 ) return 1;\n\t\t\t\t\tif ( !a || a < 1 ) { a = 1; s = p / 4; }\n\t\t\t\t\telse s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n\t\t\t\t\treturn ( a * Math.pow( 2, - 10 * k) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) + 1 );\n\n\t\t\t\t},\n\t\t\t},\n\t\t\tback: {\n\t\t\t\tout: function ( k ) {\n\t\t\t\t\tvar s = 1.70158;\n\t\t\t\t\treturn --k * k * ( ( s + 1 ) * k + s ) + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t*/\n\t},\n\n\t/**\n\t * \n\t * @return {object}\n\t * \n\t * {\n\t * raf : request animation frame function\n\t * caf : cancel animation frame function\n\t * transfrom : transform property key (with vendor), or null if not supported\n\t * oldIE : IE8 or below\n\t * }\n\t * \n\t */\n\tdetectFeatures: function() {\n\t\tif(framework.features) {\n\t\t\treturn framework.features;\n\t\t}\n\t\tvar helperEl = framework.createEl(),\n\t\t\thelperStyle = helperEl.style,\n\t\t\tvendor = '',\n\t\t\tfeatures = {};\n\n\t\t// IE8 and below\n\t\tfeatures.oldIE = document.all && !document.addEventListener;\n\n\t\tfeatures.touch = 'ontouchstart' in window;\n\n\t\tif(window.requestAnimationFrame) {\n\t\t\tfeatures.raf = window.requestAnimationFrame;\n\t\t\tfeatures.caf = window.cancelAnimationFrame;\n\t\t}\n\n\t\tfeatures.pointerEvent = navigator.pointerEnabled || navigator.msPointerEnabled;\n\n\t\t// fix false-positive detection of old Android in new IE\n\t\t// (IE11 ua string contains \"Android 4.0\")\n\t\t\n\t\tif(!features.pointerEvent) { \n\n\t\t\tvar ua = navigator.userAgent;\n\n\t\t\t// Detect if device is iPhone or iPod and if it's older than iOS 8\n\t\t\t// http://stackoverflow.com/a/14223920\n\t\t\t// \n\t\t\t// This detection is made because of buggy top/bottom toolbars\n\t\t\t// that don't trigger window.resize event.\n\t\t\t// For more info refer to _isFixedPosition variable in core.js\n\n\t\t\tif (/iP(hone|od)/.test(navigator.platform)) {\n\t\t\t\tvar v = (navigator.appVersion).match(/OS (\\d+)_(\\d+)_?(\\d+)?/);\n\t\t\t\tif(v && v.length > 0) {\n\t\t\t\t\tv = parseInt(v[1], 10);\n\t\t\t\t\tif(v >= 1 && v < 8 ) {\n\t\t\t\t\t\tfeatures.isOldIOSPhone = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Detect old Android (before KitKat)\n\t\t\t// due to bugs related to position:fixed\n\t\t\t// http://stackoverflow.com/questions/7184573/pick-up-the-android-version-in-the-browser-by-javascript\n\t\t\t\n\t\t\tvar match = ua.match(/Android\\s([0-9\\.]*)/);\n\t\t\tvar androidversion = match ? match[1] : 0;\n\t\t\tandroidversion = parseFloat(androidversion);\n\t\t\tif(androidversion >= 1 ) {\n\t\t\t\tif(androidversion < 4.4) {\n\t\t\t\t\tfeatures.isOldAndroid = true; // for fixed position bug & performance\n\t\t\t\t}\n\t\t\t\tfeatures.androidVersion = androidversion; // for touchend bug\n\t\t\t}\t\n\t\t\tfeatures.isMobileOpera = /opera mini|opera mobi/i.test(ua);\n\n\t\t\t// p.s. yes, yes, UA sniffing is bad, propose your solution for above bugs.\n\t\t}\n\t\t\n\t\tvar styleChecks = ['transform', 'perspective', 'animationName'],\n\t\t\tvendors = ['', 'webkit','Moz','ms','O'],\n\t\t\tstyleCheckItem,\n\t\t\tstyleName;\n\n\t\tfor(var i = 0; i < 4; i++) {\n\t\t\tvendor = vendors[i];\n\n\t\t\tfor(var a = 0; a < 3; a++) {\n\t\t\t\tstyleCheckItem = styleChecks[a];\n\n\t\t\t\t// uppercase first letter of property name, if vendor is present\n\t\t\t\tstyleName = vendor + (vendor ? \n\t\t\t\t\t\t\t\t\t\tstyleCheckItem.charAt(0).toUpperCase() + styleCheckItem.slice(1) : \n\t\t\t\t\t\t\t\t\t\tstyleCheckItem);\n\t\t\t\n\t\t\t\tif(!features[styleCheckItem] && styleName in helperStyle ) {\n\t\t\t\t\tfeatures[styleCheckItem] = styleName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(vendor && !features.raf) {\n\t\t\t\tvendor = vendor.toLowerCase();\n\t\t\t\tfeatures.raf = window[vendor+'RequestAnimationFrame'];\n\t\t\t\tif(features.raf) {\n\t\t\t\t\tfeatures.caf = window[vendor+'CancelAnimationFrame'] || \n\t\t\t\t\t\t\t\t\twindow[vendor+'CancelRequestAnimationFrame'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif(!features.raf) {\n\t\t\tvar lastTime = 0;\n\t\t\tfeatures.raf = function(fn) {\n\t\t\t\tvar currTime = new Date().getTime();\n\t\t\t\tvar timeToCall = Math.max(0, 16 - (currTime - lastTime));\n\t\t\t\tvar id = window.setTimeout(function() { fn(currTime + timeToCall); }, timeToCall);\n\t\t\t\tlastTime = currTime + timeToCall;\n\t\t\t\treturn id;\n\t\t\t};\n\t\t\tfeatures.caf = function(id) { clearTimeout(id); };\n\t\t}\n\n\t\t// Detect SVG support\n\t\tfeatures.svg = !!document.createElementNS && \n\t\t\t\t\t\t!!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;\n\n\t\tframework.features = features;\n\n\t\treturn features;\n\t}\n};\n\nframework.detectFeatures();\n\n// Override addEventListener for old versions of IE\nif(framework.features.oldIE) {\n\n\tframework.bind = function(target, type, listener, unbind) {\n\t\t\n\t\ttype = type.split(' ');\n\n\t\tvar methodName = (unbind ? 'detach' : 'attach') + 'Event',\n\t\t\tevName,\n\t\t\t_handleEv = function() {\n\t\t\t\tlistener.handleEvent.call(listener);\n\t\t\t};\n\n\t\tfor(var i = 0; i < type.length; i++) {\n\t\t\tevName = type[i];\n\t\t\tif(evName) {\n\n\t\t\t\tif(typeof listener === 'object' && listener.handleEvent) {\n\t\t\t\t\tif(!unbind) {\n\t\t\t\t\t\tlistener['oldIE' + evName] = _handleEv;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(!listener['oldIE' + evName]) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttarget[methodName]( 'on' + evName, listener['oldIE' + evName]);\n\t\t\t\t} else {\n\t\t\t\t\ttarget[methodName]( 'on' + evName, listener);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t};\n\t\n}\n\n/*>>framework-bridge*/\n\n/*>>core*/\n//function(template, UiClass, items, options)\n\nvar self = this;\n\n/**\n * Static vars, don't change unless you know what you're doing.\n */\nvar DOUBLE_TAP_RADIUS = 25, \n\tNUM_HOLDERS = 3;\n\n/**\n * Options\n */\nvar _options = {\n\tallowPanToNext:true,\n\tspacing: 0.12,\n\tbgOpacity: 1,\n\tmouseUsed: false,\n\tloop: true,\n\tpinchToClose: true,\n\tcloseOnScroll: true,\n\tcloseOnVerticalDrag: true,\n\tverticalDragRange: 0.75,\n\thideAnimationDuration: 333,\n\tshowAnimationDuration: 333,\n\tshowHideOpacity: false,\n\tfocus: true,\n\tescKey: true,\n\tarrowKeys: true,\n\tmainScrollEndFriction: 0.35,\n\tpanEndFriction: 0.35,\n\tisClickableElement: function(el) {\n return el.tagName === 'A';\n },\n getDoubleTapZoom: function(isMouseClick, item) {\n \tif(isMouseClick) {\n \t\treturn 1;\n \t} else {\n \t\treturn item.initialZoomLevel < 0.7 ? 1 : 1.33;\n \t}\n },\n maxSpreadZoom: 1.33,\n\tmodal: true,\n\n\t// not fully implemented yet\n\tscaleMode: 'fit' // TODO\n};\nframework.extend(_options, options);\n\n\n/**\n * Private helper variables & functions\n */\n\nvar _getEmptyPoint = function() { \n\t\treturn {x:0,y:0}; \n\t};\n\nvar _isOpen,\n\t_isDestroying,\n\t_closedByScroll,\n\t_currentItemIndex,\n\t_containerStyle,\n\t_containerShiftIndex,\n\t_currPanDist = _getEmptyPoint(),\n\t_startPanOffset = _getEmptyPoint(),\n\t_panOffset = _getEmptyPoint(),\n\t_upMoveEvents, // drag move, drag end & drag cancel events array\n\t_downEvents, // drag start events array\n\t_globalEventHandlers,\n\t_viewportSize = {},\n\t_currZoomLevel,\n\t_startZoomLevel,\n\t_translatePrefix,\n\t_translateSufix,\n\t_updateSizeInterval,\n\t_itemsNeedUpdate,\n\t_currPositionIndex = 0,\n\t_offset = {},\n\t_slideSize = _getEmptyPoint(), // size of slide area, including spacing\n\t_itemHolders,\n\t_prevItemIndex,\n\t_indexDiff = 0, // difference of indexes since last content update\n\t_dragStartEvent,\n\t_dragMoveEvent,\n\t_dragEndEvent,\n\t_dragCancelEvent,\n\t_transformKey,\n\t_pointerEventEnabled,\n\t_isFixedPosition = true,\n\t_likelyTouchDevice,\n\t_modules = [],\n\t_requestAF,\n\t_cancelAF,\n\t_initalClassName,\n\t_initalWindowScrollY,\n\t_oldIE,\n\t_currentWindowScrollY,\n\t_features,\n\t_windowVisibleSize = {},\n\t_renderMaxResolution = false,\n\t_orientationChangeTimeout,\n\n\n\t// Registers PhotoSWipe module (History, Controller ...)\n\t_registerModule = function(name, module) {\n\t\tframework.extend(self, module.publicMethods);\n\t\t_modules.push(name);\n\t},\n\n\t_getLoopedId = function(index) {\n\t\tvar numSlides = _getNumItems();\n\t\tif(index > numSlides - 1) {\n\t\t\treturn index - numSlides;\n\t\t} else if(index < 0) {\n\t\t\treturn numSlides + index;\n\t\t}\n\t\treturn index;\n\t},\n\t\n\t// Micro bind/trigger\n\t_listeners = {},\n\t_listen = function(name, fn) {\n\t\tif(!_listeners[name]) {\n\t\t\t_listeners[name] = [];\n\t\t}\n\t\treturn _listeners[name].push(fn);\n\t},\n\t_shout = function(name) {\n\t\tvar listeners = _listeners[name];\n\n\t\tif(listeners) {\n\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\targs.shift();\n\n\t\t\tfor(var i = 0; i < listeners.length; i++) {\n\t\t\t\tlisteners[i].apply(self, args);\n\t\t\t}\n\t\t}\n\t},\n\n\t_getCurrentTime = function() {\n\t\treturn new Date().getTime();\n\t},\n\t_applyBgOpacity = function(opacity) {\n\t\t_bgOpacity = opacity;\n\t\tself.bg.style.opacity = opacity * _options.bgOpacity;\n\t},\n\n\t_applyZoomTransform = function(styleObj,x,y,zoom,item) {\n\t\tif(!_renderMaxResolution || (item && item !== self.currItem) ) {\n\t\t\tzoom = zoom / (item ? item.fitRatio : self.currItem.fitRatio);\t\n\t\t}\n\t\t\t\n\t\tstyleObj[_transformKey] = _translatePrefix + x + 'px, ' + y + 'px' + _translateSufix + ' scale(' + zoom + ')';\n\t},\n\t_applyCurrentZoomPan = function( allowRenderResolution ) {\n\t\tif(_currZoomElementStyle) {\n\n\t\t\tif(allowRenderResolution) {\n\t\t\t\tif(_currZoomLevel > self.currItem.fitRatio) {\n\t\t\t\t\tif(!_renderMaxResolution) {\n\t\t\t\t\t\t_setImageSize(self.currItem, false, true);\n\t\t\t\t\t\t_renderMaxResolution = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(_renderMaxResolution) {\n\t\t\t\t\t\t_setImageSize(self.currItem);\n\t\t\t\t\t\t_renderMaxResolution = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\t_applyZoomTransform(_currZoomElementStyle, _panOffset.x, _panOffset.y, _currZoomLevel);\n\t\t}\n\t},\n\t_applyZoomPanToItem = function(item) {\n\t\tif(item.container) {\n\n\t\t\t_applyZoomTransform(item.container.style, \n\t\t\t\t\t\t\t\titem.initialPosition.x, \n\t\t\t\t\t\t\t\titem.initialPosition.y, \n\t\t\t\t\t\t\t\titem.initialZoomLevel,\n\t\t\t\t\t\t\t\titem);\n\t\t}\n\t},\n\t_setTranslateX = function(x, elStyle) {\n\t\telStyle[_transformKey] = _translatePrefix + x + 'px, 0px' + _translateSufix;\n\t},\n\t_moveMainScroll = function(x, dragging) {\n\n\t\tif(!_options.loop && dragging) {\n\t\t\tvar newSlideIndexOffset = _currentItemIndex + (_slideSize.x * _currPositionIndex - x) / _slideSize.x,\n\t\t\t\tdelta = Math.round(x - _mainScrollPos.x);\n\n\t\t\tif( (newSlideIndexOffset < 0 && delta > 0) || \n\t\t\t\t(newSlideIndexOffset >= _getNumItems() - 1 && delta < 0) ) {\n\t\t\t\tx = _mainScrollPos.x + delta * _options.mainScrollEndFriction;\n\t\t\t} \n\t\t}\n\t\t\n\t\t_mainScrollPos.x = x;\n\t\t_setTranslateX(x, _containerStyle);\n\t},\n\t_calculatePanOffset = function(axis, zoomLevel) {\n\t\tvar m = _midZoomPoint[axis] - _offset[axis];\n\t\treturn _startPanOffset[axis] + _currPanDist[axis] + m - m * ( zoomLevel / _startZoomLevel );\n\t},\n\t\n\t_equalizePoints = function(p1, p2) {\n\t\tp1.x = p2.x;\n\t\tp1.y = p2.y;\n\t\tif(p2.id) {\n\t\t\tp1.id = p2.id;\n\t\t}\n\t},\n\t_roundPoint = function(p) {\n\t\tp.x = Math.round(p.x);\n\t\tp.y = Math.round(p.y);\n\t},\n\n\t_mouseMoveTimeout = null,\n\t_onFirstMouseMove = function() {\n\t\t// Wait until mouse move event is fired at least twice during 100ms\n\t\t// We do this, because some mobile browsers trigger it on touchstart\n\t\tif(_mouseMoveTimeout ) { \n\t\t\tframework.unbind(document, 'mousemove', _onFirstMouseMove);\n\t\t\tframework.addClass(template, 'pswp--has_mouse');\n\t\t\t_options.mouseUsed = true;\n\t\t\t_shout('mouseUsed');\n\t\t}\n\t\t_mouseMoveTimeout = setTimeout(function() {\n\t\t\t_mouseMoveTimeout = null;\n\t\t}, 100);\n\t},\n\n\t_bindEvents = function() {\n\t\tframework.bind(document, 'keydown', self);\n\n\t\tif(_features.transform) {\n\t\t\t// don't bind click event in browsers that don't support transform (mostly IE8)\n\t\t\tframework.bind(self.scrollWrap, 'click', self);\n\t\t}\n\t\t\n\n\t\tif(!_options.mouseUsed) {\n\t\t\tframework.bind(document, 'mousemove', _onFirstMouseMove);\n\t\t}\n\n\t\tframework.bind(window, 'resize scroll orientationchange', self);\n\n\t\t_shout('bindEvents');\n\t},\n\n\t_unbindEvents = function() {\n\t\tframework.unbind(window, 'resize scroll orientationchange', self);\n\t\tframework.unbind(window, 'scroll', _globalEventHandlers.scroll);\n\t\tframework.unbind(document, 'keydown', self);\n\t\tframework.unbind(document, 'mousemove', _onFirstMouseMove);\n\n\t\tif(_features.transform) {\n\t\t\tframework.unbind(self.scrollWrap, 'click', self);\n\t\t}\n\n\t\tif(_isDragging) {\n\t\t\tframework.unbind(window, _upMoveEvents, self);\n\t\t}\n\n\t\tclearTimeout(_orientationChangeTimeout);\n\n\t\t_shout('unbindEvents');\n\t},\n\t\n\t_calculatePanBounds = function(zoomLevel, update) {\n\t\tvar bounds = _calculateItemSize( self.currItem, _viewportSize, zoomLevel );\n\t\tif(update) {\n\t\t\t_currPanBounds = bounds;\n\t\t}\n\t\treturn bounds;\n\t},\n\t\n\t_getMinZoomLevel = function(item) {\n\t\tif(!item) {\n\t\t\titem = self.currItem;\n\t\t}\n\t\treturn item.initialZoomLevel;\n\t},\n\t_getMaxZoomLevel = function(item) {\n\t\tif(!item) {\n\t\t\titem = self.currItem;\n\t\t}\n\t\treturn item.w > 0 ? _options.maxSpreadZoom : 1;\n\t},\n\n\t// Return true if offset is out of the bounds\n\t_modifyDestPanOffset = function(axis, destPanBounds, destPanOffset, destZoomLevel) {\n\t\tif(destZoomLevel === self.currItem.initialZoomLevel) {\n\t\t\tdestPanOffset[axis] = self.currItem.initialPosition[axis];\n\t\t\treturn true;\n\t\t} else {\n\t\t\tdestPanOffset[axis] = _calculatePanOffset(axis, destZoomLevel); \n\n\t\t\tif(destPanOffset[axis] > destPanBounds.min[axis]) {\n\t\t\t\tdestPanOffset[axis] = destPanBounds.min[axis];\n\t\t\t\treturn true;\n\t\t\t} else if(destPanOffset[axis] < destPanBounds.max[axis] ) {\n\t\t\t\tdestPanOffset[axis] = destPanBounds.max[axis];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\n\t_setupTransforms = function() {\n\n\t\tif(_transformKey) {\n\t\t\t// setup 3d transforms\n\t\t\tvar allow3dTransform = _features.perspective && !_likelyTouchDevice;\n\t\t\t_translatePrefix = 'translate' + (allow3dTransform ? '3d(' : '(');\n\t\t\t_translateSufix = _features.perspective ? ', 0px)' : ')';\t\n\t\t\treturn;\n\t\t}\n\n\t\t// Override zoom/pan/move functions in case old browser is used (most likely IE)\n\t\t// (so they use left/top/width/height, instead of CSS transform)\n\t\n\t\t_transformKey = 'left';\n\t\tframework.addClass(template, 'pswp--ie');\n\n\t\t_setTranslateX = function(x, elStyle) {\n\t\t\telStyle.left = x + 'px';\n\t\t};\n\t\t_applyZoomPanToItem = function(item) {\n\n\t\t\tvar zoomRatio = item.fitRatio > 1 ? 1 : item.fitRatio,\n\t\t\t\ts = item.container.style,\n\t\t\t\tw = zoomRatio * item.w,\n\t\t\t\th = zoomRatio * item.h;\n\n\t\t\ts.width = w + 'px';\n\t\t\ts.height = h + 'px';\n\t\t\ts.left = item.initialPosition.x + 'px';\n\t\t\ts.top = item.initialPosition.y + 'px';\n\n\t\t};\n\t\t_applyCurrentZoomPan = function() {\n\t\t\tif(_currZoomElementStyle) {\n\n\t\t\t\tvar s = _currZoomElementStyle,\n\t\t\t\t\titem = self.currItem,\n\t\t\t\t\tzoomRatio = item.fitRatio > 1 ? 1 : item.fitRatio,\n\t\t\t\t\tw = zoomRatio * item.w,\n\t\t\t\t\th = zoomRatio * item.h;\n\n\t\t\t\ts.width = w + 'px';\n\t\t\t\ts.height = h + 'px';\n\n\n\t\t\t\ts.left = _panOffset.x + 'px';\n\t\t\t\ts.top = _panOffset.y + 'px';\n\t\t\t}\n\t\t\t\n\t\t};\n\t},\n\n\t_onKeyDown = function(e) {\n\t\tvar keydownAction = '';\n\t\tif(_options.escKey && e.keyCode === 27) { \n\t\t\tkeydownAction = 'close';\n\t\t} else if(_options.arrowKeys) {\n\t\t\tif(e.keyCode === 37) {\n\t\t\t\tkeydownAction = 'prev';\n\t\t\t} else if(e.keyCode === 39) { \n\t\t\t\tkeydownAction = 'next';\n\t\t\t}\n\t\t}\n\n\t\tif(keydownAction) {\n\t\t\t// don't do anything if special key pressed to prevent from overriding default browser actions\n\t\t\t// e.g. in Chrome on Mac cmd+arrow-left returns to previous page\n\t\t\tif( !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey ) {\n\t\t\t\tif(e.preventDefault) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t} else {\n\t\t\t\t\te.returnValue = false;\n\t\t\t\t} \n\t\t\t\tself[keydownAction]();\n\t\t\t}\n\t\t}\n\t},\n\n\t_onGlobalClick = function(e) {\n\t\tif(!e) {\n\t\t\treturn;\n\t\t}\n\n\t\t// don't allow click event to pass through when triggering after drag or some other gesture\n\t\tif(_moved || _zoomStarted || _mainScrollAnimating || _verticalDragInitiated) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\n\t_updatePageScrollOffset = function() {\n\t\tself.setScrollOffset(0, framework.getScrollY());\t\t\n\t};\n\t\n\n\n\t\n\n\n\n// Micro animation engine\nvar _animations = {},\n\t_numAnimations = 0,\n\t_stopAnimation = function(name) {\n\t\tif(_animations[name]) {\n\t\t\tif(_animations[name].raf) {\n\t\t\t\t_cancelAF( _animations[name].raf );\n\t\t\t}\n\t\t\t_numAnimations--;\n\t\t\tdelete _animations[name];\n\t\t}\n\t},\n\t_registerStartAnimation = function(name) {\n\t\tif(_animations[name]) {\n\t\t\t_stopAnimation(name);\n\t\t}\n\t\tif(!_animations[name]) {\n\t\t\t_numAnimations++;\n\t\t\t_animations[name] = {};\n\t\t}\n\t},\n\t_stopAllAnimations = function() {\n\t\tfor (var prop in _animations) {\n\n\t\t\tif( _animations.hasOwnProperty( prop ) ) {\n\t\t\t\t_stopAnimation(prop);\n\t\t\t} \n\t\t\t\n\t\t}\n\t},\n\t_animateProp = function(name, b, endProp, d, easingFn, onUpdate, onComplete) {\n\t\tvar startAnimTime = _getCurrentTime(), t;\n\t\t_registerStartAnimation(name);\n\n\t\tvar animloop = function(){\n\t\t\tif ( _animations[name] ) {\n\t\t\t\t\n\t\t\t\tt = _getCurrentTime() - startAnimTime; // time diff\n\t\t\t\t//b - beginning (start prop)\n\t\t\t\t//d - anim duration\n\n\t\t\t\tif ( t >= d ) {\n\t\t\t\t\t_stopAnimation(name);\n\t\t\t\t\tonUpdate(endProp);\n\t\t\t\t\tif(onComplete) {\n\t\t\t\t\t\tonComplete();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonUpdate( (endProp - b) * easingFn(t/d) + b );\n\n\t\t\t\t_animations[name].raf = _requestAF(animloop);\n\t\t\t}\n\t\t};\n\t\tanimloop();\n\t};\n\t\n\n\nvar publicMethods = {\n\n\t// make a few local variables and functions public\n\tshout: _shout,\n\tlisten: _listen,\n\tviewportSize: _viewportSize,\n\toptions: _options,\n\n\tisMainScrollAnimating: function() {\n\t\treturn _mainScrollAnimating;\n\t},\n\tgetZoomLevel: function() {\n\t\treturn _currZoomLevel;\n\t},\n\tgetCurrentIndex: function() {\n\t\treturn _currentItemIndex;\n\t},\n\tisDragging: function() {\n\t\treturn _isDragging;\n\t},\t\n\tisZooming: function() {\n\t\treturn _isZooming;\n\t},\n\tsetScrollOffset: function(x,y) {\n\t\t_offset.x = x;\n\t\t_currentWindowScrollY = _offset.y = y;\n\t\t_shout('updateScrollOffset', _offset);\n\t},\n\tapplyZoomPan: function(zoomLevel,panX,panY,allowRenderResolution) {\n\t\t_panOffset.x = panX;\n\t\t_panOffset.y = panY;\n\t\t_currZoomLevel = zoomLevel;\n\t\t_applyCurrentZoomPan( allowRenderResolution );\n\t},\n\n\tinit: function() {\n\n\t\tif(_isOpen || _isDestroying) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i;\n\n\t\tself.framework = framework; // basic functionality\n\t\tself.template = template; // root DOM element of PhotoSwipe\n\t\tself.bg = framework.getChildByClass(template, 'pswp__bg');\n\n\t\t_initalClassName = template.className;\n\t\t_isOpen = true;\n\t\t\t\t\n\t\t_features = framework.detectFeatures();\n\t\t_requestAF = _features.raf;\n\t\t_cancelAF = _features.caf;\n\t\t_transformKey = _features.transform;\n\t\t_oldIE = _features.oldIE;\n\t\t\n\t\tself.scrollWrap = framework.getChildByClass(template, 'pswp__scroll-wrap');\n\t\tself.container = framework.getChildByClass(self.scrollWrap, 'pswp__container');\n\n\t\t_containerStyle = self.container.style; // for fast access\n\n\t\t// Objects that hold slides (there are only 3 in DOM)\n\t\tself.itemHolders = _itemHolders = [\n\t\t\t{el:self.container.children[0] , wrap:0, index: -1},\n\t\t\t{el:self.container.children[1] , wrap:0, index: -1},\n\t\t\t{el:self.container.children[2] , wrap:0, index: -1}\n\t\t];\n\n\t\t// hide nearby item holders until initial zoom animation finishes (to avoid extra Paints)\n\t\t_itemHolders[0].el.style.display = _itemHolders[2].el.style.display = 'none';\n\n\t\t_setupTransforms();\n\n\t\t// Setup global events\n\t\t_globalEventHandlers = {\n\t\t\tresize: self.updateSize,\n\n\t\t\t// Fixes: iOS 10.3 resize event\n\t\t\t// does not update scrollWrap.clientWidth instantly after resize\n\t\t\t// https://github.com/dimsemenov/PhotoSwipe/issues/1315\n\t\t\torientationchange: function() {\n\t\t\t\tclearTimeout(_orientationChangeTimeout);\n\t\t\t\t_orientationChangeTimeout = setTimeout(function() {\n\t\t\t\t\tif(_viewportSize.x !== self.scrollWrap.clientWidth) {\n\t\t\t\t\t\tself.updateSize();\n\t\t\t\t\t}\n\t\t\t\t}, 500);\n\t\t\t},\n\t\t\tscroll: _updatePageScrollOffset,\n\t\t\tkeydown: _onKeyDown,\n\t\t\tclick: _onGlobalClick\n\t\t};\n\n\t\t// disable show/hide effects on old browsers that don't support CSS animations or transforms, \n\t\t// old IOS, Android and Opera mobile. Blackberry seems to work fine, even older models.\n\t\tvar oldPhone = _features.isOldIOSPhone || _features.isOldAndroid || _features.isMobileOpera;\n\t\tif(!_features.animationName || !_features.transform || oldPhone) {\n\t\t\t_options.showAnimationDuration = _options.hideAnimationDuration = 0;\n\t\t}\n\n\t\t// init modules\n\t\tfor(i = 0; i < _modules.length; i++) {\n\t\t\tself['init' + _modules[i]]();\n\t\t}\n\t\t\n\t\t// init\n\t\tif(UiClass) {\n\t\t\tvar ui = self.ui = new UiClass(self, framework);\n\t\t\tui.init();\n\t\t}\n\n\t\t_shout('firstUpdate');\n\t\t_currentItemIndex = _currentItemIndex || _options.index || 0;\n\t\t// validate index\n\t\tif( isNaN(_currentItemIndex) || _currentItemIndex < 0 || _currentItemIndex >= _getNumItems() ) {\n\t\t\t_currentItemIndex = 0;\n\t\t}\n\t\tself.currItem = _getItemAt( _currentItemIndex );\n\n\t\t\n\t\tif(_features.isOldIOSPhone || _features.isOldAndroid) {\n\t\t\t_isFixedPosition = false;\n\t\t}\n\t\t\n\t\ttemplate.setAttribute('aria-hidden', 'false');\n\t\tif(_options.modal) {\n\t\t\tif(!_isFixedPosition) {\n\t\t\t\ttemplate.style.position = 'absolute';\n\t\t\t\ttemplate.style.top = framework.getScrollY() + 'px';\n\t\t\t} else {\n\t\t\t\ttemplate.style.position = 'fixed';\n\t\t\t}\n\t\t}\n\n\t\tif(_currentWindowScrollY === undefined) {\n\t\t\t_shout('initialLayout');\n\t\t\t_currentWindowScrollY = _initalWindowScrollY = framework.getScrollY();\n\t\t}\n\t\t\n\t\t// add classes to root element of PhotoSwipe\n\t\tvar rootClasses = 'pswp--open ';\n\t\tif(_options.mainClass) {\n\t\t\trootClasses += _options.mainClass + ' ';\n\t\t}\n\t\tif(_options.showHideOpacity) {\n\t\t\trootClasses += 'pswp--animate_opacity ';\n\t\t}\n\t\trootClasses += _likelyTouchDevice ? 'pswp--touch' : 'pswp--notouch';\n\t\trootClasses += _features.animationName ? ' pswp--css_animation' : '';\n\t\trootClasses += _features.svg ? ' pswp--svg' : '';\n\t\tframework.addClass(template, rootClasses);\n\n\t\tself.updateSize();\n\n\t\t// initial update\n\t\t_containerShiftIndex = -1;\n\t\t_indexDiff = null;\n\t\tfor(i = 0; i < NUM_HOLDERS; i++) {\n\t\t\t_setTranslateX( (i+_containerShiftIndex) * _slideSize.x, _itemHolders[i].el.style);\n\t\t}\n\n\t\tif(!_oldIE) {\n\t\t\tframework.bind(self.scrollWrap, _downEvents, self); // no dragging for old IE\n\t\t}\t\n\n\t\t_listen('initialZoomInEnd', function() {\n\t\t\tself.setContent(_itemHolders[0], _currentItemIndex-1);\n\t\t\tself.setContent(_itemHolders[2], _currentItemIndex+1);\n\n\t\t\t_itemHolders[0].el.style.display = _itemHolders[2].el.style.display = 'block';\n\n\t\t\tif(_options.focus) {\n\t\t\t\t// focus causes layout, \n\t\t\t\t// which causes lag during the animation, \n\t\t\t\t// that's why we delay it untill the initial zoom transition ends\n\t\t\t\ttemplate.focus();\n\t\t\t}\n\t\t\t \n\n\t\t\t_bindEvents();\n\t\t});\n\n\t\t// set content for center slide (first time)\n\t\tself.setContent(_itemHolders[1], _currentItemIndex);\n\t\t\n\t\tself.updateCurrItem();\n\n\t\t_shout('afterInit');\n\n\t\tif(!_isFixedPosition) {\n\n\t\t\t// On all versions of iOS lower than 8.0, we check size of viewport every second.\n\t\t\t// \n\t\t\t// This is done to detect when Safari top & bottom bars appear, \n\t\t\t// as this action doesn't trigger any events (like resize). \n\t\t\t// \n\t\t\t// On iOS8 they fixed this.\n\t\t\t// \n\t\t\t// 10 Nov 2014: iOS 7 usage ~40%. iOS 8 usage 56%.\n\t\t\t\n\t\t\t_updateSizeInterval = setInterval(function() {\n\t\t\t\tif(!_numAnimations && !_isDragging && !_isZooming && (_currZoomLevel === self.currItem.initialZoomLevel) ) {\n\t\t\t\t\tself.updateSize();\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\n\t\tframework.addClass(template, 'pswp--visible');\n\t},\n\n\t// Close the gallery, then destroy it\n\tclose: function() {\n\t\tif(!_isOpen) {\n\t\t\treturn;\n\t\t}\n\n\t\t_isOpen = false;\n\t\t_isDestroying = true;\n\t\t_shout('close');\n\t\t_unbindEvents();\n\n\t\t_showOrHide(self.currItem, null, true, self.destroy);\n\t},\n\n\t// destroys the gallery (unbinds events, cleans up intervals and timeouts to avoid memory leaks)\n\tdestroy: function() {\n\t\t_shout('destroy');\n\n\t\tif(_showOrHideTimeout) {\n\t\t\tclearTimeout(_showOrHideTimeout);\n\t\t}\n\t\t\n\t\ttemplate.setAttribute('aria-hidden', 'true');\n\t\ttemplate.className = _initalClassName;\n\n\t\tif(_updateSizeInterval) {\n\t\t\tclearInterval(_updateSizeInterval);\n\t\t}\n\n\t\tframework.unbind(self.scrollWrap, _downEvents, self);\n\n\t\t// we unbind scroll event at the end, as closing animation may depend on it\n\t\tframework.unbind(window, 'scroll', self);\n\n\t\t_stopDragUpdateLoop();\n\n\t\t_stopAllAnimations();\n\n\t\t_listeners = null;\n\t},\n\n\t/**\n\t * Pan image to position\n\t * @param {Number} x \n\t * @param {Number} y \n\t * @param {Boolean} force Will ignore bounds if set to true.\n\t */\n\tpanTo: function(x,y,force) {\n\t\tif(!force) {\n\t\t\tif(x > _currPanBounds.min.x) {\n\t\t\t\tx = _currPanBounds.min.x;\n\t\t\t} else if(x < _currPanBounds.max.x) {\n\t\t\t\tx = _currPanBounds.max.x;\n\t\t\t}\n\n\t\t\tif(y > _currPanBounds.min.y) {\n\t\t\t\ty = _currPanBounds.min.y;\n\t\t\t} else if(y < _currPanBounds.max.y) {\n\t\t\t\ty = _currPanBounds.max.y;\n\t\t\t}\n\t\t}\n\t\t\n\t\t_panOffset.x = x;\n\t\t_panOffset.y = y;\n\t\t_applyCurrentZoomPan();\n\t},\n\t\n\thandleEvent: function (e) {\n\t\te = e || window.event;\n\t\tif(_globalEventHandlers[e.type]) {\n\t\t\t_globalEventHandlers[e.type](e);\n\t\t}\n\t},\n\n\n\tgoTo: function(index) {\n\n\t\tindex = _getLoopedId(index);\n\n\t\tvar diff = index - _currentItemIndex;\n\t\t_indexDiff = diff;\n\n\t\t_currentItemIndex = index;\n\t\tself.currItem = _getItemAt( _currentItemIndex );\n\t\t_currPositionIndex -= diff;\n\t\t\n\t\t_moveMainScroll(_slideSize.x * _currPositionIndex);\n\t\t\n\n\t\t_stopAllAnimations();\n\t\t_mainScrollAnimating = false;\n\n\t\tself.updateCurrItem();\n\t},\n\tnext: function() {\n\t\tself.goTo( _currentItemIndex + 1);\n\t},\n\tprev: function() {\n\t\tself.goTo( _currentItemIndex - 1);\n\t},\n\n\t// update current zoom/pan objects\n\tupdateCurrZoomItem: function(emulateSetContent) {\n\t\tif(emulateSetContent) {\n\t\t\t_shout('beforeChange', 0);\n\t\t}\n\n\t\t// itemHolder[1] is middle (current) item\n\t\tif(_itemHolders[1].el.children.length) {\n\t\t\tvar zoomElement = _itemHolders[1].el.children[0];\n\t\t\tif( framework.hasClass(zoomElement, 'pswp__zoom-wrap') ) {\n\t\t\t\t_currZoomElementStyle = zoomElement.style;\n\t\t\t} else {\n\t\t\t\t_currZoomElementStyle = null;\n\t\t\t}\n\t\t} else {\n\t\t\t_currZoomElementStyle = null;\n\t\t}\n\t\t\n\t\t_currPanBounds = self.currItem.bounds;\t\n\t\t_startZoomLevel = _currZoomLevel = self.currItem.initialZoomLevel;\n\n\t\t_panOffset.x = _currPanBounds.center.x;\n\t\t_panOffset.y = _currPanBounds.center.y;\n\n\t\tif(emulateSetContent) {\n\t\t\t_shout('afterChange');\n\t\t}\n\t},\n\n\n\tinvalidateCurrItems: function() {\n\t\t_itemsNeedUpdate = true;\n\t\tfor(var i = 0; i < NUM_HOLDERS; i++) {\n\t\t\tif( _itemHolders[i].item ) {\n\t\t\t\t_itemHolders[i].item.needsUpdate = true;\n\t\t\t}\n\t\t}\n\t},\n\n\tupdateCurrItem: function(beforeAnimation) {\n\n\t\tif(_indexDiff === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar diffAbs = Math.abs(_indexDiff),\n\t\t\ttempHolder;\n\n\t\tif(beforeAnimation && diffAbs < 2) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tself.currItem = _getItemAt( _currentItemIndex );\n\t\t_renderMaxResolution = false;\n\t\t\n\t\t_shout('beforeChange', _indexDiff);\n\n\t\tif(diffAbs >= NUM_HOLDERS) {\n\t\t\t_containerShiftIndex += _indexDiff + (_indexDiff > 0 ? -NUM_HOLDERS : NUM_HOLDERS);\n\t\t\tdiffAbs = NUM_HOLDERS;\n\t\t}\n\t\tfor(var i = 0; i < diffAbs; i++) {\n\t\t\tif(_indexDiff > 0) {\n\t\t\t\ttempHolder = _itemHolders.shift();\n\t\t\t\t_itemHolders[NUM_HOLDERS-1] = tempHolder; // move first to last\n\n\t\t\t\t_containerShiftIndex++;\n\t\t\t\t_setTranslateX( (_containerShiftIndex+2) * _slideSize.x, tempHolder.el.style);\n\t\t\t\tself.setContent(tempHolder, _currentItemIndex - diffAbs + i + 1 + 1);\n\t\t\t} else {\n\t\t\t\ttempHolder = _itemHolders.pop();\n\t\t\t\t_itemHolders.unshift( tempHolder ); // move last to first\n\n\t\t\t\t_containerShiftIndex--;\n\t\t\t\t_setTranslateX( _containerShiftIndex * _slideSize.x, tempHolder.el.style);\n\t\t\t\tself.setContent(tempHolder, _currentItemIndex + diffAbs - i - 1 - 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// reset zoom/pan on previous item\n\t\tif(_currZoomElementStyle && Math.abs(_indexDiff) === 1) {\n\n\t\t\tvar prevItem = _getItemAt(_prevItemIndex);\n\t\t\tif(prevItem.initialZoomLevel !== _currZoomLevel) {\n\t\t\t\t_calculateItemSize(prevItem , _viewportSize );\n\t\t\t\t_setImageSize(prevItem);\n\t\t\t\t_applyZoomPanToItem( prevItem ); \t\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\t// reset diff after update\n\t\t_indexDiff = 0;\n\n\t\tself.updateCurrZoomItem();\n\n\t\t_prevItemIndex = _currentItemIndex;\n\n\t\t_shout('afterChange');\n\t\t\n\t},\n\n\n\n\tupdateSize: function(force) {\n\t\t\n\t\tif(!_isFixedPosition && _options.modal) {\n\t\t\tvar windowScrollY = framework.getScrollY();\n\t\t\tif(_currentWindowScrollY !== windowScrollY) {\n\t\t\t\ttemplate.style.top = windowScrollY + 'px';\n\t\t\t\t_currentWindowScrollY = windowScrollY;\n\t\t\t}\n\t\t\tif(!force && _windowVisibleSize.x === window.innerWidth && _windowVisibleSize.y === window.innerHeight) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t_windowVisibleSize.x = window.innerWidth;\n\t\t\t_windowVisibleSize.y = window.innerHeight;\n\n\t\t\t//template.style.width = _windowVisibleSize.x + 'px';\n\t\t\ttemplate.style.height = _windowVisibleSize.y + 'px';\n\t\t}\n\n\n\n\t\t_viewportSize.x = self.scrollWrap.clientWidth;\n\t\t_viewportSize.y = self.scrollWrap.clientHeight;\n\n\t\t_updatePageScrollOffset();\n\n\t\t_slideSize.x = _viewportSize.x + Math.round(_viewportSize.x * _options.spacing);\n\t\t_slideSize.y = _viewportSize.y;\n\n\t\t_moveMainScroll(_slideSize.x * _currPositionIndex);\n\n\t\t_shout('beforeResize'); // even may be used for example to switch image sources\n\n\n\t\t// don't re-calculate size on inital size update\n\t\tif(_containerShiftIndex !== undefined) {\n\n\t\t\tvar holder,\n\t\t\t\titem,\n\t\t\t\thIndex;\n\n\t\t\tfor(var i = 0; i < NUM_HOLDERS; i++) {\n\t\t\t\tholder = _itemHolders[i];\n\t\t\t\t_setTranslateX( (i+_containerShiftIndex) * _slideSize.x, holder.el.style);\n\n\t\t\t\thIndex = _currentItemIndex+i-1;\n\n\t\t\t\tif(_options.loop && _getNumItems() > 2) {\n\t\t\t\t\thIndex = _getLoopedId(hIndex);\n\t\t\t\t}\n\n\t\t\t\t// update zoom level on items and refresh source (if needsUpdate)\n\t\t\t\titem = _getItemAt( hIndex );\n\n\t\t\t\t// re-render gallery item if `needsUpdate`,\n\t\t\t\t// or doesn't have `bounds` (entirely new slide object)\n\t\t\t\tif( item && (_itemsNeedUpdate || item.needsUpdate || !item.bounds) ) {\n\n\t\t\t\t\tself.cleanSlide( item );\n\t\t\t\t\t\n\t\t\t\t\tself.setContent( holder, hIndex );\n\n\t\t\t\t\t// if \"center\" slide\n\t\t\t\t\tif(i === 1) {\n\t\t\t\t\t\tself.currItem = item;\n\t\t\t\t\t\tself.updateCurrZoomItem(true);\n\t\t\t\t\t}\n\n\t\t\t\t\titem.needsUpdate = false;\n\n\t\t\t\t} else if(holder.index === -1 && hIndex >= 0) {\n\t\t\t\t\t// add content first time\n\t\t\t\t\tself.setContent( holder, hIndex );\n\t\t\t\t}\n\t\t\t\tif(item && item.container) {\n\t\t\t\t\t_calculateItemSize(item, _viewportSize);\n\t\t\t\t\t_setImageSize(item);\n\t\t\t\t\t_applyZoomPanToItem( item );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t_itemsNeedUpdate = false;\n\t\t}\t\n\n\t\t_startZoomLevel = _currZoomLevel = self.currItem.initialZoomLevel;\n\t\t_currPanBounds = self.currItem.bounds;\n\n\t\tif(_currPanBounds) {\n\t\t\t_panOffset.x = _currPanBounds.center.x;\n\t\t\t_panOffset.y = _currPanBounds.center.y;\n\t\t\t_applyCurrentZoomPan( true );\n\t\t}\n\t\t\n\t\t_shout('resize');\n\t},\n\t\n\t// Zoom current item to\n\tzoomTo: function(destZoomLevel, centerPoint, speed, easingFn, updateFn) {\n\t\t/*\n\t\t\tif(destZoomLevel === 'fit') {\n\t\t\t\tdestZoomLevel = self.currItem.fitRatio;\n\t\t\t} else if(destZoomLevel === 'fill') {\n\t\t\t\tdestZoomLevel = self.currItem.fillRatio;\n\t\t\t}\n\t\t*/\n\n\t\tif(centerPoint) {\n\t\t\t_startZoomLevel = _currZoomLevel;\n\t\t\t_midZoomPoint.x = Math.abs(centerPoint.x) - _panOffset.x ;\n\t\t\t_midZoomPoint.y = Math.abs(centerPoint.y) - _panOffset.y ;\n\t\t\t_equalizePoints(_startPanOffset, _panOffset);\n\t\t}\n\n\t\tvar destPanBounds = _calculatePanBounds(destZoomLevel, false),\n\t\t\tdestPanOffset = {};\n\n\t\t_modifyDestPanOffset('x', destPanBounds, destPanOffset, destZoomLevel);\n\t\t_modifyDestPanOffset('y', destPanBounds, destPanOffset, destZoomLevel);\n\n\t\tvar initialZoomLevel = _currZoomLevel;\n\t\tvar initialPanOffset = {\n\t\t\tx: _panOffset.x,\n\t\t\ty: _panOffset.y\n\t\t};\n\n\t\t_roundPoint(destPanOffset);\n\n\t\tvar onUpdate = function(now) {\n\t\t\tif(now === 1) {\n\t\t\t\t_currZoomLevel = destZoomLevel;\n\t\t\t\t_panOffset.x = destPanOffset.x;\n\t\t\t\t_panOffset.y = destPanOffset.y;\n\t\t\t} else {\n\t\t\t\t_currZoomLevel = (destZoomLevel - initialZoomLevel) * now + initialZoomLevel;\n\t\t\t\t_panOffset.x = (destPanOffset.x - initialPanOffset.x) * now + initialPanOffset.x;\n\t\t\t\t_panOffset.y = (destPanOffset.y - initialPanOffset.y) * now + initialPanOffset.y;\n\t\t\t}\n\n\t\t\tif(updateFn) {\n\t\t\t\tupdateFn(now);\n\t\t\t}\n\n\t\t\t_applyCurrentZoomPan( now === 1 );\n\t\t};\n\n\t\tif(speed) {\n\t\t\t_animateProp('customZoomTo', 0, 1, speed, easingFn || framework.easing.sine.inOut, onUpdate);\n\t\t} else {\n\t\t\tonUpdate(1);\n\t\t}\n\t}\n\n\n};\n\n\n/*>>core*/\n\n/*>>gestures*/\n/**\n * Mouse/touch/pointer event handlers.\n * \n * separated from @core.js for readability\n */\n\nvar MIN_SWIPE_DISTANCE = 30,\n\tDIRECTION_CHECK_OFFSET = 10; // amount of pixels to drag to determine direction of swipe\n\nvar _gestureStartTime,\n\t_gestureCheckSpeedTime,\n\n\t// pool of objects that are used during dragging of zooming\n\tp = {}, // first point\n\tp2 = {}, // second point (for zoom gesture)\n\tdelta = {},\n\t_currPoint = {},\n\t_startPoint = {},\n\t_currPointers = [],\n\t_startMainScrollPos = {},\n\t_releaseAnimData,\n\t_posPoints = [], // array of points during dragging, used to determine type of gesture\n\t_tempPoint = {},\n\n\t_isZoomingIn,\n\t_verticalDragInitiated,\n\t_oldAndroidTouchEndTimeout,\n\t_currZoomedItemIndex = 0,\n\t_centerPoint = _getEmptyPoint(),\n\t_lastReleaseTime = 0,\n\t_isDragging, // at least one pointer is down\n\t_isMultitouch, // at least two _pointers are down\n\t_zoomStarted, // zoom level changed during zoom gesture\n\t_moved,\n\t_dragAnimFrame,\n\t_mainScrollShifted,\n\t_currentPoints, // array of current touch points\n\t_isZooming,\n\t_currPointsDistance,\n\t_startPointsDistance,\n\t_currPanBounds,\n\t_mainScrollPos = _getEmptyPoint(),\n\t_currZoomElementStyle,\n\t_mainScrollAnimating, // true, if animation after swipe gesture is running\n\t_midZoomPoint = _getEmptyPoint(),\n\t_currCenterPoint = _getEmptyPoint(),\n\t_direction,\n\t_isFirstMove,\n\t_opacityChanged,\n\t_bgOpacity,\n\t_wasOverInitialZoom,\n\n\t_isEqualPoints = function(p1, p2) {\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\t},\n\t_isNearbyPoints = function(touch0, touch1) {\n\t\treturn Math.abs(touch0.x - touch1.x) < DOUBLE_TAP_RADIUS && Math.abs(touch0.y - touch1.y) < DOUBLE_TAP_RADIUS;\n\t},\n\t_calculatePointsDistance = function(p1, p2) {\n\t\t_tempPoint.x = Math.abs( p1.x - p2.x );\n\t\t_tempPoint.y = Math.abs( p1.y - p2.y );\n\t\treturn Math.sqrt(_tempPoint.x * _tempPoint.x + _tempPoint.y * _tempPoint.y);\n\t},\n\t_stopDragUpdateLoop = function() {\n\t\tif(_dragAnimFrame) {\n\t\t\t_cancelAF(_dragAnimFrame);\n\t\t\t_dragAnimFrame = null;\n\t\t}\n\t},\n\t_dragUpdateLoop = function() {\n\t\tif(_isDragging) {\n\t\t\t_dragAnimFrame = _requestAF(_dragUpdateLoop);\n\t\t\t_renderMovement();\n\t\t}\n\t},\n\t_canPan = function() {\n\t\treturn !(_options.scaleMode === 'fit' && _currZoomLevel === self.currItem.initialZoomLevel);\n\t},\n\t\n\t// find the closest parent DOM element\n\t_closestElement = function(el, fn) {\n\t \tif(!el || el === document) {\n\t \t\treturn false;\n\t \t}\n\n\t \t// don't search elements above pswp__scroll-wrap\n\t \tif(el.getAttribute('class') && el.getAttribute('class').indexOf('pswp__scroll-wrap') > -1 ) {\n\t \t\treturn false;\n\t \t}\n\n\t \tif( fn(el) ) {\n\t \t\treturn el;\n\t \t}\n\n\t \treturn _closestElement(el.parentNode, fn);\n\t},\n\n\t_preventObj = {},\n\t_preventDefaultEventBehaviour = function(e, isDown) {\n\t _preventObj.prevent = !_closestElement(e.target, _options.isClickableElement);\n\n\t\t_shout('preventDragEvent', e, isDown, _preventObj);\n\t\treturn _preventObj.prevent;\n\n\t},\n\t_convertTouchToPoint = function(touch, p) {\n\t\tp.x = touch.pageX;\n\t\tp.y = touch.pageY;\n\t\tp.id = touch.identifier;\n\t\treturn p;\n\t},\n\t_findCenterOfPoints = function(p1, p2, pCenter) {\n\t\tpCenter.x = (p1.x + p2.x) * 0.5;\n\t\tpCenter.y = (p1.y + p2.y) * 0.5;\n\t},\n\t_pushPosPoint = function(time, x, y) {\n\t\tif(time - _gestureCheckSpeedTime > 50) {\n\t\t\tvar o = _posPoints.length > 2 ? _posPoints.shift() : {};\n\t\t\to.x = x;\n\t\t\to.y = y; \n\t\t\t_posPoints.push(o);\n\t\t\t_gestureCheckSpeedTime = time;\n\t\t}\n\t},\n\n\t_calculateVerticalDragOpacityRatio = function() {\n\t\tvar yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position\n\t\treturn 1 - Math.abs( yOffset / (_viewportSize.y / 2) );\n\t},\n\n\t\n\t// points pool, reused during touch events\n\t_ePoint1 = {},\n\t_ePoint2 = {},\n\t_tempPointsArr = [],\n\t_tempCounter,\n\t_getTouchPoints = function(e) {\n\t\t// clean up previous points, without recreating array\n\t\twhile(_tempPointsArr.length > 0) {\n\t\t\t_tempPointsArr.pop();\n\t\t}\n\n\t\tif(!_pointerEventEnabled) {\n\t\t\tif(e.type.indexOf('touch') > -1) {\n\n\t\t\t\tif(e.touches && e.touches.length > 0) {\n\t\t\t\t\t_tempPointsArr[0] = _convertTouchToPoint(e.touches[0], _ePoint1);\n\t\t\t\t\tif(e.touches.length > 1) {\n\t\t\t\t\t\t_tempPointsArr[1] = _convertTouchToPoint(e.touches[1], _ePoint2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t_ePoint1.x = e.pageX;\n\t\t\t\t_ePoint1.y = e.pageY;\n\t\t\t\t_ePoint1.id = '';\n\t\t\t\t_tempPointsArr[0] = _ePoint1;//_ePoint1;\n\t\t\t}\n\t\t} else {\n\t\t\t_tempCounter = 0;\n\t\t\t// we can use forEach, as pointer events are supported only in modern browsers\n\t\t\t_currPointers.forEach(function(p) {\n\t\t\t\tif(_tempCounter === 0) {\n\t\t\t\t\t_tempPointsArr[0] = p;\n\t\t\t\t} else if(_tempCounter === 1) {\n\t\t\t\t\t_tempPointsArr[1] = p;\n\t\t\t\t}\n\t\t\t\t_tempCounter++;\n\n\t\t\t});\n\t\t}\n\t\treturn _tempPointsArr;\n\t},\n\n\t_panOrMoveMainScroll = function(axis, delta) {\n\n\t\tvar panFriction,\n\t\t\toverDiff = 0,\n\t\t\tnewOffset = _panOffset[axis] + delta[axis],\n\t\t\tstartOverDiff,\n\t\t\tdir = delta[axis] > 0,\n\t\t\tnewMainScrollPosition = _mainScrollPos.x + delta.x,\n\t\t\tmainScrollDiff = _mainScrollPos.x - _startMainScrollPos.x,\n\t\t\tnewPanPos,\n\t\t\tnewMainScrollPos;\n\n\t\t// calculate fdistance over the bounds and friction\n\t\tif(newOffset > _currPanBounds.min[axis] || newOffset < _currPanBounds.max[axis]) {\n\t\t\tpanFriction = _options.panEndFriction;\n\t\t\t// Linear increasing of friction, so at 1/4 of viewport it's at max value. \n\t\t\t// Looks not as nice as was expected. Left for history.\n\t\t\t// panFriction = (1 - (_panOffset[axis] + delta[axis] + panBounds.min[axis]) / (_viewportSize[axis] / 4) );\n\t\t} else {\n\t\t\tpanFriction = 1;\n\t\t}\n\t\t\n\t\tnewOffset = _panOffset[axis] + delta[axis] * panFriction;\n\n\t\t// move main scroll or start panning\n\t\tif(_options.allowPanToNext || _currZoomLevel === self.currItem.initialZoomLevel) {\n\n\n\t\t\tif(!_currZoomElementStyle) {\n\t\t\t\t\n\t\t\t\tnewMainScrollPos = newMainScrollPosition;\n\n\t\t\t} else if(_direction === 'h' && axis === 'x' && !_zoomStarted ) {\n\t\t\t\t\n\t\t\t\tif(dir) {\n\t\t\t\t\tif(newOffset > _currPanBounds.min[axis]) {\n\t\t\t\t\t\tpanFriction = _options.panEndFriction;\n\t\t\t\t\t\toverDiff = _currPanBounds.min[axis] - newOffset;\n\t\t\t\t\t\tstartOverDiff = _currPanBounds.min[axis] - _startPanOffset[axis];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// drag right\n\t\t\t\t\tif( (startOverDiff <= 0 || mainScrollDiff < 0) && _getNumItems() > 1 ) {\n\t\t\t\t\t\tnewMainScrollPos = newMainScrollPosition;\n\t\t\t\t\t\tif(mainScrollDiff < 0 && newMainScrollPosition > _startMainScrollPos.x) {\n\t\t\t\t\t\t\tnewMainScrollPos = _startMainScrollPos.x;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(_currPanBounds.min.x !== _currPanBounds.max.x) {\n\t\t\t\t\t\t\tnewPanPos = newOffset;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif(newOffset < _currPanBounds.max[axis] ) {\n\t\t\t\t\t\tpanFriction =_options.panEndFriction;\n\t\t\t\t\t\toverDiff = newOffset - _currPanBounds.max[axis];\n\t\t\t\t\t\tstartOverDiff = _startPanOffset[axis] - _currPanBounds.max[axis];\n\t\t\t\t\t}\n\n\t\t\t\t\tif( (startOverDiff <= 0 || mainScrollDiff > 0) && _getNumItems() > 1 ) {\n\t\t\t\t\t\tnewMainScrollPos = newMainScrollPosition;\n\n\t\t\t\t\t\tif(mainScrollDiff > 0 && newMainScrollPosition < _startMainScrollPos.x) {\n\t\t\t\t\t\t\tnewMainScrollPos = _startMainScrollPos.x;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(_currPanBounds.min.x !== _currPanBounds.max.x) {\n\t\t\t\t\t\t\tnewPanPos = newOffset;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//\n\t\t\t}\n\n\t\t\tif(axis === 'x') {\n\n\t\t\t\tif(newMainScrollPos !== undefined) {\n\t\t\t\t\t_moveMainScroll(newMainScrollPos, true);\n\t\t\t\t\tif(newMainScrollPos === _startMainScrollPos.x) {\n\t\t\t\t\t\t_mainScrollShifted = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_mainScrollShifted = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(_currPanBounds.min.x !== _currPanBounds.max.x) {\n\t\t\t\t\tif(newPanPos !== undefined) {\n\t\t\t\t\t\t_panOffset.x = newPanPos;\n\t\t\t\t\t} else if(!_mainScrollShifted) {\n\t\t\t\t\t\t_panOffset.x += delta.x * panFriction;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn newMainScrollPos !== undefined;\n\t\t\t}\n\n\t\t}\n\n\t\tif(!_mainScrollAnimating) {\n\t\t\t\n\t\t\tif(!_mainScrollShifted) {\n\t\t\t\tif(_currZoomLevel > self.currItem.fitRatio) {\n\t\t\t\t\t_panOffset[axis] += delta[axis] * panFriction;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t},\n\n\t// Pointerdown/touchstart/mousedown handler\n\t_onDragStart = function(e) {\n\n\t\t// Allow dragging only via left mouse button.\n\t\t// As this handler is not added in IE8 - we ignore e.which\n\t\t// \n\t\t// http://www.quirksmode.org/js/events_properties.html\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/event.button\n\t\tif(e.type === 'mousedown' && e.button > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(_initialZoomRunning) {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif(_oldAndroidTouchEndTimeout && e.type === 'mousedown') {\n\t\t\treturn;\n\t\t}\n\n\t\tif(_preventDefaultEventBehaviour(e, true)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\n\n\t\t_shout('pointerDown');\n\n\t\tif(_pointerEventEnabled) {\n\t\t\tvar pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id');\n\t\t\tif(pointerIndex < 0) {\n\t\t\t\tpointerIndex = _currPointers.length;\n\t\t\t}\n\t\t\t_currPointers[pointerIndex] = {x:e.pageX, y:e.pageY, id: e.pointerId};\n\t\t}\n\t\t\n\n\n\t\tvar startPointsList = _getTouchPoints(e),\n\t\t\tnumPoints = startPointsList.length;\n\n\t\t_currentPoints = null;\n\n\t\t_stopAllAnimations();\n\n\t\t// init drag\n\t\tif(!_isDragging || numPoints === 1) {\n\n\t\t\t\n\n\t\t\t_isDragging = _isFirstMove = true;\n\t\t\tframework.bind(window, _upMoveEvents, self);\n\n\t\t\t_isZoomingIn = \n\t\t\t\t_wasOverInitialZoom = \n\t\t\t\t_opacityChanged = \n\t\t\t\t_verticalDragInitiated = \n\t\t\t\t_mainScrollShifted = \n\t\t\t\t_moved = \n\t\t\t\t_isMultitouch = \n\t\t\t\t_zoomStarted = false;\n\n\t\t\t_direction = null;\n\n\t\t\t_shout('firstTouchStart', startPointsList);\n\n\t\t\t_equalizePoints(_startPanOffset, _panOffset);\n\n\t\t\t_currPanDist.x = _currPanDist.y = 0;\n\t\t\t_equalizePoints(_currPoint, startPointsList[0]);\n\t\t\t_equalizePoints(_startPoint, _currPoint);\n\n\t\t\t//_equalizePoints(_startMainScrollPos, _mainScrollPos);\n\t\t\t_startMainScrollPos.x = _slideSize.x * _currPositionIndex;\n\n\t\t\t_posPoints = [{\n\t\t\t\tx: _currPoint.x,\n\t\t\t\ty: _currPoint.y\n\t\t\t}];\n\n\t\t\t_gestureCheckSpeedTime = _gestureStartTime = _getCurrentTime();\n\n\t\t\t//_mainScrollAnimationEnd(true);\n\t\t\t_calculatePanBounds( _currZoomLevel, true );\n\t\t\t\n\t\t\t// Start rendering\n\t\t\t_stopDragUpdateLoop();\n\t\t\t_dragUpdateLoop();\n\t\t\t\n\t\t}\n\n\t\t// init zoom\n\t\tif(!_isZooming && numPoints > 1 && !_mainScrollAnimating && !_mainScrollShifted) {\n\t\t\t_startZoomLevel = _currZoomLevel;\n\t\t\t_zoomStarted = false; // true if zoom changed at least once\n\n\t\t\t_isZooming = _isMultitouch = true;\n\t\t\t_currPanDist.y = _currPanDist.x = 0;\n\n\t\t\t_equalizePoints(_startPanOffset, _panOffset);\n\n\t\t\t_equalizePoints(p, startPointsList[0]);\n\t\t\t_equalizePoints(p2, startPointsList[1]);\n\n\t\t\t_findCenterOfPoints(p, p2, _currCenterPoint);\n\n\t\t\t_midZoomPoint.x = Math.abs(_currCenterPoint.x) - _panOffset.x;\n\t\t\t_midZoomPoint.y = Math.abs(_currCenterPoint.y) - _panOffset.y;\n\t\t\t_currPointsDistance = _startPointsDistance = _calculatePointsDistance(p, p2);\n\t\t}\n\n\n\t},\n\n\t// Pointermove/touchmove/mousemove handler\n\t_onDragMove = function(e) {\n\n\t\te.preventDefault();\n\n\t\tif(_pointerEventEnabled) {\n\t\t\tvar pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id');\n\t\t\tif(pointerIndex > -1) {\n\t\t\t\tvar p = _currPointers[pointerIndex];\n\t\t\t\tp.x = e.pageX;\n\t\t\t\tp.y = e.pageY; \n\t\t\t}\n\t\t}\n\n\t\tif(_isDragging) {\n\t\t\tvar touchesList = _getTouchPoints(e);\n\t\t\tif(!_direction && !_moved && !_isZooming) {\n\n\t\t\t\tif(_mainScrollPos.x !== _slideSize.x * _currPositionIndex) {\n\t\t\t\t\t// if main scroll position is shifted – direction is always horizontal\n\t\t\t\t\t_direction = 'h';\n\t\t\t\t} else {\n\t\t\t\t\tvar diff = Math.abs(touchesList[0].x - _currPoint.x) - Math.abs(touchesList[0].y - _currPoint.y);\n\t\t\t\t\t// check the direction of movement\n\t\t\t\t\tif(Math.abs(diff) >= DIRECTION_CHECK_OFFSET) {\n\t\t\t\t\t\t_direction = diff > 0 ? 'h' : 'v';\n\t\t\t\t\t\t_currentPoints = touchesList;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t_currentPoints = touchesList;\n\t\t\t}\n\t\t}\t\n\t},\n\t// \n\t_renderMovement = function() {\n\n\t\tif(!_currentPoints) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar numPoints = _currentPoints.length;\n\n\t\tif(numPoints === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t_equalizePoints(p, _currentPoints[0]);\n\n\t\tdelta.x = p.x - _currPoint.x;\n\t\tdelta.y = p.y - _currPoint.y;\n\n\t\tif(_isZooming && numPoints > 1) {\n\t\t\t// Handle behaviour for more than 1 point\n\n\t\t\t_currPoint.x = p.x;\n\t\t\t_currPoint.y = p.y;\n\t\t\n\t\t\t// check if one of two points changed\n\t\t\tif( !delta.x && !delta.y && _isEqualPoints(_currentPoints[1], p2) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_equalizePoints(p2, _currentPoints[1]);\n\n\n\t\t\tif(!_zoomStarted) {\n\t\t\t\t_zoomStarted = true;\n\t\t\t\t_shout('zoomGestureStarted');\n\t\t\t}\n\t\t\t\n\t\t\t// Distance between two points\n\t\t\tvar pointsDistance = _calculatePointsDistance(p,p2);\n\n\t\t\tvar zoomLevel = _calculateZoomLevel(pointsDistance);\n\n\t\t\t// slightly over the of initial zoom level\n\t\t\tif(zoomLevel > self.currItem.initialZoomLevel + self.currItem.initialZoomLevel / 15) {\n\t\t\t\t_wasOverInitialZoom = true;\n\t\t\t}\n\n\t\t\t// Apply the friction if zoom level is out of the bounds\n\t\t\tvar zoomFriction = 1,\n\t\t\t\tminZoomLevel = _getMinZoomLevel(),\n\t\t\t\tmaxZoomLevel = _getMaxZoomLevel();\n\n\t\t\tif ( zoomLevel < minZoomLevel ) {\n\t\t\t\t\n\t\t\t\tif(_options.pinchToClose && !_wasOverInitialZoom && _startZoomLevel <= self.currItem.initialZoomLevel) {\n\t\t\t\t\t// fade out background if zooming out\n\t\t\t\t\tvar minusDiff = minZoomLevel - zoomLevel;\n\t\t\t\t\tvar percent = 1 - minusDiff / (minZoomLevel / 1.2);\n\n\t\t\t\t\t_applyBgOpacity(percent);\n\t\t\t\t\t_shout('onPinchClose', percent);\n\t\t\t\t\t_opacityChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tzoomFriction = (minZoomLevel - zoomLevel) / minZoomLevel;\n\t\t\t\t\tif(zoomFriction > 1) {\n\t\t\t\t\t\tzoomFriction = 1;\n\t\t\t\t\t}\n\t\t\t\t\tzoomLevel = minZoomLevel - zoomFriction * (minZoomLevel / 3);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ( zoomLevel > maxZoomLevel ) {\n\t\t\t\t// 1.5 - extra zoom level above the max. E.g. if max is x6, real max 6 + 1.5 = 7.5\n\t\t\t\tzoomFriction = (zoomLevel - maxZoomLevel) / ( minZoomLevel * 6 );\n\t\t\t\tif(zoomFriction > 1) {\n\t\t\t\t\tzoomFriction = 1;\n\t\t\t\t}\n\t\t\t\tzoomLevel = maxZoomLevel + zoomFriction * minZoomLevel;\n\t\t\t}\n\n\t\t\tif(zoomFriction < 0) {\n\t\t\t\tzoomFriction = 0;\n\t\t\t}\n\n\t\t\t// distance between touch points after friction is applied\n\t\t\t_currPointsDistance = pointsDistance;\n\n\t\t\t// _centerPoint - The point in the middle of two pointers\n\t\t\t_findCenterOfPoints(p, p2, _centerPoint);\n\t\t\n\t\t\t// paning with two pointers pressed\n\t\t\t_currPanDist.x += _centerPoint.x - _currCenterPoint.x;\n\t\t\t_currPanDist.y += _centerPoint.y - _currCenterPoint.y;\n\t\t\t_equalizePoints(_currCenterPoint, _centerPoint);\n\n\t\t\t_panOffset.x = _calculatePanOffset('x', zoomLevel);\n\t\t\t_panOffset.y = _calculatePanOffset('y', zoomLevel);\n\n\t\t\t_isZoomingIn = zoomLevel > _currZoomLevel;\n\t\t\t_currZoomLevel = zoomLevel;\n\t\t\t_applyCurrentZoomPan();\n\n\t\t} else {\n\n\t\t\t// handle behaviour for one point (dragging or panning)\n\n\t\t\tif(!_direction) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(_isFirstMove) {\n\t\t\t\t_isFirstMove = false;\n\n\t\t\t\t// subtract drag distance that was used during the detection direction \n\n\t\t\t\tif( Math.abs(delta.x) >= DIRECTION_CHECK_OFFSET) {\n\t\t\t\t\tdelta.x -= _currentPoints[0].x - _startPoint.x;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( Math.abs(delta.y) >= DIRECTION_CHECK_OFFSET) {\n\t\t\t\t\tdelta.y -= _currentPoints[0].y - _startPoint.y;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_currPoint.x = p.x;\n\t\t\t_currPoint.y = p.y;\n\n\t\t\t// do nothing if pointers position hasn't changed\n\t\t\tif(delta.x === 0 && delta.y === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(_direction === 'v' && _options.closeOnVerticalDrag) {\n\t\t\t\tif(!_canPan()) {\n\t\t\t\t\t_currPanDist.y += delta.y;\n\t\t\t\t\t_panOffset.y += delta.y;\n\n\t\t\t\t\tvar opacityRatio = _calculateVerticalDragOpacityRatio();\n\n\t\t\t\t\t_verticalDragInitiated = true;\n\t\t\t\t\t_shout('onVerticalDrag', opacityRatio);\n\n\t\t\t\t\t_applyBgOpacity(opacityRatio);\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_pushPosPoint(_getCurrentTime(), p.x, p.y);\n\n\t\t\t_moved = true;\n\t\t\t_currPanBounds = self.currItem.bounds;\n\t\t\t\n\t\t\tvar mainScrollChanged = _panOrMoveMainScroll('x', delta);\n\t\t\tif(!mainScrollChanged) {\n\t\t\t\t_panOrMoveMainScroll('y', delta);\n\n\t\t\t\t_roundPoint(_panOffset);\n\t\t\t\t_applyCurrentZoomPan();\n\t\t\t}\n\n\t\t}\n\n\t},\n\t\n\t// Pointerup/pointercancel/touchend/touchcancel/mouseup event handler\n\t_onDragRelease = function(e) {\n\n\t\tif(_features.isOldAndroid ) {\n\n\t\t\tif(_oldAndroidTouchEndTimeout && e.type === 'mouseup') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// on Android (v4.1, 4.2, 4.3 & possibly older) \n\t\t\t// ghost mousedown/up event isn't preventable via e.preventDefault,\n\t\t\t// which causes fake mousedown event\n\t\t\t// so we block mousedown/up for 600ms\n\t\t\tif( e.type.indexOf('touch') > -1 ) {\n\t\t\t\tclearTimeout(_oldAndroidTouchEndTimeout);\n\t\t\t\t_oldAndroidTouchEndTimeout = setTimeout(function() {\n\t\t\t\t\t_oldAndroidTouchEndTimeout = 0;\n\t\t\t\t}, 600);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t_shout('pointerUp');\n\n\t\tif(_preventDefaultEventBehaviour(e, false)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar releasePoint;\n\n\t\tif(_pointerEventEnabled) {\n\t\t\tvar pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id');\n\t\t\t\n\t\t\tif(pointerIndex > -1) {\n\t\t\t\treleasePoint = _currPointers.splice(pointerIndex, 1)[0];\n\n\t\t\t\tif(navigator.pointerEnabled) {\n\t\t\t\t\treleasePoint.type = e.pointerType || 'mouse';\n\t\t\t\t} else {\n\t\t\t\t\tvar MSPOINTER_TYPES = {\n\t\t\t\t\t\t4: 'mouse', // event.MSPOINTER_TYPE_MOUSE\n\t\t\t\t\t\t2: 'touch', // event.MSPOINTER_TYPE_TOUCH \n\t\t\t\t\t\t3: 'pen' // event.MSPOINTER_TYPE_PEN\n\t\t\t\t\t};\n\t\t\t\t\treleasePoint.type = MSPOINTER_TYPES[e.pointerType];\n\n\t\t\t\t\tif(!releasePoint.type) {\n\t\t\t\t\t\treleasePoint.type = e.pointerType || 'mouse';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tvar touchList = _getTouchPoints(e),\n\t\t\tgestureType,\n\t\t\tnumPoints = touchList.length;\n\n\t\tif(e.type === 'mouseup') {\n\t\t\tnumPoints = 0;\n\t\t}\n\n\t\t// Do nothing if there were 3 touch points or more\n\t\tif(numPoints === 2) {\n\t\t\t_currentPoints = null;\n\t\t\treturn true;\n\t\t}\n\n\t\t// if second pointer released\n\t\tif(numPoints === 1) {\n\t\t\t_equalizePoints(_startPoint, touchList[0]);\n\t\t}\t\t\t\t\n\n\n\t\t// pointer hasn't moved, send \"tap release\" point\n\t\tif(numPoints === 0 && !_direction && !_mainScrollAnimating) {\n\t\t\tif(!releasePoint) {\n\t\t\t\tif(e.type === 'mouseup') {\n\t\t\t\t\treleasePoint = {x: e.pageX, y: e.pageY, type:'mouse'};\n\t\t\t\t} else if(e.changedTouches && e.changedTouches[0]) {\n\t\t\t\t\treleasePoint = {x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY, type:'touch'};\n\t\t\t\t}\t\t\n\t\t\t}\n\n\t\t\t_shout('touchRelease', e, releasePoint);\n\t\t}\n\n\t\t// Difference in time between releasing of two last touch points (zoom gesture)\n\t\tvar releaseTimeDiff = -1;\n\n\t\t// Gesture completed, no pointers left\n\t\tif(numPoints === 0) {\n\t\t\t_isDragging = false;\n\t\t\tframework.unbind(window, _upMoveEvents, self);\n\n\t\t\t_stopDragUpdateLoop();\n\n\t\t\tif(_isZooming) {\n\t\t\t\t// Two points released at the same time\n\t\t\t\treleaseTimeDiff = 0;\n\t\t\t} else if(_lastReleaseTime !== -1) {\n\t\t\t\treleaseTimeDiff = _getCurrentTime() - _lastReleaseTime;\n\t\t\t}\n\t\t}\n\t\t_lastReleaseTime = numPoints === 1 ? _getCurrentTime() : -1;\n\t\t\n\t\tif(releaseTimeDiff !== -1 && releaseTimeDiff < 150) {\n\t\t\tgestureType = 'zoom';\n\t\t} else {\n\t\t\tgestureType = 'swipe';\n\t\t}\n\n\t\tif(_isZooming && numPoints < 2) {\n\t\t\t_isZooming = false;\n\n\t\t\t// Only second point released\n\t\t\tif(numPoints === 1) {\n\t\t\t\tgestureType = 'zoomPointerUp';\n\t\t\t}\n\t\t\t_shout('zoomGestureEnded');\n\t\t}\n\n\t\t_currentPoints = null;\n\t\tif(!_moved && !_zoomStarted && !_mainScrollAnimating && !_verticalDragInitiated) {\n\t\t\t// nothing to animate\n\t\t\treturn;\n\t\t}\n\t\n\t\t_stopAllAnimations();\n\n\t\t\n\t\tif(!_releaseAnimData) {\n\t\t\t_releaseAnimData = _initDragReleaseAnimationData();\n\t\t}\n\t\t\n\t\t_releaseAnimData.calculateSwipeSpeed('x');\n\n\n\t\tif(_verticalDragInitiated) {\n\n\t\t\tvar opacityRatio = _calculateVerticalDragOpacityRatio();\n\n\t\t\tif(opacityRatio < _options.verticalDragRange) {\n\t\t\t\tself.close();\n\t\t\t} else {\n\t\t\t\tvar initalPanY = _panOffset.y,\n\t\t\t\t\tinitialBgOpacity = _bgOpacity;\n\n\t\t\t\t_animateProp('verticalDrag', 0, 1, 300, framework.easing.cubic.out, function(now) {\n\t\t\t\t\t\n\t\t\t\t\t_panOffset.y = (self.currItem.initialPosition.y - initalPanY) * now + initalPanY;\n\n\t\t\t\t\t_applyBgOpacity( (1 - initialBgOpacity) * now + initialBgOpacity );\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t});\n\n\t\t\t\t_shout('onVerticalDrag', 1);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\n\t\t// main scroll \n\t\tif( (_mainScrollShifted || _mainScrollAnimating) && numPoints === 0) {\n\t\t\tvar itemChanged = _finishSwipeMainScrollGesture(gestureType, _releaseAnimData);\n\t\t\tif(itemChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgestureType = 'zoomPointerUp';\n\t\t}\n\n\t\t// prevent zoom/pan animation when main scroll animation runs\n\t\tif(_mainScrollAnimating) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Complete simple zoom gesture (reset zoom level if it's out of the bounds) \n\t\tif(gestureType !== 'swipe') {\n\t\t\t_completeZoomGesture();\n\t\t\treturn;\n\t\t}\n\t\n\t\t// Complete pan gesture if main scroll is not shifted, and it's possible to pan current image\n\t\tif(!_mainScrollShifted && _currZoomLevel > self.currItem.fitRatio) {\n\t\t\t_completePanGesture(_releaseAnimData);\n\t\t}\n\t},\n\n\n\t// Returns object with data about gesture\n\t// It's created only once and then reused\n\t_initDragReleaseAnimationData = function() {\n\t\t// temp local vars\n\t\tvar lastFlickDuration,\n\t\t\ttempReleasePos;\n\n\t\t// s = this\n\t\tvar s = {\n\t\t\tlastFlickOffset: {},\n\t\t\tlastFlickDist: {},\n\t\t\tlastFlickSpeed: {},\n\t\t\tslowDownRatio: {},\n\t\t\tslowDownRatioReverse: {},\n\t\t\tspeedDecelerationRatio: {},\n\t\t\tspeedDecelerationRatioAbs: {},\n\t\t\tdistanceOffset: {},\n\t\t\tbackAnimDestination: {},\n\t\t\tbackAnimStarted: {},\n\t\t\tcalculateSwipeSpeed: function(axis) {\n\t\t\t\t\n\n\t\t\t\tif( _posPoints.length > 1) {\n\t\t\t\t\tlastFlickDuration = _getCurrentTime() - _gestureCheckSpeedTime + 50;\n\t\t\t\t\ttempReleasePos = _posPoints[_posPoints.length-2][axis];\n\t\t\t\t} else {\n\t\t\t\t\tlastFlickDuration = _getCurrentTime() - _gestureStartTime; // total gesture duration\n\t\t\t\t\ttempReleasePos = _startPoint[axis];\n\t\t\t\t}\n\t\t\t\ts.lastFlickOffset[axis] = _currPoint[axis] - tempReleasePos;\n\t\t\t\ts.lastFlickDist[axis] = Math.abs(s.lastFlickOffset[axis]);\n\t\t\t\tif(s.lastFlickDist[axis] > 20) {\n\t\t\t\t\ts.lastFlickSpeed[axis] = s.lastFlickOffset[axis] / lastFlickDuration;\n\t\t\t\t} else {\n\t\t\t\t\ts.lastFlickSpeed[axis] = 0;\n\t\t\t\t}\n\t\t\t\tif( Math.abs(s.lastFlickSpeed[axis]) < 0.1 ) {\n\t\t\t\t\ts.lastFlickSpeed[axis] = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ts.slowDownRatio[axis] = 0.95;\n\t\t\t\ts.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];\n\t\t\t\ts.speedDecelerationRatio[axis] = 1;\n\t\t\t},\n\n\t\t\tcalculateOverBoundsAnimOffset: function(axis, speed) {\n\t\t\t\tif(!s.backAnimStarted[axis]) {\n\n\t\t\t\t\tif(_panOffset[axis] > _currPanBounds.min[axis]) {\n\t\t\t\t\t\ts.backAnimDestination[axis] = _currPanBounds.min[axis];\n\t\t\t\t\t\t\n\t\t\t\t\t} else if(_panOffset[axis] < _currPanBounds.max[axis]) {\n\t\t\t\t\t\ts.backAnimDestination[axis] = _currPanBounds.max[axis];\n\t\t\t\t\t}\n\n\t\t\t\t\tif(s.backAnimDestination[axis] !== undefined) {\n\t\t\t\t\t\ts.slowDownRatio[axis] = 0.7;\n\t\t\t\t\t\ts.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];\n\t\t\t\t\t\tif(s.speedDecelerationRatioAbs[axis] < 0.05) {\n\n\t\t\t\t\t\t\ts.lastFlickSpeed[axis] = 0;\n\t\t\t\t\t\t\ts.backAnimStarted[axis] = true;\n\n\t\t\t\t\t\t\t_animateProp('bounceZoomPan'+axis,_panOffset[axis], \n\t\t\t\t\t\t\t\ts.backAnimDestination[axis], \n\t\t\t\t\t\t\t\tspeed || 300, \n\t\t\t\t\t\t\t\tframework.easing.sine.out, \n\t\t\t\t\t\t\t\tfunction(pos) {\n\t\t\t\t\t\t\t\t\t_panOffset[axis] = pos;\n\t\t\t\t\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Reduces the speed by slowDownRatio (per 10ms)\n\t\t\tcalculateAnimOffset: function(axis) {\n\t\t\t\tif(!s.backAnimStarted[axis]) {\n\t\t\t\t\ts.speedDecelerationRatio[axis] = s.speedDecelerationRatio[axis] * (s.slowDownRatio[axis] + \n\t\t\t\t\t\t\t\t\t\t\t\ts.slowDownRatioReverse[axis] - \n\t\t\t\t\t\t\t\t\t\t\t\ts.slowDownRatioReverse[axis] * s.timeDiff / 10);\n\n\t\t\t\t\ts.speedDecelerationRatioAbs[axis] = Math.abs(s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis]);\n\t\t\t\t\ts.distanceOffset[axis] = s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis] * s.timeDiff;\n\t\t\t\t\t_panOffset[axis] += s.distanceOffset[axis];\n\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tpanAnimLoop: function() {\n\t\t\t\tif ( _animations.zoomPan ) {\n\t\t\t\t\t_animations.zoomPan.raf = _requestAF(s.panAnimLoop);\n\n\t\t\t\t\ts.now = _getCurrentTime();\n\t\t\t\t\ts.timeDiff = s.now - s.lastNow;\n\t\t\t\t\ts.lastNow = s.now;\n\t\t\t\t\t\n\t\t\t\t\ts.calculateAnimOffset('x');\n\t\t\t\t\ts.calculateAnimOffset('y');\n\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\n\t\t\t\t\ts.calculateOverBoundsAnimOffset('x');\n\t\t\t\t\ts.calculateOverBoundsAnimOffset('y');\n\n\n\t\t\t\t\tif (s.speedDecelerationRatioAbs.x < 0.05 && s.speedDecelerationRatioAbs.y < 0.05) {\n\n\t\t\t\t\t\t// round pan position\n\t\t\t\t\t\t_panOffset.x = Math.round(_panOffset.x);\n\t\t\t\t\t\t_panOffset.y = Math.round(_panOffset.y);\n\t\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\t\n\t\t\t\t\t\t_stopAnimation('zoomPan');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\treturn s;\n\t},\n\n\t_completePanGesture = function(animData) {\n\t\t// calculate swipe speed for Y axis (paanning)\n\t\tanimData.calculateSwipeSpeed('y');\n\n\t\t_currPanBounds = self.currItem.bounds;\n\t\t\n\t\tanimData.backAnimDestination = {};\n\t\tanimData.backAnimStarted = {};\n\n\t\t// Avoid acceleration animation if speed is too low\n\t\tif(Math.abs(animData.lastFlickSpeed.x) <= 0.05 && Math.abs(animData.lastFlickSpeed.y) <= 0.05 ) {\n\t\t\tanimData.speedDecelerationRatioAbs.x = animData.speedDecelerationRatioAbs.y = 0;\n\n\t\t\t// Run pan drag release animation. E.g. if you drag image and release finger without momentum.\n\t\t\tanimData.calculateOverBoundsAnimOffset('x');\n\t\t\tanimData.calculateOverBoundsAnimOffset('y');\n\t\t\treturn true;\n\t\t}\n\n\t\t// Animation loop that controls the acceleration after pan gesture ends\n\t\t_registerStartAnimation('zoomPan');\n\t\tanimData.lastNow = _getCurrentTime();\n\t\tanimData.panAnimLoop();\n\t},\n\n\n\t_finishSwipeMainScrollGesture = function(gestureType, _releaseAnimData) {\n\t\tvar itemChanged;\n\t\tif(!_mainScrollAnimating) {\n\t\t\t_currZoomedItemIndex = _currentItemIndex;\n\t\t}\n\n\n\t\t\n\t\tvar itemsDiff;\n\n\t\tif(gestureType === 'swipe') {\n\t\t\tvar totalShiftDist = _currPoint.x - _startPoint.x,\n\t\t\t\tisFastLastFlick = _releaseAnimData.lastFlickDist.x < 10;\n\n\t\t\t// if container is shifted for more than MIN_SWIPE_DISTANCE, \n\t\t\t// and last flick gesture was in right direction\n\t\t\tif(totalShiftDist > MIN_SWIPE_DISTANCE && \n\t\t\t\t(isFastLastFlick || _releaseAnimData.lastFlickOffset.x > 20) ) {\n\t\t\t\t// go to prev item\n\t\t\t\titemsDiff = -1;\n\t\t\t} else if(totalShiftDist < -MIN_SWIPE_DISTANCE && \n\t\t\t\t(isFastLastFlick || _releaseAnimData.lastFlickOffset.x < -20) ) {\n\t\t\t\t// go to next item\n\t\t\t\titemsDiff = 1;\n\t\t\t}\n\t\t}\n\n\t\tvar nextCircle;\n\n\t\tif(itemsDiff) {\n\t\t\t\n\t\t\t_currentItemIndex += itemsDiff;\n\n\t\t\tif(_currentItemIndex < 0) {\n\t\t\t\t_currentItemIndex = _options.loop ? _getNumItems()-1 : 0;\n\t\t\t\tnextCircle = true;\n\t\t\t} else if(_currentItemIndex >= _getNumItems()) {\n\t\t\t\t_currentItemIndex = _options.loop ? 0 : _getNumItems()-1;\n\t\t\t\tnextCircle = true;\n\t\t\t}\n\n\t\t\tif(!nextCircle || _options.loop) {\n\t\t\t\t_indexDiff += itemsDiff;\n\t\t\t\t_currPositionIndex -= itemsDiff;\n\t\t\t\titemChanged = true;\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t}\n\n\t\tvar animateToX = _slideSize.x * _currPositionIndex;\n\t\tvar animateToDist = Math.abs( animateToX - _mainScrollPos.x );\n\t\tvar finishAnimDuration;\n\n\n\t\tif(!itemChanged && animateToX > _mainScrollPos.x !== _releaseAnimData.lastFlickSpeed.x > 0) {\n\t\t\t// \"return to current\" duration, e.g. when dragging from slide 0 to -1\n\t\t\tfinishAnimDuration = 333; \n\t\t} else {\n\t\t\tfinishAnimDuration = Math.abs(_releaseAnimData.lastFlickSpeed.x) > 0 ? \n\t\t\t\t\t\t\t\t\tanimateToDist / Math.abs(_releaseAnimData.lastFlickSpeed.x) : \n\t\t\t\t\t\t\t\t\t333;\n\n\t\t\tfinishAnimDuration = Math.min(finishAnimDuration, 400);\n\t\t\tfinishAnimDuration = Math.max(finishAnimDuration, 250);\n\t\t}\n\n\t\tif(_currZoomedItemIndex === _currentItemIndex) {\n\t\t\titemChanged = false;\n\t\t}\n\t\t\n\t\t_mainScrollAnimating = true;\n\t\t\n\t\t_shout('mainScrollAnimStart');\n\n\t\t_animateProp('mainScroll', _mainScrollPos.x, animateToX, finishAnimDuration, framework.easing.cubic.out, \n\t\t\t_moveMainScroll,\n\t\t\tfunction() {\n\t\t\t\t_stopAllAnimations();\n\t\t\t\t_mainScrollAnimating = false;\n\t\t\t\t_currZoomedItemIndex = -1;\n\t\t\t\t\n\t\t\t\tif(itemChanged || _currZoomedItemIndex !== _currentItemIndex) {\n\t\t\t\t\tself.updateCurrItem();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_shout('mainScrollAnimComplete');\n\t\t\t}\n\t\t);\n\n\t\tif(itemChanged) {\n\t\t\tself.updateCurrItem(true);\n\t\t}\n\n\t\treturn itemChanged;\n\t},\n\n\t_calculateZoomLevel = function(touchesDistance) {\n\t\treturn 1 / _startPointsDistance * touchesDistance * _startZoomLevel;\n\t},\n\n\t// Resets zoom if it's out of bounds\n\t_completeZoomGesture = function() {\n\t\tvar destZoomLevel = _currZoomLevel,\n\t\t\tminZoomLevel = _getMinZoomLevel(),\n\t\t\tmaxZoomLevel = _getMaxZoomLevel();\n\n\t\tif ( _currZoomLevel < minZoomLevel ) {\n\t\t\tdestZoomLevel = minZoomLevel;\n\t\t} else if ( _currZoomLevel > maxZoomLevel ) {\n\t\t\tdestZoomLevel = maxZoomLevel;\n\t\t}\n\n\t\tvar destOpacity = 1,\n\t\t\tonUpdate,\n\t\t\tinitialOpacity = _bgOpacity;\n\n\t\tif(_opacityChanged && !_isZoomingIn && !_wasOverInitialZoom && _currZoomLevel < minZoomLevel) {\n\t\t\t//_closedByScroll = true;\n\t\t\tself.close();\n\t\t\treturn true;\n\t\t}\n\n\t\tif(_opacityChanged) {\n\t\t\tonUpdate = function(now) {\n\t\t\t\t_applyBgOpacity( (destOpacity - initialOpacity) * now + initialOpacity );\n\t\t\t};\n\t\t}\n\n\t\tself.zoomTo(destZoomLevel, 0, 200, framework.easing.cubic.out, onUpdate);\n\t\treturn true;\n\t};\n\n\n_registerModule('Gestures', {\n\tpublicMethods: {\n\n\t\tinitGestures: function() {\n\n\t\t\t// helper function that builds touch/pointer/mouse events\n\t\t\tvar addEventNames = function(pref, down, move, up, cancel) {\n\t\t\t\t_dragStartEvent = pref + down;\n\t\t\t\t_dragMoveEvent = pref + move;\n\t\t\t\t_dragEndEvent = pref + up;\n\t\t\t\tif(cancel) {\n\t\t\t\t\t_dragCancelEvent = pref + cancel;\n\t\t\t\t} else {\n\t\t\t\t\t_dragCancelEvent = '';\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t_pointerEventEnabled = _features.pointerEvent;\n\t\t\tif(_pointerEventEnabled && _features.touch) {\n\t\t\t\t// we don't need touch events, if browser supports pointer events\n\t\t\t\t_features.touch = false;\n\t\t\t}\n\n\t\t\tif(_pointerEventEnabled) {\n\t\t\t\tif(navigator.pointerEnabled) {\n\t\t\t\t\taddEventNames('pointer', 'down', 'move', 'up', 'cancel');\n\t\t\t\t} else {\n\t\t\t\t\t// IE10 pointer events are case-sensitive\n\t\t\t\t\taddEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');\n\t\t\t\t}\n\t\t\t} else if(_features.touch) {\n\t\t\t\taddEventNames('touch', 'start', 'move', 'end', 'cancel');\n\t\t\t\t_likelyTouchDevice = true;\n\t\t\t} else {\n\t\t\t\taddEventNames('mouse', 'down', 'move', 'up');\t\n\t\t\t}\n\n\t\t\t_upMoveEvents = _dragMoveEvent + ' ' + _dragEndEvent + ' ' + _dragCancelEvent;\n\t\t\t_downEvents = _dragStartEvent;\n\n\t\t\tif(_pointerEventEnabled && !_likelyTouchDevice) {\n\t\t\t\t_likelyTouchDevice = (navigator.maxTouchPoints > 1) || (navigator.msMaxTouchPoints > 1);\n\t\t\t}\n\t\t\t// make variable public\n\t\t\tself.likelyTouchDevice = _likelyTouchDevice; \n\t\t\t\n\t\t\t_globalEventHandlers[_dragStartEvent] = _onDragStart;\n\t\t\t_globalEventHandlers[_dragMoveEvent] = _onDragMove;\n\t\t\t_globalEventHandlers[_dragEndEvent] = _onDragRelease; // the Kraken\n\n\t\t\tif(_dragCancelEvent) {\n\t\t\t\t_globalEventHandlers[_dragCancelEvent] = _globalEventHandlers[_dragEndEvent];\n\t\t\t}\n\n\t\t\t// Bind mouse events on device with detected hardware touch support, in case it supports multiple types of input.\n\t\t\tif(_features.touch) {\n\t\t\t\t_downEvents += ' mousedown';\n\t\t\t\t_upMoveEvents += ' mousemove mouseup';\n\t\t\t\t_globalEventHandlers.mousedown = _globalEventHandlers[_dragStartEvent];\n\t\t\t\t_globalEventHandlers.mousemove = _globalEventHandlers[_dragMoveEvent];\n\t\t\t\t_globalEventHandlers.mouseup = _globalEventHandlers[_dragEndEvent];\n\t\t\t}\n\n\t\t\tif(!_likelyTouchDevice) {\n\t\t\t\t// don't allow pan to next slide from zoomed state on Desktop\n\t\t\t\t_options.allowPanToNext = false;\n\t\t\t}\n\t\t}\n\n\t}\n});\n\n\n/*>>gestures*/\n\n/*>>show-hide-transition*/\n/**\n * show-hide-transition.js:\n *\n * Manages initial opening or closing transition.\n *\n * If you're not planning to use transition for gallery at all,\n * you may set options hideAnimationDuration and showAnimationDuration to 0,\n * and just delete startAnimation function.\n * \n */\n\n\nvar _showOrHideTimeout,\n\t_showOrHide = function(item, img, out, completeFn) {\n\n\t\tif(_showOrHideTimeout) {\n\t\t\tclearTimeout(_showOrHideTimeout);\n\t\t}\n\n\t\t_initialZoomRunning = true;\n\t\t_initialContentSet = true;\n\t\t\n\t\t// dimensions of small thumbnail {x:,y:,w:}.\n\t\t// Height is optional, as calculated based on large image.\n\t\tvar thumbBounds; \n\t\tif(item.initialLayout) {\n\t\t\tthumbBounds = item.initialLayout;\n\t\t\titem.initialLayout = null;\n\t\t} else {\n\t\t\tthumbBounds = _options.getThumbBoundsFn && _options.getThumbBoundsFn(_currentItemIndex);\n\t\t}\n\n\t\tvar duration = out ? _options.hideAnimationDuration : _options.showAnimationDuration;\n\n\t\tvar onComplete = function() {\n\t\t\t_stopAnimation('initialZoom');\n\t\t\tif(!out) {\n\t\t\t\t_applyBgOpacity(1);\n\t\t\t\tif(img) {\n\t\t\t\t\timg.style.display = 'block';\n\t\t\t\t}\n\t\t\t\tframework.addClass(template, 'pswp--animated-in');\n\t\t\t\t_shout('initialZoom' + (out ? 'OutEnd' : 'InEnd'));\n\t\t\t} else {\n\t\t\t\tself.template.removeAttribute('style');\n\t\t\t\tself.bg.removeAttribute('style');\n\t\t\t}\n\n\t\t\tif(completeFn) {\n\t\t\t\tcompleteFn();\n\t\t\t}\n\t\t\t_initialZoomRunning = false;\n\t\t};\n\n\t\t// if bounds aren't provided, just open gallery without animation\n\t\tif(!duration || !thumbBounds || thumbBounds.x === undefined) {\n\n\t\t\t_shout('initialZoom' + (out ? 'Out' : 'In') );\n\n\t\t\t_currZoomLevel = item.initialZoomLevel;\n\t\t\t_equalizePoints(_panOffset, item.initialPosition );\n\t\t\t_applyCurrentZoomPan();\n\n\t\t\ttemplate.style.opacity = out ? 0 : 1;\n\t\t\t_applyBgOpacity(1);\n\n\t\t\tif(duration) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tonComplete();\n\t\t\t\t}, duration);\n\t\t\t} else {\n\t\t\t\tonComplete();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvar startAnimation = function() {\n\t\t\tvar closeWithRaf = _closedByScroll,\n\t\t\t\tfadeEverything = !self.currItem.src || self.currItem.loadError || _options.showHideOpacity;\n\t\t\t\n\t\t\t// apply hw-acceleration to image\n\t\t\tif(item.miniImg) {\n\t\t\t\titem.miniImg.style.webkitBackfaceVisibility = 'hidden';\n\t\t\t}\n\n\t\t\tif(!out) {\n\t\t\t\t_currZoomLevel = thumbBounds.w / item.w;\n\t\t\t\t_panOffset.x = thumbBounds.x;\n\t\t\t\t_panOffset.y = thumbBounds.y - _initalWindowScrollY;\n\n\t\t\t\tself[fadeEverything ? 'template' : 'bg'].style.opacity = 0.001;\n\t\t\t\t_applyCurrentZoomPan();\n\t\t\t}\n\n\t\t\t_registerStartAnimation('initialZoom');\n\t\t\t\n\t\t\tif(out && !closeWithRaf) {\n\t\t\t\tframework.removeClass(template, 'pswp--animated-in');\n\t\t\t}\n\n\t\t\tif(fadeEverything) {\n\t\t\t\tif(out) {\n\t\t\t\t\tframework[ (closeWithRaf ? 'remove' : 'add') + 'Class' ](template, 'pswp--animate_opacity');\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tframework.addClass(template, 'pswp--animate_opacity');\n\t\t\t\t\t}, 30);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_showOrHideTimeout = setTimeout(function() {\n\n\t\t\t\t_shout('initialZoom' + (out ? 'Out' : 'In') );\n\t\t\t\t\n\n\t\t\t\tif(!out) {\n\n\t\t\t\t\t// \"in\" animation always uses CSS transitions (instead of rAF).\n\t\t\t\t\t// CSS transition work faster here, \n\t\t\t\t\t// as developer may also want to animate other things, \n\t\t\t\t\t// like ui on top of sliding area, which can be animated just via CSS\n\t\t\t\t\t\n\t\t\t\t\t_currZoomLevel = item.initialZoomLevel;\n\t\t\t\t\t_equalizePoints(_panOffset, item.initialPosition );\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t_applyBgOpacity(1);\n\n\t\t\t\t\tif(fadeEverything) {\n\t\t\t\t\t\ttemplate.style.opacity = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_applyBgOpacity(1);\n\t\t\t\t\t}\n\n\t\t\t\t\t_showOrHideTimeout = setTimeout(onComplete, duration + 20);\n\t\t\t\t} else {\n\n\t\t\t\t\t// \"out\" animation uses rAF only when PhotoSwipe is closed by browser scroll, to recalculate position\n\t\t\t\t\tvar destZoomLevel = thumbBounds.w / item.w,\n\t\t\t\t\t\tinitialPanOffset = {\n\t\t\t\t\t\t\tx: _panOffset.x,\n\t\t\t\t\t\t\ty: _panOffset.y\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinitialZoomLevel = _currZoomLevel,\n\t\t\t\t\t\tinitalBgOpacity = _bgOpacity,\n\t\t\t\t\t\tonUpdate = function(now) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(now === 1) {\n\t\t\t\t\t\t\t\t_currZoomLevel = destZoomLevel;\n\t\t\t\t\t\t\t\t_panOffset.x = thumbBounds.x;\n\t\t\t\t\t\t\t\t_panOffset.y = thumbBounds.y - _currentWindowScrollY;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_currZoomLevel = (destZoomLevel - initialZoomLevel) * now + initialZoomLevel;\n\t\t\t\t\t\t\t\t_panOffset.x = (thumbBounds.x - initialPanOffset.x) * now + initialPanOffset.x;\n\t\t\t\t\t\t\t\t_panOffset.y = (thumbBounds.y - _currentWindowScrollY - initialPanOffset.y) * now + initialPanOffset.y;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\t\tif(fadeEverything) {\n\t\t\t\t\t\t\t\ttemplate.style.opacity = 1 - now;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_applyBgOpacity( initalBgOpacity - now * initalBgOpacity );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\tif(closeWithRaf) {\n\t\t\t\t\t\t_animateProp('initialZoom', 0, 1, duration, framework.easing.cubic.out, onUpdate, onComplete);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonUpdate(1);\n\t\t\t\t\t\t_showOrHideTimeout = setTimeout(onComplete, duration + 20);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}, out ? 25 : 90); // Main purpose of this delay is to give browser time to paint and\n\t\t\t\t\t// create composite layers of PhotoSwipe UI parts (background, controls, caption, arrows).\n\t\t\t\t\t// Which avoids lag at the beginning of scale transition.\n\t\t};\n\t\tstartAnimation();\n\n\t\t\n\t};\n\n/*>>show-hide-transition*/\n\n/*>>items-controller*/\n/**\n*\n* Controller manages gallery items, their dimensions, and their content.\n* \n*/\n\nvar _items,\n\t_tempPanAreaSize = {},\n\t_imagesToAppendPool = [],\n\t_initialContentSet,\n\t_initialZoomRunning,\n\t_controllerDefaultOptions = {\n\t\tindex: 0,\n\t\terrorMsg: '
The image could not be loaded.
',\n\t\tforceProgressiveLoading: false, // TODO\n\t\tpreload: [1,1],\n\t\tgetNumItemsFn: function() {\n\t\t\treturn _items.length;\n\t\t}\n\t};\n\n\nvar _getItemAt,\n\t_getNumItems,\n\t_initialIsLoop,\n\t_getZeroBounds = function() {\n\t\treturn {\n\t\t\tcenter:{x:0,y:0}, \n\t\t\tmax:{x:0,y:0}, \n\t\t\tmin:{x:0,y:0}\n\t\t};\n\t},\n\t_calculateSingleItemPanBounds = function(item, realPanElementW, realPanElementH ) {\n\t\tvar bounds = item.bounds;\n\n\t\t// position of element when it's centered\n\t\tbounds.center.x = Math.round((_tempPanAreaSize.x - realPanElementW) / 2);\n\t\tbounds.center.y = Math.round((_tempPanAreaSize.y - realPanElementH) / 2) + item.vGap.top;\n\n\t\t// maximum pan position\n\t\tbounds.max.x = (realPanElementW > _tempPanAreaSize.x) ? \n\t\t\t\t\t\t\tMath.round(_tempPanAreaSize.x - realPanElementW) : \n\t\t\t\t\t\t\tbounds.center.x;\n\t\t\n\t\tbounds.max.y = (realPanElementH > _tempPanAreaSize.y) ? \n\t\t\t\t\t\t\tMath.round(_tempPanAreaSize.y - realPanElementH) + item.vGap.top : \n\t\t\t\t\t\t\tbounds.center.y;\n\t\t\n\t\t// minimum pan position\n\t\tbounds.min.x = (realPanElementW > _tempPanAreaSize.x) ? 0 : bounds.center.x;\n\t\tbounds.min.y = (realPanElementH > _tempPanAreaSize.y) ? item.vGap.top : bounds.center.y;\n\t},\n\t_calculateItemSize = function(item, viewportSize, zoomLevel) {\n\n\t\tif (item.src && !item.loadError) {\n\t\t\tvar isInitial = !zoomLevel;\n\t\t\t\n\t\t\tif(isInitial) {\n\t\t\t\tif(!item.vGap) {\n\t\t\t\t\titem.vGap = {top:0,bottom:0};\n\t\t\t\t}\n\t\t\t\t// allows overriding vertical margin for individual items\n\t\t\t\t_shout('parseVerticalMargin', item);\n\t\t\t}\n\n\n\t\t\t_tempPanAreaSize.x = viewportSize.x;\n\t\t\t_tempPanAreaSize.y = viewportSize.y - item.vGap.top - item.vGap.bottom;\n\n\t\t\tif (isInitial) {\n\t\t\t\tvar hRatio = _tempPanAreaSize.x / item.w;\n\t\t\t\tvar vRatio = _tempPanAreaSize.y / item.h;\n\n\t\t\t\titem.fitRatio = hRatio < vRatio ? hRatio : vRatio;\n\t\t\t\t//item.fillRatio = hRatio > vRatio ? hRatio : vRatio;\n\n\t\t\t\tvar scaleMode = _options.scaleMode;\n\n\t\t\t\tif (scaleMode === 'orig') {\n\t\t\t\t\tzoomLevel = 1;\n\t\t\t\t} else if (scaleMode === 'fit') {\n\t\t\t\t\tzoomLevel = item.fitRatio;\n\t\t\t\t}\n\n\t\t\t\tif (zoomLevel > 1) {\n\t\t\t\t\tzoomLevel = 1;\n\t\t\t\t}\n\n\t\t\t\titem.initialZoomLevel = zoomLevel;\n\t\t\t\t\n\t\t\t\tif(!item.bounds) {\n\t\t\t\t\t// reuse bounds object\n\t\t\t\t\titem.bounds = _getZeroBounds(); \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!zoomLevel) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_calculateSingleItemPanBounds(item, item.w * zoomLevel, item.h * zoomLevel);\n\n\t\t\tif (isInitial && zoomLevel === item.initialZoomLevel) {\n\t\t\t\titem.initialPosition = item.bounds.center;\n\t\t\t}\n\n\t\t\treturn item.bounds;\n\t\t} else {\n\t\t\titem.w = item.h = 0;\n\t\t\titem.initialZoomLevel = item.fitRatio = 1;\n\t\t\titem.bounds = _getZeroBounds();\n\t\t\titem.initialPosition = item.bounds.center;\n\n\t\t\t// if it's not image, we return zero bounds (content is not zoomable)\n\t\t\treturn item.bounds;\n\t\t}\n\t\t\n\t},\n\n\t\n\n\n\t_appendImage = function(index, item, baseDiv, img, preventAnimation, keepPlaceholder) {\n\t\t\n\n\t\tif(item.loadError) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(img) {\n\n\t\t\titem.imageAppended = true;\n\t\t\t_setImageSize(item, img, (item === self.currItem && _renderMaxResolution) );\n\t\t\t\n\t\t\tbaseDiv.appendChild(img);\n\n\t\t\tif(keepPlaceholder) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif(item && item.loaded && item.placeholder) {\n\t\t\t\t\t\titem.placeholder.style.display = 'none';\n\t\t\t\t\t\titem.placeholder = null;\n\t\t\t\t\t}\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}\n\t},\n\t\n\n\n\t_preloadImage = function(item) {\n\t\titem.loading = true;\n\t\titem.loaded = false;\n\t\tvar img = item.img = framework.createEl('pswp__img', 'img');\n\t\tvar onComplete = function() {\n\t\t\titem.loading = false;\n\t\t\titem.loaded = true;\n\n\t\t\tif(item.loadComplete) {\n\t\t\t\titem.loadComplete(item);\n\t\t\t} else {\n\t\t\t\titem.img = null; // no need to store image object\n\t\t\t}\n\t\t\timg.onload = img.onerror = null;\n\t\t\timg = null;\n\t\t};\n\t\timg.onload = onComplete;\n\t\timg.onerror = function() {\n\t\t\titem.loadError = true;\n\t\t\tonComplete();\n\t\t};\t\t\n\n\t\timg.src = item.src;// + '?a=' + Math.random();\n\n\t\treturn img;\n\t},\n\t_checkForError = function(item, cleanUp) {\n\t\tif(item.src && item.loadError && item.container) {\n\n\t\t\tif(cleanUp) {\n\t\t\t\titem.container.innerHTML = '';\n\t\t\t}\n\n\t\t\titem.container.innerHTML = _options.errorMsg.replace('%url%', item.src );\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t},\n\t_setImageSize = function(item, img, maxRes) {\n\t\tif(!item.src) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(!img) {\n\t\t\timg = item.container.lastChild;\n\t\t}\n\n\t\tvar w = maxRes ? item.w : Math.round(item.w * item.fitRatio),\n\t\t\th = maxRes ? item.h : Math.round(item.h * item.fitRatio);\n\t\t\n\t\tif(item.placeholder && !item.loaded) {\n\t\t\titem.placeholder.style.width = w + 'px';\n\t\t\titem.placeholder.style.height = h + 'px';\n\t\t}\n\n\t\timg.style.width = w + 'px';\n\t\timg.style.height = h + 'px';\n\t},\n\t_appendImagesPool = function() {\n\n\t\tif(_imagesToAppendPool.length) {\n\t\t\tvar poolItem;\n\n\t\t\tfor(var i = 0; i < _imagesToAppendPool.length; i++) {\n\t\t\t\tpoolItem = _imagesToAppendPool[i];\n\t\t\t\tif( poolItem.holder.index === poolItem.index ) {\n\t\t\t\t\t_appendImage(poolItem.index, poolItem.item, poolItem.baseDiv, poolItem.img, false, poolItem.clearPlaceholder);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_imagesToAppendPool = [];\n\t\t}\n\t};\n\t\n\n\n_registerModule('Controller', {\n\n\tpublicMethods: {\n\n\t\tlazyLoadItem: function(index) {\n\t\t\tindex = _getLoopedId(index);\n\t\t\tvar item = _getItemAt(index);\n\n\t\t\tif(!item || ((item.loaded || item.loading) && !_itemsNeedUpdate)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_shout('gettingData', index, item);\n\n\t\t\tif (!item.src) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_preloadImage(item);\n\t\t},\n\t\tinitController: function() {\n\t\t\tframework.extend(_options, _controllerDefaultOptions, true);\n\t\t\tself.items = _items = items;\n\t\t\t_getItemAt = self.getItemAt;\n\t\t\t_getNumItems = _options.getNumItemsFn; //self.getNumItems;\n\n\n\n\t\t\t_initialIsLoop = _options.loop;\n\t\t\tif(_getNumItems() < 3) {\n\t\t\t\t_options.loop = false; // disable loop if less then 3 items\n\t\t\t}\n\n\t\t\t_listen('beforeChange', function(diff) {\n\n\t\t\t\tvar p = _options.preload,\n\t\t\t\t\tisNext = diff === null ? true : (diff >= 0),\n\t\t\t\t\tpreloadBefore = Math.min(p[0], _getNumItems() ),\n\t\t\t\t\tpreloadAfter = Math.min(p[1], _getNumItems() ),\n\t\t\t\t\ti;\n\n\n\t\t\t\tfor(i = 1; i <= (isNext ? preloadAfter : preloadBefore); i++) {\n\t\t\t\t\tself.lazyLoadItem(_currentItemIndex+i);\n\t\t\t\t}\n\t\t\t\tfor(i = 1; i <= (isNext ? preloadBefore : preloadAfter); i++) {\n\t\t\t\t\tself.lazyLoadItem(_currentItemIndex-i);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_listen('initialLayout', function() {\n\t\t\t\tself.currItem.initialLayout = _options.getThumbBoundsFn && _options.getThumbBoundsFn(_currentItemIndex);\n\t\t\t});\n\n\t\t\t_listen('mainScrollAnimComplete', _appendImagesPool);\n\t\t\t_listen('initialZoomInEnd', _appendImagesPool);\n\n\n\n\t\t\t_listen('destroy', function() {\n\t\t\t\tvar item;\n\t\t\t\tfor(var i = 0; i < _items.length; i++) {\n\t\t\t\t\titem = _items[i];\n\t\t\t\t\t// remove reference to DOM elements, for GC\n\t\t\t\t\tif(item.container) {\n\t\t\t\t\t\titem.container = null; \n\t\t\t\t\t}\n\t\t\t\t\tif(item.placeholder) {\n\t\t\t\t\t\titem.placeholder = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(item.img) {\n\t\t\t\t\t\titem.img = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(item.preloader) {\n\t\t\t\t\t\titem.preloader = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(item.loadError) {\n\t\t\t\t\t\titem.loaded = item.loadError = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_imagesToAppendPool = null;\n\t\t\t});\n\t\t},\n\n\n\t\tgetItemAt: function(index) {\n\t\t\tif (index >= 0) {\n\t\t\t\treturn _items[index] !== undefined ? _items[index] : false;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\tallowProgressiveImg: function() {\n\t\t\t// 1. Progressive image loading isn't working on webkit/blink \n\t\t\t// when hw-acceleration (e.g. translateZ) is applied to IMG element.\n\t\t\t// That's why in PhotoSwipe parent element gets zoom transform, not image itself.\n\t\t\t// \n\t\t\t// 2. Progressive image loading sometimes blinks in webkit/blink when applying animation to parent element.\n\t\t\t// That's why it's disabled on touch devices (mainly because of swipe transition)\n\t\t\t// \n\t\t\t// 3. Progressive image loading sometimes doesn't work in IE (up to 11).\n\n\t\t\t// Don't allow progressive loading on non-large touch devices\n\t\t\treturn _options.forceProgressiveLoading || !_likelyTouchDevice || _options.mouseUsed || screen.width > 1200; \n\t\t\t// 1200 - to eliminate touch devices with large screen (like Chromebook Pixel)\n\t\t},\n\n\t\tsetContent: function(holder, index) {\n\n\t\t\tif(_options.loop) {\n\t\t\t\tindex = _getLoopedId(index);\n\t\t\t}\n\n\t\t\tvar prevItem = self.getItemAt(holder.index);\n\t\t\tif(prevItem) {\n\t\t\t\tprevItem.container = null;\n\t\t\t}\n\t\n\t\t\tvar item = self.getItemAt(index),\n\t\t\t\timg;\n\t\t\t\n\t\t\tif(!item) {\n\t\t\t\tholder.el.innerHTML = '';\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// allow to override data\n\t\t\t_shout('gettingData', index, item);\n\n\t\t\tholder.index = index;\n\t\t\tholder.item = item;\n\n\t\t\t// base container DIV is created only once for each of 3 holders\n\t\t\tvar baseDiv = item.container = framework.createEl('pswp__zoom-wrap'); \n\n\t\t\t\n\n\t\t\tif(!item.src && item.html) {\n\t\t\t\tif(item.html.tagName) {\n\t\t\t\t\tbaseDiv.appendChild(item.html);\n\t\t\t\t} else {\n\t\t\t\t\tbaseDiv.innerHTML = item.html;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_checkForError(item);\n\n\t\t\t_calculateItemSize(item, _viewportSize);\n\t\t\t\n\t\t\tif(item.src && !item.loadError && !item.loaded) {\n\n\t\t\t\titem.loadComplete = function(item) {\n\n\t\t\t\t\t// gallery closed before image finished loading\n\t\t\t\t\tif(!_isOpen) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// check if holder hasn't changed while image was loading\n\t\t\t\t\tif(holder && holder.index === index ) {\n\t\t\t\t\t\tif( _checkForError(item, true) ) {\n\t\t\t\t\t\t\titem.loadComplete = item.img = null;\n\t\t\t\t\t\t\t_calculateItemSize(item, _viewportSize);\n\t\t\t\t\t\t\t_applyZoomPanToItem(item);\n\n\t\t\t\t\t\t\tif(holder.index === _currentItemIndex) {\n\t\t\t\t\t\t\t\t// recalculate dimensions\n\t\t\t\t\t\t\t\tself.updateCurrZoomItem();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( !item.imageAppended ) {\n\t\t\t\t\t\t\tif(_features.transform && (_mainScrollAnimating || _initialZoomRunning) ) {\n\t\t\t\t\t\t\t\t_imagesToAppendPool.push({\n\t\t\t\t\t\t\t\t\titem:item,\n\t\t\t\t\t\t\t\t\tbaseDiv:baseDiv,\n\t\t\t\t\t\t\t\t\timg:item.img,\n\t\t\t\t\t\t\t\t\tindex:index,\n\t\t\t\t\t\t\t\t\tholder:holder,\n\t\t\t\t\t\t\t\t\tclearPlaceholder:true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_appendImage(index, item, baseDiv, item.img, _mainScrollAnimating || _initialZoomRunning, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// remove preloader & mini-img\n\t\t\t\t\t\t\tif(!_initialZoomRunning && item.placeholder) {\n\t\t\t\t\t\t\t\titem.placeholder.style.display = 'none';\n\t\t\t\t\t\t\t\titem.placeholder = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\titem.loadComplete = null;\n\t\t\t\t\titem.img = null; // no need to store image element after it's added\n\n\t\t\t\t\t_shout('imageLoadComplete', index, item);\n\t\t\t\t};\n\n\t\t\t\tif(framework.features.transform) {\n\t\t\t\t\t\n\t\t\t\t\tvar placeholderClassName = 'pswp__img pswp__img--placeholder'; \n\t\t\t\t\tplaceholderClassName += (item.msrc ? '' : ' pswp__img--placeholder--blank');\n\n\t\t\t\t\tvar placeholder = framework.createEl(placeholderClassName, item.msrc ? 'img' : '');\n\t\t\t\t\tif(item.msrc) {\n\t\t\t\t\t\tplaceholder.src = item.msrc;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t_setImageSize(item, placeholder);\n\n\t\t\t\t\tbaseDiv.appendChild(placeholder);\n\t\t\t\t\titem.placeholder = placeholder;\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t\n\n\t\t\t\tif(!item.loading) {\n\t\t\t\t\t_preloadImage(item);\n\t\t\t\t}\n\n\n\t\t\t\tif( self.allowProgressiveImg() ) {\n\t\t\t\t\t// just append image\n\t\t\t\t\tif(!_initialContentSet && _features.transform) {\n\t\t\t\t\t\t_imagesToAppendPool.push({\n\t\t\t\t\t\t\titem:item, \n\t\t\t\t\t\t\tbaseDiv:baseDiv, \n\t\t\t\t\t\t\timg:item.img, \n\t\t\t\t\t\t\tindex:index, \n\t\t\t\t\t\t\tholder:holder\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_appendImage(index, item, baseDiv, item.img, true, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if(item.src && !item.loadError) {\n\t\t\t\t// image object is created every time, due to bugs of image loading & delay when switching images\n\t\t\t\timg = framework.createEl('pswp__img', 'img');\n\t\t\t\timg.style.opacity = 1;\n\t\t\t\timg.src = item.src;\n\t\t\t\t_setImageSize(item, img);\n\t\t\t\t_appendImage(index, item, baseDiv, img, true);\n\t\t\t}\n\t\t\t\n\n\t\t\tif(!_initialContentSet && index === _currentItemIndex) {\n\t\t\t\t_currZoomElementStyle = baseDiv.style;\n\t\t\t\t_showOrHide(item, (img ||item.img) );\n\t\t\t} else {\n\t\t\t\t_applyZoomPanToItem(item);\n\t\t\t}\n\n\t\t\tholder.el.innerHTML = '';\n\t\t\tholder.el.appendChild(baseDiv);\n\t\t},\n\n\t\tcleanSlide: function( item ) {\n\t\t\tif(item.img ) {\n\t\t\t\titem.img.onload = item.img.onerror = null;\n\t\t\t}\n\t\t\titem.loaded = item.loading = item.img = item.imageAppended = false;\n\t\t}\n\n\t}\n});\n\n/*>>items-controller*/\n\n/*>>tap*/\n/**\n * tap.js:\n *\n * Displatches tap and double-tap events.\n * \n */\n\nvar tapTimer,\n\ttapReleasePoint = {},\n\t_dispatchTapEvent = function(origEvent, releasePoint, pointerType) {\t\t\n\t\tvar e = document.createEvent( 'CustomEvent' ),\n\t\t\teDetail = {\n\t\t\t\torigEvent:origEvent, \n\t\t\t\ttarget:origEvent.target, \n\t\t\t\treleasePoint: releasePoint, \n\t\t\t\tpointerType:pointerType || 'touch'\n\t\t\t};\n\n\t\te.initCustomEvent( 'pswpTap', true, true, eDetail );\n\t\torigEvent.target.dispatchEvent(e);\n\t};\n\n_registerModule('Tap', {\n\tpublicMethods: {\n\t\tinitTap: function() {\n\t\t\t_listen('firstTouchStart', self.onTapStart);\n\t\t\t_listen('touchRelease', self.onTapRelease);\n\t\t\t_listen('destroy', function() {\n\t\t\t\ttapReleasePoint = {};\n\t\t\t\ttapTimer = null;\n\t\t\t});\n\t\t},\n\t\tonTapStart: function(touchList) {\n\t\t\tif(touchList.length > 1) {\n\t\t\t\tclearTimeout(tapTimer);\n\t\t\t\ttapTimer = null;\n\t\t\t}\n\t\t},\n\t\tonTapRelease: function(e, releasePoint) {\n\t\t\tif(!releasePoint) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!_moved && !_isMultitouch && !_numAnimations) {\n\t\t\t\tvar p0 = releasePoint;\n\t\t\t\tif(tapTimer) {\n\t\t\t\t\tclearTimeout(tapTimer);\n\t\t\t\t\ttapTimer = null;\n\n\t\t\t\t\t// Check if taped on the same place\n\t\t\t\t\tif ( _isNearbyPoints(p0, tapReleasePoint) ) {\n\t\t\t\t\t\t_shout('doubleTap', p0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(releasePoint.type === 'mouse') {\n\t\t\t\t\t_dispatchTapEvent(e, releasePoint, 'mouse');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar clickedTagName = e.target.tagName.toUpperCase();\n\t\t\t\t// avoid double tap delay on buttons and elements that have class pswp__single-tap\n\t\t\t\tif(clickedTagName === 'BUTTON' || framework.hasClass(e.target, 'pswp__single-tap') ) {\n\t\t\t\t\t_dispatchTapEvent(e, releasePoint);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_equalizePoints(tapReleasePoint, p0);\n\n\t\t\t\ttapTimer = setTimeout(function() {\n\t\t\t\t\t_dispatchTapEvent(e, releasePoint);\n\t\t\t\t\ttapTimer = null;\n\t\t\t\t}, 300);\n\t\t\t}\n\t\t}\n\t}\n});\n\n/*>>tap*/\n\n/*>>desktop-zoom*/\n/**\n *\n * desktop-zoom.js:\n *\n * - Binds mousewheel event for paning zoomed image.\n * - Manages \"dragging\", \"zoomed-in\", \"zoom-out\" classes.\n * (which are used for cursors and zoom icon)\n * - Adds toggleDesktopZoom function.\n * \n */\n\nvar _wheelDelta;\n\t\n_registerModule('DesktopZoom', {\n\n\tpublicMethods: {\n\n\t\tinitDesktopZoom: function() {\n\n\t\t\tif(_oldIE) {\n\t\t\t\t// no zoom for old IE (<=8)\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(_likelyTouchDevice) {\n\t\t\t\t// if detected hardware touch support, we wait until mouse is used,\n\t\t\t\t// and only then apply desktop-zoom features\n\t\t\t\t_listen('mouseUsed', function() {\n\t\t\t\t\tself.setupDesktopZoom();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tself.setupDesktopZoom(true);\n\t\t\t}\n\n\t\t},\n\n\t\tsetupDesktopZoom: function(onInit) {\n\n\t\t\t_wheelDelta = {};\n\n\t\t\tvar events = 'wheel mousewheel DOMMouseScroll';\n\t\t\t\n\t\t\t_listen('bindEvents', function() {\n\t\t\t\tframework.bind(template, events, self.handleMouseWheel);\n\t\t\t});\n\n\t\t\t_listen('unbindEvents', function() {\n\t\t\t\tif(_wheelDelta) {\n\t\t\t\t\tframework.unbind(template, events, self.handleMouseWheel);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tself.mouseZoomedIn = false;\n\n\t\t\tvar hasDraggingClass,\n\t\t\t\tupdateZoomable = function() {\n\t\t\t\t\tif(self.mouseZoomedIn) {\n\t\t\t\t\t\tframework.removeClass(template, 'pswp--zoomed-in');\n\t\t\t\t\t\tself.mouseZoomedIn = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(_currZoomLevel < 1) {\n\t\t\t\t\t\tframework.addClass(template, 'pswp--zoom-allowed');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tframework.removeClass(template, 'pswp--zoom-allowed');\n\t\t\t\t\t}\n\t\t\t\t\tremoveDraggingClass();\n\t\t\t\t},\n\t\t\t\tremoveDraggingClass = function() {\n\t\t\t\t\tif(hasDraggingClass) {\n\t\t\t\t\t\tframework.removeClass(template, 'pswp--dragging');\n\t\t\t\t\t\thasDraggingClass = false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t_listen('resize' , updateZoomable);\n\t\t\t_listen('afterChange' , updateZoomable);\n\t\t\t_listen('pointerDown', function() {\n\t\t\t\tif(self.mouseZoomedIn) {\n\t\t\t\t\thasDraggingClass = true;\n\t\t\t\t\tframework.addClass(template, 'pswp--dragging');\n\t\t\t\t}\n\t\t\t});\n\t\t\t_listen('pointerUp', removeDraggingClass);\n\n\t\t\tif(!onInit) {\n\t\t\t\tupdateZoomable();\n\t\t\t}\n\t\t\t\n\t\t},\n\n\t\thandleMouseWheel: function(e) {\n\n\t\t\tif(_currZoomLevel <= self.currItem.fitRatio) {\n\t\t\t\tif( _options.modal ) {\n\n\t\t\t\t\tif (!_options.closeOnScroll || _numAnimations || _isDragging) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else if(_transformKey && Math.abs(e.deltaY) > 2) {\n\t\t\t\t\t\t// close PhotoSwipe\n\t\t\t\t\t\t// if browser supports transforms & scroll changed enough\n\t\t\t\t\t\t_closedByScroll = true;\n\t\t\t\t\t\tself.close();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// allow just one event to fire\n\t\t\te.stopPropagation();\n\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/Events/wheel\n\t\t\t_wheelDelta.x = 0;\n\n\t\t\tif('deltaX' in e) {\n\t\t\t\tif(e.deltaMode === 1 /* DOM_DELTA_LINE */) {\n\t\t\t\t\t// 18 - average line height\n\t\t\t\t\t_wheelDelta.x = e.deltaX * 18;\n\t\t\t\t\t_wheelDelta.y = e.deltaY * 18;\n\t\t\t\t} else {\n\t\t\t\t\t_wheelDelta.x = e.deltaX;\n\t\t\t\t\t_wheelDelta.y = e.deltaY;\n\t\t\t\t}\n\t\t\t} else if('wheelDelta' in e) {\n\t\t\t\tif(e.wheelDeltaX) {\n\t\t\t\t\t_wheelDelta.x = -0.16 * e.wheelDeltaX;\n\t\t\t\t}\n\t\t\t\tif(e.wheelDeltaY) {\n\t\t\t\t\t_wheelDelta.y = -0.16 * e.wheelDeltaY;\n\t\t\t\t} else {\n\t\t\t\t\t_wheelDelta.y = -0.16 * e.wheelDelta;\n\t\t\t\t}\n\t\t\t} else if('detail' in e) {\n\t\t\t\t_wheelDelta.y = e.detail;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_calculatePanBounds(_currZoomLevel, true);\n\n\t\t\tvar newPanX = _panOffset.x - _wheelDelta.x,\n\t\t\t\tnewPanY = _panOffset.y - _wheelDelta.y;\n\n\t\t\t// only prevent scrolling in nonmodal mode when not at edges\n\t\t\tif (_options.modal ||\n\t\t\t\t(\n\t\t\t\tnewPanX <= _currPanBounds.min.x && newPanX >= _currPanBounds.max.x &&\n\t\t\t\tnewPanY <= _currPanBounds.min.y && newPanY >= _currPanBounds.max.y\n\t\t\t\t) ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\t// TODO: use rAF instead of mousewheel?\n\t\t\tself.panTo(newPanX, newPanY);\n\t\t},\n\n\t\ttoggleDesktopZoom: function(centerPoint) {\n\t\t\tcenterPoint = centerPoint || {x:_viewportSize.x/2 + _offset.x, y:_viewportSize.y/2 + _offset.y };\n\n\t\t\tvar doubleTapZoomLevel = _options.getDoubleTapZoom(true, self.currItem);\n\t\t\tvar zoomOut = _currZoomLevel === doubleTapZoomLevel;\n\t\t\t\n\t\t\tself.mouseZoomedIn = !zoomOut;\n\n\t\t\tself.zoomTo(zoomOut ? self.currItem.initialZoomLevel : doubleTapZoomLevel, centerPoint, 333);\n\t\t\tframework[ (!zoomOut ? 'add' : 'remove') + 'Class'](template, 'pswp--zoomed-in');\n\t\t}\n\n\t}\n});\n\n\n/*>>desktop-zoom*/\n\n/*>>history*/\n/**\n *\n * history.js:\n *\n * - Back button to close gallery.\n * \n * - Unique URL for each slide: example.com/&pid=1&gid=3\n * (where PID is picture index, and GID and gallery index)\n * \n * - Switch URL when slides change.\n * \n */\n\n\nvar _historyDefaultOptions = {\n\thistory: true,\n\tgalleryUID: 1\n};\n\nvar _historyUpdateTimeout,\n\t_hashChangeTimeout,\n\t_hashAnimCheckTimeout,\n\t_hashChangedByScript,\n\t_hashChangedByHistory,\n\t_hashReseted,\n\t_initialHash,\n\t_historyChanged,\n\t_closedFromURL,\n\t_urlChangedOnce,\n\t_windowLoc,\n\n\t_supportsPushState,\n\n\t_getHash = function() {\n\t\treturn _windowLoc.hash.substring(1);\n\t},\n\t_cleanHistoryTimeouts = function() {\n\n\t\tif(_historyUpdateTimeout) {\n\t\t\tclearTimeout(_historyUpdateTimeout);\n\t\t}\n\n\t\tif(_hashAnimCheckTimeout) {\n\t\t\tclearTimeout(_hashAnimCheckTimeout);\n\t\t}\n\t},\n\n\t// pid - Picture index\n\t// gid - Gallery index\n\t_parseItemIndexFromURL = function() {\n\t\tvar hash = _getHash(),\n\t\t\tparams = {};\n\n\t\tif(hash.length < 5) { // pid=1\n\t\t\treturn params;\n\t\t}\n\n\t\tvar i, vars = hash.split('&');\n\t\tfor (i = 0; i < vars.length; i++) {\n\t\t\tif(!vars[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar pair = vars[i].split('=');\t\n\t\t\tif(pair.length < 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tparams[pair[0]] = pair[1];\n\t\t}\n\t\tif(_options.galleryPIDs) {\n\t\t\t// detect custom pid in hash and search for it among the items collection\n\t\t\tvar searchfor = params.pid;\n\t\t\tparams.pid = 0; // if custom pid cannot be found, fallback to the first item\n\t\t\tfor(i = 0; i < _items.length; i++) {\n\t\t\t\tif(_items[i].pid === searchfor) {\n\t\t\t\t\tparams.pid = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tparams.pid = parseInt(params.pid,10)-1;\n\t\t}\n\t\tif( params.pid < 0 ) {\n\t\t\tparams.pid = 0;\n\t\t}\n\t\treturn params;\n\t},\n\t_updateHash = function() {\n\n\t\tif(_hashAnimCheckTimeout) {\n\t\t\tclearTimeout(_hashAnimCheckTimeout);\n\t\t}\n\n\n\t\tif(_numAnimations || _isDragging) {\n\t\t\t// changing browser URL forces layout/paint in some browsers, which causes noticable lag during animation\n\t\t\t// that's why we update hash only when no animations running\n\t\t\t_hashAnimCheckTimeout = setTimeout(_updateHash, 500);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(_hashChangedByScript) {\n\t\t\tclearTimeout(_hashChangeTimeout);\n\t\t} else {\n\t\t\t_hashChangedByScript = true;\n\t\t}\n\n\n\t\tvar pid = (_currentItemIndex + 1);\n\t\tvar item = _getItemAt( _currentItemIndex );\n\t\tif(item.hasOwnProperty('pid')) {\n\t\t\t// carry forward any custom pid assigned to the item\n\t\t\tpid = item.pid;\n\t\t}\n\t\tvar newHash = _initialHash + '&' + 'gid=' + _options.galleryUID + '&' + 'pid=' + pid;\n\n\t\tif(!_historyChanged) {\n\t\t\tif(_windowLoc.hash.indexOf(newHash) === -1) {\n\t\t\t\t_urlChangedOnce = true;\n\t\t\t}\n\t\t\t// first time - add new hisory record, then just replace\n\t\t}\n\n\t\tvar newURL = _windowLoc.href.split('#')[0] + '#' + newHash;\n\n\t\tif( _supportsPushState ) {\n\n\t\t\tif('#' + newHash !== window.location.hash) {\n\t\t\t\thistory[_historyChanged ? 'replaceState' : 'pushState']('', document.title, newURL);\n\t\t\t}\n\n\t\t} else {\n\t\t\tif(_historyChanged) {\n\t\t\t\t_windowLoc.replace( newURL );\n\t\t\t} else {\n\t\t\t\t_windowLoc.hash = newHash;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\n\t\t_historyChanged = true;\n\t\t_hashChangeTimeout = setTimeout(function() {\n\t\t\t_hashChangedByScript = false;\n\t\t}, 60);\n\t};\n\n\n\n\t\n\n_registerModule('History', {\n\n\t\n\n\tpublicMethods: {\n\t\tinitHistory: function() {\n\n\t\t\tframework.extend(_options, _historyDefaultOptions, true);\n\n\t\t\tif( !_options.history ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\t_windowLoc = window.location;\n\t\t\t_urlChangedOnce = false;\n\t\t\t_closedFromURL = false;\n\t\t\t_historyChanged = false;\n\t\t\t_initialHash = _getHash();\n\t\t\t_supportsPushState = ('pushState' in history);\n\n\n\t\t\tif(_initialHash.indexOf('gid=') > -1) {\n\t\t\t\t_initialHash = _initialHash.split('&gid=')[0];\n\t\t\t\t_initialHash = _initialHash.split('?gid=')[0];\n\t\t\t}\n\t\t\t\n\n\t\t\t_listen('afterChange', self.updateURL);\n\t\t\t_listen('unbindEvents', function() {\n\t\t\t\tframework.unbind(window, 'hashchange', self.onHashChange);\n\t\t\t});\n\n\n\t\t\tvar returnToOriginal = function() {\n\t\t\t\t_hashReseted = true;\n\t\t\t\tif(!_closedFromURL) {\n\n\t\t\t\t\tif(_urlChangedOnce) {\n\t\t\t\t\t\thistory.back();\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif(_initialHash) {\n\t\t\t\t\t\t\t_windowLoc.hash = _initialHash;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (_supportsPushState) {\n\n\t\t\t\t\t\t\t\t// remove hash from url without refreshing it or scrolling to top\n\t\t\t\t\t\t\t\thistory.pushState('', document.title, _windowLoc.pathname + _windowLoc.search );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_windowLoc.hash = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t_cleanHistoryTimeouts();\n\t\t\t};\n\n\n\t\t\t_listen('unbindEvents', function() {\n\t\t\t\tif(_closedByScroll) {\n\t\t\t\t\t// if PhotoSwipe is closed by scroll, we go \"back\" before the closing animation starts\n\t\t\t\t\t// this is done to keep the scroll position\n\t\t\t\t\treturnToOriginal();\n\t\t\t\t}\n\t\t\t});\n\t\t\t_listen('destroy', function() {\n\t\t\t\tif(!_hashReseted) {\n\t\t\t\t\treturnToOriginal();\n\t\t\t\t}\n\t\t\t});\n\t\t\t_listen('firstUpdate', function() {\n\t\t\t\t_currentItemIndex = _parseItemIndexFromURL().pid;\n\t\t\t});\n\n\t\t\t\n\n\t\t\t\n\t\t\tvar index = _initialHash.indexOf('pid=');\n\t\t\tif(index > -1) {\n\t\t\t\t_initialHash = _initialHash.substring(0, index);\n\t\t\t\tif(_initialHash.slice(-1) === '&') {\n\t\t\t\t\t_initialHash = _initialHash.slice(0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\tsetTimeout(function() {\n\t\t\t\tif(_isOpen) { // hasn't destroyed yet\n\t\t\t\t\tframework.bind(window, 'hashchange', self.onHashChange);\n\t\t\t\t}\n\t\t\t}, 40);\n\t\t\t\n\t\t},\n\t\tonHashChange: function() {\n\n\t\t\tif(_getHash() === _initialHash) {\n\n\t\t\t\t_closedFromURL = true;\n\t\t\t\tself.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!_hashChangedByScript) {\n\n\t\t\t\t_hashChangedByHistory = true;\n\t\t\t\tself.goTo( _parseItemIndexFromURL().pid );\n\t\t\t\t_hashChangedByHistory = false;\n\t\t\t}\n\t\t\t\n\t\t},\n\t\tupdateURL: function() {\n\n\t\t\t// Delay the update of URL, to avoid lag during transition, \n\t\t\t// and to not to trigger actions like \"refresh page sound\" or \"blinking favicon\" to often\n\t\t\t\n\t\t\t_cleanHistoryTimeouts();\n\t\t\t\n\n\t\t\tif(_hashChangedByHistory) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!_historyChanged) {\n\t\t\t\t_updateHash(); // first time\n\t\t\t} else {\n\t\t\t\t_historyUpdateTimeout = setTimeout(_updateHash, 800);\n\t\t\t}\n\t\t}\n\t\n\t}\n});\n\n\n/*>>history*/\n\tframework.extend(self, publicMethods); };\n\treturn PhotoSwipe;\n});","/*! PhotoSwipe Default UI - 4.1.2 - 2017-04-05\n* http://photoswipe.com\n* Copyright (c) 2017 Dmitry Semenov; */\n/**\n*\n* UI on top of main sliding area (caption, arrows, close button, etc.).\n* Built just using public methods/properties of PhotoSwipe.\n* \n*/\n(function (root, factory) { \n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t} else if (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\troot.PhotoSwipeUI_Default = factory();\n\t}\n})(this, function () {\n\n\t'use strict';\n\n\n\nvar PhotoSwipeUI_Default =\n function(pswp, framework) {\n\n\tvar ui = this;\n\tvar _overlayUIUpdated = false,\n\t\t_controlsVisible = true,\n\t\t_fullscrenAPI,\n\t\t_controls,\n\t\t_captionContainer,\n\t\t_fakeCaptionContainer,\n\t\t_indexIndicator,\n\t\t_shareButton,\n\t\t_shareModal,\n\t\t_shareModalHidden = true,\n\t\t_initalCloseOnScrollValue,\n\t\t_isIdle,\n\t\t_listen,\n\n\t\t_loadingIndicator,\n\t\t_loadingIndicatorHidden,\n\t\t_loadingIndicatorTimeout,\n\n\t\t_galleryHasOneSlide,\n\n\t\t_options,\n\t\t_defaultUIOptions = {\n\t\t\tbarsSize: {top:44, bottom:'auto'},\n\t\t\tcloseElClasses: ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar'], \n\t\t\ttimeToIdle: 4000, \n\t\t\ttimeToIdleOutside: 1000,\n\t\t\tloadingIndicatorDelay: 1000, // 2s\n\t\t\t\n\t\t\taddCaptionHTMLFn: function(item, captionEl /*, isFake */) {\n\t\t\t\tif(!item.title) {\n\t\t\t\t\tcaptionEl.children[0].innerHTML = '';\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcaptionEl.children[0].innerHTML = item.title;\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tcloseEl:true,\n\t\t\tcaptionEl: true,\n\t\t\tfullscreenEl: true,\n\t\t\tzoomEl: true,\n\t\t\tshareEl: true,\n\t\t\tcounterEl: true,\n\t\t\tarrowEl: true,\n\t\t\tpreloaderEl: true,\n\n\t\t\ttapToClose: false,\n\t\t\ttapToToggleControls: true,\n\n\t\t\tclickToCloseNonZoomable: true,\n\n\t\t\tshareButtons: [\n\t\t\t\t{id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'},\n\t\t\t\t{id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'},\n\t\t\t\t{id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t'?url={{url}}&media={{image_url}}&description={{text}}'},\n\t\t\t\t{id:'download', label:'Download image', url:'{{raw_image_url}}', download:true}\n\t\t\t],\n\t\t\tgetImageURLForShare: function( /* shareButtonData */ ) {\n\t\t\t\treturn pswp.currItem.src || '';\n\t\t\t},\n\t\t\tgetPageURLForShare: function( /* shareButtonData */ ) {\n\t\t\t\treturn window.location.href;\n\t\t\t},\n\t\t\tgetTextForShare: function( /* shareButtonData */ ) {\n\t\t\t\treturn pswp.currItem.title || '';\n\t\t\t},\n\t\t\t\t\n\t\t\tindexIndicatorSep: ' / ',\n\t\t\tfitControlsWidth: 1200\n\n\t\t},\n\t\t_blockControlsTap,\n\t\t_blockControlsTapTimeout;\n\n\n\n\tvar _onControlsTap = function(e) {\n\t\t\tif(_blockControlsTap) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\te = e || window.event;\n\n\t\t\tif(_options.timeToIdle && _options.mouseUsed && !_isIdle) {\n\t\t\t\t// reset idle timer\n\t\t\t\t_onIdleMouseMove();\n\t\t\t}\n\n\n\t\t\tvar target = e.target || e.srcElement,\n\t\t\t\tuiElement,\n\t\t\t\tclickedClass = target.getAttribute('class') || '',\n\t\t\t\tfound;\n\n\t\t\tfor(var i = 0; i < _uiElements.length; i++) {\n\t\t\t\tuiElement = _uiElements[i];\n\t\t\t\tif(uiElement.onTap && clickedClass.indexOf('pswp__' + uiElement.name ) > -1 ) {\n\t\t\t\t\tuiElement.onTap();\n\t\t\t\t\tfound = true;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(found) {\n\t\t\t\tif(e.stopPropagation) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\t_blockControlsTap = true;\n\n\t\t\t\t// Some versions of Android don't prevent ghost click event \n\t\t\t\t// when preventDefault() was called on touchstart and/or touchend.\n\t\t\t\t// \n\t\t\t\t// This happens on v4.3, 4.2, 4.1, \n\t\t\t\t// older versions strangely work correctly, \n\t\t\t\t// but just in case we add delay on all of them)\t\n\t\t\t\tvar tapDelay = framework.features.isOldAndroid ? 600 : 30;\n\t\t\t\t_blockControlsTapTimeout = setTimeout(function() {\n\t\t\t\t\t_blockControlsTap = false;\n\t\t\t\t}, tapDelay);\n\t\t\t}\n\n\t\t},\n\t\t_fitControlsInViewport = function() {\n\t\t\treturn !pswp.likelyTouchDevice || _options.mouseUsed || screen.width > _options.fitControlsWidth;\n\t\t},\n\t\t_togglePswpClass = function(el, cName, add) {\n\t\t\tframework[ (add ? 'add' : 'remove') + 'Class' ](el, 'pswp__' + cName);\n\t\t},\n\n\t\t// add class when there is just one item in the gallery\n\t\t// (by default it hides left/right arrows and 1ofX counter)\n\t\t_countNumItems = function() {\n\t\t\tvar hasOneSlide = (_options.getNumItemsFn() === 1);\n\n\t\t\tif(hasOneSlide !== _galleryHasOneSlide) {\n\t\t\t\t_togglePswpClass(_controls, 'ui--one-slide', hasOneSlide);\n\t\t\t\t_galleryHasOneSlide = hasOneSlide;\n\t\t\t}\n\t\t},\n\t\t_toggleShareModalClass = function() {\n\t\t\t_togglePswpClass(_shareModal, 'share-modal--hidden', _shareModalHidden);\n\t\t},\n\t\t_toggleShareModal = function() {\n\n\t\t\t_shareModalHidden = !_shareModalHidden;\n\t\t\t\n\t\t\t\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_toggleShareModalClass();\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif(!_shareModalHidden) {\n\t\t\t\t\t\tframework.addClass(_shareModal, 'pswp__share-modal--fade-in');\n\t\t\t\t\t}\n\t\t\t\t}, 30);\n\t\t\t} else {\n\t\t\t\tframework.removeClass(_shareModal, 'pswp__share-modal--fade-in');\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif(_shareModalHidden) {\n\t\t\t\t\t\t_toggleShareModalClass();\n\t\t\t\t\t}\n\t\t\t\t}, 300);\n\t\t\t}\n\t\t\t\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_updateShareURLs();\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\t_openWindowPopup = function(e) {\n\t\t\te = e || window.event;\n\t\t\tvar target = e.target || e.srcElement;\n\n\t\t\tpswp.shout('shareLinkClick', e, target);\n\n\t\t\tif(!target.href) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif( target.hasAttribute('download') ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\twindow.open(target.href, 'pswp_share', 'scrollbars=yes,resizable=yes,toolbar=no,'+\n\t\t\t\t\t\t\t\t\t\t'location=yes,width=550,height=420,top=100,left=' + \n\t\t\t\t\t\t\t\t\t\t(window.screen ? Math.round(screen.width / 2 - 275) : 100) );\n\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_toggleShareModal();\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t},\n\t\t_updateShareURLs = function() {\n\t\t\tvar shareButtonOut = '',\n\t\t\t\tshareButtonData,\n\t\t\t\tshareURL,\n\t\t\t\timage_url,\n\t\t\t\tpage_url,\n\t\t\t\tshare_text;\n\n\t\t\tfor(var i = 0; i < _options.shareButtons.length; i++) {\n\t\t\t\tshareButtonData = _options.shareButtons[i];\n\n\t\t\t\timage_url = _options.getImageURLForShare(shareButtonData);\n\t\t\t\tpage_url = _options.getPageURLForShare(shareButtonData);\n\t\t\t\tshare_text = _options.getTextForShare(shareButtonData);\n\n\t\t\t\tshareURL = shareButtonData.url.replace('{{url}}', encodeURIComponent(page_url) )\n\t\t\t\t\t\t\t\t\t.replace('{{image_url}}', encodeURIComponent(image_url) )\n\t\t\t\t\t\t\t\t\t.replace('{{raw_image_url}}', image_url )\n\t\t\t\t\t\t\t\t\t.replace('{{text}}', encodeURIComponent(share_text) );\n\n\t\t\t\tshareButtonOut += '' + \n\t\t\t\t\t\t\t\t\tshareButtonData.label + '';\n\n\t\t\t\tif(_options.parseShareButtonOut) {\n\t\t\t\t\tshareButtonOut = _options.parseShareButtonOut(shareButtonData, shareButtonOut);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_shareModal.children[0].innerHTML = shareButtonOut;\n\t\t\t_shareModal.children[0].onclick = _openWindowPopup;\n\n\t\t},\n\t\t_hasCloseClass = function(target) {\n\t\t\tfor(var i = 0; i < _options.closeElClasses.length; i++) {\n\t\t\t\tif( framework.hasClass(target, 'pswp__' + _options.closeElClasses[i]) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t_idleInterval,\n\t\t_idleTimer,\n\t\t_idleIncrement = 0,\n\t\t_onIdleMouseMove = function() {\n\t\t\tclearTimeout(_idleTimer);\n\t\t\t_idleIncrement = 0;\n\t\t\tif(_isIdle) {\n\t\t\t\tui.setIdle(false);\n\t\t\t}\n\t\t},\n\t\t_onMouseLeaveWindow = function(e) {\n\t\t\te = e ? e : window.event;\n\t\t\tvar from = e.relatedTarget || e.toElement;\n\t\t\tif (!from || from.nodeName === 'HTML') {\n\t\t\t\tclearTimeout(_idleTimer);\n\t\t\t\t_idleTimer = setTimeout(function() {\n\t\t\t\t\tui.setIdle(true);\n\t\t\t\t}, _options.timeToIdleOutside);\n\t\t\t}\n\t\t},\n\t\t_setupFullscreenAPI = function() {\n\t\t\tif(_options.fullscreenEl && !framework.features.isOldAndroid) {\n\t\t\t\tif(!_fullscrenAPI) {\n\t\t\t\t\t_fullscrenAPI = ui.getFullscreenAPI();\n\t\t\t\t}\n\t\t\t\tif(_fullscrenAPI) {\n\t\t\t\t\tframework.bind(document, _fullscrenAPI.eventK, ui.updateFullscreen);\n\t\t\t\t\tui.updateFullscreen();\n\t\t\t\t\tframework.addClass(pswp.template, 'pswp--supports-fs');\n\t\t\t\t} else {\n\t\t\t\t\tframework.removeClass(pswp.template, 'pswp--supports-fs');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t_setupLoadingIndicator = function() {\n\t\t\t// Setup loading indicator\n\t\t\tif(_options.preloaderEl) {\n\t\t\t\n\t\t\t\t_toggleLoadingIndicator(true);\n\n\t\t\t\t_listen('beforeChange', function() {\n\n\t\t\t\t\tclearTimeout(_loadingIndicatorTimeout);\n\n\t\t\t\t\t// display loading indicator with delay\n\t\t\t\t\t_loadingIndicatorTimeout = setTimeout(function() {\n\n\t\t\t\t\t\tif(pswp.currItem && pswp.currItem.loading) {\n\n\t\t\t\t\t\t\tif( !pswp.allowProgressiveImg() || (pswp.currItem.img && !pswp.currItem.img.naturalWidth) ) {\n\t\t\t\t\t\t\t\t// show preloader if progressive loading is not enabled, \n\t\t\t\t\t\t\t\t// or image width is not defined yet (because of slow connection)\n\t\t\t\t\t\t\t\t_toggleLoadingIndicator(false); \n\t\t\t\t\t\t\t\t// items-controller.js function allowProgressiveImg\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_toggleLoadingIndicator(true); // hide preloader\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, _options.loadingIndicatorDelay);\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t_listen('imageLoadComplete', function(index, item) {\n\t\t\t\t\tif(pswp.currItem === item) {\n\t\t\t\t\t\t_toggleLoadingIndicator(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t},\n\t\t_toggleLoadingIndicator = function(hide) {\n\t\t\tif( _loadingIndicatorHidden !== hide ) {\n\t\t\t\t_togglePswpClass(_loadingIndicator, 'preloader--active', !hide);\n\t\t\t\t_loadingIndicatorHidden = hide;\n\t\t\t}\n\t\t},\n\t\t_applyNavBarGaps = function(item) {\n\t\t\tvar gap = item.vGap;\n\n\t\t\tif( _fitControlsInViewport() ) {\n\t\t\t\t\n\t\t\t\tvar bars = _options.barsSize; \n\t\t\t\tif(_options.captionEl && bars.bottom === 'auto') {\n\t\t\t\t\tif(!_fakeCaptionContainer) {\n\t\t\t\t\t\t_fakeCaptionContainer = framework.createEl('pswp__caption pswp__caption--fake');\n\t\t\t\t\t\t_fakeCaptionContainer.appendChild( framework.createEl('pswp__caption__center') );\n\t\t\t\t\t\t_controls.insertBefore(_fakeCaptionContainer, _captionContainer);\n\t\t\t\t\t\tframework.addClass(_controls, 'pswp__ui--fit');\n\t\t\t\t\t}\n\t\t\t\t\tif( _options.addCaptionHTMLFn(item, _fakeCaptionContainer, true) ) {\n\n\t\t\t\t\t\tvar captionSize = _fakeCaptionContainer.clientHeight;\n\t\t\t\t\t\tgap.bottom = parseInt(captionSize,10) || 44;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgap.bottom = bars.top; // if no caption, set size of bottom gap to size of top\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tgap.bottom = bars.bottom === 'auto' ? 0 : bars.bottom;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// height of top bar is static, no need to calculate it\n\t\t\t\tgap.top = bars.top;\n\t\t\t} else {\n\t\t\t\tgap.top = gap.bottom = 0;\n\t\t\t}\n\t\t},\n\t\t_setupIdle = function() {\n\t\t\t// Hide controls when mouse is used\n\t\t\tif(_options.timeToIdle) {\n\t\t\t\t_listen('mouseUsed', function() {\n\t\t\t\t\t\n\t\t\t\t\tframework.bind(document, 'mousemove', _onIdleMouseMove);\n\t\t\t\t\tframework.bind(document, 'mouseout', _onMouseLeaveWindow);\n\n\t\t\t\t\t_idleInterval = setInterval(function() {\n\t\t\t\t\t\t_idleIncrement++;\n\t\t\t\t\t\tif(_idleIncrement === 2) {\n\t\t\t\t\t\t\tui.setIdle(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, _options.timeToIdle / 2);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t_setupHidingControlsDuringGestures = function() {\n\n\t\t\t// Hide controls on vertical drag\n\t\t\t_listen('onVerticalDrag', function(now) {\n\t\t\t\tif(_controlsVisible && now < 0.95) {\n\t\t\t\t\tui.hideControls();\n\t\t\t\t} else if(!_controlsVisible && now >= 0.95) {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Hide controls when pinching to close\n\t\t\tvar pinchControlsHidden;\n\t\t\t_listen('onPinchClose' , function(now) {\n\t\t\t\tif(_controlsVisible && now < 0.9) {\n\t\t\t\t\tui.hideControls();\n\t\t\t\t\tpinchControlsHidden = true;\n\t\t\t\t} else if(pinchControlsHidden && !_controlsVisible && now > 0.9) {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_listen('zoomGestureEnded', function() {\n\t\t\t\tpinchControlsHidden = false;\n\t\t\t\tif(pinchControlsHidden && !_controlsVisible) {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t});\n\n\t\t};\n\n\n\n\tvar _uiElements = [\n\t\t{ \n\t\t\tname: 'caption', \n\t\t\toption: 'captionEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_captionContainer = el; \n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'share-modal', \n\t\t\toption: 'shareEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_shareModal = el;\n\t\t\t},\n\t\t\tonTap: function() {\n\t\t\t\t_toggleShareModal();\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'button--share', \n\t\t\toption: 'shareEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_shareButton = el;\n\t\t\t},\n\t\t\tonTap: function() {\n\t\t\t\t_toggleShareModal();\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'button--zoom', \n\t\t\toption: 'zoomEl',\n\t\t\tonTap: pswp.toggleDesktopZoom\n\t\t},\n\t\t{ \n\t\t\tname: 'counter', \n\t\t\toption: 'counterEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_indexIndicator = el;\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'button--close', \n\t\t\toption: 'closeEl',\n\t\t\tonTap: pswp.close\n\t\t},\n\t\t{ \n\t\t\tname: 'button--arrow--left', \n\t\t\toption: 'arrowEl',\n\t\t\tonTap: pswp.prev\n\t\t},\n\t\t{ \n\t\t\tname: 'button--arrow--right', \n\t\t\toption: 'arrowEl',\n\t\t\tonTap: pswp.next\n\t\t},\n\t\t{ \n\t\t\tname: 'button--fs', \n\t\t\toption: 'fullscreenEl',\n\t\t\tonTap: function() { \n\t\t\t\tif(_fullscrenAPI.isFullscreen()) {\n\t\t\t\t\t_fullscrenAPI.exit();\n\t\t\t\t} else {\n\t\t\t\t\t_fullscrenAPI.enter();\n\t\t\t\t}\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'preloader', \n\t\t\toption: 'preloaderEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_loadingIndicator = el;\n\t\t\t} \n\t\t}\n\n\t];\n\n\tvar _setupUIElements = function() {\n\t\tvar item,\n\t\t\tclassAttr,\n\t\t\tuiElement;\n\n\t\tvar loopThroughChildElements = function(sChildren) {\n\t\t\tif(!sChildren) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar l = sChildren.length;\n\t\t\tfor(var i = 0; i < l; i++) {\n\t\t\t\titem = sChildren[i];\n\t\t\t\tclassAttr = item.className;\n\n\t\t\t\tfor(var a = 0; a < _uiElements.length; a++) {\n\t\t\t\t\tuiElement = _uiElements[a];\n\n\t\t\t\t\tif(classAttr.indexOf('pswp__' + uiElement.name) > -1 ) {\n\n\t\t\t\t\t\tif( _options[uiElement.option] ) { // if element is not disabled from options\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tframework.removeClass(item, 'pswp__element--disabled');\n\t\t\t\t\t\t\tif(uiElement.onInit) {\n\t\t\t\t\t\t\t\tuiElement.onInit(item);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//item.style.display = 'block';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tframework.addClass(item, 'pswp__element--disabled');\n\t\t\t\t\t\t\t//item.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tloopThroughChildElements(_controls.children);\n\n\t\tvar topBar = framework.getChildByClass(_controls, 'pswp__top-bar');\n\t\tif(topBar) {\n\t\t\tloopThroughChildElements( topBar.children );\n\t\t}\n\t};\n\n\n\t\n\n\tui.init = function() {\n\n\t\t// extend options\n\t\tframework.extend(pswp.options, _defaultUIOptions, true);\n\n\t\t// create local link for fast access\n\t\t_options = pswp.options;\n\n\t\t// find pswp__ui element\n\t\t_controls = framework.getChildByClass(pswp.scrollWrap, 'pswp__ui');\n\n\t\t// create local link\n\t\t_listen = pswp.listen;\n\n\n\t\t_setupHidingControlsDuringGestures();\n\n\t\t// update controls when slides change\n\t\t_listen('beforeChange', ui.update);\n\n\t\t// toggle zoom on double-tap\n\t\t_listen('doubleTap', function(point) {\n\t\t\tvar initialZoomLevel = pswp.currItem.initialZoomLevel;\n\t\t\tif(pswp.getZoomLevel() !== initialZoomLevel) {\n\t\t\t\tpswp.zoomTo(initialZoomLevel, point, 333);\n\t\t\t} else {\n\t\t\t\tpswp.zoomTo(_options.getDoubleTapZoom(false, pswp.currItem), point, 333);\n\t\t\t}\n\t\t});\n\n\t\t// Allow text selection in caption\n\t\t_listen('preventDragEvent', function(e, isDown, preventObj) {\n\t\t\tvar t = e.target || e.srcElement;\n\t\t\tif(\n\t\t\t\tt && \n\t\t\t\tt.getAttribute('class') && e.type.indexOf('mouse') > -1 && \n\t\t\t\t( t.getAttribute('class').indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) ) \n\t\t\t) {\n\t\t\t\tpreventObj.prevent = false;\n\t\t\t}\n\t\t});\n\n\t\t// bind events for UI\n\t\t_listen('bindEvents', function() {\n\t\t\tframework.bind(_controls, 'pswpTap click', _onControlsTap);\n\t\t\tframework.bind(pswp.scrollWrap, 'pswpTap', ui.onGlobalTap);\n\n\t\t\tif(!pswp.likelyTouchDevice) {\n\t\t\t\tframework.bind(pswp.scrollWrap, 'mouseover', ui.onMouseOver);\n\t\t\t}\n\t\t});\n\n\t\t// unbind events for UI\n\t\t_listen('unbindEvents', function() {\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_toggleShareModal();\n\t\t\t}\n\n\t\t\tif(_idleInterval) {\n\t\t\t\tclearInterval(_idleInterval);\n\t\t\t}\n\t\t\tframework.unbind(document, 'mouseout', _onMouseLeaveWindow);\n\t\t\tframework.unbind(document, 'mousemove', _onIdleMouseMove);\n\t\t\tframework.unbind(_controls, 'pswpTap click', _onControlsTap);\n\t\t\tframework.unbind(pswp.scrollWrap, 'pswpTap', ui.onGlobalTap);\n\t\t\tframework.unbind(pswp.scrollWrap, 'mouseover', ui.onMouseOver);\n\n\t\t\tif(_fullscrenAPI) {\n\t\t\t\tframework.unbind(document, _fullscrenAPI.eventK, ui.updateFullscreen);\n\t\t\t\tif(_fullscrenAPI.isFullscreen()) {\n\t\t\t\t\t_options.hideAnimationDuration = 0;\n\t\t\t\t\t_fullscrenAPI.exit();\n\t\t\t\t}\n\t\t\t\t_fullscrenAPI = null;\n\t\t\t}\n\t\t});\n\n\n\t\t// clean up things when gallery is destroyed\n\t\t_listen('destroy', function() {\n\t\t\tif(_options.captionEl) {\n\t\t\t\tif(_fakeCaptionContainer) {\n\t\t\t\t\t_controls.removeChild(_fakeCaptionContainer);\n\t\t\t\t}\n\t\t\t\tframework.removeClass(_captionContainer, 'pswp__caption--empty');\n\t\t\t}\n\n\t\t\tif(_shareModal) {\n\t\t\t\t_shareModal.children[0].onclick = null;\n\t\t\t}\n\t\t\tframework.removeClass(_controls, 'pswp__ui--over-close');\n\t\t\tframework.addClass( _controls, 'pswp__ui--hidden');\n\t\t\tui.setIdle(false);\n\t\t});\n\t\t\n\n\t\tif(!_options.showAnimationDuration) {\n\t\t\tframework.removeClass( _controls, 'pswp__ui--hidden');\n\t\t}\n\t\t_listen('initialZoomIn', function() {\n\t\t\tif(_options.showAnimationDuration) {\n\t\t\t\tframework.removeClass( _controls, 'pswp__ui--hidden');\n\t\t\t}\n\t\t});\n\t\t_listen('initialZoomOut', function() {\n\t\t\tframework.addClass( _controls, 'pswp__ui--hidden');\n\t\t});\n\n\t\t_listen('parseVerticalMargin', _applyNavBarGaps);\n\t\t\n\t\t_setupUIElements();\n\n\t\tif(_options.shareEl && _shareButton && _shareModal) {\n\t\t\t_shareModalHidden = true;\n\t\t}\n\n\t\t_countNumItems();\n\n\t\t_setupIdle();\n\n\t\t_setupFullscreenAPI();\n\n\t\t_setupLoadingIndicator();\n\t};\n\n\tui.setIdle = function(isIdle) {\n\t\t_isIdle = isIdle;\n\t\t_togglePswpClass(_controls, 'ui--idle', isIdle);\n\t};\n\n\tui.update = function() {\n\t\t// Don't update UI if it's hidden\n\t\tif(_controlsVisible && pswp.currItem) {\n\t\t\t\n\t\t\tui.updateIndexIndicator();\n\n\t\t\tif(_options.captionEl) {\n\t\t\t\t_options.addCaptionHTMLFn(pswp.currItem, _captionContainer);\n\n\t\t\t\t_togglePswpClass(_captionContainer, 'caption--empty', !pswp.currItem.title);\n\t\t\t}\n\n\t\t\t_overlayUIUpdated = true;\n\n\t\t} else {\n\t\t\t_overlayUIUpdated = false;\n\t\t}\n\n\t\tif(!_shareModalHidden) {\n\t\t\t_toggleShareModal();\n\t\t}\n\n\t\t_countNumItems();\n\t};\n\n\tui.updateFullscreen = function(e) {\n\n\t\tif(e) {\n\t\t\t// some browsers change window scroll position during the fullscreen\n\t\t\t// so PhotoSwipe updates it just in case\n\t\t\tsetTimeout(function() {\n\t\t\t\tpswp.setScrollOffset( 0, framework.getScrollY() );\n\t\t\t}, 50);\n\t\t}\n\t\t\n\t\t// toogle pswp--fs class on root element\n\t\tframework[ (_fullscrenAPI.isFullscreen() ? 'add' : 'remove') + 'Class' ](pswp.template, 'pswp--fs');\n\t};\n\n\tui.updateIndexIndicator = function() {\n\t\tif(_options.counterEl) {\n\t\t\t_indexIndicator.innerHTML = (pswp.getCurrentIndex()+1) + \n\t\t\t\t\t\t\t\t\t\t_options.indexIndicatorSep + \n\t\t\t\t\t\t\t\t\t\t_options.getNumItemsFn();\n\t\t}\n\t};\n\t\n\tui.onGlobalTap = function(e) {\n\t\te = e || window.event;\n\t\tvar target = e.target || e.srcElement;\n\n\t\tif(_blockControlsTap) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(e.detail && e.detail.pointerType === 'mouse') {\n\n\t\t\t// close gallery if clicked outside of the image\n\t\t\tif(_hasCloseClass(target)) {\n\t\t\t\tpswp.close();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(framework.hasClass(target, 'pswp__img')) {\n\t\t\t\tif(pswp.getZoomLevel() === 1 && pswp.getZoomLevel() <= pswp.currItem.fitRatio) {\n\t\t\t\t\tif(_options.clickToCloseNonZoomable) {\n\t\t\t\t\t\tpswp.close();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tpswp.toggleDesktopZoom(e.detail.releasePoint);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else {\n\n\t\t\t// tap anywhere (except buttons) to toggle visibility of controls\n\t\t\tif(_options.tapToToggleControls) {\n\t\t\t\tif(_controlsVisible) {\n\t\t\t\t\tui.hideControls();\n\t\t\t\t} else {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// tap to close gallery\n\t\t\tif(_options.tapToClose && (framework.hasClass(target, 'pswp__img') || _hasCloseClass(target)) ) {\n\t\t\t\tpswp.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t}\n\t};\n\tui.onMouseOver = function(e) {\n\t\te = e || window.event;\n\t\tvar target = e.target || e.srcElement;\n\n\t\t// add class when mouse is over an element that should close the gallery\n\t\t_togglePswpClass(_controls, 'ui--over-close', _hasCloseClass(target));\n\t};\n\n\tui.hideControls = function() {\n\t\tframework.addClass(_controls,'pswp__ui--hidden');\n\t\t_controlsVisible = false;\n\t};\n\n\tui.showControls = function() {\n\t\t_controlsVisible = true;\n\t\tif(!_overlayUIUpdated) {\n\t\t\tui.update();\n\t\t}\n\t\tframework.removeClass(_controls,'pswp__ui--hidden');\n\t};\n\n\tui.supportsFullscreen = function() {\n\t\tvar d = document;\n\t\treturn !!(d.exitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen || d.msExitFullscreen);\n\t};\n\n\tui.getFullscreenAPI = function() {\n\t\tvar dE = document.documentElement,\n\t\t\tapi,\n\t\t\ttF = 'fullscreenchange';\n\n\t\tif (dE.requestFullscreen) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'requestFullscreen',\n\t\t\t\texitK: 'exitFullscreen',\n\t\t\t\telementK: 'fullscreenElement',\n\t\t\t\teventK: tF\n\t\t\t};\n\n\t\t} else if(dE.mozRequestFullScreen ) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'mozRequestFullScreen',\n\t\t\t\texitK: 'mozCancelFullScreen',\n\t\t\t\telementK: 'mozFullScreenElement',\n\t\t\t\teventK: 'moz' + tF\n\t\t\t};\n\n\t\t\t\n\n\t\t} else if(dE.webkitRequestFullscreen) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'webkitRequestFullscreen',\n\t\t\t\texitK: 'webkitExitFullscreen',\n\t\t\t\telementK: 'webkitFullscreenElement',\n\t\t\t\teventK: 'webkit' + tF\n\t\t\t};\n\n\t\t} else if(dE.msRequestFullscreen) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'msRequestFullscreen',\n\t\t\t\texitK: 'msExitFullscreen',\n\t\t\t\telementK: 'msFullscreenElement',\n\t\t\t\teventK: 'MSFullscreenChange'\n\t\t\t};\n\t\t}\n\n\t\tif(api) {\n\t\t\tapi.enter = function() { \n\t\t\t\t// disable close-on-scroll in fullscreen\n\t\t\t\t_initalCloseOnScrollValue = _options.closeOnScroll; \n\t\t\t\t_options.closeOnScroll = false; \n\n\t\t\t\tif(this.enterK === 'webkitRequestFullscreen') {\n\t\t\t\t\tpswp.template[this.enterK]( Element.ALLOW_KEYBOARD_INPUT );\n\t\t\t\t} else {\n\t\t\t\t\treturn pswp.template[this.enterK](); \n\t\t\t\t}\n\t\t\t};\n\t\t\tapi.exit = function() { \n\t\t\t\t_options.closeOnScroll = _initalCloseOnScrollValue;\n\n\t\t\t\treturn document[this.exitK](); \n\n\t\t\t};\n\t\t\tapi.isFullscreen = function() { return document[this.elementK]; };\n\t\t}\n\n\t\treturn api;\n\t};\n\n\n\n};\nreturn PhotoSwipeUI_Default;\n\n\n});\n","'use strict';\n\n// shared variables are defined in SCSS\nconst sharedVariables = require('../scss/_exports.scss');\n\n/**\n * Events for use with pubsub\n * This way events that are used in the application can be tracked\n * When adding a new subscription, make sure to add them here.\n */\nconst pubSubEvents = {\n hideNotification: 'notification.hide',\n mailChimpSuccess: 'mailchimp.success',\n showNotification: 'notification.show',\n wishlist: {\n clickAddToWishlist: 'wishlist.clickAddToWishlist',\n addToWishlist: 'wishlist.addToWishlist',\n displayMessage: 'wishlist.displayMessage',\n updateAmount: 'wishlist.updateAmount'\n }\n};\n\nconst events = {\n ajaxSuccess: 'ajaxSuccess',\n beforeAddToCart: 'product:beforeAddToCart',\n blur: 'blur',\n bonusProductSelect: 'bonusproduct:updateSelectButton',\n bsCollapseHidden: 'hidden.bs.collapse',\n bsCollapseHide: 'hise.bs.collapse',\n bsCollapseShow: 'show.bs.collapse',\n bsCollapseShown: 'shown.bs.collapse',\n bsModalHidden: 'hidden.bs.modal',\n bsModalHide: 'hide.bs.modal',\n bsModalShow: 'show.bs.modal',\n bsModalShown: 'shown.bs.modal',\n cart: 'cart:chequeAdded',\n change: 'change',\n click: 'click',\n focusin: 'focusin',\n focusout: 'focusout',\n hide: 'hide',\n idle: 'idle',\n keydown: 'keydown',\n keypress: 'keypress',\n keyup: 'keyup',\n load: 'load',\n loginModalShown: 'loginModal:shown',\n minicartTriggerPopover: 'minicart:triggerPopover',\n modalPanes: {\n next: 'modal-pane:next',\n prev: 'modal-pane:prev'\n },\n mouseenter: 'mouseenter',\n mouseleave: 'mouseleave',\n productAfterAddToCart: 'product:afterAddToCart',\n productAfterAttrValuesUpdate: 'product:updateAttrValues',\n productAfterAttributeSelect: 'product:afterAttributeSelect',\n productAfterRemoveFromCart: 'product:afterRemoveFromCart',\n productAvailabilityUpdated: 'product:updateAvailability',\n productBeforeAttributeSelect: 'product:beforeAttributeSelect',\n productChangeQuantity: 'product:changeQuantity',\n productStatusUpdate: 'product:statusUpdate',\n productTileClick: 'productTileClick',\n productPromotionClick: 'productPromotionClick',\n productUpdateAddToCart: 'product:updateAddToCart',\n checkoutOption: 'checkoutOption',\n promotionClick: 'promotionClick',\n resize: 'resize',\n scroll: 'scroll',\n searchFilter: 'search:filter',\n searchSort: 'search:sort',\n setShippingMethodSelection: 'setShippingMethodSelection',\n show: 'show',\n showQuickview: 'quickview:show',\n slick: {\n unslick: 'unslick'\n },\n start: 'start',\n submit: 'submit',\n tilesLoaded: 'tilesloaded',\n toggleMobileMenu: 'menu:toggleMobileMenu',\n toggleModal: 'toggleModal',\n touchend: 'touchend',\n touchstart: 'touchstart',\n transitionEnd: 'transitionend',\n update: 'update'\n};\n\nconst selectors = {\n account: {\n notAuthenticated: '.js-not-authenticated'\n },\n backdrop: '.modal-backdrop',\n body: 'body',\n column: '[class*=\"col-\"]',\n footer: 'footer',\n form: {\n checkbox: 'checkbox',\n form: 'form',\n input: 'input',\n select: 'select',\n selectedOption: 'option:selected',\n selectedRadio: 'input:checked',\n textarea: 'textarea',\n disabledField: {\n enabled: 'input.enabled',\n disabled: 'input.disabled'\n }\n },\n header: 'header',\n html: 'html',\n htmlBody: 'html, body',\n img: 'img',\n input: 'input',\n listItem: 'li',\n modal: '.modal',\n notTouch: 'html:not(.touch)',\n modalPanes: {\n activePane: '.modal-pane--active',\n container: '.js-modal-pane-container',\n pane: '.js-modal-pane'\n },\n page: '.js-page',\n product: {\n addToCart: '.js-add-to-cart',\n addToWishlist: '.js-add-to-wishlist',\n attributes: {\n container: '.product-attributes',\n item: '.product-attributes__item',\n message: '.product-attribute__message',\n selected: '.product-attributes__item.selected'\n },\n availabilityMsg: '.js-availability-msg',\n jsProductContainer: '.js-product',\n detailPage: '.product-detail-page',\n productContainer: '.product-detail',\n productID: '.product-id',\n productOption: '.product-option',\n productOptionSelected: '.options-select option:selected'\n },\n content: {\n tile: '[data-js=content-tile]'\n },\n promotion: {\n tile: '[data-js-content=promotion-tile]'\n },\n script: 'script',\n slick: {\n initialized: '.slick-initialized',\n all: '[data-slick-regular]',\n slider: '.slick-slider',\n track: '.slick-track',\n nextButton: '.slick-next',\n slide: '.slick-slide',\n currentSlide: '.slick-current',\n notInitialized: ':not(.slick-initialized)'\n },\n unOrderedListItem: 'ul',\n row: '.row',\n contentSearch: '.content-search'\n};\n\nconst classes = {\n active: 'active',\n childExpanded: 'child-expanded',\n collapsed: 'collapsed',\n disabled: 'disabled',\n dBlock: 'd-block',\n dInlineBlock: 'd-inline-block',\n dNone: 'd-none',\n expanded: 'expanded',\n hide: 'hide',\n hover: 'hover',\n invalid: 'is-invalid',\n modalOpen: 'modal-open',\n product: {\n attributes: {\n errorState: 'product-attributes--error'\n },\n isInWishlist: 'is-in-wishlist'\n },\n modalPanes: {\n activePane: 'modal-pane--active'\n },\n scrollLock: 'scroll-lock',\n selectable: 'selectable',\n selected: 'selected',\n show: 'show',\n slick: {\n initialized: 'slick-initialized',\n currentSlide: 'slick-current',\n disabled: 'slick-disabled'\n },\n unselectable: 'unselectable'\n};\n\nconst attributes = {\n action: 'action',\n actionUrl: 'action-url',\n addressId: 'address-id',\n alt: 'alt',\n ariaExpanded: 'aria-expanded',\n ariaPopUp: 'aria-haspopup',\n attrValue: 'data-attr-value',\n attribute: 'data-attr',\n attributeValue: 'data-attr-value',\n available: 'available',\n checked: 'checked',\n class: 'class',\n color: 'color',\n dataToggle: 'data-toggle',\n dataUrl: 'data-url',\n storeID: 'storeid',\n disabled: 'disabled',\n href: 'href',\n id: 'id',\n name: 'name',\n outerHTML: 'outerHTML',\n pattern: 'pattern',\n pid: 'pid',\n product: {\n isInWishlist: 'data-isinwishlist',\n optionID: 'data-option-id',\n productID: 'data-pid',\n productVariationID: 'data-pvid',\n valueID: 'data-value-id'\n },\n quantity: 'data-qty',\n readyToOrder: 'ready-to-order',\n selected: 'selected',\n slick: 'slick',\n slickConfig: 'slick-config',\n src: 'src',\n srcset: 'srcset',\n style: 'style',\n target: 'target',\n dataTarget: 'data-target',\n textSelect: 'text-select',\n textSelected: 'text-selected',\n title: 'title',\n translationResource: 'resource',\n uuid: 'uuid',\n url: 'url',\n urlAdd: 'data-href-add',\n urlRemove: 'data-href-remove',\n value: 'value'\n};\n\nconst pipelines = {\n cartShow: 'Cart-Show',\n checkoutStep: 'Checkout-Step'\n};\n\nconst states = {\n isAnimating: 'animating'\n};\n\nconst buffer = {\n cssTransitionTime: 50\n};\n\nconst times = {\n scrollToAnimation: 500,\n cssTransitionTime: 300 + buffer.cssTransitionTime,\n heartTransitionTime: 700 + buffer.cssTransitionTime\n};\n\nconst breakpoints = {\n xs: parseFloat(sharedVariables.breakpoint_xs),\n sm: parseFloat(sharedVariables.breakpoint_sm),\n md: parseFloat(sharedVariables.breakpoint_md),\n lg: parseFloat(sharedVariables.breakpoint_lg),\n xl: parseFloat(sharedVariables.breakpoint_xl)\n};\n\nconst cookies = {};\nconst queryParams = {};\n\nmodule.exports = {\n pubSubEvents: pubSubEvents,\n events: events,\n selectors: selectors,\n classes: classes,\n attributes: attributes,\n pipelines: pipelines,\n states: states,\n times: times,\n breakpoints: breakpoints,\n cookies: cookies,\n queryParams: queryParams\n};\n","const processInclude = require('app_storefront_base/util');\n\nwindow.onjQueryLoad(function () {\n processInclude(require('plugin_catalog/product-detail/product-detail'));\n processInclude(require('plugin_wishlists/product/wishlist'));\n}, true);\n","'use strict';\n\nconst CONST = require('plugin_frontend_core/constants');\nconst base = require('app_storefront_base/product/base');\nconst productImages = require('./product-images');\nconst photoswipe = require('./photoswipe');\nconst scrollTo = require('plugin_frontend_components/components/scroll-to');\n\nrequire('plugin_catalog/product/badge');\nrequire('./components/out-of-stock.js').init();\nrequire('./components/store-availability.js').init();\n\nconst selectors = {\n productID: '.product-id',\n productBrand: '.js-product-brand',\n productDetail: '.product-detail',\n productDetailTopBlock: '.js-product-detail-top-block',\n productPrimaryImages: '.js-primary-images',\n productDetailNotBundle: '.product-detail:not(\".bundle-item\")',\n productBundleItems: '.product-detail > .bundle-items',\n productCarouselMain: '.js-product-images-main',\n productCarouselThumbs: '.js-product-images-thumbs',\n productVariations: '.product-detail__variations',\n pdpColorLinks: '.product-variation--color .variant__link',\n pdpSizeLinks: '.product-detail-variants__size .variant__link',\n pdpSizeDropdown: '.product-detail-variants__size.variant-select',\n selectOption: 'option',\n selectedOption: ':selected',\n selectVariations: '.please-select-variations',\n variantLink: '.variant__link',\n sizechartLink: '.js-size-chart-link',\n modalBody: '.js-modal-body',\n longDescription: '.js-longdescription',\n shortDescription: '.js-shortdescription',\n productDetailVariations: '.js-product-detail-variations',\n productAttribute: '.js-product-attributes',\n productSetDetail: '.product-set-detail',\n productDetailImageLink: '.js-product-detail-image-link',\n addToCartStickyBar: '.js-product-detail__sticky-bar',\n pdpMicroTextSlot: '.js-pdp-micro-text-slot',\n chatIcon: '.embeddedServiceHelpButton .helpButton',\n addCart: '.js-add-to-cart',\n addCartGlobal: '.js-add-to-cart-global',\n addToWishlist: '.js-add-to-wishlist',\n attributeLabel: '.js-attribute-label',\n detailBodyShow: '.js-details-body.show',\n detailsHeading: '.js-details-heading',\n availability: 'div.availability',\n availabilityMessage: '.availability-msg',\n availabilityGlobal: '.global-availability',\n shippingMessage: '.js-shipping-message',\n extraDiscountBadge: '.js-badge-promotion'\n};\n\nconst classes = {\n selectedVariant: 'selected',\n unselectableVariant: 'unselectable disabled'\n};\n\n/**\n* Initializes all size-variations functionality\n*/\nfunction initSizeVariations() {\n bindEventListeners();\n}\n\n/**\n* Binds event listeners\n*/\nfunction bindEventListeners() {\n const $doc = $(document);\n\n $doc.on(CONST.events.productAfterAttrValuesUpdate, updateSizeLinks);\n $doc.on(CONST.events.click, selectors.pdpSizeLinks, handleSizeLink);\n $doc.on(CONST.events.change, selectors.pdpSizeDropdown, handleSizeDropdown);\n}\n\n/**\n* Updates the size links after the size dropdown is updated\n*/\nfunction updateSizeLinks() {\n $(selectors.pdpSizeDropdown).find(selectors.selectOption).each(function (i) {\n var $option = $(this);\n var $equivalentSizeLink = $(selectors.pdpSizeLinks).eq(i - 1);\n var isDisabled = $option.attr(CONST.attributes.disabled);\n\n if (isDisabled) {\n $equivalentSizeLink.addClass(classes.unselectableVariant);\n } else {\n $equivalentSizeLink.removeClass(classes.unselectableVariant);\n }\n });\n}\n\n/**\n* Handler for 'links' version of size selection\n* @param {jQuery.event} e - Event\n*/\nfunction handleSizeLink(e) {\n // Return if variant is unselectable\n if (e.currentTarget.classList.contains('unselectable')) {\n return;\n }\n\n var $link = $(e.target).closest(selectors.variantLink);\n var value = $link.attr(CONST.attributes.attrValue);\n\n // Update the classes of each variant\n $link.closest(selectors.variantLink).toggleClass(classes.selectedVariant);\n $link.closest(selectors.variantLink).siblings().removeClass(classes.selectedVariant);\n\n // Stop if the event is not triggered by the user, to prevent an infinite loop\n if (!e.originalEvent) {\n return;\n }\n\n // Sync all size link/dropdown selectors\n syncAllSizeSelectors(value);\n}\n\n/**\n* Handler for 'dropdown' version of size selection\n* @param {jQuery.event} e - Event\n*/\nfunction handleSizeDropdown(e) {\n var $dropdown = $(e.target);\n var value = $dropdown.find(selectors.selectedOption).attr(CONST.attributes.attrValue);\n\n // Stop if the event is not triggered by the user, to prevent an infinite loop\n if (!e.originalEvent) {\n return;\n }\n\n // Sync all size link/dropdown selectors\n syncAllSizeSelectors(value);\n}\n\n/**\n* Is called when either the 'links' or 'dropdown' version of size selection is used.\n* Makes sure to update the other version is updated to keep them in sync.\n* @param {string} value - The variation value\n*/\nfunction syncAllSizeSelectors(value) {\n // Update the links with the same value as the dropdown\n $(selectors.pdpSizeLinks).each(function (i, sizeLink) {\n $(sizeLink).find('[' + CONST.attributes.attrValue + '=\"' + value + '\"]').eq(0).trigger(CONST.events.click);\n });\n\n // Update the dropdown with the same value as the links\n var $optionTarget = $(selectors.pdpSizeDropdown).find('[' + CONST.attributes.attrValue + '=\"' + value + '\"]').eq(0);\n var optionValue = $optionTarget.val();\n\n $(selectors.pdpSizeDropdown).each(function (i) {\n var $dropdown = $(this);\n $dropdown.val(optionValue);\n\n // Only trigger change event for the first dropdown to prevent multiple ajax calls.\n // JVP @TODO: If the change event is triggered on the first dropdown is it possible that a race condition is created and the change fires before this is done?\n if (i === 0) {\n $dropdown.trigger(CONST.events.change);\n }\n });\n}\n\n/**\n * Adjusting chat icon position since there can be micro text just under the add to cart button on mobile device.\n */\nfunction adjustChatIconPosition() {\n setTimeout(function () {\n const $pdpMicroTextSlot = $(selectors.pdpMicroTextSlot);\n\n if (!$pdpMicroTextSlot.length || window.innerWidth >= CONST.breakpoints.md) {\n return;\n }\n\n const $addToCartStickyBar = $(selectors.addToCartStickyBar);\n const $chatIcon = $(selectors.chatIcon);\n const chatIconMarginBottomValue = $addToCartStickyBar.height() + 20;\n $chatIcon.css('margin-bottom', chatIconMarginBottomValue);\n }, 5000);\n}\n\nmodule.exports = {\n scrollTo: scrollTo.init(),\n availability: base.availability,\n addToCart: base.addToCart,\n onAddToCartClick: base.onAddToCartClick,\n initSizeVariations: initSizeVariations,\n productImages: productImages.init,\n photoswipe: photoswipe.init,\n\n updateAttributesAndDetails() {\n $(CONST.selectors.body).on(CONST.events.productStatusUpdate, function (e, data) {\n var $productContainer = $(selectors.productDetail);\n\n var activeDetailsHeading = $(`${selectors.detailsHeading}:not(${CONST.classes.collapsed})`).attr(CONST.attributes.id);\n var activeDetailsBody = $(selectors.detailBodyShow).attr(CONST.attributes.id);\n\n if (data.attributesHtml) {\n $productContainer.find(selectors.productAttribute)\n .empty()\n .html(data.attributesHtml);\n\n $('#' + activeDetailsHeading).removeClass(CONST.classes.collapsed);\n $('#' + activeDetailsBody).addClass(CONST.classes.show);\n }\n\n if (data.brand) {\n $productContainer.find(selectors.productBrand).eq(0)\n .empty()\n .html(data.brand);\n }\n\n if (data.shortDescription) {\n $productContainer.find(selectors.shortDescription).eq(0)\n .empty()\n .html(data.shortDescription);\n }\n\n if (data.longDescription) {\n $productContainer.find(selectors.longDescription)\n .empty()\n .html(data.longDescription);\n }\n });\n },\n showSpinner() {\n $(CONST.selectors.body).on([CONST.events.beforeAddToCart, CONST.events.productBeforeAttributeSelect].join(' '), function () {\n $.spinner().start();\n });\n },\n updateAttribute() {\n $(CONST.selectors.body).on(CONST.events.productAfterAttributeSelect, function (e, response) {\n const productData = response.data.product;\n const productID = productData.masterID ? productData.masterID : productData.id;\n\n const $productContainer = $(response.container);\n const $extraDiscountBadge = $(selectors.productDetailTopBlock + ' ' + selectors.extraDiscountBadge);\n\n const $productAttributes = $productContainer.find(CONST.selectors.product.attributes.container);\n $productAttributes.each(function () {\n const $productAttribute = $(this);\n const hasAttributeItems = $productAttribute.find(CONST.selectors.product.attributes.item).length > 0;\n const hasSelectedAttribute = $productAttribute.find(CONST.selectors.product.attributes.selected).length > 0;\n const $productAttributeMessage = $productAttribute.find(CONST.selectors.product.attributes.message);\n\n if (hasAttributeItems && hasSelectedAttribute) {\n $productAttribute.removeClass(CONST.classes.product.attributes.errorState);\n $productAttributeMessage.addClass(CONST.classes.dNone);\n }\n });\n\n if (productData.promotions) {\n productData.promotions.forEach(function (promotion) {\n if (promotion.media) {\n response.container.find(selectors.productPrimaryImages)\n .next()\n .empty()\n .html(\"\");\n }\n });\n } else {\n $extraDiscountBadge.html(\"\");\n }\n\n if ($(selectors.productBundleItems).length) {\n response.container.attr(CONST.attributes.product.productID, productData.id);\n response.container.find(selectors.productID).text(productID);\n } else if ($(selectors.productSetDetail)[0]) {\n response.container.attr(CONST.attributes.product.productID, productData.id);\n response.container.find(selectors.productID).text(productID);\n } else {\n $(selectors.productID)\n .text(productID)\n .attr(CONST.attributes.product.productID, productData.id);\n $(selectors.productDetailNotBundle)\n .attr(CONST.attributes.product.productID, productData.id)\n .data(CONST.attributes.pid, productData.id);\n\n // JVP @TODO: Refactor in architechture sprint\n // JVP @TODO: SFRA setup doesn't into account take the fact that some variations can have more/less images\n if ('images' in productData) {\n var $mainImages = $(selectors.productCarouselMain);\n var $thumbnails = $(selectors.productCarouselThumbs);\n\n $mainImages.slick(CONST.events.slick.unslick);\n $thumbnails.slick(CONST.events.slick.unslick);\n\n Object.keys(productData.images.hires).map(function (i) {\n var img = productData.images.hires[i];\n $mainImages.find(selectors.productDetailImageLink).eq(i).attr({\n href: img.url\n });\n });\n\n Object.keys(productData.images.large).map(function (i) {\n var img = productData.images.large[i];\n $mainImages.find(CONST.selectors.img).eq(i).attr({\n src: img.url,\n alt: img.alt\n });\n });\n\n Object.keys(productData.images.small).map(function (i) {\n var img = productData.images.small[i];\n $thumbnails.find(CONST.selectors.img).eq(i).attr({\n src: img.url,\n alt: img.alt\n });\n });\n\n $mainImages.slick($mainImages.data(CONST.attributes.slickConfig));\n $thumbnails.slick($thumbnails.data(CONST.attributes.slickConfig));\n }\n\n // JVP @TODO: Refactor in architechture sprint\n if ('variationAttributes' in productData) {\n Object.keys(productData.variationAttributes).map(function (i) {\n var attr = productData.variationAttributes[i];\n var $variations = $(selectors.productVariations);\n var $variantContainer = $variations.find('[data-attr=\"' + attr.id + '\"]');\n var $label = $variantContainer.find(selectors.attributeLabel);\n var labelTextSelect = $label.data(CONST.attributes.textSelect);\n var labelTextSelected = $label.data(CONST.attributes.textSelected);\n\n if (attr.selectedValue) {\n $label.text(labelTextSelected.replace('$$0$$', attr.selectedValue));\n } else {\n $label.text(labelTextSelect);\n $variantContainer.find(`${selectors.variantLink}.${classes.selectedVariant}`).removeClass(classes.selectedVariant);\n }\n });\n }\n\n // JVP @TODO: Refactor in architechture sprint\n var $shippingMessage = response.container.find(selectors.shippingMessage);\n\n if (productData.readyToOrder) {\n $shippingMessage.removeClass(CONST.classes.dNone).text(productData.shippingMessage);\n } else {\n $shippingMessage.addClass(CONST.classes.dNone);\n }\n\n var $wishlistLink = $(selectors.addToWishlist);\n if ('isInWishlist' in productData && $wishlistLink.length > 0) {\n if (productData.isInWishlist) {\n $wishlistLink.addClass(CONST.classes.product.isInWishlist);\n } else {\n $wishlistLink.removeClass(CONST.classes.product.isInWishlist);\n }\n }\n }\n });\n },\n updateAddToCart() {\n $(CONST.selectors.body).on(CONST.events.productUpdateAddToCart, function (e, response) {\n // The ATC button is no longer disabled by default.\n // When clicked upon a message should be shown to select a color/size\n // It is possible that some other elements should still be disabled.\n });\n },\n updateAvailability() {\n $(CONST.selectors.body).on(CONST.events.productAvailabilityUpdated, function (e, response) {\n $(selectors.availability, response.$productContainer)\n .data(CONST.attributes.readyToOrder, response.product.readyToOrder)\n .data(CONST.attributes.available, response.product.available);\n\n $(selectors.availabilityMessage, response.$productContainer)\n .empty().html(response.message);\n\n if ($(selectors.availabilityGlobal).length) {\n var allAvailable = $(selectors.availability).toArray()\n .every(function (item) { return $(item).data(CONST.attributes.available); });\n\n var allReady = $(selectors.availability).toArray()\n .every(function (item) { return $(item).data(CONST.attributes.readyToOrder); });\n\n $(selectors.availabilityGlobal)\n .data(CONST.attributes.readyToOrder, allReady)\n .data(CONST.attributes.available, allAvailable);\n\n $(`${selectors.availabilityGlobal} ${selectors.availabilityMessage}`).empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n }\n });\n },\n sizeChart() {\n var $sizeChart;\n $(selectors.sizechartLink).on(CONST.events.click, function (e) {\n e.preventDefault();\n var url = $(this).attr(CONST.attributes.href);\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $sizeChart = $(selectors.modalBody);\n $sizeChart.append(data.content);\n }\n });\n });\n },\n adjustChatIconPosition: adjustChatIconPosition\n};\n","const CONST = require('plugin_frontend_core/constants');\n\nconst selectors = {\n productCarouselMain: '.js-product-images-main',\n productCarouselThumbs: '.js-product-images-thumbs',\n productCarouselItem: '.js-product-images-item'\n};\n\nconst slickConfig = {\n mainImages: {\n container: selectors.productCarouselMain,\n slidesToShow: 1,\n slidesToScroll: 1,\n rows: 0,\n arrows: false,\n dots: true,\n fade: false,\n asNavFor: selectors.productCarouselThumbs,\n slide: selectors.productCarouselItem\n },\n thumbnails: {\n container: selectors.productCarouselThumbs,\n arrows: false,\n dots: false,\n asNavFor: selectors.productCarouselMain,\n focusOnSelect: true,\n speed: 1\n }\n};\n\n/**\n* Initializes the carousel for product images\n*/\nfunction initCarousels() {\n Object.keys(slickConfig).forEach((key) => {\n var $container = $(slickConfig[key].container + CONST.selectors.slick.notInitialized);\n\n if ($container[0]) {\n $container.slick(slickConfig[key]).data('slick-config', slickConfig[key]);\n }\n });\n}\n\n/**\n* Initializes the file\n*/\nfunction init() {\n $(document).ready(() => {\n initCarousels();\n });\n}\n\nmodule.exports = {\n init: init\n};\n","const CONST = require('plugin_frontend_core/constants');\n\nconst selectors = {\n scrollToLink: '.js-scrollto'\n};\n\n/**\n* Scrolls to element with animation\n* JVP @TODO: Add check/have option to account for a possible sticky header\n* @param {event} e - The click event\n*/\nfunction animateScrollToElement(e) {\n const $self = $(e.target);\n const targetElement = $self.attr(CONST.attributes.href);\n\n if (!$(targetElement)[0]) {\n return;\n }\n\n e.preventDefault();\n const scrollPosTarget = $(targetElement).offset().top;\n\n $(CONST.selectors.htmlBody).animate({\n scrollTop: scrollPosTarget\n }, CONST.times.scrollToAnimation);\n}\n\n/**\n* Binds event handlers\n*/\nfunction bindEventHandlers() {\n const $doc = $(document);\n\n $doc.on(CONST.events.click, selectors.scrollToLink, animateScrollToElement);\n}\n\n/**\n* Initializes the module\n*/\nfunction init() {\n bindEventHandlers();\n}\n\nmodule.exports = {\n init: init\n};\n","'use strict';\n\nconst CONST = require('plugin_frontend_core/constants');\n\nconst selectors = {\n badge: '.js-badge-promotion',\n imageContainer: '.js-primary-images'\n};\n\n/**\n * @private addImageBadge\n * @param {jQueryElement} $container - The PDP container\n * @param {JSON} badge - The productBadge\n */\nfunction addImageBadge($container, badge) {\n const template = `
\n \"${badge.alt}\"\n
`;\n $container.find(selectors.imageContainer).parent().append(template);\n}\n\n/**\n * @private addStringBadge\n * @param {jQueryElement} $container - The PDP container\n * @param {JSON} badge - The productBadge\n */\nfunction addStringBadge($container, badge) {\n const template = `
\n ${badge.value}\n
`;\n $container.find(selectors.imageContainer).parent().append(template);\n}\n\n/**\n * @private updateProductBadge\n * @param {JSON} product - JSON response of the Product model\n * @param {jQueryElement} $container - The PDP container\n */\nfunction updateProductBadge(product, $container) {\n if (!product) return;\n\n const badge = $container.find(selectors.badge);\n\n // remove existing badge\n if (badge.length > 0) {\n badge.remove();\n }\n\n if (!product.badge) return;\n\n if (product.badge.type === 'image') {\n addImageBadge($container, product.badge);\n } else if (product.badge.type === 'string') {\n addStringBadge($container, product.badge);\n }\n}\n\n/**\n * @public init\n */\nfunction init() {\n $(CONST.selectors.body).on(CONST.events.productAfterAttributeSelect, (evt, response) => {\n let $container = $(response.container);\n if ($container && $container.length > 0) {\n updateProductBadge(response.data.product, $container);\n }\n });\n}\n\nmodule.exports = init();\n","const CONST = require('plugin_frontend_core/constants');\n\nconst selectors = {\n pboContainer: '.js-product-back-order-container',\n pboLink: '.js-product-back-order-link',\n pboModal: '.js-product-back-order-modal',\n pboForm: '.js-product-back-order-form',\n pboAtcError: '.js-atc-error',\n pboSizeSelect: '.js-size-select',\n pboFeedback: '.js-product-back-order-feedback',\n pboSuccessScreen: '.js-product-back-order-success-screen',\n sizeVariations: '.product-detail-variants__size'\n};\n\nconst attributes = {\n modalTitle: 'data-modal-title',\n stockFormUrl: 'data-stockform-url',\n genericError: 'data-resource-genericerror'\n};\n\nconst dataValues = {\n modalTitle: 'modal-title'\n};\n\nconst $document = $(document);\n\n\n/**\n * Creates a modal element\n * @param {jQuery.event} e - Event\n */\nfunction formSubmitHandler(e) {\n e.preventDefault();\n const $form = $(e.target);\n const $feedback = $(selectors.pboFeedback);\n const $successScreen = $(selectors.pboSuccessScreen);\n const url = $form.attr(CONST.attributes.action);\n\n $form.spinner().start();\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n $form.spinner().stop();\n $(selectors.pboAtcError).remove();\n \n if (!data.success) {\n $feedback.html(`\n

${data.errorMessage}

\n `).removeClass(CONST.classes.dNone);\n } else {\n $form.addClass(CONST.classes.dNone);\n \n $successScreen.html(`\n

${data.successMessage}

\n `).removeClass(CONST.classes.dNone);\n }\n },\n error: function (err) {\n $form.spinner().stop();\n console.error('Out of stock eror:', err);\n\n var errorResource = $feedback.attr(attributes.genericError);\n\n $feedback.html(`\n

${errorResource}

\n `).removeClass(CONST.classes.dNone);\n }\n });\n}\n\n/**\n * Get the new modal html from the BE and update the DOM.\n * @param {jQuery.event} e - Event\n * @param {Object} response - the response\n */\nfunction setModalData(e, response) {\n const $pboContainer = $(selectors.pboContainer);\n const $pboLink = $(selectors.pboLink);\n const $pboModal = $(selectors.pboModal);\n const responseProduct = response.data.product;\n const variationId = responseProduct.variationGroupID;\n const variationAttributes = responseProduct.variationAttributes;\n let variationColor;\n\n for (var i = 0; i < variationAttributes.length; i++) {\n if (variationAttributes[i].attributeId === 'size') {\n const sizeValues = variationAttributes[i].values;\n let hasUnselectableVariant = false;\n\n for (var vai = 0; vai < sizeValues.length; vai++) {\n if (!sizeValues[vai].selectable) {\n hasUnselectableVariant = true;\n }\n\n if (sizeValues[vai].selected) {\n $pboModal.attr('data-selected-size', sizeValues[vai].id);\n $pboModal.attr('data-selected-var-id', sizeValues[vai].pvid);\n }\n }\n\n if (!hasUnselectableVariant) {\n $pboContainer.addClass(CONST.classes.dNone);\n } else {\n $pboContainer.removeClass(CONST.classes.dNone);\n }\n \n\n } else if (variationAttributes[i].attributeId === 'color') {\n variationColor = variationAttributes[i]['selectedValue'];\n }\n }\n\n if (!variationId || !variationColor) {\n return;\n }\n\n const stockFormUrl = $pboModal.attr(attributes.stockFormUrl) + variationId;\n\n $.ajax({\n url: stockFormUrl,\n type: 'get',\n dataType: 'html',\n success: function (data) {\n var $data = $(data);\n if ($data.find(selectors.pboForm)) {\n $pboModal.html(data);\n $pboLink.data(dataValues.modalTitle, `${$pboLink.attr(attributes.modalTitle)} ${variationColor}`);\n }\n },\n error: function (err) {\n console.error('setModalData:', err);\n }\n });\n}\n\nfunction openOutOfStockErrorModal(e, data){\n const $pboModal = $(selectors.pboModal);\n const $pboLink = $(selectors.pboLink);\n const selectedProductId = $pboModal.attr('data-selected-var-id') || false;\n const selectedProductSize = $pboModal.attr('data-selected-size') || false;\n let $pboSizeSelector = $pboModal.find(selectors.pboSizeSelect);\n\n // add error txt to modal\n $('

', {\n class : 'atc__error js-atc-error',\n text: data.message\n }).prependTo($pboModal);\n\n // get the original size options\n let sizes = [];\n let $orgSelectOptions = $pboSizeSelector.find('option');\n $orgSelectOptions.each(function(i){\n if ($(this).attr('value') !== selectedProductId) {\n sizes.push([$(this).text().trim(), $(this).attr('value')]);\n }\n });\n\n // Add the sold out variant\n if (selectedProductId && selectedProductSize) {\n sizes.push([selectedProductSize, selectedProductId]);\n }\n\n // Sort sizes\n sizes.sort(function(a, b) {\n return a[0] - b[0];\n });\n\n // remove existing options\n $orgSelectOptions.remove();\n\n // Create new options\n for (let size in sizes) {\n let $newoption = $('

\n
\n
${store.city} - ${store.address}
\n
${store.storeHoursMessage}
\n
\n
${store.stockMessage}
\n
\n `;\n });\n $storesList.append(storesHTML);\n } else {\n const notInStockMessage = $storesList.attr(attributes.notInStockMessage);\n\n if (notInStockMessage) {\n $storesList.html(`

${notInStockMessage}

`);\n }\n }\n\n // scroll back to top\n $storesList.scrollTop(0);\n}\n\n/**\n* getStoresList\n* @param {string} pid - The product id\n* @param {Object} userLocation - The user's location\n*/\nfunction getStoresList(pid, userLocation) {\n if (!pid || !userLocation) {\n console.log('fn getStoresList: Insufficient data');\n return;\n }\n $(selectors.storeModalDialog).spinner().start();\n\n let getStoresUrl = $(selectors.postalCodeForm).attr(CONST.attributes.action);\n getStoresUrl += `?pid=${pid}`;\n getStoresUrl += `&searchQuery=${userLocation.coords.latitude},${userLocation.coords.longitude}`;\n\n $.ajax({\n url: getStoresUrl,\n method: 'GET',\n dataType: 'json',\n success: function (data) {\n if (data.success) {\n populateHtmlWithStores(data.stores);\n }\n $(selectors.storeModalDialog).spinner().stop();\n },\n error: function () {\n $(selectors.storeModalDialog).spinner().stop();\n }\n });\n}\n\n\n/**\n* useLocation\n*/\nfunction useLocation() {\n $(selectors.storeModalDialog).spinner().start();\n navigator.geolocation.getCurrentPosition(function(geoData){\n const pid = $(selectors.product).attr(CONST.attributes.product.productID);\n $(selectors.locationError).addClass('d-none');\n getStoresList(pid, geoData);\n }, function(error){\n $(selectors.locationError).removeClass('d-none');\n $(selectors.storeModalDialog).spinner().stop();\n });\n}\n\n/**\n * @private getLatlongFromPostalCode\n * @param {string} postalCode - a postal code\n * @param {string} countryCode - two letters country code\n */\nfunction getLatlongFromPostalCode(postalCode, countryCode) {\n const geocoder = new google.maps.Geocoder();\n const componentRestrictions = {\n country: countryCode,\n postalCode: postalCode\n };\n\n return new Promise(function (resolve, reject) {\n geocoder.geocode({componentRestrictions: componentRestrictions}, function (results, status) {\n if (status === 'OK') {\n resolve([results[0].geometry.location.lat(), results[0].geometry.location.lng()]);\n } else {\n reject({\n status: status,\n message: 'Couldnt\\'t find the location for componentRestrictions:' + JSON.stringify(componentRestrictions),\n });\n }\n });\n });\n}\n\n/**\n * Returns the country code of the given zipcode by testing against to regexp pattern\n * @param {string} zipcode\n * @param {Object} zipCodeCountryCodeMapping\n * @return {string|undefine}\n * @private\n */\nfunction _getCountryCodeOfTheZipCode(zipcode, zipCodeCountryCodeMapping) {\n return Object.keys(zipCodeCountryCodeMapping).find(function (countryCode) {\n var pattern = zipCodeCountryCodeMapping[countryCode];\n return new RegExp(pattern).test(zipcode);\n });\n}\n\n/**\n* searchPostalCode\n* @param {event} event - The submit event\n*/\nfunction searchPostalCode(event) {\n event.preventDefault();\n const pid = $(selectors.product).attr(CONST.attributes.product.productID);\n const $form = $(selectors.postalCodeForm);\n const $field = $form.find(selectors.postalCodeField);\n const zipcode = $field && $field.val();\n const $storesList = $(selectors.storesList);\n\n if (!new RegExp($field.data(CONST.attributes.pattern)).test(zipcode)) {\n $storesList.empty();\n $storesList.html(`

${$field.attr(attributes.patternMismatch)}

`);\n return;\n }\n\n var countryCode = _getCountryCodeOfTheZipCode(zipcode, $field.data('pattern-mapping'));\n\n getLatlongFromPostalCode(zipcode, countryCode).then(result => {\n let location = {\n coords: {\n latitude: result[0],\n longitude: result[1]\n }\n };\n getStoresList(pid, location);\n }).catch(error => {\n $storesList.empty();\n if (error.status === 'ZERO_RESULTS') {\n $storesList.html(`

${$storesList.attr(attributes.postcodeUnknown)}

`);\n } else {\n $storesList.html(`

${$storesList.attr(attributes.resultError)}

`);\n }\n });\n}\n\n/**\n * showModal\n* @param {event} event - The click event\n*/\nfunction showModal(evt) {\n evt.preventDefault();\n const $productContainer = $(this).closest(CONST.selectors.product.jsProductContainer);\n const $productAttributes = $productContainer.find(CONST.selectors.product.attributes.container);\n let isReady = true;\n\n $productAttributes.each(function () {\n const $productAttribute = $(this);\n const hasAttributeItems = $productAttribute.find(CONST.selectors.product.attributes.item).length > 0; // does the attribute have any items/variations?\n const noSelectedAttribute = $productAttribute.find(CONST.selectors.product.attributes.selected).length === 0; // does the attribute not have a selected item/variation?\n const $productAttributeMessage = $productContainer.find(CONST.selectors.product.availabilityMsg);\n\n if (hasAttributeItems && noSelectedAttribute) {\n $productAttribute.addClass(CONST.classes.product.attributes.errorState);\n $productAttributeMessage.removeClass(CONST.classes.dNone);\n isReady = false;\n }\n });\n\n if (!isReady) {\n return false;\n }\n\n $(selectors.storeModalDialog).parent().modal('show');\n}\n\nfunction onAttributeSelect(evt, response) {\n const data = response.data;\n if (!(data.product && data.product.variationAttributes)) {\n return;\n }\n const $modal = $(selectors.storeModalDialog);\n data.product.variationAttributes.forEach(attr => {\n if (attr.attributeId === 'size' && attr.selectedValue) {\n $modal.find(selectors.productColorAttribute).text(attr.selectedValue);\n }\n });\n if (data.product.images && data.product.images.small) {\n $modal.find(selectors.productImageAttribute).attr(CONST.attributes.src, data.product.images.small[0].url);\n }\n // empty previous results\n $modal.find(selectors.storesList).empty();\n}\n\n/**\n* Initializes the module\n*/\nfunction init() {\n const locationAnchor = document.querySelector(selectors.locationAnchor);\n const postalCodeForm = document.querySelector(selectors.postalCodeForm);\n const searchTrigger = document.querySelector(selectors.searchTrigger);\n const trigger = document.querySelector(selectors.trigger);\n\n locationAnchor.addEventListener(CONST.events.click, useLocation);\n postalCodeForm.addEventListener(CONST.events.submit, searchPostalCode);\n searchTrigger.addEventListener(CONST.events.click, searchPostalCode);\n $(CONST.selectors.body).on(CONST.events.productAfterAttributeSelect, onAttributeSelect);\n\n trigger.addEventListener(CONST.events.click, showModal);\n}\n\nmodule.exports = {\n init: init\n};\n","'use strict';\n\nconst CONST = require('plugin_frontend_core/constants');\n\nmodule.exports = {\n addToWishlist: function () {\n $(document).on(CONST.events.click, CONST.selectors.product.addToWishlist, function clickAddToWishlist(e) {\n e.preventDefault();\n \n const $self = $(this);\n const $productContainer = $self.closest(CONST.selectors.product.jsProductContainer);\n let isReady = true;\n\n // Loop over all attributes\n const $productAttributes = $productContainer.find(CONST.selectors.product.attributes.container);\n\n $productAttributes.each(function () {\n const $productAttribute = $(this);\n const hasAttributeItems = $productAttribute.find(CONST.selectors.product.attributes.item).length > 0; // does the attribute have any items/variations?\n const noSelectedAttribute = $productAttribute.find(CONST.selectors.product.attributes.selected).length === 0; // does the attribute not have a selected item/variation?\n const $productAttributeMessage = $productContainer.find(CONST.selectors.product.availabilityMsg);\n \n if (hasAttributeItems && noSelectedAttribute) {\n $productAttribute.addClass(CONST.classes.product.attributes.errorState);\n $productAttributeMessage.removeClass(CONST.classes.dNone);\n isReady = false;\n }\n });\n\n if (!isReady) {\n return false;\n }\n\n const pid = $productContainer.attr(CONST.attributes.product.productID);\n const urlAdd = $self.attr(CONST.attributes.urlAdd);\n const urlRemove = $self.attr(CONST.attributes.urlRemove);\n const optionId = $productContainer.find(CONST.selectors.product.productOption).attr(CONST.attributes.product.optionID) || null;\n const optionVal = $productContainer.find(CONST.selectors.product.productOptionSelected).attr(CONST.attributes.product.valueID) || null;\n\n\n const addToWishlistData = {\n origin: 'wishlist.js',\n optionId: optionId,\n optionVal: optionVal,\n pid: pid,\n trigger: $self,\n urlAdd: urlAdd,\n urlRemove: urlRemove\n };\n\n window.pubSub.publish(CONST.pubSubEvents.wishlist.clickAddToWishlist, addToWishlistData);\n });\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","\nvar content = require(\"!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/sass-loader/lib/loader.js!./_exports.scss\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../../../../../../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/sass-loader/lib/loader.js!./_exports.scss\", function() {\n\t\tvar newContent = require(\"!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/sass-loader/lib/loader.js!./_exports.scss\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","exports = module.exports = require(\"../../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"/**\\n * CSS Font family names\\n *\\n * usage:\\n * font-family: font-family(primary)\\n * font: 12px/24px font-family(secondary)\\n */\\n/**\\n * Font types, define font styling, optionally combined with breakpoints\\n * retrieve font style with the mixin: font-type($name)\\n *\\n * usage:\\n * @include font-type(button)\\n */\\n\", \"\"]);\n\n// exports\nexports.locals = {\n\t\"breakpoint_xs\": \"0px\",\n\t\"breakpoint_sm\": \"520px\",\n\t\"breakpoint_md\": \"720px\",\n\t\"breakpoint_lg\": \"992px\",\n\t\"breakpoint_xl\": \"1200px\"\n};","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target) {\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of