From 2e1e7aecc5bf053dd2570c0d33ffec3cb6dd6476 Mon Sep 17 00:00:00 2001 From: Amr Wagdy Date: Wed, 30 Oct 2024 15:29:50 +0300 Subject: [PATCH] Updates --- assets/canvas.worker-CauLFNM0.js.map | 1 + assets/index-49ZK8EAw.js | 9 - assets/index-BHPHGWSL.js | 9 + index.html | 29 +- js-cloudimage-360-view.min.js | 10 + js-cloudimage-360-view.min.js.map | 1 + js-cloudimage-360-view.min.mjs | 2111 -------------------------- js-cloudimage-360-view.min.umd.js | 9 - 8 files changed, 24 insertions(+), 2155 deletions(-) create mode 100644 assets/canvas.worker-CauLFNM0.js.map delete mode 100644 assets/index-49ZK8EAw.js create mode 100644 assets/index-BHPHGWSL.js create mode 100644 js-cloudimage-360-view.min.js create mode 100644 js-cloudimage-360-view.min.js.map delete mode 100644 js-cloudimage-360-view.min.mjs delete mode 100644 js-cloudimage-360-view.min.umd.js diff --git a/assets/canvas.worker-CauLFNM0.js.map b/assets/canvas.worker-CauLFNM0.js.map new file mode 100644 index 0000000..53c8f3a --- /dev/null +++ b/assets/canvas.worker-CauLFNM0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"canvas.worker-CauLFNM0.js","sources":["../src/canvas.worker.js","../src/utils/zoom/calculate-zoomed-dimensions.js","../src/utils/zoom/calculate-zoomed-offset.js"],"sourcesContent":["import { calculateZoomedDimensions, calculateZoomOffsets } from './utils';\n\nlet canvas, ctx, dpr, drawWidth, drawHeight, wideImage;\n\nself.onmessage = async (event) => {\n const {\n action,\n offscreen,\n devicePixelRatio,\n imageData,\n zoomScale,\n pointerX,\n pointerY,\n imageAspectRatio,\n containerWidth,\n containerHeight,\n } = event.data;\n\n switch (action) {\n case 'initCanvas':\n initCanvas(offscreen, devicePixelRatio);\n break;\n case 'adaptCanvasSize':\n adaptCanvasSize(imageAspectRatio, containerWidth, containerHeight);\n break;\n case 'drawImageOnCanvas':\n drawImageOnCanvas(imageData, zoomScale, pointerX, pointerY);\n break;\n default:\n break;\n }\n};\n\nconst initCanvas = (offscreenCanvas, devicePixelRatio) => {\n canvas = offscreenCanvas;\n ctx = canvas.getContext('2d');\n dpr = devicePixelRatio;\n};\n\nconst adaptCanvasSize = (imageAspectRatio, containerWidth, containerHeight) => {\n const containerAspectRatio = containerWidth / containerHeight;\n wideImage = imageAspectRatio > containerAspectRatio;\n\n canvas.width = containerWidth * dpr;\n canvas.height = containerHeight * dpr;\n ctx.scale(dpr, dpr);\n\n if (wideImage) {\n drawWidth = containerWidth;\n drawHeight = containerWidth / imageAspectRatio;\n } else {\n drawHeight = containerHeight;\n drawWidth = containerHeight * imageAspectRatio;\n }\n\n ctx.imageSmoothingEnabled = true;\n ctx.imageSmoothingQuality = 'high';\n};\n\n// Draw the image on the OffscreenCanvas\nconst drawImageOnCanvas = (imageData = {}, zoomScale = 1, pointerX = 0, pointerY = 0) => {\n const { bitmapImage } = imageData;\n if (!canvas || !bitmapImage) return;\n\n let offsetX, offsetY;\n if (wideImage) {\n offsetX = 0;\n offsetY = (canvas.height / dpr - drawHeight) / 2;\n } else {\n offsetX = (canvas.width / dpr - drawWidth) / 2;\n offsetY = 0;\n }\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (zoomScale !== 1) {\n const { zoomedWidth, zoomedHeight } = calculateZoomedDimensions(drawWidth, drawHeight, zoomScale);\n\n const { zoomOffsetX, zoomOffsetY } = calculateZoomOffsets({\n pointerX,\n pointerY,\n imageData,\n zoomedWidth,\n zoomedHeight,\n drawWidth,\n drawHeight,\n });\n\n ctx.drawImage(\n bitmapImage,\n zoomOffsetX,\n zoomOffsetY,\n zoomedWidth,\n zoomedHeight,\n offsetX,\n offsetY,\n drawWidth,\n drawHeight\n );\n } else {\n ctx.drawImage(bitmapImage, offsetX, offsetY, drawWidth, drawHeight);\n }\n};\n","export const calculateZoomedDimensions = (drawWidth, drawHeight, zoomScale) => {\n const zoomedWidth = drawWidth / zoomScale;\n const zoomedHeight = drawHeight / zoomScale;\n return { zoomedWidth, zoomedHeight };\n};\n","export const calculateZoomOffsets = ({\n pointerX,\n pointerY,\n imageData,\n zoomedWidth,\n zoomedHeight,\n drawWidth,\n drawHeight,\n}) => {\n const { naturalWidth, naturalHeight } = imageData;\n let zoomOffsetX = (pointerX / drawWidth) * naturalWidth - zoomedWidth / 2;\n let zoomOffsetY = (pointerY / drawHeight) * naturalHeight - zoomedHeight / 2;\n\n // Calculate max offset values\n const maxOffsetX = Math.max(0, naturalWidth - zoomedWidth);\n const maxOffsetY = Math.max(0, naturalHeight - zoomedHeight);\n\n // Clamp zoom offsets to the valid range\n zoomOffsetX = Math.max(0, Math.min(zoomOffsetX, maxOffsetX));\n zoomOffsetY = Math.max(0, Math.min(zoomOffsetY, maxOffsetY));\n\n return { zoomOffsetX, zoomOffsetY };\n};\n"],"names":["canvas","ctx","dpr","drawWidth","drawHeight","wideImage","self","onmessage","async","event","action","offscreen","devicePixelRatio","imageData","zoomScale","pointerX","pointerY","imageAspectRatio","containerWidth","containerHeight","data","initCanvas","adaptCanvasSize","drawImageOnCanvas","offscreenCanvas","getContext","width","height","scale","imageSmoothingEnabled","imageSmoothingQuality","bitmapImage","offsetX","offsetY","clearRect","zoomedWidth","zoomedHeight","calculateZoomedDimensions","zoomOffsetX","zoomOffsetY","naturalWidth","naturalHeight","maxOffsetX","Math","max","maxOffsetY","min","calculateZoomOffsets","drawImage"],"mappings":";;;;;;;;;yBAEA,IAAIA,EAAQC,EAAKC,EAAKC,EAAWC,EAAYC,EAExCC,KAAAC,UAAYC,MAAOC,IAChB,MAAAC,OACJA,EAAAC,UACAA,EAAAC,iBACAA,EAAAC,UACAA,EAAAC,UACAA,EAAAC,SACAA,EAAAC,SACAA,EAAAC,iBACAA,EAAAC,eACAA,EAAAC,gBACAA,GACEV,EAAMW,KAEV,OAAQV,GACN,IAAK,aACHW,EAAWV,EAAWC,GACtB,MACF,IAAK,kBACaU,EAAAL,EAAkBC,EAAgBC,GAClD,MACF,IAAK,oBACeI,EAAAV,EAAWC,EAAWC,EAAUC,GAIxD,EAGM,MAAAK,EAAa,CAACG,EAAiBZ,KAC1BZ,EAAAwB,EACHvB,EAAAD,EAAOyB,WAAW,MAClBvB,EAAAU,CAAA,EAGFU,EAAkB,CAACL,EAAkBC,EAAgBC,KAEzDd,EAAYY,EADiBC,EAAiBC,EAG9CnB,EAAO0B,MAAQR,EAAiBhB,EAChCF,EAAO2B,OAASR,EAAkBjB,EAC9BD,EAAA2B,MAAM1B,EAAKA,GAEXG,GACUF,EAAAe,EACZd,EAAac,EAAiBD,IAEjBb,EAAAe,EACbhB,EAAYgB,EAAkBF,GAGhChB,EAAI4B,uBAAwB,EAC5B5B,EAAI6B,sBAAwB,MAAA,EAIxBP,EAAoB,CAACV,EAAY,CAAA,EAAIC,EAAY,EAAGC,EAAW,EAAGC,EAAW,KAC3E,MAAAe,YAAEA,GAAgBlB,EACpB,IAACb,IAAW+B,EAAa,OAE7B,IAAIC,EAASC,EAWb,GAVI5B,GACQ2B,EAAA,EACCC,GAAAjC,EAAO2B,OAASzB,EAAME,GAAc,IAEpC4B,GAAAhC,EAAO0B,MAAQxB,EAAMC,GAAa,EACnC8B,EAAA,GAGZhC,EAAIiC,UAAU,EAAG,EAAGlC,EAAO0B,MAAO1B,EAAO2B,QAEvB,IAAdb,EAAiB,CACnB,MAAMqB,YAAEA,EAAaC,aAAAA,GC5EgB,EAACjC,EAAWC,EAAYU,KAGxD,CAAEqB,YAFWhC,EAAYW,EAEVsB,aADDhC,EAAaU,ID0EMuB,CAA0BlC,EAAWC,EAAYU,IAEjFwB,YAAEA,EAAAC,YAAaA,GE9EW,GAClCxB,WACAC,WACAH,YACAsB,cACAC,eACAjC,UAAAA,EACAC,WAAAA,MAEM,MAAAoC,aAAEA,EAAcC,cAAAA,GAAkB5B,EACxC,IAAIyB,EAAevB,EAAWZ,EAAaqC,EAAeL,EAAc,EACpEI,EAAevB,EAAWZ,EAAcqC,EAAgBL,EAAe,EAG3E,MAAMM,EAAaC,KAAKC,IAAI,EAAGJ,EAAeL,GACxCU,EAAaF,KAAKC,IAAI,EAAGH,EAAgBL,GAMxC,OAHPE,EAAcK,KAAKC,IAAI,EAAGD,KAAKG,IAAIR,EAAaI,IAChDH,EAAcI,KAAKC,IAAI,EAAGD,KAAKG,IAAIP,EAAaM,IAEzC,CAAEP,cAAaC,cAAa,EFyDIQ,CAAqB,CACxDhC,WACAC,WACAH,YACAsB,cACAC,eACAjC,YACAC,eAGEH,EAAA+C,UACFjB,EACAO,EACAC,EACAJ,EACAC,EACAJ,EACAC,EACA9B,EACAC,EAEN,MACIH,EAAI+C,UAAUjB,EAAaC,EAASC,EAAS9B,EAAWC,EAC5D"} \ No newline at end of file diff --git a/assets/index-49ZK8EAw.js b/assets/index-49ZK8EAw.js deleted file mode 100644 index ae31bd7..0000000 --- a/assets/index-49ZK8EAw.js +++ /dev/null @@ -1,9 +0,0 @@ -var qt=Object.defineProperty;var _t=(t,e,i)=>e in t?qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var ot=(t,e,i)=>_t(t,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tt="Expected a function",st=NaN,Qt="[object Symbol]",ei=/^\s+|\s+$/g,ti=/^[-+]0x[0-9a-f]+$/i,ii=/^0b[01]+$/i,ni=/^0o[0-7]+$/i,oi=parseInt,si=typeof Re=="object"&&Re&&Re.Object===Object&&Re,ri=typeof self=="object"&&self&&self.Object===Object&&self,ai=si||ri||Function("return this")(),li=Object.prototype,ci=li.toString,di=Math.max,ui=Math.min,Me=function(){return ai.Date.now()};function hi(t,e,i){var n,o,s,a,r,l,c=0,d=!1,h=!1,f=!0;if(typeof t!="function")throw new TypeError(Tt);e=rt(e)||0,Xe(i)&&(d=!!i.leading,h="maxWait"in i,s=h?di(rt(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f);function u(m){var I=n,E=o;return n=o=void 0,c=m,a=t.apply(E,I),a}function y(m){return c=m,r=setTimeout(x,e),d?u(m):a}function g(m){var I=m-l,E=m-c,S=e-I;return h?ui(S,s-E):S}function v(m){var I=m-l,E=m-c;return l===void 0||I>=e||I<0||h&&E>=s}function x(){var m=Me();if(v(m))return C(m);r=setTimeout(x,g(m))}function C(m){return r=void 0,f&&n?u(m):(n=o=void 0,a)}function O(){r!==void 0&&clearTimeout(r),c=0,n=l=o=r=void 0}function b(){return r===void 0?a:C(Me())}function w(){var m=Me(),I=v(m);if(n=arguments,o=this,l=m,I){if(r===void 0)return y(l);if(h)return r=setTimeout(x,e),u(l)}return r===void 0&&(r=setTimeout(x,e)),a}return w.cancel=O,w.flush=b,w}function pi(t,e,i){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(Tt);return Xe(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),hi(t,e,{leading:n,maxWait:e,trailing:o})}function Xe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function fi(t){return!!t&&typeof t=="object"}function mi(t){return typeof t=="symbol"||fi(t)&&ci.call(t)==Qt}function rt(t){if(typeof t=="number")return t;if(mi(t))return st;if(Xe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(ei,"");var i=ii.test(t);return i||ni.test(t)?oi(t.slice(2),i?2:8):ti.test(t)?st:+t}var vi=pi;const at=Jt(vi),T={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},gi=[!1,0,null,void 0,"false","0","null","undefined"],k={X:"x-axis",Y:"y-axis",CENTER:"center"},yi=["folder","folderX","folderY","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY"],bi=[37,39],wi=[38,40],lt=10,p={folder:"/",apiVersion:"v7",filenameX:"image-{index}.jpg",filenameY:null,imageListX:null,imageListY:null,indexZeroBase:0,amountX:0,amountY:0,speed:80,dragSpeed:150,draggable:!0,swipeable:!0,keys:!1,keysReverse:!1,autoplay:!1,autoplayBehavior:T.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,fullscreen:!1,magnifier:null,bottomCircle:!0,bottomCircleOffset:5,ciToken:null,ciFilters:null,ciTransformation:null,lazyload:!0,dragReverse:!1,stopAtEdges:!1,imageInfo:!1,initialIconShown:!0,hotspots:null},xi=t=>({folder:Y(t,"folder",p.folder),apiVersion:Y(t,"api-version",p.apiVersion),filenameX:Y(t,"filename")||Y(t,"filename-x")||p.filenameX,filenameY:Y(t,"filename-y",p.filenameY),imageListX:Y(t,"image-list-x",p.imageListX),imageListY:Y(t,"image-list-y",p.imageListY),indexZeroBase:parseInt(Y(t,"index-zero-base",p.indexZeroBase),10),amountX:parseInt(Y(t,"amount-x",p.amountX),10),amountY:parseInt(Y(t,"amount-y",p.amountY),10),speed:parseInt(Y(t,"speed",p.speed),10),dragSpeed:parseInt(Y(t,"drag-speed",p.dragSpeed),10),draggable:W(t,"draggable",p.draggable),swipeable:W(t,"swipeable",p.swipeable),keys:W(t,"keys",p.keys),keysReverse:W(t,"keys-reverse",p.keysReverse),autoplay:W(t,"autoplay",p.autoplay),autoplayBehavior:Y(t,"autoplay-behavior",p.autoplayBehavior),playOnce:W(t,"play-once",p.playOnce),autoplayReverse:W(t,"autoplay-reverse",p.autoplayReverse),pointerZoom:parseFloat(Y(t,"pointer-zoom",p.pointerZoom),10),fullscreen:W(t,"fullscreen")||W(t,"full-screen",p.fullscreen),magnifier:parseFloat(Y(t,"magnifier",p.magnifier),10),bottomCircleOffset:parseInt(Y(t,"bottom-circle-offset",p.bottomCircleOffset),10),ciToken:Y(t,"responsive",p.ciToken),ciFilters:Y(t,"filters",p.ciFilters),ciTransformation:Y(t,"transformation",p.ciTransformation),lazyload:W(t,"lazyload",p.lazyload),dragReverse:W(t,"drag-reverse",p.dragReverse),stopAtEdges:W(t,"stop-at-edges",p.stopAtEdges),imageInfo:W(t,"info",p.imageInfo),initialIconShown:!ct(t,"initial-icon"),bottomCircle:!ct(t,"bottom-circle")}),Ii=t=>({folder:t.folder||p.folder,apiVersion:t.apiVersion||p.apiVersion,filenameX:t.filenameX||t.filename||p.filenameX,filenameY:t.filenameY||p.filenameY,imageListX:t.imageListX||p.imageListX,imageListY:t.imageListY||p.imageListY,indexZeroBase:parseInt(t.indexZeroBase??p.indexZeroBase,10),amountX:parseInt(t.amountX??p.amountX,10),amountY:parseInt(t.amountY??p.amountY,10),speed:parseInt(t.speed??p.speed,10),draggable:t.draggable??p.draggable,swipeable:t.swipeable??p.swipeable,dragSpeed:parseInt(t.dragSpeed??p.dragSpeed,10),keys:t.keys??p.keys,keysReverse:t.keysReverse??p.keysReverse,autoplay:t.autoplay??p.autoplay,autoplayBehavior:t.autoplayBehavior||p.autoplayBehavior,playOnce:t.playOnce??p.playOnce,autoplayReverse:t.autoplayReverse??p.autoplayReverse,pointerZoom:parseFloat(t.pointerZoom??p.pointerZoom,10),fullscreen:t.fullscreen??p.fullscreen,magnifier:parseFloat(t.magnifier??p.magnifier,10),bottomCircleOffset:parseInt(t.bottomCircleOffset??p.bottomCircleOffset,10),ciToken:t.ciToken||p.ciToken,ciFilters:t.ciFilters||p.ciFilters,ciTransformation:t.ciTransformation||p.ciTransformation,lazyload:t.lazyload??p.lazyload,dragReverse:t.dragReverse??p.dragReverse,stopAtEdges:t.stopAtEdges??p.stopAtEdges,imageInfo:t.imageInfo??p.imageInfo,initialIconShown:t.initialIconShown??p.initialIconShown,bottomCircle:t.bottomCircle??p.bottomCircle,hotspots:t.hotspots??p.hotspots}),Y=(t,e,i)=>t.getAttribute(e)||t.getAttribute(`data-${e}`)||i,W=(t,e,i)=>t.hasAttribute(e)||t.hasAttribute(`data-${e}`)||i,ct=(t,e)=>Y(t,e,null)==="false",Ci=(t,e,i=yi)=>i.some(n=>n in e&&e[n]!==t[n]),Oi=(t=1)=>{const e=Math.round(window.devicePixelRatio||1);return parseInt(t)*e},Ei=(t,e,i)=>new URL(t).origin.includes("cloudimg")?t:`https://${e}.cloudimg.io/${i}${t}`,Si=({ciTransformation:t,responsiveWidth:e,ciFilters:i})=>{const n=`width=${e}`,o=t||n,s=i?`&f=${i}`:"";return`${o}${s}`},be=(t,e)=>{const{folder:i,apiVersion:n,filename:o="",ciParams:s}=t,{ciToken:a,ciFilters:r,ciTransformation:l}=s||{},c=`${i}${o}`;if(!a)return c;const d=gi.includes(n)?null:n,h=d?`${d}/`:"",f=Oi(e),u=Ei(c,a,h),y=Si({ciTransformation:l,responsiveWidth:f,ciFilters:r});return`${u}${y?"?":""}${y}`},Ri=(t,e,i)=>{const[n,o]=t.split("?"),s=`${e}=${encodeURIComponent(i)}`;if(!o)return`${n}?${s}`;const a=new URLSearchParams(o);return a.set(e,i),`${n}?${a.toString()}`},Yi=(t,e)=>Ri(t,"width",e),kt=(t,e=0)=>(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t),Li=(t,{amount:e=0,indexZeroBase:i=0}={})=>Array.from({length:e},(n,o)=>t.replace("{index}",kt(o+1,i))),Xi=({imagesUrls:t,onFirstImageLoad:e,onImageLoad:i,onAllImagesLoad:n,autoplayReverse:o})=>{let s=0;const a=t.length,r=[],l=(h,f)=>{const u=new Image;u.crossOrigin="anonymous",u.src=h,u.onload=async()=>{const y=await createImageBitmap(u),g={src:h,bitmapImage:y,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};s++,r[f]=g,i==null||i(g,f),s===a&&(n==null||n(r))},u.onerror=()=>{console.error(`Failed to load image: ${h}`),s++,s===a&&(n==null||n(r))}},c=new Image,d=t[o?t.length-1:0];c.crossOrigin="anonymous",c.src=d,c.onload=async()=>{const h=await createImageBitmap(c),f={src:d,bitmapImage:h,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};r[0]=f,s++,e==null||e(f),i==null||i(f,0);for(let u=1;u{console.error(`Failed to load first image: ${t[0]}`),s++;for(let h=1;h{let r={x:!1,y:!1},l=[],c=[];const d=t||i.imageList.length,h=e||n.imageList.length,f=()=>{r.x&&r.y&&a(l,c)},u=({cdnPath:y,config:g,orientation:v,loadedImages:x,onFirstImageLoad:C})=>{const O=v===k.X,b=g.imageList.length?g.imageList:Li(y,g);Xi({imagesUrls:b,onFirstImageLoad:C,onImageLoad:(w,m)=>{s==null||s(w,m,v),x[m]=w},onAllImagesLoad:w=>{x=w,r[O?"x":"y"]=!0,f()},autoplayReverse:g.autoplayReverse})};d?u({cdnPath:t,config:i,orientation:k.X,loadedImages:l,onFirstImageLoad:o}):r.x=!0,h?u({cdnPath:e,config:n,orientation:k.Y,loadedImages:c,onFirstImageLoad:d?void 0:o}):r.y=!0},Pi=t=>{const e=new Image;return e.src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/360.svg",e.style.bottom=`${t}%`,e.className="cloudimage-360-view-360-circle",e},Ti=()=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.innerText="360°",t},ki=(t,e)=>{const{width:i,height:n}=e,o=document.createElement("canvas");return o.width=i,o.height=n,o.style.width="100%",o.style.height="auto",t.appendChild(o),o},Ai="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='m147-96-51-51%20261-261H192v-72h288v288h-72v-165L147-96Zm333-384v-288h72v165l261-261%2051%2051-261%20261h165v72H480Z'/%3e%3c/svg%3e",Bi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-close-icon",t.innerHTML=`close icon`,t},Mi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M144-144v-192h72v120h120v72H144Zm480%200v-72h120v-120h72v192H624ZM144-624v-192h192v72H216v120h-72Zm600%200v-120H624v-72h192v192h-72Z'/%3e%3c/svg%3e",Hi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-fullscreen-button",t.innerHTML=`fullscreen icon`,t},ut=t=>{const e=document.createElement("div");return e.className="cloudimage-360-icons-container",t.appendChild(e),e},Wi=t=>{const e=document.createElement("div");return e.className="cloudimage-360-inner-box",t.appendChild(e),e},Zi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M765-144%20526-383q-30%2022-65.79%2034.5-35.79%2012.5-76.18%2012.5Q284-336%20214-406t-70-170q0-100%2070-170t170-70q100%200%20170%2070t70%20170.03q0%2040.39-12.5%2076.18Q599-464%20577-434l239%20239-51%2051ZM384-408q70%200%20119-49t49-119q0-70-49-119t-119-49q-70%200-119%2049t-49%20119q0%2070%2049%20119t119%2049Z'/%3e%3c/svg%3e",Di=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-magnifier-button",t.innerHTML=`magnifier icon`,t},Vi=t=>{const e=document.createElement("div");e.className="cloudimage-initial-icon";const i=document.createElement("span");return i.className="percentage",i.innerText="0%",e.appendChild(i),t.appendChild(e),e},Ni=t=>{const e=document.createElement("div");e.className="cloudimage-360-fullscreen-modal";const i=t.cloneNode();return i.style.height="100vh",i.style.maxHeight="100%",e.appendChild(i),window.document.body.appendChild(e),i},We=(t,e)=>{const i=t.querySelector(e);i&&i.parentNode.removeChild(i)},$i=()=>{const t=document.createElement("div");return t.className="cloudimage-loading-spinner",t},ji=()=>{const t=document.createElement("div");return t.className="cloudimage-360-transition-overlay",t},Fi=t=>{const e=document.createElement("div");return e.className="cloudimage-360-hotspot-container",t.appendChild(e),e},Gi=(t,e)=>{const[i,n]=t.split("?");if(!n)return t;const o=new RegExp(`^${e}=|&${e}=`),s=n.split("&").filter(a=>!o.test(a)).join("&");return s?`${i}?${s}`:i},Ui=t=>{const e=Gi(t,"width"),i=e.includes("?")?"&":"?";return`${e}${i}width=${150*devicePixelRatio}`},zi=t=>{const e={root:null,rootMargin:"0px",threshold:.1},i=o=>{const s=o.getAttribute("data-src");s&&(o.src=s)};new IntersectionObserver((o,s)=>{o.forEach(a=>{a.isIntersecting&&(i(a.target),s.unobserve(a.target))})},e).observe(t)},Ki=(t,e)=>{const i=kt(1,e);return t.replace("{index}",i)},qi=(t,e)=>{const[i]=t,n=/(https?):\/\//i.test(i);return be({...e,folder:n?"":e.folder,filename:i})},_i=(t,e)=>{const{imageList:i,indexZeroBase:n}=e;if(i.length)try{const o=JSON.parse(i);return qi(o,e)}catch(o){console.error(`Wrong format in image-list attribute: ${o.message}`)}return Ki(t,n)},ht=(t,e,i)=>{const n=new Image;return n.setAttribute(e?"data-src":"src",t),n.className=i,n.style.cssText=` - position: ${e?"absolute":"static"}; - width: 100%; - inset: 0; - height: 100%; - object-fit: contain; - object-position: center; - filter: blur(10px); - `,n},pt=(t,e,i)=>{const{innerBox:n,imageList:o,lazyload:s}=e||{},[a]=o,r=a||_i(t,e),l=Ui(r),c=ht(l,s,"cloudimage-lazy"),d=ht(l,!1,"cloudimage-360-placeholder"),h=f=>{We(n,".cloudimage-lazy"),i&&i({event:f,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:l})};c.onload=h,n.appendChild(c),n.appendChild(d),zi(c)},Ji=(t,e)=>{const i=new Image;i.src=t,i.onload=n=>{e&&e({event:n,width:i.width,height:i.height,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,src:t})},i.onerror=function(){}},Qi=(t,e)=>{const i=e.getBoundingClientRect(),n=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;return{x:n-i.left,y:o-i.top}},He=(t,e,i)=>{const{container:n,w:o,h:s,zoom:a,bw:r,offsetX:l,offsetY:c}=e,d=Qi(t,n);let h=d.x,f=d.y;h=Math.max(o/a,Math.min(h,n.offsetWidth-o/a)),f=Math.max(s/a,Math.min(f,n.offsetHeight-s/a)),i.style.left=`${h-o}px`,i.style.top=`${f-s}px`;const u=(h-l)*a-o+r,y=(f-c)*a-s+r;i.style.backgroundPosition=`-${u}px -${y}px`},en=(t,e,i,n,o,s)=>{const{x:a=0,y:r=0}=i||{},l=(e.offsetWidth-a*2)*s,c=(e.offsetHeight-r*2)*s;if(!o)return;o.setAttribute("class","cloudimage-360-img-magnifier-glass"),e.prepend(o),o.style.backgroundImage=`url('${n.src}')`,o.style.backgroundSize=`${l}px ${c}px`;const d=3,h=o.offsetWidth/2,f=o.offsetHeight/2,u={container:e,w:h,h:f,zoom:s,bw:d,offsetX:a,offsetY:r};He(t,u,o);const y=v=>{He(v,u,o)},g=v=>{v.preventDefault(),He(v,u,o)};o.addEventListener("mousemove",y),e.addEventListener("mousemove",y),e.addEventListener("touchmove",g)},tn=(t,e,i)=>{const{clientX:n,clientY:o}=t,s=e.getBoundingClientRect(),a=e.width/(s.width*i),r=e.height/(s.height*i),l=(n-s.left)*a,c=(o-s.top)*r;return{offsetX:l,offsetY:c}},ft=(t,{bottom:e,top:i})=>{t?e():i()},mt=(t,{left:e,right:i})=>{t?e():i()},nn=({autoplayBehavior:t,spinY:e,reversed:i,loopTriggers:n})=>{switch(t){case T.SPIN_XY:case T.SPIN_YX:e?ft(i,n):mt(i,n);break;case T.SPIN_Y:ft(i,n);break;case T.SPIN_X:default:mt(i,n)}},on=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s})=>{const a=(r,l)=>{const c=l-1;return s?r===0:r===c};switch(t){case T.SPIN_XY:case T.SPIN_Y:return a(i,o);case T.SPIN_X:case T.SPIN_YX:default:return a(e,n)}},sn=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s,spinDirection:a})=>{const r=e===(s?0:n-1),l=i===(s?0:o-1);return t===T.SPIN_XY||t===T.SPIN_YX?a==="x"&&r||a==="y"&&l:!1},rn=(t,e,i)=>{if(!i)return"x";if(!e)return"y";switch(t){case T.SPIN_XY:return"x";case T.SPIN_YX:return"y";case T.SPIN_Y:return"y";case T.SPIN_X:default:return"x"}},an=t=>t==="x"?"y":"x",vt=(t,e)=>{const i=[...bi];return e?[...i,...wi].includes(t):i.includes(t)},ln=({deltaX:t,deltaY:e,reversed:i,allowSpinX:n,allowSpinY:o,threshold:s=1})=>{const a=Math.abs(t),r=Math.abs(e);return n&&a-s>r?i?t>0?"left":"right":t>0?"right":"left":o&&r-s>a?i?e>0?"up":"down":e>0?"down":"up":null},cn=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,dn=(t,e=150)=>{let i;return function(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}},At="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==",un=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),gt=typeof self<"u"&&self.Blob&&new Blob([un(At)],{type:"text/javascript;charset=utf-8"});function hn(t){let e;try{if(e=gt&&(self.URL||self.webkitURL).createObjectURL(gt),!e)throw"";const i=new Worker(e,{name:t==null?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch{return new Worker("data:text/javascript;base64,"+At,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const pn=t=>t==="x"?k.X:k.Y,fn=(t,e,i)=>t.filter(n=>pn(n.orientation)===i&&e in n.positions),mn=t=>{const e=document.createElement("span");return e.id=t,e.className="cloudimage-360-hotspot",e.dataset.hotspotId=t,e},vn=t=>{const e=Object.entries(t).sort(([s],[a])=>Number(s)-Number(a));let i=null,n=null;const o={};for(const[s,a]of e)if(!a)o[s]={x:i,y:n};else{const{x:r,y:l}=a;r!=null&&(i=r),l!=null&&(n=l),o[s]={x:r||i,y:l||n}}return o},gn=t=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:t}}],yn=(t,e)=>{const i=document.createElement("div");return i.className="cloudimage-360-popper",i.id=`cloudimage-360-popper-${e}`,i.dataset.popperId=e,typeof t=="string"&&/<\/?[a-z][\s\S]*>/i.test(t)?i.innerHTML=t:i.textContent=t,document.body.appendChild(i),i},bn=t=>{const e=[...t];return e.forEach((i,n)=>{const o={...vn(i.positions)};e[n].initialPositions=o,e[n].positions=o}),e},wn=({newWidth:t,newHeight:e,initialContainerSize:i,imageAspectRatio:n,hotspotsConfig:o})=>{const[s,a]=i;let r=t,l=e,c=0,d=0;const h=t/e;n>h?(l=t/n,d=(e-l)/2):(r=e*n,c=(t-r)/2);const u=r/s,y=l/a;return o.map(g=>{const v={};return Object.entries(g.initialPositions).forEach(([x,C])=>{v[x]={x:C.x*u+c,y:C.y*y+d}}),{...g,positions:v}})};var A="top",V="bottom",N="right",B="left",Ne="auto",Oe=[A,V,N,B],de="start",Ie="end",xn="clippingParents",Bt="viewport",ye="popper",In="reference",yt=Oe.reduce(function(t,e){return t.concat([e+"-"+de,e+"-"+Ie])},[]),Mt=[].concat(Oe,[Ne]).reduce(function(t,e){return t.concat([e,e+"-"+de,e+"-"+Ie])},[]),Cn="beforeRead",On="read",En="afterRead",Sn="beforeMain",Rn="main",Yn="afterMain",Ln="beforeWrite",Xn="write",Pn="afterWrite",Tn=[Cn,On,En,Sn,Rn,Yn,Ln,Xn,Pn];function U(t){return t?(t.nodeName||"").toLowerCase():null}function Z(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ae(t){var e=Z(t).Element;return t instanceof e||t instanceof Element}function D(t){var e=Z(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function $e(t){if(typeof ShadowRoot>"u")return!1;var e=Z(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kn(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var n=e.styles[i]||{},o=e.attributes[i]||{},s=e.elements[i];!D(s)||!U(s)||(Object.assign(s.style,n),Object.keys(o).forEach(function(a){var r=o[a];r===!1?s.removeAttribute(a):s.setAttribute(a,r===!0?"":r)}))})}function An(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(n){var o=e.elements[n],s=e.attributes[n]||{},a=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),r=a.reduce(function(l,c){return l[c]="",l},{});!D(o)||!U(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const Bn={name:"applyStyles",enabled:!0,phase:"write",fn:kn,effect:An,requires:["computeStyles"]};function G(t){return t.split("-")[0]}var re=Math.max,Pe=Math.min,ue=Math.round;function Ze(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ht(){return!/^((?!chrome|android).)*safari/i.test(Ze())}function he(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&D(t)&&(o=t.offsetWidth>0&&ue(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ue(n.height)/t.offsetHeight||1);var a=ae(t)?Z(t):window,r=a.visualViewport,l=!Ht()&&i,c=(n.left+(l&&r?r.offsetLeft:0))/o,d=(n.top+(l&&r?r.offsetTop:0))/s,h=n.width/o,f=n.height/s;return{width:h,height:f,top:d,right:c+h,bottom:d+f,left:c,x:c,y:d}}function je(t){var e=he(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Wt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&$e(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function J(t){return Z(t).getComputedStyle(t)}function Mn(t){return["table","td","th"].indexOf(U(t))>=0}function ie(t){return((ae(t)?t.ownerDocument:t.document)||window.document).documentElement}function ke(t){return U(t)==="html"?t:t.assignedSlot||t.parentNode||($e(t)?t.host:null)||ie(t)}function bt(t){return!D(t)||J(t).position==="fixed"?null:t.offsetParent}function Hn(t){var e=/firefox/i.test(Ze()),i=/Trident/i.test(Ze());if(i&&D(t)){var n=J(t);if(n.position==="fixed")return null}var o=ke(t);for($e(o)&&(o=o.host);D(o)&&["html","body"].indexOf(U(o))<0;){var s=J(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Ee(t){for(var e=Z(t),i=bt(t);i&&Mn(i)&&J(i).position==="static";)i=bt(i);return i&&(U(i)==="html"||U(i)==="body"&&J(i).position==="static")?e:i||Hn(t)||e}function Fe(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function we(t,e,i){return re(t,Pe(e,i))}function Wn(t,e,i){var n=we(t,e,i);return n>i?i:n}function Zt(){return{top:0,right:0,bottom:0,left:0}}function Dt(t){return Object.assign({},Zt(),t)}function Vt(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var Zn=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Dt(typeof e!="number"?e:Vt(e,Oe))};function Dn(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,r=G(i.placement),l=Fe(r),c=[B,N].indexOf(r)>=0,d=c?"height":"width";if(!(!s||!a)){var h=Zn(o.padding,i),f=je(s),u=l==="y"?A:B,y=l==="y"?V:N,g=i.rects.reference[d]+i.rects.reference[l]-a[l]-i.rects.popper[d],v=a[l]-i.rects.reference[l],x=Ee(s),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,O=g/2-v/2,b=h[u],w=C-f[d]-h[y],m=C/2-f[d]/2+O,I=we(b,m,w),E=l;i.modifiersData[n]=(e={},e[E]=I,e.centerOffset=I-m,e)}}function Vn(t){var e=t.state,i=t.options,n=i.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||Wt(e.elements.popper,o)&&(e.elements.arrow=o))}const Nn={name:"arrow",enabled:!0,phase:"main",fn:Dn,effect:Vn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pe(t){return t.split("-")[1]}var $n={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jn(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:ue(i*o)/o||0,y:ue(n*o)/o||0}}function wt(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,a=t.offsets,r=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,h=t.isFixed,f=a.x,u=f===void 0?0:f,y=a.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:u,y:g}):{x:u,y:g};u=v.x,g=v.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),O=B,b=A,w=window;if(c){var m=Ee(i),I="clientHeight",E="clientWidth";if(m===Z(i)&&(m=ie(i),J(m).position!=="static"&&r==="absolute"&&(I="scrollHeight",E="scrollWidth")),m=m,o===A||(o===B||o===N)&&s===Ie){b=V;var S=h&&m===w&&w.visualViewport?w.visualViewport.height:m[I];g-=S-n.height,g*=l?1:-1}if(o===B||(o===A||o===V)&&s===Ie){O=N;var R=h&&m===w&&w.visualViewport?w.visualViewport.width:m[E];u-=R-n.width,u*=l?1:-1}}var L=Object.assign({position:r},c&&$n),M=d===!0?jn({x:u,y:g},Z(i)):{x:u,y:g};if(u=M.x,g=M.y,l){var X;return Object.assign({},L,(X={},X[b]=C?"0":"",X[O]=x?"0":"",X.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+g+"px)":"translate3d("+u+"px, "+g+"px, 0)",X))}return Object.assign({},L,(e={},e[b]=C?g+"px":"",e[O]=x?u+"px":"",e.transform="",e))}function Fn(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=n===void 0?!0:n,s=i.adaptive,a=s===void 0?!0:s,r=i.roundOffsets,l=r===void 0?!0:r,c={placement:G(e.placement),variation:pe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,wt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,wt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fn,data:{}};var Ye={passive:!0};function Un(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=o===void 0?!0:o,a=n.resize,r=a===void 0?!0:a,l=Z(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,Ye)}),r&&l.addEventListener("resize",i.update,Ye),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Ye)}),r&&l.removeEventListener("resize",i.update,Ye)}}const zn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Un,data:{}};var Kn={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(t){return t.replace(/left|right|bottom|top/g,function(e){return Kn[e]})}var qn={start:"end",end:"start"};function xt(t){return t.replace(/start|end/g,function(e){return qn[e]})}function Ge(t){var e=Z(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Ue(t){return he(ie(t)).left+Ge(t).scrollLeft}function _n(t,e){var i=Z(t),n=ie(t),o=i.visualViewport,s=n.clientWidth,a=n.clientHeight,r=0,l=0;if(o){s=o.width,a=o.height;var c=Ht();(c||!c&&e==="fixed")&&(r=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:r+Ue(t),y:l}}function Jn(t){var e,i=ie(t),n=Ge(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=re(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=re(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),r=-n.scrollLeft+Ue(t),l=-n.scrollTop;return J(o||i).direction==="rtl"&&(r+=re(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:r,y:l}}function ze(t){var e=J(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function Nt(t){return["html","body","#document"].indexOf(U(t))>=0?t.ownerDocument.body:D(t)&&ze(t)?t:Nt(ke(t))}function xe(t,e){var i;e===void 0&&(e=[]);var n=Nt(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=Z(n),a=o?[s].concat(s.visualViewport||[],ze(n)?n:[]):n,r=e.concat(a);return o?r:r.concat(xe(ke(a)))}function De(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Qn(t,e){var i=he(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function It(t,e,i){return e===Bt?De(_n(t,i)):ae(e)?Qn(e,i):De(Jn(ie(t)))}function eo(t){var e=xe(ke(t)),i=["absolute","fixed"].indexOf(J(t).position)>=0,n=i&&D(t)?Ee(t):t;return ae(n)?e.filter(function(o){return ae(o)&&Wt(o,n)&&U(o)!=="body"}):[]}function to(t,e,i,n){var o=e==="clippingParents"?eo(t):[].concat(e),s=[].concat(o,[i]),a=s[0],r=s.reduce(function(l,c){var d=It(t,c,n);return l.top=re(d.top,l.top),l.right=Pe(d.right,l.right),l.bottom=Pe(d.bottom,l.bottom),l.left=re(d.left,l.left),l},It(t,a,n));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function $t(t){var e=t.reference,i=t.element,n=t.placement,o=n?G(n):null,s=n?pe(n):null,a=e.x+e.width/2-i.width/2,r=e.y+e.height/2-i.height/2,l;switch(o){case A:l={x:a,y:e.y-i.height};break;case V:l={x:a,y:e.y+e.height};break;case N:l={x:e.x+e.width,y:r};break;case B:l={x:e.x-i.width,y:r};break;default:l={x:e.x,y:e.y}}var c=o?Fe(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case de:l[c]=l[c]-(e[d]/2-i[d]/2);break;case Ie:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function Ce(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=n===void 0?t.placement:n,s=i.strategy,a=s===void 0?t.strategy:s,r=i.boundary,l=r===void 0?xn:r,c=i.rootBoundary,d=c===void 0?Bt:c,h=i.elementContext,f=h===void 0?ye:h,u=i.altBoundary,y=u===void 0?!1:u,g=i.padding,v=g===void 0?0:g,x=Dt(typeof v!="number"?v:Vt(v,Oe)),C=f===ye?In:ye,O=t.rects.popper,b=t.elements[y?C:f],w=to(ae(b)?b:b.contextElement||ie(t.elements.popper),l,d,a),m=he(t.elements.reference),I=$t({reference:m,element:O,strategy:"absolute",placement:o}),E=De(Object.assign({},O,I)),S=f===ye?E:m,R={top:w.top-S.top+x.top,bottom:S.bottom-w.bottom+x.bottom,left:w.left-S.left+x.left,right:S.right-w.right+x.right},L=t.modifiersData.offset;if(f===ye&&L){var M=L[o];Object.keys(R).forEach(function(X){var K=[N,V].indexOf(X)>=0?1:-1,q=[A,V].indexOf(X)>=0?"y":"x";R[X]+=M[q]*K})}return R}function io(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,a=i.padding,r=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Mt:l,d=pe(n),h=d?r?yt:yt.filter(function(y){return pe(y)===d}):Oe,f=h.filter(function(y){return c.indexOf(y)>=0});f.length===0&&(f=h);var u=f.reduce(function(y,g){return y[g]=Ce(t,{placement:g,boundary:o,rootBoundary:s,padding:a})[G(g)],y},{});return Object.keys(u).sort(function(y,g){return u[y]-u[g]})}function no(t){if(G(t)===Ne)return[];var e=Le(t);return[xt(t),e,xt(e)]}function oo(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=i.mainAxis,s=o===void 0?!0:o,a=i.altAxis,r=a===void 0?!0:a,l=i.fallbackPlacements,c=i.padding,d=i.boundary,h=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,y=u===void 0?!0:u,g=i.allowedAutoPlacements,v=e.options.placement,x=G(v),C=x===v,O=l||(C||!y?[Le(v)]:no(v)),b=[v].concat(O).reduce(function(j,$){return j.concat(G($)===Ne?io(e,{placement:$,boundary:d,rootBoundary:h,padding:c,flipVariations:y,allowedAutoPlacements:g}):$)},[]),w=e.rects.reference,m=e.rects.popper,I=new Map,E=!0,S=b[0],R=0;R=0,q=K?"width":"height",P=Ce(e,{placement:L,boundary:d,rootBoundary:h,altBoundary:f,padding:c}),H=K?X?N:B:X?V:A;w[q]>m[q]&&(H=Le(H));var le=Le(H),_=[];if(s&&_.push(P[M]<=0),r&&_.push(P[H]<=0,P[le]<=0),_.every(function(j){return j})){S=L,E=!1;break}I.set(L,_)}if(E)for(var ce=y?3:1,fe=function($){var te=b.find(function(oe){var F=I.get(oe);if(F)return F.slice(0,$).every(function(me){return me})});if(te)return S=te,"break"},Q=ce;Q>0;Q--){var ee=fe(Q);if(ee==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}const so={name:"flip",enabled:!0,phase:"main",fn:oo,requiresIfExists:["offset"],data:{_skip:!1}};function Ct(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ot(t){return[A,N,V,B].some(function(e){return t[e]>=0})}function ro(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,a=Ce(e,{elementContext:"reference"}),r=Ce(e,{altBoundary:!0}),l=Ct(a,n),c=Ct(r,o,s),d=Ot(l),h=Ot(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const ao={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ro};function lo(t,e,i){var n=G(t),o=[B,A].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,a=s[0],r=s[1];return a=a||0,r=(r||0)*o,[B,N].indexOf(n)>=0?{x:r,y:a}:{x:a,y:r}}function co(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=o===void 0?[0,0]:o,a=Mt.reduce(function(d,h){return d[h]=lo(h,e.rects,s),d},{}),r=a[e.placement],l=r.x,c=r.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=a}const uo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:co};function ho(t){var e=t.state,i=t.name;e.modifiersData[i]=$t({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const po={name:"popperOffsets",enabled:!0,phase:"read",fn:ho,data:{}};function fo(t){return t==="x"?"y":"x"}function mo(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=o===void 0?!0:o,a=i.altAxis,r=a===void 0?!1:a,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,h=i.padding,f=i.tether,u=f===void 0?!0:f,y=i.tetherOffset,g=y===void 0?0:y,v=Ce(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),x=G(e.placement),C=pe(e.placement),O=!C,b=Fe(x),w=fo(b),m=e.modifiersData.popperOffsets,I=e.rects.reference,E=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,R=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(m){if(s){var X,K=b==="y"?A:B,q=b==="y"?V:N,P=b==="y"?"height":"width",H=m[b],le=H+v[K],_=H-v[q],ce=u?-E[P]/2:0,fe=C===de?I[P]:E[P],Q=C===de?-E[P]:-I[P],ee=e.elements.arrow,j=u&&ee?je(ee):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Zt(),te=$[K],oe=$[q],F=we(0,I[P],j[P]),me=O?I[P]/2-ce-F-te-R.mainAxis:fe-F-te-R.mainAxis,ve=O?-I[P]/2+ce+F+oe+R.mainAxis:Q+F+oe+R.mainAxis,ge=e.elements.arrow&&Ee(e.elements.arrow),Ae=ge?b==="y"?ge.clientTop||0:ge.clientLeft||0:0,Ke=(X=L==null?void 0:L[b])!=null?X:0,Gt=H+me-Ke-Ae,Ut=H+ve-Ke,qe=we(u?Pe(le,Gt):le,H,u?re(_,Ut):_);m[b]=qe,M[b]=qe-H}if(r){var _e,zt=b==="x"?A:B,Kt=b==="x"?V:N,se=m[w],Se=w==="y"?"height":"width",Je=se+v[zt],Qe=se-v[Kt],Be=[A,B].indexOf(x)!==-1,et=(_e=L==null?void 0:L[w])!=null?_e:0,tt=Be?Je:se-I[Se]-E[Se]-et+R.altAxis,it=Be?se+I[Se]+E[Se]-et-R.altAxis:Qe,nt=u&&Be?Wn(tt,se,it):we(u?tt:Je,se,u?it:Qe);m[w]=nt,M[w]=nt-se}e.modifiersData[n]=M}}const vo={name:"preventOverflow",enabled:!0,phase:"main",fn:mo,requiresIfExists:["offset"]};function go(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function yo(t){return t===Z(t)||!D(t)?Ge(t):go(t)}function bo(t){var e=t.getBoundingClientRect(),i=ue(e.width)/t.offsetWidth||1,n=ue(e.height)/t.offsetHeight||1;return i!==1||n!==1}function wo(t,e,i){i===void 0&&(i=!1);var n=D(e),o=D(e)&&bo(e),s=ie(e),a=he(t,o,i),r={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((U(e)!=="body"||ze(s))&&(r=yo(e)),D(e)?(l=he(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Ue(s))),{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function xo(t){var e=new Map,i=new Set,n=[];t.forEach(function(s){e.set(s.name,s)});function o(s){i.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(r){if(!i.has(r)){var l=e.get(r);l&&o(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||o(s)}),n}function Io(t){var e=xo(t);return Tn.reduce(function(i,n){return i.concat(e.filter(function(o){return o.phase===n}))},[])}function Co(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Oo(t){var e=t.reduce(function(i,n){var o=i[n.name];return i[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,i},{});return Object.keys(e).map(function(i){return e[i]})}var Et={placement:"bottom",modifiers:[],strategy:"absolute"};function St(){for(var t=arguments.length,e=new Array(t),i=0;i{this.currentActiveIndex=e,this.currentOrientation=i;const n=fn(this.hotspotsConfig,e,i);this.hideHotspots(),n.forEach(o=>this.updateAndShowHotspot(o,e))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=Fi(this.container),this.hotspotsConfig=bn(e),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.imageAspectRatio=n;const{containerSize:o}=e[0];this.initialContainerSize=o||[i.offsetWidth,i.offsetHeight],this.initHotspots(),this.observeContainerResize()}observeContainerResize(){this.resizeObserver=new ResizeObserver(()=>{const e=this.container.offsetWidth,i=this.container.offsetHeight;this.updateHotspotsForResize(e,i)}),this.resizeObserver.observe(this.container)}updateHotspotsForResize(e,i){this.hotspotsConfig=wn({newWidth:e,newHeight:i,initialContainerSize:this.initialContainerSize,imageAspectRatio:this.imageAspectRatio,hotspotsConfig:this.hotspotsConfig}),this.updateHotspotPosition(this.currentActiveIndex,this.currentOrientation)}showPopper({hotspotElement:e,content:i,id:n,keepOpen:o}){this.popperInstance&&this.popperInstance.instanceId!==n&&this.hidePopper();const s={placement:"top",modifiers:gn(this.container)};this.popper=yn(i,n),this.popper.setAttribute("data-show",""),this.popper.addEventListener("mouseenter",()=>{this.shouldHidePopper=!1}),this.popper.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),e.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),e.addEventListener("mouseenter",()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)}),this.popperInstance={...Ro(e,this.popper,s),keepOpen:o,instanceId:n}}checkAndHidePopper(){var e;this.shouldHidePopper&&!((e=this.popperInstance)!=null&&e.keepOpen)&&(this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},150))}hidePopper(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.popper&&(this.popper.removeAttribute("data-show"),setTimeout(()=>{this.popper&&this.popper.remove(),this.popper=null},200))}createHotspot(e){const{id:i,content:n,keepOpen:o,onClick:s}=e,a=mn(i);s&&(a.style.cursor="pointer"),a.onclick=r=>{r.stopPropagation(),s==null||s(r,this.popperInstance,i)},n&&a.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:a,content:n,id:i,keepOpen:o})),this.hotspotsContainer.appendChild(a)}hideHotspots(){this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach(e=>{e.style.opacity=0,e.style.pointerEvents="none"})}updateAndShowHotspot(e,i){const{positions:n,id:o}=e,{x:s,y:a}=n[i]??{},r=this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);r&&(r.style.translate=`${s}px ${a}px`,r.style.opacity=1,r.style.pointerEvents="all")}createAllHotspots(){this.hotspotsConfig.forEach(e=>this.createHotspot(e))}initHotspots(){this.createAllHotspots()}destroy(){this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotsContainer.innerHTML=""}}class Te{constructor(e,i,n){this.container=e,this.isClicked=!1,this.fullscreenView=!!n,this.imagesX=[],this.imagesY=[],this.devicePixelRatio=Math.round(window.devicePixelRatio||1),this.id=e.id,this.movementStart={x:0,y:0},this.draggingDirection=null,this.isReady=!1,this.currentZoomScale=1,this.touchDevice=cn(),this.canvasWorker=new hn,this.onMoveHandler=this.onMoveHandler.bind(this),this.destroy=this.destroy.bind(this),this.init(this.container,i)}mouseDown(e){if(!this.isReady||this.glass)return;const{pageX:i,pageY:n}=e;(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.movementStart={x:i,y:n},this.isClicked=!0,this.isDragging=!1}mouseUp(){this.isReady&&(this.isZoomed||this.showAllIcons(),this.movementStart={x:0,y:0},this.isClicked=!1,this.innerBox.style.cursor="grab")}drag(e,i){if(!this.isReady||!this.isClicked)return;const n=e-this.movementStart.x,o=i-this.movementStart.y;this.draggingDirection=ln({deltaX:n,deltaY:o,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const s=this.fullscreenView?document.body:this.container,a=this.dragSpeed/50,r=a*(this.amountX/s.offsetWidth),l=a*(this.amountY/s.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(n*r)):0,d=this.allowSpinY?Math.abs(Math.round(o*l)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&d!==0)&&(this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,d),this.movementStart={x:e,y:i},setTimeout(()=>{this.isDragging=!0},150))}mouseMove(e){!this.isReady||!this.isClicked&&!this.isZoomed||this.glass||(this.hideAllIcons(),this.drag(e.pageX,e.pageY),this.isZoomed&&this.applyZoom(e))}mouseClick(e){if(!(!this.isReady||this.isDragging)){if(this.glass&&this.magnified){this.removeGlass();return}this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(e)}}loadHigherQualityImages(e,i){const n=be(this.srcXConfig,e),o=this.allowSpinY?be(this.srcYConfig,e):null;dt({cdnPathX:n,cdnPathY:o,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(s,a)=>{this.imagesX=s,this.imagesY=a,i()}})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.hidePopper()}toggleZoom(e){if(this.isZoomed)this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},800);else{let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(e)},800)})}}removeZoom(){this.isZoomed=!1,this.updateView(),this.showAllIcons(),this.hideTransitionOverlay()}applyZoom(e){const{offsetX:i,offsetY:n}=tn(e,this.canvas,this.devicePixelRatio);this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.updateView(this.pointerZoom,i,n)}touchOutside(e){if(!this.glass)return;!this.canvas.contains(e.target)&&this.removeGlass()}touchStart(e){if(!this.isReady||e.touches.length>1||this.glass)return;const{pageX:i,pageY:n}=e.touches[0];(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.hideAllIcons(),this.movementStart={x:i,y:n},this.isClicked=!0}touchEnd(){this.isReady&&(this.showAllIcons(),this.movementStart={x:0,y:0},this.isClicked=!1)}touchMove(e){if(!this.isReady||!this.isClicked||this.glass)return;const{pageX:i,pageY:n}=e.touches[0];e.preventDefault(),this.drag(i,n)}keyDown(e){if(!this.isReady)return;const{keyCode:i}=e,n=this.keysReverse;switch(vt(i,this.allowSpinY)&&this.hideAllIcons(),i){case 37:n?this.moveLeft():this.moveRight();break;case 39:n?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(e.preventDefault(),n?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(e.preventDefault(),n?this.moveBottom():this.moveTop());break}}keyUp(e){const{keyCode:i}=e;vt(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(e){this.orientation=k.X,this.activeImageX=(this.activeImageX+e)%this.amountX}moveActiveXIndexDown(e){this.orientation=k.X,this.activeImageX=(this.activeImageX-e+this.amountX)%this.amountX}moveActiveYIndexUp(e){this.orientation=k.Y,this.activeImageY=(this.activeImageY+e)%this.amountY}moveActiveYIndexDown(e){this.orientation=k.Y,this.activeImageY=(this.activeImageY-e+this.amountY)%this.amountY}moveRight(e,i=1){e&&this.activeImageX>=this.imagesX.length-1||(this.moveActiveXIndexUp(i),this.isZoomed||this.updateView())}moveLeft(e,i=1){e&&this.activeImageX<=0||(this.moveActiveXIndexDown(i),this.isZoomed||this.updateView())}moveTop(e,i=1){e&&this.activeImageY>=this.imagesY.length-1||(this.moveActiveYIndexUp(i),this.isZoomed||this.updateView())}moveBottom(e,i=1){e&&this.activeImageY<=0||(this.moveActiveYIndexDown(i),this.isZoomed||this.updateView())}onMoveHandler(e,i=1,n=1){e==="right"?this.moveRight(this.stopAtEdges,i):e==="left"?this.moveLeft(this.stopAtEdges,i):e==="up"?this.moveTop(this.stopAtEdges,n):e==="down"&&this.moveBottom(this.stopAtEdges,n)}updateView(e,i,n){const o=this.orientation===k.X?this.activeImageX:this.activeImageY,s=this.orientation===k.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(o,this.orientation),this.drawImageOnCanvas(s,e,i,n)}updatePercentageInLoader(e=0){this.loader&&(this.loader.innerText=e+"%")}adaptCanvasSize(e){const{naturalWidth:i,naturalHeight:n}=e;this.imageAspectRatio=i/n;const o=this.fullscreenView?window.innerWidth:this.canvas.clientWidth,s=this.fullscreenView?window.innerHeight:this.canvas.clientHeight;this.canvasWorker.postMessage({action:"adaptCanvasSize",devicePixelRatio:this.devicePixelRatio,imageAspectRatio:this.imageAspectRatio,containerWidth:o,containerHeight:s})}drawImageOnCanvas(e,i=1,n=0,o=0){this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:e,zoomScale:i,pointerX:n,pointerY:o})}pushImageToSet(e,i,n){n===k.X?this.imagesX[i]=e:this.imagesY[i]=e}calculatePercentage(){const e=this.amountX+this.amountY,i=this.imagesX.length+this.imagesY.length;return Math.round(i/e*100)}onImageLoad(e,i,n){this.pushImageToSet(e,i,n),this.updatePercentageInLoader(this.calculatePercentage())}onFirstImageLoaded(e,i){this.createContainers(e),this.adaptCanvasSize(i),this.drawImageOnCanvas(i)}onAllImagesLoaded(){this.addAllIcons(),this.hotspots&&(this.hotspotsInstance=new Yo(this.hotspots,this.innerBox,this.imageAspectRatio)),this.isReady=!0,this.amountX=this.imagesX.length,this.amountY=this.imagesY.length,this.activeImageX=this.autoplayReverse?this.amountX-1:0,this.activeImageY=this.autoplayReverse?this.amountY-1:0,this.autoplay&&(this.hideAllIcons(),dn(this.play.bind(this))())}magnify(e){e.stopPropagation();const{src:i}=this.orientation===k.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],o=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,s=Yi(i,o);this.showLoadingSpinner(),this.createGlass(),Ji(s,r=>{this.hideLoadingSpinner(),this.magnified=!0,en(e,this.innerBox,this.offset,r,this.glass,this.magnifier)})}openFullscreenModal(e){e.stopPropagation();const i=Ni(this.container);new Te(i,this.viewerConfig,!0)}closeFullscreenModal(e){e.stopPropagation(),document.body.removeChild(this.container.parentNode),window.document.body.style.overflow="visible"}play(){if(this.isClicked)return;this.hide360ViewCircleIcon();const e=this.speed*36/(this.amountX+this.amountY),i={left:this.moveLeft.bind(this),right:this.moveRight.bind(this),top:this.moveTop.bind(this),bottom:this.moveBottom.bind(this)};this.loopTimeoutId=window.setInterval(()=>{if(this.playOnce&&on({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}sn({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=an(this.spinDirection));const s=this.spinDirection==="y";nn({autoplayBehavior:this.autoplayBehavior,spinY:s,reversed:this.autoplayReverse,loopTriggers:i})},e)}stopAutoplay(){this.showAllIcons(),this.autoplay=!1,window.clearTimeout(this.loopTimeoutId)}destroy(){this.stopAutoplay(),this.hotspotsInstance&&this.hotspotsInstance.destroy();const e=this.container,i=e.cloneNode(!0),n=i.querySelector(".cloudimage-360-inner-box");i.removeChild(n),e.parentNode.replaceChild(i,e)}addInitialIcon(){this.initialIcon||(this.initialIcon=Ti(),this.innerBox.appendChild(this.initialIcon))}showInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=1)}hideInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=0)}createGlass(){this.hideAllIcons(),this.glass=document.createElement("div"),this.innerBox.appendChild(this.glass),this.innerBox.style.cursor="default"}removeGlass(){this.showAllIcons(),this.innerBox.removeChild(this.glass),this.glass=null,this.magnified=!1}addMagnifierIcon(){this.magnifier&&(this.magnifierIcon=Di(),this.magnifierIcon.onclick=this.magnify.bind(this),this.iconsContainer.appendChild(this.magnifierIcon))}showMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="visible",this.magnifierIcon.style.opacity=1)}hideMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="hidden",this.magnifierIcon.style.opacity=0)}addFullscreenIcon(){this.fullscreen&&(this.fullscreenIcon=Hi(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=Bi(),this.fullscreenCloseIcon.onclick=this.closeFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenCloseIcon)}showFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=1)}hideFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=0)}add360ViewCircleIcon(){this.view360CircleIcon||(this.view360CircleIcon=Pi(this.bottomCircleOffset),this.innerBox.appendChild(this.view360CircleIcon))}show360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=1)}hide360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=0)}addLoadingSpinner(){this.loadingSpinner=$i(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=ji(),this.innerBox.appendChild(this.transitionOverlay)}showTransitionOverlay(){this.transitionOverlay&&(this.hideAllIcons(),this.transitionOverlay.style.opacity=1)}hideTransitionOverlay(){this.transitionOverlay&&(this.transitionOverlay.style.opacity=0)}hideLoadingSpinner(){this.loadingSpinner&&(this.loadingSpinner.style.opacity=0)}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.innerBox.style.cursor="grab",this.pointerZoom&&(this.createTransitionOverlay(),this.addLoadingSpinner()),!this.fullscreenView&&!this.touchDevice&&this.addMagnifierIcon(),this.fullscreenView||this.addFullscreenIcon(),this.initialIconShown&&this.addInitialIcon(),this.bottomCircle||this.add360ViewCircleIcon()}showAllIcons(){this.showInitialIcon(),this.show360ViewCircleIcon(),this.showMagnifierIcon(),this.showFullscreenIcon()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideMagnifierIcon(),this.hideFullscreenIcon()}removeLoader(){this.loader&&(this.innerBox.removeChild(this.loader),this.loader=null)}attachEvents(e,i,n){e&&this.addMouseEvents(),i&&this.addTouchEvents(),n&&this.addKeyboardEvents()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=at(this.mouseMove.bind(this),lt),this.boundMouseUp=this.mouseUp.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),document.addEventListener("mousemove",this.boundMouseMove),document.addEventListener("mouseup",this.boundMouseUp)}addTouchEvents(){this.boundTouchOutside=this.touchOutside.bind(this),this.boundTouchStart=this.touchStart.bind(this),this.boundTouchEnd=this.touchEnd.bind(this),this.boundTouchMove=at(this.touchMove.bind(this),lt),document.addEventListener("touchstart",this.boundTouchOutside),this.container.addEventListener("touchstart",this.boundTouchStart),this.container.addEventListener("touchend",this.boundTouchEnd),this.container.addEventListener("touchmove",this.boundTouchMove)}addKeyboardEvents(){this.boundKeyDown=this.keyDown.bind(this),this.boundKeyUp=this.keyUp.bind(this),document.addEventListener("keydown",this.boundKeyDown),document.addEventListener("keyup",this.boundKeyUp)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),document.removeEventListener("mousemove",this.boundMouseMove),document.removeEventListener("mouseup",this.boundMouseUp)}removeTouchEvents(){document.removeEventListener("touchstart",this.boundTouchOutside),this.container.removeEventListener("touchstart",this.boundTouchStart),this.container.removeEventListener("touchend",this.boundTouchEnd),this.container.removeEventListener("touchmove",this.boundTouchMove)}removeKeyboardEvents(){document.removeEventListener("keydown",this.boundKeyDown),document.removeEventListener("keyup",this.boundKeyUp)}createContainers(e){this.iconsContainer=ut(this.innerBox),this.canvas=ki(this.innerBox,e),this.loader=Vi(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),We(this.innerBox,".cloudimage-360-placeholder")}update(e){this.isReady&&(this.stopAutoplay(),We(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,e,!0),this.iconsContainer=ut(this.innerBox),this.onAllImagesLoaded())}init(e,i,n){const o=i?Ii(i):xi(e),{folder:s,apiVersion:a,filenameX:r,filenameY:l,imageListX:c,imageListY:d,indexZeroBase:h,amountX:f,amountY:u,draggable:y=!0,swipeable:g=!0,keys:v,keysReverse:x,bottomCircleOffset:C,autoplay:O,autoplayBehavior:b,playOnce:w,speed:m,autoplayReverse:I,fullscreen:E,magnifier:S,ciToken:R,ciFilters:L,ciTransformation:M,lazyload:X,dragSpeed:K,stopAtEdges:q,pointerZoom:P,imageInfo:H="black",initialIconShown:le,bottomCircle:_,hotspots:ce,dragReverse:fe}=o,Q={ciToken:R,ciFilters:L,ciTransformation:M},ee=c?JSON.parse(c):[],j=d?JSON.parse(d):[];if(this.viewerConfig=o,this.amountX=ee.length||f,this.amountY=j.length||u,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=I?this.amountX-1:0,this.activeImageY=I?this.amountY-1:0,this.bottomCircleOffset=C,this.autoplay=O,this.autoplayBehavior=b,this.playOnce=w,this.speed=m,this.autoplayReverse=I,this.fullscreen=E,this.magnifier=S>1?Math.min(S,5):0,this.dragSpeed=Math.max(K,50),this.stopAtEdges=q,this.ciParams=Q,this.apiVersion=a,this.pointerZoom=P>1?Math.min(P,5):null,this.keysReverse=x,this.info=H,this.keys=v,this.innerBox=this.innerBox??Wi(this.container),this.initialIconShown=le,this.bottomCircle=_,this.spinDirection=rn(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=fe,this.hotspots=ce,this.srcXConfig={folder:s,filename:r,imageList:ee,container:e,innerBox:this.innerBox,apiVersion:a,ciParams:Q,lazyload:X,amount:this.amountX,indexZeroBase:h,autoplayReverse:I},this.srcYConfig={...this.srcXConfig,filename:l,imageList:j,orientation:k.Y,amount:this.amountY},n&&this.removeEvents(),this.attachEvents(y,g,v),n)return;const $=(this.fullscreenView?document.body:this.container).offsetWidth,te=this.allowSpinX&&!ee.length?be(this.srcXConfig,$):null,oe=this.allowSpinY&&!j.length?be(this.srcYConfig,$):null,F=me=>{dt({cdnPathX:te,cdnPathY:oe,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(ve,ge,Ae)=>this.onImageLoad(ve,ge,Ae),onFirstImageLoad:ve=>this.onFirstImageLoaded(me,ve),onAllImagesLoad:this.onAllImagesLoaded.bind(this)})};this.allowSpinX?pt(te,this.srcXConfig,F):this.allowSpinY&&pt(oe,this.srcYConfig,F)}}class jt{constructor(){this.views=new Map,this.initAll=this.initAll.bind(this),this.getViews=this.getViews.bind(this)}generateId(){return`ci360-${Math.random().toString(36).slice(2,11)}`}init(e,i,n){if(!e)return;const o=e.id||this.generateId();e.id||(e.id=o);const s=new Te(e,i,n);return this.views.set(o,s),s}initAll(e="cloudimage-360"){[...document.querySelectorAll(`.${e}`)].filter(Boolean).forEach(n=>{const o=n.id||this.generateId();n.id||(n.id=o);const s=new Te(n);this.views.set(o,s)})}destroy(e){const i=this.getViewById(e);i&&(i.destroy(),this.views.delete(e))}destroyAll(){this.views.forEach(e=>{e.destroy()}),this.views.clear()}getViewById(e){return this.views.get(e)}getViews(){return Array.from(this.views.values())}updateView(e,i){const n=this.getViewById(e),o={...n.viewerConfig,...i};if(Ci(n.viewerConfig,i)){n.destroy();const a=document.getElementById(e);this.init(a,o)}else n.update(o);return n}}window.CI360=jt;const Lo=[{id:"hotspot-1",orientation:"x",containerSize:[1170,663],positions:{0:{x:527,y:319},1:{x:527,y:319},2:{x:527,y:null},3:{x:498,y:null},4:{x:470,y:null},5:{x:441,y:null},73:{x:555,y:null},72:{x:586,y:null},71:{x:614,y:null},70:{x:641,y:null},69:{x:668,y:null},68:{x:692,y:null},67:{x:715,y:null},66:{x:736,y:null},65:{x:756,y:null},64:{x:773,y:null},63:{x:787,y:null}},content:'
Info about Hotspot 1
'},{id:"hotspot-2",orientation:"x",containerSize:[1220,680],positions:{73:{x:355,y:474},74:{x:355,y:null},72:{x:341,y:479},71:{x:336,y:null},70:{x:332,y:null},69:{x:327,y:null},68:{x:326,y:null},67:{x:327,y:null},66:{x:331,y:null},65:{x:334,y:null},64:{x:336,y:null},63:{x:347,y:474}},content:'
Info about Hotspot 2
'},{id:"hotspot-3",orientation:"x",containerSize:[1220,680],positions:{11:{x:683,y:151},12:{x:683,y:null},13:{x:683,y:null},14:{x:683,y:null},15:{x:683,y:null},16:{x:683,y:null},17:{x:681,y:152},18:{x:677,y:156},19:{x:671,y:159},20:{x:665,y:163},21:{x:656,y:168},22:{x:650,y:171},23:{x:643,y:176},24:{x:635,y:178},25:{x:628,y:181},26:{x:621,y:null},27:{x:610,y:null},28:{x:598,y:null},29:{x:588,y:null},30:{x:578,y:null},31:{x:570,y:176},32:{x:560,y:173}},content:'
Info about Hotspot 3
'},{id:"hotspot-4",orientation:"x",containerSize:[1220,680],positions:{6:{x:607,y:246},7:{x:619,y:null},8:{x:630,y:null},9:{x:637,y:null},10:{x:642,y:null}},content:'
Info about Hotspot 4
'}],Xo={folder:"https://scaleflex.cloudimg.io/v7/demo/360-nike/",filenameX:"nike-{index}.jpg",filenameY:"nike-y-{index}.jpg",amountX:"35",amountY:"36",autoplayBehavior:"spin-xy"},Po={folder:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",filenameX:"{index}.jpg",amountX:"233",amountY:void 0,filenameY:void 0},Rt={folder:{label:"data-folder",value:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",isRequired:!0,isUrl:!0},filenameX:{label:"data-filename-x",value:"{index}.jpg"},filenameY:{label:"data-filename-y"},amountY:{label:"data-amount-y",isRequired:!1},amountX:{label:"data-amount-x",value:233,isRequired:!0},speed:{label:"data-speed",value:100,isRequired:!1},dragSpeed:{label:"data-drag-speed",value:120,isRequired:!1},autoplay:{label:"data-autoplay",isRequired:!1},pointerZoom:{label:"data-pointer-zoom",value:1.5,isRequired:!1},autoplayBehavior:{label:"data-autoplay-behavior",value:"spin-xy",isRequired:!1},magnifier:{label:"data-magnifier",value:1.5,isRequired:!1},autoplayReverse:{label:"data-autoplay-reverse",isRequired:!1},playOnce:{label:"data-play-once",isRequired:!1},keys:{label:"data-keys",isRequired:!1},keysReverse:{label:"data-keys-reverse",isRequired:!1},draggable:{label:"data-draggable",isRequired:!1},swipeable:{label:"data-swipeable",isRequired:!1},fullscreen:{label:"data-fullscreen",isRequired:!1}},Yt={NAME:"#7B9200",URL:"#2D88CB"},To=["folder","class"],ko=document.getElementById("spin-directions"),Lt=document.getElementById("copy-text"),Xt=document.getElementById("code-block"),Pt=document.getElementById("code-wrapper"),Ve=document.getElementById("pointer-zoom-selector"),Ao=document.querySelector(".copy-button"),Bo=document.querySelector(".output-code"),Mo=document.getElementById("pointer-checkbox"),Ho=document.querySelectorAll(".plugin-option"),Ft=document.getElementById("x-images-selector"),Wo=document.getElementById("images-y"),Zo=document.getElementById("spin-speed"),Do=document.getElementById("drag-speed"),z=new jt;function Vo(t){const i=t.target.value==="Y",n=i?Xo:Po,o=z.updateView("demo-generator",n);Ft.value=i?35:233,Wo.style.display=i?"block":"none",ne(o.viewerConfig)}function No(t){const{value:e}=t.target,i=z.updateView("demo-generator",{dragSpeed:parseInt(e,10)});ne(i.viewerConfig)}function $o(t){const{value:e}=t.target,i=z.updateView("demo-generator",{speed:parseInt(e,10)});ne(i.viewerConfig)}function jo(){navigator.clipboard.writeText(Bo.innerText),Lt.innerHTML="Copied",setTimeout(()=>{Lt.innerHTML="Copy"},500)}function Fo(t){const{value:e}=t.target,i=z.updateView("demo-generator",{amountX:parseInt(e,10)});ne(i.viewerConfig)}function Go(t){const e=t.target.checked,i=parseFloat(Ve.value,10),n=z.updateView("demo-generator",{pointerZoom:e?i:!1});Ve.disabled=!e,ne(n.viewerConfig)}function Uo(t){const{value:e}=t.target,i=z.updateView("demo-generator",{pointerZoom:parseFloat(e,10)});ne(i.viewerConfig)}function zo(t){const e=t.target.checked,i=t.target.getAttribute("data-plugin-property"),n=t.target.getAttribute("data-plugin-value");let o=e;n&&(o=e?JSON.parse(n):void 0);const s=z.updateView("demo-generator",{[i]:o});ne(s.viewerConfig)}function ne(t){Xt.innerText="",Object.keys(t).filter(n=>Rt[n]&&!!t[n]).forEach(n=>{const{label:o}=Rt[n],s=document.createElement("div"),a=document.createElement("span"),r=document.createElement("span");a.innerText=o,a.style.color=Yt.NAME,To.includes(n)&&(r.style.color=Yt.URL),s.appendChild(a),r.innerText=`"${t[n]}"`,s.innerHTML+="=",s.appendChild(r),Xt.appendChild(s),Pt.scrollTop=Pt.scrollHeight})}Do.addEventListener("change",No);Zo.addEventListener("change",$o);Mo.addEventListener("change",Go);Ft.addEventListener("change",Fo);Ve.addEventListener("change",Uo);ko.addEventListener("change",Vo);Ao.addEventListener("click",jo);Ho.forEach(t=>{t.addEventListener("change",zo)});const Ko=document.getElementById("gurkha-suv"),qo={folder:"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/",filenameX:"orange-{index}.jpg",amountX:73,lazyload:!0,speed:120,pointerZoom:2,responsive:"scaleflex",autoplay:!0,fullscreen:!0,magnifier:3,playOnce:!0,hotspots:Lo};z.init(Ko,qo);z.initAll();const _o=z.getViewById("demo-generator");ne(_o.viewerConfig); diff --git a/assets/index-BHPHGWSL.js b/assets/index-BHPHGWSL.js new file mode 100644 index 0000000..2250d51 --- /dev/null +++ b/assets/index-BHPHGWSL.js @@ -0,0 +1,9 @@ +var qt=Object.defineProperty;var _t=(t,e,i)=>e in t?qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var st=(t,e,i)=>_t(t,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var At="Expected a function",rt=NaN,Qt="[object Symbol]",ei=/^\s+|\s+$/g,ti=/^[-+]0x[0-9a-f]+$/i,ii=/^0b[01]+$/i,ni=/^0o[0-7]+$/i,oi=parseInt,si=typeof Re=="object"&&Re&&Re.Object===Object&&Re,ri=typeof self=="object"&&self&&self.Object===Object&&self,ai=si||ri||Function("return this")(),li=Object.prototype,ci=li.toString,di=Math.max,ui=Math.min,Me=function(){return ai.Date.now()};function hi(t,e,i){var n,o,s,a,r,l,c=0,d=!1,h=!1,f=!0;if(typeof t!="function")throw new TypeError(At);e=at(e)||0,Xe(i)&&(d=!!i.leading,h="maxWait"in i,s=h?di(at(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f);function u(m){var I=n,E=o;return n=o=void 0,c=m,a=t.apply(E,I),a}function y(m){return c=m,r=setTimeout(x,e),d?u(m):a}function g(m){var I=m-l,E=m-c,S=e-I;return h?ui(S,s-E):S}function v(m){var I=m-l,E=m-c;return l===void 0||I>=e||I<0||h&&E>=s}function x(){var m=Me();if(v(m))return C(m);r=setTimeout(x,g(m))}function C(m){return r=void 0,f&&n?u(m):(n=o=void 0,a)}function O(){r!==void 0&&clearTimeout(r),c=0,n=l=o=r=void 0}function b(){return r===void 0?a:C(Me())}function w(){var m=Me(),I=v(m);if(n=arguments,o=this,l=m,I){if(r===void 0)return y(l);if(h)return r=setTimeout(x,e),u(l)}return r===void 0&&(r=setTimeout(x,e)),a}return w.cancel=O,w.flush=b,w}function pi(t,e,i){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(At);return Xe(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),hi(t,e,{leading:n,maxWait:e,trailing:o})}function Xe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function fi(t){return!!t&&typeof t=="object"}function mi(t){return typeof t=="symbol"||fi(t)&&ci.call(t)==Qt}function at(t){if(typeof t=="number")return t;if(mi(t))return rt;if(Xe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(ei,"");var i=ii.test(t);return i||ni.test(t)?oi(t.slice(2),i?2:8):ti.test(t)?rt:+t}var vi=pi;const lt=Jt(vi),T={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},gi=[!1,0,null,void 0,"false","0","null","undefined"],A={X:"x-axis",Y:"y-axis",CENTER:"center"},yi=["folder","folderX","folderY","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY"],bi=[37,39],wi=[38,40],ct=10,p={folder:"/",apiVersion:"v7",filenameX:"image-{index}.jpg",filenameY:null,imageListX:null,imageListY:null,indexZeroBase:0,amountX:0,amountY:0,speed:80,dragSpeed:150,draggable:!0,swipeable:!0,keys:!1,keysReverse:!1,autoplay:!1,autoplayBehavior:T.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,fullscreen:!1,magnifier:null,bottomCircle:!0,bottomCircleOffset:5,ciToken:null,ciFilters:null,ciTransformation:null,lazyload:!0,dragReverse:!1,stopAtEdges:!1,imageInfo:!1,initialIconShown:!0,hotspots:null},xi=t=>({folder:Y(t,"folder",p.folder),apiVersion:Y(t,"api-version",p.apiVersion),filenameX:Y(t,"filename")||Y(t,"filename-x")||p.filenameX,filenameY:Y(t,"filename-y",p.filenameY),imageListX:Y(t,"image-list-x",p.imageListX),imageListY:Y(t,"image-list-y",p.imageListY),indexZeroBase:parseInt(Y(t,"index-zero-base",p.indexZeroBase),10),amountX:parseInt(Y(t,"amount-x",p.amountX),10),amountY:parseInt(Y(t,"amount-y",p.amountY),10),speed:parseInt(Y(t,"speed",p.speed),10),dragSpeed:parseInt(Y(t,"drag-speed",p.dragSpeed),10),draggable:W(t,"draggable",p.draggable),swipeable:W(t,"swipeable",p.swipeable),keys:W(t,"keys",p.keys),keysReverse:W(t,"keys-reverse",p.keysReverse),autoplay:W(t,"autoplay",p.autoplay),autoplayBehavior:Y(t,"autoplay-behavior",p.autoplayBehavior),playOnce:W(t,"play-once",p.playOnce),autoplayReverse:W(t,"autoplay-reverse",p.autoplayReverse),pointerZoom:parseFloat(Y(t,"pointer-zoom",p.pointerZoom),10),fullscreen:W(t,"fullscreen")||W(t,"full-screen",p.fullscreen),magnifier:parseFloat(Y(t,"magnifier",p.magnifier),10),bottomCircleOffset:parseInt(Y(t,"bottom-circle-offset",p.bottomCircleOffset),10),ciToken:Y(t,"responsive",p.ciToken),ciFilters:Y(t,"filters",p.ciFilters),ciTransformation:Y(t,"transformation",p.ciTransformation),lazyload:W(t,"lazyload",p.lazyload),dragReverse:W(t,"drag-reverse",p.dragReverse),stopAtEdges:W(t,"stop-at-edges",p.stopAtEdges),imageInfo:W(t,"info",p.imageInfo),initialIconShown:!dt(t,"initial-icon"),bottomCircle:!dt(t,"bottom-circle")}),Ii=t=>({folder:t.folder||p.folder,apiVersion:t.apiVersion||p.apiVersion,filenameX:t.filenameX||t.filename||p.filenameX,filenameY:t.filenameY||p.filenameY,imageListX:t.imageListX||p.imageListX,imageListY:t.imageListY||p.imageListY,indexZeroBase:parseInt(t.indexZeroBase??p.indexZeroBase,10),amountX:parseInt(t.amountX??p.amountX,10),amountY:parseInt(t.amountY??p.amountY,10),speed:parseInt(t.speed??p.speed,10),draggable:t.draggable??p.draggable,swipeable:t.swipeable??p.swipeable,dragSpeed:parseInt(t.dragSpeed??p.dragSpeed,10),keys:t.keys??p.keys,keysReverse:t.keysReverse??p.keysReverse,autoplay:t.autoplay??p.autoplay,autoplayBehavior:t.autoplayBehavior||p.autoplayBehavior,playOnce:t.playOnce??p.playOnce,autoplayReverse:t.autoplayReverse??p.autoplayReverse,pointerZoom:parseFloat(t.pointerZoom??p.pointerZoom,10),fullscreen:t.fullscreen??p.fullscreen,magnifier:parseFloat(t.magnifier??p.magnifier,10),bottomCircleOffset:parseInt(t.bottomCircleOffset??p.bottomCircleOffset,10),ciToken:t.ciToken||p.ciToken,ciFilters:t.ciFilters||p.ciFilters,ciTransformation:t.ciTransformation||p.ciTransformation,lazyload:t.lazyload??p.lazyload,dragReverse:t.dragReverse??p.dragReverse,stopAtEdges:t.stopAtEdges??p.stopAtEdges,imageInfo:t.imageInfo??p.imageInfo,initialIconShown:t.initialIconShown??p.initialIconShown,bottomCircle:t.bottomCircle??p.bottomCircle,hotspots:t.hotspots??p.hotspots}),Y=(t,e,i)=>t.getAttribute(e)||t.getAttribute(`data-${e}`)||i,W=(t,e,i)=>t.hasAttribute(e)||t.hasAttribute(`data-${e}`)||i,dt=(t,e)=>Y(t,e,null)==="false",Ci=(t,e,i=yi)=>i.some(n=>n in e&&e[n]!==t[n]),Oi=(t=1)=>{const e=Math.round(window.devicePixelRatio||1);return parseInt(t)*e},Ei=(t,e,i)=>new URL(t).origin.includes("cloudimg")?t:`https://${e}.cloudimg.io/${i}${t}`,Si=({ciTransformation:t,responsiveWidth:e,ciFilters:i})=>{const n=`width=${e}`,o=t||n,s=i?`&f=${i}`:"";return`${o}${s}`},be=(t,e)=>{const{folder:i,apiVersion:n,filename:o="",ciParams:s}=t,{ciToken:a,ciFilters:r,ciTransformation:l}=s||{},c=`${i}${o}`;if(!a)return c;const d=gi.includes(n)?null:n,h=d?`${d}/`:"",f=Oi(e),u=Ei(c,a,h),y=Si({ciTransformation:l,responsiveWidth:f,ciFilters:r});return`${u}${y?"?":""}${y}`},Ri=(t,e,i)=>{const[n,o]=t.split("?"),s=`${e}=${encodeURIComponent(i)}`;if(!o)return`${n}?${s}`;const a=new URLSearchParams(o);return a.set(e,i),`${n}?${a.toString()}`},Yi=(t,e)=>Ri(t,"width",e),kt=(t,e=0)=>(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t),Li=(t,{amount:e=0,indexZeroBase:i=0}={})=>Array.from({length:e},(n,o)=>t.replace("{index}",kt(o+1,i))),Xi=({imagesUrls:t,onFirstImageLoad:e,onImageLoad:i,onAllImagesLoad:n,autoplayReverse:o})=>{let s=0;const a=t.length,r=[],l=(h,f)=>{const u=new Image;u.crossOrigin="anonymous",u.src=h,u.onload=async()=>{const y=await createImageBitmap(u),g={src:h,bitmapImage:y,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};s++,r[f]=g,i==null||i(g,f),s===a&&(n==null||n(r))},u.onerror=()=>{console.error(`Failed to load image: ${h}`),s++,s===a&&(n==null||n(r))}},c=new Image,d=t[o?t.length-1:0];c.crossOrigin="anonymous",c.src=d,c.onload=async()=>{const h=await createImageBitmap(c),f={src:d,bitmapImage:h,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};r[0]=f,s++,e==null||e(f),i==null||i(f,0);for(let u=1;u{console.error(`Failed to load first image: ${t[0]}`),s++;for(let h=1;h{let r={x:!1,y:!1},l=[],c=[];const d=t||i.imageList.length,h=e||n.imageList.length,f=()=>{r.x&&r.y&&a(l,c)},u=({cdnPath:y,config:g,orientation:v,loadedImages:x,onFirstImageLoad:C})=>{const O=v===A.X,b=g.imageList.length?g.imageList:Li(y,g);Xi({imagesUrls:b,onFirstImageLoad:C,onImageLoad:(w,m)=>{s==null||s(w,m,v),x[m]=w},onAllImagesLoad:w=>{x=w,r[O?"x":"y"]=!0,f()},autoplayReverse:g.autoplayReverse})};d?u({cdnPath:t,config:i,orientation:A.X,loadedImages:l,onFirstImageLoad:o}):r.x=!0,h?u({cdnPath:e,config:n,orientation:A.Y,loadedImages:c,onFirstImageLoad:d?void 0:o}):r.y=!0},Pi=t=>{const e=new Image;return e.src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/360.svg",e.style.bottom=`${t}%`,e.className="cloudimage-360-view-360-circle",e},Ti=()=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.innerText="360°",t},Ai=(t,e)=>{const{width:i,height:n}=e,o=document.createElement("canvas");return o.width=i,o.height=n,o.style.width="100%",o.style.height="auto",t.appendChild(o),o},ki="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='m147-96-51-51%20261-261H192v-72h288v288h-72v-165L147-96Zm333-384v-288h72v165l261-261%2051%2051-261%20261h165v72H480Z'/%3e%3c/svg%3e",Bi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-close-icon",t.innerHTML=`close icon`,t},Mi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M144-144v-192h72v120h120v72H144Zm480%200v-72h120v-120h72v192H624ZM144-624v-192h192v72H216v120h-72Zm600%200v-120H624v-72h192v192h-72Z'/%3e%3c/svg%3e",Hi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-fullscreen-button",t.innerHTML=`fullscreen icon`,t},ht=t=>{const e=document.createElement("div");return e.className="cloudimage-360-icons-container",t.appendChild(e),e},Wi=t=>{const e=document.createElement("div");return e.className="cloudimage-360-inner-box",t.appendChild(e),e},Zi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M765-144%20526-383q-30%2022-65.79%2034.5-35.79%2012.5-76.18%2012.5Q284-336%20214-406t-70-170q0-100%2070-170t170-70q100%200%20170%2070t70%20170.03q0%2040.39-12.5%2076.18Q599-464%20577-434l239%20239-51%2051ZM384-408q70%200%20119-49t49-119q0-70-49-119t-119-49q-70%200-119%2049t-49%20119q0%2070%2049%20119t119%2049Z'/%3e%3c/svg%3e",Di=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-magnifier-button",t.innerHTML=`magnifier icon`,t},Vi=t=>{const e=document.createElement("div");e.className="cloudimage-initial-icon";const i=document.createElement("span");return i.className="percentage",i.innerText="0%",e.appendChild(i),t.appendChild(e),e},Ni=t=>{const e=document.createElement("div");e.className="cloudimage-360-fullscreen-modal";const i=t.cloneNode();return i.style.height="100vh",i.style.maxHeight="100%",e.appendChild(i),window.document.body.appendChild(e),i},We=(t,e)=>{const i=t.querySelector(e);i&&i.parentNode.removeChild(i)},$i=()=>{const t=document.createElement("div");return t.className="cloudimage-loading-spinner",t},ji=()=>{const t=document.createElement("div");return t.className="cloudimage-360-transition-overlay",t},Fi=t=>{const e=document.createElement("div");return e.className="cloudimage-360-hotspot-container",t.appendChild(e),e},Gi=(t,e)=>{const[i,n]=t.split("?");if(!n)return t;const o=new RegExp(`^${e}=|&${e}=`),s=n.split("&").filter(a=>!o.test(a)).join("&");return s?`${i}?${s}`:i},Ui=t=>{const e=Gi(t,"width"),i=e.includes("?")?"&":"?";return`${e}${i}width=${150*devicePixelRatio}`},zi=t=>{const e={root:null,rootMargin:"0px",threshold:.1},i=o=>{const s=o.getAttribute("data-src");s&&(o.src=s)};new IntersectionObserver((o,s)=>{o.forEach(a=>{a.isIntersecting&&(i(a.target),s.unobserve(a.target))})},e).observe(t)},Ki=(t,e)=>{const i=kt(1,e);return t.replace("{index}",i)},qi=(t,e)=>{const[i]=t,n=/(https?):\/\//i.test(i);return be({...e,folder:n?"":e.folder,filename:i})},_i=(t,e)=>{const{imageList:i,indexZeroBase:n}=e;if(i.length)try{const o=JSON.parse(i);return qi(o,e)}catch(o){console.error(`Wrong format in image-list attribute: ${o.message}`)}return Ki(t,n)},pt=(t,e,i)=>{const n=new Image;return n.setAttribute(e?"data-src":"src",t),n.className=i,n.style.cssText=` + position: ${e?"absolute":"static"}; + width: 100%; + inset: 0; + height: 100%; + object-fit: contain; + object-position: center; + filter: blur(10px); + `,n},ft=(t,e,i)=>{const{innerBox:n,imageList:o,lazyload:s}=e||{},[a]=o,r=a||_i(t,e),l=Ui(r),c=pt(l,s,"cloudimage-lazy"),d=pt(l,!1,"cloudimage-360-placeholder"),h=f=>{We(n,".cloudimage-lazy"),i&&i({event:f,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:l})};c.onload=h,n.appendChild(c),n.appendChild(d),zi(c)},Ji=(t,e)=>{const i=new Image;i.src=t,i.onload=n=>{e&&e({event:n,width:i.width,height:i.height,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,src:t})},i.onerror=function(){}},Qi=(t,e)=>{const i=e.getBoundingClientRect(),n=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;return{x:n-i.left,y:o-i.top}},He=(t,e,i)=>{const{container:n,w:o,h:s,zoom:a,bw:r,offsetX:l,offsetY:c}=e,d=Qi(t,n);let h=d.x,f=d.y;h=Math.max(o/a,Math.min(h,n.offsetWidth-o/a)),f=Math.max(s/a,Math.min(f,n.offsetHeight-s/a)),i.style.left=`${h-o}px`,i.style.top=`${f-s}px`;const u=(h-l)*a-o+r,y=(f-c)*a-s+r;i.style.backgroundPosition=`-${u}px -${y}px`},en=(t,e,i,n,o,s)=>{const{x:a=0,y:r=0}=i||{},l=(e.offsetWidth-a*2)*s,c=(e.offsetHeight-r*2)*s;if(!o)return;o.setAttribute("class","cloudimage-360-img-magnifier-glass"),e.prepend(o),o.style.backgroundImage=`url('${n.src}')`,o.style.backgroundSize=`${l}px ${c}px`;const d=3,h=o.offsetWidth/2,f=o.offsetHeight/2,u={container:e,w:h,h:f,zoom:s,bw:d,offsetX:a,offsetY:r};He(t,u,o);const y=v=>{He(v,u,o)},g=v=>{v.preventDefault(),He(v,u,o)};o.addEventListener("mousemove",y),e.addEventListener("mousemove",y),e.addEventListener("touchmove",g)},tn=(t,e,i)=>{const{clientX:n,clientY:o}=t,s=e.getBoundingClientRect(),a=e.width/(s.width*i),r=e.height/(s.height*i),l=(n-s.left)*a,c=(o-s.top)*r;return{offsetX:l,offsetY:c}},mt=(t,{bottom:e,top:i})=>{t?e():i()},vt=(t,{left:e,right:i})=>{t?e():i()},nn=({autoplayBehavior:t,spinY:e,reversed:i,loopTriggers:n})=>{switch(t){case T.SPIN_XY:case T.SPIN_YX:e?mt(i,n):vt(i,n);break;case T.SPIN_Y:mt(i,n);break;case T.SPIN_X:default:vt(i,n)}},on=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s})=>{const a=(r,l)=>{const c=l-1;return s?r===0:r===c};switch(t){case T.SPIN_XY:case T.SPIN_Y:return a(i,o);case T.SPIN_X:case T.SPIN_YX:default:return a(e,n)}},sn=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s,spinDirection:a})=>{const r=e===(s?0:n-1),l=i===(s?0:o-1);return t===T.SPIN_XY||t===T.SPIN_YX?a==="x"&&r||a==="y"&&l:!1},rn=(t,e,i)=>{if(!i)return"x";if(!e)return"y";switch(t){case T.SPIN_XY:return"x";case T.SPIN_YX:return"y";case T.SPIN_Y:return"y";case T.SPIN_X:default:return"x"}},an=t=>t==="x"?"y":"x",gt=(t,e)=>{const i=[...bi];return e?[...i,...wi].includes(t):i.includes(t)},ln=({deltaX:t,deltaY:e,reversed:i,allowSpinX:n,allowSpinY:o,threshold:s=0})=>{const a=n&&!o||o&&!n?0:s,r=Math.abs(t),l=Math.abs(e);return n&&r-a>l?i?t>0?"left":"right":t>0?"right":"left":o&&l-a>r?i?e>0?"up":"down":e>0?"down":"up":null},cn=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,dn=(t,e=150)=>{let i;return function(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}},Bt="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==",un=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),yt=typeof self<"u"&&self.Blob&&new Blob([un(Bt)],{type:"text/javascript;charset=utf-8"});function hn(t){let e;try{if(e=yt&&(self.URL||self.webkitURL).createObjectURL(yt),!e)throw"";const i=new Worker(e,{name:t==null?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch{return new Worker("data:text/javascript;base64,"+Bt,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const pn=t=>t==="x"?A.X:A.Y,fn=(t,e,i)=>t.filter(n=>pn(n.orientation)===i&&e in n.positions),mn=t=>{const e=document.createElement("span");return e.id=t,e.className="cloudimage-360-hotspot",e.dataset.hotspotId=t,e},vn=t=>{const e=Object.entries(t).sort(([s],[a])=>Number(s)-Number(a));let i=null,n=null;const o={};for(const[s,a]of e)if(!a)o[s]={x:i,y:n};else{const{x:r,y:l}=a;r!=null&&(i=r),l!=null&&(n=l),o[s]={x:r||i,y:l||n}}return o},gn=t=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:t}}],yn=(t,e)=>{const i=document.createElement("div");return i.className="cloudimage-360-popper",i.id=`cloudimage-360-popper-${e}`,i.dataset.popperId=e,typeof t=="string"&&/<\/?[a-z][\s\S]*>/i.test(t)?i.innerHTML=t:i.textContent=t,document.body.appendChild(i),i},bn=t=>{const e=[...t];return e.forEach((i,n)=>{const o={...vn(i.positions)};e[n].initialPositions=o,e[n].positions=o}),e},wn=({newWidth:t,newHeight:e,initialContainerSize:i,imageAspectRatio:n,hotspotsConfig:o})=>{const[s,a]=i;let r=t,l=e,c=0,d=0;const h=t/e;n>h?(l=t/n,d=(e-l)/2):(r=e*n,c=(t-r)/2);const u=r/s,y=l/a;return o.map(g=>{const v={};return Object.entries(g.initialPositions).forEach(([x,C])=>{v[x]={x:C.x*u+c,y:C.y*y+d}}),{...g,positions:v}})};var k="top",V="bottom",N="right",B="left",$e="auto",Oe=[k,V,N,B],de="start",Ie="end",xn="clippingParents",Mt="viewport",ye="popper",In="reference",bt=Oe.reduce(function(t,e){return t.concat([e+"-"+de,e+"-"+Ie])},[]),Ht=[].concat(Oe,[$e]).reduce(function(t,e){return t.concat([e,e+"-"+de,e+"-"+Ie])},[]),Cn="beforeRead",On="read",En="afterRead",Sn="beforeMain",Rn="main",Yn="afterMain",Ln="beforeWrite",Xn="write",Pn="afterWrite",Tn=[Cn,On,En,Sn,Rn,Yn,Ln,Xn,Pn];function U(t){return t?(t.nodeName||"").toLowerCase():null}function Z(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ae(t){var e=Z(t).Element;return t instanceof e||t instanceof Element}function D(t){var e=Z(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function je(t){if(typeof ShadowRoot>"u")return!1;var e=Z(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function An(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var n=e.styles[i]||{},o=e.attributes[i]||{},s=e.elements[i];!D(s)||!U(s)||(Object.assign(s.style,n),Object.keys(o).forEach(function(a){var r=o[a];r===!1?s.removeAttribute(a):s.setAttribute(a,r===!0?"":r)}))})}function kn(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(n){var o=e.elements[n],s=e.attributes[n]||{},a=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),r=a.reduce(function(l,c){return l[c]="",l},{});!D(o)||!U(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const Bn={name:"applyStyles",enabled:!0,phase:"write",fn:An,effect:kn,requires:["computeStyles"]};function G(t){return t.split("-")[0]}var re=Math.max,Pe=Math.min,ue=Math.round;function Ze(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Wt(){return!/^((?!chrome|android).)*safari/i.test(Ze())}function he(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&D(t)&&(o=t.offsetWidth>0&&ue(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ue(n.height)/t.offsetHeight||1);var a=ae(t)?Z(t):window,r=a.visualViewport,l=!Wt()&&i,c=(n.left+(l&&r?r.offsetLeft:0))/o,d=(n.top+(l&&r?r.offsetTop:0))/s,h=n.width/o,f=n.height/s;return{width:h,height:f,top:d,right:c+h,bottom:d+f,left:c,x:c,y:d}}function Fe(t){var e=he(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Zt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&je(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function J(t){return Z(t).getComputedStyle(t)}function Mn(t){return["table","td","th"].indexOf(U(t))>=0}function ie(t){return((ae(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ae(t){return U(t)==="html"?t:t.assignedSlot||t.parentNode||(je(t)?t.host:null)||ie(t)}function wt(t){return!D(t)||J(t).position==="fixed"?null:t.offsetParent}function Hn(t){var e=/firefox/i.test(Ze()),i=/Trident/i.test(Ze());if(i&&D(t)){var n=J(t);if(n.position==="fixed")return null}var o=Ae(t);for(je(o)&&(o=o.host);D(o)&&["html","body"].indexOf(U(o))<0;){var s=J(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Ee(t){for(var e=Z(t),i=wt(t);i&&Mn(i)&&J(i).position==="static";)i=wt(i);return i&&(U(i)==="html"||U(i)==="body"&&J(i).position==="static")?e:i||Hn(t)||e}function Ge(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function we(t,e,i){return re(t,Pe(e,i))}function Wn(t,e,i){var n=we(t,e,i);return n>i?i:n}function Dt(){return{top:0,right:0,bottom:0,left:0}}function Vt(t){return Object.assign({},Dt(),t)}function Nt(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var Zn=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Vt(typeof e!="number"?e:Nt(e,Oe))};function Dn(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,r=G(i.placement),l=Ge(r),c=[B,N].indexOf(r)>=0,d=c?"height":"width";if(!(!s||!a)){var h=Zn(o.padding,i),f=Fe(s),u=l==="y"?k:B,y=l==="y"?V:N,g=i.rects.reference[d]+i.rects.reference[l]-a[l]-i.rects.popper[d],v=a[l]-i.rects.reference[l],x=Ee(s),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,O=g/2-v/2,b=h[u],w=C-f[d]-h[y],m=C/2-f[d]/2+O,I=we(b,m,w),E=l;i.modifiersData[n]=(e={},e[E]=I,e.centerOffset=I-m,e)}}function Vn(t){var e=t.state,i=t.options,n=i.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||Zt(e.elements.popper,o)&&(e.elements.arrow=o))}const Nn={name:"arrow",enabled:!0,phase:"main",fn:Dn,effect:Vn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pe(t){return t.split("-")[1]}var $n={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jn(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:ue(i*o)/o||0,y:ue(n*o)/o||0}}function xt(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,a=t.offsets,r=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,h=t.isFixed,f=a.x,u=f===void 0?0:f,y=a.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:u,y:g}):{x:u,y:g};u=v.x,g=v.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),O=B,b=k,w=window;if(c){var m=Ee(i),I="clientHeight",E="clientWidth";if(m===Z(i)&&(m=ie(i),J(m).position!=="static"&&r==="absolute"&&(I="scrollHeight",E="scrollWidth")),m=m,o===k||(o===B||o===N)&&s===Ie){b=V;var S=h&&m===w&&w.visualViewport?w.visualViewport.height:m[I];g-=S-n.height,g*=l?1:-1}if(o===B||(o===k||o===V)&&s===Ie){O=N;var R=h&&m===w&&w.visualViewport?w.visualViewport.width:m[E];u-=R-n.width,u*=l?1:-1}}var L=Object.assign({position:r},c&&$n),M=d===!0?jn({x:u,y:g},Z(i)):{x:u,y:g};if(u=M.x,g=M.y,l){var X;return Object.assign({},L,(X={},X[b]=C?"0":"",X[O]=x?"0":"",X.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+g+"px)":"translate3d("+u+"px, "+g+"px, 0)",X))}return Object.assign({},L,(e={},e[b]=C?g+"px":"",e[O]=x?u+"px":"",e.transform="",e))}function Fn(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=n===void 0?!0:n,s=i.adaptive,a=s===void 0?!0:s,r=i.roundOffsets,l=r===void 0?!0:r,c={placement:G(e.placement),variation:pe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,xt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,xt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fn,data:{}};var Ye={passive:!0};function Un(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=o===void 0?!0:o,a=n.resize,r=a===void 0?!0:a,l=Z(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,Ye)}),r&&l.addEventListener("resize",i.update,Ye),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Ye)}),r&&l.removeEventListener("resize",i.update,Ye)}}const zn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Un,data:{}};var Kn={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(t){return t.replace(/left|right|bottom|top/g,function(e){return Kn[e]})}var qn={start:"end",end:"start"};function It(t){return t.replace(/start|end/g,function(e){return qn[e]})}function Ue(t){var e=Z(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function ze(t){return he(ie(t)).left+Ue(t).scrollLeft}function _n(t,e){var i=Z(t),n=ie(t),o=i.visualViewport,s=n.clientWidth,a=n.clientHeight,r=0,l=0;if(o){s=o.width,a=o.height;var c=Wt();(c||!c&&e==="fixed")&&(r=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:r+ze(t),y:l}}function Jn(t){var e,i=ie(t),n=Ue(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=re(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=re(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),r=-n.scrollLeft+ze(t),l=-n.scrollTop;return J(o||i).direction==="rtl"&&(r+=re(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:r,y:l}}function Ke(t){var e=J(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function $t(t){return["html","body","#document"].indexOf(U(t))>=0?t.ownerDocument.body:D(t)&&Ke(t)?t:$t(Ae(t))}function xe(t,e){var i;e===void 0&&(e=[]);var n=$t(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=Z(n),a=o?[s].concat(s.visualViewport||[],Ke(n)?n:[]):n,r=e.concat(a);return o?r:r.concat(xe(Ae(a)))}function De(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Qn(t,e){var i=he(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Ct(t,e,i){return e===Mt?De(_n(t,i)):ae(e)?Qn(e,i):De(Jn(ie(t)))}function eo(t){var e=xe(Ae(t)),i=["absolute","fixed"].indexOf(J(t).position)>=0,n=i&&D(t)?Ee(t):t;return ae(n)?e.filter(function(o){return ae(o)&&Zt(o,n)&&U(o)!=="body"}):[]}function to(t,e,i,n){var o=e==="clippingParents"?eo(t):[].concat(e),s=[].concat(o,[i]),a=s[0],r=s.reduce(function(l,c){var d=Ct(t,c,n);return l.top=re(d.top,l.top),l.right=Pe(d.right,l.right),l.bottom=Pe(d.bottom,l.bottom),l.left=re(d.left,l.left),l},Ct(t,a,n));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function jt(t){var e=t.reference,i=t.element,n=t.placement,o=n?G(n):null,s=n?pe(n):null,a=e.x+e.width/2-i.width/2,r=e.y+e.height/2-i.height/2,l;switch(o){case k:l={x:a,y:e.y-i.height};break;case V:l={x:a,y:e.y+e.height};break;case N:l={x:e.x+e.width,y:r};break;case B:l={x:e.x-i.width,y:r};break;default:l={x:e.x,y:e.y}}var c=o?Ge(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case de:l[c]=l[c]-(e[d]/2-i[d]/2);break;case Ie:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function Ce(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=n===void 0?t.placement:n,s=i.strategy,a=s===void 0?t.strategy:s,r=i.boundary,l=r===void 0?xn:r,c=i.rootBoundary,d=c===void 0?Mt:c,h=i.elementContext,f=h===void 0?ye:h,u=i.altBoundary,y=u===void 0?!1:u,g=i.padding,v=g===void 0?0:g,x=Vt(typeof v!="number"?v:Nt(v,Oe)),C=f===ye?In:ye,O=t.rects.popper,b=t.elements[y?C:f],w=to(ae(b)?b:b.contextElement||ie(t.elements.popper),l,d,a),m=he(t.elements.reference),I=jt({reference:m,element:O,strategy:"absolute",placement:o}),E=De(Object.assign({},O,I)),S=f===ye?E:m,R={top:w.top-S.top+x.top,bottom:S.bottom-w.bottom+x.bottom,left:w.left-S.left+x.left,right:S.right-w.right+x.right},L=t.modifiersData.offset;if(f===ye&&L){var M=L[o];Object.keys(R).forEach(function(X){var K=[N,V].indexOf(X)>=0?1:-1,q=[k,V].indexOf(X)>=0?"y":"x";R[X]+=M[q]*K})}return R}function io(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,a=i.padding,r=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Ht:l,d=pe(n),h=d?r?bt:bt.filter(function(y){return pe(y)===d}):Oe,f=h.filter(function(y){return c.indexOf(y)>=0});f.length===0&&(f=h);var u=f.reduce(function(y,g){return y[g]=Ce(t,{placement:g,boundary:o,rootBoundary:s,padding:a})[G(g)],y},{});return Object.keys(u).sort(function(y,g){return u[y]-u[g]})}function no(t){if(G(t)===$e)return[];var e=Le(t);return[It(t),e,It(e)]}function oo(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=i.mainAxis,s=o===void 0?!0:o,a=i.altAxis,r=a===void 0?!0:a,l=i.fallbackPlacements,c=i.padding,d=i.boundary,h=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,y=u===void 0?!0:u,g=i.allowedAutoPlacements,v=e.options.placement,x=G(v),C=x===v,O=l||(C||!y?[Le(v)]:no(v)),b=[v].concat(O).reduce(function(j,$){return j.concat(G($)===$e?io(e,{placement:$,boundary:d,rootBoundary:h,padding:c,flipVariations:y,allowedAutoPlacements:g}):$)},[]),w=e.rects.reference,m=e.rects.popper,I=new Map,E=!0,S=b[0],R=0;R=0,q=K?"width":"height",P=Ce(e,{placement:L,boundary:d,rootBoundary:h,altBoundary:f,padding:c}),H=K?X?N:B:X?V:k;w[q]>m[q]&&(H=Le(H));var le=Le(H),_=[];if(s&&_.push(P[M]<=0),r&&_.push(P[H]<=0,P[le]<=0),_.every(function(j){return j})){S=L,E=!1;break}I.set(L,_)}if(E)for(var ce=y?3:1,fe=function($){var te=b.find(function(oe){var F=I.get(oe);if(F)return F.slice(0,$).every(function(me){return me})});if(te)return S=te,"break"},Q=ce;Q>0;Q--){var ee=fe(Q);if(ee==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}const so={name:"flip",enabled:!0,phase:"main",fn:oo,requiresIfExists:["offset"],data:{_skip:!1}};function Ot(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Et(t){return[k,N,V,B].some(function(e){return t[e]>=0})}function ro(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,a=Ce(e,{elementContext:"reference"}),r=Ce(e,{altBoundary:!0}),l=Ot(a,n),c=Ot(r,o,s),d=Et(l),h=Et(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const ao={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ro};function lo(t,e,i){var n=G(t),o=[B,k].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,a=s[0],r=s[1];return a=a||0,r=(r||0)*o,[B,N].indexOf(n)>=0?{x:r,y:a}:{x:a,y:r}}function co(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=o===void 0?[0,0]:o,a=Ht.reduce(function(d,h){return d[h]=lo(h,e.rects,s),d},{}),r=a[e.placement],l=r.x,c=r.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=a}const uo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:co};function ho(t){var e=t.state,i=t.name;e.modifiersData[i]=jt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const po={name:"popperOffsets",enabled:!0,phase:"read",fn:ho,data:{}};function fo(t){return t==="x"?"y":"x"}function mo(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=o===void 0?!0:o,a=i.altAxis,r=a===void 0?!1:a,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,h=i.padding,f=i.tether,u=f===void 0?!0:f,y=i.tetherOffset,g=y===void 0?0:y,v=Ce(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),x=G(e.placement),C=pe(e.placement),O=!C,b=Ge(x),w=fo(b),m=e.modifiersData.popperOffsets,I=e.rects.reference,E=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,R=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(m){if(s){var X,K=b==="y"?k:B,q=b==="y"?V:N,P=b==="y"?"height":"width",H=m[b],le=H+v[K],_=H-v[q],ce=u?-E[P]/2:0,fe=C===de?I[P]:E[P],Q=C===de?-E[P]:-I[P],ee=e.elements.arrow,j=u&&ee?Fe(ee):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Dt(),te=$[K],oe=$[q],F=we(0,I[P],j[P]),me=O?I[P]/2-ce-F-te-R.mainAxis:fe-F-te-R.mainAxis,ve=O?-I[P]/2+ce+F+oe+R.mainAxis:Q+F+oe+R.mainAxis,ge=e.elements.arrow&&Ee(e.elements.arrow),ke=ge?b==="y"?ge.clientTop||0:ge.clientLeft||0:0,qe=(X=L==null?void 0:L[b])!=null?X:0,Gt=H+me-qe-ke,Ut=H+ve-qe,_e=we(u?Pe(le,Gt):le,H,u?re(_,Ut):_);m[b]=_e,M[b]=_e-H}if(r){var Je,zt=b==="x"?k:B,Kt=b==="x"?V:N,se=m[w],Se=w==="y"?"height":"width",Qe=se+v[zt],et=se-v[Kt],Be=[k,B].indexOf(x)!==-1,tt=(Je=L==null?void 0:L[w])!=null?Je:0,it=Be?Qe:se-I[Se]-E[Se]-tt+R.altAxis,nt=Be?se+I[Se]+E[Se]-tt-R.altAxis:et,ot=u&&Be?Wn(it,se,nt):we(u?it:Qe,se,u?nt:et);m[w]=ot,M[w]=ot-se}e.modifiersData[n]=M}}const vo={name:"preventOverflow",enabled:!0,phase:"main",fn:mo,requiresIfExists:["offset"]};function go(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function yo(t){return t===Z(t)||!D(t)?Ue(t):go(t)}function bo(t){var e=t.getBoundingClientRect(),i=ue(e.width)/t.offsetWidth||1,n=ue(e.height)/t.offsetHeight||1;return i!==1||n!==1}function wo(t,e,i){i===void 0&&(i=!1);var n=D(e),o=D(e)&&bo(e),s=ie(e),a=he(t,o,i),r={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((U(e)!=="body"||Ke(s))&&(r=yo(e)),D(e)?(l=he(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=ze(s))),{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function xo(t){var e=new Map,i=new Set,n=[];t.forEach(function(s){e.set(s.name,s)});function o(s){i.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(r){if(!i.has(r)){var l=e.get(r);l&&o(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||o(s)}),n}function Io(t){var e=xo(t);return Tn.reduce(function(i,n){return i.concat(e.filter(function(o){return o.phase===n}))},[])}function Co(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Oo(t){var e=t.reduce(function(i,n){var o=i[n.name];return i[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,i},{});return Object.keys(e).map(function(i){return e[i]})}var St={placement:"bottom",modifiers:[],strategy:"absolute"};function Rt(){for(var t=arguments.length,e=new Array(t),i=0;i{this.currentActiveIndex=e,this.currentOrientation=i;const n=fn(this.hotspotsConfig,e,i);this.hideHotspots(),n.forEach(o=>this.updateAndShowHotspot(o,e))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=Fi(this.container),this.hotspotsConfig=bn(e),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.imageAspectRatio=n;const{containerSize:o}=e[0];this.initialContainerSize=o||[i.offsetWidth,i.offsetHeight],this.initHotspots(),this.observeContainerResize()}observeContainerResize(){this.resizeObserver=new ResizeObserver(()=>{const e=this.container.offsetWidth,i=this.container.offsetHeight;this.updateHotspotsForResize(e,i)}),this.resizeObserver.observe(this.container)}updateHotspotsForResize(e,i){this.hotspotsConfig=wn({newWidth:e,newHeight:i,initialContainerSize:this.initialContainerSize,imageAspectRatio:this.imageAspectRatio,hotspotsConfig:this.hotspotsConfig}),this.updateHotspotPosition(this.currentActiveIndex,this.currentOrientation)}showPopper({hotspotElement:e,content:i,id:n,keepOpen:o}){this.popperInstance&&this.popperInstance.instanceId!==n&&this.hidePopper();const s={placement:"top",modifiers:gn(this.container)};this.popper=yn(i,n),this.popper.setAttribute("data-show",""),this.popper.addEventListener("mouseenter",()=>{this.shouldHidePopper=!1}),this.popper.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),e.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),e.addEventListener("mouseenter",()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)}),this.popperInstance={...Ro(e,this.popper,s),keepOpen:o,instanceId:n}}checkAndHidePopper(){var e;this.shouldHidePopper&&!((e=this.popperInstance)!=null&&e.keepOpen)&&(this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},150))}hidePopper(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.popper&&(this.popper.removeAttribute("data-show"),setTimeout(()=>{this.popper&&this.popper.remove(),this.popper=null},200))}createHotspot(e){const{id:i,content:n,keepOpen:o,onClick:s}=e,a=mn(i);s&&(a.style.cursor="pointer"),a.onclick=r=>{r.stopPropagation(),s==null||s(r,this.popperInstance,i)},n&&a.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:a,content:n,id:i,keepOpen:o})),this.hotspotsContainer.appendChild(a)}hideHotspots(){this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach(e=>{e.style.opacity=0,e.style.pointerEvents="none"})}updateAndShowHotspot(e,i){const{positions:n,id:o}=e,{x:s,y:a}=n[i]??{},r=this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);r&&(r.style.translate=`${s}px ${a}px`,r.style.opacity=1,r.style.pointerEvents="all")}createAllHotspots(){this.hotspotsConfig.forEach(e=>this.createHotspot(e))}initHotspots(){this.createAllHotspots()}destroy(){this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotsContainer.innerHTML=""}}class Te{constructor(e,i,n){this.container=e,this.isClicked=!1,this.fullscreenView=!!n,this.imagesX=[],this.imagesY=[],this.devicePixelRatio=Math.round(window.devicePixelRatio||1),this.id=e.id,this.movementStart={x:0,y:0},this.draggingDirection=null,this.isReady=!1,this.currentZoomScale=1,this.touchDevice=cn(),this.canvasWorker=new hn,this.onMoveHandler=this.onMoveHandler.bind(this),this.destroy=this.destroy.bind(this),this.init(this.container,i)}mouseDown(e){if(!this.isReady||this.glass)return;const{pageX:i,pageY:n}=e;(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.movementStart={x:i,y:n},this.isClicked=!0,this.isDragging=!1}mouseUp(){this.isReady&&(this.isZoomed||this.showAllIcons(),this.movementStart={x:0,y:0},this.isClicked=!1,this.innerBox.style.cursor="grab")}drag(e,i){if(!this.isReady||!this.isClicked)return;const n=e-this.movementStart.x,o=i-this.movementStart.y;this.draggingDirection=ln({deltaX:n,deltaY:o,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const s=this.fullscreenView?document.body:this.container,a=this.dragSpeed/50,r=a*(this.amountX/s.offsetWidth),l=a*(this.amountY/s.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(n*r)):0,d=this.allowSpinY?Math.abs(Math.round(o*l)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&d!==0)&&(this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,d),this.movementStart={x:e,y:i},setTimeout(()=>{this.isDragging=!0},150))}mouseMove(e){!this.isReady||!this.isClicked&&!this.isZoomed||this.glass||(this.hideAllIcons(),this.drag(e.pageX,e.pageY),this.isZoomed&&this.applyZoom(e))}mouseClick(e){if(!(!this.isReady||this.isDragging)){if(this.glass&&this.magnified){this.removeGlass();return}this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(e)}}loadHigherQualityImages(e,i){const n=be(this.srcXConfig,e),o=this.allowSpinY?be(this.srcYConfig,e):null;ut({cdnPathX:n,cdnPathY:o,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(s,a)=>{this.imagesX=s,this.imagesY=a,i()}})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.hidePopper()}toggleZoom(e){if(this.isZoomed)this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},800);else{let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(e)},800)})}}removeZoom(){this.isZoomed=!1,this.updateView(),this.showAllIcons(),this.hideTransitionOverlay()}applyZoom(e){const{offsetX:i,offsetY:n}=tn(e,this.canvas,this.devicePixelRatio);this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.updateView(this.pointerZoom,i,n)}touchOutside(e){if(!this.glass)return;!this.canvas.contains(e.target)&&this.removeGlass()}touchStart(e){if(!this.isReady||e.touches.length>1||this.glass)return;const{pageX:i,pageY:n}=e.touches[0];(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.hideAllIcons(),this.movementStart={x:i,y:n},this.isClicked=!0}touchEnd(){this.isReady&&(this.showAllIcons(),this.movementStart={x:0,y:0},this.isClicked=!1)}touchMove(e){if(!this.isReady||!this.isClicked||this.glass)return;const{pageX:i,pageY:n}=e.touches[0];e.preventDefault(),this.drag(i,n)}keyDown(e){if(!this.isReady)return;const{keyCode:i}=e,n=this.keysReverse;switch(this.autoplay&&this.stopAutoplay(),gt(i,this.allowSpinY)&&this.hideAllIcons(),i){case 37:n?this.moveLeft():this.moveRight();break;case 39:n?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(e.preventDefault(),n?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(e.preventDefault(),n?this.moveBottom():this.moveTop());break}}keyUp(e){const{keyCode:i}=e;gt(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(e){this.orientation=A.X,this.activeImageX=(this.activeImageX+e)%this.amountX}moveActiveXIndexDown(e){this.orientation=A.X,this.activeImageX=(this.activeImageX-e+this.amountX)%this.amountX}moveActiveYIndexUp(e){this.orientation=A.Y,this.activeImageY=(this.activeImageY+e)%this.amountY}moveActiveYIndexDown(e){this.orientation=A.Y,this.activeImageY=(this.activeImageY-e+this.amountY)%this.amountY}moveRight(e,i=1){e&&this.activeImageX>=this.imagesX.length-1||(this.moveActiveXIndexUp(i),this.isZoomed||this.updateView())}moveLeft(e,i=1){e&&this.activeImageX<=0||(this.moveActiveXIndexDown(i),this.isZoomed||this.updateView())}moveTop(e,i=1){e&&this.activeImageY>=this.imagesY.length-1||(this.moveActiveYIndexUp(i),this.isZoomed||this.updateView())}moveBottom(e,i=1){e&&this.activeImageY<=0||(this.moveActiveYIndexDown(i),this.isZoomed||this.updateView())}onMoveHandler(e,i=1,n=1){e==="right"?this.moveRight(this.stopAtEdges,i):e==="left"?this.moveLeft(this.stopAtEdges,i):e==="up"?this.moveTop(this.stopAtEdges,n):e==="down"&&this.moveBottom(this.stopAtEdges,n)}updateView(e,i,n){const o=this.orientation===A.X?this.activeImageX:this.activeImageY,s=this.orientation===A.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(o,this.orientation),this.drawImageOnCanvas(s,e,i,n)}updatePercentageInLoader(e=0){this.loader&&(this.loader.innerText=e+"%")}adaptCanvasSize(e){const{naturalWidth:i,naturalHeight:n}=e;this.imageAspectRatio=i/n;const o=this.fullscreenView?window.innerWidth:this.canvas.clientWidth,s=this.fullscreenView?window.innerHeight:this.canvas.clientHeight;this.canvasWorker.postMessage({action:"adaptCanvasSize",devicePixelRatio:this.devicePixelRatio,imageAspectRatio:this.imageAspectRatio,containerWidth:o,containerHeight:s})}drawImageOnCanvas(e,i=1,n=0,o=0){this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:e,zoomScale:i,pointerX:n,pointerY:o})}pushImageToSet(e,i,n){n===A.X?this.imagesX[i]=e:this.imagesY[i]=e}calculatePercentage(){const e=this.amountX+this.amountY,i=this.imagesX.length+this.imagesY.length;return Math.round(i/e*100)}onImageLoad(e,i,n){this.pushImageToSet(e,i,n),this.updatePercentageInLoader(this.calculatePercentage())}onFirstImageLoaded(e,i){this.createContainers(e),this.adaptCanvasSize(i),this.drawImageOnCanvas(i)}onAllImagesLoaded(){this.addAllIcons(),this.hotspots&&(this.hotspotsInstance=new Yo(this.hotspots,this.innerBox,this.imageAspectRatio)),this.isReady=!0,this.amountX=this.imagesX.length,this.amountY=this.imagesY.length,this.activeImageX=this.autoplayReverse?this.amountX-1:0,this.activeImageY=this.autoplayReverse?this.amountY-1:0,this.autoplay&&(this.hideAllIcons(),dn(this.play.bind(this))())}magnify(e){e.stopPropagation();const{src:i}=this.orientation===A.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],o=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,s=Yi(i,o);this.showLoadingSpinner(),this.createGlass(),Ji(s,r=>{this.hideLoadingSpinner(),this.magnified=!0,en(e,this.innerBox,this.offset,r,this.glass,this.magnifier)})}openFullscreenModal(e){e.stopPropagation();const i=Ni(this.container);new Te(i,this.viewerConfig,!0)}closeFullscreenModal(e){e.stopPropagation(),document.body.removeChild(this.container.parentNode),window.document.body.style.overflow="visible"}play(){if(this.isClicked)return;this.hide360ViewCircleIcon();const e=this.speed*36/(this.amountX+this.amountY),i={left:this.moveLeft.bind(this),right:this.moveRight.bind(this),top:this.moveTop.bind(this),bottom:this.moveBottom.bind(this)};this.loopTimeoutId=window.setInterval(()=>{if(this.playOnce&&on({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}sn({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=an(this.spinDirection));const s=this.spinDirection==="y";nn({autoplayBehavior:this.autoplayBehavior,spinY:s,reversed:this.autoplayReverse,loopTriggers:i})},e)}stopAutoplay(){this.showAllIcons(),this.autoplay=!1,window.clearTimeout(this.loopTimeoutId)}destroy(){this.stopAutoplay(),this.hotspotsInstance&&this.hotspotsInstance.destroy();const e=this.container,i=e.cloneNode(!0),n=i.querySelector(".cloudimage-360-inner-box");i.removeChild(n),e.parentNode.replaceChild(i,e)}addInitialIcon(){this.initialIcon||(this.initialIcon=Ti(),this.innerBox.appendChild(this.initialIcon))}showInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=1)}hideInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=0)}createGlass(){this.hideAllIcons(),this.glass=document.createElement("div"),this.innerBox.appendChild(this.glass),this.innerBox.style.cursor="default"}removeGlass(){this.showAllIcons(),this.innerBox.removeChild(this.glass),this.glass=null,this.magnified=!1}addMagnifierIcon(){this.magnifier&&(this.magnifierIcon=Di(),this.magnifierIcon.onclick=this.magnify.bind(this),this.iconsContainer.appendChild(this.magnifierIcon))}showMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="visible",this.magnifierIcon.style.opacity=1)}hideMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="hidden",this.magnifierIcon.style.opacity=0)}addFullscreenIcon(){this.fullscreen&&(this.fullscreenIcon=Hi(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=Bi(),this.fullscreenCloseIcon.onclick=this.closeFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenCloseIcon)}showFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=1)}hideFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=0)}add360ViewCircleIcon(){this.view360CircleIcon||(this.view360CircleIcon=Pi(this.bottomCircleOffset),this.innerBox.appendChild(this.view360CircleIcon))}show360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=1)}hide360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=0)}addLoadingSpinner(){this.loadingSpinner=$i(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=ji(),this.innerBox.appendChild(this.transitionOverlay)}showTransitionOverlay(){this.transitionOverlay&&(this.hideAllIcons(),this.transitionOverlay.style.opacity=1)}hideTransitionOverlay(){this.transitionOverlay&&(this.transitionOverlay.style.opacity=0)}hideLoadingSpinner(){this.loadingSpinner&&(this.loadingSpinner.style.opacity=0)}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.innerBox.style.cursor="grab",this.pointerZoom&&(this.createTransitionOverlay(),this.addLoadingSpinner()),!this.fullscreenView&&!this.touchDevice&&this.addMagnifierIcon(),this.fullscreenView||this.addFullscreenIcon(),this.initialIconShown&&this.addInitialIcon(),this.bottomCircle||this.add360ViewCircleIcon()}showAllIcons(){this.showInitialIcon(),this.show360ViewCircleIcon(),this.showMagnifierIcon(),this.showFullscreenIcon()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideMagnifierIcon(),this.hideFullscreenIcon()}removeLoader(){this.loader&&(this.innerBox.removeChild(this.loader),this.loader=null)}attachEvents(e,i,n){e&&this.addMouseEvents(),i&&this.addTouchEvents(),n&&this.addKeyboardEvents()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=lt(this.mouseMove.bind(this),ct),this.boundMouseUp=this.mouseUp.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),document.addEventListener("mousemove",this.boundMouseMove),document.addEventListener("mouseup",this.boundMouseUp)}addTouchEvents(){this.boundTouchOutside=this.touchOutside.bind(this),this.boundTouchStart=this.touchStart.bind(this),this.boundTouchEnd=this.touchEnd.bind(this),this.boundTouchMove=lt(this.touchMove.bind(this),ct),document.addEventListener("touchstart",this.boundTouchOutside),this.container.addEventListener("touchstart",this.boundTouchStart),this.container.addEventListener("touchend",this.boundTouchEnd),this.container.addEventListener("touchmove",this.boundTouchMove)}addKeyboardEvents(){this.boundKeyDown=this.keyDown.bind(this),this.boundKeyUp=this.keyUp.bind(this),document.addEventListener("keydown",this.boundKeyDown),document.addEventListener("keyup",this.boundKeyUp)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),document.removeEventListener("mousemove",this.boundMouseMove),document.removeEventListener("mouseup",this.boundMouseUp)}removeTouchEvents(){document.removeEventListener("touchstart",this.boundTouchOutside),this.container.removeEventListener("touchstart",this.boundTouchStart),this.container.removeEventListener("touchend",this.boundTouchEnd),this.container.removeEventListener("touchmove",this.boundTouchMove)}removeKeyboardEvents(){document.removeEventListener("keydown",this.boundKeyDown),document.removeEventListener("keyup",this.boundKeyUp)}createContainers(e){this.iconsContainer=ht(this.innerBox),this.canvas=Ai(this.innerBox,e),this.loader=Vi(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),We(this.innerBox,".cloudimage-360-placeholder")}update(e){this.isReady&&(this.stopAutoplay(),We(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,e,!0),this.iconsContainer=ht(this.innerBox),this.onAllImagesLoaded())}init(e,i,n){const o=i?Ii(i):xi(e),{folder:s,apiVersion:a,filenameX:r,filenameY:l,imageListX:c,imageListY:d,indexZeroBase:h,amountX:f,amountY:u,draggable:y=!0,swipeable:g=!0,keys:v,keysReverse:x,bottomCircleOffset:C,autoplay:O,autoplayBehavior:b,playOnce:w,speed:m,autoplayReverse:I,fullscreen:E,magnifier:S,ciToken:R,ciFilters:L,ciTransformation:M,lazyload:X,dragSpeed:K,stopAtEdges:q,pointerZoom:P,imageInfo:H="black",initialIconShown:le,bottomCircle:_,hotspots:ce,dragReverse:fe}=o,Q={ciToken:R,ciFilters:L,ciTransformation:M},ee=c?JSON.parse(c):[],j=d?JSON.parse(d):[];if(this.viewerConfig=o,this.amountX=ee.length||f,this.amountY=j.length||u,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=I?this.amountX-1:0,this.activeImageY=I?this.amountY-1:0,this.bottomCircleOffset=C,this.autoplay=O,this.autoplayBehavior=b,this.playOnce=w,this.speed=m,this.autoplayReverse=I,this.fullscreen=E,this.magnifier=S>1?Math.min(S,5):0,this.dragSpeed=Math.max(K,50),this.stopAtEdges=q,this.ciParams=Q,this.apiVersion=a,this.pointerZoom=P>1?Math.min(P,5):null,this.keysReverse=x,this.info=H,this.keys=v,this.innerBox=this.innerBox??Wi(this.container),this.initialIconShown=le,this.bottomCircle=_,this.spinDirection=rn(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=fe,this.hotspots=ce,this.srcXConfig={folder:s,filename:r,imageList:ee,container:e,innerBox:this.innerBox,apiVersion:a,ciParams:Q,lazyload:X,amount:this.amountX,indexZeroBase:h,autoplayReverse:I},this.srcYConfig={...this.srcXConfig,filename:l,imageList:j,orientation:A.Y,amount:this.amountY},n&&this.removeEvents(),this.attachEvents(y,g,v),n)return;const $=(this.fullscreenView?document.body:this.container).offsetWidth,te=this.allowSpinX&&!ee.length?be(this.srcXConfig,$):null,oe=this.allowSpinY&&!j.length?be(this.srcYConfig,$):null,F=me=>{ut({cdnPathX:te,cdnPathY:oe,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(ve,ge,ke)=>this.onImageLoad(ve,ge,ke),onFirstImageLoad:ve=>this.onFirstImageLoaded(me,ve),onAllImagesLoad:this.onAllImagesLoaded.bind(this)})};this.allowSpinX?ft(te,this.srcXConfig,F):this.allowSpinY&&ft(oe,this.srcYConfig,F)}}class Ft{constructor(){this.views=new Map,this.initAll=this.initAll.bind(this),this.getViews=this.getViews.bind(this)}generateId(){return`ci360-${Math.random().toString(36).slice(2,11)}`}init(e,i,n){if(!e)return;const o=e.id||this.generateId();e.id||(e.id=o);const s=new Te(e,i,n);return this.views.set(o,s),s}initAll(e="cloudimage-360"){[...document.querySelectorAll(`.${e}`)].filter(Boolean).forEach(n=>{const o=n.id||this.generateId();n.id||(n.id=o);const s=new Te(n);this.views.set(o,s)})}destroy(e){const i=this.getViewById(e);i&&(i.destroy(),this.views.delete(e))}destroyAll(){this.views.forEach(e=>{e.destroy()}),this.views.clear()}getViewById(e){return this.views.get(e)}getViews(){return Array.from(this.views.values())}updateView(e,i){const n=this.getViewById(e),o={...n.viewerConfig,...i};if(Ci(n.viewerConfig,i)){n.destroy();const a=document.getElementById(e);this.init(a,o)}else n.update(o);return n}}window.CI360=Ft;const Lo=[{id:"hotspot-1",orientation:"x",containerSize:[1170,663],positions:{0:{x:527,y:319},1:{x:527,y:319},2:{x:527,y:null},3:{x:498,y:null},4:{x:470,y:null},5:{x:441,y:null},73:{x:555,y:null},72:{x:586,y:null},71:{x:614,y:null},70:{x:641,y:null},69:{x:668,y:null},68:{x:692,y:null},67:{x:715,y:null},66:{x:736,y:null},65:{x:756,y:null},64:{x:773,y:null},63:{x:787,y:null}},content:'
Info about Hotspot 1
'},{id:"hotspot-2",orientation:"x",containerSize:[1220,680],positions:{73:{x:355,y:474},74:{x:355,y:null},72:{x:341,y:479},71:{x:336,y:null},70:{x:332,y:null},69:{x:327,y:null},68:{x:326,y:null},67:{x:327,y:null},66:{x:331,y:null},65:{x:334,y:null},64:{x:336,y:null},63:{x:347,y:474}},content:'
Info about Hotspot 2
'},{id:"hotspot-3",orientation:"x",containerSize:[1220,680],positions:{11:{x:683,y:151},12:{x:683,y:null},13:{x:683,y:null},14:{x:683,y:null},15:{x:683,y:null},16:{x:683,y:null},17:{x:681,y:152},18:{x:677,y:156},19:{x:671,y:159},20:{x:665,y:163},21:{x:656,y:168},22:{x:650,y:171},23:{x:643,y:176},24:{x:635,y:178},25:{x:628,y:181},26:{x:621,y:null},27:{x:610,y:null},28:{x:598,y:null},29:{x:588,y:null},30:{x:578,y:null},31:{x:570,y:176},32:{x:560,y:173}},content:'
Info about Hotspot 3
'},{id:"hotspot-4",orientation:"x",containerSize:[1220,680],positions:{6:{x:607,y:246},7:{x:619,y:null},8:{x:630,y:null},9:{x:637,y:null},10:{x:642,y:null}},content:'
Info about Hotspot 4
'}],Xo={folder:"https://scaleflex.cloudimg.io/v7/demo/360-nike/",filenameX:"nike-{index}.jpg",filenameY:"nike-y-{index}.jpg",amountX:"35",amountY:"36",autoplayBehavior:"spin-xy"},Po={folder:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",filenameX:"{index}.jpg",amountX:"233",amountY:void 0,filenameY:void 0},Yt={folder:{label:"data-folder",value:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",isRequired:!0,isUrl:!0},filenameX:{label:"data-filename-x",value:"{index}.jpg"},filenameY:{label:"data-filename-y"},amountY:{label:"data-amount-y",isRequired:!1},amountX:{label:"data-amount-x",value:233,isRequired:!0},speed:{label:"data-speed",value:100,isRequired:!1},dragSpeed:{label:"data-drag-speed",value:120,isRequired:!1},autoplay:{label:"data-autoplay",isRequired:!1},pointerZoom:{label:"data-pointer-zoom",value:1.5,isRequired:!1},autoplayBehavior:{label:"data-autoplay-behavior",value:"spin-xy",isRequired:!1},magnifier:{label:"data-magnifier",value:1.5,isRequired:!1},autoplayReverse:{label:"data-autoplay-reverse",isRequired:!1},playOnce:{label:"data-play-once",isRequired:!1},keys:{label:"data-keys",isRequired:!1},keysReverse:{label:"data-keys-reverse",isRequired:!1},draggable:{label:"data-draggable",isRequired:!1},swipeable:{label:"data-swipeable",isRequired:!1},fullscreen:{label:"data-fullscreen",isRequired:!1}},Lt={NAME:"#7B9200",URL:"#2D88CB"},To=["folder","class"],Ao=document.getElementById("spin-directions"),Xt=document.getElementById("copy-text"),Pt=document.getElementById("code-block"),Tt=document.getElementById("code-wrapper"),Ve=document.getElementById("pointer-zoom-selector"),ko=document.querySelector(".copy-button"),Bo=document.querySelector(".output-code"),Mo=document.getElementById("pointer-checkbox"),Ho=document.querySelectorAll(".plugin-option"),Ne=document.getElementById("x-images-selector"),Wo=document.getElementById("images-y"),Zo=document.getElementById("spin-speed"),Do=document.getElementById("drag-speed"),z=new Ft;function Vo(t){const i=t.target.value==="Y",n=i?Xo:Po,o=z.updateView("demo-generator",n);Ne.value=i?35:233,Wo.style.display=i?"block":"none",Ne.disabled=i,ne(o.viewerConfig)}function No(t){const{value:e}=t.target,i=z.updateView("demo-generator",{dragSpeed:parseInt(e,10)});ne(i.viewerConfig)}function $o(t){const{value:e}=t.target,i=z.updateView("demo-generator",{speed:parseInt(e,10)});ne(i.viewerConfig)}function jo(){navigator.clipboard.writeText(Bo.innerText),Xt.innerHTML="Copied",setTimeout(()=>{Xt.innerHTML="Copy"},500)}function Fo(t){const{value:e}=t.target,i=z.updateView("demo-generator",{amountX:parseInt(e,10)});ne(i.viewerConfig)}function Go(t){const e=t.target.checked,i=parseFloat(Ve.value,10),n=z.updateView("demo-generator",{pointerZoom:e?i:!1});Ve.disabled=!e,ne(n.viewerConfig)}function Uo(t){const{value:e}=t.target,i=z.updateView("demo-generator",{pointerZoom:parseFloat(e,10)});ne(i.viewerConfig)}function zo(t){const e=t.target.checked,i=t.target.getAttribute("data-plugin-property"),n=t.target.getAttribute("data-plugin-value");let o=e;n&&(o=e?JSON.parse(n):void 0);const s=z.updateView("demo-generator",{[i]:o});ne(s.viewerConfig)}function ne(t){Pt.innerText="",Object.keys(t).filter(n=>Yt[n]&&!!t[n]).forEach(n=>{const{label:o}=Yt[n],s=document.createElement("div"),a=document.createElement("span"),r=document.createElement("span");a.innerText=o,a.style.color=Lt.NAME,To.includes(n)&&(r.style.color=Lt.URL),s.appendChild(a),r.innerText=`"${t[n]}"`,s.innerHTML+="=",s.appendChild(r),Pt.appendChild(s),Tt.scrollTop=Tt.scrollHeight})}Do.addEventListener("change",No);Zo.addEventListener("change",$o);Mo.addEventListener("change",Go);Ne.addEventListener("change",Fo);Ve.addEventListener("change",Uo);Ao.addEventListener("change",Vo);ko.addEventListener("click",jo);Ho.forEach(t=>{t.addEventListener("change",zo)});const Ko=document.getElementById("gurkha-suv"),qo={folder:"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/",filenameX:"orange-{index}.jpg",amountX:73,lazyload:!0,speed:120,pointerZoom:2,responsive:"scaleflex",autoplay:!0,fullscreen:!0,magnifier:3,playOnce:!0,hotspots:Lo};z.init(Ko,qo);z.initAll();const _o=z.getViewById("demo-generator");ne(_o.viewerConfig); diff --git a/index.html b/index.html index c486627..7499da2 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ rel="stylesheet" /> JS-Cloudimage-360-view - + @@ -438,34 +438,11 @@

Customize

-
- -
-
- -