{"version":3,"names":[],"mappings":"","sources":["single-slider.js"],"sourcesContent":["function init_360_spinner() {\n\t// Init\n\twindow.CI360.init();\n\n\t// Reconfigure controls and reveal\n\tsetTimeout(function () {\n\t\tjQuery(\".cloudimage-inner-box div[style*='/js-cloudimage-360-view/full_screen.svg']\")\n\t\t\t.css(\"background-image\", \"none\")\n\t\t\t.append(\"\")\n\t\t\t.addClass(\"cloudimage-360-control cloudimage-360-control--fullscreen\");\n\t\tjQuery(\".cloudimage-inner-box div[style*='/js-cloudimage-360-view/loupe.svg']\")\n\t\t\t.css(\"background-image\", \"none\")\n\t\t\t.append(\"\")\n\t\t\t.addClass(\"cloudimage-360-control cloudimage-360-control--zoom\");\n\t\tjQuery(\".cloudimage-360-control\").addClass(\"visible\");\n\t}, 1500);\n\n\t// Play/pause button logic\n\tlet isPlaying360 = false;\n\tjQuery(\".cloudimage-360-play\").click(function () {\n\t\tisPlaying360 = !isPlaying360;\n\t\t// console.log(\"in cloudimage-360-play\");\n\t\tif (isPlaying360) {\n\t\t\t// console.log(\"isPlaying360\");\n\t\t\tdocument.getElementsByClassName(\"cloudimage-360-next\")[0].dispatchEvent(new Event(\"mousedown\"));\n\t\t\tjQuery(\".cloudimage-360-play i\").removeClass(\"fa-play\").addClass(\"fa-pause\");\n\t\t} else {\n\t\t\t// console.log(\"! isPlaying360\");\n\t\t\tdocument.getElementsByClassName(\"cloudimage-360-next\")[0].dispatchEvent(new Event(\"mouseup\"));\n\t\t\tjQuery(\".cloudimage-360-play i\").removeClass(\"fa-pause\").addClass(\"fa-play\");\n\t\t}\n\t});\n}\n\njQuery(document).ready(function () {\n\tvar slickConfigMain = {\n\t\tasNavFor: \"#slider-thumbs\",\n\t\tslidesToScroll: 1,\n\t\tslidesToShow: 1,\n\t\tinfinite: false,\n\t\tvertical: true,\n\t\tadaptiveHeight: true,\n\t\tarrows: false,\n\t\tswipe: false,\n\t\tresponsive: [\n\t\t\t{\n\t\t\t\tbreakpoint: 991,\n\t\t\t\tsettings: {\n\t\t\t\t\tvertical: false,\n\t\t\t\t\tadaptiveHeight: false,\n\t\t\t\t\tswipe: true,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t};\n\n\tvar slickConfigThumbs = {\n\t\tasNavFor: \"#slider-main\",\n\t\tslidesToScroll: 1,\n\t\tslidesToShow: 4,\n\t\tinfinite: false,\n\t\tvertical: true,\n\t\tarrows: true,\n\t\tswipe: true,\n\t\tappendArrows: jQuery(\"#slider-thumbs\").parent(),\n\t\tprevArrow:\n\t\t\t\"\",\n\t\tnextArrow:\n\t\t\t\"\",\n\t\tresponsive: [\n\t\t\t{\n\t\t\t\tbreakpoint: 991,\n\t\t\t\tsettings: {\n\t\t\t\t\tslidesToShow: 6,\n\t\t\t\t\tvertical: false,\n\t\t\t\t\tarrows: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tbreakpoint: 767,\n\t\t\t\tsettings: {\n\t\t\t\t\tslidesToShow: 5,\n\t\t\t\t\tvertical: false,\n\t\t\t\t\tarrows: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tbreakpoint: 576,\n\t\t\t\tsettings: {\n\t\t\t\t\tslidesToShow: 4,\n\t\t\t\t\tvertical: false,\n\t\t\t\t\tarrows: false,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t};\n\n\tvar hash = window.location.hash;\n\tif (hash) {\n\t\tvar starting_slide = jQuery(\"#slider-main\").find(hash).index();\n\n\t\tif (starting_slide > 0) {\n\t\t\tslickConfigMain.initialSlide = starting_slide;\n\t\t\tslickConfigThumbs.initialSlide = starting_slide;\n\t\t}\n\t}\n\n\tjQuery(\".slider\").on(\"init\", function (slick) {\n\t\tjQuery(\"body\").addClass(\"slider-active\");\n\t});\n\n\tjQuery(\"#slider-main\").on(\"init\", function (event, slick) {\n\t\t// Set up 360 view nonsense\n\t\tif (jQuery(\"#slider-main\").find(\".slide-360\").length > 0) {\n\t\t\t// console.log(\"360 found\");\n\t\t\tinit_360_spinner();\n\t\t}\n\n\t\t// Scroll slider into view\n\t\tif (hash && starting_slide > 0) {\n\t\t\t// console.log(event);\n\t\t\t// console.log(event.currentTarget.offsetTop);\n\t\t\twindow.scrollTo(0, event.currentTarget.offsetTop - 72);\n\t\t}\n\t});\n\n\tjQuery(\"#slider-main\").on(\"beforeChange\", function (event, slick) {\n\t\tvar currentSlide, slideType, player, command;\n\t\t//find the current slide element and decide which player API we need to use.\n\t\tcurrentSlide = jQuery(slick.$slider).find(\".slick-current\");\n\n\t\t//determine which type of slide this, via a class on the slide container. This reads the second class, you could change this to get a data attribute or something similar if you don't want to use classes.\n\t\tslideType = currentSlide.find(\".slide\").attr(\"class\").split(\" \")[1];\n\n\t\t//get the iframe inside this slide.\n\t\tplayer = currentSlide.find(\"iframe\").get(0);\n\n\t\t//check if the player exists.\n\t\tif (player !== undefined) {\n\t\t\tif (slideType === \"vimeo\") {\n\t\t\t\tcommand = {\n\t\t\t\t\tmethod: \"pause\",\n\t\t\t\t\tvalue: \"true\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tcommand = {\n\t\t\t\t\tevent: \"command\",\n\t\t\t\t\tfunc: \"pauseVideo\",\n\t\t\t\t};\n\t\t\t}\n\t\t\t//post our command to the iframe.\n\t\t\t// player.contentWindow.postMessage(JSON.stringify(command), \"*\");\n\t\t}\n\t});\n\n\t// Init sliders\n\n\tjQuery(\"#slider-main\").slick(slickConfigMain);\n\tjQuery(\"#slider-thumbs\").slick(slickConfigThumbs);\n\n\tjQuery(\".related-slider\").slick({\n\t\trows: 2,\n\t\tslidesToScroll: 3,\n\t\tslidesToShow: 3,\n\t\tinfinite: false,\n\t\tarrows: false,\n\t\tdots: true,\n\t\tresponsive: [\n\t\t\t{\n\t\t\t\tbreakpoint: 9999,\n\t\t\t\tsettings: \"unslick\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tbreakpoint: 991,\n\t\t\t\tsettings: {\n\t\t\t\t\trows: 2,\n\t\t\t\t\tslidesToScroll: 2,\n\t\t\t\t\tslidesToShow: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tbreakpoint: 576,\n\t\t\t\tsettings: {\n\t\t\t\t\trows: 1,\n\t\t\t\t\tslidesToScroll: 1,\n\t\t\t\t\tslidesToShow: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t});\n\n\t// Add click events\n\n\tjQuery(\"#slider-thumbs a\").on(\"click\", function (event) {\n\t\tevent.preventDefault();\n\t\tvar target = jQuery(this).data(\"slide-number\");\n\n\t\tjQuery(\"#slider-thumbs, #slider-main\").slick(\"slickGoTo\", target);\n\t});\n});\n"],"file":"single-slider.js"}